Bug 974189 - Black screen in content area during browser start with OMTC enabled. r=gal

This commit is contained in:
Morris Tseng 2014-02-19 11:37:25 -05:00
parent 37140326d9
commit 012a7d59e0

View File

@ -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<EffectSolidColor*>(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<TexturedEffect*>(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<ID3D11ShaderResourceView> view;
mDevice->CreateShaderResourceView(source->GetD3D11Texture(), nullptr, byRef(view));
@ -593,7 +595,6 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect,
EffectYCbCr* ycbcrEffect =
static_cast<EffectYCbCr*>(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<EffectComponentAlpha*>(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;