X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fimage-view%2Fimage-view-impl.cpp;h=69c126cc324f4296c054da67cceff74e79d14036;hp=28cbfff293eff3b39b370fae5db61a02f5a3c705;hb=16f3d4f2c1badd9be859725f6ea8154f58063c10;hpb=a79da7136f240f7dbaea136806571ff0e60f0cf9 diff --git a/dali-toolkit/internal/controls/image-view/image-view-impl.cpp b/dali-toolkit/internal/controls/image-view/image-view-impl.cpp index 28cbfff..69c126c 100755 --- a/dali-toolkit/internal/controls/image-view/image-view-impl.cpp +++ b/dali-toolkit/internal/controls/image-view/image-view-impl.cpp @@ -99,47 +99,11 @@ void ImageView::OnInitialize() handle.ResourceReadySignal().Connect( this, &ImageView::OnResourceReady ); } -void ImageView::SetImage( Image image ) -{ - // Don't bother comparing if we had a visual previously, just drop old visual and create new one - mImage = image; - mUrl.clear(); - mPropertyMap.Clear(); - - Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( image ); - if( visual ) - { - if( !mVisual ) - { - mVisual = visual; - } - - if( !mShaderMap.Empty() ) - { - Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual ); - visualImpl.SetCustomShader( mShaderMap ); - } - - DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, visual ); - } - else - { - // Unregister the existing visual - DevelControl::UnregisterVisual( *this, Toolkit::ImageView::Property::IMAGE ); - - // Trigger a size negotiation request that may be needed when unregistering a visual. - RelayoutRequest(); - } - - // Signal that a Relayout may be needed -} - void ImageView::SetImage( const Property::Map& map ) { // Comparing a property map is too expensive so just creating a new visual mPropertyMap = map; mUrl.clear(); - mImage.Reset(); Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( mPropertyMap ); if( visual ) @@ -175,7 +139,6 @@ void ImageView::SetImage( const std::string& url, ImageDimensions size ) // Don't bother comparing if we had a visual previously, just drop old visual and create new one mUrl = url; mImageSize = size; - mImage.Reset(); mPropertyMap.Clear(); // Don't set mVisual until it is ready and shown. Getters will still use current visual. @@ -207,11 +170,6 @@ void ImageView::SetImage( const std::string& url, ImageDimensions size ) // Signal that a Relayout may be needed } -Image ImageView::GetImage() const -{ - return mImage; -} - void ImageView::EnablePreMultipliedAlpha( bool preMultipled ) { if( mVisual ) @@ -316,11 +274,12 @@ void ImageView::OnRelayout( const Vector2& size, RelayoutContainer& container ) mVisual.SetTransformAndSize( transformMap, size ); // mVisual is not updated util the resource is ready in the case of visual replacement. - // So apply the transform and size to the new visual. + // in this case, the Property Map must be initialized so that the previous value is not reused. + // after mVisual is updated, the correct value will be reset. Toolkit::Visual::Base visual = DevelControl::GetVisual( *this, Toolkit::ImageView::Property::IMAGE ); if( visual && visual != mVisual ) { - visual.SetTransformAndSize( transformMap, size ); + visual.SetTransformAndSize( Property::Map(), size ); } } } @@ -504,10 +463,6 @@ void ImageView::SetProperty( BaseObject* object, Property::Index index, const Pr { impl.SetImage( impl.mUrl, impl.mImageSize ); } - else if( impl.mImage ) - { - impl.SetImage( impl.mImage ); - } else if( !impl.mPropertyMap.Empty() ) { impl.SetImage( impl.mPropertyMap ); @@ -549,12 +504,6 @@ Property::Value ImageView::GetProperty( BaseObject* object, Property::Index prop { value = impl.mUrl; } - else if( impl.mImage ) - { - Property::Map map; - Scripting::CreatePropertyMap( impl.mImage, map ); - value = map; - } else { Property::Map map;