зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1043426 - Don't crash when failing to upload apply a maskon a container layer. r=Bas
This commit is contained in:
Родитель
3bb1ba4400
Коммит
ba56925243
|
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче