Bug 1083635. Part 2: Inline nsDisplayList::PaintForFrame into PaintRoot. r=mattwoodrow

--HG--
extra : rebase_source : 1d313b18a2b0cc5894924299f421966a1f428799
This commit is contained in:
Robert O'Callahan 2014-10-21 10:32:09 +13:00
Родитель 2229b67428
Коммит 050aec01b4
2 изменённых файлов: 13 добавлений и 24 удалений

Просмотреть файл

@ -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> 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<ContainerLayer> 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());

Просмотреть файл

@ -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.