Updated WASM binding to bring WebGPU on the web player.
binding will generate a WASM binary, which can render animation through both SW and WG raster engine.
A raster engine will be chosen by parameter `engine`, when initializing.
Spec out this incomplete experimental feature,
this is a still promising one, we will reintroduce
this officially after 1.0 release
size: -2kb
issue: https://github.com/thorvg/thorvg/issues/1372
If a Meson option is typed as `boolean`, the `get_option` returns a
boolean, and comparing it with `true` is redundant. Meson also errors if
you try to compare across types, so it couldn't _not_ be a boolean.
Also, Meson is not C, so no need for parentheses around `if` conditions.
A pkgconfig file is already provided, which enables using `thorvg` once
it is installed. However, this file is not, and cannot be, available at
setup time if using `thorvg` as a subproject.
In such cases, Meson provides the `override_dependency` mechanism for a
subproject to tell its parent how to use it.
In certain cases, the user might want to set mapped memory directly.
This update ensures that a null terminator is appended to the string data.
Co-Authored-By: Mira Grudzinska <mira@lottiefiles.com>
Issue: https://github.com/thorvg/thorvg/issues/2642
Deep shader refactoring for the following purposes:
* used pre-calculated gradient texture instead of per-pixel gradient map computation
* used HW wrap samples for fill spread setting
* unified gradient shader types
* used single shader module for composition instead of signle module per composition type
* used single shader module for blending for each of fill type (solid, gradient, image) instaed of signle module per blend type
* much easier add new composition and blend equations
* get rided std::string uasge
* shaders code is more readable
For rounded rectangles the roundness value should
be determined using to the formula:
r = min(r, max(size.x, size.y)/2)
rather than the previous method:
r = min(size.x/2, size.y/2, r)
* bind groups creation in real time removed - performance boost
* blend and composition shaders decomposed - performance boost
* shader modules and pipeline layouts generalized - less memory usage
* shared single stencil buffer used - less memory usage
* bind groups usage simplified
* general context API simplified and generalized
* all rendering logic moved into new composition class
* ready for hardware MSAA (in next steps)
* ready for direct mask applience (in next steps)
For Bezier curves, we typically use 't' as a parameter
within the 0-1 range, while 'at' is used for the parameter
scaled by the curve's length. In one of the functions,
an incorrect name was used, which could be confusing.
No logical changes.
The epsilon value currently used for the precision
of Beziers calculations is sufficient for comparing
curve lengths. However, for the parameter t, which
ranges from 0 to 1, an accuracy of 1% can introduce
errors.
The solution is to increase the precision for the t
parameter while keeping the rest of the calculations
at the previously used epsilon value.
@Issue: https://github.com/thorvg/thorvg/issues/2619
In case of modern systems, size is not a big problem,
so we turn the optimization option to default
for better performance.
FPS: ~20% enhanced
Size: ~25% increased
Note that this doesn't affect to the web player.
The current Paint::bounds(transform=true) returns the coordinates
of the paint in its local coordinates after transformation.
However, it did not convert the origin to the world coordinate.
This is problematic when the user wants to determine
the paint's position and size with the origin being the canvas.
Specifically, this matters that when the paint is belonged
to a certain scene.
Now, the bounds() method returns the coordinates
of the paint's bounding box with the corrected world space.
User can figure out the actual boundary within the painted result.
Remark that, this may break the functional behavior compatibility.
This utility method allows access to a specific paint instance
by its unique identifier.
Experimental API:
- const Paint* Picture::paint(uint32_t id)
- const Tvg_Paint* tvg_picture_get_paint(Tvg_Paint* paint, uint32_t id)
This function computes a unique identifier value based on the provided string.
You can use this to assign a unique ID to the Paint object.
Experimental APIs:
- uint32_t Accessorr::id(const char* name)
- uint32_t tvg_accessor_id(const char* name)
Lighten is applied, where multiple masks intersect,
the highest transparency value is used.
Darken is applied, where multiple masks intersect,
the lowest transparency value is used.
Experimental API:
- CompositeMethod::LightenMask
- CompositeMethod::DarkenMask
issue: https://github.com/thorvg/thorvg/issues/2608
For a linear gradient defined by identical start and end
points, and for a radial gradient with a radius of 0,
the rendered shape should have the color of the last
specified color stop.
The documentation has been updated accordingly.
@Issue: https://github.com/thorvg/thorvg/issues/2582