Commit graph

1702 commits

Author SHA1 Message Date
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
Hermet Park
4c2688fcd4
Create CODEOWNERS 2023-02-13 19:13:30 +09:00
JunsuChoi
50da80573d png_loader(static): Move the colortype check code to open() 2023-02-10 22:23:24 +09:00
JunsuChoi
02613feac3 png_loader(static): Fix the colorspace of an image with an alpha channel
Set colorspace to ABGR when colortype of lodepng is LCT_RGBA.
Since an image without an alpha channel becomes an ARGB colorspace with LCT_RGB,
it is the same as the default colorspace.
2023-02-10 22:23:24 +09:00
JunsuChoi
507b11829c loader: Support ABGR colorspace
Since the color space is set at the time of specifying the target buffer of the canvas,
there is no way to know the color space when the picture is loaded.
So, check the color space applied to SwCanvas at the time of reload()
and change the color space.

There is an issue of BGR color space support for each loader.
The external_jpg loader resets the TJPF color space and calls read() to get a new buffer.
In the case of external_png, we need to change the color value directly
because it have to start over from begin_read_*.

This solution can affect performance as much as it access again image buffer
that have already been `read()` done. However, this only happens once.
2023-02-08 17:54:33 -08:00
Hermet Park
a05816e219 common shape: code refactoring.
keep name consistency.
2023-02-05 12:06:09 +09:00
Hermet Park
e576e1d8e6 gl_engine: -- compiler warnings
../src/lib/gl_engine/tvgGlRenderer.cpp: In member function ‘virtual bool GlRenderer::renderShape(tvg::RenderData)’:
../src/lib/gl_engine/tvgGlRenderer.cpp:171:30: warning: ‘a’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  171 |                 drawPrimitive(*sdata, r, g, b, a, i, RenderUpdateFlag::Stroke);
      |                 ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/lib/gl_engine/tvgGlRenderer.cpp:171:30: warning: ‘b’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../src/lib/gl_engine/tvgGlRenderer.cpp:171:30: warning: ‘g’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../src/lib/gl_engine/tvgGlRenderer.cpp:171:30: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../src/lib/gl_engine/tvgGlRenderer.cpp: In member function ‘virtual void* GlRenderer::prepare(const tvg::RenderShape&, tvg::RenderData, const tvg::RenderTransform*, uint32_t, tvg::Array<void*>&, tvg::RenderUpdateFlag, bool)’:
../src/lib/gl_engine/tvgGlRenderer.cpp:215:21: warning: ‘alphaS’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  215 |     uint8_t alphaF, alphaS;
2023-02-05 12:06:09 +09:00
Hermet Park
1fd78a3485 infra: update gitignore 2023-02-05 12:06:09 +09:00
Hermet Park
919c90a97e common shape: code refactoring & data optimization.
re-design the shape data structure so that render backends
are able to access them directly.

This also let us remove tvgShape member data from the Shape::Impl.

To achieve this, migrate shape/stroke/path
from the canvas interface to the render interface.
2023-02-05 12:06:09 +09:00
Hermet Park
110f4a5cc9 common paint: keep clean apis and small size.
these are no more necessary.
2023-02-04 16:25:50 +09:00
Hermet Park
d701f6dae4 common: enhance clipping behavior.
If a paint is used as a clipper, it must be determined in the paint behavior.
Propagate its decision to the immediate derived classes so that
not only shapes but also scenes must be dealt as a clipper properly.

This revised this change 0de3872be3
for better a solution.
2023-02-04 16:25:50 +09:00
Hermet Park
6452f4a591
Update CONTRIBUTING.md 2023-01-31 11:04:06 +09:00
JunsuChoi
6ffe391c5d infra: Disable cpp lint checker
When we do 1.0 release, we clean up the coding style of all codes.
Currently, there are limitations in our coding style and lint settings.
This results in unnecessary bot comments.
2023-01-30 13:37:47 +09:00
Hermet Park
5d77551b47 test: upgrade catch2
2.13.6 -> 2.13.10
2023-01-30 13:28:44 +09:00
Hermet Park
53a60fc499
Update README.md
updated discord link.
2023-01-30 12:18:22 +09:00
Hermet Park
38964928cb
Update README.md
added the discord badge
2023-01-27 23:52:17 +09:00
Hermet Park
476643928d doc: updated the header description. 2023-01-26 21:37:14 +09:00
Hermet Park
cd68a783dd svg loader: correct clipper usage.
that has been changed by 0de3872be3
2023-01-26 21:37:03 +09:00
Hermet Park
8175f8dd2a example: correct clipper usage.
it has been changed by 0de3872be3
2023-01-22 10:13:52 +09:00
Hermet Park
8dd5a3ade1
Update README.md 2023-01-20 21:50:31 +09:00
Mira Grudzinska
b701bfc91c examples: ClipPath's modified
The opacity/alpha value doesn't need to be set
for clips any more.
2023-01-19 23:21:34 +01:00
Mira Grudzinska
0de3872be3 common: ignoring color/alpha/opacity of a clip object
According to the svg specs clip's fill and opacity
should be ignored. Till now setting the alpha/opacity
value to zero resulted in the shape's rendering abort.

@Issue: https://github.com/Samsung/thorvg/issues/1192
2023-01-19 23:21:34 +01:00
Mira Grudzinska
b58c20b881 svg_loader: overwrite the clip's opacity/alpha
According to the svg standard the clips opacity
doesn't affect the final rendering. In order to
avoid any confusion the opacity values are
overwritten by the max possible value.
2023-01-19 23:07:50 +01:00
Hermet Park
2a3165d66b
Update README.md 2023-01-15 12:52:14 +09:00
Hermet Park
9b3c34c3b1 updated copyright. 2023-01-14 13:48:11 +09:00
Hermet Park
dc9e39e6f4
Update README.md 2023-01-13 18:08:44 +09:00
Mira Grudzinska
ae07b480d0 svg_loader: fixing crash for to big buffer
Crash observed on macOS for the image-embeded-*.svg files.
Since the alloca function was used the stack allocation failure
could not be handled.
2023-01-08 11:28:42 +09:00
Mira Grudzinska
1980d9d0e3 all: Trailing spaces removed 2023-01-07 10:53:51 +09:00
Mira Grudzinska
df9a28bf0a svg_loader: fixing name
_parserColor -> _parseColor
2023-01-07 10:52:56 +09:00
Mira Grudzinska
5bc6f4881a examples: fixing the crash for disabled loaders
ImageScaleUp/ImageScaleDown fixed.
2023-01-07 10:48:40 +09:00
Hermet Park
4082a13527 examples: keep aspect ratio of svg images.
changed by 3939b61770
2023-01-07 02:28:48 +09:00
Mira Grudzinska
5c59c9aa71 scene: fixing nested masking
For any type of masking composition may be required.

@Issue: https://github.com/Samsung/thorvg/issues/1295
2023-01-07 01:54:09 +09:00
Hermet Park
57e3efc6ab
Update README.md 2023-01-07 01:24:37 +09:00
Hermet Park
262303c8b8
Update README.md 2023-01-07 01:13:25 +09:00