END_TEST;
}
+int UtcDaliImageViewTVGLoading(void)
+{
+ ToolkitTestApplication application;
+
+ tet_infoline("ImageView Testing TVG image loading");
+
+ {
+ ImageView imageView = ImageView::New( );
+
+ imageView.SetImage( TEST_RESOURCE_DIR "/test.tvg" );
+
+ application.GetScene().Add( imageView );
+ DALI_TEST_CHECK( imageView );
+ Vector3 naturalSize = imageView.GetNaturalSize();
+
+ DALI_TEST_EQUALS( naturalSize.width, 100.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( naturalSize.height, 100.0f, TEST_LOCATION );
+ }
+ END_TEST;
+}
+
namespace
{
visualPtr = NPatchVisual::New(GetFactoryCache(), GetImageVisualShaderFactory(), visualUrl, propertyMap);
break;
}
+ case VisualUrl::TVG:
case VisualUrl::SVG:
{
visualPtr = SvgVisual::New(GetFactoryCache(), GetImageVisualShaderFactory(), visualUrl, propertyMap);
visualPtr = NPatchVisual::New(GetFactoryCache(), GetImageVisualShaderFactory(), visualUrl);
break;
}
+ case VisualUrl::TVG:
case VisualUrl::SVG:
{
visualPtr = SvgVisual::New(GetFactoryCache(), GetImageVisualShaderFactory(), visualUrl);
char GIF[4] = {'f', 'i', 'g', '.'};
char WEBP[5] = {'p', 'b', 'e', 'w', '.'};
char JSON[5] = {'n', 'o', 's', 'j', '.'};
+ char TVG[4] = {'g', 'v', 't', '.'};
unsigned int svgScore = 0;
+ unsigned int tvgScore = 0;
unsigned int gifScore = 0;
unsigned int webpScore = 0;
unsigned int jsonScore = 0;
return VisualUrl::SVG;
}
}
+ if((offsetFromEnd < sizeof(TVG)) && (currentChar == TVG[offsetFromEnd]))
+ {
+ // early out if TVG as can't be used in N patch for now
+ if(++tvgScore == sizeof(TVG))
+ {
+ return VisualUrl::TVG;
+ }
+ }
if((offsetFromEnd < sizeof(GIF)) && (currentChar == GIF[offsetFromEnd]))
{
// early out if GIF as can't be used in N patch for now