Commit graph

2866 commits

Author SHA1 Message Date
Hermet Park
4d8f617af6 lottie: code refactoring.
keep the coding style.
2024-04-15 00:23:37 +09:00
Hermet Park
fa4b2cb704 infra: revise the vector build script
Note that this change renames the Meson option from 'vector' to 'simd',
separates the NEON types into 'neon-arm' and 'neon-aarch',
and designates the 'mfpu' option solely for 'neon-arm'.
2024-04-15 00:08:34 +09:00
Jinny You
cc53bce8ab test/lottie: Add the segment use case 2024-04-14 23:54:26 +09:00
Jinny You
2ea79746e3 bindings/capi: Support lottie segment and marker
new experimental apis for animation segment and lottie marker.

APIs:
- TVG_API Tvg_Result tvg_animation_set_segment(Tvg_Animation* animation, float begin, float end)
- TVG_API Tvg_Result tvg_animation_get_segment(Tvg_Animation* animation, float* begin, float* end = nullptr)
- TVG_API Tvg_Result tvg_lottie_animation_set_marker(Tvg_Animation* animation, const char* marker)
- TVG_API Tvg_Result tvg_lottie_animation_get_marker_cnt(Tvg_Animation* animation, uint32_t* cnt)
- TVG_API Tvg_Result tvg_lottie_animation_get_marker(Tvg_Animation* animation, uint32_t idx, const char** name)
2024-04-14 23:54:26 +09:00
Lucas Niu
b7ebccdc41 Update AUTHORS 2024-04-14 23:54:26 +09:00
Lucas Niu
b7ced09fef examples/lottie: Add example for the Marker
Co-authored-by: Jinny You <jinny@lottiefiles.com>
2024-04-14 23:54:26 +09:00
Lucas Niu
3af9faf116 lottie: Support the Animation Segment(Marker)
A single animation might have a desinated markers with naming: 0 ~ 0.5 (sector A), 0.5 ~ 1.0  (sector B). Selecting one of them using a marker name(sector A) and could play only that part with animation controllers.

usage:
- `animation->segment("sectionA") // Named segment(Marker)`
- `auto cnt = animation->markerCnt()`
- `auto name = animation->markers(index)`
- `animation->segment(0, 0.5) // Segment`
- `animation->segment(&begin, &end)`

Co-authored-by: Jinny You <jinny@lottiefiles.com>
2024-04-14 23:54:26 +09:00
b4a0933a10 sw_engine : type cast compile error 2024-04-14 10:22:19 +09:00
06b4b2c586 sw_engine: Implement AVX and NEON optimizations for RasterGrayscale 2024-04-13 14:47:40 +09:00
JunsuChoi
387d82a80e loader/svg: Ignore unrecognized commands following 'z'
If the command after `m` is not recognized, it must be recognized as `l` or `L`.
However, if it is not recognized after ending with `z`, all commands after it are ignored.

```
<svg width="100" version="1.0" xmlns="http://www.w3.org/2000/svg" height="100" xmlns:xlink="http://www.w3.org/1999/xlink">

<path style="stroke:#F00" d="m 20,20 0,50 50 0 -50 -50 z  70,70 0,50 50 0 -50 -50 z  "/>

</svg>
```
2024-04-11 10:55:34 +09:00
JunsuChoi
75e587a9a9 loader/svg: Skip to invalid polygon
If a Polygon's points array is odd, it is not a valid shape.
2024-04-11 10:55:20 +09:00
Hermet Park
d98cb1a84b lottie: corrected the comp/layer size data type.
Actually, the these size is expected to be a floating-point value.
This correction addresses a parsing error.

issue: https://github.com/thorvg/thorvg/issues/2153
2024-04-11 10:54:49 +09:00
Hermet Park
0d4c6bdeed Update README.md 2024-04-11 10:54:35 +09:00
Hermet Park
50707482ba lottie: rectify the frame updates.
Currently, tvg ignores the frame value if the difference
is less than 0.001. In most cases, updating the frames
when the change is less than 1ms is just an unnecessary
burden on the system.

