From a9831398d79739c5be45ee03962ba033a5e9ab30 Mon Sep 17 00:00:00 2001 From: Morris Tseng Date: Wed, 19 Feb 2014 11:37:25 -0500 Subject: [PATCH] Bug 974189 - Black screen in content area during browser start with OMTC enabled. r=gal --- gfx/layers/d3d11/CompositorD3D11.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gfx/layers/d3d11/CompositorD3D11.cpp b/gfx/layers/d3d11/CompositorD3D11.cpp index 8641c1eee0e..a70ef1c1a90 100644 --- a/gfx/layers/d3d11/CompositorD3D11.cpp +++ b/gfx/layers/d3d11/CompositorD3D11.cpp @@ -550,6 +550,8 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect, switch (aEffectChain.mPrimaryEffect->mType) { case EFFECT_SOLID_COLOR: { + SetPSForEffect(aEffectChain.mPrimaryEffect, maskType, SurfaceFormat::UNKNOWN); + Color color = static_cast(aEffectChain.mPrimaryEffect.get())->mColor; mPSConstants.layerColor[0] = color.r * color.a * aOpacity; @@ -564,8 +566,6 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect, TexturedEffect* texturedEffect = static_cast(aEffectChain.mPrimaryEffect.get()); - SetPSForEffect(aEffectChain.mPrimaryEffect, maskType, texturedEffect->mTexture->GetFormat()); - mVSConstants.textureCoords = texturedEffect->mTextureCoords; TextureSourceD3D11* source = texturedEffect->mTexture->AsSourceD3D11(); @@ -575,6 +575,8 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect, return; } + SetPSForEffect(aEffectChain.mPrimaryEffect, maskType, texturedEffect->mTexture->GetFormat()); + RefPtr view; mDevice->CreateShaderResourceView(source->GetD3D11Texture(), nullptr, byRef(view)); @@ -593,7 +595,6 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect, EffectYCbCr* ycbcrEffect = static_cast(aEffectChain.mPrimaryEffect.get()); - SetPSForEffect(aEffectChain.mPrimaryEffect, maskType, ycbcrEffect->mTexture->GetFormat()); SetSamplerForFilter(Filter::LINEAR); mVSConstants.textureCoords = ycbcrEffect->mTextureCoords; @@ -606,6 +607,8 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect, return; } + SetPSForEffect(aEffectChain.mPrimaryEffect, maskType, ycbcrEffect->mTexture->GetFormat()); + if (!source->GetSubSource(Y) || !source->GetSubSource(Cb) || !source->GetSubSource(Cr)) { // This can happen if we failed to upload the textures, most likely // because of unsupported dimensions (we don't tile YCbCr textures). @@ -635,7 +638,6 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect, EffectComponentAlpha* effectComponentAlpha = static_cast(aEffectChain.mPrimaryEffect.get()); - SetPSForEffect(aEffectChain.mPrimaryEffect, maskType, effectComponentAlpha->mTexture->GetFormat()); TextureSourceD3D11* sourceOnWhite = effectComponentAlpha->mOnWhite->AsSourceD3D11(); TextureSourceD3D11* sourceOnBlack = effectComponentAlpha->mOnBlack->AsSourceD3D11(); @@ -644,6 +646,8 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect, return; } + SetPSForEffect(aEffectChain.mPrimaryEffect, maskType, effectComponentAlpha->mOnWhite->GetFormat()); + SetSamplerForFilter(effectComponentAlpha->mFilter); mVSConstants.textureCoords = effectComponentAlpha->mTextureCoords;