X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fvisual-url.cpp;h=451ac06fdad8212328f03803588a4175added098;hp=731ed2024425e26ee54092baca18b6de59991a3a;hb=e0a22e262eed4f4ed32fa3f88783e99a3380eb42;hpb=667a103d2c6f9caba8c970bdafd26bdd10144715 diff --git a/dali-toolkit/internal/visuals/visual-url.cpp b/dali-toolkit/internal/visuals/visual-url.cpp index 731ed20..451ac06 100644 --- a/dali-toolkit/internal/visuals/visual-url.cpp +++ b/dali-toolkit/internal/visuals/visual-url.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -99,9 +99,11 @@ VisualUrl::Type ResolveType( const std::string& url ) enum { SUFFIX, HASH, HASH_DOT } state = SUFFIX; char SVG[ 4 ] = { 'g', 'v', 's', '.' }; char GIF[ 4 ] = { 'f', 'i', 'g', '.' }; + char WEBP[ 5 ] = { 'p', 'b', 'e', 'w', '.' }; char JSON[ 5 ] = { 'n', 'o', 's', 'j', '.' }; unsigned int svgScore = 0; unsigned int gifScore = 0; + unsigned int webpScore = 0; unsigned int jsonScore = 0; int index = count; while( --index >= 0 ) @@ -124,6 +126,14 @@ VisualUrl::Type ResolveType( const std::string& url ) return VisualUrl::GIF; } } + 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; + } + } if( ( offsetFromEnd < sizeof(JSON) )&&( currentChar == JSON[ offsetFromEnd ] ) ) { // early out if JSON as can't be used in N patch for now