Backed out changeset 1e6d52401dd2

This commit is contained in:
Dão Gottwald
2009-09-04 15:32:17 +02:00
parent b40db5e2d3
commit 77730b0314
9 changed files with 74 additions and 55 deletions

View File

@@ -155,7 +155,7 @@ class nsDisplayTextShadow : public nsDisplayItem {
public:
nsDisplayTextShadow(nsHTMLContainerFrame* aFrame, const PRUint8 aDecoration,
const nscolor& aColor, nsLineBox* aLine,
const nscoord& aBlurRadius, const nsPoint& aOffset)
const nscoord& aBlurRadius, const gfxPoint& aOffset)
: nsDisplayItem(aFrame), mLine(aLine), mColor(aColor),
mDecorationFlags(aDecoration),
mBlurRadius(aBlurRadius), mOffset(aOffset) {
@@ -174,7 +174,7 @@ private:
nscolor mColor;
PRUint8 mDecorationFlags;
nscoord mBlurRadius; // App units
nsPoint mOffset; // App units
gfxPoint mOffset; // App units
};
void
@@ -192,17 +192,21 @@ nsDisplayTextShadow::Paint(nsDisplayListBuilder* aBuilder,
if (!firstFont)
return; // OOM
const gfxFont::Metrics& metrics = firstFont->GetMetrics();
nsPoint pt = aBuilder->ToReferenceFrame(mFrame) + nsPoint(mOffset.x, mOffset.y);
nsHTMLContainerFrame* f = static_cast<nsHTMLContainerFrame*>(mFrame);
nsPoint pt = aBuilder->ToReferenceFrame(mFrame) + mOffset;
nsMargin bp = f->GetUsedBorderAndPadding();
nscoord innerWidthInAppUnits = (mFrame->GetSize().width - bp.LeftRight());
nsRect shadowRect = mFrame->GetContentRect() - mFrame->GetPosition() + pt;
gfxRect shadowRect = gfxRect(pt.x, pt.y, innerWidthInAppUnits, mFrame->GetSize().height);
gfxContext* thebesCtx = aCtx->ThebesContext();
gfxRect dirtyRect(aDirtyRect.x, aDirtyRect.y, aDirtyRect.width, aDirtyRect.height);
nsContextBoxBlur contextBoxBlur;
gfxContext* shadowCtx = contextBoxBlur.Init(shadowRect, mBlurRadius,
mFrame->PresContext()->AppUnitsPerDevPixel(),
thebesCtx, aDirtyRect);
thebesCtx, dirtyRect);
if (!shadowCtx)
return;
@@ -275,7 +279,7 @@ nsHTMLContainerFrame::DisplayTextDecorations(nsDisplayListBuilder* aBuilder,
else
shadowColor = GetStyleColor()->mColor;
nsPoint offset(shadow->mXOffset, shadow->mYOffset);
gfxPoint offset = gfxPoint(shadow->mXOffset, shadow->mYOffset);
// Add it to the display list so it is painted underneath the text and all decorations
nsresult rv = aBelowTextDecorations->AppendNewToTop(new (aBuilder)