Modifed mesh-renderer to use new texture API
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / renderers / renderer-factory-cache.h
index 947fd47..8bffd15 100644 (file)
  * limitations under the License.
  */
 
-#include <map>
+// INTERNAL INCLUDES
+#include "svg/svg-rasterize-thread.h"
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/math/uint-16-pair.h>
 #include <dali/public-api/object/ref-object.h>
 #include <dali/devel-api/rendering/geometry.h>
 #include <dali/devel-api/rendering/shader.h>
@@ -51,6 +53,7 @@ public:
   {
     COLOR_SHADER,
     BORDER_SHADER,
+    BORDER_SHADER_ANTI_ALIASING,
     GRADIENT_SHADER_LINEAR_USER_SPACE,
     GRADIENT_SHADER_LINEAR_BOUNDING_BOX,
     GRADIENT_SHADER_RADIAL_USER_SPACE,
@@ -106,11 +109,12 @@ public:
    */
   void SaveShader( ShaderType type, Shader shader );
 
-  /*
-   * Greate the quad geometry.
-   * Quad geometry is shared by multiple kind of Renderer, so implement it in the factory-cache.
+  /**
+   * Create the grid geometry.
+   * @param[in] gridSize The size of the grid.
+   * @return The created grid geometry.
    */
-  static Geometry CreateQuadGeometry();
+  static Geometry CreateGridGeometry( Uint16Pair gridSize );
 
 public:
 
@@ -136,8 +140,33 @@ public:
    * @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 );
+
+  /**
+   * @brief Cache the debug renderer
+   */
+  void CacheDebugRenderer( Renderer& renderer );
+
+  /**
+   * @brief Request the debug renderer;
+   */
+  Renderer GetDebugRenderer();
+
+  /**
+   * Get the SVG rasterization thread.
+   * @return A pointer pointing to the SVG rasterization thread.
    */
-  void CleanRendererCache( const std::string& key );
+  SvgRasterizeThread* GetSVGRasterizationThread();
+
+private: // for svg rasterization thread
+
+  /**
+   * Applies the rasterized image to material
+   */
+  void ApplyRasterizedSVGToSampler();
 
 protected:
 
@@ -179,14 +208,15 @@ private:
   int FindRenderer( const std::string& key ) const;
 
 private:
-  // ToDo: test whether using the WeakHandle could improve the performance
-  //       With WeakHandle, the resource would be released automatically when no control is using it
-
   Geometry mGeometry[GEOMETRY_TYPE_MAX+1];
   Shader mShader[SHADER_TYPE_MAX+1];
 
   HashVector mRendererHashes;
   CachedRenderers mRenderers;
+
+  Renderer mDebugRenderer;
+
+  SvgRasterizeThread*  mSvgRasterizeThread;
 };
 
 } // namespace Internal