Backout a516a86f854d (bug 767064) due to Android M1 orange.
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 09 Jul 2012 21:49:50 -0400
changeset 98743 02b26fb307b4b5a4d3ba59a413bd24b7145c3e51
parent 98742 7f65a44991de788f8b6598a9212d88c1a689dab5
child 98751 8bba6a37776e41e0f8aa0785bcd0cc8dab7d00ae
child 98803 b9c7a7f3335c2b619bfcc0a20692e673148bda84
push id23078
push userryanvm@gmail.com
push dateTue, 10 Jul 2012 02:31:39 +0000
treeherdermozilla-central@02b26fb307b4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs767064
milestone16.0a1
backs outa516a86f854da9a92976566878010c820458b22d
first release with
nightly linux32
02b26fb307b4 / 16.0a1 / 20120710030551 / files
nightly linux64
02b26fb307b4 / 16.0a1 / 20120710030551 / files
nightly mac
02b26fb307b4 / 16.0a1 / 20120710030551 / files
nightly win32
02b26fb307b4 / 16.0a1 / 20120710030551 / files
nightly win64
02b26fb307b4 / 16.0a1 / 20120710030551 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout a516a86f854d (bug 767064) due to Android M1 orange.
content/canvas/src/WebGLContext.cpp
gfx/gl/GLContext.cpp
gfx/thebes/gfxPlatform.cpp
--- a/content/canvas/src/WebGLContext.cpp
+++ b/content/canvas/src/WebGLContext.cpp
@@ -402,43 +402,26 @@ WebGLContext::SetDimensions(PRInt32 widt
     }
 
     if (mOptions.stencil) {
         format.stencil = 8;
         format.minStencil = 8;
     }
 
     if (!mOptions.alpha) {
+        // Select 565; we won't/shouldn't hit this on the desktop,
+        // but let mobile know we're ok with it.
+        format.red = 5;
+        format.green = 6;
+        format.blue = 5;
+
         format.alpha = 0;
         format.minAlpha = 0;
     }
 
-    // Don't do this on Windows, since we might get a 565 config from ANGLE
-    // and end up causing problems with a surface depth mismatch
-#ifndef XP_WIN
-    if (gfxPlatform::GetPlatform()->GetScreenDepth() == 16) {
-        // Select 4444 or 565 on 16-bit displays; we won't/shouldn't
-        // hit this on the desktop, but let mobile know we're ok with
-        // it.  Note that we don't just set this to 4440 if no alpha,
-        // because that might cause us to choose 4444 anyway and we
-        // don't want that.
-        if (mOptions.alpha) {
-            format.red = 4;
-            format.green = 4;
-            format.blue = 4;
-            format.alpha = 4;
-        } else {
-            format.red = 5;
-            format.green = 6;
-            format.blue = 5;
-            format.alpha = 0;
-        }
-    }
-#endif
-
     bool forceMSAA =
         Preferences::GetBool("webgl.msaa-force", false);
 
     PRInt32 status;
     nsCOMPtr<nsIGfxInfo> gfxInfo = do_GetService("@mozilla.org/gfx/info;1");
     if (mOptions.antialias &&
         gfxInfo &&
         NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_WEBGL_MSAA, &status))) {
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -1273,58 +1273,45 @@ PRUint32 TiledTextureImage::GetTileCount
     return mImages.Length();
 }
 
 GLContext::GLFormats
 GLContext::ChooseGLFormats(ContextFormat& aCF)
 {
     GLFormats formats;
 
-    // If we're on ES2 hardware and we have an explicit request for 16 bits of color or less
-    // OR we don't support full 8-bit color, return a 4444 or 565 format.
-    if (mIsGLES2 && (aCF.colorBits() <= 16 || !IsExtensionSupported(OES_rgb8_rgba8))) {
-        if (aCF.alpha) {
+    if (aCF.alpha) {
+        if (mIsGLES2 && IsExtensionSupported(EXT_texture_format_BGRA8888)) {
+            formats.texColor = LOCAL_GL_BGRA;
+        } else {
             formats.texColor = LOCAL_GL_RGBA;
-            formats.texColorType = LOCAL_GL_UNSIGNED_SHORT_4_4_4_4;
+        }
+
+        if (mIsGLES2 && !IsExtensionSupported(OES_rgb8_rgba8)) {
             formats.rbColor = LOCAL_GL_RGBA4;
-
             aCF.red = aCF.green = aCF.blue = aCF.alpha = 4;
         } else {
-            formats.texColor = LOCAL_GL_RGB;
-            formats.texColorType = LOCAL_GL_UNSIGNED_SHORT_5_6_5;
+            formats.rbColor = LOCAL_GL_RGBA8;
+            aCF.red = aCF.green = aCF.blue = aCF.alpha = 8;
+        }
+    } else {
+        formats.texColor = LOCAL_GL_RGB;
+        if (mIsGLES2 && !IsExtensionSupported(OES_rgb8_rgba8)) {
             formats.rbColor = LOCAL_GL_RGB565;
-
             aCF.red = 5;
             aCF.green = 6;
             aCF.blue = 5;
-            aCF.alpha = 0;
-        }   
-    } else {
-        formats.texColorType = LOCAL_GL_UNSIGNED_BYTE;
-
-        if (aCF.alpha) {
-            // prefer BGRA8888 on ES2 hardware; if the extension is supported, it
-            // should be faster.
-            if (mIsGLES2 && IsExtensionSupported(EXT_texture_format_BGRA8888)) {
-                formats.texColor = LOCAL_GL_BGRA;
-            } else {
-                formats.texColor = LOCAL_GL_RGBA;
-            }
-
-            formats.rbColor = LOCAL_GL_RGBA8;
-
-            aCF.red = aCF.green = aCF.blue = aCF.alpha = 8;
         } else {
-            formats.texColor = LOCAL_GL_RGB;
             formats.rbColor = LOCAL_GL_RGB8;
-
             aCF.red = aCF.green = aCF.blue = 8;
-            aCF.alpha = 0;
         }
+        aCF.alpha = 0;
     }
+    formats.texColorType = LOCAL_GL_UNSIGNED_BYTE;
+
 
     GLsizei samples = aCF.samples;
 
     GLsizei maxSamples = 0;
     if (SupportsFramebufferMultisample())
         fGetIntegerv(LOCAL_GL_MAX_SAMPLES, (GLint*)&maxSamples);
     samples = NS_MIN(samples, maxSamples);
 
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -1453,17 +1453,17 @@ gfxPlatform::GetLog(eGfxLog aWhichLog)
 #else
     return nsnull;
 #endif
 }
 
 int
 gfxPlatform::GetScreenDepth() const
 {
-    NS_WARNING("GetScreenDepth not implemented on this platform -- returning 0!");
+    MOZ_ASSERT(false, "Not implemented on this platform");
     return 0;
 }
 
 mozilla::gfx::SurfaceFormat
 gfxPlatform::Optimal2DFormatForContent(gfxASurface::gfxContentType aContent)
 {
   switch (aContent) {
   case gfxASurface::CONTENT_COLOR: