From: Eunki, Hong Date: Fri, 2 Aug 2024 07:09:33 +0000 (+0900) Subject: Print more logs when (animation finished case + previous state) X-Git-Tag: accepted/tizen/unified/20240809.055203~3^2~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc2e2d154926c0692a8cea2f7b445c1f353d5b29;p=platform%2Fcore%2Fuifw%2Fdali-core.git Print more logs when (animation finished case + previous state) Since we don't print any logs if animation finished naturally, user might not know whether given rendering loops occured due to animation, or not. To make ensure the animation state changeness, let we also print log if animation finished naturally. Also, print the log before change the animation state. It will be useful when we trace the animation state changing. Change-Id: I642057b56b86b2aca27874995ee1ff9adcfae30e Signed-off-by: Eunki, Hong --- diff --git a/dali/internal/update/animation/scene-graph-animation.cpp b/dali/internal/update/animation/scene-graph-animation.cpp index 2f7b159d5..4d6c390f0 100644 --- a/dali/internal/update/animation/scene-graph-animation.cpp +++ b/dali/internal/update/animation/scene-graph-animation.cpp @@ -175,7 +175,6 @@ void Animation::Play() mCurrentLoop = 0; mDelaySeconds = 0.0f; } - mState = Playing; if(mSpeedFactor < 0.0f && mElapsedSeconds <= mPlayRange.x * mDurationSeconds) { @@ -183,6 +182,9 @@ void Animation::Play() } SetAnimatorsActive(true); + + // Set state after activte animators + mState = Playing; } void Animation::PlayFrom(float progress) @@ -198,9 +200,11 @@ void Animation::PlayFrom(float progress) mCurrentLoop = 0; mDelaySeconds = 0.0f; } - mState = Playing; SetAnimatorsActive(true); + + // Set state after activte animators + mState = Playing; } } @@ -214,7 +218,6 @@ void Animation::PlayAfter(float delaySeconds) { mCurrentLoop = 0; } - mState = Playing; if(mSpeedFactor < 0.0f && mElapsedSeconds <= mPlayRange.x * mDurationSeconds) { @@ -222,6 +225,9 @@ void Animation::PlayAfter(float delaySeconds) } SetAnimatorsActive(true); + + // Set state after activte animators + mState = Playing; } } @@ -229,8 +235,8 @@ void Animation::Pause() { if(mState == Playing) { + DALI_LOG_DEBUG_INFO("Animation[%u] with duration %f ms Pause (before state : %c)\n", GetNotifyId(), mDurationSeconds * 1000.0f, "SRPD"[mState]); mState = Paused; - DALI_LOG_DEBUG_INFO("Animation[%u] with duration %f ms Pause\n", GetNotifyId(), mDurationSeconds * 1000.0f); } } @@ -253,7 +259,7 @@ void Animation::Bake(BufferIndex bufferIndex, EndAction action) void Animation::SetAnimatorsActive(bool active) { - DALI_LOG_DEBUG_INFO("Animation[%u] with duration %f ms %s\n", GetNotifyId(), mDurationSeconds * 1000.0f, active ? "Play" : "Stop"); + DALI_LOG_DEBUG_INFO("Animation[%u] with duration %f ms %s (before state : %c)\n", GetNotifyId(), mDurationSeconds * 1000.0f, active ? "Play" : "Stop", "SRPD"[mState]); for(auto&& item : mAnimators) { item->SetActive(active); @@ -272,7 +278,7 @@ bool Animation::Stop(BufferIndex bufferIndex) if(mEndAction != Dali::Animation::DISCARD) { Bake(bufferIndex, mEndAction); - DALI_LOG_DEBUG_INFO("Animation[%u] with duration %f ms Stop\n", GetNotifyId(), mDurationSeconds * 1000.0f); + DALI_LOG_DEBUG_INFO("Animation[%u] with duration %f ms Stop (before state : %c)\n", GetNotifyId(), mDurationSeconds * 1000.0f, "SRPD"[mState]); // Animators are automatically set to inactive in Bake } @@ -308,7 +314,7 @@ void Animation::ClearAnimator(BufferIndex bufferIndex) mPlayedCount = 0; mCurrentLoop = 0; - DALI_LOG_DEBUG_INFO("Animation[%u] with duration %f ms Clear\n", GetNotifyId(), mDurationSeconds * 1000.0f); + DALI_LOG_DEBUG_INFO("Animation[%u] with duration %f ms Clear (before state : %c)\n", GetNotifyId(), mDurationSeconds * 1000.0f, "SRPD"[mState]); } void Animation::OnDestroy(BufferIndex bufferIndex) @@ -327,10 +333,10 @@ void Animation::OnDestroy(BufferIndex bufferIndex) } } + DALI_LOG_DEBUG_INFO("Animation[%u] with duration %f ms Destroy (before state : %c)\n", GetNotifyId(), mDurationSeconds * 1000.0f, "SRPD"[mState]); + mIsStopped = false; ///< Do not make notify. mState = Destroyed; - - DALI_LOG_DEBUG_INFO("Animation[%u] with duration %f ms Destroy\n", GetNotifyId(), mDurationSeconds * 1000.0f); } void Animation::SetLoopingMode(bool loopingMode) @@ -438,6 +444,7 @@ void Animation::Update(BufferIndex bufferIndex, float elapsedSeconds, bool& stop { DALI_ASSERT_DEBUG(mCurrentLoop == mLoopCount); finished = true; + DALI_LOG_DEBUG_INFO("Animation[%u] with duration %f ms Finished (before state : %c)\n", GetNotifyId(), mDurationSeconds * 1000.0f, "SRPD"[mState]); // The animation has now been played to completion ++mPlayedCount;