Drawable::Create();
Drawable::SetObject(static_cast<void*>(mTvgShape));
+ Drawable::SetType(Drawable::Types::SHAPE);
#endif
}
bool ShapeUbuntu::AddRect(Rect<float> rect, Vector2 roundedCorner)
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null [%p]\n", this);
return false;
bool ShapeUbuntu::AddCircle(Vector2 center, Vector2 radius)
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null [%p]\n", this);
return false;
bool ShapeUbuntu::AddArc(Vector2 center, float radius, float startAngle, float sweep, bool pie)
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return false;
bool ShapeUbuntu::AddMoveTo(Vector2 point)
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return false;
bool ShapeUbuntu::AddLineTo(Vector2 line)
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return false;
bool ShapeUbuntu::AddCubicTo(Vector2 controlPoint1, Vector2 controlPoint2, Vector2 endPoint)
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return false;
bool ShapeUbuntu::Close()
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return false;
bool ShapeUbuntu::ResetPath()
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return false;
bool ShapeUbuntu::SetFillColor(Vector4 color)
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null [%p]\n", this);
return false;
Vector4 ShapeUbuntu::GetFillColor() const
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null [%p]\n", this);
return Vector4(0, 0, 0, 0);
bool ShapeUbuntu::SetFillRule(Dali::CanvasRenderer::Shape::FillRule rule)
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return false;
Dali::CanvasRenderer::Shape::FillRule ShapeUbuntu::GetFillRule() const
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return Dali::CanvasRenderer::Shape::FillRule::WINDING;
bool ShapeUbuntu::SetStrokeWidth(float width)
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return false;
float ShapeUbuntu::GetStrokeWidth() const
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return false;
bool ShapeUbuntu::SetStrokeColor(Vector4 color)
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return false;
Vector4 ShapeUbuntu::GetStrokeColor() const
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return Vector4(0, 0, 0, 0);
bool ShapeUbuntu::SetStrokeDash(const Dali::Vector<float> dashPattern)
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return false;
Dali::Vector<float> ShapeUbuntu::GetStrokeDash() const
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return Vector<float>();
bool ShapeUbuntu::SetStrokeCap(Dali::CanvasRenderer::Shape::StrokeCap cap)
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return false;
Dali::CanvasRenderer::Shape::StrokeCap ShapeUbuntu::GetStrokeCap() const
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return Dali::CanvasRenderer::Shape::StrokeCap::SQUARE;
bool ShapeUbuntu::SetStrokeJoin(Dali::CanvasRenderer::Shape::StrokeJoin join)
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return false;
Dali::CanvasRenderer::Shape::StrokeJoin ShapeUbuntu::GetStrokeJoin() const
{
#ifdef THORVG_SUPPORT
- if(!mTvgShape)
+ if(!Drawable::GetObject() || !mTvgShape)
{
DALI_LOG_ERROR("Shape is null\n");
return Dali::CanvasRenderer::Shape::StrokeJoin::BEVEL;