From: Seoyeon Kim Date: Mon, 14 Aug 2017 06:16:33 +0000 (+0900) Subject: Revert "[Tizen] Updated ImageVisual::GetNaturalSize to work with loaded images" X-Git-Tag: submit/tizen/20170814.093340~11 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=297417b1f633d88a896184e1a50f23f4439b1155 Revert "[Tizen] Updated ImageVisual::GetNaturalSize to work with loaded images" This reverts commit 25ce0154a34a9b5d9a613485c186dbd3479de05b. Change-Id: I95d614a34c37777a6b2ca4f74cb3252c731a2bbb --- diff --git a/dali-toolkit/internal/visuals/image/image-visual.cpp b/dali-toolkit/internal/visuals/image/image-visual.cpp index dcb222d..b558cfd 100644 --- a/dali-toolkit/internal/visuals/image/image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/image-visual.cpp @@ -528,20 +528,8 @@ void ImageVisual::GetNaturalSize( Vector2& naturalSize ) naturalSize.y = mDesiredSize.GetHeight(); return; } - else if( mImpl->mRenderer ) // Check if we have a loaded image - { - auto textureSet = mImpl->mRenderer.GetTextures(); - - if( textureSet ) - { - auto texture = textureSet.GetTexture(0); - naturalSize.x = texture.GetWidth(); - naturalSize.y = texture.GetHeight(); - return; - } - } - if( mMaskingData != NULL && mMaskingData->mAlphaMaskUrl.IsValid() && + else if( mMaskingData != NULL && mMaskingData->mAlphaMaskUrl.IsValid() && mMaskingData->mCropToMask ) { ImageDimensions dimensions = Dali::GetClosestImageSize( mMaskingData->mAlphaMaskUrl.GetUrl() ); @@ -552,26 +540,23 @@ void ImageVisual::GetNaturalSize( Vector2& naturalSize ) } return; } - else if( mImageUrl.IsValid() ) + else if( mImageUrl.IsValid() && mImageUrl.GetLocation() == VisualUrl::LOCAL ) { - if( mImageUrl.GetLocation() == VisualUrl::LOCAL ) - { - ImageDimensions dimensions = Dali::GetClosestImageSize( mImageUrl.GetUrl() ); + ImageDimensions dimensions = Dali::GetClosestImageSize( mImageUrl.GetUrl() ); - if( dimensions != ImageDimensions( 0, 0 ) ) - { - naturalSize.x = dimensions.GetWidth(); - naturalSize.y = dimensions.GetHeight(); - } - else - { - Image brokenImage = VisualFactoryCache::GetBrokenVisualImage(); + if( dimensions != ImageDimensions( 0, 0 ) ) + { + naturalSize.x = dimensions.GetWidth(); + naturalSize.y = dimensions.GetHeight(); + } + else + { + Image brokenImage = VisualFactoryCache::GetBrokenVisualImage(); - naturalSize.x = brokenImage.GetWidth(); - naturalSize.y = brokenImage.GetWidth(); - } - return; + naturalSize.x = brokenImage.GetWidth(); + naturalSize.y = brokenImage.GetWidth(); } + return; } naturalSize = Vector2::ZERO;