/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
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 );
}
}
}
{
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;
}
return Toolkit::Visual::Base( visualPtr.Get() );
}
+Internal::TextureManager& VisualFactory::GetTextureManager()
+{
+ if( !mFactoryCache )
+ {
+ mFactoryCache = new VisualFactoryCache();
+ }
+ return mFactoryCache->GetTextureManager();
+}
+
} // namespace Internal
} // namespace Toolkit