Commit graph

1086 commits

Author SHA1 Message Date
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
Michal Maciola
bf8c633d38 svg_loader: fix dead loop on none digit char in stroke-dasharray fix #2
Moved _skipComma at the begining of the loop
2021-07-06 10:39:34 +09:00
Michal Maciola
2f8c00580d svg_loader: fix dead loop on none digit char in stroke-dasharray 2021-07-06 10:39:34 +09:00
Mira Grudzinska
a40d3f6fd7 sw_engine: stop-opacity value should be interpolated between stops
The opacity value is interpolated as are all color channels.
It's similar to the reverted commit ac95433, but with two slight changes
(alpha_blend was missing in the ctable init and 'a' was used in an if
statement instead of 'a2').
2021-07-06 10:33:02 +09:00
Hermet Park
0d9edfd64c infra: enable capi unit-test in default 2021-07-06 09:43:47 +09:00
Hermet Park
547920d324 test filling: add fill/linear/radial gradients. 2021-07-04 01:44:34 +09:00
Hermet Park
15d6a51527 common linear_gradient: fix to allow zero size linear.
We can't judge zero size gradient is error case.
Non-filled linear is possibly intended by calculation.
2021-07-04 01:36:51 +09:00
Hermet Park
a5d2950902 test capi: code refactoring
use catch Approx functions to compare floating-point values.
2021-07-03 16:51:50 +09:00
Hermet Park
8e2765be39 common picture: fix invalid size returns from raw image.
picture/raw should update the size if the raw image
with size values are entered.
2021-07-03 16:15:57 +09:00
Hermet Park
64b25bb35b test picture: ++ raw data loading. 2021-07-03 16:15:57 +09:00
Hermet Park
009c475fc9 test capi: add Picture unit test 2021-07-03 15:34:43 +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
Michal Maciola
99263d54d1 svg_loader: multiple composition memory leak
Multiple composition are still not supported, but this patch fixes a
memory leak if it is tried to be applied.
2021-07-03 14:14:01 +09:00
Michal Maciola
6a09a8f015 svg_loader: memory leak after improper stop tag fix #1
Updated printf message
2021-07-03 13:50:03 +09:00
Michal Maciola
b005f97bcd svg_loader: memory leak after improper stop tag
<stop> tag should be always a child of a <linearGradient> or
<radialGradient> element, but there were files with <stop> tag inside <rect>.
This patch fixes a memory leak if no gradient is defined before <stop> tag.
2021-07-03 13:50:03 +09:00
Hermet Park
935b8592f1 infra: just released v0.3.0 2021-07-03 13:08:50 +09:00
Hermet Park
10f80fa832 test Picture: add Picture unit tests 2021-07-02 14:02:09 +09:00
Hermet Park
8aa941c4ab common picture: ++exception case.
Fixed load() to return InvalidArgument if the file path is invalid.
2021-07-02 14:01:52 +09:00
JunsuChoi
113ca8b845 svg_loader SvgPath: Added corner case handling for flags of Arc
Moved the if statement to check if it is a float.

This patch is that reverts and fixes the reverted patch 55a5b9.
2021-07-02 12:49:00 +09:00
Hermet Park
1b94ff63ef infra: ++ strict build test
Enable png loader in default.
2021-07-02 12:07:53 +09:00
Hermet Park
3f176b733b common picture: ++ exception case.
size() returns InsufficientCondition if it doesn't have any loaded data.
2021-07-02 12:07:34 +09:00