From 6ce40d42529b860b546b3a129b69f07261f5634f Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Tue, 3 Jun 2008 15:25:31 -0700 Subject: [PATCH] Eliminate unnecessary reference counting of gfxContext objects. b=433640 r+sr=roc --- layout/base/nsCSSRendering.cpp | 8 ++++---- layout/base/nsLayoutUtils.cpp | 2 +- layout/generic/nsBlockFrame.cpp | 2 +- layout/generic/nsFrame.cpp | 2 +- layout/generic/nsHTMLContainerFrame.cpp | 2 +- layout/generic/nsObjectFrame.cpp | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index 37f38667b03..00aec04bdad 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -2805,7 +2805,7 @@ nsCSSRendering::PaintBorder(nsPresContext* aPresContext, SF(" borderStyles: %d %d %d %d\n", borderStyles[0], borderStyles[1], borderStyles[2], borderStyles[3]); // start drawing - nsRefPtr ctx = aRenderingContext.ThebesContext(); + gfxContext *ctx = aRenderingContext.ThebesContext(); ctx->Save(); @@ -2995,7 +2995,7 @@ nsCSSRendering::PaintOutline(nsPresContext* aPresContext, width / twipsPerPixel }; // start drawing - nsRefPtr ctx = aRenderingContext.ThebesContext(); + gfxContext *ctx = aRenderingContext.ThebesContext(); ctx->Save(); @@ -3739,7 +3739,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsPresContext* aPresContext, anchor.y += bgClipArea.y - aBorderArea.y; } - nsRefPtr ctx = aRenderingContext.ThebesContext(); + gfxContext *ctx = aRenderingContext.ThebesContext(); ctx->Save(); nscoord appUnitsPerPixel = aPresContext->DevPixelsToAppUnits(1); @@ -4033,7 +4033,7 @@ nsCSSRendering::PaintRoundedBackground(nsPresContext* aPresContext, nscoord aTheRadius[4], PRBool aCanPaintNonWhite) { - nsRefPtr ctx = aRenderingContext.ThebesContext(); + gfxContext *ctx = aRenderingContext.ThebesContext(); // needed for our border thickness nscoord appUnitsPerPixel = aPresContext->AppUnitsPerDevPixel(); diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index af3637dc742..807fa87219c 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -2513,7 +2513,7 @@ nsLayoutUtils::DrawImage(nsIRenderingContext* aRenderingContext, nsCOMPtr dc; aRenderingContext->GetDeviceContext(*getter_AddRefs(dc)); - nsRefPtr ctx = aRenderingContext->ThebesContext(); + gfxContext *ctx = aRenderingContext->ThebesContext(); // the dest rect is affected by the current transform; that'll be // handled by Image::Draw(), when we actually set up the rectangle. diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index cfcf7ae9396..98aadcdc823 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -5915,7 +5915,7 @@ nsBlockFrame::PaintTextDecorationLine(nsIRenderingContext& aRenderingContext, // Only paint if we have a positive width if (width > 0) { - nsRefPtr ctx = aRenderingContext.ThebesContext(); + gfxContext *ctx = aRenderingContext.ThebesContext(); gfxPoint pt(PresContext()->AppUnitsToGfxUnits(start + aPt.x), PresContext()->AppUnitsToGfxUnits(aLine->mBounds.y + aPt.y)); gfxSize size(PresContext()->AppUnitsToGfxUnits(width), aSize); diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index f8d8b05c7a3..e0e159d3b21 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -795,7 +795,7 @@ void nsDisplaySelectionOverlay::Paint(nsDisplayListBuilder* aBuilder, gfxRGBA c(color); c.a = .5; - nsRefPtr ctx = aCtx->ThebesContext(); + gfxContext *ctx = aCtx->ThebesContext(); ctx->SetColor(c); nsRect rect(aBuilder->ToReferenceFrame(mFrame), mFrame->GetSize()); diff --git a/layout/generic/nsHTMLContainerFrame.cpp b/layout/generic/nsHTMLContainerFrame.cpp index 949497a8ced..66c11f554cf 100644 --- a/layout/generic/nsHTMLContainerFrame.cpp +++ b/layout/generic/nsHTMLContainerFrame.cpp @@ -239,7 +239,7 @@ nsHTMLContainerFrame::PaintTextDecorationLine( } } nscoord innerWidth = mRect.width - bp.left - bp.right; - nsRefPtr ctx = aRenderingContext.ThebesContext(); + gfxContext *ctx = aRenderingContext.ThebesContext(); gfxPoint pt(PresContext()->AppUnitsToGfxUnits(bp.left + aPt.x), PresContext()->AppUnitsToGfxUnits(bp.top + aPt.y)); gfxSize size(PresContext()->AppUnitsToGfxUnits(innerWidth), aSize); diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 344f6224c0e..d3f8b8a2d23 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -1421,7 +1421,7 @@ nsObjectFrame::PaintPlugin(nsIRenderingContext& aRenderingContext, * to tell the plugin where it is, we dispatch a NPWindow through * |HandleEvent| to tell the plugin when its window moved */ - nsRefPtr ctx = aRenderingContext.ThebesContext(); + gfxContext *ctx = aRenderingContext.ThebesContext(); gfxMatrix ctxMatrix = ctx->CurrentMatrix(); if (ctxMatrix.HasNonTranslation()) { // soo; in the future, we should be able to render