X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fimage%2Fbatch-image-visual.cpp;h=fe803b27ccaff16bdc2fcb03b500973e7a3cabb7;hp=eecef346bd07c9ddf17f7b769b782656bf66886b;hb=25b212f44160ea19465962203f604cdbc6623871;hpb=1ff26466c5458cda1de2997cd4e27b014ff0275a diff --git a/dali-toolkit/internal/visuals/image/batch-image-visual.cpp b/dali-toolkit/internal/visuals/image/batch-image-visual.cpp index eecef34..fe803b2 100644 --- a/dali-toolkit/internal/visuals/image/batch-image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/batch-image-visual.cpp @@ -31,6 +31,7 @@ // INTERNAL HEADER #include +#include #include #include #include @@ -87,13 +88,16 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER( } // unnamed namespace -BatchImageVisualPtr BatchImageVisual::New( VisualFactoryCache& factoryCache ) +BatchImageVisualPtr BatchImageVisual::New( VisualFactoryCache& factoryCache, const std::string& url ) { - return new BatchImageVisual( factoryCache ); + BatchImageVisualPtr visual = new BatchImageVisual( factoryCache ); + visual->mImageUrl = url; + return visual; } BatchImageVisual::BatchImageVisual( VisualFactoryCache& factoryCache ) : Visual::Base( factoryCache ), + mImageUrl(""), mDesiredSize() { } @@ -104,29 +108,23 @@ BatchImageVisual::~BatchImageVisual() void BatchImageVisual::DoSetProperties( const Property::Map& propertyMap ) { - std::string oldImageUrl = mImageUrl; - Property::Value* imageURLValue = propertyMap.Find( Dali::Toolkit::ImageVisual::Property::URL, Dali::Toolkit::Internal::IMAGE_URL_NAME ); + // url already passed in constructor - if( imageURLValue ) + int desiredWidth = 0; + Property::Value* desiredWidthValue = propertyMap.Find( Dali::Toolkit::ImageVisual::Property::DESIRED_WIDTH, DESIRED_WIDTH ); + if( desiredWidthValue ) { - imageURLValue->Get( mImageUrl ); - - int desiredWidth = 0; - Property::Value* desiredWidthValue = propertyMap.Find( Dali::Toolkit::ImageVisual::Property::DESIRED_WIDTH, DESIRED_WIDTH ); - if( desiredWidthValue ) - { - desiredWidthValue->Get( desiredWidth ); - } - - int desiredHeight = 0; - Property::Value* desiredHeightValue = propertyMap.Find( Dali::Toolkit::ImageVisual::Property::DESIRED_HEIGHT, DESIRED_HEIGHT ); - if( desiredHeightValue ) - { - desiredHeightValue->Get( desiredHeight ); - } + desiredWidthValue->Get( desiredWidth ); + } - mDesiredSize = ImageDimensions( desiredWidth, desiredHeight ); + int desiredHeight = 0; + Property::Value* desiredHeightValue = propertyMap.Find( Dali::Toolkit::ImageVisual::Property::DESIRED_HEIGHT, DESIRED_HEIGHT ); + if( desiredHeightValue ) + { + desiredHeightValue->Get( desiredHeight ); } + + mDesiredSize = ImageDimensions( desiredWidth, desiredHeight ); } void BatchImageVisual::SetSize( const Vector2& size ) @@ -234,7 +232,7 @@ void BatchImageVisual::DoSetOffStage( Actor& actor ) void BatchImageVisual::DoCreatePropertyMap( Property::Map& map ) const { map.Clear(); - map.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE ); + map.Insert( Toolkit::VisualProperty::TYPE, Toolkit::Visual::IMAGE ); if( !mImageUrl.empty() ) {