aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleArc.cpp
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-11-23 21:07:51 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-11-23 21:07:51 +0000
commit4417740a480786ca65379ba5b398c500ba34ee18 (patch)
tree1a261f93f6270078dbf165c73616aaf9bdb1570f /samplecode/SampleArc.cpp
parente522ca5d5f249bd51a00cb68bb051f811d0a9e85 (diff)
add SampleCode::GetAnimTime() so slides go through a central location for
animation timing. This allows us to "freeze" time in order to do things like draw multiple times to test clipping. git-svn-id: http://skia.googlecode.com/svn/trunk@444 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleArc.cpp')
-rw-r--r--samplecode/SampleArc.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/samplecode/SampleArc.cpp b/samplecode/SampleArc.cpp
index 19bf5f8533..ed62537e9e 100644
--- a/samplecode/SampleArc.cpp
+++ b/samplecode/SampleArc.cpp
@@ -127,6 +127,9 @@ protected:
virtual void onDraw(SkCanvas* canvas)
{
this->drawBG(canvas);
+
+ fSweep = SampleCode::GetAnimScalar(SkIntToScalar(360)/24,
+ SkIntToScalar(360));
SkRect r;
SkPaint paint;
@@ -167,10 +170,6 @@ protected:
paint.setColor(SK_ColorBLUE);
canvas->drawArc(r, 0, fSweep, false, paint);
- fSweep += SK_Scalar1/4;
- if (fSweep > SkIntToScalar(360))
- fSweep = 0;
-
drawArcs(canvas);
this->inval(NULL);
}