Bug 1909372 - Remove WebGLContextAttributes.colorSpace. r=gfx-reviewers,webidl,lsalzman,saschanaz

The WebGL spec never added this, and WebGL expects this to change via
drawingBufferColorSpace, so I don't think we should push for a spec
addition for .colorSpace.

Differential Revision: https://phabricator.services.mozilla.com/D217350
This commit is contained in:
Kelsey Gilbert
2024-07-23 18:02:41 +00:00
parent aedcd3706c
commit ef3160faba
7 changed files with 16 additions and 32 deletions

View File

@@ -741,16 +741,7 @@ void ClientWebGLContext::GetCanvas(
void ClientWebGLContext::SetDrawingBufferColorSpace(
const dom::PredefinedColorSpace val) {
mDrawingBufferColorSpace = val;
// Just in case, update in Options too.
// Why not treat our WebGLContextOptions as the source of truth? Well,
// mNotLost is lost on context-loss, so we'd lose any setting we had here if
// that happens.
if (mNotLost) {
mNotLost->info.options.colorSpace = mDrawingBufferColorSpace;
}
Run<RPROC(SetDrawingBufferColorSpace)>(mDrawingBufferColorSpace);
Run<RPROC(SetDrawingBufferColorSpace)>(*mDrawingBufferColorSpace);
}
void ClientWebGLContext::GetContextAttributes(
@@ -1075,9 +1066,6 @@ ClientWebGLContext::SetContextOptions(JSContext* cx,
if (attributes.mAntialias.WasPassed()) {
newOpts.antialias = attributes.mAntialias.Value();
}
if (attributes.mColorSpace.WasPassed()) {
newOpts.colorSpace = attributes.mColorSpace.Value();
}
// Don't do antialiasing if we've disabled MSAA.
if (!StaticPrefs::webgl_msaa_samples()) {