Updated visuals to separate alpha channel from mixColor
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / visual-factory-resolve-url.h
index 1d3ffe3..2c1c45b 100644 (file)
@@ -37,7 +37,8 @@ namespace UrlType
   {
     REGULAR_IMAGE,
     N_PATCH,
-    SVG
+    SVG,
+    GIF
   };
 }
 
@@ -55,7 +56,9 @@ inline UrlType::Type ResolveUrlType( const std::string& url )
     // parsing from the end for better chance of early outs
     enum { SUFFIX, HASH, HASH_DOT } state = SUFFIX;
     char SVG[ 4 ] = { 'g', 'v', 's', '.' };
+    char GIF[ 4 ] = { 'f', 'i', 'g', '.' };
     unsigned int svgScore = 0;
+    unsigned int gifScore = 0;
     int index = count;
     while( --index >= 0 )
     {
@@ -69,6 +72,14 @@ inline UrlType::Type ResolveUrlType( const std::string& url )
           return UrlType::SVG;
         }
       }
+      if( ( offsetFromEnd < sizeof(GIF) )&&( tolower( currentChar ) == GIF[ offsetFromEnd ] ) )
+      {
+        // early out if GIF
+        if( ++gifScore == sizeof(GIF) )
+        {
+          return UrlType::GIF;
+        }
+      }
       switch( state )
       {
         case SUFFIX: