From acfcb2590b0dc7a2470704744be7322d09983631 Mon Sep 17 00:00:00 2001 From: Morris Tseng Date: Mon, 24 Feb 2014 10:09:55 -0500 Subject: [PATCH] Bug 975121 - Fix reversed colors with gfx.xrender.enabled = false. r=gal --- gfx/layers/opengl/CompositorOGL.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gfx/layers/opengl/CompositorOGL.cpp b/gfx/layers/opengl/CompositorOGL.cpp index 7e2addb49e4..e425f01e61f 100644 --- a/gfx/layers/opengl/CompositorOGL.cpp +++ b/gfx/layers/opengl/CompositorOGL.cpp @@ -824,8 +824,15 @@ CompositorOGL::GetShaderConfigFor(Effect *aEffect, MaskType aMask) const config.SetYCbCr(true); break; case EFFECT_COMPONENT_ALPHA: + { config.SetComponentAlpha(true); + EffectComponentAlpha* effectComponentAlpha = + static_cast(aEffect); + gfx::SurfaceFormat format = effectComponentAlpha->mOnWhite->GetFormat(); + config.SetRBSwap(format == gfx::SurfaceFormat::B8G8R8A8 || + format == gfx::SurfaceFormat::B8G8R8X8); break; + } case EFFECT_RENDER_TARGET: config.SetTextureTarget(mFBOTextureTarget); break;