Instead, this ensures that the perfect last frame is reached.

issue: https://github.com/thorvg/thorvg/issues/2147
2024-04-11 10:54:02 +09:00
Rafał Mikrut
7a955108d6 Finding crashes and adding comments 2024-04-09 11:42:59 +09:00
Hermet Park
1c4b254015 svg: code refactoring
-- compiler warnings on msvc
2024-04-08 17:25:05 +09:00
Hermet Park
c4d547c148 infra: bumped up version v0.13, set it dev mode. 2024-04-06 15:13:35 +09:00
Hermet Park
3b304dbba7 example: fixed broken tvg saver resource pathes 2024-04-06 15:06:20 +09:00
Hermet Park
e6b87b270c tvg: updated binary resources to v0.13
issue: https://github.com/thorvg/thorvg/issues/2067
2024-04-06 15:06:20 +09:00
Hermet Park
aee40f27cf docs: updated for 0.13 release
issue: https://github.com/thorvg/thorvg/issues/2067
2024-04-06 15:06:20 +09:00
EunSik Jeong
fa73bbd032 sw_engine/neon : Fix compilation error 2024-04-06 10:41:51 +09:00
Hermet Park
2ad441db29 Update README.md 2024-04-06 00:52:03 +09:00
Hermet Park
c8993e048c renderer/loader: fix a font loader memory leak 2024-04-05 16:51:22 +09:00
Hermet Park
b0f258d531 test: improve the test-coverage.
make the lottie/text coverage up.

