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

Unified Diff: samplecode/SampleCamera.cpp

Issue 894083003: add SkAnimTimer, SPACE = pause/resume, ESP = stop (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: samplecode/SampleCamera.cpp
diff --git a/samplecode/SampleCamera.cpp b/samplecode/SampleCamera.cpp
index 35fa719479424a7891312206279586e148a561b8..af9dbe8d653012070241b2d271e4dc3d29d6452f 100644
--- a/samplecode/SampleCamera.cpp
+++ b/samplecode/SampleCamera.cpp
@@ -6,6 +6,7 @@
*/
#include "SampleCode.h"
+#include "SkAnimTimer.h"
#include "SkView.h"
#include "SkCanvas.h"
#include "SkCamera.h"
@@ -88,10 +89,11 @@ protected:
}
}
- bool onAnimatePulse(SkMSec curr, SkMSec prev) SK_OVERRIDE {
- fRY += (curr - prev) * 0.09f;
- if (fRY >= 360) {
+ bool onAnimate(const SkAnimTimer& timer) SK_OVERRIDE {
+ if (timer.isStopped()) {
fRY = 0;
+ } else {
+ fRY = timer.scaled(90, 360);
}
return true;
}
« gm/SkAnimTimer.h ('K') | « samplecode/SampleBitmapRect.cpp ('k') | samplecode/SampleCode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698