[Tizen] Restore Uploaded signal for BufferImage and ResourceImage
[platform/core/uifw/dali-core.git] / dali / internal / event / images / resource-image-impl.cpp
index 6c9ad3d..ea72dcb 100644 (file)
@@ -29,7 +29,6 @@
 #include <dali/internal/event/common/thread-local-storage.h>
 #include <dali/internal/event/images/nine-patch-image-impl.h>
 #include <dali/internal/event/common/stage-impl.h>
-#include <dali/internal/event/resources/resource-client.h>
 
 using namespace Dali::Integration;
 
@@ -111,7 +110,7 @@ ResourceImage::~ResourceImage()
 bool ResourceImage::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
   bool connected( true );
-  DALI_ASSERT_DEBUG( dynamic_cast<ResourceImage*>( object ) && "Resource ticket not ImageTicket subclass for image resource.\n" );
+  DALI_ASSERT_DEBUG( dynamic_cast<ResourceImage*>( object ) && "Failed to downcast from BaseObject to ResourceImage.\n" );
   ResourceImage* image = static_cast<ResourceImage*>(object);
 
   if( 0 == strcmp( signalName.c_str(), SIGNAL_IMAGE_LOADING_FINISHED ) )
@@ -148,7 +147,7 @@ void ResourceImage::Reload()
                                                 mAttributes.GetOrientationCorrection() );
 
   // Note, bitmap is only destroyed when the image is destroyed.
-  Integration::ResourcePointer resource = platformAbstraction.LoadResourceSynchronously( resourceType, mUrl );
+  Integration::ResourcePointer resource = platformAbstraction.LoadImageSynchronously( resourceType, mUrl );
   if( resource )
   {
     Integration::Bitmap* bitmap = static_cast<Integration::Bitmap*>( resource.Get() );
@@ -157,7 +156,7 @@ void ResourceImage::Reload()
 
     //Create texture
     Pixel::Format format = bitmap->GetPixelFormat();
-    mTexture = NewTexture::New( Dali::TextureType::TEXTURE_2D, format, width, height );
+    mTexture = Texture::New( Dali::TextureType::TEXTURE_2D, format, width, height );
 
     //Upload data to the texture
     size_t bufferSize = bitmap->GetBufferSize();
@@ -182,11 +181,12 @@ void ResourceImage::Reload()
   }
   else
   {
-    mTexture = NewTexture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGBA8888, 0u, 0u );
+    mTexture = Texture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGBA8888, 0u, 0u );
     mWidth = mHeight = 0u;
     mLoadingState = Dali::ResourceLoadingFailed;
   }
 
+  UploadedSignal().Emit( Dali::Image( this ) );
   mLoadingFinished.Emit( Dali::ResourceImage( this ) );
 }