From af0ddba78ef982f242e73afaddb8fa7e069b1444 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Wed, 23 Nov 2011 18:48:23 -0800 Subject: [PATCH] Remove the unused context parameter to MeasureCharClippedText. (Bug 627842, patch 10) r=roc --- layout/generic/TextOverflow.cpp | 7 ++----- layout/generic/nsTextFrame.h | 6 ++---- layout/generic/nsTextFrameThebes.cpp | 14 ++++++-------- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/layout/generic/TextOverflow.cpp b/layout/generic/TextOverflow.cpp index 29ba6a226b9c..d509f3081483 100644 --- a/layout/generic/TextOverflow.cpp +++ b/layout/generic/TextOverflow.cpp @@ -105,11 +105,8 @@ IsFullyClipped(nsTextFrame* aFrame, nscoord aLeft, nscoord aRight, if (aLeft <= 0 && aRight <= 0) { return false; } - nsRefPtr rc = - aFrame->PresContext()->PresShell()->GetReferenceRenderingContext(); - return rc && - !aFrame->MeasureCharClippedText(rc->ThebesContext(), aLeft, aRight, - aSnappedLeft, aSnappedRight); + return !aFrame->MeasureCharClippedText(aLeft, aRight, + aSnappedLeft, aSnappedRight); } static bool diff --git a/layout/generic/nsTextFrame.h b/layout/generic/nsTextFrame.h index 36463cdadfb3..daba355eda32 100644 --- a/layout/generic/nsTextFrame.h +++ b/layout/generic/nsTextFrame.h @@ -289,8 +289,7 @@ public: * the method returns false. * @return true if at least one whole grapheme cluster fit between the edges */ - bool MeasureCharClippedText(gfxContext* aCtx, - nscoord aLeftEdge, nscoord aRightEdge, + bool MeasureCharClippedText(nscoord aLeftEdge, nscoord aRightEdge, nscoord* aSnappedLeftEdge, nscoord* aSnappedRightEdge); /** @@ -299,8 +298,7 @@ public: * undefined when the method returns false. * @return true if at least one whole grapheme cluster fit between the edges */ - bool MeasureCharClippedText(gfxContext* aCtx, - PropertyProvider& aProvider, + bool MeasureCharClippedText(PropertyProvider& aProvider, nscoord aLeftEdge, nscoord aRightEdge, PRUint32* aStartOffset, PRUint32* aMaxLength, nscoord* aSnappedLeftEdge, diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp index 2c6860951053..312a37b08f9c 100644 --- a/layout/generic/nsTextFrameThebes.cpp +++ b/layout/generic/nsTextFrameThebes.cpp @@ -5272,13 +5272,12 @@ ComputeTransformedLength(PropertyProvider& aProvider) } bool -nsTextFrame::MeasureCharClippedText(gfxContext* aCtx, - nscoord aLeftEdge, nscoord aRightEdge, +nsTextFrame::MeasureCharClippedText(nscoord aLeftEdge, nscoord aRightEdge, nscoord* aSnappedLeftEdge, nscoord* aSnappedRightEdge) { - // Don't pass in aRenderingContext here, because we need a *reference* - // context and aRenderingContext might have some transform in it + // We need a *reference* rendering context (not one that might have a + // transform), so we don't have a rendering context argument. // XXX get the block and line passed to us somehow! This is slow! gfxSkipCharsIterator iter = EnsureTextRun(nsTextFrame::eInflated); if (!mTextRun) @@ -5290,7 +5289,7 @@ nsTextFrame::MeasureCharClippedText(gfxContext* aCtx, PRUint32 startOffset = provider.GetStart().GetSkippedOffset(); PRUint32 maxLength = ComputeTransformedLength(provider); - return MeasureCharClippedText(aCtx, provider, aLeftEdge, aRightEdge, + return MeasureCharClippedText(provider, aLeftEdge, aRightEdge, &startOffset, &maxLength, aSnappedLeftEdge, aSnappedRightEdge); } @@ -5314,8 +5313,7 @@ static PRUint32 GetClusterLength(gfxTextRun* aTextRun, } bool -nsTextFrame::MeasureCharClippedText(gfxContext* aCtx, - PropertyProvider& aProvider, +nsTextFrame::MeasureCharClippedText(PropertyProvider& aProvider, nscoord aLeftEdge, nscoord aRightEdge, PRUint32* aStartOffset, PRUint32* aMaxLength, @@ -5401,7 +5399,7 @@ nsTextFrame::PaintText(nsRenderingContext* aRenderingContext, nsPoint aPt, PRUint32 startOffset = provider.GetStart().GetSkippedOffset(); PRUint32 maxLength = ComputeTransformedLength(provider); nscoord snappedLeftEdge, snappedRightEdge; - if (!MeasureCharClippedText(ctx, provider, aItem.mLeftEdge, aItem.mRightEdge, + if (!MeasureCharClippedText(provider, aItem.mLeftEdge, aItem.mRightEdge, &startOffset, &maxLength, &snappedLeftEdge, &snappedRightEdge)) { return; }