Releases: thorvg/thorvg
ThorVG 0.14.6
This release includes several improvements and minor bug fixes:
- [Renderer] Removed the experimental scene clipping feature.
- [Lottie] Rectified support for the polygon rounded corner property. #2624
- [Lottie] Optimized rendering by pooling Shape instances, improving performance.
- [Lottie] Fixed an edge case where the rectangle roundness formula was incorrectly applied.
- [Lottie] Updated logic to prioritize rectangle roundness over rounded corners, ensuring consistency with After Effects behavior.
- [Web] Fixed a regression where resizing the frame buffer did not work. #2580
Full Changelog: v0.14.5...v0.14.6
ThorVG 0.14.5
This release includes several improvements and minor bug fixes:
- [SwEngine] Enhanced the Radial Gradient quality by revamping the coefficient calculations. #2530
- [SwEngine] Improved the Radial Gradient behavior to fill with the last color stop value when its region is zero. #2582
- [Renderer] Introduced support for Lighten/Darken Masking options. #2608
- [Renderer] Revised Paint::bounds() to correctly return coordinates in Canvas space.
- [Renderer] Added a feature to find a specific paint node by unique ID. #2055
- [Lottie] Enhanced Expressions functionality, adding support for groupIndex() and property(ix).
- [Lottie] Fixed various Expression bugs, including issues with updating missing Transformation and SolidFill properties.
- [Lottie] Improved functionality to support Matte + Masking composition, Lighten/Darken Masking usages.
- [Lottie] Resolved a regression issue affecting animation smoothness due to Bezier computation.
- [TTF] Added basic support for composite glyph loading. #2599
- [Infrastructure] Applied Build Optimization Level 3, boosting performance to the native systems by ~ 20%.
Full Changelog: v0.14.4...v0.14.5
ThorVG 0.14.4
This release includes several improvements and minor bug fixes:
- [SwEngine] Fixed the linear gradient filling issue when its length is less than zero. #2582
- [SwEngine] Addressed a corner case where a invisible image drawing returns
InsufficientCondition, Now it'sSuccess - [Renderer] Corrected the animation segment handling to accommodate zero-size segments for stopped motion.
- [Lottie] Improved Expressions feature coverage, including global layer index and PingPong looping.
- [Lottie] Stabilized Expressions linear interpolation and composition layer behaviors.
- [Lottie] Fixed a regression bug causing invalid contents to appear as artifacts.
- [Lottie] Optimized with more aggressive object culling.
Full Changelog: v0.14.3...v0.14.4
ThorVG 0.14.3
This release includes several improvements and minor bug fixes:
[SwEngine] Added support for drawing images in 8-bit grayscale format.
[SwEngine] Improved performance of alpha blending operations for faster rendering.
[Renderer] Introduced APIs for querying the engine version. #2543
[Lottie] Properly supported counterclockwise direction for ellipse drawing.
[Lottie] Achieved (~10%) performance improvement by introducing a designated shape render pool.
[Lottie] Rectified the Expressions where PolyStar was not implemented.
Full Changelog: v0.14.2...v0.14.3
ThorVG 0.14.2
This release includes several improvements and minor bug fixes:
[SwEngine] Optimized RLE operations to reduce a bunch of memory copy during shape generation.
[SwEngine] Rectified blending operations on masked translucent rectangle drawings.
[GlEngine] Improved anti-aliasing quality when FillSpread::Repeat is set. #2521
[GlEngine] Corrected gradient fill display instead of solid fill. Duplicate in #2435
[Renderer] Replaced round() math calls with nearbyint(), which is twice as fast.
[Renderer] Introduced a custom atan2() method, 1.4 times faster than the standard atan2().
[Renderer] Reduced thread locking burden when no nested threads are used.
[Renderer] Fixed internal render updates to ensure proper functionality.
[Renderer] Corrected the transform() API to return InsufficientCondition instead of FailedAllocation.
[Lottie] Properly supported counterclockwise direction for rectangle drawing.
[Lottie] Optimized scene composition by caching solid layer drawing paint nodes.
[Lottie] Introduced the Text RangeSelector feature, covering text units and customizing text styles. #2178
[Lottie] Corrected 3D rotation matrix computation for accurate results.
[Lottie] Fixed incorrect auto-orient direction calculations.
[Lottie] Fixed broken image size due to missing image size settings.
[Lottie] Improved thread safety.
[SVG] Fixed a bug where graphic elements declared in are displayed. #2518
Full Changelog: v0.14.1...v0.14.2
ThorVG 0.14.1
This release includes several improvements and minor bug fixes:
- [SwEngine] Improved GradientFill rendering quality with properly applies anti-aliased edges for FillSpread: Repeat.
- [SwEngine] Correctly applied the anti-aliased shape filling when half-translucent stroking overlaps.
- [SwEngine] Added support for 8-bit grayscale image scaling rasterization.
- [GlEngine] Optimized rendering performance by allocating the optimal size of off-screen buffers.
- [GlEngine] Rectified the drawing quality for tiny strokes.
- [Lottie] Removed assert() calls in JSON Parser to reduce the binary size by 0.8 KB.
- [Lottie] Improved parsing to continue even when the expected integer value type is not provided. #2389
- [Lottie] Rectified masking behaviors to support complex masking compositions. #2426
- [Lottie] Fixed image drawing issues by allowing image sharing among LottiePicture instances. #2428
- [Lottie] Fixed a regression bug where InverseAlphaMasking was incorrectly applied as AlphaMasking.
- [Portability] Resolved compilation issues in VS2017 due to missing headers for std::min and std::max. #2512
Full Changelog: v0.14.0...v0.14.1
ThorVG v0.14.0
After three months of steadfast commitment, we are pleased to present ThorVG v0.14! This new version features a series of significant advancements that we are eager to showcase. Full Change Log
Community
Lottie Animation Support in LVGL
Over the past six months, through collaboration, LVGL has successfully integrated ThorVG to support vector primitive drawings and fully replaced the existing rlottie with ThorVG for Lottie animation functionality. rlottie, an open-source project led by Samsung, has ceased all maintenance, clearly indicating little potential for further development. Given this, it was quite expected that LVGL would see choosing ThorVG for its superior functionality and performance as the obvious choice. Additionally, LVGL needed to support SVG features within their framework; they were able to achieve both SVG and Lottie functionalities using the compact ThorVG library.
[Lottie Animation on a micro-device (STM32F769, 200 MHz, 800x480 screen)]
ThorVG in Canva iOS
Canva, a leading visual communication platform, has integrated ThorVG into its iOS app for Lottie animation support. The decision to adopt ThorVG was driven by several factors identified by its team:
- Performance Improvement: ThorVG offered significant speed and memory efficiency improvements.
- Active Development: Continuous updates and support from the ThorVG community ensured reliability and access to new features.
- Technical Compatibility: ThorVG's ability to render frames efficiently and its compatibility with Canva’s existing infrastructure made it an ideal choice.
For more details, please check this page to see how Canva applied ThorVG and gained significant improvements from it.
ThorVG New Package distributions
During the last development period, ThorVG has been expanded to various package management systems with the help of the community. Here are three new package servers you can officially use to conveniently install ThorVG:
- Conan C/C++ Package Manager
- xmake, A cross-platform build utility based on Lua
- The ESP Component Registry
- MSYS2 Software Distribution and Building Platform for Windows
Infrastructure (for Integrators)
During the last development period, we made structural changes and improvements to the ThorVG repository.
First, we changed the folder locations for the source code. By separating the tools and examples within the ThorVG directory from the src folder, we have started maintaining only the pure ThorVG library code in it.
Second, we separated the web code into a separate thorvg.web project, keeping the thorvg project solely for the core rendering engine. This change is expected to make the repository and branch management more compact and efficient, as many projects do not need to reference the web components.
"thorvg/src/tools" -> "thorvg/tools" (Executable ThorVG programs)
"thorvg/src/examples" -> "thorvg/examples" (ThorVG sample code)
"thorvg/web" -> "thorvg.web" (ThorVG for Web system support)
Third, we changed the meson option name from vector to simd for a more obvious and intuitive name. To use AVX or Neon vector processing, please update your build configuration with the new option.
$meson setup builddir -Dsimd=true ...
Fourth, ThorVG has enabled the TTF loader in the build configuration to support text rendering by default. To manually specify the TTF feature, please use the -Dloader meson option to include or exclude it. This feature is also defined in the ThorVG config.h file.
#define THORVG_TTF_LOADER_SUPPORT 1
Laslty, In this release, ThorVG starts to support Lottie Expressions feature in default. It might enlarge the binary size of the ThorVG (~250kb). If your program doesn't necessary for this, Please disable the feature using meson option:
$meson setup builddir -Dextra="" ...
This feature will be also defined in the ThorVG config.h file.
#define THORVG_LOTTIE_EXPRESSIONS_SUPPORT 1 //Remove this if you manually integrate ThorVG with your program.
If you are not familiar with Lottie and Expressions, please refer to the Lottie Animation > Expressions Support section.
Lottie Animation
Expressions Support
Lottie Expressions represent a runtime scripting method designed to execute programmable programs, created specifically for Adobe After Effects. Originally, Lottie was developed for After Effects, but its reliance on expressions has become a significant barrier to compatibility with players on other platforms. Currently, no players, aside from lottie-web, support the expressions feature at all.
Nevertheless, ThorVG begins to support Expressions primarily, it supports the major specifications of Expressions as well as the basic JavaScript operations that underlie JerryScript engine. With Expressions, ThorVG can modify the position, size, and color of shapes and layers, and control the segment repeat playback of Lottie animations, among other options such as loop.
The following is an example of Expressions code that modifies the position of a scene in a Lottie Animation which is allowed in ThorVG.
var $bm_rt; //This is a result, its type is a 2d position.
var amp, freq, decay, n, time_max, n, t, t, v;
amp = 0.05;
freq = 2;
decay = 2;
n = 0;
$bm_rt = time_max = 2;
if (numKeys > 0) {
$bm_rt = n = nearestKey(time).index;
if (key(n).time > time) {
n--;
}
}
if (n == 0) {
$bm_rt = t = 0;
} else {
$bm_rt = t = sub(time, key(n).time);
}
if (n > 0 && t < time_max) {
v = velocityAtTime(sub(key(n).time, div(thisComp.frameDuration, 10)));
$bm_rt = sum(value, div(mul(mul(v, amp), Math.sin(mul(mul(mul(freq, t), 2), Math.PI))), Math.exp(mul(decay, t))));
} else {
$bm_rt = value;
}
[Lottie Expressions Sample Code]
[ThorVG Lottie Animations without Expressions]
[ThorVG Lottie Animations with Expressions]
In the expressions, $bm_rt is the result variable whose type is arbitrary but aligned with the current property targeted by the expression. After executing the expression code, ThorVG can acquire a new property value from $bm_rt in each frame, and it will overwrite the existing property with this new value within the same frame. Therefore, we can assume that if the above code resides in the Lottie Position property, the type of the bm_rt value will be a Position(x, y) value and the value will be applied to the current model position value.
[ThorVG Lottie Expressions: Design Overview]
Basically, when provided, Expressions source code can reside in every Lottie Property with Lottie Expression. A Lottie Property is abstract data that will be implemented as Position, Opacity, Float, Path, etc., as required by the Lottie Model data. The ThorVG Lottie Parser will combine them—LottieExpression plus LottieProperty—in the LottieModel in order to compile/execute the Expression source code using the Lottie Expressions Engine for every property during the scene building time by the Lottie Builder.
In the above figure, the Lottie Expressions Engine and JerryScript Core are presented as integrated features of ThorVG and can be optionally enabled as an experimental feature during the ThorVG build process. If the feature is disabled, ThorVG Lottie will neither compose the LottieExpression data nor execute any of it.
Additionally, the Expressions Engine will not function when Lottie Model data is processed on the worker thread through ThorVG's intrinsic task-scheduler. This mean s that Expressions feature can be disabled by the engine on runtime when the ThorVG threading is functional. The reason I assume that the JerryScript Core has been designed to work within an unique global context that is not thread-safe at all. We could consider making it thread-safe using a locking mechanism, but this might lead to significant threading sync-waiting, which could undermine the effectiveness of threading. Until now, the dotlottie player has not used ThorVG's threading feature so it wouldn’t be a problem but in the future, we will address this issue and decide on a proper solution.
Note that, the current specifications of Expressions officially supported by ThorVG are as follows:
- Global Object
- Math
- Random
- Interpolation
- Comp Properties
- Layer General
- Layer Properties
- Properties
- Key
-...
ThorVG v0.13.8
This release includes several improvements and minor bug fixes:
- [Renderer] Optimized ClipPath performance with viewport fast-track. #2332
- [SwEngine] Fixed a bug in Bezier curve drawing with wrong rectangular filling. #2379
- [SwEngine] Fixed an issue where anti-aliasing was omitted when trimming the stroke.
- [SwEngine] Resolved a corner case crash when the anti-aliasing frame range was out of bounds. #2391
- [SVG] Added support for Text Node. #2350
- [Portability] Fixed a mutex crash issue in Visual Studio 2022 17.10 due to the STL known issue (_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR).
Full Changelog: v0.13.7...v0.13.8
ThorVG 0.13.7
This release includes several improvements and minor bug fixes:
- [Renderer] Introduced the Shape::strokeTrim() feature. #2190
- [Renderer] Corrected the return value of Shape::strokeMiterlimit() API from NonSupport to InvalidArgument.
- [SwEngine] Rectified the dash line drawing issue, ensuring the length of the remaining line to be drawn matches the dash line length exactly.
- [SwEngine] Improved trim path accuracy, enhancing Lottie simultaneous mode rendering. #2335
- [SwEngine] Fine-tuned RLE performance for extremely large shapes.
- [Lottie] Corrected the bug in matte layer finding. #2349
- [Lottie] Stabilized text property support for cases with invalid font or glyph matches.
- [SVG] Fixed the issue with loading embedded WebP images due to a missing MIME type. #2355
Full Changelog: v0.13.6...v0.13.7
ThorVG 0.13.6
This release includes several improvements and minor bug fixes:
- [Renderer] Corrected a missing symbol in the viewport CAPI. #2314
- [Lottie] Fixed a memory violation error during path interpolation. #2287
- [Lottie] Enhanced the matte feature to support the 'tp' property. #2325
- [Lottie] Rectified transformation behaviors in the repeater.
- [Lottie] Optimized runtime memory usage by encoding the property names.
- [Web] Optimized the rendering performance by introducing the viewport clipping. #2292
- [Portability] Resolved several compilation warnings.
- [Example] Fixed a missing update for re-drawing gl engine in AnimateMasking.
- [Example] Fixed a heap-use-after-free error in CAPI.
Full Changelog: v0.13.5...v0.13.6