Commit graph

2053 commits

Author SHA1 Message Date
Hermet Park
20466ea78f sw_engine rle: The out-of-range memory access has been fixed.
@Issue: https://github.com/thorvg/thorvg/issues/1370
2023-04-26 00:23:03 +09:00
Hermet Park
7e3380db8b sw_engine mempool: fixed to address a potential memory corruption issue.
The previous memory pool was being shared by both the main and first threads,
which could lead to corruption if any threading changes occurred.

@Issue: https://github.com/thorvg/thorvg/issues/1370
2023-04-26 00:23:03 +09:00
Mira Grudzinska
bf2b348343 svg_loader: removed unused code
While css styling applied one of conditions was
always false. It is now removed and the function
that was called is refactored
2023-04-25 14:30:40 +09:00
Mira Grudzinska
83ffe9f612 svg_loader: fixing grad overwritting
Gradient was mistakenly overwritten in
files in which the <def> section existed,
but grad was defined outside it.
2023-04-25 14:30:23 +09:00
Hermet Park
92dbc8507e common: polished the log message.
Removed 'l.'. It just bothers in reading numbers.
2023-04-25 14:23:23 +09:00
Mira Grudzinska
ef93a45d56 svg_loader: removing setting the locale
The locale was set while reading the path attr,
which could have caused race conditions between
threads and potentially led to crashes.
Now removed as unnecessary.

@Issue: https://github.com/thorvg/thorvg/issues/1389
2023-04-25 09:17:00 +09:00
Mira Grudzinska
cc75928c23 capi: type identifier apis added
The tvg_gradient_get_identifier and tvg_paint_get_identifier
apis have been introduced. They set the newly introduced
Tvg_Identifier enum, which indicates the paint and gradient
types, respectively.
2023-04-25 09:15:28 +09:00
Mira Grudzinska
74c9a5f795 svg_loader: changed update order
The gradient was updated before the style,
which resulted in only the URL tag being
inherited, but the gradient itself was not
applied to the node.
2023-04-25 09:01:19 +09:00
Mira Grudzinska
5f5b4fdb80 tests: ++coverage of the svg_loader 2023-04-24 10:54:11 +09:00
Mira Grudzinska
b0991b6ce7 svg_loader: fixing 'infinity' handling in svgUtilStrtof
The word 'infinity' was not read to the end due to
the pointer shifting.
2023-04-24 10:47:17 +09:00
Mira Grudzinska
dbca656ff5 tests capi: missing header added
Because of this tests for SwCanvas were
not performed.
2023-04-23 10:25:55 +09:00
Mira Grudzinska
f82b16285a tests: fixing error on windows (mingw-64)
Error while comparing a pointer and an integer.
Solved by using a null pointer const instead of
the NULL macro.

@Issue: https://github.com/thorvg/thorvg/issues/1382
2023-04-22 21:24:41 +09:00
Hermet Park
ffbdc6990c
Update README.md 2023-04-22 18:39:28 +09:00
Hermet Park
5d930e51e4 test/examples: -- deprecated apis call warnings.
Result load(const char* data, uint32_t size, bool copy = false)
-> Result load(const char* data, uint32_t size, const std::string& mimeType, bool copy = false)

Result bounds(float* x, float* y, float* w, float* h)
-> Result bounds(float* x, float* y, float* w, float* h, bool transformed)
2023-04-22 18:32:22 +09:00
Hermet Park
69063d2405 infra: specify TVG_API for both static/dynamic linking.
The previous meson script was incomplete,
therefore this change requires it to be revised.

To enable static linking use the next meson option.
"-Ddefault_library=static"

Issue: https://github.com/thorvg/thorvg/issues/1234
2023-04-22 18:32:22 +09:00
Hermet Park
02bc89fc93 infra github: adds static loader test 2023-04-21 08:29:19 +09:00
Hermet Park
a5e84ce791 infra github: compact actions & added tools build.
Still windows action needs unit_test & examples.

@https://github.com/thorvg/thorvg/issues/1378
2023-04-21 08:29:19 +09:00
Hermet Park
a2d93b7d37 infra github: compact actions & supplement verfication. 2023-04-21 08:29:19 +09:00
Hermet Park
91781abf0d infra github: changed the file name for clarity. 2023-04-21 08:29:19 +09:00
Hermet Park
aa915ee1c4 Make it silent MSVC's trivial compilation warnings.
@Issue: https://github.com/thorvg/thorvg/issues/1381
2023-04-21 08:28:56 +09:00
Hermet Park
eadca4ec9b
Update README.md 2023-04-20 13:30:27 +09:00
Hermet Park
ac73202b47
Update README.md 2023-04-20 12:32:44 +09:00
Hermet Park
2c00d0f6a6
Update README.md 2023-04-20 12:16:41 +09:00
Hermet Park
fc196b0965 tools svg2tvg: ++Windows port
Complete the Windows port build that is currently missing.

@Issue: https://github.com/thorvg/thorvg/issues/882
2023-04-20 11:13:31 +09:00
Mira Grudzinska
46147dcec7 svg_loader: fixing clipper transformation
In a case where both the clipper and the clippee
are transformed, the final clipper transformation
matrix should be calculated as the multiplication
of both matrices.

