Releases: thorvg/thorvg
ThorVG 1.0.0-pre3
In preparation for the ThorVG 1.0.0 release, we are conducting a pre-release for ThorVG v1.0. Please carefully review the release notes, as there may be API/ABI breaks included. Also, this release includes several improvements and minor bug fixes since v1.0.0-pre2.
- [Renderer] Hotfixed an issue with broken SVG file sharing.
- [WgEngine] Applied 4x MultiSampling anti-aliasing for improving visual quality.
- [WgEngine] Enhanced Path Clipping performance by eliminating costful context switching.
- [GlEngine] Fixed an incorrect PNG colorspace issue. #2880
- [GlEngine] Corrected the alpha multiplication error in Inverse Luma Masking.
- [SwEngine] Fixed an issue with Gaussian Blur feathering when applied in one directional filter. #2892
- [SwEngine] Resolved incorrect masking with 8-bit linear gradient filling. #2204
- [SwEngine] Corrected blending errors in 8-bit channel data when directly drawing images.
- [Lottie] Improved the Offset Path algorithm for more accurate shape deformation.
- [Lottie] Adjusted the Offset Path logic to ignore path direction, following Lottie specification.
- [SVG] Enhanced runtime stability by preventing invalid memory access.
- [API] Modified APIs:
Result RadialGradient::radial(float cx, float cy, float radius)
-> Result RadialGradient::radial(float cx, float cy, float r, float fx, float fy, float fr)
Result RadialGradient::radial(float* cx, float* cy, float* radius)
-> Result RadialGradient::radial(float* cx, float* cy, float* r, float* fx = nullptr, float* fy = nullptr, float* fr = nullptr)
Full Changelog: v1.0-pre2...v1.0-pre3
ThorVG 0.15.2
This release includes several improvements and minor bug fixes:
- [SwEngine] Optimized render region updates to minimize unnecessary rendering tasks.
- [SwEngine] Fixed a crash by splitting long lines to prevent overflow. #2651
- [SwEngine] Fixed incorrect 8bits linear gradient filling masking. #2204
- [SwEngine] Rectified a wrong 8bits channel data blending in direct image drawing.
- [GlEngine] Added support for the Path Trimming feature. #2435
- [GlEngine] Fixed an wrong png colorspace. #2880
- [GlEngine] Corrected a wrong masking alpha multiplication when applying the Inverse Luma Masking.
- [Lottie] Enhanced performance for Gaussian Blur effects.
- [Lottie] Added support for Masking Expansion (Dilate). #2832
- [Lottie] Optimized memory management by releasing JSON data immediately after loading. #2647
- [Lottie] Fixed regression bugs causing gradient fills to matte masked, incorrectly. #2842 #2841
- [Lottie] Rectified Offset Path to ignore the path direction according to its Spec.
Full Changelog: v0.15.1...v0.15.2
ThorVG 1.0.0-pre2
In preparation for the ThorVG 1.0.0 release, we are conducting a pre-release for ThorVG v1.0. Please carefully review the release notes, as there may be API/ABI breaks included. Also, this release includes several improvements and minor bug fixes since v1.0-pre2
- [Renderer] Reduced the PathCommand data size from 4 bytes to 1 byte for improved memory efficiency.
- [GlEngine] Added support for the Path Trimming feature. #2435
- [WgEngine] Fixed an uninitialized data access issue in AABB when handling empty shapes or long paths. #2843
- [Lottie] Optimized memory management by releasing JSON data immediately after loading. #2647
- [Lottie] Fixed regression bugs causing gradient fills to matte masked, incorrectly. #2842 #2841
- [TVG] TVG binary feature support has been removed. #2721
- [API] Modified APIs:
Result Picture::load(uint32_t* data, uint32_t w, uint32_t h, bool premultiplied, bool copy = false)
-> Result Picture::load(uint32_t* data, uint32_t w, uint32_t h, ColorSpace cs, bool copy = false)
enum class PathCommand
-> enum class PathCommand : uint8_t
enum class Result::Unknown (6)
-> enum class Result::Unknown (255)
Matrix Fill::transform() const
-> Matrix& Fill::transform() const
enum class CompositeMethod
-> enum class MaskMethod
Result Paint::composite(std::unique_ptr target, CompositeMethod method)
-> Result Paint::mask(std::unique_ptr target, MaskMethod method)
CompositeMethod Paint::mask(const Paint** target) const
-> MaskMethod Paint::mask(const Paint** target) const
Tvg_Result tvg_picture_load_raw(Tvg_Paint* paint, uint32_t data, uint32_t w, uint32_t h, bool premultiplied, bool copy)
-> Tvg_Result tvg_picture_load_raw(Tvg_Paint paint, uint32_t *data, uint32_t w, uint32_t h, Tvg_Colorspace cs, bool copy)
enum Tvg_Path_Command
-> uint8_t Tvg_Path_Command
TVG_RESULT_UNKNOWN (6)
-> TVG_RESULT_UNKNOWN (255)
enum Tvg_Composite_Method
-> enum Tvg_Mask_Method
Tvg_Result tvg_paint_set_composite_method(Tvg_Paint* paint, Tvg_Paint* target, Tvg_Composite_Method method)
-> Tvg_Result tvg_paint_set_mask_method(Tvg_Paint* paint, Tvg_Paint* target, Tvg_Mask_Method method)
Tvg_Result tvg_paint_get_composite_method(const Tvg_Paint* paint, const Tvg_Paint** target, Tvg_Composite_Method* method)
-> Tvg_Result tvg_paint_get_mask_method(const Tvg_Paint* paint, const Tvg_Paint** target, Tvg_Mask_Method* method)
- [API] Removed deprecated APIs:
enum class CompisiteMethod::ClipPath
enum Tvg_Composite_Method::TVG_COMPOSITE_METHOD_CLIP_PATH
Full Changelog: v1.0-pre1...v1.0-pre2
ThorVG 0.15.1
This release includes only hotfixes for critical bugs:
- [Lottie] Fixed a crash when the image external path is not addressed. #2733
Full Changelog: v0.15.0...v0.15.1
ThorVG 1.0.0-pre1
In preparation for the ThorVG 1.0.0 release, we are conducting a pre-release for ThorVG v1.0. Please carefully review the release notes, as there may be API/ABI breaks included. Also, this release includes several improvements and minor bug fixes since v0.15.0.
- [Lottie] Enhanced performance for Gaussian Blur effects.
- [Lottie] Added support for Masking Expansion (Dilate). Issue #2832
- [SwEngine] Optimized render region updates to minimize unnecessary rendering tasks.
- [SwEngine] Fixed a crash by splitting long lines to prevent overflow. Issue #2651
- [WgEngine] Resolved several resource leaks. Issue #2808
- [WgEngine] Corrected the order of gradient fill color stop offsets. Issue #2435
- [WgEngine] Fixed incorrect opacity handling during scene blending.
- [WgEngine] Addressed a crash when processing shapes with excessively large paths.
- [SVG] Added support for
tvg::Accessor
to access elements using the id attribute in SVG. - [Web] Increased WebGPU stack size to 4MB for improved stability.
- [Infra] Removed the
beta
tag from the WebGPU engine. - [API] Modified APIs:
enum class StrokeCap
-> enum class StrokeCap : uint8_t
enum class StrokeJoin
-> enum class StrokeJoin : uint8_t
enum class FillSpread
-> enum class FillSpread : uint8_t
enum class FillRule
-> enum class FillRule : uint8_t
enum class CompositeMethod
-> enum class CompositeMethod : uint8_t
enum class CanvasEngine
-> enum class CanvasEngine : uint8_t
enum SwCanvas::Colorspace
-> enum SwCanvas::Colorspace : uint8_t
enum SwCanvas::MempoolPolicy
-> enum SwCanvas::MempoolPolicy : uint8_t
virtual Canvas::clear(bool free = true)
-> virtual Result Canvas::clear(bool paints = true, bool buffer = true)
Result Shape::stroke(float width)
-> Result Shape::strokeWidth(float width)
Result Shape::stroke(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255)
-> Result Shape::strokeFill(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255)
Result Shape::stroke(std::unique_ptr<Fill> f)
-> Result Shape::strokeFill(std::unique_ptr<Fill> f)
Result Shape::stroke(const float* dashPattern, uint32_t cnt)
-> Result Shape::strokeDash(const float* dashPattern, uint32_t cnt, float offset = 0.0f)
Result Shape::stroke(StrokeCap cap)
-> Result Shape::strokeCap(StrokeCap cap)
Result Shape::stroke(StrokeJoin join)
-> Result strokeJoin(StrokeJoin join)
Result Shape::strokeColor(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a = nullptr) const
-> Result Shape::strokeFill(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a = nullptr) const
uint32_t Shape::strokeDash(const float** dashPattern) const
-> uint32_t Shape::strokeDash(const float** dashPattern, float* offset = nullptr) const
Result Picture::load(const char* data, uint32_t size, const std::string& mimeType, bool copy = false)
-> Result Picture::load(const char* data,
Result Picture::load(uint32_t* data, uint32_t w, uint32_t h, bool copy)
-> Result load(uint32_t* data, uint32_t w, uint32_t h, bool premultiplied, bool copy = false)
static Result Initializer::init(CanvasEngine engine, uint32_t threads)
-> static Result Initializer::init(uint32_t threads, CanvasEngine engine = tvg::CanvasEngine::All)
Result Saver::save(std::unique_ptr<Paint> paint, const std::string& path, bool compress = true)
-> Result Saver::save(std::unique_ptr<Paint> paint, const std::string& path, uint8_t quality = 100)
Tvg_Result tvg_canvas_clear(Tvg_Canvas* canvas, bool free)
-> Tvg_Result tvg_canvas_clear(Tvg_Canvas* canvas, bool paints, bool buffer)
Tvg_Result tvg_shape_set_stroke_dash(Tvg_Paint* paint, const float* dashPattern, uint32_t cnt)
-> Tvg_Result tvg_shape_set_stroke_dash(Tvg_Paint* paint, const float* dashPattern, uint32_t cnt, float offset)
Result tvg_shape_get_stroke_dash(const Tvg_Paint* paint, const float** dashPattern, uint32_t* cnt)
-> Tvg_Result tvg_shape_get_stroke_dash(const Tvg_Paint* paint, const float** dashPattern, uint32_t* cnt, float* offset)
Tvg_Result tvg_picture_load_raw(Tvg_Paint* paint, uint32_t *data, uint32_t w, uint32_t h, bool copy)
-> tvg_picture_load_raw(Tvg_Paint* paint, uint32_t *data, uint32_t w, uint32_t h, bool premultiplied, bool copy)
Tvg_Result tvg_picture_load_data(Tvg_Paint* paint, const char *data, uint32_t size, const char *mimetype, bool copy)
-> Tvg_Result tvg_picture_load_data(Tvg_Paint* paint, const char *data, uint32_t size, const char *mimetype, const char* rpath, bool copy)
Tvg_Result tvg_saver_save(Tvg_Saver* saver, Tvg_Paint* paint, const char* path, bool compress)
-> Tvg_Result tvg_saver_save(Tvg_Saver* saver, Tvg_Paint* paint, const char* path, uint32_t quality)
- [API] Removed deprecated APIs:
Result Paint::bounds(float* x, float* y, float* w, float* h) const
uint32_t Paint::identifier() const
Result Canvas::reserve(uint32_t n)
uint32_t Fill::identifier() const
static uint32_t LinearGradient::identifier()
static uint32_t RadialGradient::identifier()
static uint32_t Shape::identifier()
Result Shape::appendArc(float cx, float cy, float radius, float startAngle, float sweep, bool pie)
static uint32_t Picture::identifier()
Result Picture::load(const char* data, uint32_t size, bool copy = false)
uint32_t size, const std::string& mimeType, const std::string& rpath = "", bool copy = false)
static uint32_t Scene::identifier()
Result Scene::reserve(uint32_t size)
std::unique_ptr<Picture> Accessor::set(std::unique_ptr<Picture> picture, std::function<bool(const Paint* paint)> func)
Tvg_Result tvg_canvas_reserve(Tvg_Canvas* canvas, uint32_t n)
Tvg_Result tvg_paint_get_identifier(const Tvg_Paint* paint, Tvg_Identifier* identifier)
Tvg_Result tvg_shape_append_arc(Tvg_Paint* paint, float cx, float cy, float radius, float startAngle, float sweep, uint8_t pie)
Tvg_Result tvg_gradient_get_identifier(const Tvg_Gradient* grad, Tvg_Identifier* identifier)
Tvg_Result tvg_scene_reserve(Tvg_Paint* scene, uint32_t size)
Tvg_Result tvg_canvas_reserve(Tvg_Canvas* canvas, uint32_t n)
Tvg_Result tvg_paint_get_identifier(const Tvg_Paint* paint, Tvg_Identifier* identifier)
Tvg_Result tvg_shape_append_arc(Tvg_Paint* paint, float cx, float cy, float radius, float startAngle, float sweep, uint8_t pie)
Tvg_Result tvg_gradient_get_identifier(const Tvg_Gradient* grad, Tvg_Identifier* identifier)
Tvg_Result tvg_scene_reserve(Tvg_Paint* scene, uint32_t size)
ThorVG v0.15
After three months of steadfast commitment, we are pleased to present ThorVG v0.15! This new version features a series of significant advancements that we are eager to showcase. Please check the release notes to see the latest updates in ThorVG!
Full Changelog: v0.14.0...v0.15.0
WebGPU Engine
In this release, we have made significant improvements in the performance, functionality, and stability of the WebGPU engine. Despite our steadyfast efforts, the WebGPU engine is being provided as a experimental version in this release. This decision led us to further validate its stability and improve the quality of anti-aliasing. We plan to achieve these goals in the right next version. Nevertheless, the WebGPU engine's rendering performance and functionality are working well overall and are ready for trial use at this stage. We have also successfully integrated WebGPU with web browsers using WebAssembly, and performance tests show it can deliver 120fps in 4K resolution.
To further boost ThorVG's performance, we revisited the WebGPU engines from a performance standpoint and applied a series of targeted optimizations.
[Enhanced Rendering Capabilities with ThorVG WebGPU]
Stroke Generation
We introduced several optimizations to improve stroke generation efficiency. We minimized memory allocations, range checks, and other conditions for large-scale vertex and index creation, while reducing the number of segment length and bounding box calculations. Distance and bounding box updates are now applied only when necessary, and for shapes without strokes, distance calculations were entirely removed. We also switched to stack memory for better cache efficiency and reduced fragmentation, improving memory allocation speed. Caching was implemented for point distances and path lengths, with updates triggered only as needed. Geometry consistency validation is deferred to the final stage of the path life-cycle to streamline data streaming. Additionally, stroke trimming now uses binary search, circle geometry for caps and joints is pre-cached. After this optimization, we achieved a performance enhancement in stroke rendering of approximately 3x.
[Stroke Generation Performance Comparison. Before: 200fps -> After: 676fps]
Blending and Compositions
We have reduced the number of context switches during masking operations, leading to improved performance. Additionally, new decomposed Shaders were introduced to optimize the execution of various blending methods. Support for new masking methods, including Lighten and Darken, has also been added, offering greater flexibility in visual effects. The ThorVG WebGPU engine currently supports the following blending modes: Normal, Multiply, Screen, Overlay, Darken, Lighten, Color Dodge, Color Burn, Hard Light, Soft Light, Difference, Exclusion, Add.
[Support for Various WebGPU Blending Types]
More Optimizations
We implemented memory optimizations by using a single stencil buffer for all operations, significantly reducing GPU memory pressure. Additionally, gradient values are now pre-cached into a texture, allowing GPU samplers to efficiently manage spread and interpolation computations. The pre-cached gradient values and reduced context switches further enhanced both the performance and visual quality of the rendering.
[Gradient Fill Transform]
More Feature Coverage
We added support for Path Clipping and Viewport management. Path clipping allows parts of a graphic that fall outside a defined clipping area to be hidden, enabling more efficient rendering and control over what is displayed within the scene. This feature is particularly useful when managing complex shapes or focusing on specific regions of a graphic, ensuring that only the visible portions are processed and rendered. Viewport defines the visible area in which the rendering occurs, allowing control over the portion of the canvas or scene that is rendered to the screen. By setting the viewport, developers can manage the scale and positioning of content within a specified region, offering greater flexibility in rendering larger scenes or zooming into specific areas without recalculating the entire graphic.
[Path Clipping (Left) and Viewport (Right)]
Lottie Animation
In this update, the ThorVG Lottie feature has been significantly enhanced in terms of specification support, functionality stability, and performance. Lottie rendering performance has improved by approximately 10% compared to the last version v0.14, with new support for Layer Effects, Text Range Selector, User Interaction, Offset Path, and extended Masking capabilities.
Layer Effect Support
The biggest feature addition in ThorVG is Layer Effect support. Layer Effects in Lottie are related to post-processing effects and can create various visual transformations through post-processing image manipulation. While there are various types of effects within Layer Effects, ThorVG will start by supporting the widely-used Blur effect first and gradually expand to other types such as Drop Shadow. Please note that Layer Effects are advanced features that come with higher processing costs, making them ideal for creating impactful visuals while offering enhanced creative control and dynamic visual presentations.
[Lottie Layer Effect (Gaussian Blur) in ThorVG]
Interactive Lottie Support
ThorVG’s Interactive Lottie Feature introduces the ability to make Lottie animations responsive to user interactions, significantly enhancing the user experience. This feature allows developers to trigger, control, and manipulate animations in real-time based on user inputs such as clicks, touches, or hover actions, and then play the corresponding animation segment based on the application's context.
[Interactive Lottie Animation in ThorVG]
For this interaction, ThorVG introduced a mechanism for searching for specific objects within a Lottie scene and determining the response between those objects and user input. By default, the unit of search is a Lottie Layer, and users can determine the target they want to search for through its name. To facilitate this process, ThorVG allows users to easily determine whether a specific object within a Lottie scene has been selected by identifying the object and providing its touch area (bounding box). Please check the demo code for basic interaction.
[Interactive Lottie Workflow in ThorVG]
Text Range Selector Support
ThorVG’s text capabilities have been enhanced with new features and corrections, providing greater flexibility and precision for text animations in Lottie. We’ve introduced support for selecting and animating text based on defined ranges, improved control over line spacing for more sophisticated layouts, and added the ability to randomize text animations for dynamic visual effects.
[Dynamic Lottie Texts in ThorVG]
Offset Path Support
The offset curve is a curve parallel to the original one at a specified distance. For Bezier curves, generating an offset curve is non-trivial. Although it can be done analytically, the resulting curve is no longer a polynomial and cannot be represented as a Bezier curve:
To address this, different techniques can be employed to quickly and accurately estimate the offset curve as a Bezier curve. In general, this can be tricky, but a straightforward approach can be applied in most cases. For each point along the original Bezier curve, the tangent vector at that point is computed, which can be derived from the first derivative of the Bezier curve's parametric equation. From the tangent vector, the normal vector is calculated by rotating the tangent vector 90 degrees in either direction (left or right). Next, each control point of the original Bezier curve is moved by a specified offset distance along the corresponding normal vector. These resulting points are then connected, creating new segments that can be intersected with adjacent segments. This process yields...
ThorVG 0.14.10
This release includes several improvements and minor bug fixes:
- [SwEngine] Corrected blending operations in certain Lottie animations, ensuring proper rendering behavior. #2704
- [SwEngine] Enhanced support for drawing direct images with matte and blending compositions, improving overall rendering accuracy. #1767
- [SwEngine] Fixed the issue where 8-bit grayscale images were not blending correctly during rendering.
- [Renderer] Resolved a regression causing rendering failures when text assets were missing. #2715
- [Lottie] Improved support for the Text Range Selector, now excluding spaces among character, words, and lines when using text-based. #2178
- [Lottie] Updated line spacing calculations to consider the Text Range Selector, applying the maximum spacing value for each line for better text rendering. #2178
- [SVG] Fixed an issue where text was not being appended correctly to the SVG scene, ensuring proper rendering of text elements.
Full Changelog: v0.14.9...v0.14.10
ThorVG 0.14.9
This release includes several improvements and minor bug fixes:
- [SwEngine] Improved accuracy in dashed line drawing.
- [Lottie] Corrected TrimPath handling for values exceeding the specification range.
- [Lottie] Enhanced reliability when parsing JSON, addressing cases with "null" data. #2703
- [SVG] Fixed a rendering issue where matrix inversion required precision greater than 1e-6.
- [SVG] Resolved a regression bug that caused the omission of drawing due to text nodes. #2706
- [TTF] Fixed an issue with incorrect rendering where spaces and invalid glyphs were inserted #2687
Full Changelog: v0.14.8...v0.14.9
ThorVG v0.14.8
This release includes several improvements and minor bug fixes:
- [SwEngine] Rectified an issue where anti-aliased outline colors were incorrectly blended.
- [GlEngine] Corrected an issue where stroke drawing was omitted at small line sizes. #2435
- [GlEngine] Fixed the miter limit calculation to ensure correct fallback to bevel join.
- [Renderer] Resolved an issue where text updates were missing after changing italic or font size. #2676 #2669
- [Lottie] Fixed a regression bug affecting TrimPath behavior. #2670
- [Lottie] Addressed an issue where TrimPaths were not applied consistently across groups.
- [Lottie] Corrected an over-range issue in color interpolation.
- [Lottie] Stabilized Lottie Expressions to prevent several crashes.
- [SVG] Adjusted out-of-range HSL values. #2678
Full Changelog: v0.14.7...v0.14.8
ThorVG 0.14.7
This release includes several improvements and minor bug fixes:
- [Lottie] Added support for ShapeModifiers OffsetPath property. #2230
- [Lottie] Fixed a crash related to Text updates when a carriage return (13) character is introduced.
- [Lottie] Ensured a null terminator is present at the end of copied JSON data. #2642
- [Common] Removed the TexMap Experimental feature. #1372
- [SwEngine] Fixed memory access violations causing crashes during texture mapping.
- [Infra] Updated the Meson build to override pkgconfig dependencies, allowing ThorVG to be used as a subproject.
Full Changelog: v0.14.6...v0.14.7