diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-03-12 21:14:09 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-03-12 21:14:09 +0000 |
commit | c9fa63c869d9216869da64c1defb150655ade3af (patch) | |
tree | ca7b8e85d924065c4860ae9221a38aec3a9dcae4 /samplecode/SamplePath.cpp | |
parent | 7b1859034fd1febd69eeeca9efd5e3eb297fb168 (diff) |
don't draw in constructor (makes debugging harder)
git-svn-id: http://skia.googlecode.com/svn/trunk@3369 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SamplePath.cpp')
-rw-r--r-- | samplecode/SamplePath.cpp | 13 |
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[] = { |