From 996e78676bc48ff35889167fc76d48e798955855 Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Mon, 25 Nov 2024 14:12:25 +0900 Subject: [PATCH] (Vector) RenderOnce only if rasterize successed + Print more info Let we print more logs if vector animation task finished Change-Id: I1cb3cf8599dc7a2974f147fafbdfd9728c85b703 Signed-off-by: Eunki, Hong --- .../animated-vector-image-visual.cpp | 10 ++++++++++ .../animated-vector-image/vector-animation-task.cpp | 5 ++++- .../animated-vector-image/vector-animation-thread.cpp | 4 ++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp b/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp index dd00e84cf6..1342cf49c6 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp +++ b/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp @@ -598,6 +598,7 @@ void AnimatedVectorImageVisual::OnDoAction(const Property::Index actionId, const mAnimationData.playState = DevelImageVisual::PlayState::PLAYING; mAnimationData.resendFlag |= VectorAnimationTask::RESEND_PLAY_STATE; } + DALI_LOG_DEBUG_INFO("[%p] Play request (url:%s)\n", this, mImageUrl.GetEllipsedUrl().c_str()); mPlayState = DevelImageVisual::PlayState::PLAYING; break; } @@ -608,6 +609,7 @@ void AnimatedVectorImageVisual::OnDoAction(const Property::Index actionId, const mAnimationData.playState = DevelImageVisual::PlayState::PAUSED; mAnimationData.resendFlag |= VectorAnimationTask::RESEND_PLAY_STATE; } + DALI_LOG_DEBUG_INFO("[%p] Pause request (url:%s)\n", this, mImageUrl.GetEllipsedUrl().c_str()); mPlayState = DevelImageVisual::PlayState::PAUSED; break; } @@ -618,6 +620,7 @@ void AnimatedVectorImageVisual::OnDoAction(const Property::Index actionId, const mAnimationData.playState = DevelImageVisual::PlayState::STOPPED; mAnimationData.resendFlag |= VectorAnimationTask::RESEND_PLAY_STATE; } + DALI_LOG_DEBUG_INFO("[%p] Stop request (url:%s)\n", this, mImageUrl.GetEllipsedUrl().c_str()); mPlayState = DevelImageVisual::PlayState::STOPPED; break; } @@ -628,6 +631,7 @@ void AnimatedVectorImageVisual::OnDoAction(const Property::Index actionId, const { mAnimationData.currentFrame = frameNumber; mAnimationData.resendFlag |= VectorAnimationTask::RESEND_CURRENT_FRAME; + DALI_LOG_DEBUG_INFO("[%p] Jump to (%d) request (url:%s)\n", this, frameNumber, mImageUrl.GetEllipsedUrl().c_str()); } break; } @@ -635,6 +639,7 @@ void AnimatedVectorImageVisual::OnDoAction(const Property::Index actionId, const { if(DALI_LIKELY(Dali::Adaptor::IsAvailable())) { + DALI_LOG_DEBUG_INFO("[%p] Flush request (url:%s)\n", this, mImageUrl.GetEllipsedUrl().c_str()); SendAnimationData(); } break; @@ -662,6 +667,8 @@ void AnimatedVectorImageVisual::OnDoActionExtension(const Property::Index action void AnimatedVectorImageVisual::OnResourceReady(VectorAnimationTask::ResourceStatus status) { + DALI_LOG_DEBUG_INFO("[%p] OnResourceReady (status:%d) (url:%s)\n", this, static_cast(status), mImageUrl.GetEllipsedUrl().c_str()); + AnimatedVectorImageVisualPtr self = this; // Keep reference until this API finished if(status == VectorAnimationTask::ResourceStatus::LOADED) @@ -724,6 +731,8 @@ void AnimatedVectorImageVisual::OnResourceReady(VectorAnimationTask::ResourceSta void AnimatedVectorImageVisual::OnAnimationFinished(uint32_t playStateId) { + DALI_LOG_DEBUG_INFO("[%p] OnAnimationFinished (id : %u vs %u) (url:%s)\n", this, mLastSentPlayStateId, playStateId, mImageUrl.GetEllipsedUrl().c_str()); + // Only send event when animation is finished by the last Play/Pause/Stop request. if(mLastSentPlayStateId != playStateId) { @@ -762,6 +771,7 @@ void AnimatedVectorImageVisual::SendAnimationData() // The OnAnimationFinished signal what before Play/Pause/Stop action send could be come after action sent. // To ensure the OnAnimationFinished signal comes belong to what we sent, we need to keep last sent playId. mAnimationData.playStateId = ++mLastSentPlayStateId; + DALI_LOG_DEBUG_INFO("[%p] Resend play state request (id:%u) (state:%d,%d) (url:%s)\n", this, mLastSentPlayStateId, static_cast(mPlayState), static_cast(mAnimationData.playState), mImageUrl.GetEllipsedUrl().c_str()); } mVectorAnimationTask->SetAnimationData(mAnimationData); diff --git a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp index 68547e2d34..d3607b7068 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp +++ b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp @@ -730,7 +730,7 @@ bool VectorAnimationTask::Rasterize() } // Forcely trigger render once if need. - if(mNotifyAfterRasterization || mNeedForceRenderOnceTrigger) + if(renderSuccess && (mNotifyAfterRasterization || mNeedForceRenderOnceTrigger)) { mVectorAnimationThread.RequestForceRenderOnce(); mNeedForceRenderOnceTrigger = false; @@ -755,6 +755,9 @@ bool VectorAnimationTask::Rasterize() oss << " "; oss << "l:" << mCurrentLoop << " "; oss << "p:" << mPlayState << " "; + oss << "r:" << renderSuccess << " "; + oss << "s:" << stopped << " "; + oss << "k:" << mKeepAnimation << " "; oss << "u:" << mImageUrl.GetEllipsedUrl() << "]"; }); diff --git a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.cpp b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.cpp index 0b7ac49543..7fb77e6178 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.cpp +++ b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.cpp @@ -173,6 +173,7 @@ void VectorAnimationThread::AddEventTriggerCallback(CallbackBase* callback, uint if(!mEventTriggered) { + DALI_LOG_DEBUG_INFO("VectorAnimationThread::mEventTrigger Triggered!\n"); mEventTrigger->Trigger(); mEventTriggered = true; } @@ -200,6 +201,7 @@ void VectorAnimationThread::RequestForceRenderOnce() if(!mEventTriggered) { + DALI_LOG_DEBUG_INFO("VectorAnimationThread::mEventTrigger Triggered!\n"); mEventTrigger->Trigger(); mEventTriggered = true; } @@ -431,6 +433,8 @@ void VectorAnimationThread::Rasterize() /// Event thread called (Due to mTrigger triggered) void VectorAnimationThread::OnEventCallbackTriggered() { + DALI_TRACE_SCOPE(gTraceFilter, "VECTOR_ANIMATION_EVENT_CALLBACK_TRIGGERED"); + while(true) { auto callbackPair = GetNextEventCallback(); -- 2.34.1