From bb75a951f3e51fcbdf492a3818b7ff82e81a4f73 Mon Sep 17 00:00:00 2001 From: deanm Date: Wed, 3 Aug 2016 07:21:04 -0700 Subject: 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 --- src/core/SkStroke.cpp | 3 +++ 1 file changed, 3 insertions(+) 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); -- cgit v1.2.3