From 1fba70289b7c39b496aa55d9a86b16d3d09e90f9 Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Thu, 15 Dec 2016 10:23:42 -0500 Subject: add fatstroke sample BUG=skia: Change-Id: I7d5d2c76cba8ac566e2900697b913ea18e7695dd Reviewed-on: https://skia-review.googlesource.com/6120 Reviewed-by: Mike Reed Commit-Queue: Mike Reed --- samplecode/SamplePath.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'samplecode/SamplePath.cpp') diff --git a/samplecode/SamplePath.cpp b/samplecode/SamplePath.cpp index 40c350fbd2..6438dcfb7d 100644 --- a/samplecode/SamplePath.cpp +++ b/samplecode/SamplePath.cpp @@ -338,6 +338,7 @@ DEF_SAMPLE( return new ArcToView; ) class FatStroke : public SampleView { bool fClosed, fShowStroke, fShowHidden, fShowSkeleton; int fJoinType, fCapType; + float fWidth = 30; SkPaint fPtsPaint, fHiddenPaint, fSkeletonPaint, fStrokePaint; public: enum { @@ -398,6 +399,8 @@ protected: case '4': this->toggle3(fJoinType); return true; case '5': this->toggle3(fCapType); return true; case '6': this->toggle(fClosed); return true; + case '-': fWidth -= 5; this->inval(nullptr); return true; + case '=': fWidth += 5; this->inval(nullptr); return true; default: break; } } @@ -420,6 +423,7 @@ protected: SkPath path; this->makePath(&path); + fStrokePaint.setStrokeWidth(fWidth); fStrokePaint.setStrokeJoin((SkPaint::Join)fJoinType); fStrokePaint.setStrokeCap((SkPaint::Cap)fCapType); -- cgit v1.2.3