Bug 1304539 - Use AdjustedDrawTarget to draw text. r=mstange
authorEthan Lin <ethlin@mozilla.com>
Fri, 23 Sep 2016 18:37:00 +0200
changeset 315946 2ac1c5fdaef5e92a9c3e766947ba48bf44f09b2b
parent 315945 941e03a4876faedc82ff5092ed31d1c47804d349
child 315947 1422dee77e6082162cbd2ec1372c6a1b089512fa
push id20634
push usercbook@mozilla.com
push dateFri, 30 Sep 2016 10:10:13 +0000
treeherderfx-team@afe79b010d13 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1304539
milestone52.0a1
Bug 1304539 - Use AdjustedDrawTarget to draw text. r=mstange
dom/canvas/CanvasRenderingContext2D.cpp
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -3975,18 +3975,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;