platform/core/graphics/tizenvg.git
2 years agotvg_saver: fix the invalid data size. accepted/tizen/unified/20210727.124506 submit/tizen/20210726.072959
Hermet Park [Mon, 26 Jul 2021 07:12:23 +0000 (16:12 +0900)]
tvg_saver: fix the invalid data size.

sizeof(colors) indicates its pointer size, we actually intended to the structure size.

Change-Id: I007dbc615a9f241e009a513b401de32232aee64a

2 years agotvg_saver: +exception handling
Hermet Park [Mon, 26 Jul 2021 07:17:06 +0000 (16:17 +0900)]
tvg_saver: +exception handling

close the file handle before returning the function.

Change-Id: I9da706184669a42ad1ef27747b3909aa0462ab32

2 years agotvg_saver: removing saving the default values
Mira Grudzinska [Thu, 22 Jul 2021 20:02:28 +0000 (22:02 +0200)]
tvg_saver: removing saving the default values

The default values (stroke cap/join, fill rule/spread or color with alpha = 0)
were unnecessarily saved in the tvg format file.

Change-Id: If26778e7759d3aca11c1423bad2ed360cfd3d512

2 years agodoc: ++ MemPool docs
Mira Grudzinska [Fri, 23 Jul 2021 10:33:00 +0000 (12:33 +0200)]
doc: ++ MemPool docs

Change-Id: Ic0230e663172754eb5d1f2c02a6f2f97d334c245

2 years agoMerge "replace the logging system with dlog in tizen" into tizen
Hermet Park [Mon, 26 Jul 2021 06:56:03 +0000 (06:56 +0000)]
Merge "replace the logging system with dlog in tizen" into tizen

2 years agoMerge "enable tvg format in tizen" into tizen
Hermet Park [Mon, 26 Jul 2021 06:55:42 +0000 (06:55 +0000)]
Merge "enable tvg format in tizen" into tizen

2 years agobump up version 0.3.2 75/261775/1
Hermet Park [Mon, 26 Jul 2021 06:52:53 +0000 (15:52 +0900)]
bump up version 0.3.2

Change-Id: I030cd8faa7cb2d2673bcb4edacf339f0345cd474

2 years agoenable tvg format in tizen 74/261774/1
Hermet Park [Mon, 26 Jul 2021 06:46:07 +0000 (15:46 +0900)]
enable tvg format in tizen

Change-Id: I3088ca5d8dfdb39647b4cb3a63e100c82177dcd2

2 years agoreplace the logging system with dlog in tizen 72/261772/2
Hermet Park [Mon, 26 Jul 2021 06:41:52 +0000 (15:41 +0900)]
replace the logging system with dlog in tizen

please turn on logging in meson_option when it's necessary.

Change-Id: Ib2483184697c344f196fc1ff2253309c9215239f

2 years agosw_engine: removed unused rleAlphaMask
Michal Maciola [Fri, 23 Jul 2021 12:27:39 +0000 (14:27 +0200)]
sw_engine: removed unused rleAlphaMask

2 years agocommon log: use the log macro to replace the print method easier.
Hermet Park [Fri, 23 Jul 2021 03:05:53 +0000 (12:05 +0900)]
common log: use the log macro to replace the print method easier.

We can replace the system logger method by changing single line print source in common,
This also helps to remove the THORVG_LOG_ENABLED macro from each use-cases.

TVGLOG(): To print the hint & tip messages for users.
TVGERR(): To print the error message for debugging.

@Issues: https://github.com/Samsung/thorvg/issues/36

2 years agosvg_loader: code refactoring.
Hermet Park [Fri, 23 Jul 2021 05:46:31 +0000 (14:46 +0900)]
svg_loader: code refactoring.

clean up about logging before replacing it with TVGLOG()

3 years agodoc: improved Saver documentation.
Hermet Park [Thu, 22 Jul 2021 04:10:30 +0000 (13:10 +0900)]
doc: improved Saver documentation.

3 years agoapis: promote beta apis to the official ones.
Hermet Park [Thu, 22 Jul 2021 04:00:59 +0000 (13:00 +0900)]
apis: promote beta apis to the official ones.

