mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
Bug 896651 - Need to clean up resources for out-of-process layer trees when shutting down (r=mattwoodrow)
This commit is contained in:
parent
e570bec18c
commit
54cb4cc404
@ -151,6 +151,9 @@ ThebesLayerComposite::GetCompositableHost() {
|
||||
void
|
||||
ThebesLayerComposite::CleanupResources()
|
||||
{
|
||||
if (mBuffer) {
|
||||
mBuffer->Detach();
|
||||
}
|
||||
mBuffer = nullptr;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user