From 050aec01b4504cee25b8f842110b8b33cb8fc1a1 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Tue, 21 Oct 2014 10:32:09 +1300 Subject: [PATCH] Bug 1083635. Part 2: Inline nsDisplayList::PaintForFrame into PaintRoot. r=mattwoodrow --HG-- extra : rebase_source : 1d313b18a2b0cc5894924299f421966a1f428799 --- layout/base/nsDisplayList.cpp | 31 +++++++++++++------------------ layout/base/nsDisplayList.h | 6 ------ 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index e27dab52f17a..5335a760f0c9 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -1278,23 +1278,17 @@ nsDisplayList::ComputeVisibilityForSublist(nsDisplayListBuilder* aBuilder, return anyVisible; } -void nsDisplayList::PaintRoot(nsDisplayListBuilder* aBuilder, - nsRenderingContext* aCtx, - uint32_t aFlags) { - PROFILER_LABEL("nsDisplayList", "PaintRoot", - js::ProfileEntry::Category::GRAPHICS); - PaintForFrame(aBuilder, aCtx, aBuilder->RootReferenceFrame(), aFlags); -} - /** * We paint by executing a layer manager transaction, constructing a * single layer representing the display list, and then making it the * root of the layer manager, drawing into the PaintedLayers. */ -void nsDisplayList::PaintForFrame(nsDisplayListBuilder* aBuilder, - nsRenderingContext* aCtx, - nsIFrame* aForFrame, - uint32_t aFlags) { +void nsDisplayList::PaintRoot(nsDisplayListBuilder* aBuilder, + nsRenderingContext* aCtx, + uint32_t aFlags) { + PROFILER_LABEL("nsDisplayList", "PaintRoot", + js::ProfileEntry::Category::GRAPHICS); + nsRefPtr layerManager; bool widgetTransaction = false; bool allowRetaining = false; @@ -1347,7 +1341,8 @@ void nsDisplayList::PaintForFrame(nsDisplayListBuilder* aBuilder, layerBuilder->DidBeginRetainedLayerTransaction(layerManager); } - nsPresContext* presContext = aForFrame->PresContext(); + nsIFrame* frame = aBuilder->RootReferenceFrame(); + nsPresContext* presContext = frame->PresContext(); nsIPresShell* presShell = presContext->GetPresShell(); NotifySubDocInvalidationFunc computeInvalidFunc = @@ -1364,7 +1359,7 @@ void nsDisplayList::PaintForFrame(nsDisplayListBuilder* aBuilder, ContainerLayerParameters containerParameters (presShell->GetXResolution(), presShell->GetYResolution()); nsRefPtr root = layerBuilder-> - BuildContainerLayerFor(aBuilder, layerManager, aForFrame, nullptr, this, + BuildContainerLayerFor(aBuilder, layerManager, frame, nullptr, this, containerParameters, nullptr); nsIDocument* document = nullptr; @@ -1384,11 +1379,11 @@ void nsDisplayList::PaintForFrame(nsDisplayListBuilder* aBuilder, nsIFrame* rootScrollFrame = presShell->GetRootScrollFrame(); - nsRect viewport(aBuilder->ToReferenceFrame(aForFrame), aForFrame->GetSize()); + nsRect viewport(aBuilder->ToReferenceFrame(frame), frame->GetSize()); root->SetFrameMetrics( - nsDisplayScrollLayer::ComputeFrameMetrics(aForFrame, rootScrollFrame, - aBuilder->FindReferenceFrameFor(aForFrame), + nsDisplayScrollLayer::ComputeFrameMetrics(frame, rootScrollFrame, + aBuilder->FindReferenceFrameFor(frame), root, FrameMetrics::NULL_SCROLL_ID, viewport, !isRoot, isRoot, containerParameters)); @@ -1418,7 +1413,7 @@ void nsDisplayList::PaintForFrame(nsDisplayListBuilder* aBuilder, // but they still need the invalidation state bits cleared in order for // invalidation for CSS/SMIL animation to work properly. (document && document->IsBeingUsedAsImage())) { - aForFrame->ClearInvalidationStateBits(); + frame->ClearInvalidationStateBits(); } bool temp = aBuilder->SetIsCompositingCheap(layerManager->IsCompositingCheap()); diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index 4439d06fe9a2..e6496da4d64a 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -1672,12 +1672,6 @@ public: }; void PaintRoot(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx, uint32_t aFlags); - /** - * Like PaintRoot, but used for internal display sublists. - * aForFrame is the frame that the list is associated with. - */ - void PaintForFrame(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx, - nsIFrame* aForFrame, uint32_t aFlags); /** * Get the bounds. Takes the union of the bounds of all children. * The result is not cached.