*
* The following properties are required for create a BorderRender
*
- * | %Property Name | Type |
- * |------------------|-------------|
- * | border-color | VECTOR4 |
- * | border-size | FLOAT |
+ * | %Property Name | Type |
+ * |-----------------|-------------|
+ * | borderColor | VECTOR4 |
+ * | borderSize | FLOAT |
+ * | antiAliasing | BOOLEAN |
*/
class BorderRenderer : public ControlRenderer
/**
* @brief Constructor.
+ *
+ * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
*/
- BorderRenderer();
+ BorderRenderer( RendererFactoryCache& factoryCache );
/**
* @brief A reference counted object may only be deleted by calling Unreference().
public: // from ControlRenderer
/**
- * @copydoc ControlRenderer::DoInitialize
- */
- virtual void DoInitialize( RendererFactoryCache& factoryCache, const Property::Map& propertyMap );
-
- /**
* @copydoc ControlRenderer::SetClipRect
*/
virtual void SetClipRect( const Rect<int>& clipRect );
protected:
+
+ /**
+ * @copydoc ControlRenderer::DoInitialize
+ */
+ virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
+
/**
* @copydoc ControlRenderer::DoSetOnStage
*/
public:
/**
- * Request the geometry and shader from the cache, if not available, create and save to the cache for sharing.
- *
- * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
- */
- void Initialize( RendererFactoryCache& factoryCache );
-
- /**
* Set the color of the border.
* @param[in] color The border color.
*/
*/
void SetBorderSize( float size );
+ /**
+ * Enable/Disable the anti-aliasing.
+ * @param[in] enable Whether the anti-aliasing be enabled or not.
+ */
+ void RequireAntiAliasing( bool antiAliasing );
+
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();
+
+ /**
+ * Request the border shader from the factory cache. If fail, create tha shader and add it to cache.
+ * @return The border shader.
+ */
+ Shader GetBorderShader();
+
+ /**
* Create the geometry which presents the border.
* @return The border geometry
*/
Property::Index mBorderColorIndex;
Property::Index mBorderSizeIndex;
+
+ bool mAntiAliasing;
};
} // namespace Internal