From 13ac194dbf9968d356e580b85420f1314f453a10 Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Thu, 12 Jul 2018 17:48:36 -0400 Subject: [skottie] Fix matrix parenting for default/static values When all matrix properties are static/default, we simply discard the matrix node. But we cannot do that in the presence of a parent matrix. TBR= Change-Id: I56c62216f18786249dea063690261bfae83fabec Reviewed-on: https://skia-review.googlesource.com/141127 Reviewed-by: Florin Malita Commit-Queue: Florin Malita --- modules/skottie/src/Skottie.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/skottie/src/Skottie.cpp b/modules/skottie/src/Skottie.cpp index 571cbd1d9d..88e42d4e58 100644 --- a/modules/skottie/src/Skottie.cpp +++ b/modules/skottie/src/Skottie.cpp @@ -80,7 +80,7 @@ sk_sp AttachMatrix(const skjson::ObjectValue& t, AttachContext* ct static const VectorValue g_default_vec_0 = { 0, 0}, g_default_vec_100 = {100, 100}; - auto matrix = sksg::Matrix::Make(SkMatrix::I(), std::move(parentMatrix)); + auto matrix = sksg::Matrix::Make(SkMatrix::I(), parentMatrix); auto adapter = sk_make_sp(matrix); auto bound = BindProperty(t["a"], &ctx->fAnimators, @@ -115,7 +115,7 @@ sk_sp AttachMatrix(const skjson::ObjectValue& t, AttachContext* ct adapter->setSkewAxis(sa); }, 0.0f); - return bound ? matrix : nullptr; + return bound ? matrix : parentMatrix; } sk_sp AttachOpacity(const skjson::ObjectValue& jtransform, AttachContext* ctx, -- cgit v1.2.3