aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/skottie/src/SkottieAnimator.h
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2018-07-10 10:20:36 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-10 15:07:04 +0000
commit3be2e10ce534a9bf8eb008d3704be26b2ba04437 (patch)
tree57a362b83d922631f3f0b04637235bcf6bd57e89 /modules/skottie/src/SkottieAnimator.h
parentc100d48e4241ecc7be0fd7fd79eae13e13f255c0 (diff)
[skottie] Ignore identity transforms
Some tranform properties are not optional, but many of them are static identity. Detect these cases and don't attach SG nodes for them. Reduces the number of sksg::Matrix nodes by ~18%. TBR= Change-Id: Ia51c865d6928e8c48c73b30f6d45541caf334880 Reviewed-on: https://skia-review.googlesource.com/140186 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'modules/skottie/src/SkottieAnimator.h')
-rw-r--r--modules/skottie/src/SkottieAnimator.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/skottie/src/SkottieAnimator.h b/modules/skottie/src/SkottieAnimator.h
index c4464e3138..23bd9aa500 100644
--- a/modules/skottie/src/SkottieAnimator.h
+++ b/modules/skottie/src/SkottieAnimator.h
@@ -22,7 +22,15 @@ template <typename T>
bool BindProperty(const skjson::Value&,
sksg::AnimatorList*,
std::function<void(const T&)>&&,
- const T* noop = nullptr);
+ const T* default_igore = nullptr);
+
+template <typename T>
+bool BindProperty(const skjson::Value& jv,
+ sksg::AnimatorList* animators,
+ std::function<void(const T&)>&& apply,
+ const T& default_ignore) {
+ return BindProperty(jv, animators, std::move(apply), &default_ignore);
+}
} // namespace skottie