add SkAnimTimer, SPACE = pause/resume, ESP = stop
BUG=skia:
Review URL: https://codereview.chromium.org/894083003
diff --git a/samplecode/SampleCamera.cpp b/samplecode/SampleCamera.cpp
index 35fa719..af9dbe8 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 @@
}
}
- 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;
}