Commit graph

2764 commits

Author SHA1 Message Date
Hermet Park
30aa742b26 bump up version v0.13.8 2024-06-14 10:54:31 +09:00
Hermet Park
263ce25153 sw_engine: fix a crash issue.
set the anti-aliasing frame info properly, in an exceptional case.

issue: https://github.com/thorvg/thorvg/issues/2391
2024-06-14 10:53:57 +09:00
Hermet Park
63d6a2dadf sw_engine: fix a missing anti-aliasing
enable fill anti-aliasing when the stroke is trimming.
2024-06-14 10:53:12 +09:00
Hermet Park
111ffca53b common: fix a crash on CI windows test.
it's a vs2022 17.10 stl known issue.
https://github.com/microsoft/STL/wiki/Changelog
2024-06-14 10:52:38 +09:00
Mira Grudzinska
7e43cf402a svg_loader: handle text node
The text node is handled, but default values
of the font-family and font-size as used in
the user's system are not.
For now font has to be loaded by the user.

@Issue: https://github.com/thorvg/thorvg/issues/2350
2024-06-14 10:52:23 +09:00
Hermet Park
abb083eb02 renderer: optimize the ClipPath fast-track.
this optimization applies when the clipper is
not an axis-aligned rectangle under the following conditions:

a. Coverage where the clipper is a regional superset of the viewport.
b. Coverage where the clipper is completely outside of the viewport.

issue: https://github.com/thorvg/thorvg/issues/2332
2024-06-14 10:52:12 +09:00
Hermet Park
3b821c33cc renderer: code clean up 2024-06-14 10:52:04 +09:00
Mira Grudzinska
b5b6a5c527 sw_engine: fix fastTrack condition
When checking the fastTrack condition,
it's necessary to exclude the outlines
with a Bezier curve (Move-Cubic-Line,
Move-Cubic-Close, Move-Line-Cubic).

@Issue: https://github.com/thorvg/thorvg/issues/2379
2024-06-14 10:51:53 +09:00
Mira Grudzinska
a0490fd026 svg_loader: improved clarity, no logical changes
Unnecessary structure removed, typos corrected,
comment added, an unused function argument removed.
2024-06-14 10:50:48 +09:00
Hermet Park
d2c0428a99 bump up version v0.13.7 2024-06-07 12:25:25 +09:00
Hermet Park
9145638ec6 examples: fix memory leak 2024-06-07 12:25:25 +09:00
Hermet Park
f9b6617405 Revert "sw_engine: revert the threshold."
This reverts commit dad797445b.

Misidentified the key issue. It will be reviewed again.
2024-06-07 12:25:25 +09:00
Hermet Park
1e469c9f20 sw_engine: revert the threshold.
Somehow, it breaks the window unit-test, revert the value.

regression by: 51a2936b28
2024-06-07 12:09:48 +09:00
Hermet Park
46f4b8aeab sw_engine: fine-tuning RLE performance.
the arranged value is examined with the local test,
improved the speed twice for a corner-case that
extreamly huge size shape.
2024-06-07 10:52:20 +09:00
Hermet Park
bfb7d46297 api: corrected return type.
NonSupport indicates unsupported options due to disabled features
or lack of system support. InvalidArgument indicates the case
such as incorrect parameter values.
2024-06-07 10:52:13 +09:00
Jinny You
7a06e9bbf8 lottie: Add exception for lottie doesn't have exported glyph
Added handling logic for missing characters to prevent program hang.
2024-06-07 10:52:02 +09:00
Mira Grudzinska
6f652bb87a sw_engine: fix trimming
For the 'simultaneous' trimming option, the maximum
stroke length from all subpaths was determined and
used to scale the trim of each subpath. As a result,
if the subpaths had different lengths, this scaling
was incorrect.
Now, the length is determined separately for each
subpath and is used to scale the trimming of its stroke.

@Issue: https://github.com/thorvg/thorvg/issues/2335
2024-06-07 10:51:56 +09:00
Jinny You
1e4fc955b4 lottie: Fix invalid font match
When Lottie has similar font names, it incorrectly matches fonts due to a logic bug.

This error causes an infinite loop when searching for glyphs.
2024-06-07 10:51:48 +09:00
Mira Grudzinska
3a6fd4c0e4 common: clarification of returned types
The functions setting stroke's features always
returned a true. Returnig a boolen was a remnant
from a previous implementation. Since now they
never return false, they can be void functions.
The APIs description has been corrected.
2024-06-07 10:51:29 +09:00
Mira Grudzinska
c7822cca53 common: strokeTrim api introduced
New api sets/gets the trim of the stroke
along the defined path segment, allowing
control over which part of the stroke is
visible.

@issue: https://github.com/thorvg/thorvg/issues/2190
2024-06-07 10:44:34 +09:00
Mira Grudzinska
1ff583b03d lottie: fix matte layer finding
Layer identifiers do not have to be unique within
the entire file - they are unique within a given
group. Searching the entire composition to find
the referenced matte was an incorrect approach.

Error introduced by 1ee79a6c2a

