Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(788)

Unified Diff: samplecode/SampleArc.cpp

Issue 888283002: allow GMs to animate (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: switch all existing animations to use animatePulse Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | samplecode/SampleCamera.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleArc.cpp
diff --git a/samplecode/SampleArc.cpp b/samplecode/SampleArc.cpp
index df452ce77687e6ee752d4c29eee9e90a640a2f74..9f922ae2d618ede08a749a10f3662c91fe0059d4 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 {
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | samplecode/SampleCamera.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698