[Tizen](Vector) Ignore rendered frames when the vector rendering is failed repeatedly 49/221249/1
authorHeeyong Song <heeyong.song@samsung.com>
Mon, 30 Dec 2019 09:20:39 +0000 (18:20 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 30 Dec 2019 09:41:18 +0000 (18:41 +0900)
Change-Id: I20b94a698a882c2938c3555d7586f0af94e3d05f

automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.cpp
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h

index cf52774..ee74ea0 100755 (executable)
@@ -245,6 +245,10 @@ bool VectorAnimationRenderer::GetMarkerInfo( const std::string& marker, uint32_t
   return Internal::Adaptor::GetImplementation( *this ).GetMarkerInfo( marker, startFrame, endFrame );
 }
 
+void VectorAnimationRenderer::IgnoreRenderedFrames()
+{
+}
+
 VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
 {
   return Internal::Adaptor::GetImplementation( *this ).UploadCompletedSignal();
index bb6fb7e..f1feb6f 100644 (file)
@@ -84,7 +84,8 @@ VectorAnimationTask::VectorAnimationTask( VisualFactoryCache& factoryCache, cons
   mCurrentLoopUpdated( false ),
   mForward( true ),
   mUpdateFrameNumber( false ),
-  mNeedAnimationFinishedTrigger( true )
+  mNeedAnimationFinishedTrigger( true ),
+  mForceRender( false )
 {
   Initialize();
 }
@@ -308,7 +309,7 @@ void VectorAnimationTask::SetPlayRange( const Property::Array& playRange )
   }
 
   // Make sure the range specified is between 0 and the total frame number
-  if( startFrame >= 0 && startFrame < mTotalFrame && endFrame >= 0 && endFrame < mTotalFrame )
+  if( startFrame < mTotalFrame && endFrame < mTotalFrame )
   {
     // If the range is not in order swap values
     if( startFrame > endFrame )
@@ -561,14 +562,33 @@ bool VectorAnimationTask::Rasterize()
     if( !renderSuccess )
     {
       DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::Rasterize: Rendering failed. Try again later.[%d] [%p]\n", currentFrame, this );
-      mUpdateFrameNumber = false;
 
-      if( !resourceReady )
+      if( mForceRender )
       {
-        ConditionalWait::ScopedLock lock( mConditionalWait );
-        mResourceReady = false;
+        // Ignore previous frames and retry
+        mVectorRenderer.IgnoreRenderedFrames();
+        renderSuccess = mVectorRenderer.Render( currentFrame );
+        mForceRender = false;
+      }
+      else
+      {
+        mForceRender = true;
+      }
+
+      if( !renderSuccess )
+      {
+        mUpdateFrameNumber = false;
+        if( !resourceReady )
+        {
+          ConditionalWait::ScopedLock lock( mConditionalWait );
+          mResourceReady = false;
+        }
       }
     }
+    else
+    {
+      mForceRender = false;
+    }
   }
 
   if( stopped && renderSuccess )
index 6fbd293..6d24518 100644 (file)
@@ -305,6 +305,7 @@ private:
   bool                                   mForward;
   bool                                   mUpdateFrameNumber;
   bool                                   mNeedAnimationFinishedTrigger;
+  bool                                   mForceRender;
 
 };