diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-03-30 20:04:21 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-03-30 20:04:21 +0000 |
commit | d42e3f60cd571afb6c0f1837f9e0996bfe149001 (patch) | |
tree | 33ac82a3cd588b20875d92c1d0b47e8b1a0cd531 /gm/filltypes.cpp | |
parent | bbbe9ed59ee1d3077fa4e6368a4a7294240a5ec6 (diff) |
defer drawing/work until first draw, to make debugging easier and speedup
instantiating the obj just to get its name.
git-svn-id: http://skia.googlecode.com/svn/trunk@3568 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/filltypes.cpp')
-rw-r--r-- | gm/filltypes.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gm/filltypes.cpp b/gm/filltypes.cpp index 73c718e20b..e096a6b1fc 100644 --- a/gm/filltypes.cpp +++ b/gm/filltypes.cpp @@ -14,9 +14,14 @@ class FillTypeGM : public GM { public: FillTypeGM() { this->setBGColor(0xFFDDDDDD); - const SkScalar radius = SkIntToScalar(45); - fPath.addCircle(SkIntToScalar(50), SkIntToScalar(50), radius); - fPath.addCircle(SkIntToScalar(100), SkIntToScalar(100), radius); + } + + void makePath() { + if (fPath.isEmpty()) { + const SkScalar radius = SkIntToScalar(45); + fPath.addCircle(SkIntToScalar(50), SkIntToScalar(50), radius); + fPath.addCircle(SkIntToScalar(100), SkIntToScalar(100), radius); + } } protected: @@ -57,6 +62,8 @@ protected: } virtual void onDraw(SkCanvas* canvas) { + this->makePath(); + canvas->translate(SkIntToScalar(20), SkIntToScalar(20)); SkPaint paint; |