lottie builder doesn't need to rebuild the layer object
if it has no any animation frame data.
That case, we can cache the layer scene in order to reuse it.
Tested on local machine (single thread):
- Lottie: appx. 2ms enhanced.
- Binary: +204
replace the frame count unit from the int32_t to float
since animations could smoothly interpolate key-frames.
This notificably improve the animation smoothness in Lottie
Beta API changes:
Result Animation::frame(uint32_t no) -> Result Animation::frame(float no)
uint32_t Animation::curFrame() const -> float Animation::curFrame() const
uint32_t Animation::totalFrame() const -> float Animation::totalFrame() const
Previously, the builder accumulated the outlines and fills
in one paint to reduce the rendering context.
However, this approach won't work for Lottie
if the resource contains multiple strokes with branched groups.
We should apply the optimization
only when the specified condition is satisfied.
Revised the rendering logic of Lottie by creating a new rendering context
using a queue when multiple strokes are requested.
Issue: https://github.com/thorvg/thorvg/issues/1642
This correction ensures a consistent use of 'ref' and 'unref' for paints to release memory properly.
The memory leak occurred when a picture was not pushed to a valid canvas.
This issue was reported by the unit-test memory sanitizer.
Lottie ColorStop RGB / Alpha can be dealt with individually.
Since thorvg handles this one unified set,
lottie model need to merge the data into one structure.
Previously, it ignored the matte when it was out of frames for the sake of optimization.
However, this led to an incorrect matting result.
It should make the scene invisible when the matting is invisible.
migrate transform from the group to the layer.
transformation is not necessary in group but layer.
This helps to reduce the unnecessary assigning of the transformation
in group instances.
This fix introduces a workaround to enforce synchronous tasking on worker threads.
Sometimes, out of threads get stuck in a deadlock condition.
@Issue: https://github.com/thorvg/thorvg/issues/1636
Rounded corners should now be applied not only to rectangles
but also to path strokes. This enhancement changes the stroke join style
to round when a rounded corner is present.
Indeed, rounded corners ensure the accurate calculation of roundness based on the join style.
However, this patch has not yet been designed to handle it.