From 2a776a69a276def52a1cf78b688255d2e849c0d1 Mon Sep 17 00:00:00 2001 From: Anthony Jones Date: Sun, 2 Sep 2012 19:07:05 -0400 Subject: [PATCH] Bug 781731 - Fix 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,