[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 <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
This commit is contained in:
Florin Malita 2018-07-12 17:48:36 -04:00 committed by Skia Commit-Bot
parent ab5c9af442
commit 13ac194dbf

View File

@ -80,7 +80,7 @@ sk_sp<sksg::Matrix> 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<TransformAdapter>(matrix);
auto bound = BindProperty<VectorValue>(t["a"], &ctx->fAnimators,
@ -115,7 +115,7 @@ sk_sp<sksg::Matrix> AttachMatrix(const skjson::ObjectValue& t, AttachContext* ct
adapter->setSkewAxis(sa);
}, 0.0f);
return bound ? matrix : nullptr;
return bound ? matrix : parentMatrix;
}
sk_sp<sksg::RenderNode> AttachOpacity(const skjson::ObjectValue& jtransform, AttachContext* ctx,