diff options
author | 2016-08-03 07:21:04 -0700 | |
---|---|---|
committer | 2016-08-03 07:21:04 -0700 | |
commit | bb75a951f3e51fcbdf492a3818b7ff82e81a4f73 (patch) | |
tree | a775db94dfd7b9b5fec0592a1c50d47bfd1f2618 /src/core | |
parent | 552bca9afadd81d263041d04e2605d8d897940b6 (diff) |
Don't leave fResScale uninitialized when constructing an SkStroke.
Set a default value of 1. Users can set it with setResScale, but it's better
that the constructor doesn't just leave the field uninitialized otherwise.
R=reed@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2207753003
Review-Url: https://codereview.chromium.org/2207753003
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkStroke.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/SkStroke.cpp b/src/core/SkStroke.cpp index 0f02a9449a..df3e0f98e1 100644 --- a/src/core/SkStroke.cpp +++ b/src/core/SkStroke.cpp @@ -1267,6 +1267,7 @@ void SkPathStroker::cubicTo(const SkPoint& pt1, const SkPoint& pt2, SkStroke::SkStroke() { fWidth = SK_Scalar1; fMiterLimit = SkPaintDefaults_MiterLimit; + fResScale = 1; fCap = SkPaint::kDefault_Cap; fJoin = SkPaint::kDefault_Join; fDoFill = false; @@ -1275,6 +1276,7 @@ SkStroke::SkStroke() { SkStroke::SkStroke(const SkPaint& p) { fWidth = p.getStrokeWidth(); fMiterLimit = p.getStrokeMiter(); + fResScale = 1; fCap = (uint8_t)p.getStrokeCap(); fJoin = (uint8_t)p.getStrokeJoin(); fDoFill = SkToU8(p.getStyle() == SkPaint::kStrokeAndFill_Style); @@ -1283,6 +1285,7 @@ SkStroke::SkStroke(const SkPaint& p) { SkStroke::SkStroke(const SkPaint& p, SkScalar width) { fWidth = width; fMiterLimit = p.getStrokeMiter(); + fResScale = 1; fCap = (uint8_t)p.getStrokeCap(); fJoin = (uint8_t)p.getStrokeJoin(); fDoFill = SkToU8(p.getStyle() == SkPaint::kStrokeAndFill_Style); |