Bug 1324604 - Only query IMPLEMENTATION_COLOR_READ_FORMAT/TYPE on actual GLES. (flattened) - r=daoshengmu. a=gchang
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 19 Dec 2016 16:37:52 -0800
changeset 368193 1c27570771fc2d7f00993a6e9cf22f18bd6d97aa
parent 368192 80b4d086f74ec36e76a312e57258721ad1f6f99a
child 368194 06c0d166c9b74d4929f98ba6cbae425c48dc7a05
push id1369
push userjlorenzo@mozilla.com
push dateMon, 27 Feb 2017 14:59:41 +0000
treeherdermozilla-release@d75a1dba431f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaoshengmu, gchang
bugs1324604
milestone52.0a2
Bug 1324604 - Only query IMPLEMENTATION_COLOR_READ_FORMAT/TYPE on actual GLES. (flattened) - r=daoshengmu. a=gchang MozReview-Commit-ID: 3KFbKZremf2
dom/canvas/WebGLContextGL.cpp
dom/canvas/WebGLContextState.cpp
dom/canvas/test/webgl-conf/generated-mochitest.ini
dom/canvas/test/webgl-conf/mochitest-errata.ini
--- a/dom/canvas/WebGLContextGL.cpp
+++ b/dom/canvas/WebGLContextGL.cpp
@@ -1462,17 +1462,17 @@ ValidateReadPixelsFormatAndType(const we
     }
 
     if (pi.type == LOCAL_GL_UNSIGNED_INT_24_8) {
         webgl->ErrorInvalidEnum("readPixels: Invalid type: 0x%04x", pi.type);
         return false;
     }
 
     MOZ_ASSERT(gl->IsCurrent());
-    if (gl->IsSupported(gl::GLFeature::ES2_compatibility)) {
+    if (gl->IsGLES()) {
         const auto auxFormat = gl->GetIntAs<GLenum>(LOCAL_GL_IMPLEMENTATION_COLOR_READ_FORMAT);
         const auto auxType = gl->GetIntAs<GLenum>(LOCAL_GL_IMPLEMENTATION_COLOR_READ_TYPE);
 
         if (auxFormat && auxType &&
             pi.format == auxFormat && pi.type == auxType)
         {
             return true;
         }
--- a/dom/canvas/WebGLContextState.cpp
+++ b/dom/canvas/WebGLContextState.cpp
@@ -397,32 +397,37 @@ WebGLContext::GetParameter(JSContext* cx
 
         case LOCAL_GL_IMPLEMENTATION_COLOR_READ_TYPE: {
             const webgl::FormatUsageInfo* usage;
             uint32_t width, height;
             if (!ValidateCurFBForRead(funcName, &usage, &width, &height))
                 return JS::NullValue();
 
             GLint i = 0;
-            if (gl->IsSupported(gl::GLFeature::ES2_compatibility)) {
+            if (gl->IsGLES()) {
+                // ES2_compatibility always returns UNSIGNED_BYTE here, so
+                // branch on actual IsGLES().
+                // Also OSX+NV generates an error here.
                 gl->fGetIntegerv(pname, &i);
             } else {
                 i = LOCAL_GL_UNSIGNED_BYTE;
             }
-
             return JS::NumberValue(uint32_t(i));
         }
         case LOCAL_GL_IMPLEMENTATION_COLOR_READ_FORMAT: {
             const webgl::FormatUsageInfo* usage;
             uint32_t width, height;
             if (!ValidateCurFBForRead(funcName, &usage, &width, &height))
                 return JS::NullValue();
 
             GLint i = 0;
-            if (gl->IsSupported(gl::GLFeature::ES2_compatibility)) {
+            if (gl->IsGLES()) {
+                // ES2_compatibility always returns UNSIGNED_BYTE here, so
+                // branch on actual IsGLES().
+                // Also OSX+NV generates an error here.
                 gl->fGetIntegerv(pname, &i);
             } else {
                 i = LOCAL_GL_RGBA;
             }
 
             // OpenGL ES 3.0.4 p112 Table 3.2 shows that read format SRGB_ALPHA is
             // not supported. And if internal format of fbo is SRGB8_ALPHA8, then
             // IMPLEMENTATION_COLOR_READ_FORMAT is SRGB_ALPHA which is not supported
--- a/dom/canvas/test/webgl-conf/generated-mochitest.ini
+++ b/dom/canvas/test/webgl-conf/generated-mochitest.ini
@@ -4581,17 +4581,16 @@ skip-if = (os == 'android' || os == 'lin
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance2__samplers__sampler-drawing-test.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance2__samplers__samplers.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance2__state__gl-enum-tests.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance2__state__gl-get-calls.html]
-fail-if = (os == 'mac')
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance2__state__gl-getstring.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance2__state__gl-object-get-calls.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance2__transform_feedback__transform_feedback.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance2__vertex_arrays__vertex-array-object.html]
@@ -5789,18 +5788,17 @@ skip-if = (os == 'android' || os == 'lin
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance__rendering__simple.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance__rendering__triangle.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance__state__gl-enable-enum-test.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance__state__gl-get-calls.html]
-skip-if = (os == 'mac' && debug) || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
-fail-if = (os == 'mac')
+skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance__state__gl-geterror.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance__state__gl-initial-state.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance__state__state-uneffected-after-compositing.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance__textures__misc__copy-tex-image-2d-formats.html]
 skip-if = (os == 'mac') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
--- a/dom/canvas/test/webgl-conf/mochitest-errata.ini
+++ b/dom/canvas/test/webgl-conf/mochitest-errata.ini
@@ -531,35 +531,27 @@ fail-if = (os == 'mac' && os_version == 
 fail-if = (os == 'mac' && os_version == '10.8')
 [generated/test_conformance__glsl__variables__gl-pointcoord.html]
 fail-if = (os == 'mac' && os_version == '10.8')
 [generated/test_conformance__limits__gl-max-texture-dimensions.html]
 fail-if = (os == 'mac' && os_version == '10.8')
 
 ####################
 # failure on OSX
-[generated/test_2_conformance2__state__gl-get-calls.html]
-fail-if = (os == 'mac')
 [generated/test_conformance__extensions__angle-instanced-arrays.html]
 fail-if = (os == 'mac')
 [generated/test_conformance__glsl__misc__shaders-with-invariance.html]
 fail-if = (os == 'mac')
 
 [generated/test_2_conformance2__extensions__ext-color-buffer-float.html]
 skip-if = (os == 'mac' && debug)
 [generated/test_2_conformance__limits__gl-line-width.html]
 skip-if = (os == 'mac')
 [generated/test_2_conformance__misc__type-conversion-test.html]
 skip-if = (os == 'mac' && debug)
-[generated/test_2_conformance__state__gl-get-calls.html]
-# Hit MOZ_GL_DEBUG_ABORT_ON_ERROR on debug build
-fail-if = (os == 'mac')
-skip-if = (os == 'mac' && debug)
-
-
 
 ########################################################################
 ########################################################################
 # Win
 [generated/test_2_conformance__ogles__GL__built_in_varying_array_out_of_bounds__built_in_varying_array_out_of_bounds_001_to_001.html]
 # time out crash
 skip-if = (os == 'win')
 [generated/test_conformance__ogles__GL__built_in_varying_array_out_of_bounds__built_in_varying_array_out_of_bounds_001_to_001.html]