Do not skip update when it has dynamic property 74/298074/1 accepted/tizen/7.0/unified/20231227.072357 accepted/tizen/7.0/unified/20231227.090349
authorJiyun Yang <ji.yang@samsung.com>
Wed, 30 Aug 2023 12:29:01 +0000 (21:29 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Thu, 31 Aug 2023 04:47:31 +0000 (13:47 +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: I6b94b6d99aa56118930b06b5f7244aa4cb18b7c0
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/lottie/lottieitem.cpp
src/lottie/lottieitem.h

index 90108ec9272df9e62648ecda56aa66ece5ade70d..80600cbe4e250cb77e33e66d1c40dc2feae7215e 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 b0708976bdd0ea07adf547761cb7018059676845..d3ffb7acbd31638d67c75afeefa6077c6feb1ed4 100644 (file)
@@ -207,6 +207,7 @@ private:
     VArenaAlloc                         mAllocator{2048};
     int                                 mCurFrameNo;
     bool                                mKeepAspectRatio{true};
+    bool                                mHasDynamicValue{false};
 };
 
 class Layer {