@Issue: https://github.com/thorvg/thorvg/issues/2349
2024-06-07 10:43:52 +09:00
Martin Capitanio
eb6e635cd5 svg_loader: Add embedded webp mime type
Fixes loading _webp_ images embedded in SVG.
2024-06-07 10:43:41 +09:00
Mira Grudzinska
fb6b01a914 common: fix typos & remove unused var 2024-06-07 10:43:26 +09:00
Mira Grudzinska
ae90a9f18b lottie: parsing obj property inside this obj
Shape's property 'direction' should be parsed
together with other properties specific for
the shape. This solves the issue with direction-
it wasn't working.
2024-06-07 10:43:17 +09:00
Mira Grudzinska
0ea042e537 sw_engine: fix dashing
Fixing the problem with handling a specific
case where the length of the remaining line
to be drawn and the dash line length were
exactly the same
2024-06-07 10:42:59 +09:00
Hermet Park
20f82982b0 bump up version v0.13.6 2024-05-31 11:05:03 +09:00
Mira Grudzinska
75d17d8ad4 examples: fix heap-use-after-free in Capi.cpp 2024-05-31 11:04:38 +09:00
Hermet Park
9b427f426a lottie/builder: revise the layer build logic
Promote the text/image updates to the layer level.
2024-05-31 11:04:25 +09:00
Hermet Park
1823305ea3 lottie: try packing data compactly. 2024-05-31 11:01:29 +09:00
Hermet Park
71e3124469 lottie: optimize the internal data
encode the object name with the hash value
to save memory and enable fast data comparison.
2024-05-31 11:01:23 +09:00
Hermet Park
53818b41f2 lottie: code refactoring & size reduction
- introduced a pasing logic for duplicates.
- renamed internal varaible, no logical changes.
- removed null checks after memory alloc fails.
- reduced 1kb size.
2024-05-31 11:01:17 +09:00
Hermet Park
d319765bc7 common/compressor: added djb2 encoder
This is useful for encoding the string into one long type value.
2024-05-31 11:01:11 +09:00
Hermet Park
163b5ed16a lottie: hotfix memory leaks by a regression
A regression bug by a recent change:
1ee79a6c2a
2024-05-31 11:00:59 +09:00
Jinny You
0ffd75976c wasm: Support viewport API
wasm binding for viewport API in web.

see: #2276
2024-05-31 11:00:50 +09:00
Mira Grudzinska
bf29289b3c lottie: repeater transformation fix
In the case of a transformation (denoted as T1)
appearing after the repeater, but at the same
level of nesting, the objects to which the repeater
is applied should not consider T1. However,
the transformation of the repeater itself should
take T1 into account.
Also, it is possible to have several consecutive
repeaters, and all of them should be taken into
account. Until now, the last one was overwriting
the previous one.
2024-05-31 11:00:40 +09:00
Mira Grudzinska
e69cc2b936 lottie: add 'tp' tag support
So far it hasn't been possible to specify
a matte layer - by default, it was the layer
above the calling layer. The 'tp' tag support
has been introduced, enabling referencing any
layer by its index.
In cases where the layer referencing the matte
was the first one, a segmentation fault was
observed. This issue has now been resolved.

@Issue: https://github.com/thorvg/thorvg/issues/2325
2024-05-31 11:00:33 +09:00
Mira Grudzinska
a70802d85c lottie: fix interpolation issue
Handled the case of different numbers
of points in consecutive frames. This
case can occur due to erroneous data
or as a consequence of changing the path
from closed to open and vice versa.

@Issue: https://github.com/thorvg/thorvg/issues/2287
2024-05-31 11:00:26 +09:00
RuiwenTang
086c2ed9a7 Fix AnimateMasking with GL backend not triger redraw 2024-05-31 11:00:14 +09:00
Niklas Fiekas
758f17f3fc sw_engine: fix -Wcalloc-transposed-args 2024-05-31 11:00:04 +09:00
Xu Xingliang
946abbddf2 capi: fix compile warning
Fix warning during build with lvgl https://github.com/lvgl/lvgl/pull/6081/

error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-05-31 10:59:46 +09:00
Hermet Park
93a1d4a4af common: code refactoring
Replace the math functions with operator overloading.
This should potentially reduce the code size.
2024-05-31 10:57:59 +09:00
Abdelrahman Ashraf
5d3db6d7bb fix: 🐛 missing binding for tvg_canvas_set_viewport c api 2024-05-24 13:29:15 +02:00
Hermet Park
86afc0e8e5 bump up version v0.13.5 2024-05-24 11:18:09 +09:00
Hermet Park
dfe0e19a2f math: introduced a custom floating epsilon
Rather than aiming for extremely high accuracy,
a compromise can achieve with better performance.

This modification helps prevent unnecessary image rotation.

issue: https://github.com/thorvg/thorvg/issues/2265
2024-05-24 11:17:37 +09:00
Hermet Park
9b89178ae9 lottie: fixed a missing slot overriding update.
the Lottie scene should be updated when the slot overriding
is updated. Previously, it only depended on the frame update.

issue: https://github.com/thorvg/thorvg/issues/2303
2024-05-24 11:17:37 +09:00
Mira Grudzinska
1c66b5fa3d svg_loader: fix data parsing
Added an additional XML entity to be
omitted while parsing.

@Issue: https://github.com/thorvg/thorvg/issues/2273
2024-05-24 11:17:37 +09:00
Jinny You
9c5eafd74e web: Reduce initial playing resources
Previously, the Intersection Observer doesn't filter hidden animations when page just loaded.

Ensure that the only visible animations to be played. Hidden resources will be frozen in the initial load.
2024-05-24 11:17:37 +09:00
Hermet Park
7e721e8ba7 web: Improve the performance.
Compared the FPS with ThorVG viewer at 1664x1664 resolution.
This minor tweak improves the performance by 2 to 5 FPS.
2024-05-24 11:17:37 +09:00
Hermet Park
24cdbc7369 wasm: code clean up
binary reduction by -188
2024-05-24 11:17:37 +09:00
Mira Grudzinska
3994ff0b01 lottie: matrix multiplication fix
In case the shapes could be merged, matrix
multiplication was not stored in any variable,
resulting in one of the transformations not
being applied.
2024-05-24 11:17:37 +09:00