Commit graph

2459 commits

Author SHA1 Message Date
Hermet Park
c2fa4a728b renderer: revise the internal logic.
dispose of the resources at the end of the paint deletion.
This will help retain the resources of the retained paints
and reuse them after reconstructing the next scene.
2024-02-02 12:15:24 +09:00
Hermet Park
dd48a4155e renderer: code refactoring.
replaced references with pointers to ensure consistency.
no logical changes.
2024-02-02 11:56:58 +09:00
Hermet Park
d7003505f3 lottie: minor optimization.
remove an unnecessary scene in the lottie render tree.
2024-02-02 11:53:57 +09:00
Hermet Park
5eac5622c0 lottie: compatibility++
retry image loading with the given candidates,
even if the suggested format is mismatched.
2024-02-02 11:53:44 +09:00
Hermet Park
77669d6d0e lottie: corrected text height alignment issues.
enhanced support for a wider range of text use cases.
2024-02-02 11:51:34 +09:00
Hermet Park
6c7ca743be lottie: Fixed a font/glyph parsing error.
Previously, the Lottie parser expected a specific parsing order:
font followed by glyph, for optimal data processing.

However, since this order is not guaranteed,
we have revised the parsing logic to accommodate any order.
2024-02-02 11:51:27 +09:00
Hermet Park
a88f7094c4 sw_engine: Address a corner case in trim path handling
This update fixes an issue where duplicated overlapping curves/lines,
when introduced as a single line.
That case overlapping command operation is take account for
the trim path's path-building process.

We now skip such cases to ensure the trim path functions correctly.

issue: https://github.com/thorvg/thorvg/issues/1939
2024-02-02 11:51:22 +09:00
JunsuChoi
07b11e0528 loader/svg: Fix zero check of arc's rx and ry
Please refer to the specifications.
https://www.w3.org/TR/SVG/paths.html#ArcOutOfRangeParameters

If either rx or ry is 0, then this arc is treated as a straight line
segment(a "lineto") joining the endpoints.
2024-02-02 11:51:17 +09:00
JunsuChoi
fc5ca21dea loader/svg: Apply specification of out-of-range elliptical arc parameters
The three specifications below apply.

Specification: https://www.w3.org/TR/SVG/paths.html#ArcOutOfRangeParameters

-
If the endpoint (x, y) of the segment is identical to the current point
(e.g., the endpoint of the previous segment),
then this is equivalent to omitting the elliptical arc segment entirely.

-
If either rx or ry is 0, then this arc is treated
as a straight line segment(a "lineto") joining the endpoints.

-
If either rx or ry have negative signs, these are dropped;
the absolute value is used instead.
2024-02-02 11:51:08 +09:00
Hermet Park
9d79f0ccef bump up version 0.12.3 2024-01-26 11:56:45 +09:00
Hermet Park
ac08d83211 lottie: rectified scene building Logic
resolved a corner case where assets were being attached
multiple times during scene building. This issue was causing
a significant performence drop in image animation
in certain scenarios.
2024-01-26 11:51:52 +09:00
Hermet Park
68ecd61ef7 lottie: fixed an issue with missing stroke drawing
Resolved a problem where the context was missing in scenarios
involving an overlapped stroke drawing.

issue: https://github.com/thorvg/thorvg/issues/1933
2024-01-26 11:51:25 +09:00
Hermet Park
adf92beef5 renderer/shape: rectified the round rectangle start position.
adjusted the starting position of the rounded rectangle to 90 degrees
to ensure compatibility with the Lottie trim path effect.

This modification follows the earlier circle correction applied to the rectangle.

issue: https://github.com/thorvg/thorvg/issues/1933
2024-01-26 11:50:01 +09:00
Hermet Park
25b6811354 sw_engine: Rectified dash line drawing issue.
Omit the dash line when its length falls below a minimal threshold.
This threshold is set to less than 0.0001 times the pixel size.
2024-01-26 11:49:53 +09:00
Hermet Park
e353e588fa svg_loader: code refactoring
removed duplicate matrix multiply function.
2024-01-26 11:49:42 +09:00
Mew Pur Pur
bdb522d15f svg_loader: Add missing implementation of skewX and skewY in transform-list 2024-01-26 11:49:35 +09:00
Hermet Park
10ad8bad36 sw_engine: fix a regression bug
invalidate cached compositors when target size is changed.
compositors must be re-initialized with a new size.

regression bug by ca3c1fc1b9
2024-01-19 17:03:22 +09:00
Hermet Park
fcb8f813ff bump up version 0.12.2 2024-01-18 23:56:42 +09:00
Hermet Park
ca3c1fc1b9 sw_engine: retain the compositor cache memory
The compositor memory is likely to be reused in the next frame.
To enhance performance, it is advisable to retain this memory by default.

We may consider introducing a cache policy interface in the Initializer.
This would allow users to manage the Canvas memory more effectively.

Anyhow, this improves the Lottie example performance by 10%
2024-01-18 23:56:42 +09:00
Hermet Park
2a105de9e8 sw_engine: tweak the image down-scaler.
Adjust the sampling count according to the scale ratio.

This significantly improves performance
while making it hard to recognize any loss in image quality.

Lottie example performance has improved by 15%.
2024-01-18 23:56:42 +09:00
Hermet Park
9c725e64b2 sw_engine: removed redundant logic.
Basically, sw_engine uses a desinated memory pool,
this reservation is not so effective.
2024-01-18 23:56:42 +09:00
Hermet Park
4aa95e70b4 lottie: Improve feature coverage by correctly handling XOR shapes
XOR when the shape's direction property is set to a value of 2.
Currently, the direction property is expected to have
either 1 for clockwise or 3 for counterclockwise orientation.

