Bug 1048108 - Don't require alpha on ANGLE. - r=kamidphish
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 01 Oct 2014 17:05:34 -0700
changeset 231495 45472bfa3f16cc208c8c0c0a30ded6bea2b75b67
parent 231494 0155f960161f6e71af9eb5d2e8657cf00810ec6d
child 231496 e17f9996e092551057e8a57a5743702b3f47dda1
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskamidphish
bugs1048108
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1048108 - Don't require alpha on ANGLE. - r=kamidphish
gfx/gl/SharedSurfaceANGLE.cpp
--- a/gfx/gl/SharedSurfaceANGLE.cpp
+++ b/gfx/gl/SharedSurfaceANGLE.cpp
@@ -284,26 +284,36 @@ ChooseConfig(GLContext* gl, GLLibraryEGL
         return EGL_NO_CONFIG;
     }
 
     // The requests passed to ChooseConfig are treated as minimums. If you ask
     // for 0 bits of alpha, we might still get 8 bits.
     EGLConfig config = EGL_NO_CONFIG;
     for (int i = 0; i < foundConfigs; i++) {
         EGLConfig cur = configs[i];
-        if (DoesAttribBitsMatchCapBool(egl, cur, LOCAL_EGL_ALPHA_SIZE,
-                                       caps.alpha) &&
-            DoesAttribBitsMatchCapBool(egl, cur, LOCAL_EGL_DEPTH_SIZE,
-                                       caps.depth) &&
-            DoesAttribBitsMatchCapBool(egl, cur, LOCAL_EGL_STENCIL_SIZE,
-                                       caps.stencil))
+        if (!DoesAttribBitsMatchCapBool(egl, cur, LOCAL_EGL_DEPTH_SIZE,
+                                        caps.depth) ||
+            !DoesAttribBitsMatchCapBool(egl, cur, LOCAL_EGL_STENCIL_SIZE,
+                                        caps.stencil))
         {
-            config = cur;
-            break;
+            continue;
         }
+
+        // We can't enforce alpha on ANGLE yet because of:
+        // https://code.google.com/p/angleproject/issues/detail?id=764
+        if (!gl->IsANGLE()) {
+            if (!DoesAttribBitsMatchCapBool(egl, cur, LOCAL_EGL_ALPHA_SIZE,
+                                            caps.alpha))
+            {
+                continue;
+            }
+        }
+
+        config = cur;
+        break;
     }
 
     if (config == EGL_NO_CONFIG) {
         NS_WARNING("No acceptable EGLConfig found.");
         return EGL_NO_CONFIG;
     }
 
     if (gl->DebugMode()) {