+ mImpl->mRenderer.RegisterProperty(PIXEL_AREA_UNIFORM_NAME, mPixelArea);
+ }
+}
+
+void AnimatedImageVisual::LoadFirstBatch()
+{
+ // Ensure the batch size and cache size are no bigger than the number of URLs,
+ // and that the cache is at least as big as the batch size.
+ uint16_t numUrls = 0;
+ uint16_t batchSize = 1;
+ uint16_t cacheSize = 1;
+
+ if(mImageUrls)
+ {
+ numUrls = mImageUrls->size();
+ }
+ else
+ {
+ numUrls = mFrameCount;
+ }
+
+ batchSize = std::min(mBatchSize, numUrls);
+ cacheSize = std::min(std::max(batchSize, mCacheSize), numUrls);
+
+ DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "AnimatedImageVisual::LoadFirstBatch() batchSize:%d cacheSize:%d\n", batchSize, cacheSize);
+
+ mUrlIndex = 0;
+ TextureManager& textureManager = mFactoryCache.GetTextureManager();
+
+ if(mAnimatedImageLoading)
+ {
+ mImageCache = new RollingAnimatedImageCache(textureManager, mAnimatedImageLoading, mFrameCount, *this, cacheSize, batchSize, IsSynchronousLoadingRequired());
+ }
+ else if(mImageUrls)
+ {
+ if(batchSize > 0 && cacheSize > 0)
+ {
+ if(cacheSize < numUrls)
+ {
+ mImageCache = new RollingImageCache(textureManager, *mImageUrls, *this, cacheSize, batchSize);
+ }
+ else
+ {
+ mImageCache = new FixedImageCache(textureManager, *mImageUrls, *this, batchSize);
+ }
+ }
+ else
+ {
+ mImageCache = new RollingImageCache(textureManager, *mImageUrls, *this, 1, 1);
+ }
+ }
+
+ if(!mImageCache)
+ {
+ DALI_LOG_ERROR("mImageCache is null\n");
+ }
+}
+
+void AnimatedImageVisual::StartFirstFrame(TextureSet& textureSet)
+{
+ DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "AnimatedImageVisual::StartFirstFrame()\n");
+
+ mStartFirstFrame = false;
+ if(mImpl->mRenderer)
+ {
+ mImpl->mRenderer.SetTextures(textureSet);
+
+ Actor actor = mPlacementActor.GetHandle();
+ if(actor)