Commit graph

3190 commits

Author SHA1 Message Date
Hermet Park
a16cbd58a0 bump up version v0.15.1 2024-10-12 12:46:29 +09:00
Hermet Park
066160a82a lottie: hotfix a crash
Fixed a mistake during the code merge.

issue: https://github.com/thorvg/thorvg/issues/2733
2024-10-12 12:41:15 +09:00
Hermet Park
c9960fcc93 bump up version v0.15 2024-10-04 10:00:38 +09:00
Sergii Liebodkin
7e1f756da0 wg_engine: fix picture memory leak
picture mesh data was not released
2024-10-04 10:00:38 +09:00
Hermet Park
3563546a65 infra: --shutdown the unkown-pragmas warning
Apply the flag even if the sanitizer is toggled on.
2024-10-04 02:33:11 +09:00
Hermet Park
5813e7e09f test/capi: fixed a memory leak 2024-10-04 01:53:10 +09:00
Hermet Park
f374802d04 doc: updated to v0.15 2024-10-04 00:41:06 +09:00
Hermet Park
0df35447b3 wg_engine: fixed resource leaks
issue: https://github.com/thorvg/thorvg/issues/2808
2024-10-04 00:34:16 +09:00
Mira Grudzinska
52def8dc27 sw_engine: ++exception handling
Prevent the infinite loop in the worst case

@Issue: https://github.com/thorvg/thorvg/issues/2651
2024-10-04 00:34:16 +09:00
Mira Grudzinska
03bbfd3183 sw_engine: ignore small cubics
During the stroke's outline calculation, the function
handling small cubics set all angles to zero. When
the cubic was small but not zero, this resulted in
incorrect outlines. Now such curves are ignored.

Co-Authored-By: Hermet Park <hermet@lottiefiles.com>

Issue: https://github.com/thorvg/thorvg/issues/2776
Issue: https://github.com/thorvg/thorvg/issues/2712
2024-10-03 21:42:14 +09:00
Hermet Park
8ebaf06ffd test: shutdown the false alram of the valgrind
- Conditional jump or move depends on uninitialised value(s)
2024-10-03 19:02:40 +09:00
Hermet Park
19656db676 renderer/compressor: corrected base64 decoded data size
issue: https://github.com/thorvg/thorvg/issues/2794
2024-10-03 19:02:33 +09:00
Hermet Park
aece166cb7 sw_engine: ++stability
cut the Bezier curve based on the number of points
and transform it into a straight line when it's very small.

issue: https://github.com/thorvg/thorvg/issues/2759
2024-10-03 19:02:26 +09:00
Hermet Park
bceedf081f sw_engine: fixed an uninitialized data access 2024-10-03 19:02:14 +09:00
Mira Grudzinska
42c4190112 examples: fix mingw build error
M_PI was not declared error solved
2024-10-03 16:39:42 +09:00
Hermet Park
38f6ff4380 lottie: hotfix layer effect parsing
fixed a break in expressions/driving.json
2024-10-03 16:33:26 +09:00
Hermet Park
2b3a2e5ddf lottie: fixed a corrupted colorstop population
the color stop number should be retained during
the population of frames

issue: https://github.com/thorvg/thorvg/issues/2765
2024-10-03 16:33:16 +09:00
Mira Grudzinska
1c48cd3cdc lottie: fix gradient populating
When populating the gradient, the color/alpha should
be assigned the first possible value from the provided
ones, rather than the default value of 255.
2024-10-03 12:39:46 +09:00
Hermet Park
f446e5d079 wasm: fix a build break 2024-10-01 17:12:28 +09:00
Hermet Park
6f7ec5165a lottie: portability++
issue: https://github.com/thorvg/thorvg/issues/2764
2024-10-01 14:08:40 +09:00
Hermet Park
ee19380d50 tvg: updated binary with v0.15 tagging 2024-10-01 12:58:13 +09:00
Hermet Park
124dd4b629 lottie: ++safety 2024-10-01 12:58:13 +09:00
Hermet Park
c39910cfd6 test: fix a memory leak 2024-10-01 12:58:13 +09:00
RuiwenTang
c8a04a5337 gl_engine: implement darken and lighten mask method
Add new shader to support darken and lighten mask method.
2024-09-30 23:24:28 +09:00
Mira Grudzinska
80a977f07e lottie: fix mem leak
Mem leak was observed in a case the end values
(deprecated feature) were provided for the gradient.

@Issue: https://github.com/thorvg/thorvg/issues/2667
2024-09-30 23:24:24 +09:00
Hermet Park
fa9223fe1e hotfix: backward compatibility++ 2024-09-30 18:02:48 +09:00
Sergii Liebodkin
b66ff36502 CompositeMethod::ClipPath will be replaced with the Scene::clip()
wg_engine needs to refactor to remove the enum value usage before proceeding with its removal
2024-09-30 18:02:43 +09:00
Hermet Park
ff2cacd25d examples: fixed an incorrect buffer size.
adjusted the size according to the offsets.
2024-09-30 17:00:40 +09:00
Hermet Park
1a795e2ed4 lottie: optimization++
Use a clipper instead of masking when the condition is satisfied.
Generally, clipping is cheaper than masking in fps & memory usage.

