Commit graph

16 commits

Author SHA1 Message Date
Hermet Park
ae67a126e1 lottie: fixed all memory access violations. 2023-10-27 13:51:13 +09:00
Hermet Park
fe259d0414 lottie: ++optimization with a caching effect.
reuse clippers if they are available.

Binary: +132
2023-10-27 12:27:47 +09:00
Hermet Park
f223f2f6ac lottie: introduced static layer cache.
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
2023-10-27 12:26:35 +09:00
Hermet Park
c71ae85953 lottie: clean up code
no logical changes, only code clean-up
2023-10-27 12:24:12 +09:00
Hermet Park
dc02e131e9 animation/lottie: updated the frame count unit.
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
2023-10-27 12:23:38 +09:00
Hermet Park
1819fed033 renderer/paint: fixed a mismatched reference count.
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.
2023-09-26 10:48:33 +09:00
Hermet Park
2cada9c446 loader/lottie: code refactoring.
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.
2023-09-19 14:03:13 +09:00
Hermet Park
42d7a5faed loader/lottie: correct the frame range.
Fixed some incorrect time-remapping logic,
Also, the last frame should not be taken into account for the drawing.
2023-09-18 10:41:00 +09:00
Hermet Park
b5fcc90e5d loader/lottie: fix a wrong precomp time remapping.
the remapped frame number should be applied to the only referenced
precomp layer.
2023-09-07 17:59:52 +09:00
Hermet Park
64a444aeb6 loader/lottie: support focal property in the radial gradient 2023-09-05 10:29:12 +09:00
Hermet Park
ad9d9d0ecd loader/lottie: support trimpath feature 2023-09-01 13:16:18 +09:00
Hermet Park
994c1b99a5 lottie/loader: support the masking features.
Enhancing the basic masking options by providing additional support.
2023-08-17 23:03:37 +09:00
Hermet Park
15c09f260f loader/lottie: Fix the incorrect precomp layer frame time
The frame number of the referenced layer should be
reduced by the precomp start frame.
2023-08-17 15:53:12 +09:00
Hermet Park
df43f91644 loader/lottie: optimize the header task.
To achieve full threading efficiency,
the header should return the necessary properties:
view size, framerate, and duration.

This commit adds duration parsing.

Also don't do the header task in case of single thread
because there wouldn't be parallel effects.
2023-08-15 15:48:53 +09:00
Hermet Park
8f4f3d6f1b loader/lottie: Add radial gradient support
This allows for the creation of basic radial gradients,
without support for focal points.
2023-08-09 21:30:25 +09:00
Hermet Park
d7c70c5371 loader/lottie: fix a missing layer timeremap.
The frame count should have been multiplied with the timeStretch property.
also newly implemented the TimeRemap(tm) property
2023-08-09 21:30:25 +09:00