Fix issue, agif to play a number of times of loopcount.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / animated-image / animated-image-visual.cpp
index ec58860..b1463ba 100755 (executable)
@@ -444,7 +444,7 @@ void AnimatedImageVisual::CreateRenderer()
 {
   bool defaultWrapMode = mWrapModeU <= WrapMode::CLAMP_TO_EDGE && mWrapModeV <= WrapMode::CLAMP_TO_EDGE;
   bool atlasing = false;
-  Shader shader = mImageVisualShaderFactory.GetShader( mFactoryCache, atlasing, defaultWrapMode );
+  Shader shader = mImageVisualShaderFactory.GetShader( mFactoryCache, atlasing, defaultWrapMode, IsRoundedCornerRequired() );
 
   Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY );
 
@@ -527,7 +527,10 @@ void AnimatedImageVisual::StartFirstFrame( TextureSet& textureSet )
   DALI_LOG_INFO(gAnimImgLogFilter,Debug::Concise,"AnimatedImageVisual::StartFirstFrame()\n");
 
   mStartFirstFrame = false;
-  mImpl->mRenderer.SetTextures( textureSet );
+  if(mImpl->mRenderer)
+  {
+    mImpl->mRenderer.SetTextures( textureSet );
+  }
   Actor actor = mPlacementActor.GetHandle();
   if( actor )
   {
@@ -594,7 +597,10 @@ void AnimatedImageVisual::FrameReady( TextureSet textureSet )
   }
   else
   {
-    mImpl->mRenderer.SetTextures( textureSet );
+    if(mImpl->mRenderer)
+    {
+      mImpl->mRenderer.SetTextures( textureSet );
+    }
   }
 }
 
@@ -609,7 +615,7 @@ bool AnimatedImageVisual::DisplayNextFrame()
     // Wrap the frame index
     ++mCurrentFrameIndex;
 
-    if( mLoopCount < 0 || mCurrentLoopIndex <= mLoopCount)
+    if( mLoopCount < 0 || mCurrentLoopIndex < mLoopCount)
     {
       mCurrentFrameIndex %= mFrameCount;
       if( mCurrentFrameIndex == 0 )