aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SamplePath.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2016-12-15 10:23:42 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-15 16:28:57 +0000
commit1fba70289b7c39b496aa55d9a86b16d3d09e90f9 (patch)
treee003f1226629c061595dd6859cd3b179bce89607 /samplecode/SamplePath.cpp
parent797ef16d82e4e52cff37fa54770fe47db4b3ab6e (diff)
add fatstroke sample
BUG=skia: Change-Id: I7d5d2c76cba8ac566e2900697b913ea18e7695dd Reviewed-on: https://skia-review.googlesource.com/6120 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'samplecode/SamplePath.cpp')
-rw-r--r--samplecode/SamplePath.cpp4
1 files changed, 4 insertions, 0 deletions
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);