Bug 727311 - Disable BGRA readback support in GLES 2. r=bjacob
authorJoe Drew <joe@drew.ca>
Sat, 18 Feb 2012 18:12:33 -0800
changeset 92490 532171d0e792d4f5cbdc06465beb2065f76b5d53
parent 92489 1705e50937fc9cb1344ed3272e14a00636b08730
child 92491 0a5dbb35bf458a6c3745e5f5678714c075fde5cc
push idunknown
push userunknown
push dateunknown
reviewersbjacob
bugs727311
milestone13.0a1
Bug 727311 - Disable BGRA readback support in GLES 2. r=bjacob
gfx/gl/GLContext.cpp
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -506,18 +506,24 @@ GLContext::InitWithPrefix(const char *pr
 
         fGetIntegerv(LOCAL_GL_VIEWPORT, v);
         mViewportStack.AppendElement(nsIntRect(v[0], v[1], v[2], v[3]));
 
         fGetIntegerv(LOCAL_GL_MAX_TEXTURE_SIZE, &mMaxTextureSize);
         fGetIntegerv(LOCAL_GL_MAX_RENDERBUFFER_SIZE, &mMaxRenderbufferSize);
         mMaxTextureImageSize = mMaxTextureSize;
 
+        // BGRA ReadPixels support - in particular, what is returned for
+        // GL_IMPLEMENTATION_COLOR_READ_FORMAT et al - is only guaranteed to be
+        // accurate for what's currently bound to the context. It seems that,
+        // after we initialize, we bind something incompatible with the BGRA
+        // pixel format on at least some devices.
+        // For now, just disable this code altogether.
         mSupport_ES_ReadPixels_BGRA_UByte = false;
-        if (mIsGLES2) {
+        if (false) {
             if (IsExtensionSupported(gl::GLContext::EXT_bgra)) {
                 mSupport_ES_ReadPixels_BGRA_UByte = true;
             } else if (IsExtensionSupported(gl::GLContext::EXT_read_format_bgra) ||
                        IsExtensionSupported(gl::GLContext::IMG_read_format)) {
                 GLint auxFormat = 0;
                 GLint auxType = 0;
 
                 fGetIntegerv(LOCAL_GL_IMPLEMENTATION_COLOR_READ_FORMAT, &auxFormat);