From a6dd752efaab0162fec43771050f6c014a8f7222 Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Tue, 9 Jan 2018 08:46:52 -0500 Subject: [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 Commit-Queue: Florin Malita --- experimental/skotty/Skotty.cpp | 2 +- experimental/skotty/SkottyAnimator.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'experimental') 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 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 Make(const Json::Value& frames, sk_sp node, ApplyFuncT&& applyFunc); - void tick(SkMSec t) override { + void tick(float t) override { const auto& frame = this->findInterval(t); ValT val; -- cgit v1.2.3