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>
diff --git a/samplecode/SamplePath.cpp b/samplecode/SamplePath.cpp
index 40c350f..6438dcf 100644
--- a/samplecode/SamplePath.cpp
+++ b/samplecode/SamplePath.cpp
@@ -338,6 +338,7 @@
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 @@
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 @@
SkPath path;
this->makePath(&path);
+ fStrokePaint.setStrokeWidth(fWidth);
fStrokePaint.setStrokeJoin((SkPaint::Join)fJoinType);
fStrokePaint.setStrokeCap((SkPaint::Cap)fCapType);