Bug 1304353 - part 1 - Set up the DrawOptions appropriately when painting canvas text for FILL, not only for STROKE. r=bas
authorJonathan Kew <jkew@mozilla.com>
Fri, 23 Sep 2016 13:38:06 +0100
changeset 315163 7c4c4312a8c639feb1be77c32e709625ce58ac1d
parent 315162 e15d82589f84255ef9e428ff2fafa2f7f3bade88
child 315164 59a8a58754d58667c5484a2a4b8c889a640a2f89
push id32563
push userihsiao@mozilla.com
push dateMon, 26 Sep 2016 11:18:33 +0000
treeherderautoland@eb840c87b5fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas
bugs1304353
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1304353 - part 1 - Set up the DrawOptions appropriately when painting canvas text for FILL, not only for STROKE. r=bas
dom/canvas/CanvasRenderingContext2D.cpp
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -4004,33 +4004,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
   RefPtr<gfxTextRun> mTextRun;