[3.0] Mark Clipping API as being part of the Tizen 3 version
[platform/core/uifw/dali-core.git] / dali / internal / event / actors / image-actor-impl.h
index 1fa96ea..cd2ebe3 100644 (file)
 // INTERNAL INCLUDES
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/actors/image-actor.h>
-#include <dali/devel-api/rendering/cull-face.h>
+#include <dali/public-api/math/uint-16-pair.h>
 #include <dali/internal/event/actors/actor-declarations.h>
 #include <dali/internal/event/actors/actor-impl.h>
 #include <dali/internal/event/animation/animation-impl.h>
 #include <dali/internal/event/effects/shader-effect-impl.h>
 #include <dali/internal/event/images/nine-patch-image-impl.h>
+#include <dali/internal/event/rendering/texture-set-impl.h>
 
 namespace Dali
 {
@@ -37,17 +38,7 @@ namespace Internal
 class Image;
 
 /**
- * An actor which displays an Image object.
- *
- * This handles image fade-in if required, waiting for the image to load.
- *
- * If a new image is set on the actor, then this ensures that the old image
- * is displayed until the new image is ready to render to prevent flashing
- * to the actor color. This will also happen if the image is reloaded.
- *
- * This is achieved by using two connector objects to Image: mImageNext and
- * mImageAttachment's member object. The first one points to the Image object that is going to
- * be displayed next, the second one to the Image that is currently being displayed.
+ * An actor which displays an Image.
  */
 class ImageActor : public Actor
 {
@@ -73,7 +64,7 @@ public:
   void SetImage( ImagePtr& image );
 
   /**
-   * Retrieve the image rendered by the actor's attachment.
+   * Retrieve the image rendered by the actor.
    * @return smart pointer to the image or an empty one if no image is assigned
    */
   ImagePtr GetImage() const;
@@ -99,24 +90,34 @@ public:
   void ClearPixelArea();
 
   /**
-   * @copydoc Dali::RenderableActor::SetSortModifier()
+   * @copydoc Dali::ImageActor::SetStyle()
    */
-  void SetSortModifier(float modifier);
+  void SetStyle( Dali::ImageActor::Style style );
 
   /**
-   * @copydoc Dali::RenderableActor::GetSortModifier()
+   * @copydoc Dali::ImageActor::GetStyle()
    */
-  float GetSortModifier() const;
+  Dali::ImageActor::Style GetStyle() const;
 
   /**
-   * @copydoc Dali::RenderableActor::SetCullFace()
+   * @copydoc Dali::ImageActor::SetNinePatchBorder()
    */
-  void SetCullFace(CullFaceMode mode);
+  void SetNinePatchBorder( const Vector4& border );
+
+  /**
+   * @copydoc Dali::ImageActor::GetNinePatchBorder()
+   */
+  Vector4 GetNinePatchBorder() const;
+
+  /**
+   * @copydoc Dali::RenderableActor::SetSortModifier()
+   */
+  void SetSortModifier(float modifier);
 
   /**
-   * @copydoc Dali::RenderableActor::GetCullFace()
+   * @copydoc Dali::RenderableActor::GetSortModifier()
    */
-  CullFaceMode GetCullFace() const;
+  float GetSortModifier() const;
 
   /**
    * @copydoc Dali::RenderableActor::SetBlendMode()
@@ -201,6 +202,18 @@ public:
    */
   virtual void RemoveShaderEffect();
 
+private:
+
+  /**
+   * @copydoc Actor::OnRelayout
+   */
+  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+
+  /**
+   * @copydoc Actor::OnSizeSet
+   */
+  virtual void OnSizeSet( const Vector3& targetSize );
+
 public: // Default property extensions from Object
 
   /**
@@ -282,22 +295,29 @@ private:
   Vector2 CalculateNaturalSize() const;
 
   /**
-   * @copydoc Dali::Actor::OnRelayout()
+   * Update the grid geometry.
    */
-  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+  void UpdateGeometry();
+
+  /**
+   * Update the texture rect uniform
+   */
+  void UpdateTexureRect();
 
 private:
 
-  ShaderEffectPtr    mShaderEffect;            ///< Optional referenced shader effect
-  RendererPtr        mRenderer;                ///< The renderer used to render the image
-  PixelArea          mPixelArea;               ///< The pixel area of the image to render
-  Vector4            mBlendColor;              ///< The blend color for this ImageActor
-  int                mRendererIndex;           ///< The index location of mRenderer
-  size_t             mTextureIndex;                       ///< The texture index for this ImageActor's texture
-  size_t             mEffectTextureIndex;      ///< The texture index for this ImageActor's effect texture
-  FilterMode::Type   mMinFilter;               ///< The minification filter currently set
-  FilterMode::Type   mMagFilter;               ///< The magnification filter currently set
-  bool               mIsPixelAreaSet;          ///< Flag indicating if the pixel area has been set
+  ShaderEffectPtr         mShaderEffect;            ///< Optional referenced shader effect
+  RendererPtr             mRenderer;                ///< The renderer used to render the image
+  PixelArea               mPixelArea;               ///< The pixel area of the image to render
+  Vector4                 mBlendColor;              ///< The blend color for this ImageActor
+  Vector4                 mNinePatchBorder;         ///< Nine-patch not supported, but this is used to store what is set so it can be returned for backwards compatibility.
+  Vector2                 mActorSize;               ///< The actor size
+  Uint16Pair              mGridSize;                ///< The geometry grid size
+  int                     mRendererIndex;           ///< The index location of mRenderer
+  FilterMode::Type        mMinFilter;               ///< The minification filter currently set
+  FilterMode::Type        mMagFilter;               ///< The magnification filter currently set
+  Dali::ImageActor::Style mStyle;                   ///< The style set by SetStyle. Not used internally, only used to store what is set so it can be returned for backwards compatibility.
+  bool                    mIsPixelAreaSet;          ///< Flag indicating if the pixel area has been set
 };
 
 } // namespace Internal