These new apis would enable users to easily modify the motion scene,
The data structure of the paints has been changed from an array to a list.
@APIs:
std::list<Paint*>& Canvas::paints() noexcept;
std::list<Paint*>& Scene::paints() noexcept;
@Deprecated:
Result Canvas::reserve(uint32_t size) noexcept;
Result Scene::reserve(uint32_t size) noexcept;
@Issue: https://github.com/thorvg/thorvg/issues/1203
When shapes are poped from canvas while retaining shapes instances,
they have no chances to redraw after pushed again due to missing flag.
This patch fixes it by forcely updating flag on pushing time.
@Issues: 181
Canvas::clear() introduces a new argument "free" that deterimes freeing the retained paints.
If free is true, Canvas won't delete the retained paints so that user keep paints valid.
In this scenario, user must have paints pointers, free them manually or push them again to the canvas.
This scenario is useful if user wants to re-organize paints order in the list or reuse them.
we should avoid code insertion during file dependencies,
such as #include "xxx.h" which has implementations.
This could increase binary size, we can avoid it as possible.
Current patch improves binary size like this:
From: file(2059008) = text(120360) data(8096) bss(80) dec(128536)
To : file(1921832) = text(118429) data(7872) bss(56) dec(126357)
More additional patches will come in to optmize binary size.
remove unnecessary condition.
implementation won't be included multiple times not like headers.
Thus this condition is unnecessary.
Change-Id: Id37e675c40ce7213a06c950da8e5ca17ff7245c9
1. removed async option which doesn't work currently,
rather than it, we can add async option in initiailizer class.
2. removed update() method.
Instead, we can call update(paint = nullptr); which has exactly same behavior.
Change-Id: I7909a50d804b97baf413a2ff6365a3cf79a3689e
We prefer to build up a tiny compact engine at memory rather than compatibility,
this engine is not considerd for end-users but designed for middle-level framework
and some low-level users.
Thus, we won't consider 64bits data size,
use explicit 32 bits data until coming next upgrade...
Change-Id: I0704d5f1e0eb909cccc10922bc5972e115fbbcc0
Introduce Result type for notifying caller more detailed info.
We should implement the result values for each apis, with practical values.
Change-Id: Ia47abcb56a8efca7094ac3eed0178aeac8aa2910
hide engine() interface of shape that's not friendly one by users.
instead canvas would access shape internal data to update/draw it.
Now Paint cannot update itself but has to request to Canvas for it.
Change-Id: Ibafd0864a65c3c33238789d1a3e06c49c4378349
PaintNode -> Paint
ShapeNode -> Shape
SceneNode -> Scene
We can keep clean and neat shorter names.
Change-Id: Ic8521d456d947985e5fbe1ba2bde06faa1f52469
Obivously, we need to clear target before drawing.
Thus canvas request to renderers to clear buffer.
the implementation is upto backend engines.
Change-Id: Ib80da7f2260b021bcfed9fa13fb91c20218f9da0
This allocates nodes slots in advance to avoid memory grow & copy.
it will be benefit if you know how many shapes will be used in your canvas.
Change-Id: I7d93d166c9c054078bd86593d3471a2ade3671ee
introduce Canvas class to replace the CanvasBase.
now, SwCanvas, GlCanvas inherits this Canvas for polymorphism
and remove duplicated interfaces.
Change-Id: I65a87e3aa2289d04997930a54aeccd14f57dd73a