Make property resetter age down correctly 77/296477/2
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 28 Jul 2023 12:23:17 +0000 (21:23 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Mon, 31 Jul 2023 00:51:16 +0000 (09:51 +0900)
Previously, we call this sequence.

frame#1
 - ObjectDestroyed (mRunning = AGING)
 - ResetToBaseValue (mRunning = STOPPED)
 - IsFinished (mRunning <= STOPPED --> finished!)

That mean, this property resetter works only 1 frame.

Now make age down on IsFinished function, so age works 2 frames.

frame#1
 - ObjectDestroyed (mRunning = AGING)
 - ResetToBaseValue (mRunning = AGING)
 - IsFinished (mRunning = STOPPED --> not finished!)
frame#2
 - ResetToBaseValue (mRunning = STOPPED)
 - IsFinished (mRunning <= STOPPED --> finished!)

Change-Id: Ie938df6088c4d73087fc138d29ebbf93df7f8dc7
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/internal/update/common/property-resetter.h

index 4fd1830..833be60 100644 (file)
@@ -81,13 +81,6 @@ public:
 
       mBaseProperty->ResetToBaseValue(updateBufferIndex);
     }
-
-    if(mRunning == AGING)
-    {
-      // If this resetter is aging now, make it as stopped.
-      // Now we can assume that this PropertyResetter is finished.
-      mRunning = STOPPED;
-    }
   };
 
   /**
@@ -139,7 +132,14 @@ public:
    */
   virtual bool IsFinished()
   {
-    return mRunning <= STOPPED;
+    const bool finished = mRunning <= STOPPED;
+    if(mRunning == AGING)
+    {
+      // If this resetter is aging now, make it as stopped.
+      // Now we can assume that this PropertyResetter is finished next frame.
+      mRunning = STOPPED;
+    }
+    return finished;
   }
 
   enum