aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/skottie/Skottie.h
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2018-02-23 11:10:22 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-23 19:15:26 +0000
commit1022f743758b71bcc476e602679282a0acd64ff1 (patch)
tree3380edf89e0458408d7d0b63227e9116839f9b39 /experimental/skottie/Skottie.h
parent09f818d2c9c0b82ef5417a7f1d0f2a5ea09fc682 (diff)
[skottie] Nested animation support
Extend composition layers to support referencing external .json animations ("$"<PATH> syntax). This is a custom extension (not supported in BM/Lottie). Also make skottie::Animation ref-counted, to facilitate sharing. TBR= Change-Id: I062d031e5868d759f3930dea9b261f9b3ec81684 Reviewed-on: https://skia-review.googlesource.com/109806 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'experimental/skottie/Skottie.h')
-rw-r--r--experimental/skottie/Skottie.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/experimental/skottie/Skottie.h b/experimental/skottie/Skottie.h
index d2486dc946..f14c4dc42b 100644
--- a/experimental/skottie/Skottie.h
+++ b/experimental/skottie/Skottie.h
@@ -34,13 +34,12 @@ public:
virtual std::unique_ptr<SkStream> openStream(const char resource[]) const = 0;
};
-class Animation : public SkNoncopyable {
+class Animation : public SkRefCnt {
public:
- static std::unique_ptr<Animation> Make(SkStream*, const ResourceProvider&);
- static std::unique_ptr<Animation> MakeFromFile(const char path[],
- const ResourceProvider* = nullptr);
+ static sk_sp<Animation> Make(SkStream*, const ResourceProvider&);
+ static sk_sp<Animation> MakeFromFile(const char path[], const ResourceProvider* = nullptr);
- ~Animation();
+ ~Animation() override;
void render(SkCanvas*, const SkRect* dst = nullptr) const;
@@ -67,7 +66,7 @@ private:
std::unique_ptr<sksg::Scene> fScene;
- typedef SkNoncopyable INHERITED;
+ typedef SkRefCnt INHERITED;
};
} // namespace skottie