issue: https://github.com/thorvg/thorvg/issues/2067
2024-04-05 16:51:22 +09:00
Sergii Liebodkin
392f59db9d wg_engine: vertex, index and unifroms buffers, render objects caching
[issues 1479: lottie](#1479)

Vertex, Index and uniform buffers now updates instead of recreate.
Implemented pools form mesh objects and render shapes data

it increase performance in 30-40% in massive animations scenes
2024-04-05 11:40:57 +09:00
Hermet Park
1efb72ce94 gl_engine: hotfix for the main surface drawing issue.
GL might need to generate a default target FBO
when the given target ID indicates the main surface.

However, users may want to draw visuals directly onto the main surface.

This policy must be reviewed thoroughly.
2024-04-05 01:11:14 +09:00
RuiwenTang
1e93eb0f49 gl_engine: change all shader output premultiplied alpha color 2024-04-05 01:11:00 +09:00
Hermet Park
d37ed535d1 wasm: update the gif conversion function
re-implement the gif conversion function with the correct approach.
The input data is not reusable as it undergoes modifications during parsing.

To address this, the function now creates a backup of the original data for use in GIF conversion.

This also resolves issues where the GIF viewport was incorrectly matched.

This implementation may be revisited upon
the availability of Animation::duplicate().
2024-04-05 01:10:39 +09:00
Hermet Park
059939f2ed wasm: optimize TVG saving Logic
Optimized the saving logic for TVG.

Copying the picture is unnecessary;
the logic now directly utilizes the currently held picture.
2024-04-05 01:10:39 +09:00
Hermet Park
06a34a4c65 renderer/loader: ensure unique scene instances for each Lottie loader
The Lottie loader now utilizes an individual scene instance per loader.
This guarantees that each instance retains a unique frame number,
essential for maintaining the integrity of animation states.

As a result, sharing loaders between Lottie animations is prohibited
to uphold frame context isolation.

This may be subject to optimization review in the future.
2024-04-05 01:10:39 +09:00
Hermet Park
1228f52dc9 renderer/saver: enhanced safety
enhanced safety by taking into account the object reference counting.
2024-04-05 01:10:39 +09:00
JunsuChoi
a4ced1963e loader/svg: Fix invalid syntax check
If the key is not parsed and the '=' keyword is located next,
modify it to parse the following syntax.

related issue:
https://github.com/thorvg/thorvg/issues/2116
2024-04-04 15:58:07 +09:00
Youjin Lee
ab49e2ee2b Modify txt file for cross-platform build setup
Following the Android developer guide (https://developer.android.com/ndk/guides/other_build_systems), added HOST_TAG to the directory.
2024-04-04 14:09:35 +09:00
Hermet Park
4b3b7f7823 Update CODEOWNERS
auto assign .github reviewers
2024-04-04 14:09:14 +09:00
Hermet Park
99a29ae97f lottie: removed unused code.
Currently, thorvg has no plan to support dotlottie format.
2024-04-04 14:09:04 +09:00
Sergii Liebodkin
b0280150db wg_engine: Blending optimization
[issues 1479: lottie](#1479)

To optimize bled operations hardware pipeline blend stage are used for some blend methods:
	BlendMethod::SrcOver
    BlendMethod::Normal
    BlendMethod::Add
    BlendMethod::Multiply
    BlendMethod::Darken
    BlendMethod::Lighten

Other types compute shaders used
2024-04-04 11:03:59 +09:00
Hermet Park
622b25a3b4 lottie: hotfix memory corruption.
revise the fix that occured a side effect by:
287e6d33d2
2024-04-03 18:27:01 +09:00
Hermet Park
a4a585d8f0 sw_engine/stroke: hotfix the memory access violation
ensure that the number of contour/close data is properly paired.

issue: https://github.com/thorvg/thorvg/issues/2129
2024-04-03 13:52:34 +09:00
Jinny You
287e6d33d2 lottie: Fix heap-buffer-overflow in gradient populate 2024-04-03 13:19:19 +09:00
JunsuChoi
79c65aa5e7 loader/svg: Check invalid color
Checks whether the string that can be specified in Color is valid.

example)
```
     style="stroke:asdasd"
```

related issue: https://github.com/thorvg/thorvg/issues/1255
2024-04-03 11:38:49 +09:00
Hermet Park
cbed261ba2 lottie: Properly handle the TrimPath mode.
This correction addresses the drawing order of
objects when a group contains a TrimPath and
is merging shapes.

Additionally, the TrimPath method is can applied
to the engine to control the drawing behavior by
7f3dc541d6b7abcdc03facd884489f37c327fd98

issue: https://github.com/thorvg/thorvg/issues/2047
2024-04-03 10:46:01 +09:00
Hermet Park
c74cd42363 sw_engine: revised the trimpath dash line logic
Support the TrimPath modes (individual/simultaneous)
internally in the engine to handle them efficiently.
2024-04-03 10:46:01 +09:00
Hermet Park
75477f502e
Update README.md 2024-04-03 01:15:52 +09:00
JunsuChoi
dea08681c0 loader/svg: Support hsl color format
Support parsing of hsl(hue, saturation, brightness) color type
and conversion to rgb color.
2024-04-02 22:59:13 +09:00
Sergii Liebodkin
712fc3cfea wg_engine: Lottie extensions
[issues 1479: LottieExtensions](#1479)

LottieExtensions example supports
Supports multiple color stops for gradient fill (redial and linear)
2024-04-02 20:06:06 +09:00
Jinny You
8bc1daac38 lottie: Fix buffer-overflow in base64 decode 2024-04-01 15:41:16 +09:00
Hermet Park
c503f688db sw_engine: hotfix a regression bug of line drawing.
fixed one more corner case problem, just observed.
it's a side effect by 925009c4a5
2024-04-01 10:52:44 +09:00
Hermet Park
e8e9ba5ea0 infra: move the examples folder outside of the source directory.
examples are not considered a feature of ThorVG;
hence, they are excluded from the src directory.

This change allows developers to concentrate more effectively
on the core ThorVG sources for practical usages.
2024-04-01 10:52:22 +09:00
Hermet Park
9cd71589d8
Update README.md 2024-03-30 14:19:53 +09:00
Vincent Torri
ac1681d07f README.MD: add instructions to install and update thorVG with MSYS2 2024-03-30 14:17:02 +09:00