DrawableUbuntu::DrawableUbuntu()
: mAdded(false),
mChanged(false),
- mType(Drawable::Types::NONE)
+ mType(Drawable::Types::NONE),
+ mCompositionType(Drawable::CompositionType::NONE),
+ mCompositionDrawable()
#ifdef THORVG_SUPPORT
,
mTvgPaint(nullptr)
#endif
}
+bool DrawableUbuntu::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 DrawableUbuntu::GetCompositionDrawable() const
+{
+ return mCompositionDrawable;
+}
+
+Drawable::CompositionType DrawableUbuntu::GetCompositionType() const
+{
+ return mCompositionType;
+}
+
void DrawableUbuntu::SetAdded(bool added)
{
mAdded = !!added;