зеркало из https://github.com/mozilla/pjs.git
Bug 584282. Use nsDisplayItem::ToReferenceFrame() instead of calling nsDisplayListBuilder::ToReferenceFrame, wherever possible. r=tnikkel,a=dbaron
--HG-- extra : rebase_source : 730ba8640cb37bd8484ff069b5d6fd46d9bc3e84
This commit is contained in:
Родитель
4b2e3494b8
Коммит
64c4e38da6
|
@ -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<nsRect,10> 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<nsRect,10> rects;
|
||||
|
@ -1541,7 +1541,7 @@ already_AddRefed<Layer> 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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1333,7 +1333,7 @@ void nsDisplayComboboxFocus::Paint(nsDisplayListBuilder* aBuilder,
|
|||
nsIRenderingContext* aCtx)
|
||||
{
|
||||
static_cast<nsComboboxControlFrame*>(mFrame)
|
||||
->PaintFocus(*aCtx, aBuilder->ToReferenceFrame(mFrame));
|
||||
->PaintFocus(*aCtx, ToReferenceFrame());
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -208,7 +208,7 @@ nsDisplayFieldSetBorderBackground::Paint(nsDisplayListBuilder* aBuilder,
|
|||
nsIRenderingContext* aCtx)
|
||||
{
|
||||
static_cast<nsFieldSetFrame*>(mFrame)->
|
||||
PaintBorderBackground(*aCtx, aBuilder->ToReferenceFrame(mFrame),
|
||||
PaintBorderBackground(*aCtx, ToReferenceFrame(),
|
||||
mVisibleRect, aBuilder->GetBackgroundPaintFlags());
|
||||
}
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ void nsDisplayBullet::Paint(nsDisplayListBuilder* aBuilder,
|
|||
nsIRenderingContext* aCtx)
|
||||
{
|
||||
static_cast<nsBulletFrame*>(mFrame)->
|
||||
PaintBullet(*aCtx, aBuilder->ToReferenceFrame(mFrame), mVisibleRect);
|
||||
PaintBullet(*aCtx, ToReferenceFrame(), mVisibleRect);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -254,7 +254,7 @@ nsDisplayCanvasBackground::Paint(nsDisplayListBuilder* aBuilder,
|
|||
nsIRenderingContext* aCtx)
|
||||
{
|
||||
nsCanvasFrame* frame = static_cast<nsCanvasFrame*>(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<nsCanvasFrame*>(mFrame);
|
||||
return frame->CanvasArea() + aBuilder->ToReferenceFrame(mFrame);
|
||||
return frame->CanvasArea() + ToReferenceFrame();
|
||||
}
|
||||
|
||||
virtual void Paint(nsDisplayListBuilder* aBuilder,
|
||||
nsIRenderingContext* aCtx)
|
||||
{
|
||||
nsCanvasFrame* frame = static_cast<nsCanvasFrame*>(mFrame);
|
||||
frame->PaintFocus(*aCtx, aBuilder->ToReferenceFrame(mFrame));
|
||||
frame->PaintFocus(*aCtx, ToReferenceFrame());
|
||||
}
|
||||
|
||||
NS_DISPLAY_DECL_NAME("CanvasFocus", TYPE_CANVAS_FOCUS)
|
||||
|
|
|
@ -196,7 +196,7 @@ public:
|
|||
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder)
|
||||
{
|
||||
nsCanvasFrame* frame = static_cast<nsCanvasFrame*>(mFrame);
|
||||
return frame->CanvasArea() + aBuilder->ToReferenceFrame(mFrame);
|
||||
return frame->CanvasArea() + ToReferenceFrame();
|
||||
}
|
||||
|
||||
virtual void Paint(nsDisplayListBuilder* aBuilder,
|
||||
|
|
|
@ -1643,7 +1643,7 @@ void nsDisplayFramesetBorder::Paint(nsDisplayListBuilder* aBuilder,
|
|||
nsIRenderingContext* aCtx)
|
||||
{
|
||||
static_cast<nsHTMLFramesetBorderFrame*>(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)
|
||||
{
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ public:
|
|||
|
||||
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder) {
|
||||
nsHTMLCanvasFrame* f = static_cast<nsHTMLCanvasFrame*>(GetUnderlyingFrame());
|
||||
return f->GetInnerArea() + aBuilder->ToReferenceFrame(f);
|
||||
return f->GetInnerArea() + ToReferenceFrame();
|
||||
}
|
||||
|
||||
virtual already_AddRefed<Layer> 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<nsHTMLCanvasElement*>(GetContent());
|
||||
nsIntSize canvasSize = GetCanvasSize();
|
||||
|
||||
|
|
|
@ -131,8 +131,7 @@ nsDisplayTextDecoration::Paint(nsDisplayListBuilder* aBuilder,
|
|||
ascent = metrics.maxAscent;
|
||||
}
|
||||
|
||||
nsPoint pt = aBuilder->ToReferenceFrame(mFrame);
|
||||
|
||||
nsPoint pt = ToReferenceFrame();
|
||||
nsHTMLContainerFrame* f = static_cast<nsHTMLContainerFrame*>(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
|
||||
|
|
|
@ -1151,7 +1151,7 @@ void
|
|||
nsDisplayImage::Paint(nsDisplayListBuilder* aBuilder,
|
||||
nsIRenderingContext* aCtx) {
|
||||
static_cast<nsImageFrame*>(mFrame)->
|
||||
PaintImage(*aCtx, aBuilder->ToReferenceFrame(mFrame), mVisibleRect, mImage,
|
||||
PaintImage(*aCtx, ToReferenceFrame(), mVisibleRect, mImage,
|
||||
aBuilder->ShouldSyncDecodeImages()
|
||||
? (PRUint32) imgIContainer::FLAG_SYNC_DECODE
|
||||
: (PRUint32) imgIContainer::FLAG_NONE);
|
||||
|
|
|
@ -1172,8 +1172,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
|
||||
|
@ -1205,7 +1205,7 @@ nsDisplayPlugin::GetWidgetConfiguration(nsDisplayListBuilder* aBuilder,
|
|||
{
|
||||
nsObjectFrame* f = static_cast<nsObjectFrame*>(mFrame);
|
||||
nsPoint pluginOrigin = mFrame->GetUsedBorderAndPadding().TopLeft() +
|
||||
aBuilder->ToReferenceFrame(mFrame);
|
||||
ToReferenceFrame();
|
||||
f->ComputeWidgetGeometry(mVisibleRegion, pluginOrigin, aConfigurations);
|
||||
}
|
||||
|
||||
|
|
|
@ -3938,11 +3938,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<nsIFrame*> *aOutFrames) {
|
||||
if (nsRect(aBuilder->ToReferenceFrame(mFrame), mFrame->GetSize()).Intersects(aRect)) {
|
||||
if (nsRect(ToReferenceFrame(), mFrame->GetSize()).Intersects(aRect)) {
|
||||
aOutFrames->AppendElement(mFrame);
|
||||
}
|
||||
}
|
||||
|
@ -3961,7 +3961,7 @@ nsDisplayText::Paint(nsDisplayListBuilder* aBuilder,
|
|||
nscoord appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
|
||||
extraVisible.Inflate(appUnitsPerDevPixel, appUnitsPerDevPixel);
|
||||
static_cast<nsTextFrame*>(mFrame)->
|
||||
PaintText(aCtx, aBuilder->ToReferenceFrame(mFrame), extraVisible);
|
||||
PaintText(aCtx, ToReferenceFrame(), extraVisible);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -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<nsHTMLVideoElement*>(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<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
|
||||
|
|
|
@ -1947,7 +1947,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 {
|
||||
|
@ -1976,7 +1976,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,
|
||||
|
@ -2000,8 +2000,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,
|
||||
|
@ -2012,7 +2011,7 @@ public:
|
|||
nsIRenderingContext* aCtx)
|
||||
{
|
||||
mChar->PaintForeground(mFrame->PresContext(), *aCtx,
|
||||
aBuilder->ToReferenceFrame(mFrame), mIsSelected);
|
||||
ToReferenceFrame(), mIsSelected);
|
||||
}
|
||||
|
||||
NS_DISPLAY_DECL_NAME("MathMLCharForeground", TYPE_MATHML_CHAR_FOREGROUND)
|
||||
|
@ -2051,7 +2050,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,
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -443,7 +443,7 @@ nsDisplaySVG::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
|
|||
HitTestState* aState, nsTArray<nsIFrame*> *aOutFrames)
|
||||
{
|
||||
nsSVGOuterSVGFrame *outerSVGFrame = static_cast<nsSVGOuterSVGFrame*>(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<nsSVGOuterSVGFrame*>(mFrame)->
|
||||
Paint(*aCtx, mVisibleRect, aBuilder->ToReferenceFrame(mFrame));
|
||||
Paint(*aCtx, mVisibleRect, ToReferenceFrame());
|
||||
}
|
||||
|
||||
// helper
|
||||
|
|
|
@ -411,7 +411,7 @@ void nsDisplayTableCellBackground::Paint(nsDisplayListBuilder* aBuilder,
|
|||
nsIRenderingContext* aCtx)
|
||||
{
|
||||
static_cast<nsTableCellFrame*>(mFrame)->
|
||||
PaintBackground(*aCtx, mVisibleRect, aBuilder->ToReferenceFrame(mFrame),
|
||||
PaintBackground(*aCtx, mVisibleRect, ToReferenceFrame(),
|
||||
aBuilder->GetBackgroundPaintFlags());
|
||||
}
|
||||
|
||||
|
|
|
@ -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<nsTableFrame*>(mFrame)->
|
||||
PaintTableBorderBackground(*aCtx, mVisibleRect,
|
||||
aBuilder->ToReferenceFrame(mFrame),
|
||||
ToReferenceFrame(),
|
||||
aBuilder->GetBackgroundPaintFlags());
|
||||
}
|
||||
|
||||
|
|
|
@ -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<nsTableRowFrame*>(mFrame));
|
||||
}
|
||||
|
|
|
@ -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<nsTableRowGroupFrame*>(mFrame));
|
||||
}
|
||||
|
|
|
@ -1278,7 +1278,7 @@ public:
|
|||
HitTestState* aState, nsTArray<nsIFrame*> *aOutFrames) {
|
||||
nsPoint rectCenter(aRect.x + aRect.width / 2, aRect.y + aRect.height / 2);
|
||||
static_cast<nsBoxFrame*>(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<nsBoxFrame*>(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
|
||||
|
|
|
@ -132,8 +132,7 @@ nsDisplayXULGroupBackground::Paint(nsDisplayListBuilder* aBuilder,
|
|||
nsIRenderingContext* aCtx)
|
||||
{
|
||||
static_cast<nsGroupBoxFrame*>(mFrame)->
|
||||
PaintBorderBackground(*aCtx, aBuilder->ToReferenceFrame(mFrame),
|
||||
mVisibleRect);
|
||||
PaintBorderBackground(*aCtx, ToReferenceFrame(), mVisibleRect);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -333,7 +333,7 @@ void nsDisplayXULImage::Paint(nsDisplayListBuilder* aBuilder,
|
|||
nsIRenderingContext* aCtx)
|
||||
{
|
||||
static_cast<nsImageBoxFrame*>(mFrame)->
|
||||
PaintImage(*aCtx, mVisibleRect, aBuilder->ToReferenceFrame(mFrame),
|
||||
PaintImage(*aCtx, mVisibleRect, ToReferenceFrame(),
|
||||
aBuilder->ShouldSyncDecodeImages()
|
||||
? (PRUint32) imgIContainer::FLAG_SYNC_DECODE
|
||||
: (PRUint32) imgIContainer::FLAG_NONE);
|
||||
|
|
|
@ -353,12 +353,12 @@ nsDisplayXULTextBox::Paint(nsDisplayListBuilder* aBuilder,
|
|||
nsIRenderingContext* aCtx)
|
||||
{
|
||||
static_cast<nsTextBoxFrame*>(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
|
||||
|
|
|
@ -110,7 +110,7 @@ void
|
|||
nsDisplayXULTreeColSplitterTarget::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
|
||||
HitTestState* aState, nsTArray<nsIFrame*> *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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче