[Tizen] Revert "Remove TypeRegistration from deprecated Image classes"
[platform/core/uifw/dali-core.git] / dali / internal / event / images / image-impl.h
index 15eeff2..2a4f142 100644 (file)
@@ -24,8 +24,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/images/image.h>
 #include <dali/public-api/object/base-object.h>
-#include <dali/internal/event/resources/resource-client.h>
-#include <dali/internal/event/resources/resource-ticket-observer.h>
+#include <dali/internal/event/rendering/texture-impl.h>
 
 namespace Dali
 {
@@ -42,7 +41,7 @@ typedef IntrusivePtr<Image> ImagePtr;
  * When the Image object is created, resource loading will be attempted.
  * Provided this is successful, the resource will exist until the Image is destroyed.
  */
-class Image : public BaseObject, public ResourceTicketObserver
+class Image : public BaseObject
 {
 public:
 
@@ -63,13 +62,6 @@ public:
   static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
 
   /**
-   * returns the Id used for lookups
-   * @note if LoadPolicy::OnDemand is used and Image is off Stage, this will return 0.
-   * @return the unique ID of the image data resource. This is actually also the same as Dali Texture id.
-   */
-  ResourceId GetResourceId() const;
-
-  /**
    * Get the width of the image.
    * Only to be used after the image has finished loading.
    * (Ticket's LoadingSucceeded callback was called)
@@ -93,22 +85,13 @@ public:
    */
   virtual Vector2 GetNaturalSize() const;
 
-public: // From ResourceTicketObserver
-
-  /**
-   * @copydoc Dali::Internal::ResourceTicketObserver::ResourceLoadingFailed()
-   */
-  virtual void ResourceLoadingFailed(const ResourceTicket& ticket);
-
-  /**
-   * @copydoc Dali::Internal::ResourceTicketObserver::ResourceLoadingSucceeded()
-   */
-  virtual void ResourceLoadingSucceeded(const ResourceTicket& ticket);
-
   /**
-   * @copydoc Dali::Internal::ResourceTicketObserver::ResourceUploaded()
+   * Returns a pointer to the internal texture used by the image
    */
-  virtual void ResourceUploaded(const ResourceTicket& ticket);
+  Texture* GetTexture() const
+  {
+    return mTexture.Get();
+  }
 
 public:
 
@@ -141,10 +124,10 @@ protected:
 
 protected:
 
-  ResourceTicketPtr mTicket;              ///< smart pointer to the ticket object that gets completed when load finishes
+  TexturePtr mTexture;  ///< smart pointer to the texture used by the image
 
-  mutable unsigned int mWidth;     ///< natural width of the image, needs to be mutable for lazy resolving and as the API for GetWidth is const
-  mutable unsigned int mHeight;    ///< natural height of the image, needs to be mutable for lazy resolving and as the API for GetHeight is const
+  unsigned int mWidth;     ///< natural width of the image
+  unsigned int mHeight;    ///< natural height of the image
 
   unsigned int mConnectionCount; ///< number of on-stage objects using this image