Commit graph

91 commits

Author SHA1 Message Date
Mira Grudzinska
284298445b sw_engine: border cases for gradients
According to the svg standard, in a case when 'x1==x2 and y1==y2'
for a linear gradient or when 'r==0' for a radial gradient, the area
should be painted as a single color - the last gradient stop color.
2021-10-05 15:24:07 +02:00
Hermet Park
5ad17c6ccf infra: just released v0.5.0 2021-09-24 12:19:02 +09:00
Hermet Park
75e1310c7a prepare to release tvg format feature. 2021-09-16 17:46:10 +09:00
Hermet Park
6f95e9dbe7 infra: simplify vector meson option.
neon/avx can't be resided in together,
we replace it with a string variable.
2021-08-19 14:46:59 +09:00
Hermet Park
ca16e8b403 build: renamed the cpu vectorization option. 2021-08-18 19:00:48 +09:00
Michal Szczecinski
e3eaa05548 build: Fixed simd options detection 2021-08-18 18:58:12 +09:00
Michal Maciola
5f25154ba8 common: meson.build added default_options cpp_std=gnu++14 2021-08-09 18:08:38 +09:00
Hermet Park
4b54d7fcb6 infra: just released v0.4.0 2021-08-09 15:21:32 +09:00
Hermet Park
ae8120bb29 infra: fix missing tvg -> tvg_beta tag.
breakage was introduced by 6ad1b1bf73
2021-08-09 12:57:00 +09:00
Hermet Park
148b4fbfe0 infra: updated meson summary. 2021-08-04 19:58:15 +09:00
Hermet Park
a042e771e4
tvg_format: force to check for compatibility by version comparision.
tvg file stores the version info of thorvg when it's generated,
in order to compare it with the runtime thorvg version when it's loaded.

For this, thorvg builds up the current version of symbol on the initilaization step,
that can be referred by the tvg loader.
2021-08-04 15:31:06 +09:00
Michal Szczecinski
1acc25b5ac sw_engine common: Added neon version of rasterRGBA32 API.
Changes:
- Added 'neon' vector option in build system
- Introduced neon version of rasterRGBA32 API, which improves
speed of the funciton on ARM cpu's around ~35%
2021-07-28 19:17:23 +09:00
Hermet Park
fe00e54257 tvg_saver: introduce a new module tvg saver
tvg saver is a new module to export tvg files.

In this patch, it also contains the infrastructure of saver module
to expand other types of savers such as png, jpg, etc.

To save the tvg file from a paint, you can use the Saver feature, for example:

auto saver = tvg::Saver::gen();
saver->save(paint, "sample.tvg");
saver->sync();

Later, you can read the "sample.tvg" using Picture.

auto picture = tvg::Picture::gen();
picture->load("sample.tvg");
...

The behavior of the saver will work on sync/async based on the threading setting of the initializer.
Thus if you wish to have a benefit of it, you must call sync() after the save() in the proper delayed time.

Otherwise, you can call sync() immediately.

Note that, the asynchronous tasking is depent on the saver module implementation.
Also, you need to enable tvg saver/loader modules from meson option. (yet this feature is under the beta)

@API Addition:
Result Saver::save(std::unique_ptr<Paint> paint, const std::string& path) noexcept;
Result Saver::sync() noexcept;

@Examples: tvgSaver

@Co-author: Mira Grudzinska <m.grudzinska@samsung.com>
2021-07-21 19:30:15 +09:00
Hermet Park
94eeb92dbe infra: seprate test image resources from the examples.
change for removing dependency.
2021-07-19 14:43:26 +09:00
Hermet Park
90a8c9d197 infra: ++ jpg support meson message 2021-07-07 13:48:27 +09:00
Michal Maciola
0435f29f11 jpg_loader: introduced jpg decode using libjpeg-turbo
This patch introduces a jpg loader.
For decoding the image, libjpeg-turbo library is used. Library was found to be
fast (SIMD instructions accelerated) and portable.

@issue: #517
2021-07-07 13:44:16 +09:00
Hermet Park
8d31496648 infra: print enabled features in the meson summary list.
instead removed individual messages.
2021-07-03 14:58:17 +09:00
Hermet Park
935b8592f1 infra: just released v0.3.0 2021-07-03 13:08:50 +09:00
Hermet Park
5bbe713ca5 infra: add memory sanitize option in meson
for optimial library, we removed some peripheral information in default,
this breaks asan environment.

This patch changes it to make it both.

if you want to use asan, please change the meson option.

default is disabled.

example)
$meson . build -Db_sanitize=address
$meson . build -Db_sanitize=address,undefined
2021-06-23 11:55:52 +09:00
Hermet Park
4795927dc1 fix build break.
regression by - 15b56a66de
2021-06-11 21:04:43 +09:00
Hermet Park
73ea4abf51 infra: just released v0.2.0 2021-06-06 17:36:48 +09:00
Hermet Park
59198d2735 infra: set higher version to try the devel symbols with higher priority than released ones. 2021-06-06 17:12:41 +09:00
Hermet Park
6b7aa8ad9e
tests: introduce catch2 unit tests infrastructure.
Catch2 is a multi-paradigm test framework for C++.
It is primarily distributed as a single header file,
very easy and simple to adopt this to thorvg project.

