Merge "Support FastTrackUploading for YUV images" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / texture-manager / texture-manager-impl.h
index 68bf165..59aa9b7 100644 (file)
@@ -99,8 +99,10 @@ public:
 
   /**
    * Constructor.
+   *
+   * @param[in] loadYuvPlanes Whether we allow to load YuvPlanes or not. Default is false.
    */
-  TextureManager();
+  TextureManager(bool loadYuvPlanes = false);
 
   /**
    * Destructor.
@@ -186,7 +188,8 @@ public:
    * @param[in] samplingMode          The SamplingMode to use
    * @param[in, out] maskInfo         Mask info structure
    * @param[in] synchronousLoading    true if the URL should be loaded synchronously
-   * @param[out] textureId,           The textureId of the URL
+   * @param[in, out] textureId        The textureId of the URL. It is also be used to check the previous textureId
+   *                                  what requestor had. It will be used only ReloadPolicy::FORCED for now.
    * @param[out] textureRect          The rectangle within the texture atlas that this URL occupies,
    *                                  this is the rectangle in normalized coordinates.
    * @param[out] textureRectSize      The rectangle within the texture atlas that this URL occupies,
@@ -365,6 +368,7 @@ public: // Load Request API
     TextureManager::MultiplyOnLoad&     preMultiplyOnLoad,
     const bool&                         synchronousLoading = false);
 
+private: // Internal Load Request API
   /**
    * @brief Requests an image load of the given URL, when the texture has
    * have loaded, it will perform a blend with the image mask, and upload
@@ -378,6 +382,7 @@ public: // Load Request API
    * @param[in] url                   The URL of the image to load
    * @param[in] maskTextureId         The texture id of an image to mask this with
    *                                  (can be INVALID if no masking required)
+   * @param[in] previousTextureId     The texture id of an image which the requestor already has before
    * @param[in] contentScale          The scale factor to apply to the image before masking
    * @param[in] desiredSize           The size the image is likely to appear at. This can be set to 0,0 for automatic
    * @param[in] fittingMode           The FittingMode to use
@@ -402,6 +407,7 @@ public: // Load Request API
   TextureId RequestLoad(
     const VisualUrl&                    url,
     const TextureManager::TextureId&    maskTextureId,
+    const TextureManager::TextureId&    previousTextureId,
     const float&                        contentScale,
     const ImageDimensions&              desiredSize,
     const Dali::FittingMode::Type&      fittingMode,
@@ -428,7 +434,6 @@ public: // Load Request API
     StorageType      storageType,
     const bool&      synchronousLoading = false);
 
-private:
   /**
    * @brief Requests an image load of the given URL, when the texture has
    * have loaded, if there is a valid maskTextureId, it will perform a
@@ -442,6 +447,8 @@ private:
    * @param[in] url                   The URL of the image to load
    * @param[in] maskTextureId         The texture id of an image to use as a mask. If no mask is required, then set
    *                                  to INVALID_TEXTURE_ID
+   * @param[in] previousTextureId     The texture id of an image which the requestor already has before. It will be used
+   *                                  when reloadPolicy is FORCED.
    * @param[in] contentScale          The scaling factor to apply to the content when masking
    * @param[in] desiredSize           The size the image is likely to appear at. This can be set to 0,0 for automatic
    * @param[in] fittingMode           The FittingMode to use
@@ -468,6 +475,7 @@ private:
   TextureId RequestLoadInternal(
     const VisualUrl&                    url,
     const TextureManager::TextureId&    maskTextureId,
+    const TextureManager::TextureId&    previousTextureId,
     const float&                        contentScale,
     const Dali::ImageDimensions&        desiredSize,
     const Dali::FittingMode::Type&      fittingMode,
@@ -681,8 +689,8 @@ private:                                    // Member Variables:
 
   Dali::Vector<TextureManager::TextureId> mRemoveQueue; ///< Queue of textures to remove at PostProcess. It will be cleared after PostProcess.
 
-  bool mLoadYuvPlanes;             ///< A global flag to specify if the image should be loaded as yuv planes
-  bool mRemoveProcessorRegistered; ///< Flag if remove processor registered or not.
+  const bool mLoadYuvPlanes;             ///< A global flag to specify if the image should be loaded as yuv planes
+  bool       mRemoveProcessorRegistered; ///< Flag if remove processor registered or not.
 };
 
 } // namespace Internal