* | new cache
* | cache->LoadBatch()
* |
- * | DoSetOnStage()
+ * | DoSetOnScene()
* | PrepareTextureSet()
* | cache->FirstFrame()
* | CreateRenderer() (Doesn't become ready until first frame loads)
mCurrentFrameIndex( 0 ),
mImageUrls( NULL ),
mImageCache( NULL ),
- mCacheSize( 1 ),
- mBatchSize( 1 ),
+ mCacheSize( 2 ),
+ mBatchSize( 2 ),
mFrameDelay( 100 ),
mLoopCount( LOOP_FOREVER ),
mCurrentLoopIndex( 0 ),
{
map.Clear();
+ bool sync = IsSynchronousLoadingRequired();
+ map.Insert( Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, sync );
+
map.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::ANIMATED_IMAGE );
if( mImageUrl.IsValid() )
}
case DevelAnimatedImageVisual::Action::PLAY:
{
- if( mFrameDelayTimer && IsOnStage() && mActionStatus != DevelAnimatedImageVisual::Action::PLAY )
+ if( mFrameDelayTimer && IsOnScene() && mActionStatus != DevelAnimatedImageVisual::Action::PLAY )
{
mFrameDelayTimer.Start();
}
// STOP reset functionality will actually be done in a future change
// Stop will be executed on next timer tick
mActionStatus = DevelAnimatedImageVisual::Action::STOP;
- if( IsOnStage() )
+ if( IsOnScene() )
{
DisplayNextFrame();
}
{
mIsJumpTo = true;
mCurrentFrameIndex = frameNumber;
- if( IsOnStage() )
+ if( IsOnScene() )
{
DisplayNextFrame();
}
int batchSize;
if( value.Get( batchSize ) )
{
- mBatchSize = batchSize;
+ if( batchSize < 2 )
+ {
+ DALI_LOG_ERROR( "The minimum value of batch size is 2." );
+ }
+ else
+ {
+ mBatchSize = batchSize;
+ }
}
break;
}
int cacheSize;
if( value.Get( cacheSize ) )
{
- mCacheSize = cacheSize;
+ if( cacheSize < 2 )
+ {
+ DALI_LOG_ERROR( "The minimum value of cache size is 2." );
+ }
+ else
+ {
+ mCacheSize = cacheSize;
+ }
}
break;
}
}
break;
}
+
+ case Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING:
+ {
+ bool sync = false;
+ value.Get( sync );
+ if( sync )
+ {
+ mImpl->mFlags |= Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
+ }
+ else
+ {
+ mImpl->mFlags &= ~Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
+ }
+ break;
+ }
}
}
-void AnimatedImageVisual::DoSetOnStage( Actor& actor )
+void AnimatedImageVisual::DoSetOnScene( Actor& actor )
{
mPlacementActor = actor;
TextureSet textureSet = PrepareTextureSet();
}
}
-void AnimatedImageVisual::DoSetOffStage( Actor& actor )
+void AnimatedImageVisual::DoSetOffScene( Actor& actor )
{
DALI_ASSERT_DEBUG( (bool)mImpl->mRenderer && "There should always be a renderer whilst on stage");
if( mAnimatedImageLoading )
{
- mImageCache = new RollingAnimatedImageCache( textureManager, mAnimatedImageLoading, mFrameCount, *this, cacheSize, batchSize );
+ mImageCache = new RollingAnimatedImageCache( textureManager, mAnimatedImageLoading, mFrameCount, *this, cacheSize, batchSize, IsSynchronousLoadingRequired() );
}
else if( mImageUrls )
{
{
TextureSet textureSet;
if (mImageCache)
+ {
textureSet = mImageCache->FirstFrame();
+ }
if( textureSet )
{
SetImageSize( textureSet );
}
else
{
- DALI_LOG_INFO(gAnimImgLogFilter,Debug::Concise,"ResourceReady(ResourceStatus::FAILED)\n");
+ DALI_LOG_INFO( gAnimImgLogFilter, Debug::Concise, "ResourceReady(ResourceStatus::FAILED)\n" );
ResourceReady( Toolkit::Visual::ResourceStatus::FAILED );
}
}
else
{
- if(mImpl->mRenderer)
+ if( mImpl->mRenderer )
{
mImpl->mRenderer.SetTextures( textureSet );
}