[Tizen] Fix Animated Image Visual issue of using same file in multiple visual accepted/tizen/unified/20201203.123834 submit/tizen/20201202.010141
authorJoogab Yun <joogab.yun@samsung.com>
Tue, 1 Dec 2020 04:56:10 +0000 (13:56 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Tue, 1 Dec 2020 04:56:13 +0000 (13:56 +0900)
This reverts commit 009570d3cfd51fcfd9f1a7786cc8a56378663588.

Change-Id: I42a0e36d57e0c32f0cced99243aa411c59aa1ddd

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

index 2d82b41..ea0abc1 100644 (file)
@@ -458,16 +458,15 @@ TextureManager::TextureId TextureManager::RequestLoadInternal(
 
   TextureHash textureHash = INITIAL_CACHE_NUMBER;
   int cacheIndex = INVALID_CACHE_INDEX;
-  if(storageType != StorageType::RETURN_PIXEL_BUFFER)
+  if(storageType != StorageType::RETURN_PIXEL_BUFFER && !isAnimatedImage)
   {
-    textureHash = GenerateHash(url.GetUrl(), desiredSize, fittingMode, samplingMode, useAtlas, maskTextureId, isAnimatedImage, frameIndex);
+    textureHash = GenerateHash(url.GetUrl(), desiredSize, fittingMode, samplingMode, useAtlas, maskTextureId);
 
     // Look up the texture by hash. Note: The extra parameters are used in case of a hash collision.
-    cacheIndex = FindCachedTexture(textureHash, url.GetUrl(), desiredSize, fittingMode, samplingMode, useAtlas, maskTextureId, preMultiplyOnLoad, isAnimatedImage, frameIndex);
+    cacheIndex = FindCachedTexture(textureHash, url.GetUrl(), desiredSize, fittingMode, samplingMode, useAtlas, maskTextureId, preMultiplyOnLoad);
   }
 
   TextureManager::TextureId textureId = INVALID_TEXTURE_ID;
-
   // Check if the requested Texture exists in the cache.
   if( cacheIndex != INVALID_CACHE_INDEX )
   {
@@ -1175,9 +1174,7 @@ TextureManager::TextureHash TextureManager::GenerateHash(
   const FittingMode::Type        fittingMode,
   const Dali::SamplingMode::Type samplingMode,
   const UseAtlas                 useAtlas,
-  TextureId                      maskTextureId,
-  bool                           isAnimationImage,
-  uint32_t                       frameIndex )
+  TextureId                      maskTextureId)
 {
   std::string hashTarget( url );
   const size_t urlLength = hashTarget.length();
@@ -1222,19 +1219,6 @@ TextureManager::TextureHash TextureManager::GenerateHash(
     }
   }
 
-  if( isAnimationImage )
-  {
-    auto textureIdIndex = hashTarget.length();
-    hashTarget.resize( hashTarget.length() + sizeof( uint32_t ) );
-    char* hashTargetPtr = &( hashTarget[ textureIdIndex ] );
-
-    for( size_t byteIter = 0; byteIter < sizeof( uint32_t ); ++byteIter )
-    {
-      *hashTargetPtr++ = frameIndex & 0xff;
-      frameIndex >>= 8u;
-    }
-  }
-
   if( maskTextureId != INVALID_TEXTURE_ID )
   {
     auto textureIdIndex = hashTarget.length();
@@ -1261,9 +1245,7 @@ int TextureManager::FindCachedTexture(
   const Dali::SamplingMode::Type    samplingMode,
   const bool                        useAtlas,
   TextureId                         maskTextureId,
-  TextureManager::MultiplyOnLoad    preMultiplyOnLoad,
-  bool                              isAnimatedImage,
-  uint32_t                          frameIndex )
+  TextureManager::MultiplyOnLoad    preMultiplyOnLoad)
 {
   // Default to an invalid ID, in case we do not find a match.
   int cacheIndex = INVALID_CACHE_INDEX;
@@ -1283,9 +1265,7 @@ int TextureManager::FindCachedTexture(
           ( size == textureInfo.desiredSize ) &&
           ( ( size.GetWidth() == 0 && size.GetHeight() == 0 ) ||
             ( fittingMode == textureInfo.fittingMode &&
-              samplingMode == textureInfo.samplingMode ) ) &&
-          ( isAnimatedImage == ( ( textureInfo.animatedImageLoading ) ? true : false ) ) &&
-          ( frameIndex == textureInfo.frameIndex ) )
+              samplingMode == textureInfo.samplingMode ) ) )
       {
         // 1. If preMultiplyOnLoad is MULTIPLY_ON_LOAD, then textureInfo.preMultiplyOnLoad should be true. The premultiplication result can be different.
         // 2. If preMultiplyOnLoad is LOAD_WITHOUT_MULTIPLY, then textureInfo.preMultiplied should be false.
index a3da3fc..28e0869 100644 (file)
@@ -752,14 +752,12 @@ private:
    * @param[in] samplingMode     The SamplingMode to use
    * @param[in] useAtlas         True if atlased
    * @param[in] maskTextureId    The masking texture id (or INVALID_TEXTURE_ID)
-   * @param[in] isAnimatedImage  The boolean value to know whether the request is for animated image or not
-   * @param[in] frameIndex       The frame index of a frame to be loaded frame
    * @return                     A hash of the provided data for caching.
    */
   TextureHash GenerateHash( const std::string& url, const ImageDimensions size,
                             const FittingMode::Type fittingMode,
                             const Dali::SamplingMode::Type samplingMode, const UseAtlas useAtlas,
-                            TextureId maskTextureId, bool isAnimatedImage, uint32_t frameIndex );
+                            TextureId maskTextureId );
 
   /**
    * @brief Looks up a cached texture by its hash.
@@ -772,8 +770,6 @@ private:
    * @param[in] useAtlas          True if atlased
    * @param[in] maskTextureId     Optional texture ID to use to mask this image
    * @param[in] preMultiplyOnLoad if the image's color should be multiplied by it's alpha. Set to OFF if there is no alpha.
-   * @param[in] isAnimatedImage   The boolean value to know whether the request is for animated image or not
-   * @param[in] frameIndex        The frame index of a frame to be loaded frame
    * @return                      A TextureId of a cached Texture if found. Or INVALID_TEXTURE_ID if not found.
    */
   TextureManager::TextureId FindCachedTexture(
@@ -784,9 +780,7 @@ private:
     const Dali::SamplingMode::Type samplingMode,
     const bool useAtlas,
     TextureId maskTextureId,
-    MultiplyOnLoad preMultiplyOnLoad,
-    bool isAnimatedImage,
-    uint32_t frameIndex );
+    MultiplyOnLoad preMultiplyOnLoad);
 
 private: