Bug 1304353 - part 1 - Set up the DrawOptions appropriately when painting canvas text for FILL, not only for STROKE. r=bas, a=ritu
authorJonathan Kew <jkew@mozilla.com>
Fri, 23 Sep 2016 13:38:06 +0100
changeset 350417 edb415cd33b8397c65eb504fadc19bffe2fb80a8
parent 350416 865939f4946d80fa532aaa168515a2fe69f9a774
child 350418 5ef5aef99bf169b52aaa2a8f2bf61b60c1bf77ea
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas, ritu
bugs1304353
milestone50.0
Bug 1304353 - part 1 - Set up the DrawOptions appropriately when painting canvas text for FILL, not only for STROKE. r=bas, a=ritu
dom/canvas/CanvasRenderingContext2D.cpp
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -3875,33 +3875,33 @@ struct MOZ_STACK_CLASS CanvasBidiProcess
 
       if (style == Style::FILL) {
         params.context->SetPattern(pattern);
       } else {
         params.textStrokePattern = pattern;
       }
     }
 
+    const ContextState& state = *mState;
+    drawOpts.mAlpha = state.globalAlpha;
+    drawOpts.mCompositionOp = mCtx->UsedOperation();
+    params.drawOpts = &drawOpts;
+
     if (style == Style::STROKE) {
-      const ContextState& state = *mState;
-      drawOpts.mAlpha = state.globalAlpha;
-      drawOpts.mCompositionOp = mCtx->UsedOperation();
-
       strokeOpts.mLineWidth = state.lineWidth;
       strokeOpts.mLineJoin = state.lineJoin;
       strokeOpts.mLineCap = state.lineCap;
       strokeOpts.mMiterLimit = state.miterLimit;
       strokeOpts.mDashLength = state.dash.Length();
       strokeOpts.mDashPattern =
         (strokeOpts.mDashLength > 0) ? state.dash.Elements() : 0;
       strokeOpts.mDashOffset = state.dashOffset;
 
       params.drawMode = DrawMode::GLYPH_STROKE;
       params.strokeOpts = &strokeOpts;
-      params.drawOpts = &drawOpts;
     }
 
     mTextRun->Draw(gfxTextRun::Range(mTextRun.get()), point, params);
   }
 
   // current text run
   UniquePtr<gfxTextRun> mTextRun;