Index: src/core/SkStrokeRec.cpp |
diff --git a/src/core/SkStrokeRec.cpp b/src/core/SkStrokeRec.cpp |
index 22f0562fe2b8a2ab223045cb2f79dae183b5d07d..95f56b76a6efadd6df3b082113d68a400f36bf97 100644 |
--- a/src/core/SkStrokeRec.cpp |
+++ b/src/core/SkStrokeRec.cpp |
@@ -114,3 +114,16 @@ bool SkStrokeRec::applyToPath(SkPath* dst, const SkPath& src) const { |
stroker.strokePath(src, dst); |
return true; |
} |
+ |
+void SkStrokeRec::applyToPaint(SkPaint* paint) const { |
+ if (fWidth < 0) { // fill |
+ paint->setStyle(SkPaint::kFill_Style); |
+ return; |
+ } |
+ |
+ paint->setStyle(fStrokeAndFill ? SkPaint::kStrokeAndFill_Style : SkPaint::kStroke_Style); |
+ paint->setStrokeWidth(fWidth); |
+ paint->setStrokeMiter(fMiterLimit); |
+ paint->setStrokeCap(fCap); |
+ paint->setStrokeJoin(fJoin); |
+} |