Commit graph

336 commits

Author SHA1 Message Date
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
Mira Grudzinska
1980d9d0e3 all: Trailing spaces removed 2023-01-07 10:53:51 +09:00
Hermet Park
91730249ae test picture: add picture mesh api unit test
@Issue: https://github.com/Samsung/thorvg/issues/1241
2022-12-09 12:09:59 +09:00
Hermet Park
d78744bae3 test accessor: added accessor test unit test.
@Issue: https://github.com/Samsung/thorvg/issues/1243
2022-12-08 22:39:09 +09:00
projectitis
510ffa571a Fix compiler warnings on windows 2022-08-20 12:30:35 +09:00
Rémi Verschelde
46c3fc1f94 Format code files with dos2unix, ensure newline at EOF 2022-07-10 23:21:05 +09:00
Hermet Park
49c6336b33 examples - updated a resource usage 2022-03-08 18:39:32 +09:00
Hermet Park
f0141e63de updated copyright date. 2022-01-12 14:08:48 +09:00
Hermet Park
e258a2a662 sw_engine texmap: implemented fast span-edge anti-aliasing
This Anti-Aliasing mechanism is originated from Hermet Park's idea.
To understand this AA logic, you can refer this page:
www.hermet.pe.kr/122 (hermetpark@gmail.com)

@Issue: https://github.com/Samsung/thorvg/issues/161
2021-12-16 15:56:20 +09:00
JunsuChoi
80cc0177fb test capiSwCanvas: remove a invalid test case.
This test depends on the machine environment.
it's not guaranteed the same result so we remove it.
2021-11-22 13:29:07 +09:00
Hermet Park
4587a39f46 test capi: fix the memory leak.
target is dangled without any proper deletion...
2021-11-09 15:05:55 +09:00
Hermet Park
de353401a7 Revert "test capi: fix memory leak."
This reverts commit 651a98a2d8.

Applied the alternative solution instead of this patch.
37e39866dd
2021-11-09 14:55:54 +09:00
Hermet Park
74413a989f common paint: fix a memory leak.
delete dangling object properly in the corner case.

Unfortunately, this brings to correct the capi test cases.
we assume the paints is deleted whenever its result is successful or not.

@Issue: https://github.com/Samsung/thorvg/issues/995
2021-11-09 14:51:32 +09:00
Hermet Park
775a0bcb1d test initializer: remove a invalid test case.
This test depends on the machine environment.
it's not guaranteed the same result so we remove it.
2021-11-09 14:28:41 +09:00
JunsuChoi
00bba39b02 test Array: Remove too big size test
On large memory machines, if machine have enough memory,
tests failed because it doesn't return null.
2021-11-09 14:04:42 +09:00
Mira Grudzinska
8608238343 tests: capi - buffer was not freed 2021-11-08 12:27:23 +09:00
Hermet Park
651a98a2d8 test capi: fix memory leak.
Delete the paint which is not committed properly.
2021-11-06 01:46:42 +01:00
Hermet Park
fd74e0fae8 test: fix memory leak.
these duplicates are not unique_ptr, should be taken care.

@Issue: https://github.com/Samsung/thorvg/issues/995
2021-11-05 21:48:24 +09:00
Hermet Park
c3a29bd648 common math: code refactoring
introduce common math functions to improve the reusability.
2021-11-04 17:11:27 +09:00
JunsuChoi
021b86a065 test Picture: Fix array release
fix code
2021-11-01 15:04:05 +09:00
JunsuChoi
f28a0d9b5c test Scene/Canvas: Fix maximum size for big size test
In some development environments, -1 of uint32_t may become 0.
2021-10-28 14:24:20 +09:00
JunsuChoi
5fd60e14a2 test Picture : Remove unnecessary namespace
Remove `std::`
2021-10-28 13:59:24 +09:00