From 4f48b91fcf7f45c1801b1e8d58790f0b74673e0e Mon Sep 17 00:00:00 2001 From: Oleg Romashin Date: Wed, 4 Apr 2012 14:32:21 -0700 Subject: [PATCH] Bug 742091 - Texture format detection broken by 740372. r=gwright --- gfx/gl/GLContextProviderEGL.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp index a3f0814e73d..74205b1d40a 100644 --- a/gfx/gl/GLContextProviderEGL.cpp +++ b/gfx/gl/GLContextProviderEGL.cpp @@ -851,20 +851,16 @@ public: mUpdateFormat = gfxASurface::FormatFromContent(GetContentType()); if (gUseBackingSurface) { - if (mUpdateFormat == gfxASurface::ImageFormatRGB24) { -#ifdef MOZ_GFX_OPTIMIZE_MOBILE - mUpdateFormat = gfxASurface::ImageFormatRGB16_565; + if (mUpdateFormat != gfxASurface::ImageFormatARGB32) { mShaderType = RGBXLayerProgramType; -#else - mUpdateFormat = gfxASurface::ImageFormatARGB32; - mShaderType = RGBALayerProgramType; -#endif } else { mShaderType = RGBALayerProgramType; } Resize(aSize); } else { - if (mUpdateFormat == gfxASurface::ImageFormatRGB24) { + if (mUpdateFormat == gfxASurface::ImageFormatRGB16_565) { + mShaderType = RGBXLayerProgramType; + } else if (mUpdateFormat == gfxASurface::ImageFormatRGB24) { // RGB24 means really RGBX for Thebes, which means we have to // use the right shader and ignore the uninitialized alpha // value.