issue: https://github.com/thorvg/thorvg/issues/2647
2024-09-30 16:44:22 +09:00
Hermet Park
ec65501079 gl_engine: --deprecation references. 2024-09-30 16:44:22 +09:00
Hermet Park
8289385760 renderer/scene: rectify the render region elaboration
Properly clip the render region to the current viewport.
2024-09-30 16:44:22 +09:00
Hermet Park
2972a631bd sw_engine: applied OpenMP to improve post-processing performance.
- OpenMp threads will be allocated alongside the TaskSculeduler::threads()
- Performance improved by 2x in a specific animation.
- Disable the thread feature in the Android build test due to system issues with OpenMP compilation.
2024-09-30 16:44:22 +09:00
Hermet Park
ab8b4ef73e lottie: support layer effect & gaussian blur
issue: https://github.com/thorvg/thorvg/issues/2718
2024-09-30 16:44:22 +09:00
Hermet Park
ece0d8c7e1 examples: added SceneEffect
added a showcase with a gaussian blur effect
2024-09-30 16:44:22 +09:00
Hermet Park
ad7c65d2ea renderer: introduced SceneEffect feature
Scene effects are typically applied to modify
the final appearance of a rendered scene,
such as adding a blur effect.

Each effect would have a different number of parameters
to control its visual properties. The Scene::push() interface
 uses variadic arguments to accommodate various cases.

Users should refer to the SceneEffect API documentation
and pass the parameters exactly as required for the specific
effect type. For instance, GaussianBlur expects 3 parameters
which are:

- sigma(float)[greater than 0]
- direction(int)[both: 0 / horizontal: 1 / vertical: 2]
- border(int)[extend: 0 / wrap: 1]
- quality(int)[0 ~ 100]

and, scene->push(SceneEffect::GaussianBlur, 5.0f, 0, 0, 100);

New Experimental APIs:
- SceneEffect::ClearAll
- SceneEffect::GaussianBlur
- Result Scene::push(SceneEffect effect, ...);

Example:
- examples/SceneEffect

issue: https://github.com/thorvg/thorvg/issues/374
2024-09-30 16:44:22 +09:00
RuiwenTang
cd4fecf84e example: MultiCanvas show case with GL backend
Change the MultiCanvas code to show how to render the content of
GlCanvas to a given off-screen framebuffer.

issue: https://github.com/thorvg/thorvg/issues/2746
2024-09-30 16:44:22 +09:00
Hermet Park
4378d8dc7c renderer: ++TODO for optimization 2024-09-30 16:44:22 +09:00
Mira Grudzinska
310183972e renderer: fix clipped clippers
Fast track was applied for clippers even if they
were also clipped. As a result their clips were
omitted.

@Issue: https://github.com/thorvg/thorvg/issues/2777
2024-09-30 16:44:22 +09:00
Hermet Park
5453e8d82b Update README.md 2024-09-30 16:44:22 +09:00
Mira Grudzinska
59ffd90758 sw_engine: add support for 8bits gradient rectangles
Rastering for 32bits dst buffer was implemented,
but 8bits dst were not supported.

@Issue: https://github.com/thorvg/thorvg/issues/2765
2024-09-30 16:44:22 +09:00
Mira Grudzinska
99153ef26e sw_engine: fix translucent grad rastering
8bit translucent gradient rle were missing AA. Fixed.
2024-09-30 16:44:22 +09:00
Mira Grudzinska
7e30bd850c tests: ++lcov 2024-09-30 16:44:22 +09:00
Mira Grudzinska
21dad77da6 wg_engine: prevent adding duplicate points while trimming
In cases where the distance between points is 0, further
processing of the points results in division by zero.
To avoid this check, we ensure that duplicate points are
not added during trimming.
2024-09-30 16:44:22 +09:00
Mira Grudzinska
d240044aae wg_engine: fix stroke trimming
Fix cases when begin < 0 - this require handling the stroke
in two parts: begin - 0 and 0 - end.
Improve trimming for simultaneous=true.
2024-09-30 16:44:22 +09:00
Mira Grudzinska
b3b619349d wg_engine: fix stroke trimming
Prevent crash for begin == end;
2024-09-30 16:44:22 +09:00
Sergii Liebodkin
47d3d7e7d5 wg_engine: geometry generating optimization
Streaming model for massive vertex and index creations: minimize memory allocations, range checks and other conditions
Reduce number of segments length calculations (sqrt) and bbox (min and max).
Update distances and bboxes on a whole buffer and only if necessary. For shapes without strokes compute distances not necessary at all. bbox can be updated only on the final stage of geometry workflow, but not on the each stage.
Using stack memory instead of heap. its more cache friendly and did not fragment memory, faster memory allocations (weak place of realization)
Using cache for points distances and whole path length. Updates only if necessary
Validation of geometry consistency executes only on the final stage of path life cicle. It more friendly for data streaming: no any conditions and branches.
Using binary search for strokes trimming
Pre-cached circles geometry for caps and joints
Refactored strokes elements generation functions. Code is more readable and modifiable in general. Can be easily fixed if some geometry issues will be finded
2024-09-30 16:44:22 +09:00
Hermet Park
8b01f92c57 loader/jpg: --compiler warnings
../src/loaders/jpg/tvgJpgd.cpp:867:36: warning: ‘*&P.DCT_Upsample::Matrix44::v[0][0]’ may be used uninitialized [-Wmaybe-uninitialized]

https://github.com/thorvg/thorvg/issues/2639
2024-09-30 16:44:22 +09:00
Mira Grudzinska
45a35fd65b svg_loader: fix circle radius if in percentages 2024-09-30 16:44:22 +09:00
Hermet Park
8510926bf7 infra: updated labeler 2024-09-30 16:44:22 +09:00
Hermet Park
03db2e31c3 Update README.md 2024-09-30 16:44:22 +09:00