+void TextureManager::LoadTexture( TextureInfo& textureInfo, TextureUploadObserver* observer )
+{
+ DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::LoadTexture(): url:%s sync:%s\n",
+ textureInfo.url.GetUrl().c_str(), textureInfo.loadSynchronously?"T":"F" );
+
+ textureInfo.loadState = LOADING;
+ if( !textureInfo.loadSynchronously )
+ {
+ auto& loadersContainer = textureInfo.url.IsLocalResource() ? mAsyncLocalLoaders : mAsyncRemoteLoaders;
+ auto loadingHelperIt = loadersContainer.GetNext();
+ DALI_ASSERT_ALWAYS(loadingHelperIt != loadersContainer.End());
+ loadingHelperIt->Load(textureInfo.textureId, textureInfo.url,
+ textureInfo.desiredSize, textureInfo.fittingMode,
+ textureInfo.samplingMode, textureInfo.orientationCorrection );
+ }
+ ObserveTexture( textureInfo, observer );
+}
+
+void TextureManager::ProcessQueuedTextures()
+{
+ for( auto&& element : mLoadQueue )
+ {
+ int cacheIndex = GetCacheIndexFromId( element.mTextureId );
+ if( cacheIndex != INVALID_CACHE_INDEX )
+ {
+ TextureInfo& textureInfo( mTextureInfoContainer[cacheIndex] );
+ if( textureInfo.loadState == UPLOADED )
+ {
+ element.mObserver->UploadComplete( true, textureInfo.textureId, textureInfo.textureSet,
+ textureInfo.useAtlas, textureInfo.atlasRect,
+ textureInfo.preMultiplied );
+ }
+ else
+ {
+ LoadTexture( textureInfo, element.mObserver );
+ }
+ }
+ }
+ mLoadQueue.Clear();