Do not skip update when it has dynamic property 15/302815/1 tizen_8.0
authorJiyun Yang <ji.yang@samsung.com>
Wed, 30 Aug 2023 12:29:01 +0000 (21:29 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Thu, 14 Dec 2023 06:22:08 +0000 (15:22 +0900)
In following cases,

```c++
animation->setValue<Property::FillColor>("**", red);
animation->render(0, surface);
// after render is finished
animation->setValue<Property::FillColor>("**", blue);
animation->render(0, surface);
```
Or
```c++
animation->setValue<Property::FillColor>("**", [&](const FrameInfo& info) {
    return colors->getColor();
});

colors->setColor(red);
animation->render(0, surface);
// after render is finished
colors->setColor(blue);
animation->render(0, surface);

```
the second render request for both cases should not be ignored even if it's the same request as previous.

Change-Id: I0337e885e7d7623c01332415207829da8549ddce
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/lottie/lottieitem.cpp
src/lottie/lottieitem.h

index f5c8c2f..7c7694e 100644 (file)
@@ -109,6 +109,7 @@ renderer::Composition::Composition(std::shared_ptr<model::Composition> model)
 void renderer::Composition::setValue(const std::string &keypath,
                                      LOTVariant &       value)
 {
+    mHasDynamicValue = true;
     LOTKeyPath key(keypath);
     mRootLayer->resolveKeyPath(key, 0, value);
 }
@@ -117,7 +118,7 @@ bool renderer::Composition::update(int frameNo, const VSize &size,
                                    bool keepAspectRatio)
 {
     // check if cached frame is same as requested frame.
-    if ((mViewSize == size) && (mCurFrameNo == frameNo) &&
+    if (!mHasDynamicValue && (mViewSize == size) && (mCurFrameNo == frameNo) &&
         (mKeepAspectRatio == keepAspectRatio))
         return false;
 
index b070897..d3ffb7a 100644 (file)
@@ -207,6 +207,7 @@ private:
     VArenaAlloc                         mAllocator{2048};
     int                                 mCurFrameNo;
     bool                                mKeepAspectRatio{true};
+    bool                                mHasDynamicValue{false};
 };
 
 class Layer {