Commit graph

1253 commits

Author SHA1 Message Date
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
Hermet Park
27cac72d7d
test Shape: add Shape unit tests 2021-07-02 10:38:28 +09:00
Hermet Park
2fd830c940 common shape: allow to reset stroke dash.
user may need to reset stroke dash to off,
now stroke api allows it.
2021-07-02 10:35:46 +09:00
Hermet Park
97302d2983 test scene: revert section usage.
Dismiss this usage for consistency.

Yet we have no practical necessity,
we can apply this to *all test suites later.
2021-07-01 20:41:07 +09:00
Hermet Park
55a5b9492b Revert "svg_loader SvgPath: Added corner case handling for flags of Arc"
This reverts commit 5da4c81138.

Please double-check this regression bug:

examples/images/samsung-galaxy-s.svg
2021-07-01 18:04:25 +09:00
Hermet Park
e74ce7e315 sw_engine: --sanitizer errors
runtime error: load of value 190, which is not a valid value for type 'bool'

@Issue: https://github.com/Samsung/thorvg/issues/544
2021-07-01 17:59:27 +09:00
Hermet Park
480bd8376e common array: -- sanitizer errors
runtime error: null pointer passed as argument 1, which is declared to never be null

@Issue: https://github.com/Samsung/thorvg/issues/543
2021-07-01 17:41:56 +09:00
Hermet Park
e1eabf7dc3 Revert "sw_engine: stop-opacity value should be interpolated between stops"
This reverts commit ac95433b53.

Ahh this breaks examples/images/rg1024_eggs.svg
2021-07-01 17:34:59 +09:00
Hermet Park
397becee46 update CONTRIBUTING 2021-07-01 12:59:20 +09:00
Hermet Park
cf2b0c4620
Update CONTRIBUTING.md 2021-07-01 12:50:09 +09:00
Hermet Park
870948ea32 res: updated images 2021-07-01 12:26:52 +09:00
Mira Grudzinska
f411b5a64c svg_loader: recalculating the default values of grads
The default values of gradient properties were handled differently
than the values given by a user/in an svg file.
2021-07-01 12:15:55 +09:00
Hermet Park
1154986a58 sw_engine: fix broken MSVC compatibility.
error: use of undeclared identifier 'ulong'

@Issue: https://github.com/Samsung/thorvg/issues/541
2021-07-01 12:06:18 +09:00
Mira Grudzinska
ac95433b53 sw_engine: stop-opacity value should be interpolated between stops
The opacity value is interpolated as are all color channels.
2021-06-30 19:32:52 +09:00
Michal Maciola
3086f28b55
svg_loader: allow multiple <defs> tags without data and memory leak (#528)
* svg_loader: allow multiple defs without data and memory leak

If the svg file contained multiple <defs> tags, each subsequent tag
overwritten the previous tag. This resulted in incorrect rendering of the
file and memory leaks.

@Issues: 491

* svg_loader: allow multiple defs without data and memory leak- fix #1

Changed the idea to abandon node creating instead of deleting it after
creation. Removed simpleXmlParseAttributes for _createDefsNode.
2021-06-30 17:21:30 +09:00
Hermet Park
19a3190245 svg_loader: fix a infinite loop error by circular dependency.
Composition can be applied recursively if its children nodes have composition target to this one.
This can be occured by wrong svg description, and tvg prevents this exception case.

@Issue: https://github.com/Samsung/thorvg/issues/494
2021-06-30 16:12:16 +09:00
Hermet Park
bb68a2d514 infra: ++ strict build test
Enable log in default.
2021-06-30 15:18:40 +09:00
Hermet Park
fcbc77bcdf svg_loader: code refactoring
unify to tvg fill rule.
2021-06-30 15:18:14 +09:00
Hermet Park
2c24a1fa5e svg_loader: recover partial code from 3e7888b538
oops, log was not tested in the patch...
2021-06-30 15:12:15 +09:00
Hermet Park
571a1e5caa svg_loader: code refactoring
remove more unused declarations...
2021-06-30 14:54:22 +09:00
Hermet Park
3e7888b538 svg_loader: code refactoring
use color structure to keep neat & compact code.
2021-06-30 14:54:12 +09:00
Hermet Park
8dc5d5204b svg_loader: code refactoring
remove unused declaration.
2021-06-30 13:47:22 +09:00
Hermet Park
6a79d2c06e svg_loader: fix the inifite loop bug when size has 'em' unit.
svg may have 'em' unit for fonts, strtof() must handle this case to not
drop in the infinite loop.

Yet thorvg doesn't support font feature in svg,
it must multiply values with font size if those values have 'em' size.

@Issue: https://github.com/Samsung/thorvg/issues/488
2021-06-30 11:27:31 +09:00
Hermet Park
38fa5107bf sw_engine rle: -- sanitizer reports.
The code is actually intended, we can modify it to ignore the
annoying sanitizer reports.

@Issue: https://github.com/Samsung/thorvg/issues/483
2021-06-29 15:56:11 +09:00
Hermet Park
c31156e737 sw_engine renderer: fix a broken composition bug
tvg sw_engine tries to skip composition as far as its doable,
it tries composition only if the translucent shape with stroking is there.

There has been a condition bug that composition is applied unnecessarily
even if stroking is disabled. This resulted in broken blending
at gradient filling since it applied alpha values multiple times.

Issues:
https://github.com/Samsung/thorvg/issues/445
2021-06-29 14:44:09 +09:00
Mira Grudzinska
feb71ff36c svg_loader: currentColor - inheritance from a parent
The 'currentColor' attribute value was not inherited. Fixed.
2021-06-29 09:27:52 +09:00
Michal Maciola
520d6e7bbd svg_loader: negative attrs length fix
After finding no attributes but white spaces, attrs length could be negative
that resulted in segmentation fault in simpleXmlParseAttributes function.

@Issue: #487
2021-06-28 16:46:26 +09:00
Hermet Park
78bb8d1f2e svg_loader: fix trivial build warnings.
../src/loaders/svg/tvgSvgLoader.cpp: In function ‘void _copyAttr(SvgNode*, const SvgNode*)’:
../src/loaders/svg/tvgSvgLoader.cpp:1598:60: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct SvgStyleProperty’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
     memcpy(to->style, from->style, sizeof(SvgStyleProperty));

@Issue: 498
2021-06-28 13:47:15 +09:00
Mira Grudzinska
57a22b8462 svg_loader: finish the search after founding the proper color
In the _toColor func, after founding the proper color, the search
should be finiched.
2021-06-28 11:32:44 +09:00
Mira Grudzinska
f477933098 svg_loader: applying opacity to the gradient
Before this change the 'stroke-opacity' and the 'fill-opacity'
grad style attributes were not taken into account.
2021-06-28 10:34:14 +09:00
Mira Grudzinska
6eea979dae common: introducing the composite API (getter)
The new API gets the composite method and the pointer to the composite
target of the given paint object.
2021-06-25 22:16:06 +09:00
Mira Grudzinska
96d6b47a64 common: PaintType enum changed to identifier in Paint class
The PaintType enum was used to set the paint type in the internal Paint
implementation. This solution is switched to an identifier with id() getter,
so that the information about the type can be reached from outside the Paint.
2021-06-25 22:13:20 +09:00
Hermet Park
bf39e0fea9
Update README.md
@mgrudzinska I don't know this makes you understand, you can suggest if you have a better phrase.
2021-06-25 10:49:08 +09:00
K. S. Ernest (iFire) Lee
affa809a2c Use spellcheck 2021-06-25 10:43:34 +09:00