Bug 1304539 - Use AdjustedDrawTarget to draw text. r=mstange, a=ritu
authorEthan Lin <ethlin@mozilla.com>
Fri, 23 Sep 2016 18:37:00 +0200
changeset 348416 4103b6b482e3
parent 348415 f9f2f088a3d9
child 348417 2c8342768f77
push id6438
push userryanvm@gmail.com
push dateFri, 30 Sep 2016 19:58:37 +0000
treeherdermozilla-beta@2c8342768f77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, ritu
bugs1304539
milestone50.0
Bug 1304539 - Use AdjustedDrawTarget to draw text. r=mstange, a=ritu
dom/canvas/CanvasRenderingContext2D.cpp
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -3846,18 +3846,19 @@ struct MOZ_STACK_CLASS CanvasBidiProcess
 
     // Defer the tasks to gfxTextRun which will handle color/svg-in-ot fonts
     // appropriately.
     StrokeOptions strokeOpts;
     DrawOptions drawOpts;
     Style style = (mOp == CanvasRenderingContext2D::TextDrawOperation::FILL)
                     ? Style::FILL
                     : Style::STROKE;
+    AdjustedTarget target(mCtx);
     RefPtr<gfxContext> thebes =
-      gfxContext::CreatePreservingTransformOrNull(mCtx->mTarget);
+      gfxContext::CreatePreservingTransformOrNull(target);
     gfxTextRun::DrawParams params(thebes);
 
     if (mState->StyleIsColor(style)) { // Color
       nscolor fontColor = mState->colorStyles[style];
       if (style == Style::FILL) {
         params.context->SetColor(Color::FromABGR(fontColor));
       } else {
         params.textStrokeColor = fontColor;