aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SamplePath.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'samplecode/SamplePath.cpp')
-rw-r--r--samplecode/SamplePath.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/samplecode/SamplePath.cpp b/samplecode/SamplePath.cpp
index 0fb528774b..ec92fdfc1a 100644
--- a/samplecode/SamplePath.cpp
+++ b/samplecode/SamplePath.cpp
@@ -334,7 +334,7 @@ public:
N = 4
};
SkPoint fPts[N];
-
+
FatStroke() : fClosed(false), fShowStroke(true), fShowHidden(false), fShowSkeleton(true),
fJoinType(0), fCapType(0)
{
@@ -343,35 +343,35 @@ public:
fPts[i].fX = 20 + rand.nextUScalar1() * 640;
fPts[i].fY = 20 + rand.nextUScalar1() * 480;
}
-
+
fPtsPaint.setAntiAlias(true);
fPtsPaint.setStrokeWidth(10);
fPtsPaint.setStrokeCap(SkPaint::kRound_Cap);
-
+
fHiddenPaint.setAntiAlias(true);
fHiddenPaint.setStyle(SkPaint::kStroke_Style);
fHiddenPaint.setColor(0xFF0000FF);
-
+
fStrokePaint.setAntiAlias(true);
fStrokePaint.setStyle(SkPaint::kStroke_Style);
fStrokePaint.setStrokeWidth(50);
fStrokePaint.setColor(0x8000FF00);
-
+
fSkeletonPaint.setAntiAlias(true);
fSkeletonPaint.setStyle(SkPaint::kStroke_Style);
fSkeletonPaint.setColor(SK_ColorRED);
}
-
+
void toggle(bool& value) {
value = !value;
this->inval(nullptr);
}
-
+
void toggle3(int& value) {
value = (value + 1) % 3;
this->inval(nullptr);
}
-
+
protected:
// overrides from SkEventSink
bool onQuery(SkEvent* evt) override {
@@ -395,7 +395,7 @@ protected:
}
return this->INHERITED::onQuery(evt);
}
-
+
void makePath(SkPath* path) {
path->moveTo(fPts[0]);
for (int i = 1; i < N; ++i) {
@@ -405,7 +405,7 @@ protected:
path->close();
}
}
-
+
void onDrawContent(SkCanvas* canvas) override {
canvas->drawColor(0xFFEEEEEE);
@@ -429,7 +429,7 @@ protected:
}
canvas->drawPoints(SkCanvas::kPoints_PointMode, N, fPts, fPtsPaint);
}
-
+
bool onClick(Click* click) override {
int32_t index;
if (click->fMeta.findS32("index", &index)) {
@@ -440,7 +440,7 @@ protected:
}
return false;
}
-
+
SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) override {
const SkScalar tol = 4;
const SkRect r = SkRect::MakeXYWH(x - tol, y - tol, tol * 2, tol * 2);
@@ -453,7 +453,7 @@ protected:
}
return this->INHERITED::onFindClickHandler(x, y, modi);
}
-
+
private:
typedef SampleView INHERITED;
};