Fix an issue not to unload alpha mask texture 76/222776/1
authorHeeyong Song <heeyong.song@samsung.com>
Mon, 20 Jan 2020 04:09:49 +0000 (13:09 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 20 Jan 2020 04:11:33 +0000 (13:11 +0900)
ImageVisual needs the alpha mask texture id to unload the texture

Change-Id: I6fe7a1b362cfbba27cdc9eba7e9ec3b3bcee087d

dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/texture-manager-impl.cpp
dali-toolkit/internal/visuals/texture-manager-impl.h

index 7ecfb81..f656e2d 100644 (file)
@@ -425,7 +425,6 @@ void ImageVisual::DoSetProperty( Property::Index index, const Property::Value& v
       if( value.Get( alphaUrl ) )
       {
         AllocateMaskData();
       if( value.Get( alphaUrl ) )
       {
         AllocateMaskData();
-        // Immediately trigger the alpha mask loading (it may just get a cached value)
         mMaskingData->mAlphaMaskUrl = alphaUrl;
       }
       break;
         mMaskingData->mAlphaMaskUrl = alphaUrl;
       }
       break;
index fbb8114..a2381e8 100644 (file)
@@ -146,7 +146,7 @@ TextureManager::~TextureManager()
 
 TextureSet TextureManager::LoadTexture(
   const VisualUrl& url, Dali::ImageDimensions desiredSize, Dali::FittingMode::Type fittingMode,
 
 TextureSet TextureManager::LoadTexture(
   const VisualUrl& url, Dali::ImageDimensions desiredSize, Dali::FittingMode::Type fittingMode,
-  Dali::SamplingMode::Type samplingMode, const MaskingDataPointer& maskInfo,
+  Dali::SamplingMode::Type samplingMode, MaskingDataPointer& maskInfo,
   bool synchronousLoading, TextureManager::TextureId& textureId, Vector4& textureRect,
   Dali::ImageDimensions& textureRectSize, bool& atlasingStatus, bool& loadingStatus,
   Dali::WrapMode::Type wrapModeU, Dali::WrapMode::Type wrapModeV, TextureUploadObserver* textureObserver,
   bool synchronousLoading, TextureManager::TextureId& textureId, Vector4& textureRect,
   Dali::ImageDimensions& textureRectSize, bool& atlasingStatus, bool& loadingStatus,
   Dali::WrapMode::Type wrapModeU, Dali::WrapMode::Type wrapModeV, TextureUploadObserver* textureObserver,
@@ -252,9 +252,9 @@ TextureSet TextureManager::LoadTexture(
       }
       else
       {
       }
       else
       {
-        TextureId alphaMaskId = RequestMaskLoad( maskInfo->mAlphaMaskUrl );
+        maskInfo->mAlphaMaskId = RequestMaskLoad( maskInfo->mAlphaMaskUrl );
         textureId = RequestLoad( url,
         textureId = RequestLoad( url,
-                                 alphaMaskId,
+                                 maskInfo->mAlphaMaskId,
                                  maskInfo->mContentScaleFactor,
                                  desiredSize,
                                  fittingMode, samplingMode,
                                  maskInfo->mContentScaleFactor,
                                  desiredSize,
                                  fittingMode, samplingMode,
index b782517..651bc44 100755 (executable)
@@ -174,7 +174,7 @@ public:
    * @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
    * @param[in] samplingMode          The SamplingMode to use
    * @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
    * @param[in] samplingMode          The SamplingMode to use
-   * @param[in] maskInfo              Mask info structure
+   * @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[out] textureRect          The rectangle within the texture atlas that this URL occupies,
    * @param[in] synchronousLoading    true if the URL should be loaded synchronously
    * @param[out] textureId,           The textureId of the URL
    * @param[out] textureRect          The rectangle within the texture atlas that this URL occupies,
@@ -204,7 +204,7 @@ public:
                           Dali::ImageDimensions        desiredSize,
                           Dali::FittingMode::Type      fittingMode,
                           Dali::SamplingMode::Type     samplingMode,
                           Dali::ImageDimensions        desiredSize,
                           Dali::FittingMode::Type      fittingMode,
                           Dali::SamplingMode::Type     samplingMode,
-                          const MaskingDataPointer&    maskInfo,
+                          MaskingDataPointer&          maskInfo,
                           bool                         synchronousLoading,
                           TextureManager::TextureId&   textureId,
                           Vector4&                     textureRect,
                           bool                         synchronousLoading,
                           TextureManager::TextureId&   textureId,
                           Vector4&                     textureRect,