Commit graph

307 commits

Author SHA1 Message Date
Jinny You
62e7f0a7c6 test/lottie: added the slot resetting use case 2024-04-06 12:08:23 +09:00
Rafał Mikrut
71f596b173 Better regression testing 2024-04-06 12:08:22 +09:00
Jinny You
fb20938b14 test: Added test code for the lottie slot
This patch adds the test case for the recently introduced lottie slot API.

@Issues: https://github.com/thorvg/thorvg/issues/2029
2024-04-06 12:08:21 +09:00
Hermet Park
d07eb87ca3 renderer/canvas: Optimize logic by removing paint verification.
Allow direct updates to the paint object without prior validation.
The verification process is deemed inefficient;
users are expected to ensure the paint is updated using a canvas
that contains it.

This might break the backward compatibility.
2024-04-05 18:01:28 +09:00
Hermet Park
a8fc3a6e50 renderer: revise the internal logic.
dispose of the resources at the end of the paint deletion.
This will help retain the resources of the retained paints
and reuse them after reconstructing the next scene.
2024-04-05 17:46:32 +09:00
Jinny You
92288c8291 updated copyright date (#1866) 2024-01-02 20:34:12 +09:00
Hermet Park
6f19c581e8 infra: renamed the folders, images -> resources.
these folders might have more than images.
2024-01-02 20:34:10 +09:00
Hermet Park
f98d01c2c5 test: added gif save test
Skipped capi tests this time, since it has no saver api now.
2024-01-02 20:34:06 +09:00
Hermet Park
0832a188fe animation/lottie: updated the frame count unit.
replace the frame count unit from the int32_t to float
since animations could smoothly interpolate key-frames.

This notificably improve the animation smoothness in Lottie

Beta API changes:
Result Animation::frame(uint32_t no) -> Result Animation::frame(float no)
uint32_t Animation::curFrame() const -> float Animation::curFrame() const
uint32_t Animation::totalFrame() const -> float Animation::totalFrame() const
2023-12-26 17:51:53 +09:00
Hermet Park
c7123a1547 test: enhanced the unit-test coverage
supplements animation/lottie/sw_engine test cases.

updated the page: https://github.com/thorvg/thorvg/wiki/Unit-Tests

Issue: https://github.com/thorvg/thorvg/issues/1669
2023-09-26 10:48:33 +09:00
Hermet Park
2f1873f04e test/capi: update unit tests
added a Tvg_Composite_Method::TVG_COMPOSITE_METHOD_NONE case
2023-09-25 21:33:23 +09:00
Hermet Park
87dee3c1f7 loader/lottie: fix a memory leak
A dangling scene instance should be deleted properly.
2023-09-18 10:41:00 +09:00
Hermet Park
7d797ee548 Yet we don't break apis, this patch reverts the next:
cb36c25aff
8c0fc2b25a
c1e4e0808a

Those reverted changes sholud be in the bucket, the next issue item:

@Issue: https://github.com/thorvg/thorvg/issues/1372
2023-08-24 01:00:57 +09:00
Mira Grudzinska
cb36c25aff test: dashed stroke with offset added 2023-08-23 12:40:27 +09:00
Mira Grudzinska
8c0fc2b25a capi: dashed stroke setter and getter modyfied
tvg_shape_set_stroke_dash() and tvg_shape_get_stroke_dash()
require an extra argument: offset
2023-08-23 12:40:27 +09:00
Hermet Park
3eca77b280 infra wasm: remove useless wasm test.
the test hasn't been maintained properly,
and we won't be maintaining it anymore.

please use thorvg.viewer intead. it's much more accurate.
2023-08-04 15:09:28 +09:00
Hermet Park
0e97d21752 common canvas: Alter the concept of the Canvas::clear() API.
We've changed the behavior of Canvas::clear(false).

The canvas::clear(false) now retains the paints, allowing the user to update the next frame
more easily without having to recompose the paint list.

Previously, clear(false) removed the paint list from the canvas,
requiring the user to re-push all of them in the next frame.

Now, we offer the Canvas::paints() API, allowing users to modify the paint list directly instead.

This change will break compatibility with previous versions of Canvas.

Therefore, this update is included in ThorVG 1.0.

@Issue: https://github.com/thorvg/thorvg/issues/1372
2023-08-02 17:23:53 +09:00
Mira Grudzinska
c5a02b90df tests: bounds test ++
The 'transformed' arg of the 'bounds' api
wasn't tested. Added.
2023-08-01 14:53:12 +02:00
Hermet Park
3512beab9f test: ++blending 2023-06-20 11:30:18 +09:00
Hermet Park
90c9810b97 test: ++coverage of Canvas::paints(), Scene::paints() 2023-06-14 10:46:21 +09:00
Hermet Park
4627daf6f7 api: enhance API usability
Set the default values of rx = 0 and ry = 0 for the shape.
Only the round rectangle shape requires the usage of these values.
2023-06-13 10:42:57 +09:00
Martin Capitanio
44a750ee5d API, CAPI, sw_engine: add suport for stroke-miterlimit. 2023-06-13 10:42:20 +09:00
JunsuChoi
595cc56e86 webp_loader: Introduce Webp image loader
Add external_webp loader which uses libwebp library.
2023-06-09 10:58:01 +09:00
Hermet Park
b214fd23bc common canvas/scene: introduce paints() api that returns the list of the paints.
These new apis would enable users to easily modify the motion scene,
The data structure of the paints has been changed from an array to a list.

@APIs:
std::list<Paint*>& Canvas::paints() noexcept;
std::list<Paint*>& Scene::paints() noexcept;

@Deprecated:
Result Canvas::reserve(uint32_t size) noexcept;
Result Scene::reserve(uint32_t size) noexcept;

@Issue: https://github.com/thorvg/thorvg/issues/1203
2023-06-09 10:54:03 +09:00
Martin Capitanio
4def2a679c Fix clang compiler warnings in unit tests.
[clang] Warn on unqualified calls to std::move and std::forward
See: https://reviews.llvm.org/D119670

[141/166] Compiling C++ object test/tvgUnitTests.p/testAccessor.cpp.o
../thorvg-git/test/testAccessor.cpp:58:29: warning: unqualified call to
'std::move' [-Wunqualified-std-cast-call]
    picture = accessor->set(move(picture), nullptr);
                            ^
                            std::
...
2023-06-07 16:56:30 +09:00
Hermet Park
1ae92daa9d api: enhance Shape::fill() method usage.
Designate a default value for alpha which is mostly optional.
2023-06-07 12:10:31 +09:00
Hermet Park
72f89fcf53 test: add Inverse Luma Mask test cases 2023-05-20 20:11:58 +09:00
Mira Grudzinska
ca0f30c4c0 tests: capi test for tvg_shape_set_paint_order 2023-05-20 13:23:47 +09:00
Hermet Park
5ceeb32ef0 api: remove a beta api.
- Result Picture::viewbox(float* x, float* y, float* w, float* h) const;  //c++
- vg_Result tvg_picture_get_viewbox(const Tvg_Paint* paint, float* x, float* y, float* w, float* h);  //c

@Issue: https://github.com/thorvg/thorvg/issues/1372
2023-05-20 13:22:52 +09:00
Hermet Park
f633717e9f test shape: add stroke order test 2023-05-20 13:22:52 +09:00
Hermet Park
fe14e4f499 api: rename beta apis.
- SwCanvas::Colorspace::ABGR8888_STRAIGHT -> SwCanvas::Colorspace::ABGR8888S
- SwCanvas::Colorspace::ARGB8888_STRAIGHT -> SwCanvas::Colorspace::ARGB8888S

@Issue: https://github.com/thorvg/thorvg/issues/1372
2023-05-20 13:22:52 +09:00
Vincent Torri
be2de28312 portability: fix usage of TVG_API
Rule of thumb on Windows:
  * for a DLL:
    * if the library is built, set TVG_API to __declspec(dllexport)
    * if the library is used, set TVG_API to __declspec(dllimport)
  * for a static library, set TVG_API to nothing

To set TVG_API for a static library, TVG_STATIC is defined when the stataic library is built.
Otherwise, TVG_API is correctly set for a DLL.
Also sun and intel compilers are handled

@issue: https://github.com/thorvg/thorvg/issues/1446
2023-05-16 18:55:33 +09:00
Hermet Park
9d9f38c875 common: code refactoring
Replace standard casting with tvg::cast()
2023-05-15 12:07:55 +09:00
Hermet Park
07cb8fd55b test: updated tvg binaries. 2023-05-12 17:53:10 +09:00
JunsuChoi
6d16713ce9 test_capi: Add missing *_del api 2023-05-10 21:05:26 +09:00
Mira Grudzinska
78c5034229 tests: lcov++ (sw_engine) 2023-05-10 14:36:02 +09:00
Hermet Park
a992e571a3 test capi: ++CompositeMethod coverage 2023-05-09 23:19:15 +09:00
Hermet Park
89dc7616cf test paint: ++CompositeMethod coverage 2023-05-09 23:19:15 +09:00
Rafał Mikrut
56d18f37c3 infra: Improve regression finder 2023-05-08 10:38:27 +09:00
Mira Grudzinska
51a31e226d tests: capi identifier tests added 2023-05-04 09:58:09 +09:00
Rafał Mikrut
e8b1c654d4 Regression finder 2023-04-26 11:19:12 +09:00
Mira Grudzinska
5f5b4fdb80 tests: ++coverage of the svg_loader 2023-04-24 10:54:11 +09:00
Mira Grudzinska
dbca656ff5 tests capi: missing header added
Because of this tests for SwCanvas were
not performed.
2023-04-23 10:25:55 +09:00
Mira Grudzinska
f82b16285a tests: fixing error on windows (mingw-64)
Error while comparing a pointer and an integer.
Solved by using a null pointer const instead of
the NULL macro.

@Issue: https://github.com/thorvg/thorvg/issues/1382
2023-04-22 21:24:41 +09:00
Hermet Park
5d930e51e4 test/examples: -- deprecated apis call warnings.
Result load(const char* data, uint32_t size, bool copy = false)
-> Result load(const char* data, uint32_t size, const std::string& mimeType, bool copy = false)

Result bounds(float* x, float* y, float* w, float* h)
-> Result bounds(float* x, float* y, float* w, float* h, bool transformed)
2023-04-22 18:32:22 +09:00
Hermet Park
69063d2405 infra: specify TVG_API for both static/dynamic linking.
The previous meson script was incomplete,
therefore this change requires it to be revised.

To enable static linking use the next meson option.
"-Ddefault_library=static"

Issue: https://github.com/thorvg/thorvg/issues/1234
2023-04-22 18:32:22 +09:00
Hermet Park
d359d65640 test capi: ++coverage
added jpg, tvg tests
2023-04-06 19:54:54 +09:00
Hermet Park
f0ae3e9cee test: fix broken plugin support.
The thorvg test should not attempt to perform features
that were not enabled, as this will cause them to fail.

@Issues: https://github.com/thorvg/thorvg/issues/1251
2023-04-06 19:47:10 +09:00
Hermet Park
5d77551b47 test: upgrade catch2
2.13.6 -> 2.13.10
2023-01-30 13:28:44 +09:00
Hermet Park
9b3c34c3b1 updated copyright. 2023-01-14 13:48:11 +09:00