Bug 1320023 - Reduce MOZ_ENABLE_WEBRENDER r=nical?
authorsotaro <sotaro.ikeda.g@gmail.com>
Wed, 14 Dec 2016 15:41:04 +0900
changeset 459886 2299de9e58d7e1f615ecbcfed041052f91cf8e07
parent 459885 03dc5c18d2ed2f8d314c9bfd40b67ddae13944e8
child 459887 7604973adccb02cd3023259404aee502ff9da87f
push id41343
push userkgupta@mozilla.com
push dateThu, 12 Jan 2017 20:13:44 +0000
reviewersnical
bugs1320023
milestone53.0a1
Bug 1320023 - Reduce MOZ_ENABLE_WEBRENDER r=nical?
gfx/layers/ipc/CompositorBridgeChild.cpp
gfx/layers/ipc/CompositorBridgeParent.cpp
--- a/gfx/layers/ipc/CompositorBridgeChild.cpp
+++ b/gfx/layers/ipc/CompositorBridgeChild.cpp
@@ -140,25 +140,23 @@ CompositorBridgeChild::Destroy()
   AutoTArray<PLayerTransactionChild*, 16> transactions;
   ManagedPLayerTransactionChild(transactions);
   for (int i = transactions.Length() - 1; i >= 0; --i) {
     RefPtr<LayerTransactionChild> layers =
       static_cast<LayerTransactionChild*>(transactions[i]);
     layers->Destroy();
   }
 
-#ifdef MOZ_ENABLE_WEBRENDER
   AutoTArray<PWebRenderBridgeChild*, 16> wRBridges;
   ManagedPWebRenderBridgeChild(wRBridges);
-  for (int i = transactions.Length() - 1; i >= 0; --i) {
+  for (int i = wRBridges.Length() - 1; i >= 0; --i) {
     RefPtr<WebRenderBridgeChild> wRBridge =
       static_cast<WebRenderBridgeChild*>(wRBridges[i]);
     wRBridge->Destroy();
   }
-#endif
 
   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();
     }
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -455,30 +455,28 @@ CompositorBridgeParent::StopAndClearReso
       lts->mLayerManager = nullptr;
       lts->mParent = nullptr;
     });
     mLayerManager->Destroy();
     mLayerManager = nullptr;
     mCompositionManager = nullptr;
   }
 
-#ifdef MOZ_ENABLE_WEBRENDER
   if (mWRBridge) {
     MonitorAutoLock lock(*sIndirectLayerTreesLock);
     ForEachIndirectLayerTree([this] (LayerTreeState* lts, uint64_t) -> void {
       if (lts->mWRBridge) {
         lts->mWRBridge->Destroy();
         lts->mWRBridge = nullptr;
       }
       lts->mParent = nullptr;
     });
     mWRBridge->Destroy();
     mWRBridge = nullptr;
   }
-#endif
 
   if (mCompositor) {
     mCompositor->DetachWidget();
     mCompositor->Destroy();
     mCompositor = nullptr;
   }
 
   // This must be destroyed now since it accesses the widget.