Bug 900248. Don't assume success for effect creation. r=Bas

This commit is contained in:
Nicholas Cameron 2013-11-22 11:07:56 +13:00
parent d3441a90be
commit a5462f4e61
4 changed files with 16 additions and 1 deletions

View File

@ -229,7 +229,8 @@ CreateTexturedEffect(gfx::SurfaceFormat aFormat,
result = new EffectYCbCr(aSource, aFilter);
break;
default:
MOZ_CRASH("unhandled program type");
NS_WARNING("unhandled program type");
break;
}
return result;

View File

@ -91,6 +91,9 @@ ContentHostBase::Composite(EffectChain& aEffectChain,
RefPtr<TexturedEffect> effect =
CreateTexturedEffect(mDeprecatedTextureHost, mDeprecatedTextureHostOnWhite, aFilter);
if (!effect) {
return;
}
aEffectChain.mPrimaryEffect = effect;

View File

@ -86,6 +86,10 @@ ImageHost::Composite(EffectChain& aEffectChain,
RefPtr<TexturedEffect> effect = CreateTexturedEffect(mFrontBuffer->GetFormat(),
source,
aFilter);
if (!effect) {
return;
}
aEffectChain.mPrimaryEffect = effect;
IntSize textureSize = source->GetSize();
gfx::Rect gfxPictureRect
@ -288,6 +292,9 @@ DeprecatedImageHostSingle::Composite(EffectChain& aEffectChain,
RefPtr<TexturedEffect> effect =
CreateTexturedEffect(mDeprecatedTextureHost, aFilter);
if (!effect) {
return;
}
aEffectChain.mPrimaryEffect = effect;

View File

@ -184,6 +184,10 @@ TiledContentHost::RenderTile(const TiledTexture& aTile,
RefPtr<TexturedEffect> effect =
CreateTexturedEffect(aTile.mDeprecatedTextureHost, aFilter);
if (!effect) {
return;
}
if (aTile.mDeprecatedTextureHost->Lock()) {
aEffectChain.mPrimaryEffect = effect;
} else {