[Tizen] Fix webp issue 87/271487/6
authorsunghyun kim <scholb.kim@samsung.com>
Tue, 22 Feb 2022 05:13:01 +0000 (14:13 +0900)
committertscholb <scholb.kim@samsung.com>
Thu, 24 Feb 2022 06:07:32 +0000 (15:07 +0900)
1. Change Fitting mode
- animated image visual use FIT_KEEP_ASPECT_RATIO by default, but image visual use FILL.
  i think we need to use same fitting mode by default.

2. use npatch in webp
- if webp use npatch, it need to be chage regular type

Change-Id: Ib29234e86d5d2efaa38dce9ef391a79a1065dd5d

dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp
dali-toolkit/internal/visuals/visual-url.cpp

index bfa0118..542f2ce 100644 (file)
@@ -214,7 +214,7 @@ void AnimatedImageVisual::CreateImageCache()
 }
 
 AnimatedImageVisual::AnimatedImageVisual(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory)
-: Visual::Base(factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO, Toolkit::Visual::ANIMATED_IMAGE),
+: Visual::Base(factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::ANIMATED_IMAGE),
   mFrameDelayTimer(),
   mPlacementActor(),
   mImageVisualShaderFactory(shaderFactory),
index 0ad5778..b17de56 100644 (file)
@@ -105,6 +105,7 @@ VisualUrl::Type ResolveType(const std::string& url)
 {
   // if only one char in string, can only be regular image
   const std::size_t count = url.size();
+  VisualUrl::Type  returnType = VisualUrl::REGULAR_IMAGE;
   if(count > 0)
   {
     // parsing from the end for better chance of early outs
@@ -155,10 +156,10 @@ VisualUrl::Type ResolveType(const std::string& url)
       }
       if((offsetFromEnd < sizeof(WEBP)) && (currentChar == WEBP[offsetFromEnd]))
       {
-        // early out if WEBP as can't be used in N patch for now
         if(++webpScore == sizeof(WEBP))
         {
-          return VisualUrl::WEBP;
+          //find type, but need to be check used in N patch
+          returnType = VisualUrl::WEBP;
         }
       }
       if((offsetFromEnd < sizeof(JSON)) && (currentChar == JSON[offsetFromEnd]))
@@ -188,7 +189,7 @@ VisualUrl::Type ResolveType(const std::string& url)
           else
           {
             // early out, not a valid N/9-patch URL
-            return VisualUrl::REGULAR_IMAGE;
+            return returnType;
           }
           break;
         }
@@ -201,7 +202,7 @@ VisualUrl::Type ResolveType(const std::string& url)
           else
           {
             // early out, not a valid N/9-patch URL
-            return VisualUrl::REGULAR_IMAGE;
+            return returnType;
           }
           break;
         }
@@ -209,7 +210,7 @@ VisualUrl::Type ResolveType(const std::string& url)
     }
   }
   // if we got here it is a regular image
-  return VisualUrl::REGULAR_IMAGE;
+  return returnType;
 }
 
 } // namespace