From 3be2e10ce534a9bf8eb008d3704be26b2ba04437 Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Tue, 10 Jul 2018 10:20:36 -0400 Subject: [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 Commit-Queue: Florin Malita --- modules/skottie/src/SkottieAnimator.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'modules/skottie/src/SkottieAnimator.h') 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 bool BindProperty(const skjson::Value&, sksg::AnimatorList*, std::function&&, - const T* noop = nullptr); + const T* default_igore = nullptr); + +template +bool BindProperty(const skjson::Value& jv, + sksg::AnimatorList* animators, + std::function&& apply, + const T& default_ignore) { + return BindProperty(jv, animators, std::move(apply), &default_ignore); +} } // namespace skottie -- cgit v1.2.3