From 900c3cc6b526616d35994fda526e7166f13cd12d Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 18 Sep 2018 11:48:34 +0200 Subject: [PATCH] Implement gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL) --- components/script/dom/webglrenderingcontext.rs | 10 +++++++++- .../meta/conformance/misc/webgl-specific.html.ini | 11 ----------- 2 files changed, 9 insertions(+), 12 deletions(-) delete mode 100644 tests/wpt/webgl/meta/conformance/misc/webgl-specific.html.ini diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index ac2ef4ea218..fadfb42f668 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -1235,7 +1235,15 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { constants::UNPACK_ALIGNMENT => { return UInt32Value(self.texture_unpacking_alignment.get()); }, - _ => {} + constants::UNPACK_COLORSPACE_CONVERSION_WEBGL => { + let unpack = self.texture_unpacking_settings.get(); + return UInt32Value(if unpack.contains(TextureUnpacking::CONVERT_COLORSPACE) { + constants::BROWSER_DEFAULT_WEBGL + } else { + constants::NONE + }); + }, + _ => {}, } // Handle any MAX_ parameters by retrieving the limits that were stored diff --git a/tests/wpt/webgl/meta/conformance/misc/webgl-specific.html.ini b/tests/wpt/webgl/meta/conformance/misc/webgl-specific.html.ini deleted file mode 100644 index 2a09e0f1a62..00000000000 --- a/tests/wpt/webgl/meta/conformance/misc/webgl-specific.html.ini +++ /dev/null @@ -1,11 +0,0 @@ -[webgl-specific.html] - bug: https://github.com/servo/servo/issues/20552 - [WebGL test #25: getError expected: NO_ERROR. Was INVALID_ENUM : set/get UNPACK_COLORSPACE_CONVERSION_WEBGL should generate no error] - expected: FAIL - - [WebGL test #23: gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL) should be 37444 (of type number). Was null (of type object).] - expected: FAIL - - [WebGL test #24: gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL) should be 0 (of type number). Was null (of type object).] - expected: FAIL -