Cache animated image's frame index
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / texture-manager / texture-manager-impl.h
index 01f62ee..5800e54 100644 (file)
@@ -115,11 +115,11 @@ public:
    * @param[in]  animatedImageLoading  The AnimatedImageLoading that contain the animated image information
    * @param[in]  frameIndex            The frame index to load.
    * @param[out] textureId             The textureId of the frame
+   * @param[in, out] maskInfo          Mask info structure
    * @param[in]  samplingMode          The SamplingMode to use
    * @param[in]  wrapModeU             Horizontal Wrap mode
    * @param[in]  wrapModeV             Vertical Wrap mode
    * @param[in]  synchronousLoading    true if the frame should be loaded synchronously
-   * @param[in]  useCache              true if this frame loading uses cache.
    * @param[in]  textureObserver       The client object should inherit from this and provide the "LoadCompleted" virtual.
    *                                   This is called when an image load completes (or fails).
    *
@@ -128,11 +128,11 @@ public:
   TextureSet LoadAnimatedImageTexture(Dali::AnimatedImageLoading      animatedImageLoading,
                                       const uint32_t&                 frameIndex,
                                       TextureManager::TextureId&      textureId,
+                                      MaskingDataPointer&             maskInfo,
                                       const Dali::SamplingMode::Type& samplingMode,
                                       const Dali::WrapMode::Type&     wrapModeU,
                                       const Dali::WrapMode::Type&     wrapModeV,
                                       const bool&                     synchronousLoading,
-                                      const bool&                     useCache,
                                       TextureUploadObserver*          textureObserver);
 
   /**
@@ -283,11 +283,11 @@ public:
   }
 
   /**
-   * @copydoc TextureCacheManager::RemoveExternalEncodedImageBuffer
+   * @copydoc TextureCacheManager::RemoveEncodedImageBuffer
    */
-  inline EncodedImageBuffer RemoveExternalEncodedImageBuffer(const std::string& url)
+  inline EncodedImageBuffer RemoveEncodedImageBuffer(const std::string& url)
   {
-    return mTextureCacheManager.RemoveExternalEncodedImageBuffer(url);
+    return mTextureCacheManager.RemoveEncodedImageBuffer(url);
   }
 
   /**
@@ -315,11 +315,11 @@ public:
   }
 
   /**
-   * @copydoc TextureCacheManager::AddExternalEncodedImageBuffer
+   * @copydoc TextureCacheManager::AddEncodedImageBuffer
    */
-  inline std::string AddExternalEncodedImageBuffer(const EncodedImageBuffer& encodedImageBuffer)
+  inline std::string AddEncodedImageBuffer(const EncodedImageBuffer& encodedImageBuffer)
   {
-    return mTextureCacheManager.AddExternalEncodedImageBuffer(encodedImageBuffer);
+    return mTextureCacheManager.AddEncodedImageBuffer(encodedImageBuffer);
   }
 
 public: // Load Request API
@@ -454,7 +454,6 @@ private:
    * @param[in] frameIndex            The frame index of a frame to be loaded frame
    * @param[in] synchronousLoading    True if the frame should be loaded synchronously. If you skip this parameter,
    *                                  default is false.
-   * @param[in] useCache              True if the texture will be cached.
    * @return                          A TextureId to use as a handle to reference this Texture
    */
   TextureId RequestLoadInternal(
@@ -473,8 +472,7 @@ private:
     TextureManager::MultiplyOnLoad&     preMultiplyOnLoad,
     Dali::AnimatedImageLoading          animatedImageLoading,
     const std::uint32_t&                frameIndex,
-    const bool&                         synchronousLoading,
-    const bool&                         useCache);
+    const bool&                         synchronousLoading);
 
   /**
    * @brief Load a new image synchronously.
@@ -536,7 +534,12 @@ private:
   /**
    * @brief Initiate load of textures queued whilst NotifyObservers invoking callbacks.
    */
-  void ProcessQueuedTextures();
+  void ProcessLoadQueue();
+
+  /**
+   * @brief Initiate remove of texture queued whilst NotifyObservers invoking callbacks.
+   */
+  void ProcessRemoveQueue();
 
   /**
    * Add the observer to the observer list
@@ -624,9 +627,10 @@ private:                                    // Member Variables:
   RoundRobinContainerView<TextureAsyncLoadingHelper> mAsyncLocalLoaders;  ///< The Asynchronous image loaders used to provide all local async loads
   RoundRobinContainerView<TextureAsyncLoadingHelper> mAsyncRemoteLoaders; ///< The Asynchronous image loaders used to provide all remote async loads
 
-  Dali::Vector<LifecycleObserver*> mLifecycleObservers; ///< Lifecycle observers of texture manager
-  Dali::Vector<LoadQueueElement>   mLoadQueue;          ///< Queue of textures to load after NotifyObservers
-  bool                             mQueueLoadFlag;      ///< Flag that causes Load Textures to be queued.
+  Dali::Vector<LifecycleObserver*>        mLifecycleObservers; ///< Lifecycle observers of texture manager
+  Dali::Vector<LoadQueueElement>          mLoadQueue;          ///< Queue of textures to load after NotifyObservers
+  Dali::Vector<TextureManager::TextureId> mRemoveQueue;        ///< Queue of textures to remove after NotifyObservers
+  bool                                    mQueueLoadFlag;      ///< Flag that causes Load Textures to be queued.
 };
 
 } // namespace Internal