Changed NPatchRenderer and ImageRenderer to use an "broken image" if they try to...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / renderers / image / image-renderer.h
index fd88df0..efcbf53 100644 (file)
@@ -24,6 +24,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/images/image.h>
 #include <dali/public-api/images/image-operations.h>
+#include <dali/public-api/images/resource-image.h>
 
 namespace Dali
 {
@@ -68,14 +69,16 @@ typedef IntrusivePtr< ImageRenderer > ImageRendererPtr;
  *   "default"
  *
  */
-class ImageRenderer: public ControlRenderer
+class ImageRenderer: public ControlRenderer, public ConnectionTracker
 {
 public:
 
   /**
    * @brief Constructor.
+   *
+   * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
    */
-  ImageRenderer();
+  ImageRenderer( RendererFactoryCache& factoryCache );
 
   /**
    * @brief A reference counted object may only be deleted by calling Unreference().
@@ -85,11 +88,6 @@ public:
 public:  // from ControlRenderer
 
   /**
-   * @copydoc ControlRenderer::Initialize
-   */
-  virtual void Initialize( RendererFactoryCache& factoryCache, const Property::Map& propertyMap );
-
-  /**
    * @copydoc ControlRenderer::SetSize
    */
   virtual void SetSize( const Vector2& size );
@@ -112,10 +110,15 @@ public:  // from ControlRenderer
   /**
    * @copydoc ControlRenderer::CreatePropertyMap
    */
-  virtual void CreatePropertyMap( Property::Map& map ) const;
+  virtual void DoCreatePropertyMap( Property::Map& map ) const;
 
 protected:
   /**
+   * @copydoc ControlRenderer::DoInitialize
+   */
+  virtual void DoInitialize( const Property::Map& propertyMap );
+
+  /**
    * @copydoc ControlRenderer::DoSetOnStage
    */
   virtual void DoSetOnStage( Actor& actor );
@@ -125,14 +128,12 @@ protected:
    */
   virtual void DoSetOffStage( Actor& actor );
 
-public:
-
   /**
-   * Request the geometry and shader from the cache, if not available, create and save to the cache for sharing.
-   *
-   * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
+   * @copydoc ControlRenderer::InitializeRenderer
    */
-  void Initialize( RendererFactoryCache& factoryCache );
+  virtual void InitializeRenderer( Renderer& renderer );
+
+public:
 
   /**
    * @brief Sets the image of this renderer to the resource at imageUrl
@@ -175,6 +176,12 @@ private:
    */
   void ApplyImageToSampler();
 
+  /**
+   * Callback function of image resource loading succeed
+   * @param[in] image The Image content that we attempted to load from mImageUrl
+   */
+  void OnImageLoaded( ResourceImage image );
+
 private:
   Image mImage;