[Tizen] Use original PixelBufferLoadedSignalType signal parameter.
authorSeungho, Baek <sbsh.baek@samsung.com>
Tue, 17 Sep 2019 04:31:31 +0000 (13:31 +0900)
committerSeungho, Baek <sbsh.baek@samsung.com>
Tue, 17 Sep 2019 04:31:35 +0000 (13:31 +0900)
This reverts commit a97632fe7f09b7e323191f1234f9c595e370ad42.

dali-toolkit/devel-api/image-loader/async-image-loader-devel.h
dali-toolkit/internal/image-loader/async-image-loader-impl.cpp
dali-toolkit/internal/visuals/texture-manager-impl.cpp
dali-toolkit/internal/visuals/texture-manager-impl.h

index fb2ade1..681c00b 100644 (file)
@@ -28,7 +28,7 @@ namespace Toolkit
 namespace DevelAsyncImageLoader
 {
 
-typedef Signal< void ( uint32_t, Devel::PixelBuffer, bool ) > PixelBufferLoadedSignalType;
+typedef Signal< void ( uint32_t, Devel::PixelBuffer ) > PixelBufferLoadedSignalType;
 
 /**
  * @brief Whether to multiply alpha into color channels on load
index dd98ae3..de0ee3f 100644 (file)
@@ -107,7 +107,7 @@ void AsyncImageLoader::ProcessLoadedImage()
   {
     if( mPixelBufferLoadedSignal.GetConnectionCount() > 0 )
     {
-      mPixelBufferLoadedSignal.Emit( next->id, next->pixelBuffer, next->isMaskTask );
+      mPixelBufferLoadedSignal.Emit( next->id, next->pixelBuffer );
     }
     else if( mLoadedSignal.GetConnectionCount() > 0 )
     {
index e55fd90..64a1977 100644 (file)
@@ -750,7 +750,7 @@ void TextureManager::ObserveTexture( TextureInfo& textureInfo,
 }
 
 void TextureManager::AsyncLoadComplete( AsyncLoadingInfoContainerType& loadingContainer, uint32_t id,
-                                        Devel::PixelBuffer pixelBuffer, bool isMaskTask )
+                                        Devel::PixelBuffer pixelBuffer )
 {
   DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::AsyncLoadComplete( id:%d )\n", id );
 
@@ -771,7 +771,7 @@ void TextureManager::AsyncLoadComplete( AsyncLoadingInfoContainerType& loadingCo
 
         if( textureInfo.loadState != CANCELLED )
         {
-          if( isMaskTask )
+          if( textureInfo.maskApplied )
           {
             textureInfo.loadState = MASK_APPLIED;
           }
@@ -890,6 +890,7 @@ void TextureManager::ApplyMask( TextureInfo& textureInfo, TextureId maskTextureI
                    textureInfo.url.GetUrl().c_str(), textureInfo.loadSynchronously?"T":"F" );
 
     textureInfo.loadState = MASK_APPLYING;
+    textureInfo.maskApplied = true;
     auto& loadersContainer = textureInfo.url.IsLocalResource() ? mAsyncLocalLoaders : mAsyncRemoteLoaders;
     auto loadingHelperIt = loadersContainer.GetNext();
     DALI_ASSERT_ALWAYS(loadingHelperIt != loadersContainer.End());
@@ -1182,10 +1183,9 @@ TextureManager::AsyncLoadingHelper::AsyncLoadingHelper(
 }
 
 void TextureManager::AsyncLoadingHelper::AsyncLoadComplete(uint32_t           id,
-                                                           Devel::PixelBuffer pixelBuffer,
-                                                           bool isMaskTask)
+                                                           Devel::PixelBuffer pixelBuffer )
 {
-  mTextureManager.AsyncLoadComplete(mLoadingInfoContainer, id, pixelBuffer, isMaskTask);
+  mTextureManager.AsyncLoadComplete( mLoadingInfoContainer, id, pixelBuffer );
 }
 
 void TextureManager::SetBrokenImageUrl(const std::string& brokenImageUrl)
index d2c55fd..4f35040 100755 (executable)
@@ -464,7 +464,8 @@ private:
       cropToMask( cropToMask ),
       orientationCorrection( true ),
       preMultiplyOnLoad( preMultiplyOnLoad ),
-      preMultiplied( false )
+      preMultiplied( false ),
+      maskApplied( false )
     {
     }
 
@@ -497,6 +498,7 @@ private:
     bool orientationCorrection:1;  ///< true if the image should be rotated to match exif orientation data
     bool preMultiplyOnLoad:1;      ///< true if the image's color should be multiplied by it's alpha
     bool preMultiplied:1;          ///< true if the image's color was multiplied by it's alpha
+    bool maskApplied:1;            ///< true if the image's mask is applied
   };
 
   /**
@@ -587,9 +589,8 @@ private:
    * @param[in] container The Async loading container
    * @param[in] id        This is the async image loaders Id
    * @param[in] pixelBuffer The loaded image data
-   * @param[in] isMaskTask whether this task is for mask or not
    */
-  void AsyncLoadComplete( AsyncLoadingInfoContainerType& container, uint32_t id, Devel::PixelBuffer pixelBuffer, bool isMaskTask );
+  void AsyncLoadComplete( AsyncLoadingInfoContainerType& container, uint32_t id, Devel::PixelBuffer pixelBuffer );
 
   /**
    * @brief Performs Post-Load steps including atlasing.
@@ -748,17 +749,16 @@ private:
     /**
      * @brief Main constructor that used by all other constructors
      */
-    AsyncLoadingHelper(Toolkit::AsyncImageLoader loader,
-                       TextureManager& textureManager,
-                       AsyncLoadingInfoContainerType&& loadingInfoContainer);
+    AsyncLoadingHelper( Toolkit::AsyncImageLoader loader,
+                        TextureManager& textureManager,
+                        AsyncLoadingInfoContainerType&& loadingInfoContainer );
 
     /**
      * @brief Callback to be called when texture loading is complete, it passes the pixel buffer on to texture manager.
      * @param[in] id          Loader id
      * @param[in] pixelBuffer Image data
-     * @param[in] isMaskTask whether this task is for mask or not
      */
-    void AsyncLoadComplete(uint32_t id, Devel::PixelBuffer pixelBuffer, bool isMaskTask);
+    void AsyncLoadComplete( uint32_t id, Devel::PixelBuffer pixelBuffer );
 
   private:
     Toolkit::AsyncImageLoader     mLoader;