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
diff --git a/samplecode/SampleArc.cpp b/samplecode/SampleArc.cpp
index 19bf5f8..ed62537 100644
--- a/samplecode/SampleArc.cpp
+++ b/samplecode/SampleArc.cpp
@@ -127,6 +127,9 @@
virtual void onDraw(SkCanvas* canvas)
{
this->drawBG(canvas);
+
+ fSweep = SampleCode::GetAnimScalar(SkIntToScalar(360)/24,
+ SkIntToScalar(360));
SkRect r;
SkPaint paint;
@@ -167,10 +170,6 @@
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);
}