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=2aba159e504bc111506f4dfdb80bb802ae6511c4;hb=25b212f44160ea19465962203f604cdbc6623871;hpb=533d8c2ec94a43bbe098b556bb905cbe10f427ab;ds=sidebyside diff --git a/dali-toolkit/internal/visuals/image/batch-image-visual.cpp b/dali-toolkit/internal/visuals/image/batch-image-visual.cpp index 2aba159..fe803b2 100644 --- a/dali-toolkit/internal/visuals/image/batch-image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/batch-image-visual.cpp @@ -88,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() { } @@ -105,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 )