X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Frenderers%2Fgradient%2Fgradient-renderer.h;h=87cb854f0f97beea4df2289db946cadc4d5ce7b9;hp=e35b5db90c47004a7110a9318553fb4fc818ea17;hb=f3da11c2818c6d17706fbb2417f21b602b3190f5;hpb=669373aecf093fe345b679b0ebe1e8056b12af2c diff --git a/dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.h b/dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.h index e35b5db..87cb854 100644 --- a/dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.h +++ b/dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.h @@ -40,31 +40,31 @@ 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 | + * |-------------------------|------------------| + * | gradientStartPosition | VECTOR2 | + * | gradientEndPosition | VECTOR2 | + * | gradientStopOffset | ARRAY of FLOAT | + * | gradientStopColor | 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 | + * |-------------------------|------------------| + * | gradientCenter | VECTOR2 | + * | gradientRadius | FLOAT | + * | gradientStopOffset | ARRAY of FLOAT | + * | gradientStopColor | 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 | + * |-------------------------|------------------| + * | gradientUnits | STRING | + * | gradientSpreadMethod | 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 gradientUnits are 'userSpace' and 'objectBoundingBox'. + * Valid values for gradientSpreadMethod 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 @@ -72,9 +72,20 @@ class GradientRenderer: public ControlRenderer public: /** + * Types of the gradient + */ + enum Type + { + LINEAR, + RADIAL + }; + + /** * @brief Constructor. + * + * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object */ - GradientRenderer(); + GradientRenderer( RendererFactoryCache& factoryCache ); /** * @brief A reference counted object may only be deleted by calling Unreference(). @@ -84,11 +95,6 @@ public: public: // from ControlRenderer /** - * @copydoc ControlRenderer::Initialize - */ - virtual void Initialize( RendererFactoryCache& factoryCache, const Property::Map& propertyMap ); - - /** * @copydoc ControlRenderer::SetSize */ virtual void SetSize( const Vector2& size ); @@ -106,10 +112,15 @@ public: // from ControlRenderer /** * @copydoc ControlRenderer::CreatePropertyMap */ - virtual void CreatePropertyMap( Property::Map& map ) const; + virtual void DoCreatePropertyMap( Property::Map& map ) const; protected: /** + * @copydoc ControlRenderer::DoInitialize + */ + virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ); + + /** * @copydoc ControlRenderer::DoSetOnStage */ virtual void DoSetOnStage( Actor& actor ); @@ -117,13 +128,9 @@ protected: private: /** - * Types of the gradient + * @brief Initialize the renderer with the geometry and shader from the cache, if not available, create and save to the cache for sharing. */ - enum Type - { - LINEAR, - RADIAL - }; + void InitializeRenderer(); /** * New a gradient object with the given property map. @@ -150,8 +157,8 @@ private: private: Matrix3 mGradientTransform; - Property::Index mGradientTransformIndex; IntrusivePtr mGradient; + Type mGradientType; }; } // namespace Internal