X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fimages%2Fimage-impl.h;h=2a4f142d986e76e62183dab27443fcf6eb069b4c;hb=698c38bd1a76158dd449639aaf014d7046dd3ae4;hp=0d5a9dadc73c4314c1b671796a0f52acff7c335d;hpb=253a9b304346ea662033604f9db1542dd6cdbc66;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/images/image-impl.h b/dali/internal/event/images/image-impl.h index 0d5a9da..2a4f142 100644 --- a/dali/internal/event/images/image-impl.h +++ b/dali/internal/event/images/image-impl.h @@ -24,8 +24,7 @@ // INTERNAL INCLUDES #include #include -#include -#include +#include namespace Dali { @@ -33,29 +32,20 @@ namespace Dali namespace Internal { -typedef Dali::Image::ReleasePolicy ReleasePolicy; - class Image; class ImageFactory; typedef IntrusivePtr ImagePtr; -const ReleasePolicy IMAGE_RELEASE_POLICY_DEFAULT = Dali::Image::NEVER; - /** * Image represents an image resource that can be added to actors etc. * 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: /** - * @copydoc Dali::Image::GetReleasePolicy() - */ - ReleasePolicy GetReleasePolicy () const { return mReleasePolicy; } - - /** * @copydoc Dali::Image::UploadedSignal() */ Dali::Image::ImageSignalType& UploadedSignal() { return mUploaded; } @@ -72,18 +62,10 @@ 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) * The returned value will reflect the true image dimensions once the asynchronous loading has finished. - * Connect to SignalLoadingFinished or use GetLoadingState to make sure this value is actual. * @pre image should be loaded */ virtual unsigned int GetWidth() const; @@ -93,7 +75,6 @@ public: * Only to be used after the image has finished loading. * (Ticket's LoadingSucceeded callback was called) * The returned value will reflect the true image dimensions once the asynchronous loading has finished. - * Connect to SignalLoadingFinished or use GetLoadingState to make sure this value is actual. * @pre image should be loaded */ virtual unsigned int GetHeight() const; @@ -104,32 +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); - - /** - * @copydoc Dali::Internal::ResourceTicketObserver::ResourceSavingSucceeded() - */ - virtual void ResourceSavingSucceeded( const ResourceTicket& ticket ); - - /** - * @copydoc Dali::Internal::ResourceTicketObserver::ResourceSavingFailed() - */ - virtual void ResourceSavingFailed( const ResourceTicket& ticket ); + Texture* GetTexture() const + { + return mTexture.Get(); + } public: @@ -153,7 +115,7 @@ protected: /** * Constructor, with default parameters */ - Image( ReleasePolicy releasePol = IMAGE_RELEASE_POLICY_DEFAULT ); + Image(); /** * Second stage initialization @@ -162,15 +124,13 @@ 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 - ReleasePolicy mReleasePolicy : 2; ///< 2 bits is enough space - private: Dali::Image::ImageSignalType mUploaded;