diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 7bcb921e1322..50b13033e157 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -808,7 +808,7 @@ nsDisplayBackground::IsFixedAndCoveringViewport(nsDisplayListBuilder* aBuilder) void nsDisplayBackground::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { - nsPoint offset = aBuilder->ToReferenceFrame(mFrame); + nsPoint offset = ToReferenceFrame(); PRUint32 flags = aBuilder->GetBackgroundPaintFlags(); nsDisplayItem* nextItem = GetAbove(); if (nextItem && nextItem->GetUnderlyingFrame() == mFrame && @@ -824,21 +824,21 @@ nsDisplayBackground::Paint(nsDisplayListBuilder* aBuilder, nsRect nsDisplayBackground::GetBounds(nsDisplayListBuilder* aBuilder) { if (mIsThemed) - return mFrame->GetOverflowRect() + aBuilder->ToReferenceFrame(mFrame); + return mFrame->GetOverflowRect() + ToReferenceFrame(); - return nsRect(aBuilder->ToReferenceFrame(mFrame), mFrame->GetSize()); + return nsRect(ToReferenceFrame(), mFrame->GetSize()); } nsRect nsDisplayOutline::GetBounds(nsDisplayListBuilder* aBuilder) { - return mFrame->GetOverflowRect() + aBuilder->ToReferenceFrame(mFrame); + return mFrame->GetOverflowRect() + ToReferenceFrame(); } void nsDisplayOutline::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { // TODO join outlines together - nsPoint offset = aBuilder->ToReferenceFrame(mFrame); + nsPoint offset = ToReferenceFrame(); nsCSSRendering::PaintOutline(mFrame->PresContext(), *aCtx, mFrame, mVisibleRect, nsRect(offset, mFrame->GetSize()), @@ -852,7 +852,7 @@ nsDisplayOutline::ComputeVisibility(nsDisplayListBuilder* aBuilder, return PR_FALSE; const nsStyleOutline* outline = mFrame->GetStyleOutline(); - nsRect borderBox(aBuilder->ToReferenceFrame(mFrame), mFrame->GetSize()); + nsRect borderBox(ToReferenceFrame(), mFrame->GetSize()); if (borderBox.Contains(aVisibleRegion->GetBounds()) && !nsLayoutUtils::HasNonZeroCorner(outline->mOutlineRadius)) { if (outline->mOutlineOffset >= 0) { @@ -870,7 +870,7 @@ nsDisplayCaret::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { // Note: Because we exist, we know that the caret is visible, so we don't // need to check for the caret's visibility. - mCaret->PaintCaret(aBuilder, aCtx, mFrame, aBuilder->ToReferenceFrame(mFrame)); + mCaret->PaintCaret(aBuilder, aCtx, mFrame, ToReferenceFrame()); } PRBool @@ -880,7 +880,7 @@ nsDisplayBorder::ComputeVisibility(nsDisplayListBuilder* aBuilder, return PR_FALSE; nsRect paddingRect = mFrame->GetPaddingRect() - mFrame->GetPosition() + - aBuilder->ToReferenceFrame(mFrame); + ToReferenceFrame(); const nsStyleBorder *styleBorder; if (paddingRect.Contains(aVisibleRegion->GetBounds()) && !(styleBorder = mFrame->GetStyleBorder())->IsBorderImageLoaded() && @@ -900,7 +900,7 @@ nsDisplayBorder::ComputeVisibility(nsDisplayListBuilder* aBuilder, void nsDisplayBorder::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { - nsPoint offset = aBuilder->ToReferenceFrame(mFrame); + nsPoint offset = ToReferenceFrame(); nsCSSRendering::PaintBorder(mFrame->PresContext(), *aCtx, mFrame, mVisibleRect, nsRect(offset, mFrame->GetSize()), @@ -942,7 +942,7 @@ ComputeDisjointRectangles(const nsRegion& aRegion, void nsDisplayBoxShadowOuter::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { - nsPoint offset = aBuilder->ToReferenceFrame(mFrame); + nsPoint offset = ToReferenceFrame(); nsRect borderRect = nsRect(offset, mFrame->GetSize()); nsPresContext* presContext = mFrame->PresContext(); nsAutoTArray rects; @@ -959,7 +959,7 @@ nsDisplayBoxShadowOuter::Paint(nsDisplayListBuilder* aBuilder, nsRect nsDisplayBoxShadowOuter::GetBounds(nsDisplayListBuilder* aBuilder) { - return mFrame->GetOverflowRect() + aBuilder->ToReferenceFrame(mFrame); + return mFrame->GetOverflowRect() + ToReferenceFrame(); } PRBool @@ -971,7 +971,7 @@ nsDisplayBoxShadowOuter::ComputeVisibility(nsDisplayListBuilder* aBuilder, // Store the actual visible region mVisibleRegion.And(*aVisibleRegion, mVisibleRect); - nsPoint origin = aBuilder->ToReferenceFrame(mFrame); + nsPoint origin = ToReferenceFrame(); nsRect visibleBounds = aVisibleRegion->GetBounds(); nsRect frameRect(origin, mFrame->GetSize()); if (!frameRect.Contains(visibleBounds)) @@ -993,7 +993,7 @@ nsDisplayBoxShadowOuter::ComputeVisibility(nsDisplayListBuilder* aBuilder, void nsDisplayBoxShadowInner::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { - nsPoint offset = aBuilder->ToReferenceFrame(mFrame); + nsPoint offset = ToReferenceFrame(); nsRect borderRect = nsRect(offset, mFrame->GetSize()); nsPresContext* presContext = mFrame->PresContext(); nsAutoTArray rects; @@ -1541,7 +1541,7 @@ already_AddRefed nsDisplayTransform::BuildLayer(nsDisplayListBuilder *aBu LayerManager *aManager) { gfxMatrix newTransformMatrix = - GetResultingTransformMatrix(mFrame, aBuilder->ToReferenceFrame(mFrame), + GetResultingTransformMatrix(mFrame, ToReferenceFrame(), mFrame->PresContext()->AppUnitsPerDevPixel(), nsnull); if (newTransformMatrix.IsSingular()) @@ -1577,7 +1577,7 @@ PRBool nsDisplayTransform::ComputeVisibility(nsDisplayListBuilder *aBuilder, * untransform the visible rect, since we want everything that's painting to * think that it's painting in its original rectangular coordinate space. */ nsRegion untransformedVisible = - UntransformRect(mVisibleRect, mFrame, aBuilder->ToReferenceFrame(mFrame)); + UntransformRect(mVisibleRect, mFrame, ToReferenceFrame()); mStoredList.ComputeVisibility(aBuilder, &untransformedVisible); return PR_TRUE; @@ -1602,7 +1602,7 @@ void nsDisplayTransform::HitTest(nsDisplayListBuilder *aBuilder, */ float factor = nsPresContext::AppUnitsPerCSSPixel(); gfxMatrix matrix = - GetResultingTransformMatrix(mFrame, aBuilder->ToReferenceFrame(mFrame), + GetResultingTransformMatrix(mFrame, ToReferenceFrame(), factor, nsnull); if (matrix.IsSingular()) return; @@ -1660,7 +1660,7 @@ void nsDisplayTransform::HitTest(nsDisplayListBuilder *aBuilder, */ nsRect nsDisplayTransform::GetBounds(nsDisplayListBuilder *aBuilder) { - return mFrame->GetOverflowRect() + aBuilder->ToReferenceFrame(mFrame); + return mFrame->GetOverflowRect() + ToReferenceFrame(); } /* The transform is opaque iff the transform consists solely of scales and diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index 1103b219e03e..fb6985edb306 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -501,8 +501,7 @@ public: * contains the area drawn by this display item */ virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder) { - nsIFrame* f = GetUnderlyingFrame(); - return nsRect(aBuilder->ToReferenceFrame(f), f->GetSize()); + return nsRect(ToReferenceFrame(), GetUnderlyingFrame()->GetSize()); } /** * @return PR_TRUE if the item is definitely opaque --- i.e., paints @@ -640,6 +639,9 @@ public: PRBool RecomputeVisibility(nsDisplayListBuilder* aBuilder, nsRegion* aVisibleRegion); + /** + * Returns the result of aBuilder->ToReferenceFrame(GetUnderlyingFrame()) + */ const nsPoint& ToReferenceFrame() { NS_ASSERTION(mFrame, "No frame?"); return mToReferenceFrame; @@ -1083,7 +1085,7 @@ public: #endif virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { - mPaint(mFrame, aCtx, mVisibleRect, aBuilder->ToReferenceFrame(mFrame)); + mPaint(mFrame, aCtx, mVisibleRect, ToReferenceFrame()); } NS_DISPLAY_DECL_NAME(mName, mType) protected: @@ -1125,7 +1127,7 @@ public: #endif virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { - nsPoint pt = aBuilder->ToReferenceFrame(mFrame); + nsPoint pt = ToReferenceFrame(); nsIRenderingContext::AutoPushTranslation translate(aCtx, pt.x, pt.y); mFrame->PresContext()->PresShell()->PaintCount(mFrameName, aCtx, mFrame->PresContext(), @@ -1193,7 +1195,7 @@ public: virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder) { // The caret returns a rect in the coordinates of mFrame. - return mCaret->GetCaretRect() + aBuilder->ToReferenceFrame(mFrame); + return mCaret->GetCaretRect() + ToReferenceFrame(); } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx); NS_DISPLAY_DECL_NAME("Caret", TYPE_CARET) diff --git a/layout/forms/nsButtonFrameRenderer.cpp b/layout/forms/nsButtonFrameRenderer.cpp index 14a326c9efaf..e202593c1842 100644 --- a/layout/forms/nsButtonFrameRenderer.cpp +++ b/layout/forms/nsButtonFrameRenderer.cpp @@ -114,13 +114,13 @@ private: nsRect nsDisplayButtonBoxShadowOuter::GetBounds(nsDisplayListBuilder* aBuilder) { - return mFrame->GetOverflowRect() + aBuilder->ToReferenceFrame(mFrame); + return mFrame->GetOverflowRect() + ToReferenceFrame(); } void nsDisplayButtonBoxShadowOuter::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { - nsRect frameRect = nsRect(aBuilder->ToReferenceFrame(mFrame), mFrame->GetSize()); + nsRect frameRect = nsRect(ToReferenceFrame(), mFrame->GetSize()); nsRect buttonRect; mBFR->GetButtonRect(frameRect, buttonRect); @@ -178,7 +178,7 @@ void nsDisplayButtonBorderBackground::Paint(nsDisplayListBuilder* aBuilder, { NS_ASSERTION(mFrame, "No frame?"); nsPresContext* pc = mFrame->PresContext(); - nsRect r = nsRect(aBuilder->ToReferenceFrame(mFrame), mFrame->GetSize()); + nsRect r = nsRect(ToReferenceFrame(), mFrame->GetSize()); // draw the border and background inside the focus and outline borders mBFR->PaintBorderAndBackground(pc, *aCtx, mVisibleRect, r, @@ -193,7 +193,7 @@ void nsDisplayButtonForeground::Paint(nsDisplayListBuilder* aBuilder, if (!mFrame->IsThemed(disp) || !presContext->GetTheme()->ThemeDrawsFocusForWidget(presContext, mFrame, disp->mAppearance)) { // draw the focus and outline borders - nsRect r = nsRect(aBuilder->ToReferenceFrame(mFrame), mFrame->GetSize()); + nsRect r = nsRect(ToReferenceFrame(), mFrame->GetSize()); mBFR->PaintOutlineAndFocusBorders(presContext, *aCtx, mVisibleRect, r); } } diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index a57efb9848e6..cd77f7c7e52c 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -1333,7 +1333,7 @@ void nsDisplayComboboxFocus::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { static_cast(mFrame) - ->PaintFocus(*aCtx, aBuilder->ToReferenceFrame(mFrame)); + ->PaintFocus(*aCtx, ToReferenceFrame()); } NS_IMETHODIMP diff --git a/layout/forms/nsFieldSetFrame.cpp b/layout/forms/nsFieldSetFrame.cpp index d41a300118d6..fd9dbbf7a7cc 100644 --- a/layout/forms/nsFieldSetFrame.cpp +++ b/layout/forms/nsFieldSetFrame.cpp @@ -208,7 +208,7 @@ nsDisplayFieldSetBorderBackground::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { static_cast(mFrame)-> - PaintBorderBackground(*aCtx, aBuilder->ToReferenceFrame(mFrame), + PaintBorderBackground(*aCtx, ToReferenceFrame(), mVisibleRect, aBuilder->GetBackgroundPaintFlags()); } diff --git a/layout/generic/nsBulletFrame.cpp b/layout/generic/nsBulletFrame.cpp index 99a04ac87ebf..e38a4207867b 100644 --- a/layout/generic/nsBulletFrame.cpp +++ b/layout/generic/nsBulletFrame.cpp @@ -207,7 +207,7 @@ void nsDisplayBullet::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { static_cast(mFrame)-> - PaintBullet(*aCtx, aBuilder->ToReferenceFrame(mFrame), mVisibleRect); + PaintBullet(*aCtx, ToReferenceFrame(), mVisibleRect); } NS_IMETHODIMP diff --git a/layout/generic/nsCanvasFrame.cpp b/layout/generic/nsCanvasFrame.cpp index 33e4cf994332..9643ffe5aabd 100644 --- a/layout/generic/nsCanvasFrame.cpp +++ b/layout/generic/nsCanvasFrame.cpp @@ -254,7 +254,7 @@ nsDisplayCanvasBackground::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { nsCanvasFrame* frame = static_cast(mFrame); - nsPoint offset = aBuilder->ToReferenceFrame(mFrame); + nsPoint offset = ToReferenceFrame(); nsRect bgClipRect = frame->CanvasArea() + offset; if (NS_GET_A(mExtraBackgroundColor) > 0) { @@ -289,14 +289,14 @@ public: { // This is an overestimate, but that's not a problem. nsCanvasFrame* frame = static_cast(mFrame); - return frame->CanvasArea() + aBuilder->ToReferenceFrame(mFrame); + return frame->CanvasArea() + ToReferenceFrame(); } virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { nsCanvasFrame* frame = static_cast(mFrame); - frame->PaintFocus(*aCtx, aBuilder->ToReferenceFrame(mFrame)); + frame->PaintFocus(*aCtx, ToReferenceFrame()); } NS_DISPLAY_DECL_NAME("CanvasFocus", TYPE_CANVAS_FOCUS) diff --git a/layout/generic/nsCanvasFrame.h b/layout/generic/nsCanvasFrame.h index e067aa647df9..1b42b01dbba3 100644 --- a/layout/generic/nsCanvasFrame.h +++ b/layout/generic/nsCanvasFrame.h @@ -196,7 +196,7 @@ public: virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder) { nsCanvasFrame* frame = static_cast(mFrame); - return frame->CanvasArea() + aBuilder->ToReferenceFrame(mFrame); + return frame->CanvasArea() + ToReferenceFrame(); } virtual void Paint(nsDisplayListBuilder* aBuilder, diff --git a/layout/generic/nsFrameSetFrame.cpp b/layout/generic/nsFrameSetFrame.cpp index d420a913a0ff..a7acbbba74c7 100644 --- a/layout/generic/nsFrameSetFrame.cpp +++ b/layout/generic/nsFrameSetFrame.cpp @@ -1643,7 +1643,7 @@ void nsDisplayFramesetBorder::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { static_cast(mFrame)-> - PaintBorder(*aCtx, aBuilder->ToReferenceFrame(mFrame)); + PaintBorder(*aCtx, ToReferenceFrame()); } NS_IMETHODIMP @@ -1838,6 +1838,7 @@ public: virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx); NS_DISPLAY_DECL_NAME("FramesetBlank", TYPE_FRAMESET_BLANK) }; + void nsDisplayFramesetBlank::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 8114fff5bacc..7b92c218cda9 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -1540,7 +1540,7 @@ InvalidateFixedBackgroundFramesFromList(nsDisplayListBuilder* aBuilder, if (item->IsFixedAndCoveringViewport(aBuilder)) { // FrameLayerBuilder takes care of scrolling these } else { - f->Invalidate(item->GetVisibleRect() - aBuilder->ToReferenceFrame(f)); + f->Invalidate(item->GetVisibleRect() - item->ToReferenceFrame()); } } } diff --git a/layout/generic/nsHTMLCanvasFrame.cpp b/layout/generic/nsHTMLCanvasFrame.cpp index e89e1eb7a28d..2ae0b72ebe9d 100644 --- a/layout/generic/nsHTMLCanvasFrame.cpp +++ b/layout/generic/nsHTMLCanvasFrame.cpp @@ -85,7 +85,7 @@ public: virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder) { nsHTMLCanvasFrame* f = static_cast(GetUnderlyingFrame()); - return f->GetInnerArea() + aBuilder->ToReferenceFrame(f); + return f->GetInnerArea() + ToReferenceFrame(); } virtual already_AddRefed BuildLayer(nsDisplayListBuilder* aBuilder, @@ -241,7 +241,7 @@ nsHTMLCanvasFrame::BuildLayer(nsDisplayListBuilder* aBuilder, LayerManager* aManager, nsDisplayItem* aItem) { - nsRect area = GetContentRect() + aBuilder->ToReferenceFrame(GetParent()); + nsRect area = GetContentRect() - GetPosition() + aItem->ToReferenceFrame(); nsHTMLCanvasElement* element = static_cast(GetContent()); nsIntSize canvasSize = GetCanvasSize(); diff --git a/layout/generic/nsHTMLContainerFrame.cpp b/layout/generic/nsHTMLContainerFrame.cpp index c64afb5f9a6a..066b6b51d09d 100644 --- a/layout/generic/nsHTMLContainerFrame.cpp +++ b/layout/generic/nsHTMLContainerFrame.cpp @@ -131,8 +131,7 @@ nsDisplayTextDecoration::Paint(nsDisplayListBuilder* aBuilder, ascent = metrics.maxAscent; } - nsPoint pt = aBuilder->ToReferenceFrame(mFrame); - + nsPoint pt = ToReferenceFrame(); nsHTMLContainerFrame* f = static_cast(mFrame); if (mDecoration == NS_STYLE_TEXT_DECORATION_UNDERLINE) { gfxFloat underlineOffset = fontGroup->GetUnderlineOffset(); @@ -153,7 +152,7 @@ nsDisplayTextDecoration::Paint(nsDisplayListBuilder* aBuilder, nsRect nsDisplayTextDecoration::GetBounds(nsDisplayListBuilder* aBuilder) { - return mFrame->GetOverflowRect() + aBuilder->ToReferenceFrame(mFrame); + return mFrame->GetOverflowRect() + ToReferenceFrame(); } class nsDisplayTextShadow : public nsDisplayItem { @@ -268,7 +267,7 @@ nsDisplayTextShadow::Paint(nsDisplayListBuilder* aBuilder, nscolor shadowColor = shadow->mHasColor ? shadow->mColor : mFrame->GetStyleColor()->mColor; - nsPoint pt = aBuilder->ToReferenceFrame(mFrame) + + nsPoint pt = ToReferenceFrame() + nsPoint(shadow->mXOffset, shadow->mYOffset); nsPoint linePt; if (mLine) { @@ -325,7 +324,7 @@ nsRect nsDisplayTextShadow::GetBounds(nsDisplayListBuilder* aBuilder) { // Shadows are always painted in the overflow rect - return mFrame->GetOverflowRect() + aBuilder->ToReferenceFrame(mFrame); + return mFrame->GetOverflowRect() + ToReferenceFrame(); } nsresult diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index ba8c328d9142..26ef67bbe5e4 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -1150,7 +1150,7 @@ void nsDisplayImage::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { static_cast(mFrame)-> - PaintImage(*aCtx, aBuilder->ToReferenceFrame(mFrame), mVisibleRect, mImage, + PaintImage(*aCtx, ToReferenceFrame(), mVisibleRect, mImage, aBuilder->ShouldSyncDecodeImages() ? (PRUint32) imgIContainer::FLAG_SYNC_DECODE : (PRUint32) imgIContainer::FLAG_NONE); diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 3b3940c8dc50..bcb838c44211 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -1175,8 +1175,8 @@ nsObjectFrame::PaintPrintPlugin(nsIFrame* aFrame, nsIRenderingContext* aCtx, nsRect nsDisplayPlugin::GetBounds(nsDisplayListBuilder* aBuilder) { - return mFrame->GetContentRect() + - aBuilder->ToReferenceFrame(mFrame->GetParent()); + return mFrame->GetContentRect() - mFrame->GetPosition() + + ToReferenceFrame(); } void @@ -1208,7 +1208,7 @@ nsDisplayPlugin::GetWidgetConfiguration(nsDisplayListBuilder* aBuilder, { nsObjectFrame* f = static_cast(mFrame); nsPoint pluginOrigin = mFrame->GetUsedBorderAndPadding().TopLeft() + - aBuilder->ToReferenceFrame(mFrame); + ToReferenceFrame(); f->ComputeWidgetGeometry(mVisibleRegion, pluginOrigin, aConfigurations); } diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp index 66750bf7a56e..564e4ae9b721 100644 --- a/layout/generic/nsTextFrameThebes.cpp +++ b/layout/generic/nsTextFrameThebes.cpp @@ -3939,11 +3939,11 @@ public: #endif virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder) { - return mFrame->GetOverflowRect() + aBuilder->ToReferenceFrame(mFrame); + return mFrame->GetOverflowRect() + ToReferenceFrame(); } virtual void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, HitTestState* aState, nsTArray *aOutFrames) { - if (nsRect(aBuilder->ToReferenceFrame(mFrame), mFrame->GetSize()).Intersects(aRect)) { + if (nsRect(ToReferenceFrame(), mFrame->GetSize()).Intersects(aRect)) { aOutFrames->AppendElement(mFrame); } } @@ -3962,7 +3962,7 @@ nsDisplayText::Paint(nsDisplayListBuilder* aBuilder, nscoord appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel(); extraVisible.Inflate(appUnitsPerDevPixel, appUnitsPerDevPixel); static_cast(mFrame)-> - PaintText(aCtx, aBuilder->ToReferenceFrame(mFrame), extraVisible); + PaintText(aCtx, ToReferenceFrame(), extraVisible); } NS_IMETHODIMP diff --git a/layout/generic/nsVideoFrame.cpp b/layout/generic/nsVideoFrame.cpp index 9c964a408e23..d6d7011956f2 100644 --- a/layout/generic/nsVideoFrame.cpp +++ b/layout/generic/nsVideoFrame.cpp @@ -180,7 +180,7 @@ nsVideoFrame::BuildLayer(nsDisplayListBuilder* aBuilder, LayerManager* aManager, nsDisplayItem* aItem) { - nsRect area = GetContentRect() + aBuilder->ToReferenceFrame(GetParent()); + nsRect area = GetContentRect() - GetPosition() + aItem->ToReferenceFrame(); nsHTMLVideoElement* element = static_cast(GetContent()); nsIntSize videoSize = element->GetVideoSize(nsIntSize(0, 0)); if (videoSize.width <= 0 || videoSize.height <= 0 || area.IsEmpty()) @@ -380,7 +380,7 @@ public: virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder) { nsIFrame* f = GetUnderlyingFrame(); - return f->GetContentRect() + aBuilder->ToReferenceFrame(f->GetParent()); + return f->GetContentRect() - f->GetPosition() + ToReferenceFrame(); } virtual already_AddRefed BuildLayer(nsDisplayListBuilder* aBuilder, diff --git a/layout/mathml/nsMathMLChar.cpp b/layout/mathml/nsMathMLChar.cpp index 9e66d39f18ed..cda40001521a 100644 --- a/layout/mathml/nsMathMLChar.cpp +++ b/layout/mathml/nsMathMLChar.cpp @@ -1893,7 +1893,7 @@ void nsDisplayMathMLSelectionRect::Paint(nsDisplayListBuilder* aBuilder, mFrame->PresContext()->LookAndFeel()-> GetColor(nsILookAndFeel::eColor_TextSelectBackground, bgColor); aCtx->SetColor(bgColor); - aCtx->FillRect(mRect + aBuilder->ToReferenceFrame(mFrame)); + aCtx->FillRect(mRect + ToReferenceFrame()); } class nsDisplayMathMLCharBackground : public nsDisplayItem { @@ -1922,7 +1922,7 @@ void nsDisplayMathMLCharBackground::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { const nsStyleBorder* border = mStyleContext->GetStyleBorder(); - nsRect rect(mRect + aBuilder->ToReferenceFrame(mFrame)); + nsRect rect(mRect + ToReferenceFrame()); nsCSSRendering::PaintBackgroundWithSC(mFrame->PresContext(), *aCtx, mFrame, mVisibleRect, rect, mStyleContext, *border, @@ -1946,8 +1946,7 @@ public: virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder) { nsRect rect; mChar->GetRect(rect); - nsPoint offset = - aBuilder->ToReferenceFrame(mFrame) + rect.TopLeft(); + nsPoint offset = ToReferenceFrame() + rect.TopLeft(); nsBoundingMetrics bm; mChar->GetBoundingMetrics(bm); return nsRect(offset.x + bm.leftBearing, offset.y, @@ -1958,7 +1957,7 @@ public: nsIRenderingContext* aCtx) { mChar->PaintForeground(mFrame->PresContext(), *aCtx, - aBuilder->ToReferenceFrame(mFrame), mIsSelected); + ToReferenceFrame(), mIsSelected); } NS_DISPLAY_DECL_NAME("MathMLCharForeground", TYPE_MATHML_CHAR_FOREGROUND) @@ -1997,7 +1996,7 @@ void nsDisplayMathMLCharDebug::Paint(nsDisplayListBuilder* aBuilder, PRIntn skipSides = 0; nsPresContext* presContext = mFrame->PresContext(); nsStyleContext* styleContext = mFrame->GetStyleContext(); - nsRect rect = mRect + aBuilder->ToReferenceFrame(mFrame); + nsRect rect = mRect + ToReferenceFrame(); nsCSSRendering::PaintBorder(presContext, *aCtx, mFrame, mVisibleRect, rect, styleContext, skipSides); nsCSSRendering::PaintOutline(presContext, *aCtx, mFrame, diff --git a/layout/mathml/nsMathMLContainerFrame.cpp b/layout/mathml/nsMathMLContainerFrame.cpp index fde57c2d7499..d6978eea60fb 100644 --- a/layout/mathml/nsMathMLContainerFrame.cpp +++ b/layout/mathml/nsMathMLContainerFrame.cpp @@ -145,7 +145,7 @@ void nsDisplayMathMLError::Paint(nsDisplayListBuilder* aBuilder, // Set color and font ... nsLayoutUtils::SetFontFromStyle(aCtx, mFrame->GetStyleContext()); - nsPoint pt = aBuilder->ToReferenceFrame(mFrame); + nsPoint pt = ToReferenceFrame(); aCtx->SetColor(NS_RGB(255,0,0)); aCtx->FillRect(nsRect(pt, mFrame->GetSize())); aCtx->SetColor(NS_RGB(255,255,255)); diff --git a/layout/mathml/nsMathMLFrame.cpp b/layout/mathml/nsMathMLFrame.cpp index c831d4f66365..1cca1616a4ab 100644 --- a/layout/mathml/nsMathMLFrame.cpp +++ b/layout/mathml/nsMathMLFrame.cpp @@ -476,7 +476,7 @@ void nsDisplayMathMLBoundingMetrics::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { aCtx->SetColor(NS_RGB(0,0,255)); - aCtx->DrawRect(mRect + aBuilder->ToReferenceFrame(mFrame)); + aCtx->DrawRect(mRect + ToReferenceFrame()); } nsresult @@ -522,7 +522,7 @@ void nsDisplayMathMLBar::Paint(nsDisplayListBuilder* aBuilder, { // paint the bar with the current text color aCtx->SetColor(mFrame->GetStyleColor()->mColor); - aCtx->FillRect(mRect + aBuilder->ToReferenceFrame(mFrame)); + aCtx->FillRect(mRect + ToReferenceFrame()); } nsresult diff --git a/layout/mathml/nsMathMLmencloseFrame.cpp b/layout/mathml/nsMathMLmencloseFrame.cpp index caa6efb4b71e..30bf0f796f17 100644 --- a/layout/mathml/nsMathMLmencloseFrame.cpp +++ b/layout/mathml/nsMathMLmencloseFrame.cpp @@ -767,8 +767,7 @@ void nsDisplayNotation::Paint(nsDisplayListBuilder* aBuilder, { // get the gfxRect nsPresContext* presContext = mFrame->PresContext(); - gfxRect rect = presContext-> - AppUnitsToGfxUnits(mRect + aBuilder->ToReferenceFrame(mFrame)); + gfxRect rect = presContext->AppUnitsToGfxUnits(mRect + ToReferenceFrame()); // paint the frame with the current text color aCtx->SetColor(mFrame->GetStyleColor()->mColor); diff --git a/layout/mathml/nsMathMLmfracFrame.cpp b/layout/mathml/nsMathMLmfracFrame.cpp index 4e7aa43aca3c..60e7152b6c7d 100644 --- a/layout/mathml/nsMathMLmfracFrame.cpp +++ b/layout/mathml/nsMathMLmfracFrame.cpp @@ -610,8 +610,7 @@ void nsDisplayMathMLSlash::Paint(nsDisplayListBuilder* aBuilder, { // get the gfxRect nsPresContext* presContext = mFrame->PresContext(); - gfxRect rect = presContext-> - AppUnitsToGfxUnits(mRect + aBuilder->ToReferenceFrame(mFrame)); + gfxRect rect = presContext->AppUnitsToGfxUnits(mRect + ToReferenceFrame()); // paint with the current text color aCtx->SetColor(mFrame->GetStyleColor()->mColor); diff --git a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp index 838aad261bbf..b70af880ea32 100644 --- a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp +++ b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp @@ -443,7 +443,7 @@ nsDisplaySVG::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, HitTestState* aState, nsTArray *aOutFrames) { nsSVGOuterSVGFrame *outerSVGFrame = static_cast(mFrame); - nsRect rectAtOrigin = aRect - aBuilder->ToReferenceFrame(mFrame); + nsRect rectAtOrigin = aRect - ToReferenceFrame(); nsRect thisRect(nsPoint(0,0), outerSVGFrame->GetSize()); if (!thisRect.Intersects(rectAtOrigin)) return; @@ -464,7 +464,7 @@ nsDisplaySVG::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { static_cast(mFrame)-> - Paint(*aCtx, mVisibleRect, aBuilder->ToReferenceFrame(mFrame)); + Paint(*aCtx, mVisibleRect, ToReferenceFrame()); } // helper diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index 0605dcdad6bf..f1f576c94af0 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -411,7 +411,7 @@ void nsDisplayTableCellBackground::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { static_cast(mFrame)-> - PaintBackground(*aCtx, mVisibleRect, aBuilder->ToReferenceFrame(mFrame), + PaintBackground(*aCtx, mVisibleRect, ToReferenceFrame(), aBuilder->GetBackgroundPaintFlags()); } diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index 2f745313a615..88ed51839cf3 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -1090,7 +1090,7 @@ nsTableFrame::GetAdditionalChildListName(PRInt32 aIndex) const nsRect nsDisplayTableItem::GetBounds(nsDisplayListBuilder* aBuilder) { - return mFrame->GetOverflowRect() + aBuilder->ToReferenceFrame(mFrame); + return mFrame->GetOverflowRect() + ToReferenceFrame(); } PRBool @@ -1143,7 +1143,7 @@ nsDisplayTableBorderBackground::Paint(nsDisplayListBuilder* aBuilder, { static_cast(mFrame)-> PaintTableBorderBackground(*aCtx, mVisibleRect, - aBuilder->ToReferenceFrame(mFrame), + ToReferenceFrame(), aBuilder->GetBackgroundPaintFlags()); } diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp index 85e707b20e24..5c30d2437d51 100644 --- a/layout/tables/nsTableRowFrame.cpp +++ b/layout/tables/nsTableRowFrame.cpp @@ -598,11 +598,10 @@ nsDisplayTableRowBackground::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(mFrame); - nsPoint pt = aBuilder->ToReferenceFrame(mFrame); TableBackgroundPainter painter(tableFrame, TableBackgroundPainter::eOrigin_TableRow, mFrame->PresContext(), *aCtx, - mVisibleRect, pt, + mVisibleRect, ToReferenceFrame(), aBuilder->GetBackgroundPaintFlags()); painter.PaintRow(static_cast(mFrame)); } diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index fc133bba59d4..2b1779fa9589 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -188,11 +188,10 @@ nsDisplayTableRowGroupBackground::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(mFrame); - nsPoint pt = aBuilder->ToReferenceFrame(mFrame); TableBackgroundPainter painter(tableFrame, TableBackgroundPainter::eOrigin_TableRowGroup, mFrame->PresContext(), *aCtx, - mVisibleRect, pt, + mVisibleRect, ToReferenceFrame(), aBuilder->GetBackgroundPaintFlags()); painter.PaintRowGroup(static_cast(mFrame)); } diff --git a/layout/xul/base/src/nsBoxFrame.cpp b/layout/xul/base/src/nsBoxFrame.cpp index 7527e273ba25..f464abfe6037 100644 --- a/layout/xul/base/src/nsBoxFrame.cpp +++ b/layout/xul/base/src/nsBoxFrame.cpp @@ -1278,7 +1278,7 @@ public: HitTestState* aState, nsTArray *aOutFrames) { nsPoint rectCenter(aRect.x + aRect.width / 2, aRect.y + aRect.height / 2); static_cast(mFrame)-> - DisplayDebugInfoFor(this, rectCenter - aBuilder->ToReferenceFrame(mFrame)); + DisplayDebugInfoFor(this, rectCenter - ToReferenceFrame()); aOutFrames->AppendElement(this); } virtual void Paint(nsDisplayListBuilder* aBuilder @@ -1291,7 +1291,7 @@ nsDisplayXULDebug::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { static_cast(mFrame)-> - PaintXULDebugOverlay(*aCtx, aBuilder->ToReferenceFrame(mFrame)); + PaintXULDebugOverlay(*aCtx, ToReferenceFrame()); } static void @@ -1318,7 +1318,7 @@ nsBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, "XULDebugBackground")); NS_ENSURE_SUCCESS(rv, rv); rv = aLists.Outlines()->AppendNewToTop(new (aBuilder) - nsDisplayXULDebug(Builder this)); + nsDisplayXULDebug(aBuilder, this)); NS_ENSURE_SUCCESS(rv, rv); } #endif diff --git a/layout/xul/base/src/nsGroupBoxFrame.cpp b/layout/xul/base/src/nsGroupBoxFrame.cpp index 0dc0a41441a1..c212be459cd9 100644 --- a/layout/xul/base/src/nsGroupBoxFrame.cpp +++ b/layout/xul/base/src/nsGroupBoxFrame.cpp @@ -132,8 +132,7 @@ nsDisplayXULGroupBackground::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { static_cast(mFrame)-> - PaintBorderBackground(*aCtx, aBuilder->ToReferenceFrame(mFrame), - mVisibleRect); + PaintBorderBackground(*aCtx, ToReferenceFrame(), mVisibleRect); } NS_IMETHODIMP diff --git a/layout/xul/base/src/nsImageBoxFrame.cpp b/layout/xul/base/src/nsImageBoxFrame.cpp index 56c347c762d5..72c452ecbf4e 100644 --- a/layout/xul/base/src/nsImageBoxFrame.cpp +++ b/layout/xul/base/src/nsImageBoxFrame.cpp @@ -333,7 +333,7 @@ void nsDisplayXULImage::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { static_cast(mFrame)-> - PaintImage(*aCtx, mVisibleRect, aBuilder->ToReferenceFrame(mFrame), + PaintImage(*aCtx, mVisibleRect, ToReferenceFrame(), aBuilder->ShouldSyncDecodeImages() ? (PRUint32) imgIContainer::FLAG_SYNC_DECODE : (PRUint32) imgIContainer::FLAG_NONE); diff --git a/layout/xul/base/src/nsTextBoxFrame.cpp b/layout/xul/base/src/nsTextBoxFrame.cpp index a3309d649e10..9d1c16c6c9d0 100644 --- a/layout/xul/base/src/nsTextBoxFrame.cpp +++ b/layout/xul/base/src/nsTextBoxFrame.cpp @@ -353,12 +353,12 @@ nsDisplayXULTextBox::Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx) { static_cast(mFrame)-> - PaintTitle(*aCtx, mVisibleRect, aBuilder->ToReferenceFrame(mFrame)); + PaintTitle(*aCtx, mVisibleRect, ToReferenceFrame()); } nsRect nsDisplayXULTextBox::GetBounds(nsDisplayListBuilder* aBuilder) { - return mFrame->GetOverflowRect() + aBuilder->ToReferenceFrame(mFrame); + return mFrame->GetOverflowRect() + ToReferenceFrame(); } NS_IMETHODIMP diff --git a/layout/xul/base/src/tree/src/nsTreeColFrame.cpp b/layout/xul/base/src/tree/src/nsTreeColFrame.cpp index f0bb8a00ea1e..1863365a1710 100644 --- a/layout/xul/base/src/tree/src/nsTreeColFrame.cpp +++ b/layout/xul/base/src/tree/src/nsTreeColFrame.cpp @@ -110,7 +110,7 @@ void nsDisplayXULTreeColSplitterTarget::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, HitTestState* aState, nsTArray *aOutFrames) { - nsRect rect = aRect - aBuilder->ToReferenceFrame(mFrame); + nsRect rect = aRect - ToReferenceFrame(); // If we are in either in the first 4 pixels or the last 4 pixels, we're going to // do something really strange. Check for an adjacent splitter. PRBool left = PR_FALSE;