aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/sksg/SkSGScene.h
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2018-01-29 10:49:49 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-29 16:16:21 +0000
commitcca86f386cfd050cd03a25b305fc6fda48a8d6cd (patch)
treeed86f775c14946e84eefbb8cfe248c12ed7136ce /experimental/sksg/SkSGScene.h
parenta6717ce9fe02e1a251eaa39aa096dd90c6975f26 (diff)
[skottie] Hierarchical animators
Instead of a flat animator space, introduce animator groups. This allows us to encapsulate layer animators and only dispatch ticks when their owning layer is active. TBR= Change-Id: I1fc8a55abf68a712b71969bb1a11275dbe54c236 Reviewed-on: https://skia-review.googlesource.com/101201 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'experimental/sksg/SkSGScene.h')
-rw-r--r--experimental/sksg/SkSGScene.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/experimental/sksg/SkSGScene.h b/experimental/sksg/SkSGScene.h
index 32186498d2..2081c1d747 100644
--- a/experimental/sksg/SkSGScene.h
+++ b/experimental/sksg/SkSGScene.h
@@ -39,6 +39,20 @@ private:
using INHERITED = SkNoncopyable;
};
+using AnimatorList = std::vector<std::unique_ptr<Animator>>;
+
+class GroupAnimator : public Animator {
+protected:
+ explicit GroupAnimator(AnimatorList&&);
+
+ void onTick(float t) override;
+
+private:
+ const AnimatorList fAnimators;
+
+ using INHERITED = Animator;
+};
+
/**
* Holds a scene root and a list of animators.
*
@@ -47,8 +61,6 @@ private:
*/
class Scene final : SkNoncopyable {
public:
- using AnimatorList = std::vector<std::unique_ptr<Animator>>;
-
static std::unique_ptr<Scene> Make(sk_sp<RenderNode> root, AnimatorList&& animators);
~Scene();