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 and gif
- if webp and gif use npatch, it need to be change regular type
Change-Id: Ib29234e86d5d2efaa38dce9ef391a79a1065dd5d
DALI_TEST_EQUALS( VisualUrl::GIF, VisualUrl(".GiF").GetType(), TEST_LOCATION );
DALI_TEST_EQUALS( VisualUrl::GIF, VisualUrl(".GiF").GetType(), TEST_LOCATION );
- // GIFs aren't N-patch
- DALI_TEST_EQUALS( VisualUrl::GIF, VisualUrl("foobar.9.gif").GetType(), TEST_LOCATION );
+ DALI_TEST_EQUALS( VisualUrl::N_PATCH, VisualUrl("foobar.9.gif").GetType(), TEST_LOCATION );
DALI_TEST_EQUALS( VisualUrl::REGULAR_IMAGE, VisualUrl("gif.png").GetType(), TEST_LOCATION );
DALI_TEST_EQUALS( VisualUrl::REGULAR_IMAGE, VisualUrl("gif.gif1").GetType(), TEST_LOCATION );
DALI_TEST_EQUALS( VisualUrl::REGULAR_IMAGE, VisualUrl("gif.png").GetType(), TEST_LOCATION );
DALI_TEST_EQUALS( VisualUrl::REGULAR_IMAGE, VisualUrl("gif.gif1").GetType(), TEST_LOCATION );
}
AnimatedImageVisual::AnimatedImageVisual(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory)
}
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),
mFrameDelayTimer(),
mPlacementActor(),
mImageVisualShaderFactory(shaderFactory),
{
// if only one char in string, can only be regular image
const std::size_t count = url.size();
{
// 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
if(count > 0)
{
// parsing from the end for better chance of early outs
}
if((offsetFromEnd < sizeof(GIF)) && (currentChar == GIF[offsetFromEnd]))
{
}
if((offsetFromEnd < sizeof(GIF)) && (currentChar == GIF[offsetFromEnd]))
{
- // early out if GIF as can't be used in N patch for now
+ //find type, but need to be check used in N patch
if(++gifScore == sizeof(GIF))
{
if(++gifScore == sizeof(GIF))
{
+ returnType = VisualUrl::GIF;
}
}
if((offsetFromEnd < sizeof(WEBP)) && (currentChar == WEBP[offsetFromEnd]))
{
}
}
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))
{
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]))
}
}
if((offsetFromEnd < sizeof(JSON)) && (currentChar == JSON[offsetFromEnd]))
else
{
// early out, not a valid N/9-patch URL
else
{
// early out, not a valid N/9-patch URL
- return VisualUrl::REGULAR_IMAGE;
else
{
// early out, not a valid N/9-patch URL
else
{
// early out, not a valid N/9-patch URL
- return VisualUrl::REGULAR_IMAGE;
}
}
// if we got here it is a regular image
}
}
// if we got here it is a regular image
- return VisualUrl::REGULAR_IMAGE;