X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Ftexture-manager-impl.h;h=48eea782b24376aeec966ff784f1a71134e24d00;hb=refs%2Fchanges%2F46%2F265846%2F1;hp=c9618a95177ba1ebcaf7bb0328f131c318e1f728;hpb=c729115e0abda4fbf302eec33ccffa7aab1f0b29;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/texture-manager-impl.h b/dali-toolkit/internal/visuals/texture-manager-impl.h index c9618a9..48eea78 100644 --- a/dali-toolkit/internal/visuals/texture-manager-impl.h +++ b/dali-toolkit/internal/visuals/texture-manager-impl.h @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include #include +#include #include #include #include @@ -389,6 +390,20 @@ public: TextureSet GetTextureSet(TextureId textureId); /** + * @brief Get the encoded image buffer + * @param[in] textureId The textureId to look up + * @return the encoded image buffer, or an empty handle if textureId is not valid + */ + EncodedImageBuffer GetEncodedImageBuffer(TextureId textureId); + + /** + * @brief Get the encoded image buffer by VisualUrl + * @param[in] url The url to look up + * @return the encoded image buffer, or an empty handle if url is not buffer resource or buffer is not valid + */ + EncodedImageBuffer GetEncodedImageBuffer(const std::string& url); + + /** * Adds an external texture to the texture manager * @param[in] texture The texture to add * @return string containing the URL for the texture @@ -396,6 +411,13 @@ public: std::string AddExternalTexture(TextureSet& texture); /** + * Adds an external encoded image buffer to the texture manager + * @param[in] encodedImageBuffer The image buffer to add + * @return string containing the URL for the texture + */ + std::string AddExternalEncodedImageBuffer(const EncodedImageBuffer& encodedImageBuffer); + + /** * Removes an external texture from texture manager * @param[in] url The string containing the texture to remove * @return handle to the texture @@ -403,10 +425,17 @@ public: TextureSet RemoveExternalTexture(const std::string& url); /** - * @brief Notify that external textures are used. + * Removes an external encoded image buffer from texture manager + * @param[in] url The string containing the encoded image buffer to remove + * @return handle to the encoded image buffer + */ + EncodedImageBuffer RemoveExternalEncodedImageBuffer(const std::string& url); + + /** + * @brief Notify that external textures or external encoded image buffers are used. * @param[in] url The URL of the texture to use. */ - void UseExternalTexture(const VisualUrl& url); + void UseExternalResource(const VisualUrl& url); /** * Add an observer to the object. @@ -859,6 +888,20 @@ private: int16_t referenceCount{1}; }; + struct EncodedBufferTextureInfo + { + EncodedBufferTextureInfo(TextureId textureId, + const EncodedImageBuffer& encodedImageBuffer) + : textureId(textureId), + encodedImageBuffer(encodedImageBuffer), + referenceCount(1u) + { + } + TextureId textureId; + EncodedImageBuffer encodedImageBuffer; + int16_t referenceCount; + }; + private: /** * Deleted copy constructor. @@ -877,15 +920,16 @@ private: */ void ObserverDestroyed(TextureUploadObserver* observer); -private: // Member Variables: - TextureInfoContainerType mTextureInfoContainer; ///< Used to manage the life-cycle and caching of Textures - 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 - std::vector mExternalTextures; ///< Externally provided textures - Dali::Vector mLifecycleObservers; ///< Lifecycle observers of texture manager - Dali::Vector mLoadQueue; ///< Queue of textures to load after NotifyObservers - TextureId mCurrentTextureId; ///< The current value used for the unique Texture Id generation - bool mQueueLoadFlag; ///< Flag that causes Load Textures to be queued. +private: // Member Variables: + TextureInfoContainerType mTextureInfoContainer; ///< Used to manage the life-cycle and caching of Textures + 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 + std::vector mExternalTextures; ///< Externally provided textures + std::vector mEncodedBufferTextures; ///< Externally encoded buffer textures + Dali::Vector mLifecycleObservers; ///< Lifecycle observers of texture manager + Dali::Vector mLoadQueue; ///< Queue of textures to load after NotifyObservers + TextureId mCurrentTextureId; ///< The current value used for the unique Texture Id generation + bool mQueueLoadFlag; ///< Flag that causes Load Textures to be queued. }; } // namespace Internal