aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
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 /tools
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 'tools')
-rw-r--r--tools/viewer/SkottieSlide.cpp6
-rw-r--r--tools/viewer/SkottieSlide.h10
2 files changed, 8 insertions, 8 deletions
diff --git a/tools/viewer/SkottieSlide.cpp b/tools/viewer/SkottieSlide.cpp
index aef28e1efc..77501d8a9f 100644
--- a/tools/viewer/SkottieSlide.cpp
+++ b/tools/viewer/SkottieSlide.cpp
@@ -17,9 +17,9 @@ SkottieSlide::SkottieSlide(const SkString& name, const SkString& path)
}
void SkottieSlide::load(SkScalar w, SkScalar h) {
- fAnimation = skottie::Animation::MakeFromFile(fPath.c_str());
- fWinSize = SkSize::Make(w, h);
- fTimeBase = 0; // force a time reset
+ fAnimation = skottie::Animation::MakeFromFile(fPath.c_str());
+ fWinSize = SkSize::Make(w, h);
+ fTimeBase = 0; // force a time reset
if (fAnimation) {
fAnimation->setShowInval(fShowAnimationInval);
diff --git a/tools/viewer/SkottieSlide.h b/tools/viewer/SkottieSlide.h
index ac26d2f3c1..b5770a0cf8 100644
--- a/tools/viewer/SkottieSlide.h
+++ b/tools/viewer/SkottieSlide.h
@@ -30,11 +30,11 @@ public:
bool onMouse(SkScalar x, SkScalar y, sk_app::Window::InputState, uint32_t modifiers) override;
private:
- SkString fPath;
- std::unique_ptr<skottie::Animation> fAnimation;
- SkSize fWinSize = SkSize::MakeEmpty();
- SkMSec fTimeBase = 0;
- bool fShowAnimationInval = false;
+ SkString fPath;
+ sk_sp<skottie::Animation> fAnimation;
+ SkSize fWinSize = SkSize::MakeEmpty();
+ SkMSec fTimeBase = 0;
+ bool fShowAnimationInval = false;
typedef Slide INHERITED;
};