+ Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
+ std::string imageUrl;
+ if( imageURLValue && imageURLValue->Get( imageUrl ) )
+ {
+ Property::Value* batchingEnabledValue = propertyMap.Find( Toolkit::ImageVisual::Property::BATCHING_ENABLED, BATCHING_ENABLED );
+ if( batchingEnabledValue )
+ {
+ bool batchingEnabled( false );
+ batchingEnabledValue->Get( batchingEnabled );
+ if( batchingEnabled )
+ {
+ CreateAtlasManager();
+ visualPtr = new BatchImageVisual( *( mFactoryCache.Get() ), *( mAtlasManager.Get() ) );
+ break;
+ }
+ }
+ else if( NinePatchImage::IsNinePatchUrl( imageUrl ) )
+ {
+ visualPtr = new NPatchVisual( *( mFactoryCache.Get() ) );
+ }
+ else
+ {
+ CreateAtlasManager();
+
+ if( SvgVisual::IsSvgUrl( imageUrl ) )
+ {
+ visualPtr = new SvgVisual( *( mFactoryCache.Get() ), *( mAtlasManager.Get() ) );
+ }
+ else
+ {
+ visualPtr = new ImageVisual( *( mFactoryCache.Get() ), *( mAtlasManager.Get() ) );
+ }
+ }
+ }
+ else if( propertyMap.Find( Toolkit::Visual::Property::SHADER, CUSTOM_SHADER ) )
+ {
+ // Create Image Visual if it has a shader
+ // TODO: This is required because of EffectsView which should be fixed
+ CreateAtlasManager();
+ visualPtr = new ImageVisual( *( mFactoryCache.Get() ), *( mAtlasManager.Get() ) );
+ }