зеркало из 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,
|
LayerManagerComposite* aManager,
|
||||||
const RenderTargetIntRect& aClipRect)
|
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 = MakeUnique<PreparedData>();
|
||||||
aContainer->mPrepared->mNeedsSurfaceCopy = false;
|
aContainer->mPrepared->mNeedsSurfaceCopy = false;
|
||||||
|
|
||||||
|
@ -687,6 +693,10 @@ void
|
||||||
ContainerLayerComposite::Cleanup()
|
ContainerLayerComposite::Cleanup()
|
||||||
{
|
{
|
||||||
mPrepared = nullptr;
|
mPrepared = nullptr;
|
||||||
|
|
||||||
|
for (Layer* l = GetFirstChild(); l; l = l->GetNextSibling()) {
|
||||||
|
static_cast<LayerComposite*>(l->AsHostLayer())->Cleanup();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -754,6 +764,16 @@ RefLayerComposite::Prepare(const RenderTargetIntRect& aClipRect)
|
||||||
ContainerPrepare(this, mCompositeManager, 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
|
void
|
||||||
RefLayerComposite::CleanupResources()
|
RefLayerComposite::CleanupResources()
|
||||||
{
|
{
|
||||||
|
|
|
@ -183,6 +183,8 @@ public:
|
||||||
DefaultComputeEffectiveTransforms(aTransformToSurface);
|
DefaultComputeEffectiveTransforms(aTransformToSurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void Cleanup() override;
|
||||||
|
|
||||||
virtual void CleanupResources() override;
|
virtual void CleanupResources() override;
|
||||||
|
|
||||||
virtual HostLayer* AsHostLayer() override { return this; }
|
virtual HostLayer* AsHostLayer() override { return this; }
|
||||||
|
|
Загрузка…
Ссылка в новой задаче