Bug 1190881 - Part 4. Use infallible PresShell getter in PaintRoot, and remove unnecessary null-check on it result. r=dholbert
authorcku <cku@mozilla.com>
Fri, 26 Aug 2016 00:57:57 +0800
changeset 312796 cd2ae4eeae40b4d4dbc19cbe66b7d92cb68ff497
parent 312795 aad83800847aecd82266dc44daa7853f247c7256
child 312797 00bdb9edbe56af8e06c515e8c03f0026a5500933
push id30658
push usercbook@mozilla.com
push dateTue, 06 Sep 2016 13:28:59 +0000
treeherdermozilla-central@bec2b7e3c0eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1190881
milestone51.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 1190881 - Part 4. Use infallible PresShell getter in PaintRoot, and remove unnecessary null-check on it result. r=dholbert MozReview-Commit-ID: 2KJ3L8oWIey
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -1777,17 +1777,17 @@ already_AddRefed<LayerManager> nsDisplay
   }
 
   if (widgetTransaction) {
     layerBuilder->DidBeginRetainedLayerTransaction(layerManager);
   }
 
   nsIFrame* frame = aBuilder->RootReferenceFrame();
   nsPresContext* presContext = frame->PresContext();
-  nsIPresShell* presShell = presContext->GetPresShell();
+  nsIPresShell* presShell = presContext->PresShell();
   nsRootPresContext* rootPresContext = presContext->GetRootPresContext();
 
   NotifySubDocInvalidationFunc computeInvalidFunc =
     presContext->MayHavePaintEventListenerInSubDocument() ? nsPresContext::NotifySubDocInvalidation : 0;
   bool computeInvalidRect = (computeInvalidFunc ||
                              (!layerManager->IsCompositingCheap() && layerManager->NeedsWidgetInvalidation())) &&
                             widgetTransaction;
 
@@ -1804,20 +1804,17 @@ already_AddRefed<LayerManager> nsDisplay
   }
 
   ContainerLayerParameters containerParameters
     (presShell->GetResolution(), presShell->GetResolution());
   RefPtr<ContainerLayer> root = layerBuilder->
     BuildContainerLayerFor(aBuilder, layerManager, frame, nullptr, this,
                            containerParameters, nullptr);
 
-  nsIDocument* document = nullptr;
-  if (presShell) {
-    document = presShell->GetDocument();
-  }
+  nsIDocument* document = presShell->GetDocument();
 
   if (!root) {
     layerManager->SetUserData(&gLayerManagerLayerBuilder, oldBuilder);
     return nullptr;
   }
   // Root is being scaled up by the X/Y resolution. Scale it back down.
   root->SetPostScale(1.0f/containerParameters.mXScale,
                      1.0f/containerParameters.mYScale);