Remove useless iteration when debug mode
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / animated-image / rolling-image-cache.cpp
index c0c598a..7a84f5b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -29,6 +29,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() << " [ ";                                                                                                                           \
@@ -81,7 +82,7 @@ TextureSet RollingImageCache::Frame(uint32_t frameIndex)
   while(!mQueue.IsEmpty() && mQueue.Front().mUrlIndex != frameIndex)
   {
     PopFrontCache();
-    popExist                                    = true;
+    popExist = true;
   }
 
   // TODO: synchronous loading of first frame.
@@ -144,7 +145,7 @@ void RollingImageCache::LoadBatch(uint32_t frameIndex)
   {
     ImageFrame imageFrame;
 
-    std::string& url     = mImageUrls[frameIndex].mUrl;
+    VisualUrl& url       = mImageUrls[frameIndex].mUrl;
     imageFrame.mUrlIndex = frameIndex;
     imageFrame.mReady    = false;
 
@@ -154,16 +155,16 @@ void RollingImageCache::LoadBatch(uint32_t frameIndex)
     // from within this method. This means it won't yet have a texture id, so we
     // need to account for this inside the LoadComplete method using mRequestingLoad.
     mRequestingLoad = true;
-    mLoadState = TextureManager::LoadState::LOADING;
+    mLoadState      = TextureManager::LoadState::LOADING;
 
-    bool                               synchronousLoading = false;
-    bool                               atlasingStatus     = false;
-    bool                               loadingStatus      = false;
-    AtlasUploadObserver*               atlasObserver      = nullptr;
-    ImageAtlasManagerPtr               imageAtlasManager  = nullptr;
-    Vector4                            textureRect;
-    Dali::ImageDimensions              textureRectSize;
-    auto                               preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
+    bool                  synchronousLoading = false;
+    bool                  atlasingStatus     = false;
+    bool                  loadingStatus      = false;
+    AtlasUploadObserver*  atlasObserver      = nullptr;
+    ImageAtlasManagerPtr  imageAtlasManager  = nullptr;
+    Vector4               textureRect;
+    Dali::ImageDimensions textureRectSize;
+    auto                  preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
 
     TextureManager::TextureId loadTextureId = TextureManager::INVALID_TEXTURE_ID;
     TextureSet                textureSet    = mTextureManager.LoadTexture(
@@ -220,7 +221,7 @@ void RollingImageCache::LoadComplete(bool loadSuccess, TextureInformation textur
 
   if(loadSuccess)
   {
-    mLoadState = TextureManager::LoadState::LOAD_FINISHED;
+    mLoadState           = TextureManager::LoadState::LOAD_FINISHED;
     bool frontFrameReady = IsFrontReady();
     if(!mRequestingLoad)
     {