Add an API that removes the all drawables registered with AddDrawable().
Change-Id: I6483f99a7acc106022fbd4eec3fbf2cab100f1e0
return GetImplementation(*this).RemoveDrawable(drawable);
}
+bool CanvasRenderer::RemoveAllDrawables()
+{
+ return GetImplementation(*this).RemoveAllDrawables();
+}
+
bool CanvasRenderer::SetSize(const Vector2& size)
{
return GetImplementation(*this).SetSize(size);
bool RemoveDrawable(Drawable& drawable);
/**
+ * @brief Remove all drawable objects added to the CanvasRenderer.
+ * @return Returns True when it's successful. False otherwise.
+ */
+ bool RemoveAllDrawables();
+
+ /**
* @brief Returns the PixelBuffer, which is the Render buffer of Canvas.
*
* @return Returns the pixel buffer.
return false;
}
+bool CanvasRenderer::RemoveAllDrawables()
+{
+ return false;
+}
+
bool CanvasRenderer::SetSize(const Vector2& size)
{
return false;
virtual bool RemoveDrawable(Dali::CanvasRenderer::Drawable& drawable);
/**
+ * @copydoc Dali::CanvasRenderer::RemoveAllDrawables()
+ */
+ virtual bool RemoveAllDrawables();
+
+ /**
* @copydoc Dali::CanvasRenderer::SetSize()
*/
virtual bool SetSize(const Vector2& size);
return false;
}
+bool CanvasRendererGeneric::RemoveAllDrawables()
+{
+ return false;
+}
+
bool CanvasRendererGeneric::SetSize(const Vector2& size)
{
return false;
bool RemoveDrawable(Dali::CanvasRenderer::Drawable& drawable) override;
/**
+ * @copydoc Dali::CanvasRenderer::RemoveAllDrawables()
+ */
+ bool RemoveAllDrawables() override;
+
+ /**
* @copydoc Dali::CanvasRenderer::SetSize()
*/
bool SetSize(const Vector2& size) override;
return false;
}
+bool CanvasRendererTizen::RemoveAllDrawables()
+{
+#ifdef THORVG_SUPPORT
+ for(auto& it : mDrawables)
+ {
+ Internal::Adaptor::Drawable& drawableImpl = GetImplementation(it);
+ drawableImpl.SetAdded(false);
+ }
+
+ mDrawables.clear();
+ mChanged = true;
+
+ return true;
+#else
+ return false;
+#endif
+}
+
bool CanvasRendererTizen::SetSize(const Vector2& size)
{
if(size.width < 1.0f || size.height < 1.0f)
bool RemoveDrawable(Dali::CanvasRenderer::Drawable& drawable) override;
/**
+ * @copydoc Dali::CanvasRenderer::RemoveAllDrawables()
+ */
+ bool RemoveAllDrawables() override;
+
+ /**
* @copydoc Dali::CanvasRenderer::SetSize()
*/
bool SetSize(const Vector2& size) override;
return false;
}
+bool CanvasRendererUbuntu::RemoveAllDrawables()
+{
+#ifdef THORVG_SUPPORT
+ for(auto& it : mDrawables)
+ {
+ Internal::Adaptor::Drawable& drawableImpl = GetImplementation(it);
+ drawableImpl.SetAdded(false);
+ }
+
+ mDrawables.clear();
+ mChanged = true;
+
+ return true;
+#else
+ return false;
+#endif
+}
+
bool CanvasRendererUbuntu::SetSize(const Vector2& size)
{
if(size.width < 1.0f || size.height < 1.0f)
bool RemoveDrawable(Dali::CanvasRenderer::Drawable& drawable) override;
/**
+ * @copydoc Dali::CanvasRenderer::RemoveAllDrawables()
+ */
+ bool RemoveAllDrawables() override;
+
+ /**
* @copydoc Dali::CanvasRenderer::SetSize()
*/
bool SetSize(const Vector2& size) override;