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

Unified Diff: samplecode/SampleCamera.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/SampleArc.cpp ('k') | samplecode/SampleCode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleCamera.cpp
diff --git a/samplecode/SampleCamera.cpp b/samplecode/SampleCamera.cpp
index 7660129c386705d753de464973c665b82626b16b..35fa719479424a7891312206279586e148a561b8 100644
--- a/samplecode/SampleCamera.cpp
+++ b/samplecode/SampleCamera.cpp
@@ -86,12 +86,14 @@ protected:
SkRect r = { -150, -150, 150, 150 };
canvas->drawRoundRect(r, 30, 30, paint);
}
+ }
- fRY += SampleCode::GetAnimSecondsDelta() * 90;
- if (fRY >= SkIntToScalar(360)) {
+ bool onAnimatePulse(SkMSec curr, SkMSec prev) SK_OVERRIDE {
+ fRY += (curr - prev) * 0.09f;
+ if (fRY >= 360) {
fRY = 0;
}
- this->inval(NULL);
+ return true;
}
private:
« no previous file with comments | « samplecode/SampleArc.cpp ('k') | samplecode/SampleCode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698