aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--samplecode/SamplePath.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/samplecode/SamplePath.cpp b/samplecode/SamplePath.cpp
index ddfbb71659..69b48fad58 100644
--- a/samplecode/SamplePath.cpp
+++ b/samplecode/SamplePath.cpp
@@ -87,8 +87,18 @@ public:
int fDStroke, fStroke, fMinStroke, fMaxStroke;
SkPath fPath[6];
bool fShowHairline;
+ bool fOnce;
PathView() {
+ fOnce = false;
+ }
+
+ void init() {
+ if (fOnce) {
+ return;
+ }
+ fOnce = true;
+
test_cubic();
test_cubic2();
@@ -167,7 +177,8 @@ protected:
canvas->drawPath(path, paint);
}
- virtual void onDrawContent(SkCanvas* canvas) {
+ virtual void onDrawContent(SkCanvas* canvas) {
+ this->init();
canvas->translate(SkIntToScalar(50), SkIntToScalar(50));
static const SkPaint::Join gJoins[] = {