Revert "[Tizen] Updated ImageVisual::GetNaturalSize to work with loaded images" 61/143961/1
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 14 Aug 2017 06:16:33 +0000 (15:16 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 14 Aug 2017 06:16:38 +0000 (15:16 +0900)
This reverts commit 25ce0154a34a9b5d9a613485c186dbd3479de05b.

Change-Id: I95d614a34c37777a6b2ca4f74cb3252c731a2bbb

dali-toolkit/internal/visuals/image/image-visual.cpp

index dcb222d..b558cfd 100644 (file)
@@ -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;