X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fvisual-factory-cache.h;h=cc68e0ff152ec50cabd14068968597fb58dd6373;hp=c674aacd577b79636472dc99efffc37660bc57e3;hb=964dd7f6a94f280063595dbb48fb8f1232836789;hpb=ceef53ad56a8e9004014dc1c320127e64f90acff diff --git a/dali-toolkit/internal/visuals/visual-factory-cache.h b/dali-toolkit/internal/visuals/visual-factory-cache.h index c674aac..cc68e0f 100644 --- a/dali-toolkit/internal/visuals/visual-factory-cache.h +++ b/dali-toolkit/internal/visuals/visual-factory-cache.h @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -29,6 +28,7 @@ // INTERNAL INCLUDES #include #include +#include namespace Dali { @@ -38,11 +38,12 @@ namespace Toolkit namespace Internal { - class ImageAtlasManager; +class NPatchLoader; +class TextureManager; + typedef IntrusivePtr ImageAtlasManagerPtr; -class NPatchLoader; /** * Caches shaders and geometries. Owned by VisualFactory. @@ -139,34 +140,6 @@ public: static Image GetBrokenVisualImage(); public: - - /** - * @brief Request renderer from the url - * - * @return The cached renderer if exist in the cache. Otherwise an empty handle is returned. - */ - Renderer GetRenderer( const std::string& key ) const; - - /** - * @brief Cache the renderer based on the given key. - * - * If the key already exists in the cache, then the cache will save an additional renderer to the cache. - * RemoveRenderer will then need to be called twice to remove both items from the cache. - * - * @param[in] key The key to use for caching - * @param[in] renderer The Renderer to be cached - */ - void SaveRenderer( const std::string& key, Renderer& renderer ); - - /** - * @brief Cleans the renderer cache by removing the renderer from the cache based on the given key if there are no longer any references to it - * - * @param[in] key The key used for caching - * - * @return True if the renderer is no longer used anywhere, false otherwise - */ - bool CleanRendererCache( const std::string& key ); - /** * Get the image atlas manager. * @return A pointer to the atlas manager @@ -174,6 +147,12 @@ public: ImageAtlasManagerPtr GetAtlasManager(); /** + * Get the texture manager + * @return A reference to the texture manager + */ + TextureManager& GetTextureManager(); + + /** * Get the N-Patch texture cache. * @return A reference to the N patch loader */ @@ -210,39 +189,12 @@ protected: VisualFactoryCache& operator=(const VisualFactoryCache& rhs); private: - struct CachedRenderer - { - std::string mKey; - WeakHandle< Renderer > mRenderer; - - CachedRenderer( const std::string& key, Renderer& renderer ) - : mKey( key ), - mRenderer( renderer) - {} - }; - - typedef Dali::Vector< std::size_t > HashVector; - typedef Dali::OwnerContainer< const CachedRenderer* > CachedRenderers; - - /** - * @brief Finds the first index into the cached visuals from the url - * - * @return Returns the first index into the cached renderer from the url if it exists in the cache, otherwise returns -1 - */ - int FindRenderer( const std::string& key ) const; - -private: Geometry mGeometry[GEOMETRY_TYPE_MAX+1]; Shader mShader[SHADER_TYPE_MAX+1]; - HashVector mRendererHashes; - CachedRenderers mRenderers; - - Renderer mWireframeRenderer; - ImageAtlasManagerPtr mAtlasManager; - NPatchLoader mNPatchLoader; - + TextureManager mTextureManager; + NPatchLoader mNPatchLoader; SvgRasterizeThread* mSvgRasterizeThread; };