3 api candidates has been verified since it's tagged in beta,
we confirm that they are useful for tvg usages.

Here list shows the candidates apis:

@API Addition:

Matrix Paint::transform() noexcept;
CompositeMethod Paint::composite(const Paint** target) const noexcept;
Result SwCanvas::mempool(MempoolPolicy policy) noexcept;

3 years agocommon: style fixes (#644)
Michal Maciola [Thu, 22 Jul 2021 11:35:26 +0000 (13:35 +0200)]
common: style fixes (#644)

3 years agocommon: code refactoring.
Hermet Park [Thu, 22 Jul 2021 08:19:22 +0000 (17:19 +0900)]
common: code refactoring.

renamed loader classes same to Saver classes

tvgLoaderMgr -> tvgLoader (tvgSaver)
tvgLoader -> tvgLoadModule (tvgSaveModule)

3 years agoexamples: replace sprintf() with snprintf()
Hermet Park [Thu, 22 Jul 2021 05:19:12 +0000 (14:19 +0900)]
examples: replace sprintf() with snprintf()

snprintf() is more preferred to use in preventing buffer overflow.

3 years agoinfra: add tvg saver in build test
Hermet Park [Thu, 22 Jul 2021 02:54:49 +0000 (11:54 +0900)]
infra: add tvg saver in build test

3 years agotvg_saver: introduce a new module tvg saver
Hermet Park [Wed, 21 Jul 2021 08:31:42 +0000 (17:31 +0900)]
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>

3 years agotvg format: code refactoring #10
Hermet Park [Wed, 21 Jul 2021 04:56:50 +0000 (13:56 +0900)]
tvg format: code refactoring #10

keep neat & clean code,
revise to tvg style naming convention.

3 years agosvg_loader: allow both clipPath and mask together (#622)
Michal Maciola [Wed, 21 Jul 2021 03:12:09 +0000 (05:12 +0200)]
svg_loader: allow both clipPath and mask together (#622)

* svg_loader: allow both clipPath and mask together

* svg_loader: allow both clipPath and mask together fix #1

Changed seperate functions _applyClipPathComposition and _applyMaskComposition into single function _applyComposition

3 years agotvg format: code refactoring #9
Hermet Park [Wed, 21 Jul 2021 02:14:11 +0000 (11:14 +0900)]
tvg format: code refactoring #9

revise format of the macro names, no logical changes.
++ comments for maintenence.

3 years agotvg format: code refactoring #8
Hermet Park [Tue, 20 Jul 2021 11:03:45 +0000 (20:03 +0900)]
tvg format: code refactoring #8

Hide iterator APIs, simplify it as much as it's necessary.

3 years agotvg format: code refactoring #7
Hermet Park [Tue, 20 Jul 2021 06:48:15 +0000 (15:48 +0900)]
tvg format: code refactoring #7

remove return type values.

3 years agotvg format: code refactoring #6
Hermet Park [Tue, 20 Jul 2021 06:39:29 +0000 (15:39 +0900)]
tvg format: code refactoring #6

++ neat & clean code

3 years agotvg format: code refactoring #5
Hermet Park [Tue, 20 Jul 2021 05:33:11 +0000 (14:33 +0900)]
tvg format: code refactoring #5

replace from ofstream to FILE

We know both have the same purpose, we always prefer the less binary size.

So... this brings the binary size reduction.

1918496 => 1913528

3 years agoexamples: split Tvg to TvgSaver, PictureTvg
Hermet Park [Tue, 20 Jul 2021 04:53:17 +0000 (13:53 +0900)]
examples: split Tvg to TvgSaver, PictureTvg

We'd like to clearly split showcases TvgSaver & Picture.

3 years agoexamples: sort file list alphabetical.
Hermet Park [Tue, 20 Jul 2021 04:42:10 +0000 (13:42 +0900)]
examples: sort file list alphabetical.

3 years agotvg_saver: Tvg.cpp example modyfied
Mira Grudzinska [Mon, 19 Jul 2021 11:03:37 +0000 (13:03 +0200)]
tvg_saver: Tvg.cpp example modyfied

Previously the 'test.tvg' file was loaded from the EXAMPLE_DIR.
Now the 'test.tvg' file is created using the tvg saver module
(if in the EXAMPLE_DIR is alread a 'test.tvg' file, it is overwriten)
and then it's loaded using the tvg loader module.

3 years agotvg format: code refactoring #4
Hermet Park [Tue, 20 Jul 2021 04:33:44 +0000 (13:33 +0900)]
tvg format: code refactoring #4

Remove an unnecessary internal reference.

3 years agotvg format: code refactoring #3
Hermet Park [Tue, 20 Jul 2021 04:31:25 +0000 (13:31 +0900)]
tvg format: code refactoring #3

use the Array function instead of own implementation.

3 years agotvg format: code refactoring #2
Hermet Park [Tue, 20 Jul 2021 03:53:16 +0000 (12:53 +0900)]
tvg format: code refactoring #2

code clean up, removed reserved data sector

3 years agocommon saver: change to instance based for future sync/async behavior.
Hermet Park [Mon, 19 Jul 2021 11:32:31 +0000 (20:32 +0900)]
common saver: change to instance based for future sync/async behavior.

reserve sync() method TODO

3 years agocommon: code refactoring
Hermet Park [Mon, 19 Jul 2021 11:07:58 +0000 (20:07 +0900)]
common: code refactoring

unify tvg class identifiers

3 years agotvg_saver: implementation of the Saver class
Mira Grudzinska [Mon, 19 Jul 2021 08:31:36 +0000 (10:31 +0200)]
tvg_saver: implementation of the Saver class

The Saver class enables to save any Paint object (Scene, Shape, Picture)
in a binary file. To read the file the tvg loader should be used.
To save a paint a new API was introduced - tvg::Saver::save.

3 years agocommon: introducing basic iterators functionality
Mira Grudzinska [Mon, 19 Jul 2021 08:28:14 +0000 (10:28 +0200)]
common: introducing basic iterators functionality

The introduced Iterator class enables to access the children nodes
of a given Paint.

3 years agosw_engine renderer: code refactoring
Hermet Park [Mon, 19 Jul 2021 07:26:27 +0000 (16:26 +0900)]
sw_engine renderer: code refactoring

+ trivial changes while reading the code.

3 years agojpg_loader: code refactoring
Hermet Park [Mon, 19 Jul 2021 06:06:44 +0000 (15:06 +0900)]
jpg_loader: code refactoring

remove unnecessary member variables.

3 years agosw_engine: preventing a double application of the opacity (#540)
Mira Grudzinska [Mon, 19 Jul 2021 07:02:10 +0000 (09:02 +0200)]
sw_engine: preventing a double application of the opacity (#540)

For filled and stroked shapes with a gradient, the opacity
was applied during the composition and during the ctable update.
To prevent this, in case the composition occured, ctable
is updated with the opacity = 255.

3 years agojpg_loader: decompress header on opening
Michal Maciola [Mon, 19 Jul 2021 05:55:23 +0000 (07:55 +0200)]
jpg_loader: decompress header on opening

3 years agoinfra: seprate test image resources from the examples.
Hermet Park [Mon, 19 Jul 2021 05:31:18 +0000 (14:31 +0900)]
infra: seprate test image resources from the examples.

change for removing dependency.

3 years agobump up version 0.3.1 34/261434/1 accepted/tizen/unified/20210720.123509 submit/tizen/20210719.032106
Hermet Park [Mon, 19 Jul 2021 03:06:47 +0000 (12:06 +0900)]
bump up version 0.3.1

Change-Id: Id0aee760027f288fbfe547d974e4241aa500e40b

3 years agosvg_loader: image tag: force size equal to the viewbox (#603)
Michal Maciola [Fri, 16 Jul 2021 00:48:35 +0000 (02:48 +0200)]
svg_loader: image tag: force size equal to the viewbox (#603)

* svg_loader: image tag: force size equal to the viewbox

For some svg files it is needed to force size equal the viewbox
for proper scaling

* svg_loader: image tag: force size equal to the viewbox fix #1

Change-Id: I480e832b1f5a184ef0ef6ee597a320d5bbf7b508

3 years agotest: testPicture added .jpg and .png loading tests
Michal Maciola [Wed, 14 Jul 2021 07:50:15 +0000 (09:50 +0200)]
test: testPicture added .jpg and .png loading tests

3 years agotest capi: added missing canvas, paint and shape tests
Michal Maciola [Thu, 15 Jul 2021 15:34:54 +0000 (17:34 +0200)]
test capi: added missing canvas, paint and shape tests

Added tests for tvg_canvas_reserve, tvg_canvas_update_paint, tvg_paint_duplicate, tvg_paint_set_composite_method, tvg_shape_cubic_to, tvg_shape_close

3 years agotest capi: Stroke Radial Gradient
Michal Maciola [Thu, 15 Jul 2021 15:32:41 +0000 (17:32 +0200)]
test capi: Stroke Radial Gradient

Added tvg_shape_get_gradient

3 years agotest: render jpg and png files
Michal Maciola [Thu, 15 Jul 2021 09:13:20 +0000 (11:13 +0200)]
test: render jpg and png files

3 years agotest capi: Stroke Linear Gradient fix #2
Michal Maciola [Wed, 14 Jul 2021 14:32:43 +0000 (16:32 +0200)]
test capi: Stroke Linear Gradient fix #2

3 years agotest capi: Stroke Linear Gradient fix #1
Michal Maciola [Wed, 14 Jul 2021 08:40:40 +0000 (10:40 +0200)]
test capi: Stroke Linear Gradient fix #1

Added tvg_shape_get_gradient

3 years agotest capi: Stroke Linear Gradient
Michal Maciola [Wed, 14 Jul 2021 07:38:34 +0000 (09:38 +0200)]
test capi: Stroke Linear Gradient

3 years agogithub actions: added tvg and jpg loaders (#613)
Michal Maciola [Thu, 15 Jul 2021 00:24:13 +0000 (02:24 +0200)]
github actions: added tvg and jpg loaders (#613)

* github actions: added tvg and jpg loaders

* github actions: added tvg and jpg loaders fix #1

Added install libturbojpeg

3 years agotest: svg rendering
Michal Maciola [Wed, 14 Jul 2021 09:27:19 +0000 (11:27 +0200)]
test: svg rendering

Added SVG file loading and rendering for increasing TC Line coverage
Line coverage for src/loaders/svg: 85.5%

3 years agotest capi: scene added negative tests
Michal Maciola [Wed, 14 Jul 2021 09:59:50 +0000 (11:59 +0200)]
test capi: scene added negative tests

3 years agoexample: logo_test.svg (#617)
Michal Maciola [Wed, 14 Jul 2021 11:57:32 +0000 (13:57 +0200)]
example: logo_test.svg (#617)

Manually created svg with edited logo.svg that test most of the svg tags
and attributes

3 years agocapi binding: added missing null paint check (#616)
Michal Maciola [Wed, 14 Jul 2021 10:19:42 +0000 (12:19 +0200)]
capi binding: added missing null paint check (#616)

3 years agosvg_loader: image tag: fixed utf8 decode
Michal Maciola [Tue, 13 Jul 2021 09:26:15 +0000 (11:26 +0200)]
svg_loader: image tag: fixed utf8 decode

Fixed svgUtilURLDecode function.
Deleted snippet was not needed and it broken decoding when space.

Change-Id: I1f14ff60c10f8c73006c7ab4fc6bf0b0f945d02e

3 years agosvg_loader: race condition on arc processing
Michal Maciola [Tue, 13 Jul 2021 12:28:52 +0000 (14:28 +0200)]
svg_loader: race condition on arc processing

Unneeded static keyword in _pathAppendArcTo function led to race
conditioning
@issue: #604

Change-Id: I1741b56f6cf210b7709f513aceb657840851b3bf

3 years agosvg_loader SvgPath: Skip invalid path
JunsuChoi [Mon, 12 Jul 2021 02:55:33 +0000 (11:55 +0900)]
svg_loader SvgPath: Skip invalid path

If the d attribute of SVG path is not parsed through _nextCommand(),
it is regarded as an invalid data.

3 years agoMerge "bump up version v0.3.0" into tizen accepted/tizen/unified/20210713.124127 submit/tizen/20210712.055754
Hermet Park [Mon, 12 Jul 2021 04:47:10 +0000 (04:47 +0000)]
Merge "bump up version v0.3.0" into tizen

3 years agosvg_loader SvgUtil: Move nullcheck to before use
JunsuChoi [Mon, 12 Jul 2021 04:26:32 +0000 (13:26 +0900)]
svg_loader SvgUtil: Move nullcheck to before use

prevent invalid access

3 years agosvg_loader SvgLoader: Initialize to flag value of SvgParser
JunsuChoi [Mon, 12 Jul 2021 00:57:48 +0000 (09:57 +0900)]
svg_loader SvgLoader: Initialize to flag value of SvgParser

This patch fixes valgrind detection

$valgrind --leak-check=yes ./Svg

==21410== Conditional jump or move depends on uninitialised value(s)
==21410== at 0x505DB66: _attrParseStops(void*, char const*, char const*) (tvgSvgLoader.cpp:2099)
==21410== by 0x5064F6D: simpleXmlParseAttributes(char const*, unsigned int, bool ()(void, char const*, char const*), void const*) (tvgXmlParser.cpp:319)
==21410== by 0x5061774: _svgLoaderParserXmlOpen(SvgLoaderData*, char const*, unsigned int, bool) (tvgSvgLoader.cpp:2387)
==21410== by 0x5061857: _svgLoaderParser(void*, SimpleXMLType, char const*, unsigned int) (tvgSvgLoader.cpp:2408)
==21410== by 0x5065052: simpleXmlParse(char const*, unsigned int, bool, bool ()(void, SimpleXMLType, char const*, unsigned int), void const*) (tvgXmlParser.cpp:425)
==21410== by 0x5061993: SvgLoader::run(unsigned int) (tvgSvgLoader.cpp:2757)
==21410== by 0x5052F5E: operator() (tvgTaskScheduler.h:68)
==21410== by 0x5052F5E: tvg::TaskSchedulerImpl::run(unsigned int) (tvgTaskScheduler.cpp:138)
==21410== by 0x62C36DE: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25)
==21410== by 0x6DA36DA: start_thread (pthread_create.c:463)
==21410== by 0x68C871E: clone (clone.S:95)

3 years agosvg_loader SvgLoader: Fix memory leak of duplicate declared id
JunsuChoi [Mon, 12 Jul 2021 01:14:51 +0000 (10:14 +0900)]
svg_loader SvgLoader: Fix memory leak of duplicate declared id

Duplicate declaration of id attribute is invaild.
We do not have a separate policy for invalid svg files.
Therefore, it is a priority to prevent crashes or memory leaks.
If an id is declared as duplicate, the last declared id is used.

3 years agobump up version v0.3.0 98/261098/1
Hermet Park [Mon, 12 Jul 2021 03:34:10 +0000 (12:34 +0900)]
bump up version v0.3.0

Change-Id: I14dee32b383a9af4e4a334df4b88a9767d210ad6

3 years agoUpdate README.md
Hermet Park [Sun, 11 Jul 2021 02:37:28 +0000 (11:37 +0900)]
Update README.md

3 years agoUpdate LICENSE
Hermet Park [Sun, 11 Jul 2021 02:34:59 +0000 (11:34 +0900)]
Update LICENSE

3 years agoUpdate AUTHORS
Hermet Park [Sun, 11 Jul 2021 02:33:43 +0000 (11:33 +0900)]
Update AUTHORS

3 years agocommong shape: --sanitizer report
Hermet Park [Sat, 10 Jul 2021 14:48:17 +0000 (23:48 +0900)]
commong shape: --sanitizer report

null pointer passed as argument 2, which is declared to never be null

3 years agoUpdate CONTRIBUTING.md
Hermet Park [Fri, 9 Jul 2021 15:34:57 +0000 (00:34 +0900)]
Update CONTRIBUTING.md

3 years agojpg_loader: code refactoring
Hermet Park [Fri, 9 Jul 2021 08:37:58 +0000 (17:37 +0900)]
jpg_loader: code refactoring

keep it clean and neat code add some TODO comments for the future tasks.

This also fixes potential data memory leak.

3 years agoexample svg: 'image-embeded.svg' added fix #2
Michal Maciola [Thu, 1 Jul 2021 08:53:06 +0000 (10:53 +0200)]
example svg: 'image-embeded.svg' added fix #2

Chenaged indent to tabs

3 years agoexample svg: 'image-embeded.svg' added fix #1
Michal Maciola [Thu, 1 Jul 2021 08:44:15 +0000 (10:44 +0200)]
example svg: 'image-embeded.svg' added fix #1

Added png image with composition applied

3 years agoexample svg: 'image-embeded.svg' added
Michal Maciola [Thu, 1 Jul 2021 08:03:32 +0000 (10:03 +0200)]
example svg: 'image-embeded.svg' added

3 years agojpg_loader: change source file mode 664
Hermet Park [Fri, 9 Jul 2021 07:53:08 +0000 (16:53 +0900)]
jpg_loader: change source file mode 664

3 years agojpg_loader JpgLoader: Prevent memory leak
JunsuChoi [Fri, 9 Jul 2021 04:22:43 +0000 (13:22 +0900)]
jpg_loader JpgLoader: Prevent memory leak

If the copied data in JpgLoader's data open is invalid,
it is processed without being cleared.
Therefore, data memory free is handled in the destructor.

3 years agosvg_loader: <image> tag introduced fix #9
Michal Maciola [Thu, 8 Jul 2021 08:49:21 +0000 (10:49 +0200)]
svg_loader: <image> tag introduced fix #9

Fixed Base64 and utf8 for new line and whitespace
Changed tvgSvgLoaderCommon.h to single line convention

3 years agosvg_loader: <image> tag introduced fix #8
Michal Maciola [Tue, 6 Jul 2021 09:33:44 +0000 (11:33 +0200)]
svg_loader: <image> tag introduced fix #8

Disable embedded svg files to protect against recursive svg image loading

3 years agosvg_loader: <image> tag introduced fix #7
Michal Maciola [Mon, 5 Jul 2021 07:12:40 +0000 (09:12 +0200)]
svg_loader: <image> tag introduced fix #7

fixed auto and new lines in tvgSvgUtil.cpp

3 years agosvg_loader: <image> tag introduced fix #6
Michal Maciola [Fri, 2 Jul 2021 11:05:10 +0000 (13:05 +0200)]
svg_loader: <image> tag introduced fix #6

Moved file:// removing into _imageBuildHelper

3 years agosvg_loader: <image> tag introduced fix #5
Michal Maciola [Fri, 2 Jul 2021 09:22:26 +0000 (11:22 +0200)]
svg_loader: <image> tag introduced fix #5

Added copyAttr for image

3 years agosvg_loader: <image> tag introduced fix #4
Michal Maciola [Thu, 1 Jul 2021 08:59:44 +0000 (10:59 +0200)]
svg_loader: <image> tag introduced fix #4

fixed mistyped vw to w and vh to h

3 years agosvg_loader: <image> tag introduced fix #3
Michal Maciola [Thu, 1 Jul 2021 08:42:17 +0000 (10:42 +0200)]
svg_loader: <image> tag introduced fix #3

Added working composition

3 years agosvg_loader: <image> tag introduced fix #2
Michal Maciola [Thu, 1 Jul 2021 08:08:12 +0000 (10:08 +0200)]
svg_loader: <image> tag introduced fix #2

Removed #ifdef from tvgSvgSceneBuilder.cpp

3 years agosvg_loader: <image> tag introduced fix #1
Michal Maciola [Thu, 1 Jul 2021 07:59:36 +0000 (09:59 +0200)]
svg_loader: <image> tag introduced fix #1

Fixed href string deleting

3 years agosvg_loader: <image> tag introduced
Michal Maciola [Wed, 30 Jun 2021 17:08:38 +0000 (19:08 +0200)]
svg_loader: <image> tag introduced

This patch introduces embeded <image> tag for svg files.
Images can be now loaded from local path or using data URI Scheme (RFC2397).
Base64 and utf8/uri are welcome.

@issue: #518

3 years agosvg_loader: fix gradient memory leak.
Hermet Park [Thu, 8 Jul 2021 11:05:24 +0000 (20:05 +0900)]
svg_loader: fix gradient memory leak.

@Issue: https://github.com/Samsung/thorvg/issues/548

3 years agosvg_loader: optimize memory usage.
Hermet Park [Thu, 8 Jul 2021 10:25:50 +0000 (19:25 +0900)]
svg_loader: optimize memory usage.

-- unnecessary memory fragmentation.

3 years agoexample: PictureJpg.cpp
Michal Maciola [Thu, 8 Jul 2021 13:50:21 +0000 (15:50 +0200)]
example: PictureJpg.cpp

Created an example for testing jpg loading

3 years agosw_engine renderer: fix memory leak.
Hermet Park [Thu, 8 Jul 2021 11:20:49 +0000 (20:20 +0900)]
sw_engine renderer: fix memory leak.

prepared compositors can be dangled if the rendering is not occured.

free them by doubl-checking in the destructor.

@Issue: https://github.com/Samsung/thorvg/issues/547

3 years agotest capi: complement scene test cases.
Hermet Park [Thu, 8 Jul 2021 08:52:10 +0000 (17:52 +0900)]
test capi: complement scene test cases.

3 years agotests capi: Add capi Scene TC.
jykeon [Fri, 2 Jul 2021 01:20:20 +0000 (10:20 +0900)]
tests capi: Add capi Scene TC.

3 years agosvg_loader: postpone cloneNode()
Michal Maciola [Wed, 7 Jul 2021 06:34:15 +0000 (08:34 +0200)]
svg_loader: postpone cloneNode()

Some svg export software puts <defs> element at the end of the file.
If so, the <defs> element won't be found, when parsing <use>.
In such scenario, this patch postpone node cloning until the whole file
is parsed.

@issue: #568

3 years agoinfra: ++ jpg support meson message
Hermet Park [Wed, 7 Jul 2021 04:48:27 +0000 (13:48 +0900)]
infra: ++ jpg support meson message

3 years agojpg_loader: introduced jpg decode using libjpeg-turbo fix #1
Michal Maciola [Fri, 2 Jul 2021 08:23:13 +0000 (10:23 +0200)]
jpg_loader: introduced jpg decode using libjpeg-turbo fix #1

Added bool open(const char* data, uint32_t size, bool copy);

3 years agojpg_loader: introduced jpg decode using libjpeg-turbo
Michal Maciola [Fri, 2 Jul 2021 07:23:57 +0000 (09:23 +0200)]
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

3 years agosvg_loader: Support percentage unit of dash-array
JunsuChoi [Tue, 6 Jul 2021 01:39:00 +0000 (10:39 +0900)]
svg_loader: Support percentage unit of dash-array

Refers to the diagonal length of the viewport.
https://www.w3.org/TR/SVG2/coords.html#Units

3 years agopng_loader: added open from memory
Michal Maciola [Fri, 2 Jul 2021 12:03:18 +0000 (14:03 +0200)]
png_loader: added open from memory

Added PngLoader::open(const char* data, uint32_t size, bool copy)
Changed variables visibility to private

3 years agosvg_loader: set the priority for the style attribute for stop properties
Mira Grudzinska [Tue, 29 Jun 2021 14:17:41 +0000 (16:17 +0200)]
svg_loader: set the priority for the style attribute for stop properties

Stop properies stop-color and stop-opacity set using a style attribute should
have higher priority than properties set in a different way.

3 years agosvg_loader: set the higher priority of style attributes
Mira Grudzinska [Tue, 29 Jun 2021 12:30:56 +0000 (14:30 +0200)]
svg_loader: set the higher priority of style attributes

issue #515

3 years agocommon: code refactoring.
Hermet Park [Tue, 6 Jul 2021 02:13:16 +0000 (11:13 +0900)]
common: code refactoring.

remove unnecessary comments,
its field name is enough descriptive. (It has to be!)

3 years agotvg_loader: change values of flags
Mira Grudzinska [Thu, 24 Jun 2021 23:11:28 +0000 (01:11 +0200)]
tvg_loader: change values of flags

It's a middle stage leading to removing flags from the tvgBinaryDesc.h file
and use the corresponding enums from the thorvg.h file.