From 101160baecad689512fc1d78feaa1de462827944 Mon Sep 17 00:00:00 2001 From: Jeff Gilbert Date: Wed, 1 Oct 2014 17:05:34 -0700 Subject: [PATCH] Bug 1048108 - Don't require alpha on ANGLE. - r=kamidphish --- gfx/gl/SharedSurfaceANGLE.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/gfx/gl/SharedSurfaceANGLE.cpp b/gfx/gl/SharedSurfaceANGLE.cpp index 496e161c0c2..7c871ae5aea 100644 --- a/gfx/gl/SharedSurfaceANGLE.cpp +++ b/gfx/gl/SharedSurfaceANGLE.cpp @@ -289,16 +289,26 @@ ChooseConfig(GLContext* gl, GLLibraryEGL* egl, const SurfaceCaps& caps) 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) {