aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2018-01-26 15:03:38 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-26 20:34:00 +0000
commit1eb98dba2fc7afdef148145f4b577e8b14deb354 (patch)
tree138b56f89457614359a598897d35e63aef9b8bd3 /experimental
parentc8f740168ff32222a35ab2a3809c7664d7a2432e (diff)
[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>
Diffstat (limited to 'experimental')
-rw-r--r--experimental/skottie/Skottie.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/experimental/skottie/Skottie.cpp b/experimental/skottie/Skottie.cpp
index 7e56106fc5..efd3d075d7 100644
--- a/experimental/skottie/Skottie.cpp
+++ b/experimental/skottie/Skottie.cpp
@@ -84,7 +84,14 @@ sk_sp<sksg::Matrix> AttachMatrix(const Json::Value& t, AttachContext* ctx,
[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);
});