Commit graph

1935 commits

Author SHA1 Message Date
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
Hermet Park
084e78d98d common: code refactoring for the IteractorAccessor.
The instantiation of the accessor is unnecessary
as it does not require any internal context.

Simplifying its usage would be beneficial.
2023-04-07 18:24:24 +09:00
Hermet Park
b2692484b7 infra - add 'all' option for savers.
ex) meson . build -Dsavers="all", ...
2023-04-07 13:54:29 +09:00
Hermet Park
daecef5acd sw_engine: fix the inproper stroke raster.
We have an incorrect value comparison when the stroke corner center
is adjusted. All coordinates in the stroke raster have been scaled by
the given values (sx, sy), while the stroke width remains at its
original size due to it not being clear how it should be scaled.

This brings wierd rendering results at times. Now fix it.

@Issue: https://github.com/thorvg/thorvg/issues/1336
2023-04-07 11:43:32 +09:00
Hermet Park
d359d65640 test capi: ++coverage
added jpg, tvg tests
2023-04-06 19:54:54 +09:00
Hermet Park
f0ae3e9cee test: fix broken plugin support.
The thorvg test should not attempt to perform features
that were not enabled, as this will cause them to fail.

@Issues: https://github.com/thorvg/thorvg/issues/1251
2023-04-06 19:47:10 +09:00
Mira Grudzinska
9102f66948 examples: preventing undef behavior
Calling get() on a unique pointer after
it has been moved is the undefined behavior.
2023-04-04 10:55:50 +09:00
Mira Grudzinska
d60a7bec7e svg_loader: fixing svgs without viewbox attr
For svgs without any viewbox and width/height
whole image is drawn. Before it was forced
to set x=y=0.
2023-04-03 12:39:43 +02:00
Mira Grudzinska
7b90d61e71 picture: remove unnecessary reloads
After #1338 is applied there is no need to reload
the pictures while aksing about its viewbox or its size.
2023-04-02 01:04:28 +09:00
Mira Grudzinska
c7137a8105 svg_loader: forcing file loading completion
Svgs without any viewbox and width/height information
have to be loaded before any other action is taken.
This is necessary to get the valid sive/viewbox info.
2023-03-31 09:48:01 +02:00
JunsuChoi
1e088a6a61 external_jpg_loader: Fix crash when loader is reloaded
When reload is called from tvgPicture,
clear() of external_jpg loader is called and 'data' is freed.
In the past, there was no case where reload was called until bitmap() was called after load.
Currently I have to consider reload() for a none-viewbox svg case
So change the color myself because loader can't call open() again.
2023-03-31 11:20:12 +09:00
Mira Grudzinska
f65d410b9f sw_engine: fix safety check
An incorrect check introduced in bf07eb11f2
as a solution of the #1327 issue. As a consequence rotated images
were not drawn. Fixed.
2023-03-26 12:46:28 +09:00
Hermet Park
1a9ff13165
Update README.md
updated discord link. the previous one was expired...
2023-03-25 22:11:56 +09:00
Hermet Park
d5dfb3d7dc
Update README.md 2023-03-25 21:57:19 +09:00
Hermet Park
5ebde2c9b6 common/accessor: fix uninitialized field.
--warnings.
2023-03-25 10:59:09 +09:00
Mira Grudzinska
d96b8f4385 svg_loader: invalid strokes' width set to zero
In case the "stroke" attrib is set to "none",
the width of the stroke is set to zero. Thanks
to that it isn't taken into account while
establishing the bounds of the shape.
2023-03-24 11:52:14 +09:00
Mira Grudzinska
be361221df svg_loader: handling zero width/height viewbox
For svgs with the width and/or height value set to zero
rendering was disabled - the load api return Result:Unknown
and draw - Result::InsufficientCondition.
Now an empty scene is added, so that both, load and draw,
return Result::Success.
2023-03-21 11:11:45 +09:00
Mira Grudzinska
9e8980a1f7 svg_loader: handling svgs without viewBox/viewPort
Additionally:
- cases of inforrect viewBox values are handled
- cases of zero width/height of a viewBox and/or viewPort

@Issue: https://github.com/Samsung/thorvg/issues/1239
2023-03-21 11:11:45 +09:00
Hermet Park
c9657e3e68 sw_engine - ++safety
Prevent any potential crash.

@Issues: https://github.com/thorvg/thorvg/issues/1327
2023-03-14 23:52:07 +09:00