Bug 896651 - Need to clean up resources for out-of-process layer trees when shutting down (r=mattwoodrow)

This commit is contained in:
Bill McCloskey 2013-07-23 14:53:22 -07:00
parent e570bec18c
commit 54cb4cc404
2 changed files with 14 additions and 3 deletions

View File

@ -151,6 +151,9 @@ ThebesLayerComposite::GetCompositableHost() {
void
ThebesLayerComposite::CleanupResources()
{
if (mBuffer) {
mBuffer->Detach();
}
mBuffer = nullptr;
}

View File

@ -33,6 +33,9 @@ using namespace std;
namespace mozilla {
namespace layers {
typedef map<uint64_t, CompositorParent::LayerTreeState> LayerTreeMap;
static LayerTreeMap sIndirectLayerTrees;
// FIXME/bug 774386: we're assuming that there's only one
// CompositorParent, but that's not always true. This assumption only
// affects CrossProcessCompositorParent below.
@ -193,6 +196,14 @@ CompositorParent::RecvWillStop()
// Ensure that the layer manager is destroyed before CompositorChild.
if (mLayerManager) {
for (LayerTreeMap::iterator it = sIndirectLayerTrees.begin();
it != sIndirectLayerTrees.end(); it++)
{
LayerTreeState* lts = &it->second;
if (lts->mParent == this) {
mLayerManager->ClearCachedResources(lts->mRoot);
}
}
mLayerManager->Destroy();
mLayerManager = nullptr;
mCompositionManager = nullptr;
@ -667,9 +678,6 @@ CompositorParent::SetTimeAndSampleAnimations(TimeStamp aTime, bool aIsTesting)
}
}
typedef map<uint64_t, CompositorParent::LayerTreeState> LayerTreeMap;
static LayerTreeMap sIndirectLayerTrees;
bool
CompositorParent::RecvNotifyChildCreated(const uint64_t& child)
{