From aca6f7c82d12d054ae95faa50547ac5e3dc2e1df Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Mon, 16 Apr 2012 14:37:59 -0400 Subject: [PATCH] Bug 745864. Add SAMPLE_LABELs to layout code. r=roc, a=joe --HG-- extra : rebase_source : d826780c34692d333442b6bf563791b53bf3aa3d --- layout/base/FrameLayerBuilder.cpp | 1 + layout/base/nsCSSRendering.cpp | 5 ++++- layout/base/nsCSSRenderingBorders.cpp | 2 ++ layout/base/nsDisplayList.cpp | 3 +++ layout/base/nsLayoutUtils.cpp | 10 ++++++++-- layout/generic/nsTextFrameThebes.cpp | 3 +++ layout/generic/nsViewportFrame.cpp | 2 ++ 7 files changed, 23 insertions(+), 3 deletions(-) diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 90c79b241c54..9fcd676ba0d2 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -1432,6 +1432,7 @@ void ContainerState::ProcessDisplayItems(const nsDisplayList& aList, FrameLayerBuilder::Clip& aClip) { + SAMPLE_LABEL("ContainerState", "ProcessDisplayItems"); for (nsDisplayItem* item = aList.GetBottom(); item; item = item->GetAbove()) { nsDisplayItem::Type type = item->GetType(); if (type == nsDisplayItem::TYPE_CLIP || diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index 977a5de33a84..95ccce192a81 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -82,7 +82,7 @@ #include "nsSVGEffects.h" #include "nsSVGIntegrationUtils.h" #include "gfxDrawable.h" - +#include "sampler.h" #include "nsCSSRenderingBorders.h" using namespace mozilla; @@ -501,6 +501,7 @@ nsCSSRendering::PaintBorder(nsPresContext* aPresContext, nsStyleContext* aStyleContext, PRIntn aSkipSides) { + SAMPLE_LABEL("nsCSSRendering", "PaintBorder"); nsStyleContext *styleIfVisited = aStyleContext->GetStyleIfVisited(); const nsStyleBorder *styleBorder = aStyleContext->GetStyleBorder(); // Don't check RelevantLinkVisited here, since we want to take the @@ -1458,6 +1459,7 @@ nsCSSRendering::PaintBackground(nsPresContext* aPresContext, PRUint32 aFlags, nsRect* aBGClipRect) { + SAMPLE_LABEL("nsCSSRendering", "PaintBackground"); NS_PRECONDITION(aForFrame, "Frame is expected to be provided to PaintBackground"); @@ -1966,6 +1968,7 @@ nsCSSRendering::PaintGradient(nsPresContext* aPresContext, const nsRect& aOneCellArea, const nsRect& aFillArea) { + SAMPLE_LABEL("nsCSSRendering", "PaintGradient"); if (aOneCellArea.IsEmpty()) return; diff --git a/layout/base/nsCSSRenderingBorders.cpp b/layout/base/nsCSSRenderingBorders.cpp index e533d0143e8e..1470ef73c7b2 100644 --- a/layout/base/nsCSSRenderingBorders.cpp +++ b/layout/base/nsCSSRenderingBorders.cpp @@ -62,6 +62,7 @@ #include "nsLayoutUtils.h" #include "nsINameSpaceManager.h" #include "nsBlockFrame.h" +#include "sampler.h" #include "gfxContext.h" @@ -1570,6 +1571,7 @@ nsCSSBorderRenderer::DrawBorders() DrawBorderSides(SIDE_BITS_ALL); SN("---------------- (1)"); } else { + SAMPLE_LABEL("nsCSSBorderRenderer", "DrawBorders::multipass"); /* We have more than one pass to go. Draw the corners separately from the sides. */ /* diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 1271cfabeb42..d7084dac5ce4 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -66,6 +66,7 @@ #include "nsViewportFrame.h" #include "nsSVGEffects.h" #include "nsSVGClipPathFrame.h" +#include "sampler.h" #include "mozilla/StandardInteger.h" @@ -431,6 +432,7 @@ nsDisplayList::GetBounds(nsDisplayListBuilder* aBuilder) const { bool nsDisplayList::ComputeVisibilityForRoot(nsDisplayListBuilder* aBuilder, nsRegion* aVisibleRegion) { + SAMPLE_LABEL("nsDisplayList", "ComputeVisibilityForRoot"); nsRegion r; r.And(*aVisibleRegion, GetBounds(aBuilder)); return ComputeVisibilityForSublist(aBuilder, aVisibleRegion, r.GetBounds(), r.GetBounds()); @@ -549,6 +551,7 @@ nsDisplayList::ComputeVisibilityForSublist(nsDisplayListBuilder* aBuilder, void nsDisplayList::PaintRoot(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx, PRUint32 aFlags) const { + SAMPLE_LABEL("nsDisplayList", "PaintRoot"); PaintForFrame(aBuilder, aCtx, aBuilder->ReferenceFrame(), aFlags); } diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index b1716b264be3..c0a2a014f68b 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -1406,6 +1406,7 @@ nsLayoutUtils::GetFrameForPoint(nsIFrame* aFrame, nsPoint aPt, bool aShouldIgnoreSuppression, bool aIgnoreRootScrollFrame) { + SAMPLE_LABEL("nsLayoutUtils", "GetFrameForPoint"); nsresult rv; nsAutoTArray outFrames; rv = GetFramesForArea(aFrame, nsRect(aPt, nsSize(1, 1)), outFrames, @@ -1420,6 +1421,7 @@ nsLayoutUtils::GetFramesForArea(nsIFrame* aFrame, const nsRect& aRect, bool aShouldIgnoreSuppression, bool aIgnoreRootScrollFrame) { + SAMPLE_LABEL("nsLayoutUtils","GetFramesForArea"); nsDisplayListBuilder builder(aFrame, nsDisplayListBuilder::EVENT_DELIVERY, false); nsDisplayList list; @@ -1560,6 +1562,7 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram const nsRegion& aDirtyRegion, nscolor aBackstop, PRUint32 aFlags) { + SAMPLE_LABEL("nsLayoutUtils","PaintFrame"); if (aFlags & PAINT_WIDGET_LAYERS) { nsIView* view = aFrame->GetView(); if (!(view && view->GetWidget() && GetDisplayRootFrame(aFrame) == aFrame)) { @@ -1666,9 +1669,10 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram nsRect dirtyRect = visibleRegion.GetBounds(); builder.EnterPresShell(aFrame, dirtyRect); - + { + SAMPLE_LABEL("nsLayoutUtils","PaintFrame::BuildDisplayList"); rv = aFrame->BuildDisplayListForStackingContext(&builder, dirtyRect, &list); - + } const bool paintAllContinuations = aFlags & PAINT_ALL_CONTINUATIONS; NS_ASSERTION(!paintAllContinuations || !aFrame->GetPrevContinuation(), "If painting all continuations, the frame must be " @@ -1689,6 +1693,7 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram nsIFrame* page = aFrame; nscoord y = aFrame->GetSize().height; while ((page = GetNextPage(page)) != nsnull) { + SAMPLE_LABEL("nsLayoutUtils","PaintFrame::BuildDisplayListForExtraPage"); rv = BuildDisplayListForExtraPage(&builder, page, y, &list); if (NS_FAILED(rv)) break; @@ -1700,6 +1705,7 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram nsIFrame* currentFrame = aFrame; while (NS_SUCCEEDED(rv) && (currentFrame = currentFrame->GetNextContinuation()) != nsnull) { + SAMPLE_LABEL("nsLayoutUtils","PaintFrame::ContinuationsBuildDisplayList"); nsRect frameDirty = dirtyRect - builder.ToReferenceFrame(currentFrame); rv = currentFrame->BuildDisplayListForStackingContext(&builder, frameDirty, &list); diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp index 865be5851dfa..64c341610d49 100644 --- a/layout/generic/nsTextFrameThebes.cpp +++ b/layout/generic/nsTextFrameThebes.cpp @@ -118,6 +118,8 @@ #include "mozilla/Util.h" // for DebugOnly #include "mozilla/LookAndFeel.h" +#include "sampler.h" + #ifdef NS_DEBUG #undef NOISY_BLINK #undef NOISY_REFLOW @@ -4417,6 +4419,7 @@ public: void nsDisplayText::Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) { + SAMPLE_LABEL("nsDisplayText", "Paint"); // Add 1 pixel of dirty area around mVisibleRect to allow us to paint // antialiased pixels beyond the measured text extents. // This is temporary until we do this in the actual calculation of text extents. diff --git a/layout/generic/nsViewportFrame.cpp b/layout/generic/nsViewportFrame.cpp index d9b1c1781311..06202ff57cd5 100644 --- a/layout/generic/nsViewportFrame.cpp +++ b/layout/generic/nsViewportFrame.cpp @@ -49,6 +49,7 @@ #include "FrameLayerBuilder.h" #include "nsSubDocumentFrame.h" #include "nsAbsoluteContainingBlock.h" +#include "sampler.h" using namespace mozilla; @@ -91,6 +92,7 @@ ViewportFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, const nsDisplayListSet& aLists) { + SAMPLE_LABEL("ViewportFrame", "BuildDisplayList"); nsIFrame* kid = mFrames.FirstChild(); if (!kid) return NS_OK;