aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleArc.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2015-02-01 19:01:04 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-01 19:01:04 -0800
commitd9adfe6a223955bc69c8c7661ab8e0a078afbc32 (patch)
treeb3ae977babf890649bce0538e6b6cb766a948219 /samplecode/SampleArc.cpp
parent47471cf19c1b386212ab0401190ac40cdeb95d1f (diff)
allow GMs to animate
Diffstat (limited to 'samplecode/SampleArc.cpp')
-rw-r--r--samplecode/SampleArc.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/samplecode/SampleArc.cpp b/samplecode/SampleArc.cpp
index df452ce776..9f922ae2d6 100644
--- a/samplecode/SampleArc.cpp
+++ b/samplecode/SampleArc.cpp
@@ -195,9 +195,13 @@ protected:
}
void onDrawContent(SkCanvas* canvas) SK_OVERRIDE {
- fAnimatingDrawable->setSweep(SampleCode::GetAnimScalar(360/24, 360));
canvas->EXPERIMENTAL_drawDrawable(fRootDrawable);
- this->inval(NULL);
+ }
+
+ bool onAnimatePulse(SkMSec curr, SkMSec prev) SK_OVERRIDE {
+ SkScalar angle = SkDoubleToScalar(fmod(curr * 0.36 / 24, 360));
+ fAnimatingDrawable->setSweep(angle);
+ return true;
}
SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) SK_OVERRIDE {