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
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
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
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.
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
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.
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.
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.
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.
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.
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.
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.
* svg_loader: preserveAspectRatio attrib handled according to the svg standard
* svg_loader: symbol fixed
The correct width/height values used in the _useBuildHelper function.
Bug was propageted while the preserveAspectRatio attrib was handled,
now fixed.
* svg_loader: refactoring code regarding the preserveAspectRatio attrib
To avoid copy/paste a new function is introduced to handle the proper
scaling.
* svg_loader: initialize the svg loader members
The 'align' and 'meetOrSlice' svg loader members were not initialized.
* svg_loader: resize function forces any transformation
The resize function is called after the svg image is read and scaled
taking into account the proper preserveAspectRatio value. While resizing
the preserveAspectRatio isn't checked any more and the image can be
freely transformed.
Improved to skip Luma Mask when conditions are the same
as AlphaMask for optimization in e409bb29.
If the composition node is an image, it is not skipped because
it is not known for sure whether to skip it.