[skottie] Add 'rz' rotation support
TBR=
Change-Id: I6dd82e5dc516faac091e5173688d2bc977e4fcaa
Reviewed-on: https://skia-review.googlesource.com/100280
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
diff --git a/experimental/skottie/Skottie.cpp b/experimental/skottie/Skottie.cpp
index 7e56106..efd3d07 100644
--- a/experimental/skottie/Skottie.cpp
+++ b/experimental/skottie/Skottie.cpp
@@ -84,7 +84,14 @@
[composite](const VectorValue& s) {
composite->setScale(ValueTraits<VectorValue>::As<SkVector>(s));
});
- auto rotation_attached = BindProperty<ScalarValue>(t["r"], &ctx->fAnimators,
+
+ auto* jrotation = &t["r"];
+ if (jrotation->isNull()) {
+ // 3d rotations have separate rx,ry,rz components. While we don't fully support them,
+ // we can still make use of rz.
+ jrotation = &t["rz"];
+ }
+ auto rotation_attached = BindProperty<ScalarValue>(*jrotation, &ctx->fAnimators,
[composite](const ScalarValue& r) {
composite->setRotation(r);
});