[Tizen](Partial Update) Fix animation delay issue 56/294556/2
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 21 Jun 2023 06:10:49 +0000 (15:10 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 21 Jun 2023 06:13:52 +0000 (06:13 +0000)
Set updated flag when the animation is delayed

Change-Id: Iaadfef28be2d6f000d0f284bf1ad8307f2c879b4

dali/internal/update/animation/scene-graph-animation.cpp
dali/internal/update/animation/scene-graph-animator.h

index 31a3e0a..75551c6 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali/internal/common/memory-pool-object-allocator.h>
 #include <dali/internal/render/common/performance-monitor.h>
 #include <dali/public-api/math/math-utils.h>
+
 namespace // Unnamed namespace
 {
 // Memory pool used to allocate new animations. Memory used by this pool will be released when shutting down DALi
@@ -488,6 +489,10 @@ void Animation::UpdateAnimators(BufferIndex bufferIndex, bool bake, bool animati
           mIsActive[bufferIndex] = true;
         }
       }
+      else
+      {
+        animator->SetDelayed(true);
+      }
       applied = true;
     }
     else
index f761b50..108446c 100644 (file)
@@ -88,7 +88,8 @@ public:
     mAnimationPlaying(false),
     mEnabled(true),
     mConnectedToSceneGraph(false),
-    mAutoReverseEnabled(false)
+    mAutoReverseEnabled(false),
+    mDelayed(false)
   {
   }
 
@@ -237,6 +238,22 @@ public:
   }
 
   /**
+   * Sets whether the animator is delayed or not.
+   * @param delayed True if the animator is delayed.
+   */
+  void SetDelayed(bool delayed)
+  {
+    if(delayed != mDelayed)
+    {
+      if(mPropertyOwner)
+      {
+        mPropertyOwner->SetUpdated(true);
+      }
+      mDelayed = delayed;
+    }
+  }
+
+  /**
    * Set the alpha function for an animator.
    * @param [in] alphaFunc The alpha function to apply to the animation progress.
    */
@@ -469,6 +486,7 @@ public:
     DoUpdate(bufferIndex, bake, alpha, blendPoint);
 
     mCurrentProgress = progress;
+    mDelayed         = false;
   }
 
   /**
@@ -510,6 +528,7 @@ protected:
   bool                       mEnabled : 1;               ///< Animator is "enabled" while its target object is valid and on the stage.
   bool                       mConnectedToSceneGraph : 1; ///< True if ConnectToSceneGraph() has been called in update-thread.
   bool                       mAutoReverseEnabled : 1;
+  bool                       mDelayed : 1; ///< True if the animator is in delayed state
 };
 
 /**
@@ -663,8 +682,8 @@ private:
   }
 
   // Undefined
-  AnimatorTransformProperty()                                            = delete;
-  AnimatorTransformProperty(const AnimatorTransformProperty&)            = delete;
+  AnimatorTransformProperty()                                 = delete;
+  AnimatorTransformProperty(const AnimatorTransformProperty&) = delete;
   AnimatorTransformProperty& operator=(const AnimatorTransformProperty&) = delete;
 
 protected: