Bug 1432531 - Move FlushAsyncPaints so it is unconditionally run in CompositorBridgeChild::Destroy. r=nical
authorRyan Hunt <rhunt@eqrion.net>
Tue, 03 Jul 2018 09:44:40 -0500
changeset 425071 ea49b4ea3828ddc22e8d9f9a684094a0852bbb5a
parent 425070 a5bb1dc293cb6245ef6123760de3c2c06327274f
child 425072 f60f27d4d133bfff864b0b260ff09653b484cde9
push id34234
push userccoroiu@mozilla.com
push dateThu, 05 Jul 2018 00:14:48 +0000
treeherdermozilla-central@90be04d99fc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1432531
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1432531 - Move FlushAsyncPaints so it is unconditionally run in CompositorBridgeChild::Destroy. r=nical
gfx/layers/ipc/CompositorBridgeChild.cpp
--- a/gfx/layers/ipc/CompositorBridgeChild.cpp
+++ b/gfx/layers/ipc/CompositorBridgeChild.cpp
@@ -151,16 +151,19 @@ CompositorBridgeChild::Destroy()
     mSectionAllocator = nullptr;
   }
 
   if (mLayerManager) {
     mLayerManager->Destroy();
     mLayerManager = nullptr;
   }
 
+  // Flush async paints before we destroy texture data.
+  FlushAsyncPaints();
+
   if (!mCanSend) {
     // We may have already called destroy but still have lingering references
     // or CompositorBridgeChild::ActorDestroy was called. Ensure that we do our
     // post destroy clean up no matter what. It is safe to call multiple times.
     MessageLoop::current()->PostTask(NewRunnableMethod(
       "CompositorBridgeChild::AfterDestroy",
       selfRef, &CompositorBridgeChild::AfterDestroy));
     return;
@@ -177,19 +180,16 @@ CompositorBridgeChild::Destroy()
   AutoTArray<PWebRenderBridgeChild*, 16> wrBridges;
   ManagedPWebRenderBridgeChild(wrBridges);
   for (int i = wrBridges.Length() - 1; i >= 0; --i) {
     RefPtr<WebRenderBridgeChild> wrBridge =
       static_cast<WebRenderBridgeChild*>(wrBridges[i]);
     wrBridge->Destroy(/* aIsSync */ false);
   }
 
-  // Flush async paints before we destroy texture data.
-  FlushAsyncPaints();
-
   const ManagedContainer<PTextureChild>& textures = ManagedPTextureChild();
   for (auto iter = textures.ConstIter(); !iter.Done(); iter.Next()) {
     RefPtr<TextureClient> texture = TextureClient::AsTextureClient(iter.Get()->GetKey());
 
     if (texture) {
       texture->Destroy();
     }
   }