X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fanimated-image%2Ffixed-image-cache.cpp;h=726cd39fd13810702282217caa3b729e80c60e41;hp=9acf1aff2f693afa448d0e7fee739edec1594116;hb=e0a22e262eed4f4ed32fa3f88783e99a3380eb42;hpb=f00334715a31692c0bfd7eb0a7fc67c5ae09f327 diff --git a/dali-toolkit/internal/visuals/animated-image/fixed-image-cache.cpp b/dali-toolkit/internal/visuals/animated-image/fixed-image-cache.cpp index 9acf1af..726cd39 100644 --- a/dali-toolkit/internal/visuals/animated-image/fixed-image-cache.cpp +++ b/dali-toolkit/internal/visuals/animated-image/fixed-image-cache.cpp @@ -54,24 +54,21 @@ FixedImageCache::~FixedImageCache() } } -TextureSet FixedImageCache::FirstFrame() +TextureSet FixedImageCache::Frame( uint32_t frameIndex ) { - TextureSet textureSet = GetFrontTextureSet(); - - if( ! textureSet ) + while( frameIndex > mFront ) { - mWaitingForReadyFrame = true; + ++mFront; + if( mFront >= mImageUrls.size() ) + { + mFront = 0; + } + LoadBatch(); } - return textureSet; -} + mFront = frameIndex; -TextureSet FixedImageCache::NextFrame() -{ TextureSet textureSet; - ++mFront; - mFront %= mImageUrls.size(); - if( IsFrontReady() == true ) { textureSet = GetFrontTextureSet(); @@ -81,11 +78,26 @@ TextureSet FixedImageCache::NextFrame() mWaitingForReadyFrame = true; } - LoadBatch(); + return textureSet; +} + +TextureSet FixedImageCache::FirstFrame() +{ + TextureSet textureSet = GetFrontTextureSet(); + + if( ! textureSet ) + { + mWaitingForReadyFrame = true; + } return textureSet; } +uint32_t FixedImageCache::GetFrameInterval( uint32_t frameIndex ) +{ + return 0u; +} + bool FixedImageCache::IsFrontReady() const { return ( mReadyFlags.size() > 0 && mReadyFlags[mFront] == true ); @@ -96,7 +108,7 @@ void FixedImageCache::LoadBatch() // Try and load up to mBatchSize images, until the cache is filled. // Once the cache is filled, mUrlIndex exceeds mImageUrls size and // no more images are loaded. - bool frontFrameReady = IsFrontReady();; + bool frontFrameReady = IsFrontReady(); for( unsigned int i=0; i< mBatchSize && mUrlIndex < mImageUrls.size(); ++i ) {