[skottie] Fix handling of hidden shapes and layers
TBR=reed@google.com Bug: skia:8923 Change-Id: I5bd1d4f2ef62ebd95cfae0fe3665960b07ed4ae1 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204082 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
This commit is contained in:
parent
c476e5da4f
commit
0ed4c37634
@ -501,7 +501,10 @@ private:
|
||||
|
||||
sk_sp<sksg::RenderNode> AnimationBuilder::attachLayer(const skjson::ObjectValue* jlayer,
|
||||
AttachLayerContext* layerCtx) const {
|
||||
if (!jlayer) return nullptr;
|
||||
if (!jlayer || ParseDefault<bool>((*jlayer)["hd"], false)) {
|
||||
// Ignore hidden layers.
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const LayerInfo layer_info = {
|
||||
ParseDefault<float>((*jlayer)["ip"], 0.0f),
|
||||
|
@ -563,6 +563,11 @@ sk_sp<sksg::RenderNode> AnimationBuilder::attachShape(const skjson::ArrayValue*
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ParseDefault<bool>((*shape)["hd"], false)) {
|
||||
// Ignore hidden shapes.
|
||||
continue;
|
||||
}
|
||||
|
||||
recs.push_back({ *shape, *info });
|
||||
|
||||
switch (info->fShapeType) {
|
||||
|
1
modules/skottie/tests/hidden-shapes-layers.json
Normal file
1
modules/skottie/tests/hidden-shapes-layers.json
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user