Michal Maciola
23db42e41c
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
2021-07-15 09:24:13 +09:00
Michal Maciola
a8e13ed2b7
test: svg rendering
...
Added SVG file loading and rendering for increasing TC Line coverage
Line coverage for src/loaders/svg: 85.5%
2021-07-14 23:24:40 +09:00
Michal Maciola
9b276cc5fa
test capi: scene added negative tests
2021-07-14 23:22:09 +09:00
Michal Maciola
1c30bb391f
example: logo_test.svg ( #617 )
...
Manually created svg with edited logo.svg that test most of the svg tags
and attributes
2021-07-14 13:57:32 +02:00
Michal Maciola
dc516df9d8
capi binding: added missing null paint check ( #616 )
2021-07-14 12:19:42 +02:00
Michal Maciola
30a3d442b9
svg_loader: image tag: fixed utf8 decode
...
Fixed svgUtilURLDecode function.
Deleted snippet was not needed and it broken decoding when space.
2021-07-14 10:08:15 +09:00
Michal Maciola
8e1d8b0cb2
svg_loader: race condition on arc processing
...
Unneeded static keyword in _pathAppendArcTo function led to race
conditioning
@issue: #604
2021-07-13 22:23:02 +09:00
JunsuChoi
233045f796
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.
2021-07-12 16:43:44 +09:00
JunsuChoi
bbc0fbb130
svg_loader SvgUtil: Move nullcheck to before use
...
prevent invalid access
2021-07-12 13:37:42 +09:00
JunsuChoi
333cac8d9d
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)
2021-07-12 12:35:42 +09:00
JunsuChoi
f9d82c2c28
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.
2021-07-12 11:21:05 +09:00
Hermet Park
99c37d01cc
Update README.md
2021-07-11 11:37:28 +09:00
Hermet Park
f1db784d87
Update LICENSE
2021-07-11 11:34:59 +09:00
Hermet Park
1238ea242d
Update AUTHORS
2021-07-11 11:33:43 +09:00
Hermet Park
26128807e1
commong shape: --sanitizer report
...
null pointer passed as argument 2, which is declared to never be null
2021-07-10 23:48:17 +09:00
Hermet Park
c9a083abce
Update CONTRIBUTING.md
2021-07-10 00:34:57 +09:00
Hermet Park
aa1a43e3a2
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.
2021-07-09 21:15:59 +09:00
Michal Maciola
cc71ff43e5
example svg: 'image-embeded.svg' added fix #2
...
Chenaged indent to tabs
2021-07-09 17:44:00 +09:00
Michal Maciola
9ea99e90e2
example svg: 'image-embeded.svg' added fix #1
...
Added png image with composition applied
2021-07-09 17:44:00 +09:00
Michal Maciola
f0815934d8
example svg: 'image-embeded.svg' added
2021-07-09 17:44:00 +09:00
Hermet Park
0d71a74de5
jpg_loader: change source file mode 664
2021-07-09 16:53:08 +09:00
JunsuChoi
91cf75ff04
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.
2021-07-09 16:50:45 +09:00
Michal Maciola
31f45fbd5f
svg_loader: <image> tag introduced fix #9
...
Fixed Base64 and utf8 for new line and whitespace
Changed tvgSvgLoaderCommon.h to single line convention
2021-07-09 12:04:29 +09:00
Michal Maciola
28342c5c1f
svg_loader: <image> tag introduced fix #8
...
Disable embedded svg files to protect against recursive svg image loading
2021-07-09 12:04:29 +09:00
Michal Maciola
48bc30e70a
svg_loader: <image> tag introduced fix #7
...
fixed auto and new lines in tvgSvgUtil.cpp
2021-07-09 12:04:29 +09:00
Michal Maciola
1f67c1d689
svg_loader: <image> tag introduced fix #6
...
Moved file:// removing into _imageBuildHelper
2021-07-09 12:04:29 +09:00
Michal Maciola
3e4512a9a6
svg_loader: <image> tag introduced fix #5
...
Added copyAttr for image
2021-07-09 12:04:29 +09:00
Michal Maciola
e01f29270a
svg_loader: <image> tag introduced fix #4
...
fixed mistyped vw to w and vh to h
2021-07-09 12:04:29 +09:00
Michal Maciola
d69805c668
svg_loader: <image> tag introduced fix #3
...
Added working composition
2021-07-09 12:04:29 +09:00
Michal Maciola
c35f7e1f64
svg_loader: <image> tag introduced fix #2
...
Removed #ifdef from tvgSvgSceneBuilder.cpp
2021-07-09 12:04:29 +09:00
Michal Maciola
9c1af3dde5
svg_loader: <image> tag introduced fix #1
...
Fixed href string deleting
2021-07-09 12:04:29 +09:00
Michal Maciola
80fa97d366
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
2021-07-09 12:04:29 +09:00
Hermet Park
af140a1fe5
svg_loader: fix gradient memory leak.
...
@Issue: https://github.com/Samsung/thorvg/issues/548
2021-07-09 11:58:44 +09:00
Hermet Park
3997aedcd5
svg_loader: optimize memory usage.
...
-- unnecessary memory fragmentation.
2021-07-09 11:58:44 +09:00
Michal Maciola
957ad5d017
example: PictureJpg.cpp
...
Created an example for testing jpg loading
2021-07-08 23:17:05 +09:00
Hermet Park
7bf6f97691
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
2021-07-08 20:29:31 +09:00
Hermet Park
30f4beacf5
test capi: complement scene test cases.
2021-07-08 18:41:04 +09:00
jykeon
60b9bc136c
tests capi: Add capi Scene TC.
2021-07-08 17:35:19 +09:00
Michal Maciola
bb19bcf64f
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
2021-07-07 15:34:15 +09:00
Hermet Park
90a8c9d197
infra: ++ jpg support meson message
2021-07-07 13:48:27 +09:00
Michal Maciola
eddbb4d71d
jpg_loader: introduced jpg decode using libjpeg-turbo fix #1
...
Added bool open(const char* data, uint32_t size, bool copy);
2021-07-07 13:44:16 +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
JunsuChoi
ea3d79f5f3
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
2021-07-07 09:48:46 +09:00
Michal Maciola
1e1f232016
png_loader: added open from memory
...
Added PngLoader::open(const char* data, uint32_t size, bool copy)
Changed variables visibility to private
2021-07-06 18:32:08 +09:00
Mira Grudzinska
1507438ecc
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.
2021-07-06 10:13:58 +02:00
Mira Grudzinska
fff5bfee83
svg_loader: set the higher priority of style attributes
...
issue #515
2021-07-06 10:13:58 +02:00
Hermet Park
ca86907739
common: code refactoring.
...
remove unnecessary comments,
its field name is enough descriptive. (It has to be!)
2021-07-06 11:13:54 +09:00
Mira Grudzinska
795e520404
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.
2021-07-06 11:07:10 +09:00
Hermet Park
925b9c8ba9
sw_engine fill: correct the range of opacity,
...
also some minor code refactors.
2021-07-06 10:44:56 +09:00
Michal Maciola
7a8d7ceac6
svg_loader: fix dead loop on none digit char in stroke-dasharray fix #3
...
Added zero and negative value protection
2021-07-06 10:39:34 +09:00