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

Unified Diff: samplecode/SampleArc.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/SampleArc.cpp
diff --git a/samplecode/SampleArc.cpp b/samplecode/SampleArc.cpp
index 9f922ae2d618ede08a749a10f3662c91fe0059d4..3775de50c826e6d328cc7b9a7a5f07416a4a7844 100644
--- a/samplecode/SampleArc.cpp
+++ b/samplecode/SampleArc.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "SampleCode.h"
+#include "SkAnimTimer.h"
#include "SkView.h"
#include "SkCanvas.h"
#include "SkGradientShader.h"
@@ -198,8 +199,8 @@ protected:
canvas->EXPERIMENTAL_drawDrawable(fRootDrawable);
}
- bool onAnimatePulse(SkMSec curr, SkMSec prev) SK_OVERRIDE {
- SkScalar angle = SkDoubleToScalar(fmod(curr * 0.36 / 24, 360));
+ bool onAnimate(const SkAnimTimer& timer) SK_OVERRIDE {
+ SkScalar angle = SkDoubleToScalar(fmod(timer.secs() * 360 / 24, 360));
fAnimatingDrawable->setSweep(angle);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698