(Vector) RenderOnce only if rasterize successed + Print more info 54/320854/3
authorEunki, Hong <eunkiki.hong@samsung.com>
Mon, 25 Nov 2024 05:12:25 +0000 (14:12 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Mon, 25 Nov 2024 09:04:34 +0000 (18:04 +0900)
Let we print more logs if vector animation task finished

Change-Id: I1cb3cf8599dc7a2974f147fafbdfd9728c85b703
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.cpp

index dd00e84cf6ab90a9ddcafdd4171c48a8838f89d4..1342cf49c6d31f458de30d6a583dedd38f3c05f5 100644 (file)
@@ -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<int>(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<int>(mPlayState), static_cast<int>(mAnimationData.playState), mImageUrl.GetEllipsedUrl().c_str());
     }
     mVectorAnimationTask->SetAnimationData(mAnimationData);
 
index 68547e2d349b9e7aa23a1a8865de9f28dfc60ae8..d3607b70681b17553911b7ef40cd8ffafc8f78bf 100644 (file)
@@ -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() << "]";
   });
 
index 0b7ac49543e0e1fc4e6118fc974b440b3022cd48..7fb77e617892d77365ab23d3855692814fffe933 100644 (file)
@@ -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();