X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=dali%2Finternal%2Fevent%2Factors%2Fimage-actor-impl.h;h=cd2ebe3d88896497c3a08870a91f55cfaf673d8f;hb=334442ab65c242cf6da1435749a5c5c5bb69f592;hp=49aac5acca4568be7b762863cad00a0ca3e6caa3;hpb=a86ae47738c5baf9707e366912e1f52dbba39129;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/actors/image-actor-impl.h b/dali/internal/event/actors/image-actor-impl.h index 49aac5a..cd2ebe3 100644 --- a/dali/internal/event/actors/image-actor-impl.h +++ b/dali/internal/event/actors/image-actor-impl.h @@ -21,11 +21,13 @@ // INTERNAL INCLUDES #include #include +#include #include -#include -#include +#include #include +#include #include +#include namespace Dali { @@ -36,23 +38,12 @@ 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 RenderableActor +class ImageActor : public Actor { public: - typedef Dali::ImageActor::Style Style; typedef Dali::ImageActor::PixelArea PixelArea; /** @@ -73,10 +64,10 @@ 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(); + ImagePtr GetImage() const; /** * @copydoc Dali::ImageActor::SetPixelArea() @@ -101,31 +92,24 @@ public: /** * @copydoc Dali::ImageActor::SetStyle() */ - void SetStyle( Style style ); + void SetStyle( Dali::ImageActor::Style style ); /** * @copydoc Dali::ImageActor::GetStyle() */ - Style GetStyle() const; + Dali::ImageActor::Style GetStyle() const; /** - * @copydoc Dali::ImageActor::SetNinePatchBorder + * @copydoc Dali::ImageActor::SetNinePatchBorder() */ - void SetNinePatchBorder( const Vector4& border, bool inPixels = false ); + void SetNinePatchBorder( const Vector4& border ); /** - * @copydoc Dali::ImageActor::GetNinePatchBorder + * @copydoc Dali::ImageActor::GetNinePatchBorder() */ Vector4 GetNinePatchBorder() const; /** - * Retrieve the attachment which renders the image. - * @return The attachment. - */ - ImageAttachment& GetImageAttachment(); - - - /** * @copydoc Dali::RenderableActor::SetSortModifier() */ void SetSortModifier(float modifier); @@ -136,16 +120,6 @@ public: float GetSortModifier() const; /** - * @copydoc Dali::RenderableActor::SetCullFace() - */ - void SetCullFace(CullFaceMode mode); - - /** - * @copydoc Dali::RenderableActor::GetCullFace() - */ - CullFaceMode GetCullFace() const; - - /** * @copydoc Dali::RenderableActor::SetBlendMode() */ void SetBlendMode( BlendingMode::Type mode ); @@ -207,6 +181,11 @@ public: */ void GetFilterMode( FilterMode::Type& minFilter, FilterMode::Type& magFilter ) const; + /** + * @brief Allows this ImageActor to respond to the eventa that the shader effect's effect texture has been changed + */ + void EffectImageUpdated(); + public: /** * @copydoc Actor::SetShaderEffect @@ -223,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,13 +273,6 @@ public: // From Actor */ virtual Vector3 GetNaturalSize() const; -private: // From RenderableActor - - /** - * @copydoc RenderableActor::GetRenderableAttachment - */ - virtual RenderableAttachment& GetRenderableAttachment() const; - protected: /** @@ -311,19 +295,29 @@ private: Vector2 CalculateNaturalSize() const; /** - * From Actor; used to trigger fade-in animations. + * Update the grid geometry. */ - virtual void OnStageConnectionInternal(); + void UpdateGeometry(); /** - * From Actor; used to notify Image. + * Update the texture rect uniform */ - virtual void OnStageDisconnectionInternal(); + void UpdateTexureRect(); private: - ImageAttachmentPtr mImageAttachment; ///< Used to display the image (holds a pointer to currently showed Image) - + 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