diff options
author | reed <reed@chromium.org> | 2015-02-01 19:01:04 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-01 19:01:04 -0800 |
commit | d9adfe6a223955bc69c8c7661ab8e0a078afbc32 (patch) | |
tree | b3ae977babf890649bce0538e6b6cb766a948219 /samplecode/SampleCamera.cpp | |
parent | 47471cf19c1b386212ab0401190ac40cdeb95d1f (diff) |
allow GMs to animate
BUG=skia:
Review URL: https://codereview.chromium.org/888283002
Diffstat (limited to 'samplecode/SampleCamera.cpp')
-rw-r--r-- | samplecode/SampleCamera.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/samplecode/SampleCamera.cpp b/samplecode/SampleCamera.cpp index 7660129c38..35fa719479 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: |