aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2018-01-09 08:46:52 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-09 14:07:22 +0000
commita6dd752efaab0162fec43771050f6c014a8f7222 (patch)
tree863ede7098f520ca2e039b22fef9f0d565851356 /experimental
parent71cba8f311f18e671ed99e6a553e2ca7e3d17466 (diff)
[skotty] Pass animation frame/time as float
No reason to punt through SkMSec, we just lose precision. TBR= Change-Id: I2f61e49658701a3b5a675f3dd44543fd9aa98708 Reviewed-on: https://skia-review.googlesource.com/92600 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'experimental')
-rw-r--r--experimental/skotty/Skotty.cpp2
-rw-r--r--experimental/skotty/SkottyAnimator.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/experimental/skotty/Skotty.cpp b/experimental/skotty/Skotty.cpp
index 9a14ac141e..396e04969c 100644
--- a/experimental/skotty/Skotty.cpp
+++ b/experimental/skotty/Skotty.cpp
@@ -736,7 +736,7 @@ sk_sp<sksg::RenderNode> AttachLayer(const Json::Value& jlayer,
, fIn(in)
, fOut(out) {}
- void tick(SkMSec t) override {
+ void tick(float t) override {
// Keep the layer fully transparent except for its [in..out] lifespan.
// (note: opacity == 0 disables rendering, while opacity == 1 is a noop)
fControlNode->setOpacity(t >= fIn && t <= fOut ? 1 : 0);
diff --git a/experimental/skotty/SkottyAnimator.h b/experimental/skotty/SkottyAnimator.h
index cd6f651ab8..858cebd25c 100644
--- a/experimental/skotty/SkottyAnimator.h
+++ b/experimental/skotty/SkottyAnimator.h
@@ -23,7 +23,7 @@ class AnimatorBase : public SkNoncopyable {
public:
virtual ~AnimatorBase() = default;
- virtual void tick(SkMSec) = 0;
+ virtual void tick(float) = 0;
protected:
AnimatorBase() = default;
@@ -91,7 +91,7 @@ public:
static std::unique_ptr<Animator> Make(const Json::Value& frames, sk_sp<NodeT> node,
ApplyFuncT&& applyFunc);
- void tick(SkMSec t) override {
+ void tick(float t) override {
const auto& frame = this->findInterval(t);
ValT val;