@Issue: https://github.com/thorvg/thorvg/issues/1255
2023-04-19 11:43:16 +09:00
Mira Grudzinska
219e23855f svg_loader: paint-order attrib handled
@Issue: https://github.com/thorvg/thorvg/issues/1340
2023-04-18 22:21:55 +09:00
Mira Grudzinska
69a9583354 common: order(bool strokeFirst) api introduced
The new api is introduced to handle the rendering
order of a stroke and a fill. By default fill is
rendered as the first one, stroke as the second
one. This order can be reversed by calling
order(true).

@Issue: https://github.com/thorvg/thorvg/issues/1340
2023-04-18 22:21:55 +09:00
Mira Grudzinska
e61857f27d svg_loader: _applySvgViewFlag refactored 2023-04-17 21:43:36 +09:00
Mira Grudzinska
158e36f7c9 svg_loader: fix vx and vy
If no viewbox is given, vx and vy were set to values
corresponding to the svg's bounding box. This is now
applied only if no viewbox and no width/height information
is given. Otherwise, vx and vy are set to the default
values (0, 0).

@Issue: https://github.com/thorvg/thorvg/issues/1368
2023-04-17 21:43:36 +09:00
Mira Grudzinska
f089b77a45 svg_loader: fixing parsing empty elements
Self-closing tags (empty elements) were parsed until
the appearance of the '>' character, causing the '/'
char to be appended to the tag name. The final '/'
char should be omitted.
2023-04-17 09:57:52 +09:00
Hermet Park
bd695c6631 sw_engine rle: fix RLE intersect.
IntersectSpansRegion() wasn't working correctly,
as it didn't take care of some corner cases.

This fix makes the algorithm more accurate.
2023-04-16 22:03:36 +09:00
Hermet Park
b26672a1f6 sw_engine: support Scene ClipPath behavior.
Introduced SceneTask, it implements scene clippath behavior
by merging RLE of the scene children render data on any running thread.

Co-authored-by: Michal Szczecinski <m.szczecinsk@partner.samsung.com>

@Issue: https://github.com/thorvg/thorvg/issues/524
2023-04-16 22:03:36 +09:00
Hermet Park
a45275b779 sw_engine renderer: add clip() interface.
As there are multiple types of painting tasks,
the clip() interface has been newly designed to handle clipping behavior
according to each task's role when requested."

Now Scene clipper could implement clipping behavior on it.
2023-04-16 22:03:36 +09:00
Hermet Park
a0fbe7db41 example: add an example SceneClipper 2023-04-16 22:03:36 +09:00
Hermet Park
08b833b5bb examples: added sample svgs 2023-04-16 13:08:15 +09:00
Mira Grudzinska
598c28a597 svg_loader: gradient inheritance implemented
Till now only the grad stops were inherited. Now all
grad attribs are.
Inheritance from different grad type is not supported.

@Issue: https://github.com/thorvg/thorvg/issues/1209
2023-04-15 17:43:42 +09:00
Mira Grudzinska
66ef84e7d7 svg_loader: code refactoring
Changed order of functions - needed in the grad
inheritance commit.
2023-04-15 17:43:42 +09:00
Hermet Park
352539fe8e common paint: prevent fastrack except Shapes.
Use fasttrack only for Shape types, as it is suitable for them.
It is not recommended to use it for other types.
2023-04-14 20:07:04 +09:00
Hermet Park
b018c83e93 common picture: reset data properly.
either way the render data should be reset.
2023-04-14 20:06:46 +09:00
Hermet Park
033a65b560 common: code refactoring
trivial changes to utilize RenderData type.
2023-04-14 20:06:39 +09:00
Mira Grudzinska
4f3b718c3f
common: adding [E]/[L] markers to errors/logs (#1365)
common: adding [E]/[L] markers to errors/logs

@Issue: https://github.com/thorvg/thorvg/issues/1351
2023-04-14 09:38:01 +09:00
Mira Grudzinska
0a3718f923 common: enhancement++ of the logging method
Logging tags are marked with the corresponding
log type color, the file and the line information
in gray, and the message content in the default
color.

@Issue: https://github.com/thorvg/thorvg/issues/1351
2023-04-14 09:26:27 +09:00
Hermet Park
7bb6713505 infra github: ++minor changes. 2023-04-13 12:08:56 +09:00
Hermet Park
4709c8195f infra github: bump up version
Node.js 12 actions were deprecated.
Updated the script to use a more recent version.
2023-04-13 10:56:14 +09:00
Hermet Park
d694e6adef infra github: updated script
Specify the build option "all" for the future expansion.
2023-04-13 10:56:04 +09:00
Hermet Park
e44a1c1ee9 infra github: apply codeql
Setup a bot script to run codeql.
It discovers vulnerabilities across a thorvg codebase.

See: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/viewing-code-scanning-logs
2023-04-13 10:54:45 +09:00
Mira Grudzinska
54cfd45165 common: enhancement of the logging method
Introducing colors for various log types.
For error messages, the file name and line
number are now included.

@Issue: https://github.com/thorvg/thorvg/issues/1351
2023-04-12 20:46:04 +09:00
Mira Grudzinska
b866ee9cac common taskscheduler: warning removed 2023-04-11 11:44:05 +09:00
Hermet Park
afea40a947 common taskscheduler: increase thread efficiency.
Revise the logic to avoid potential blocking of the main thread.
Move the clippers job completion to worker-threads to prevent main thread blocks
and enhance maximum parallelization efficiency.
2023-04-09 13:21:29 +09:00
Hermet Park
5112bdb805 common: ++todo 2023-04-07 18:28:17 +09:00