Commit graph

226 commits

Author SHA1 Message Date
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
JunsuChoi
a7f7cbd29a test Picture: Change file open of ifstream to binary(and readonly) type
When opening a file using ifstream, a different problem occurs for each platform.
To fix this, change to binary, readonly type.

refer to:
https://stackoverflow.com/questions/9817806/why-does-my-program-produce-different-results-on-windows-and-linux-about-file-r
2021-10-28 13:59:24 +09:00
Mira Grudzinska
2780d77a52 capi: tvg_paint_transform -> tvg_paint_set_transform 2021-10-26 19:20:15 +09:00
Mira Grudzinska
1006cbd0d8 tests: added Capis gradient transformation tests 2021-10-25 19:35:00 +09:00
Mira Grudzinska
cc9b5669e5 tests: fill transformation tests added 2021-10-22 19:47:29 +09:00
Hermet Park
8cc7f50235 test: API coverage up
Added identifier() test cases.
2021-10-22 18:47:05 +09:00
Mira Grudzinska
78b7b278c0 tests: saver capis added into the tests 2021-10-13 21:25:44 +09:00
Mira Grudzinska
e6debdbf15
capi: tvg_swcanvas_set_mempool capi added (#903)
* capi: tvg_swcanvas_set_mempool capi added

* tests: tvg_swcanvas_set_mempool added to the tests
2021-10-13 19:31:39 +09:00
Mira Grudzinska
a4d2a99c03 tests: tvg_gradient_duplicate added to the capi tests 2021-10-13 18:34:02 +09:00
projectitis
dad6c71b6c
all: fix warnings on MSVC
* Explicit casts to suppress warnings
* Fixed compiler warnings
2021-10-09 11:33:45 +09:00
Hermet Park
b97f9338dd test: ++safety.
add null handlings just in case.
2021-10-07 15:04:46 +09:00