aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SamplePathEffects.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-02-02 12:55:02 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-02 12:55:02 -0800
commit76113a9b7716748c70ea0ecf7aacbabe4cce5009 (patch)
tree57d91f56a717a0ffcb829b00c71e17195491753c /samplecode/SamplePathEffects.cpp
parenta669bc7a7ae7580c5cd92067aeb95d09e64ea720 (diff)
add SkAnimTimer, SPACE = pause/resume, ESP = stop
Diffstat (limited to 'samplecode/SamplePathEffects.cpp')
-rw-r--r--samplecode/SamplePathEffects.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/samplecode/SamplePathEffects.cpp b/samplecode/SamplePathEffects.cpp
index f07cd6ce40..a5f91c296e 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;
}