X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Ftexture-manager.h;h=090846e726eb2242f2f353033374b7bea82578cc;hp=5e0773564ea2eaa939903363e49f9878104f63e5;hb=421e8bf2b19f6e6e53866595d29db9cc6b8d210e;hpb=5280d715c0311735599fc9ef14bdd8b4efa293eb diff --git a/dali-toolkit/internal/visuals/texture-manager.h b/dali-toolkit/internal/visuals/texture-manager.h index 5e07735..090846e 100644 --- a/dali-toolkit/internal/visuals/texture-manager.h +++ b/dali-toolkit/internal/visuals/texture-manager.h @@ -18,19 +18,23 @@ */ // EXTERNAL INCLUDES +#include +#include #include #include #include #include #include #include -#include // INTERNAL INCLUDES +#include #include #include #include #include +#include +#include namespace Dali @@ -485,18 +489,75 @@ private: const bool useAtlas, TextureId maskTextureId ); +private: + + /** + * @brief Helper class to keep the relation between AsyncImageLoader and corresponding LoadingInfo container + */ + class AsyncLoadingHelper : public ConnectionTracker + { + public: + /** + * @brief Create an AsyncLoadingHelper. + * @param[in] textureManager Reference to the texture manager + */ + AsyncLoadingHelper(TextureManager& textureManager); + + /** + * @brief Load a new texture. + * @param[in] textureId TextureId to reference the texture that will be loaded + * @param[in] url The URL of the image to load + * @param[in] desiredSize The size the image is likely to appear at. This can be set to 0,0 for automatic + * @param[in] fittingMode The FittingMode to use + * @param[in] samplingMode The SamplingMode to use + * @param[in] orientationCorrection Whether to use image metadata to rotate or flip the image, e.g., from portrait to landscape + */ + void Load(TextureId textureId, + const VisualUrl& url, + ImageDimensions desiredSize, + FittingMode::Type fittingMode, + SamplingMode::Type samplingMode, + bool orientationCorrection); + + public: + AsyncLoadingHelper(const AsyncLoadingHelper&) = delete; + AsyncLoadingHelper& operator=(const AsyncLoadingHelper&) = delete; + + AsyncLoadingHelper(AsyncLoadingHelper&& rhs); + AsyncLoadingHelper& operator=(AsyncLoadingHelper&&rhs) = delete; + + private: + /** + * @brief Main constructor that used by all other constructors + */ + AsyncLoadingHelper(Toolkit::AsyncImageLoader loader, + TextureManager& textureManager, + AsyncLoadingInfoContainerType&& loadingInfoContainer); + + /** + * @brief Callback to be called when texture loading is complete, it passes the pixel buffer on to texture manager. + * @param[in] id Loader id + * @param[in] pixelBuffer Image data + */ + void AsyncLoadComplete(uint32_t id, Devel::PixelBuffer pixelBuffer); + + private: + Toolkit::AsyncImageLoader mLoader; + TextureManager& mTextureManager; + AsyncLoadingInfoContainerType mLoadingInfoContainer; + }; private: /** - * Undefined copy constructor. + * Deleted copy constructor. */ - TextureManager( const TextureManager& ); + TextureManager( const TextureManager& ) = delete; /** - * Undefined assignment operator. + * Deleted assignment operator. */ - TextureManager& operator=( const TextureManager& rhs ); + TextureManager& operator=( const TextureManager& rhs ) = delete; /** * This is called by the TextureManagerUploadObserver when an observer is destroyed. @@ -507,14 +568,12 @@ private: private: // Member Variables: - AsyncLoadingInfoContainerType mAsyncLocalLoadingInfoContainer; ///< Used to manage Asynchronous loads in progress - AsyncLoadingInfoContainerType mAsyncRemoteLoadingInfoContainer; ///< Used to manage Asynchronous loads in progress - AtlasInfoContainerType mAtlasContainer; ///< Used to manage Atlas creation and destruction - TextureInfoContainerType mTextureInfoContainer; ///< Used to manage the life-cycle and caching of Textures - Toolkit::AsyncImageLoader mAsyncLocalLoader; ///< The Asynchronous image loader used to provide all local async loads - Toolkit::AsyncImageLoader mAsyncRemoteLoader; ///< The Asynchronous image loader used to provide all remote async loads - TextureId mCurrentTextureId; ///< The current value used for the unique Texture Id generation + AtlasInfoContainerType mAtlasContainer; ///< Used to manage Atlas creation and destruction + TextureInfoContainerType mTextureInfoContainer; ///< Used to manage the life-cycle and caching of Textures + TextureId mCurrentTextureId; ///< The current value used for the unique Texture Id generation + RoundRobinContainerView mAsyncLocalLoaders; ///< The Asynchronous image loaders used to provide all local async loads + RoundRobinContainerView mAsyncRemoteLoaders; ///< The Asynchronous image loaders used to provide all remote async loads };