Bug 1518524 - Don't try to restore the previous FrameLayerBuilder after a transaction since it should always be nullptr anyway. r=miko
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 06 Mar 2019 15:56:55 +0000
changeset 521347 3ee7abf6d43275fe1d936df32a40bf010450d62d
parent 521346 dbd1b0222c6f9f2f43a4bed4f0c8d4f262d23b45
child 521348 6f32ec5e62e3a3b20d2c16e13f963981603768df
child 521371 423f48c9823088ca50cb00d88dd78c4046b1f054
push id10866
push usernerli@mozilla.com
push dateTue, 12 Mar 2019 18:59:09 +0000
treeherdermozilla-beta@445c24a51727 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiko
bugs1518524
milestone67.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 1518524 - Don't try to restore the previous FrameLayerBuilder after a transaction since it should always be nullptr anyway. r=miko Differential Revision: https://phabricator.services.mozilla.com/D21879
layout/painting/nsDisplayList.cpp
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -2750,31 +2750,27 @@ already_AddRefed<LayerManager> nsDisplay
     // we don't need to worry about END_NO_COMPOSITE.
     if (aBuilder->WillComputePluginGeometry()) {
       flags = LayerManager::END_NO_REMOTE_COMPOSITE;
     }
   }
 
   MaybeSetupTransactionIdAllocator(layerManager, presContext);
 
-  // Store the existing layer builder to reinstate it on return.
-  FrameLayerBuilder* oldBuilder = layerManager->GetLayerBuilder();
-  FrameLayerBuilder* layerBuilder = nullptr;
-
   bool sent = false;
   if (aFlags & PAINT_IDENTICAL_DISPLAY_LIST) {
     sent = layerManager->EndEmptyTransaction(flags);
   }
 
   if (!sent) {
-    layerBuilder =
+    FrameLayerBuilder* layerBuilder =
         BuildLayers(aBuilder, layerManager, aFlags, widgetTransaction);
 
     if (!layerBuilder) {
-      layerManager->SetUserData(&gLayerManagerLayerBuilder, oldBuilder);
+      layerManager->SetUserData(&gLayerManagerLayerBuilder, nullptr);
       return nullptr;
     }
 
     // If this is the content process, we ship plugin geometry updates over with
     // layer updates, so calculate that now before we call EndTransaction.
     nsRootPresContext* rootPresContext = presContext->GetRootPresContext();
     if (rootPresContext && XRE_IsContentProcess()) {
       if (aBuilder->WillComputePluginGeometry()) {
@@ -2832,17 +2828,17 @@ already_AddRefed<LayerManager> nsDisplay
         presContext->NotifyInvalidation(layerManager->GetLastTransactionId(),
                                         bounds);
       }
     } else if (shouldInvalidate) {
       view->GetViewManager()->InvalidateView(view);
     }
   }
 
-  layerManager->SetUserData(&gLayerManagerLayerBuilder, oldBuilder);
+  layerManager->SetUserData(&gLayerManagerLayerBuilder, nullptr);
   return layerManager.forget();
 }
 
 nsDisplayItem* nsDisplayList::RemoveBottom() {
   nsDisplayItem* item = mSentinel.mAbove;
   if (!item) return nullptr;
   mSentinel.mAbove = item->mAbove;
   if (item == mTop) {