Bug 1043426 - Don't crash when failing to upload apply a maskon a container layer. r=Bas

This commit is contained in:
Nicolas Silva 2014-08-01 15:53:12 +02:00
Родитель 3bb1ba4400
Коммит ba56925243
3 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -530,6 +530,10 @@ ContainerRender(ContainerT* aContainer,
LayerManagerComposite::AutoAddMaskEffect autoMaskEffect(aContainer->GetMaskLayer(),
effectChain,
!aContainer->GetTransform().CanDraw2D());
if (autoMaskEffect.Failed()) {
NS_WARNING("Failed to apply a mask effect.");
return;
}
aContainer->AddBlendModeEffect(effectChain);
effectChain.mPrimaryEffect = new EffectRenderTarget(surface);

Просмотреть файл

@ -828,7 +828,7 @@ LayerManagerComposite::CreateRefLayerComposite()
LayerManagerComposite::AutoAddMaskEffect::AutoAddMaskEffect(Layer* aMaskLayer,
EffectChain& aEffects,
bool aIs3D)
: mCompositable(nullptr)
: mCompositable(nullptr), mFailed(false)
{
if (!aMaskLayer) {
return;
@ -837,11 +837,13 @@ LayerManagerComposite::AutoAddMaskEffect::AutoAddMaskEffect(Layer* aMaskLayer,
mCompositable = ToLayerComposite(aMaskLayer)->GetCompositableHost();
if (!mCompositable) {
NS_WARNING("Mask layer with no compositable host");
mFailed = true;
return;
}
if (!mCompositable->AddMaskEffect(aEffects, aMaskLayer->GetEffectiveTransform(), aIs3D)) {
mCompositable = nullptr;
mFailed = true;
}
}

Просмотреть файл

@ -184,8 +184,10 @@ public:
bool aIs3D = false);
~AutoAddMaskEffect();
bool Failed() const { return mFailed; }
private:
CompositableHost* mCompositable;
bool mFailed;
};
/**