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

Unified Diff: samplecode/SamplePathEffects.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
« gm/SkAnimTimer.h ('K') | « samplecode/SampleHairline.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SamplePathEffects.cpp
diff --git a/samplecode/SamplePathEffects.cpp b/samplecode/SamplePathEffects.cpp
index f07cd6ce400b50530adcf72840c18ea394041a01..a5f91c296ebf884f45163fe25a2b1afbf42d7e36 100644
--- a/samplecode/SamplePathEffects.cpp
+++ b/samplecode/SamplePathEffects.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"
@@ -158,8 +159,8 @@ protected:
canvas->drawPath(fPath, paint);
}
- bool onAnimatePulse(SkMSec curr, SkMSec prev) SK_OVERRIDE {
- fPhase -= (curr - prev) * 0.04f;
+ bool onAnimate(const SkAnimTimer& timer) SK_OVERRIDE {
+ fPhase = timer.scaled(40);
return true;
}
« gm/SkAnimTimer.h ('K') | « samplecode/SampleHairline.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698