From: subhransu mohanty Date: Tue, 18 Jun 2019 04:53:53 +0000 (+0900) Subject: rlottie: Fix issue with handling hidden Layer X-Git-Tag: submit/tizen/20190619.051039~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f1e884128e2acfe9bf3937a77d3d8d63900339b;p=platform%2Fcore%2Fuifw%2Flottie-player.git rlottie: Fix issue with handling hidden Layer --- diff --git a/src/lottie/lottieparser.cpp b/src/lottie/lottieparser.cpp index 74899c7..ae84ba9 100644 --- a/src/lottie/lottieparser.cpp +++ b/src/lottie/lottieparser.cpp @@ -895,6 +895,8 @@ std::shared_ptr LottieParserImpl::parseLayer(bool record) parseMaskProperty(layer); } else if (0 == strcmp(key, "ao")) { layer->mAutoOrient = GetInt(); + } else if (0 == strcmp(key, "hd")) { + layer->mHidden = GetBool(); } else { #ifdef DEBUG_PARSER vWarning << "Layer Attribute Skipped : " << key; @@ -903,6 +905,18 @@ std::shared_ptr LottieParserImpl::parseLayer(bool record) } } + layer->mCompRef = compRef; + + if (layer->hidden()) { + // if layer is hidden, only data that is usefull is its + // transform matrix(when it is a parent of some other layer) + // so force it to be a Null Layer and release all resource. + layer->setStatic(layer->mTransform->isStatic()); + layer->mLayerType = LayerType::Null; + layer->mChildren = {}; + return sharedLayer; + } + // update the static property of layer bool staticFlag = true; for (const auto& child : layer->mChildren) { @@ -914,7 +928,6 @@ std::shared_ptr LottieParserImpl::parseLayer(bool record) } layer->setStatic(staticFlag && layer->mTransform->isStatic()); - layer->mCompRef = compRef; if (record) { mLayerInfoList.push_back(LayerInfo(layer->mName, layer->mInFrame, layer->mOutFrame));