Remove useless iteration when debug mode
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / animated-image / rolling-animated-image-cache.cpp
index 2929d89..74ec088 100644 (file)
@@ -28,6 +28,7 @@ namespace
 Debug::Filter* gAnimImgLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_ANIMATED_IMAGE");
 
 #define LOG_CACHE                                                                                                       \
+  if(gAnimImgLogFilter->IsEnabledFor(Debug::Concise))                                                                   \
   {                                                                                                                     \
     std::ostringstream oss;                                                                                             \
     oss << "Size:" << mQueue.Count() << " [ ";                                                                          \
@@ -65,7 +66,8 @@ RollingAnimatedImageCache::RollingAnimatedImageCache(TextureManager&
                                                      ImageCache::FrameReadyObserver&     observer,
                                                      uint16_t                            cacheSize,
                                                      uint16_t                            batchSize,
-                                                     bool                                isSynchronousLoading)
+                                                     bool                                isSynchronousLoading,
+                                                     bool                                preMultiplyOnLoad)
 : ImageCache(textureManager, maskingData, observer, batchSize, 0u),
   mImageUrl(animatedImageLoading.GetUrl()),
   mAnimatedImageLoading(animatedImageLoading),
@@ -73,7 +75,8 @@ RollingAnimatedImageCache::RollingAnimatedImageCache(TextureManager&
   mFrameIndex(FIRST_FRAME_INDEX),
   mCacheSize(cacheSize),
   mQueue(cacheSize),
-  mIsSynchronousLoading(isSynchronousLoading)
+  mIsSynchronousLoading(isSynchronousLoading),
+  mPreMultiplyOnLoad(preMultiplyOnLoad)
 {
   mTextureIds.resize(mFrameCount);
   mIntervals.assign(mFrameCount, 0);
@@ -191,6 +194,9 @@ TextureSet RollingAnimatedImageCache::RequestFrameLoading(uint32_t frameIndex, b
 
   mLoadState = TextureManager::LoadState::LOADING;
 
+  auto preMultiplyOnLoading = mPreMultiplyOnLoad ? TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD
+                                                 : TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
+
   TextureManager::TextureId loadTextureId = TextureManager::INVALID_TEXTURE_ID;
   TextureSet                textureSet    = mTextureManager.LoadAnimatedImageTexture(mImageUrl,
                                                                    mAnimatedImageLoading,
@@ -201,7 +207,8 @@ TextureSet RollingAnimatedImageCache::RequestFrameLoading(uint32_t frameIndex, b
                                                                    Dali::WrapMode::Type::DEFAULT,
                                                                    Dali::WrapMode::Type::DEFAULT,
                                                                    synchronousLoading,
-                                                                   this);
+                                                                   this,
+                                                                   preMultiplyOnLoading);
 
   mTextureIds[frameIndex] = loadTextureId;