X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fvisual-factory-impl.cpp;h=469ead5a0ee6d107a52ac5ccd0fb6598ba725f13;hb=9d9d656c92bc768ef31c0bae604102071e6e3029;hp=8a5d24554913e9379874ebe1ee102918d7639cb8;hpb=ddef399f249128bef52cbb79eb321b0bfdaa0ced;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/visual-factory-impl.cpp b/dali-toolkit/internal/visuals/visual-factory-impl.cpp index 8a5d245..469ead5 100644 --- a/dali-toolkit/internal/visuals/visual-factory-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-factory-impl.cpp @@ -119,31 +119,42 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& property { Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME ); std::string imageUrl; - if( imageURLValue && imageURLValue->Get( imageUrl ) ) + if( imageURLValue ) { - VisualUrl visualUrl( imageUrl ); - - switch( visualUrl.GetType() ) + if( imageURLValue->Get( imageUrl ) ) { - case VisualUrl::N_PATCH: - { - visualPtr = NPatchVisual::New( *( mFactoryCache.Get() ), visualUrl, propertyMap ); - break; - } - case VisualUrl::SVG: - { - visualPtr = SvgVisual::New( *( mFactoryCache.Get() ), visualUrl, propertyMap ); - break; - } - case VisualUrl::GIF: + VisualUrl visualUrl( imageUrl ); + + switch( visualUrl.GetType() ) { - visualPtr = AnimatedImageVisual::New( *( mFactoryCache.Get() ), visualUrl, propertyMap ); - break; + case VisualUrl::N_PATCH: + { + visualPtr = NPatchVisual::New( *( mFactoryCache.Get() ), visualUrl, propertyMap ); + break; + } + case VisualUrl::SVG: + { + visualPtr = SvgVisual::New( *( mFactoryCache.Get() ), visualUrl, propertyMap ); + break; + } + case VisualUrl::GIF: + { + visualPtr = AnimatedImageVisual::New( *( mFactoryCache.Get() ), visualUrl, propertyMap ); + break; + } + case VisualUrl::REGULAR_IMAGE: + { + visualPtr = ImageVisual::New( *( mFactoryCache.Get() ), visualUrl, propertyMap ); + break; + } } - case VisualUrl::REGULAR_IMAGE: + } + else + { + Property::Array* array = imageURLValue->GetArray(); + if( array ) { - visualPtr = ImageVisual::New( *( mFactoryCache.Get() ), visualUrl, propertyMap ); - break; + visualPtr = AnimatedImageVisual::New( *( mFactoryCache.Get() ), *array, propertyMap ); } } } @@ -200,9 +211,20 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& property { Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME ); std::string imageUrl; - if( imageURLValue && imageURLValue->Get( imageUrl ) ) + if( imageURLValue ) { - visualPtr = AnimatedImageVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap ); + if( imageURLValue->Get( imageUrl ) ) + { + visualPtr = AnimatedImageVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap ); + } + else + { + Property::Array* array = imageURLValue->GetArray(); + if( array ) + { + visualPtr = AnimatedImageVisual::New( *( mFactoryCache.Get() ), *array, propertyMap ); + } + } } break; }