Bug 745864. Add SAMPLE_LABELs to layout code. r=roc, a=joe

--HG--
extra : rebase_source : d826780c34692d333442b6bf563791b53bf3aa3d
This commit is contained in:
Jeff Muizelaar 2012-04-16 14:37:59 -04:00
parent d997f288c1
commit aca6f7c82d
7 changed files with 23 additions and 3 deletions

View File

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

View File

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

View File

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

View File

@ -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);
}

View File

@ -1406,6 +1406,7 @@ nsLayoutUtils::GetFrameForPoint(nsIFrame* aFrame, nsPoint aPt,
bool aShouldIgnoreSuppression,
bool aIgnoreRootScrollFrame)
{
SAMPLE_LABEL("nsLayoutUtils", "GetFrameForPoint");
nsresult rv;
nsAutoTArray<nsIFrame*,8> 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);

View File

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

View File

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