[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:
Florin Malita 2019-03-27 08:44:55 -04:00 committed by Skia Commit-Bot
parent c476e5da4f
commit 0ed4c37634
3 changed files with 10 additions and 1 deletions

View File

@ -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),

View File

@ -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) {

File diff suppressed because one or more lines are too long