From ef8463cc9b70483f142a372e9616c00f1d925d12 Mon Sep 17 00:00:00 2001 From: Anthony Jones Date: Mon, 27 Aug 2012 11:31:36 +0200 Subject: [PATCH] Bug 781731 - Fixed passing of text bounds to AdjustedTarget in order to limit the size of the temporary target; r=Bas --- content/canvas/src/nsCanvasRenderingContext2DAzure.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp b/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp index fae0bcf40cd1..05f05b1f6437 100644 --- a/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp +++ b/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp @@ -3102,8 +3102,9 @@ struct NS_STACK_CLASS nsCanvasBidiProcessorAzure : public nsBidiPresUtils::BidiP buffer.mGlyphs = &glyphBuf.front(); buffer.mNumGlyphs = glyphBuf.size(); + Rect bounds(mBoundingBox.x, mBoundingBox.y, mBoundingBox.width, mBoundingBox.height); if (mOp == nsCanvasRenderingContext2DAzure::TEXT_DRAW_OPERATION_FILL) { - AdjustedTarget(mCtx)-> + AdjustedTarget(mCtx, &bounds)-> FillGlyphs(scaledFont, buffer, CanvasGeneralPattern(). ForStyle(mCtx, nsCanvasRenderingContext2DAzure::STYLE_FILL, mCtx->mTarget), @@ -3112,7 +3113,7 @@ struct NS_STACK_CLASS nsCanvasBidiProcessorAzure : public nsBidiPresUtils::BidiP RefPtr path = scaledFont->GetPathForGlyphs(buffer, mCtx->mTarget); const ContextState& state = *mState; - AdjustedTarget(mCtx)-> + AdjustedTarget(mCtx, &bounds)-> Stroke(path, CanvasGeneralPattern(). ForStyle(mCtx, nsCanvasRenderingContext2DAzure::STYLE_STROKE, mCtx->mTarget), StrokeOptions(state.lineWidth, state.lineJoin,