From 4417740a480786ca65379ba5b398c500ba34ee18 Mon Sep 17 00:00:00 2001 From: "reed@android.com" Date: Mon, 23 Nov 2009 21:07:51 +0000 Subject: 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 --- samplecode/SampleArc.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'samplecode/SampleArc.cpp') 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); } -- cgit v1.2.3