Just found out the number 2 use-case...
2024-01-18 23:56:42 +09:00
Hermet Park
2eddfe2f15 examples: revise the usage.
Remove the canvas buffer clear call
when the solid bg is introduced.
2024-01-18 23:56:42 +09:00
Hermet Park
7caf59cba1 lottie: Fixed the issue with gradient filling.
Previously, multiple gradients within a single group
couldn't be accounted for during rendering.

This fix addresses the scenario by fragmenting the rendering context.
2024-01-18 23:56:42 +09:00
Hermet Park
375a343d2c lottie: properly capture the stroking context
Each group must determine the stroking rendering contexts
and assess whether context switching has occurred.

Migrate the sequence from the root layer to all groups.
2024-01-18 23:56:42 +09:00
Hermet Park
cfb6a7e913 common: STM32 portability enhancement
Some systems such as micro-processor might not support
the thread feature on the system.

Enhance the portability by compiling the thorvg with toggling the
threading depepdency through the build option.

For this, thorvg newly introduced the internal Key/ScopedLock abstraction
for transparent thread-locking dependnecy.

To turn off the thread feature, please use the next build option:

$meson setup build -Dthreads=false ...

Note that, the thread feature is enabled in default.
Turning off the thread feature could reduce the binary size by 7kb.

issue: https://github.com/thorvg/thorvg/issues/1900
2024-01-18 23:56:29 +09:00
Hermet Park
4675b25d9a renderer/shape: fixed a regression bug
the bug was introduced in 9bf8bb018d.

Migrated the circle commands to the rectangle, which is currently necessary.
Retained the previous circle commands for backward compatibility.
2024-01-18 23:47:00 +09:00
Hermet Park
5d9f8c36a2 lottie: Corrected the Time Remapping Range (#1907)
enable exceeding the range of normalized values in time remapping.

the issue came from a misunderstanding of the lottie spec.

issue: https://github.com/thorvg/thorvg/issues/1809
2024-01-18 23:46:47 +09:00
Hermet Park
d761e3c562 bump up version 0.12.1 2024-01-12 15:03:14 +09:00
Hermet Park
0497f24570 web: quick fix of mistake during the migration. 2024-01-12 15:03:14 +09:00
Hermet Park
1f530e07da lottie: Newly added support for the text feature.
This enhancement enables embedded glyphs rendering.
The 'fonts' and 'chars' properties are now supported.
2024-01-12 13:56:36 +09:00
Hermet Park
16b9b940c8 renderer/shape: refine the circle draw commands.
Adjusted the path's start point to 90 degrees
to align the origin consistently with other path commands.

No compatibility issue, this only could affect the trimpath effects.
2024-01-12 11:07:20 +09:00
Hermet Park
74c04bc747 loader: code refactoring
Ensure scene data is freed when it's dangled in the loader.
2024-01-12 11:06:54 +09:00
Gabor Kiss-Vamosi
c8cfe9238d fix another type mismatch 2024-01-12 11:06:44 +09:00
Gabor Kiss-Vamosi
1c22269037 fix the prototype of mpoolInit 2024-01-12 11:06:38 +09:00
Hermet Park
31abe47a75 ttf: Fixed an invalid unicode encoding.
Ensured the data count is correctly multiplied by the data size.
2024-01-12 11:06:31 +09:00
JunsuChoi
2726eb8baa loader/svg: Skip check for quotes inside quotes
Single or double quotation marks that occur before
closing the quotation mark are ignored.
2024-01-12 11:06:24 +09:00
Jinny You
80fa5fca22 web: Support save2png 2024-01-12 11:05:21 +09:00
Jinny You
8ad2bef538 web: Improve stop animation behavior
`stop` worked like `pause`, when stopping animation, frame should be at 0
2024-01-12 11:05:13 +09:00
Jinny You
54930af3a3 web: Fix animation loading bug
when `lottie-player` has no `src` at first rendering, programmatical load wasn't working
2024-01-12 11:05:06 +09:00
Jinny You
f89a40b9b9 web: Add extra feature & property
- Support `resize` method
- Add `resolution` prop
2024-01-12 11:04:50 +09:00
Hermet Park
25ea242d38 saver/tvg: removed an unstable condition.
this optimization breaks the scene composition, remove it.

Issue: https://github.com/thorvg/thorvg/issues/1750
2024-01-03 16:21:15 +09:00
Jinny You
f2b6b44bce web/examples: Add save2tvg 2024-01-03 14:15:47 +09:00
Jinny You
3e6edc3b70 web: Support file types
- added new exportable type `tvg`
- support jpg/png/svg/tvg load
2024-01-03 14:15:42 +09:00
Jinny You
959f45313e wasm: Revise saver methods 2024-01-03 14:15:23 +09:00
Hermet Park
cf76f2f604 ttf: removed the beta tag.
incorporate TTF support into the CI build tests.
2024-01-03 11:52:23 +09:00
Hermet Park
8c3c2ab652 ttf: fix the windows compilation errors. 2024-01-03 11:52:18 +09:00
Hermet Park
cfb9ea8a43 tvg picture: binary version up. 2024-01-02 20:34:12 +09:00
Hermet Park
09e6278aff docs: updated doxygen for 0.12 release 2024-01-02 20:34:12 +09:00
Sergii Liebodkin
4242485810 xides compilation issue with loaders (#1885) 2024-01-02 20:34:12 +09:00