We've investigated two json parsers, simdjson & rapidjson.
Since the size is higer priorty for thorvg, we adopted rapidjson.
It's under MIT license.
See: https://github.com/Tencent/rapidjson
The custom _strndup was used only in one file
as an internal function and wasn't accessible
in other parts of the code. Now function
is available as svgUtilStrndup.
../src/loaders/svg/tvgSvgLoader.cpp: In function ‘void _copyAttr(SvgNode*, const SvgNode*)’:
../src/loaders/svg/tvgSvgLoader.cpp:2911:44: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
2911 | if (to->node.polygon.pts.count = from->node.polygon.pts.count) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/loaders/svg/tvgSvgLoader.cpp:2917:45: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
2917 | if (to->node.polyline.pts.count = from->node.polyline.pts.count) {
These new apis would enable users to easily modify the motion scene,
The data structure of the paints has been changed from an array to a list.
@APIs:
std::list<Paint*>& Canvas::paints() noexcept;
std::list<Paint*>& Scene::paints() noexcept;
@Deprecated:
Result Canvas::reserve(uint32_t size) noexcept;
Result Scene::reserve(uint32_t size) noexcept;
@Issue: https://github.com/thorvg/thorvg/issues/1203
[41/145] Compiling C++ object src/libthorvg.a.p/loaders_jpg_tvgJpgd.cpp.o
../src/loaders/jpg/tvgJpgd.cpp:1339:17: warning: variable 'bytes' set but not used [-Wunused-but-set-variable]
uint32_t c, bytes = 0;
^
../src/loaders/jpg/tvgJpgd.cpp:1773:29: warning: variable 'row_block' set but not used [-Wunused-but-set-variable]
int mcu_row, mcu_block, row_block = 0;
^
../src/loaders/jpg/tvgJpgd.cpp:1876:9: warning: variable 'row_block' set but not used [-Wunused-but-set-variable]
int row_block = 0;
^
3 warnings generated.
In the case when a 'use' node was used
in a 'defs' block and the element it
referenced was also defined within the same
'defs' block, the reference node could not
be cloned. This was because the 'defs' node
could not be located.
@Issue: https://github.com/thorvg/thorvg/issues/1451
The conversion to percentages was applied twice.
Additionally, when a viewbox value was provided before the width/height,
incorrect scaling occurred.
@Issue: https://github.com/thorvg/thorvg/issues/1414
The percentages should refer to the size of the viewbox.
This was not the case for not knowing the viewbox before
reading the width/height.
@Issue: https://github.com/thorvg/thorvg/issues/1409
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.