Bug 1381503 - Fine tune nsDisplayListBuilder::GetWidgetLayerManager. draft
authorcku <cku@mozilla.com>
Mon, 17 Jul 2017 22:43:59 +0800
changeset 609809 2145534f2fa632ecb7626e75c5e35a0e2de9136c
parent 609596 aff336ac161daa3ea350e59a288963edbd58ed39
child 637670 d4ee7ea340470a66890f0e0af4466b2f944a817f
push id68685
push userbmo:cku@mozilla.com
push dateMon, 17 Jul 2017 14:52:52 +0000
bugs1381503
milestone56.0a1
Bug 1381503 - Fine tune nsDisplayListBuilder::GetWidgetLayerManager. nsDisplayText ctor does not pass aViewer into nsDisplayListBuilder::GetWidgetLayerManager, as a result, finding viewer in that function is not needed. MozReview-Commit-ID: 2rPbp7jkpo6
layout/painting/nsDisplayList.cpp
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -2038,19 +2038,18 @@ TriggerPendingAnimations(nsIDocument* aD
              " manager that doesn't update it");
   TriggerPendingAnimationsOnSubDocuments(aDocument,
                                          const_cast<TimeStamp*>(&aReadyTime));
 }
 
 LayerManager*
 nsDisplayListBuilder::GetWidgetLayerManager(nsView** aView)
 {
-  nsView* view = RootReferenceFrame()->GetView();
   if (aView) {
-    *aView = view;
+    *aView = RootReferenceFrame()->GetView();
   }
   if (RootReferenceFrame() != nsLayoutUtils::GetDisplayRootFrame(RootReferenceFrame())) {
     return nullptr;
   }
   nsIWidget* window = RootReferenceFrame()->GetNearestWidget();
   if (window) {
     return window->GetLayerManager();
   }