Commit graph

2826 commits

Author SHA1 Message Date
Mira Grudzinska
45f73fd627 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-10 10:55:00 +09:00
Mira Grudzinska
10cdfff20d docs: resolve doxygen warnings 2024-06-09 12:01:54 +09:00
Hermet Park
0cd256f99c test: resolve compiler warnings on msvc.
warning C4305: 'argument': truncation from 'double' to 'float'
2024-06-07 23:56:30 +09:00
Hermet Park
2abfa98bae examples: fix memory leak 2024-06-07 23:56:12 +09:00
Hermet Park
c4d09160e4 Revert "sw_engine: revert the threshold."
This reverts commit dad797445b.

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

regression by: 51a2936b28
2024-06-07 12:08:28 +09:00
Hermet Park
51a2936b28 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:38:08 +09:00
Hermet Park
ade5eb2e8d 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-05 23:03:05 +09:00
Jinny You
e346cbb5ca lottie: Add exception for lottie doesn't have exported glyph
Added handling logic for missing characters to prevent program hang.
2024-06-05 14:43:28 +02:00
Mira Grudzinska
07e386007c 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-05 20:16:44 +09:00
Jinny You
97a1aa136a 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-05 12:38:20 +09:00
Mira Grudzinska
91187cd963
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-05 12:36:37 +09:00
Mira Grudzinska
669b5badf4 test: add strokeTrim tests 2024-06-05 11:55:36 +09:00
Mira Grudzinska
566b327f09 capi: bindings for strokeTrim
Example Capi.cpp modyfied.
2024-06-05 11:55:36 +09:00
Mira Grudzinska
e868e6e343 examples: add StrokeTrim example 2024-06-05 11:55:36 +09:00
Mira Grudzinska
33f5ea34c0 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-05 11:55:36 +09:00
Mira Grudzinska
ca92d4a53b 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-04 15:27:44 +03:00
RuiwenTang
7c687816c2 gl_engine: fix gradient color interpretation error
Fix when gradient position is same as some starting or ending point
of a gradient stop, the output color is blank
2024-06-04 19:37:39 +09:00
Sergii Liebodkin
a2ea964be1 wg_engine: fix color buffer corruption with wgpu-opengl wrapper (linux)
In a case of usage stencil buffer only we need to turn off an color target writes. In other case color buffer fill be filled by unxepcted color if fragment shader did not return any value.
It happens in a case on OpenGL realization of webgpu, that used in linux

Befire:

After:
2024-06-04 15:22:32 +09:00
Martin Capitanio
f77894e407 svg_loader: Add embedded webp mime type
Fixes loading _webp_ images embedded in SVG.
2024-06-04 15:21:38 +09:00
Hermet Park
89f9694cb8
Update CONTRIBUTING.md 2024-06-04 13:40:30 +09:00
Hermet Park
952e2b0116
Update CONTRIBUTING.md 2024-06-04 13:38:45 +09:00
RuiwenTang
ceee253f4e gl_engine: fix GradientStroke ignored by tessellator
Fix the GlRenderer not take GradientStroke into consider when prepare
Geometry vertices.
2024-06-04 11:23:56 +09:00
Mira Grudzinska
5b6a774b04 common: fix typos & remove unused var 2024-06-04 11:20:59 +09:00
Mira Grudzinska
be22ede274 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-03 11:27:23 +09:00
Mira Grudzinska
ec10e92362 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-03 11:26:44 +09:00
Mira Grudzinska
185836d278 examples: fix heap-use-after-free in Capi.cpp 2024-05-31 10:02:58 +09:00
Hermet Park
9300de2d06 lottie/builder: revise the layer build logic
Promote the text/image updates to the layer level.
2024-05-30 13:00:42 +09:00
Hermet Park
309f7b6763 lottie: try packing data compactly. 2024-05-30 13:00:42 +09:00
Hermet Park
80d0f5397a lottie: optimize the internal data
encode the object name with the hash value
to save memory and enable fast data comparison.
2024-05-30 13:00:42 +09:00
Hermet Park
3cd30c3197 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-30 13:00:42 +09:00
Hermet Park
ee99fe3942 common/compressor: added djb2 encoder
This is useful for encoding the string into one long type value.
2024-05-30 13:00:42 +09:00
Hermet Park
7ce8db4d34 lottie: hotfix memory leaks by a regression
A regression bug by a recent change:
1ee79a6c2a
2024-05-30 12:52:39 +09:00
Jinny You
6870953713 wasm: Support viewport API
wasm binding for viewport API in web.

see: #2276
2024-05-30 10:56:18 +09:00
Hermet Park
b19ae5b8c0 infra: removed web support
Separated the web support into a new project repository.
https://github.com/thorvg/thorvg.web

This will help maintain the core logic more efficiently.

issue: https://github.com/thorvg/thorvg/issues/2297
2024-05-30 10:56:01 +09:00
Mira Grudzinska
7b9bebe1de 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-29 23:43:01 +09:00
Mira Grudzinska
1ee79a6c2a 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-29 23:17:13 +09:00
Mira Grudzinska
3a8ef78a36 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-28 18:59:16 +09:00
RuiwenTang
03e7c70524 gl_engine: Support StrokeCap in GlTessellator
Add new function `strokeSquare` and `strokeRound` to handle StrokeCap
during Path tessellation
2024-05-27 23:14:21 +09:00
RuiwenTang
a50335686d Fix AnimateMasking with GL backend not triger redraw 2024-05-27 23:14:08 +09:00
Niklas Fiekas
cf5b08de8a sw_engine: fix -Wcalloc-transposed-args 2024-05-27 23:13:52 +09:00
Xu Xingliang
d113540d61 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-27 23:13:34 +09:00
Hermet Park
a1818cf62b common: code refactoring
Replace the math functions with operator overloading.
This should potentially reduce the code size.
2024-05-27 10:48:46 +09:00
Hermet Park
a95d5667eb
Update AUTHORS 2024-05-24 22:37:43 +09:00
Hermet Park
54a886f673 Update CODEOWNERS 2024-05-24 22:29:07 +09:00
Abdelrahman Ashraf
178cf2944d fix: 🐛 missing binding for tvg_canvas_set_viewport c api 2024-05-24 13:19:48 +02:00
Hermet Park
5c8b68c220 examples: added more svg resources. 2024-05-24 10:45:24 +09:00
Hermet Park
efe770c3af sw_engine: code clean up 2024-05-24 10:45:24 +09:00
Hermet Park
975907731d 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 10:45:24 +09:00
Hermet Park
2e50ee3c3d 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 10:34:58 +09:00