+ case Toolkit::Visual::IMAGE:
+ {
+ Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
+ std::string imageUrl;
+ if( imageURLValue && imageURLValue->Get( imageUrl ) )
+ {
+ // first resolve url type to know which visual to create
+ UrlType::Type type = ResolveUrlType( imageUrl );
+ if( UrlType::N_PATCH == type )
+ {
+ visualPtr = NPatchVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
+ }
+ else if( UrlType::SVG == type )
+ {
+ visualPtr = SvgVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
+ }
+ else // Regular image
+ {
+ bool batchingEnabled( false );
+ Property::Value* batchingEnabledValue = propertyMap.Find( Toolkit::ImageVisual::Property::BATCHING_ENABLED, BATCHING_ENABLED );
+ if( batchingEnabledValue )
+ {
+ batchingEnabledValue->Get( batchingEnabled );
+ }
+
+ if( batchingEnabled )
+ {
+ visualPtr = BatchImageVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
+ }
+ else
+ {
+ visualPtr = ImageVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
+ }
+ }
+ }
+
+ break;
+ }