Drawable::Create();
Drawable::SetObject(static_cast<void*>(mTvgScene));
+ Drawable::SetType(Drawable::Types::DRAWABLE_GROUP);
#endif
}
bool DrawableGroupTizen::AddDrawable(Dali::CanvasRenderer::Drawable& drawable)
{
#ifdef THORVG_SUPPORT
- Internal::Adaptor::Drawable& drawableImpl = Dali::GetImplementation(drawable);
- tvg::Paint* pDrawable = static_cast<tvg::Paint*>(drawableImpl.GetObject());
- if(!pDrawable)
+ if(!Drawable::GetObject() || !mTvgScene)
{
- DALI_LOG_ERROR("Invalid drawable object [%p]\n", this);
+ DALI_LOG_ERROR("DrawableGroup is null\n");
return false;
}
+ Internal::Adaptor::Drawable& drawableImpl = Dali::GetImplementation(drawable);
if(drawableImpl.IsAdded())
{
- DALI_LOG_ERROR("Already added somewhere [%p][%p]\n", this, &drawable);
- return false;
- }
-
- if(mTvgScene->push(std::unique_ptr<tvg::Paint>(pDrawable)) != tvg::Result::Success)
- {
- DALI_LOG_ERROR("Tvg push fail [%p]\n", this);
+ DALI_LOG_ERROR("Already added [%p][%p]\n", this, &drawable);
return false;
}
bool DrawableGroupTizen::Clear()
{
#ifdef THORVG_SUPPORT
- if(!mTvgScene)
+ if(!Drawable::GetObject() || !mTvgScene)
{
DALI_LOG_ERROR("DrawableGroup is null\n");
return false;
for(auto& it : mDrawables)
{
- Dali::CanvasRenderer::Drawable drawable = it.GetHandle();
- if(DALI_UNLIKELY(!drawable))
- {
- continue;
- }
- Internal::Adaptor::Drawable& drawableImpl = Dali::GetImplementation(drawable);
+ Internal::Adaptor::Drawable& drawableImpl = Dali::GetImplementation(it);
drawableImpl.SetAdded(false);
}
#endif
}
+DrawableGroup::DrawableVector DrawableGroupTizen::GetDrawables() const
+{
+ return mDrawables;
+}
+
} // namespace Adaptor
} // namespace Internal