From 8f5da6d9db081647075b29a00f51f595fcde83d9 Mon Sep 17 00:00:00 2001 From: Jiyun Yang Date: Mon, 28 Oct 2024 19:23:11 +0900 Subject: [PATCH] Avoid skipping layer update when dynamic value set Change-Id: Ic8cd093260705c71a165d95b4e5aabbd43e72526 Signed-off-by: Jiyun Yang --- src/lottie/lottieitem.cpp | 5 ++++- src/lottie/lottieitem.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lottie/lottieitem.cpp b/src/lottie/lottieitem.cpp index 02e9477..03a4753 100644 --- a/src/lottie/lottieitem.cpp +++ b/src/lottie/lottieitem.cpp @@ -155,6 +155,7 @@ bool renderer::Composition::update(int frameNo, const VSize &size, } else { m.scale(sx, sy); } + mRootLayer->update(frameNo, m, 1.0); return true; } @@ -379,6 +380,7 @@ bool renderer::ShapeLayer::resolveKeyPath(LOTKeyPath &keyPath, uint32_t depth, uint32_t newDepth = keyPath.nextDepth(name(), depth); mRoot->resolveKeyPath(keyPath, newDepth, value); } + mHasDynamicValue = true; return true; } return false; @@ -394,6 +396,7 @@ bool renderer::CompLayer::resolveKeyPath(LOTKeyPath &keyPath, uint32_t depth, layer->resolveKeyPath(keyPath, newDepth, value); } } + mHasDynamicValue = true; return true; } return false; @@ -434,7 +437,7 @@ void renderer::Layer::update(int frameNumber, const VMatrix &parentMatrix, } // 5. if no parent property change and layer is static then nothing to do. - if (!mLayerData->precompLayer() && flag().testFlag(DirtyFlagBit::None) && + if (!mHasDynamicValue && !mLayerData->precompLayer() && flag().testFlag(DirtyFlagBit::None) && isStatic()) return; diff --git a/src/lottie/lottieitem.h b/src/lottie/lottieitem.h index 0406697..66ba27d 100644 --- a/src/lottie/lottieitem.h +++ b/src/lottie/lottieitem.h @@ -267,6 +267,7 @@ protected: DirtyFlag mDirtyFlag{DirtyFlagBit::All}; bool mComplexContent{false}; std::unique_ptr mCApiData; + bool mHasDynamicValue{false}; }; class CompLayer final : public Layer { -- 2.34.1