Bug 1304539 - Use AdjustedDrawTarget to draw text. r=mstange a=lizzard
authorEthan Lin <ethlin@mozilla.com>
Mon, 17 Oct 2016 16:21:10 -0700
changeset 342676 2c8f1510d293
parent 342675 a18dedb8c898
child 342677 ea6157b86ae2
push id1217
push userkwierso@gmail.com
push dateMon, 17 Oct 2016 23:22:04 +0000
treeherdermozilla-release@2c8f1510d293 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, lizzard
bugs1304539
milestone49.0.2
Bug 1304539 - Use AdjustedDrawTarget to draw text. r=mstange a=lizzard
dom/canvas/CanvasRenderingContext2D.cpp
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -3607,18 +3607,19 @@ struct MOZ_STACK_CLASS CanvasBidiProcess
 
     mCtx->EnsureTarget();
 
     // If the operation is 'fill' with a simple color, we defer to gfxTextRun
     // which will handle color/svg-in-ot fonts appropriately. Such fonts will
     // not render well via the code below.
     if (mOp == CanvasRenderingContext2D::TextDrawOperation::FILL &&
         mState->StyleIsColor(CanvasRenderingContext2D::Style::FILL)) {
+      AdjustedTarget target(mCtx);
       RefPtr<gfxContext> thebes =
-        gfxContext::ForDrawTargetWithTransform(mCtx->mTarget);
+        gfxContext::ForDrawTargetWithTransform(target);
       nscolor fill = mState->colorStyles[CanvasRenderingContext2D::Style::FILL];
       thebes->SetColor(Color::FromABGR(fill));
       gfxTextRun::DrawParams params(thebes);
       const ContextState& state = *mState;
       DrawOptions drawOpts;
       drawOpts.mAlpha = state.globalAlpha;
       drawOpts.mCompositionOp = mCtx->UsedOperation();
       params.drawOpts = &drawOpts;