examples are not considered a feature of ThorVG;
hence, they are excluded from the src directory.
This change allows developers to concentrate more effectively
on the core ThorVG sources for practical usages.
this optimization nicely merges shapes
when a child group has a only (transformed) pathes.
this also fixes the following compatibility issue nicely.
issue: https://github.com/thorvg/thorvg/issues/2061
When finding the 'nodeFrom' referenced by `<use>`,
if it is the parent, it is not referenced.
https://www.w3.org/TR/SVG2/struct.html#UseElement
Specification:
If the referenced element is a (shadow-including) ancestor
of the ‘use’ element, then this is an invalid circular reference
and the ‘use’ element is in error.
related issue: https://github.com/thorvg/thorvg/issues/2078
SVG_FILE_65171.svg
SVG_FILE_65172.svg
removed unused static condition.
static was prepared for optimization,
but not used at all.
we will revisit this later when time permits.
binary size: -6kb
When lottie is broken and provides invalid gradient, the program crashes in segmentation fault.
At that time, in the `populate` function, `ColorStop& color` doesn't have `input` but tries to use it.
Added checking nullptr logic. The function `populate` will not proceed and return 0 in that case.
related issue: #2072
There are differences in behavior compared to the SVG spec,
especially when consecutive line drawings occur without a moveTo command
following a closePath command.
Actually, thorvg didn't care the behavior in that scenario,
this update ensures the scenario is handled correctly
to align with the SVG specification.
issue: https://github.com/thorvg/thorvg/issues/1487
Slot overriding tries to set property via the `LottieObject`. It potentially causes unexpected changes.
Revised the `override` function. The purpose of this patch is to aim atomic property to be overriden.
Implemented the ability to revert Lottie slots by calling override with nullptr.
This functionality allows for the complete reversal of applied slots.
usage:
- `animation->override(nullptr)`
Co-Authored-By: Hermet Park <hermet@lottiefiles.com>
When image data fails to load or image parsing fails,
the id is leaked without being assigned to the name.
To prevent that, free id value when obj is nullptr.
related issue: https://github.com/thorvg/thorvg/issues/2072
BrokenLottie.7z/test3_IDX_130_RAND_18289244608080059871.json
BrokenLottie.7z/test3_IDX_131_RAND_7772102071213376276.json
BrokenLottie.7z/test3_IDX_132_RAND_3072617087893397532.json
BrokenLottie.7z/test3_IDX_134_RAND_17738488813555566674.json
BrokenLottie.7z/test3_IDX_137_RAND_13903188963759129023.json
BrokenLottie.7z/test3_IDX_138_RAND_1645404078965858130.json
* Support rendering Gradient in path Stroke mode
* Fix GlStencilCoverTask not support even-odd fill rule
* Make GlStencilCoverTask can discard overlapped area during stroke
rendering
When json file is invalid in the parser,
the LottieComposition object is not released and the parse() returns false.
To prevent memory leaks, free the memory before returning false.
related issue : https://github.com/thorvg/thorvg/issues/2070
This commit addresses an issue where paints lost their
composition context when drawings occurred without any updates.
Now, paints will consistently retain the composition context,
ensuring accurate rendering.
Issue: https://github.com/thorvg/thorvg/issues/2058
Enhances the portability of the TTF loader on UWP platforms
by implementing an alternative file loading mechanism.
This is designed to support environments where the file mapping
feature is not available, ensuring wider compatibility and reliability
in file handling.
Issue: https://github.com/thorvg/thorvg/issues/1912
[issues 1479: FillRule](#1479)
Introduced fill rule winding
This rule makes sense only if path have some self intersections.
In all other cases shapes are filled by even-odd behavor.
error: storing the address of local variable 'context' in '*this.LottieParser::context' [-Werror=dangling-pointer=]
1255 | this->context = &context;
issue: https://github.com/thorvg/thorvg/issues/2051
Refactor the GlCanvas::target() interface to allow
passing the drawing target ID from the user side.
Previously, it performed the drawing on the currently set FBO target.
Beta API change:
Result GlCanvas::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h)
-> Result GlCanvas::target(int32_t id, uint32_t w, uint32_t h)
* use GLRenderBuffer in color and stencil attachment, also use x4 sample
count by default.
* add msaa resolve logical at the end of a ComposeTask, so the normal
color texture can get the final rendering result.
sw_engine: radial gradient
[issues 2014: radial gradient](#2014)
Radial gradient results in a corrupted image when the focal point is outside the circle on Apple Silicon.
This happens because some compilers use FMA to optimize the a = dr² - dx² - dy² calculation,
which cause loss of precision.
We rely on temporary variables to prevent FMA.
We could also use compiler specific float contraction control pragmas to avoid this if this doesn't work in the future