Commit graph

2650 commits

Author SHA1 Message Date
RuiwenTang
b7eb72a27d gl_engine: fix some typo inside GlRenderer
* Fix a typo error when prepare blit task
* Prevent repeated texture generation during task preparation
2024-06-24 12:12:10 +09:00
Hermet Park
6556cddabb AUTHORS: updated
Since ThorVG has a contributor section on the main page,
there is no need to keep the redundant email list anymore.
2024-06-24 12:10:38 +09:00
RuiwenTang
574783be16 gl_engine: using normal texture rendering in final color blit
Since blit msaa framebuffer to another msaa framebuffer may generate
GLError in some platforms. Use normal texture rendering to blit the final
color buffer onto target framebuffer.
2024-06-24 12:10:18 +09:00
Hermet Park
026d85f6a8 lottie: code refactoring.
keep the coding style.
2024-06-24 12:05:59 +09:00
Hermet Park
0b5152f138 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-06-24 12:05:47 +09:00
Jinny You
22513b2fea test/lottie: Add the segment use case 2024-06-24 12:05:34 +09:00
Jinny You
e9bd05bad5 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-06-24 12:03:24 +09:00
Lucas Niu
fa60830e08 Update AUTHORS 2024-06-24 12:03:16 +09:00
Lucas Niu
e6e7ca9fee examples/lottie: Add example for the Marker
Co-authored-by: Jinny You <jinny@lottiefiles.com>
2024-06-24 12:02:53 +09:00
Lucas Niu
194bd8f01d 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-06-24 12:00:25 +09:00
9904d7b468 sw_engine : type cast compile error 2024-06-24 12:00:17 +09:00
6b27226390 sw_engine: Implement AVX and NEON optimizations for RasterGrayscale 2024-06-24 12:00:04 +09:00
JunsuChoi
6a03c4c2c1 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-06-24 11:59:55 +09:00
JunsuChoi
43b5d0e462 loader/svg: Skip to invalid polygon
If a Polygon's points array is odd, it is not a valid shape.
2024-06-24 11:59:32 +09:00
Hermet Park
f108fc9363 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-06-24 11:59:16 +09:00
Hermet Park
316317e0f7 Update README.md 2024-06-24 11:59:05 +09:00
Hermet Park
ca7aec5fff 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-06-24 11:58:48 +09:00
Rafał Mikrut
1c74e1e40a Finding crashes and adding comments 2024-06-24 11:57:28 +09:00
Hermet Park
2ff4e29949 bump up version 0.13.0 2024-04-07 15:15:59 +09:00
Hermet Park
f5cd67b77e tvg: updated binary resources to v0.13 2024-04-07 15:15:59 +09:00
Hermet Park
37b431c02f svg: code refactoring
-- compiler warnings on msvc
2024-04-07 15:15:59 +09:00
Hermet Park
9374437115 example: fixed broken tvg saver resource pathes 2024-04-07 15:15:59 +09:00
EunSik Jeong
6d3ea78d96 sw_engine/neon : Fix compilation error 2024-04-07 15:15:59 +09:00
Hermet Park
5431fdb77b docs: updated for 0.13 release 2024-04-07 15:15:59 +09:00
Hermet Park
710d1f99ae renderer/loader: fix a font loader memory leak 2024-04-07 15:15:59 +09:00
Hermet Park
f578a8947f test: improve the test-coverage.
make the lottie/text coverage up.

issue: https://github.com/thorvg/thorvg/issues/2067
2024-04-07 15:15:59 +09:00
Sergii Liebodkin
366c1be6bd 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-07 15:15:59 +09:00
Hermet Park
4746b2cf7b 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-07 15:15:59 +09:00
RuiwenTang
cde17a4fc6 gl_engine: change all shader output premultiplied alpha color 2024-04-07 15:15:59 +09:00
Hermet Park
10d6aa1bba 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-07 15:15:56 +09:00
Hermet Park
94b3971a55 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-06 12:48:30 +09:00
Hermet Park
efc7199e51 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-06 12:48:30 +09:00
Hermet Park
34bb27bfc9 renderer/saver: enhanced safety
enhanced safety by taking into account the object reference counting.
2024-04-06 12:48:30 +09:00
JunsuChoi
b3b2bc6bd5 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-06 12:48:30 +09:00
Youjin Lee
31c41306f0 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-06 12:48:30 +09:00
Hermet Park
839f856e8d Update CODEOWNERS
auto assign .github reviewers
2024-04-06 12:48:30 +09:00
Hermet Park
1632ad9ee5 lottie: removed unused code.
Currently, thorvg has no plan to support dotlottie format.
2024-04-06 12:48:30 +09:00
Sergii Liebodkin
7d8a261a83 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-06 12:48:30 +09:00
Hermet Park
ef03e5b006 lottie: hotfix memory corruption.
revise the fix that occured a side effect by:
287e6d33d2
2024-04-06 12:48:30 +09:00
Hermet Park
043b14d681 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-06 12:48:30 +09:00
Jinny You
f54f22ae78 lottie: Fix heap-buffer-overflow in gradient populate 2024-04-06 12:48:30 +09:00
JunsuChoi
349fd266b9 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-06 12:48:30 +09:00
Hermet Park
ecee01ebd6 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-06 12:48:30 +09:00
Hermet Park
6688f03396 sw_engine: revised the trimpath dash line logic
Support the TrimPath modes (individual/simultaneous)
internally in the engine to handle them efficiently.
2024-04-06 12:48:30 +09:00
Hermet Park
8be41faa26 Update README.md 2024-04-06 12:48:30 +09:00
JunsuChoi
0c6395cbea loader/svg: Support hsl color format
Support parsing of hsl(hue, saturation, brightness) color type
and conversion to rgb color.
2024-04-06 12:48:30 +09:00
Sergii Liebodkin
4f204b5e13 wg_engine: Lottie extensions
[issues 1479: LottieExtensions](#1479)

LottieExtensions example supports
Supports multiple color stops for gradient fill (redial and linear)
2024-04-06 12:48:30 +09:00
Jinny You
9a3c673f11 lottie: Fix buffer-overflow in base64 decode 2024-04-06 12:48:30 +09:00
Hermet Park
e4f7fffacc 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-06 12:48:30 +09:00
Hermet Park
26e04611e6 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-06 12:48:27 +09:00