Updated Gradient renderer to use SetTexture
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / renderers / gradient / gradient-renderer.h
index deed3aa..f0079f8 100644 (file)
@@ -40,31 +40,29 @@ class Gradient;
  *
  * The following properties are essential for create a LINEAR GradientRender
  *
- * | %Property Name            | Type             |
- * |---------------------------|------------------|
- * | gradient-start-position   | VECTOR2          |
- * | gradient-end-position     | VECTOR2          |
- * | gradient-stop-offset      | ARRAY of FLOAT   |
- * | gradient-stop-color       | ARRAY of VECTOR4 |
+ * | %Property Name          | Type             |
+ * |-------------------------|------------------|
+ * | startPosition           | VECTOR2          |
+ * | endPosition             | VECTOR2          |
+ * | stopColor               | ARRAY of VECTOR4 |
  *
  * The following properties are essential for create a RADIAL GradientRender
  *
- * | %Property Name            | Type             |
- * |---------------------------|------------------|
- * | gradient-center           | VECTOR2          |
- * | gradient-radius           | FLOAT            |
- * | gradient-stop-offset      | ARRAY of FLOAT   |
- * | gradient-stop-color       | ARRAY of VECTOR4 |
+ * | %Property Name          | Type             |
+ * |-------------------------|------------------|
+ * | center                  | VECTOR2          |
+ * | radius                  | FLOAT            |
+ * | stopColor               | ARRAY of VECTOR4 |
  *
  * The following properties are optional for both LINEAR and RADIAL GradientRender.
  *
- * | %Property Name            | Type             |
- * |---------------------------|------------------|
- * | gradient-units            | STRING           |
- * | gradient-spread-method    | STRING           |
+ * | %Property Name          | Type             |
+ * |-------------------------|------------------|
+ * | units                   | STRING           |
+ * | spreadMethod            | STRING           |
  *
- * Valid values for gradient-units are 'user-space' and 'object-bounding-box'.
- * Valid values for gradient-spread-method are 'pad', 'repeat' and 'reflect.'
+ * Valid values for units are 'userSpace' and 'objectBoundingBox'.
+ * Valid values for spreadMethod are 'pad', 'repeat' and 'reflect.'
  * If not provided, 'objectBoundingBox' is used as default gradient units, and 'pad' is used as default spread method.
  */
 class GradientRenderer: public ControlRenderer
@@ -118,16 +116,21 @@ protected:
   /**
    * @copydoc ControlRenderer::DoInitialize
    */
-  virtual void DoInitialize( const Property::Map& propertyMap );
+  virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
 
   /**
-   * @copydoc ControlRenderer::InitializeRenderer
+   * @copydoc ControlRenderer::DoSetOnStage
    */
-  virtual void InitializeRenderer( Renderer& renderer );
+  virtual void DoSetOnStage( Actor& actor );
 
 private:
 
   /**
+   * @brief Initialize the renderer with the geometry and shader from the cache, if not available, create and save to the cache for sharing.
+   */
+  void InitializeRenderer();
+
+  /**
    * New a gradient object with the given property map.
    *
    * @return True if the property map provides valid properties to create a gradient. Otherwise, returns false.
@@ -141,7 +144,7 @@ private:
    * @param[in] value The property value of stop-offsets
    * @param[out] stopOffsets The vector contains the stop offset values.
    */
-  static bool GetStopOffsets(const Property::Value* value, Vector<float>& stopOffsets);
+  static void GetStopOffsets(const Property::Value* value, Vector<float>& stopOffsets);
 
   // Undefined
   GradientRenderer( const GradientRenderer& gradientRenderer );