This patch introduces catch2 infrastsructure and one prototype as a sample.

You can refer "testInitializer.cpp", how to add unit test!
while ignoring else files such as "catch2.hpp", "testMain.cpp"

Also, enable Unit-tests with meson option when you change any thorvg code.

$meson build -Dtests=true.

launch tvgUnitTest in the build result then verify 100% coverage
before submitting any patches.
2021-06-04 16:46:34 +09:00
Hermet Park
bbfbe95ecc test: remove gtest & its infra.
thorvg is going to use catch2 framework, this is a cleanup work
before introducing catch2 utc.

See Catch2:
https://github.com/catchorg/Catch2/tree/v2.x
2021-06-03 17:38:07 +09:00
Hermet Park
9e725226da
meson: revise png loader meson script.
We hate spagettie code, not even build script.
this revise it to keep the build script consistency.
2021-04-02 12:49:18 +09:00
Mateusz Palkowski
832568e07a Added libpng based png loading 2021-04-01 19:38:00 +09:00
Hermet Park
cee1348a44 svg_loader XmlParser: code refactoring.
just renamed _nodeTypeToString() -> xmlParserNodeTypeToString()

+ print meson message if log is enabled.
2020-12-17 16:11:09 +09:00
JunsuChoi
54816339ed svg_loader XmlParser: Print unsupported elements, attribute with log option
* Using printf is temporary. We are planning a proper way to print the log.
When parsing a Svg file, Loader print unsupported elements and attributes.
2020-12-15 14:07:38 +09:00
JunsuChoi
e00f948705
raw_loader Loader: Introduce Raw image loader
Add RawLoader class that loads and display raw images,
and adds a Rasterizer for image data.
Image data can be loaded via picture.
Loaded image supports Composition, Transformation and Alpha blending.

New API
Result load(uint32_t* data, uint32_t width, uint32_t height, bool isCopy) noexcept;
2020-11-23 18:12:36 +09:00
JunsuChoi
9859a48714 test Canvas: Set up unit test based on gtest.
In test directory, set up unit_test based on gtest
First, add a test for SwCanvas generate.
2020-11-02 14:15:50 +09:00
Hermet Park
729fee5a23 examples: move tests to src/examples
tests is now officially placed in src/examples,
default is turned off, only necessaries turn it on.

ex) meson . build -Dexamples=true

+ this examples are required efl 'elementary' package.
2020-09-19 00:39:25 +09:00
Hermet Park
9893af979f replace license from Apache 2.0 to MIT
Change-Id: I61f7cb2b0e407bc035f3b2ec7da9b7f230057e24
2020-08-13 16:53:38 +09:00
Hermet Park
9876d685cf capi: support c interfaces
this capi is under the beta,
we quickly provide this working prototype for collaboration.

Change-Id: Ie246abc306feb9a1305d1b593c4f3ef7f40ab5a9
2020-07-15 16:00:09 +09:00
Hermet Park
9e1ba8d2c0 sw_engine: introduce avx simd instruction
avx is the cutting edge method for intel & amd cpus simd instruction.
We are going to support this feature for the desktop environment (instead of sse)

You can turn on this with configuration something like this:

$meson . build -Dvectors=avx

Current patch supports only for raster solid color

Change-Id: I068ba30a1f63d480415e2762f8021fc8d6d28a39
2020-07-11 20:58:09 +09:00
Hermet Park
99428ee80a build: support features toggling in meson option.
Change-Id: Id1ebda70fe8380aaa913f79af26e5c39893a6df5
2020-07-08 15:30:12 +09:00
Hermet Park
84af527a27 build: refactoring meson script.
move out engine/loader dependency to its immediate parent folders.

Change-Id: I7f08433fc6d2a333951fceaffea81cbe2e5da9e3
2020-07-08 10:56:44 +09:00
Hermet Park
e2fc353846 build: refactoriong meson script.
move gl dependency to gl_engine part which is right position.

Change-Id: I9d4935f94eff96ca1527762c92d07f9b216f19cd
2020-07-08 10:47:04 +09:00
Hermet Park
56e866dd36 renamed project name tizenvg => thorvg
we're going to open this project as the independent one,

thus removed tizen naming here.

Change-Id: Ib3c898067dd9186e893f7cb0903fd70d2ce7b31f
2020-06-25 13:57:41 +09:00
Hermet Park
86300c5fc0 sw_engine: optimize raster.
memset() is more than 10x faster than manual loop.

Thus we replace it to manipulate buffer pixels.

Change-Id: If0f255578f7d49ff6704c4f15e2eefe435cc3c15
2020-06-23 16:55:06 +09:00
Hermet Park
fe9c2c9162 common shape: implement appendCircle body.
Change-Id: Ib8507366f84532db3119f04c8d55e0d4e8206f9f
2020-04-26 11:38:06 +09:00
Hermet Park
c20274aaf8 + Initial draft
Introduce project skeleton such as build envrionment and interfaces
to build up code further cooperatively.

Change-Id: Ie9ac38991f609d33637283134906d7cc3f2ac19e
2020-03-25 11:53:03 +09:00