зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1377324 - Don't compute prepared data multiple times for ContainerLayers that are duplicated. r=miko
This commit is contained in:
Родитель
4fd709b953
Коммит
94247181df
|
@ -185,6 +185,12 @@ ContainerPrepare(ContainerT* aContainer,
|
|||
LayerManagerComposite* aManager,
|
||||
const RenderTargetIntRect& aClipRect)
|
||||
{
|
||||
// We can end up calling prepare multiple times if we duplicated
|
||||
// layers due to preserve-3d plane splitting. The results
|
||||
// should be identical, so we only need to do it once.
|
||||
if (aContainer->mPrepared) {
|
||||
return;
|
||||
}
|
||||
aContainer->mPrepared = MakeUnique<PreparedData>();
|
||||
aContainer->mPrepared->mNeedsSurfaceCopy = false;
|
||||
|
||||
|
@ -687,6 +693,10 @@ void
|
|||
ContainerLayerComposite::Cleanup()
|
||||
{
|
||||
mPrepared = nullptr;
|
||||
|
||||
for (Layer* l = GetFirstChild(); l; l = l->GetNextSibling()) {
|
||||
static_cast<LayerComposite*>(l->AsHostLayer())->Cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -754,6 +764,16 @@ RefLayerComposite::Prepare(const RenderTargetIntRect& aClipRect)
|
|||
ContainerPrepare(this, mCompositeManager, aClipRect);
|
||||
}
|
||||
|
||||
void
|
||||
RefLayerComposite::Cleanup()
|
||||
{
|
||||
mPrepared = nullptr;
|
||||
|
||||
for (Layer* l = GetFirstChild(); l; l = l->GetNextSibling()) {
|
||||
static_cast<LayerComposite*>(l->AsHostLayer())->Cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
RefLayerComposite::CleanupResources()
|
||||
{
|
||||
|
|
|
@ -183,6 +183,8 @@ public:
|
|||
DefaultComputeEffectiveTransforms(aTransformToSurface);
|
||||
}
|
||||
|
||||
virtual void Cleanup() override;
|
||||
|
||||
virtual void CleanupResources() override;
|
||||
|
||||
virtual HostLayer* AsHostLayer() override { return this; }
|
||||
|
|
Загрузка…
Ссылка в новой задаче