DrawableTizen::DrawableTizen()
: mAdded(false),
- mChanged(false)
+ mChanged(false),
+ mType(Drawable::Types::NONE),
+ mCompositionType(Drawable::CompositionType::NONE),
+ mCompositionDrawable()
#ifdef THORVG_SUPPORT
,
mTvgPaint(nullptr)
DrawableTizen::~DrawableTizen()
{
#ifdef THORVG_SUPPORT
- if(mTvgPaint && !mAdded)
+ if(mTvgPaint)
{
delete mTvgPaint;
}
#endif
}
+bool DrawableTizen::SetClipPath(Dali::CanvasRenderer::Drawable& clip)
+{
+#ifdef THORVG_SUPPORT
+ if(!mTvgPaint)
+ {
+ DALI_LOG_ERROR("Drawable is null\n");
+ return false;
+ }
+
+ Internal::Adaptor::Drawable& drawableImpl = Dali::GetImplementation(clip);
+ if(drawableImpl.IsAdded())
+ {
+ DALI_LOG_ERROR("Already used [%p][%p]\n", this, &clip);
+ return false;
+ }
+
+ drawableImpl.SetAdded(true);
+ mCompositionDrawable = clip;
+ mCompositionType = Drawable::CompositionType::CLIP_PATH;
+ Drawable::SetChanged(true);
+
+ return true;
+#else
+ return false;
+#endif
+}
+
+Dali::CanvasRenderer::Drawable DrawableTizen::GetCompositionDrawable() const
+{
+ return mCompositionDrawable;
+}
+
+Drawable::CompositionType DrawableTizen::GetCompositionType() const
+{
+ return mCompositionType;
+}
+
void DrawableTizen::SetAdded(bool added)
{
mAdded = !!added;
{
mTvgPaint = static_cast<tvg::Paint*>((void*)object);
}
- else
- {
- if(mAdded)
- {
- mTvgPaint = nullptr;
- }
- if(mTvgPaint)
- {
- delete mTvgPaint;
- }
- }
#endif
}
{
return mChanged;
}
+
+void DrawableTizen::SetType(Drawable::Types type)
+{
+ mType = type;
+}
+
+Drawable::Types DrawableTizen::GetType() const
+{
+ return mType;
+}
} // namespace Adaptor
} // namespace Internal