Commit graph

1891 commits

Author SHA1 Message Date
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
Mira Grudzinska
12056d516f paint: fastTrack should return false for the skew transformations 2022-12-28 13:06:49 +09:00
Hermet Park
eff6b3aa6a
Update CONTRIBUTING.md 2022-12-28 13:03:14 +09:00
JunsuChoi
1769e1c4af common Util: Move to before decimal part calculation 2022-12-14 10:42:27 +09:00
JunsuChoi
439c918553 common Util: Skip if there is a space after the dot
Some SVG parsers allow parsing of "0."
If there is a space after the dot, skip to the next step.
2022-12-14 10:42:27 +09:00
Mira Grudzinska
4bdb58a8ca examples: fixing building errors on macOS
Reference to the 'count' was ambiguous (var name / std::count).
2022-12-14 10:41:42 +09:00
Mira Grudzinska
3732b2c54a authors: updating email address 2022-12-13 17:15:26 -08:00
JunsuChoi
abb9df7c6b svg_loader: Change SVG viewbox variable type from int to float
The viewbox and size(width, height) defined in SVG can be of type float.
This prevents matrix calculation errors caused by this.
2022-12-12 23:48:52 +09:00
Hermet Park
91730249ae test picture: add picture mesh api unit test
@Issue: https://github.com/Samsung/thorvg/issues/1241
2022-12-09 12:09:59 +09:00
Hermet Park
7c269a9f20 common picture: +exception handling.
invalid arguments won't be allowed.
2022-12-09 12:09:59 +09:00
Hermet Park
d78744bae3 test accessor: added accessor test unit test.
@Issue: https://github.com/Samsung/thorvg/issues/1243
2022-12-08 22:39:09 +09:00
Hermet Park
d958fc7971 saver/loader tvg: support picture mesh properties.
this mesh properites newly introduced in v0.8
(see: 3dd65dfed0)

tvg saver/loader should implement mesh support to
properly capture/replay the scene snapshot.

@Issue: https://github.com/Samsung/thorvg/issues/1242
2022-12-08 22:29:29 +09:00