-void RollingAnimatedImageCache::LoadComplete(
- bool loadSuccess,
- Devel::PixelBuffer pixelBuffer,
- const VisualUrl& url,
- bool preMultiplied)
-{
- // LoadComplete is called if this TextureUploadObserver requested to load
- // an image that will be returned as a type of PixelBuffer by using a method
- // TextureManager::LoadPixelBuffer.
+ if(loadSuccess)
+ {
+ // The frames of a single animated image can not be loaded parallelly.
+ // Therefore, a frame is now loading, other orders are waiting.
+ // And, after the frame is loaded, requests load of next order.
+ if(!mLoadWaitingQueue.empty())
+ {
+ uint32_t loadingIndex = mLoadWaitingQueue.front();
+ mLoadWaitingQueue.erase(mLoadWaitingQueue.begin());
+ RequestFrameLoading(loadingIndex, false);
+ }
+ else if(mQueue.Count() == 1u && textureInformation.frameCount > SINGLE_IMAGE_COUNT)
+ {
+ // There is only an image in queue and no waiting queue.
+ // Request to load batch once again.
+ uint32_t batchFrameIndex = 0u;
+ if(!mLoadWaitingQueue.empty())
+ {
+ batchFrameIndex = (mLoadWaitingQueue.back() + 1) % mFrameCount;
+ }
+ else
+ {
+ batchFrameIndex = (mQueue.Back().mFrameNumber + 1) % mFrameCount;
+ }
+ LoadBatch(batchFrameIndex);
+ }
+ }
+
+ LOG_CACHE;