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 355767 130a83f1c885540bf15a8f755ca968d3bba656b9
parent 355766 2d7f4fd136fa8d899070e3edf84e85709674f853
child 355768 c0c615ba525b599947e497f31874caf75fda9998
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas, ritu
bugs1304353
milestone51.0a2
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
@@ -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;