* Use `add_plugins` as `add_plugin` is deprecated.
* Use `world.resource` instead of unwrapping `world.get_resource`
as it gives better error messages.
* Add the `VelloRenderer` to the render app in the `finish` method
as the `Renderer` is async and may not have initialized by the
time that the Vello plugin is being set up.
This prevents having 2 versions of `pollster` pulled into the workspace.
The workspace provided `pollster` `0.3`, while `headless` was still
using `0.2.5`.
* Add GPU profiling
* Fix conditional compilation for `headless`
* Add full profiling
* Productionise
* Fix MacOS trace file
* Try to make it easier to tell what's important
* Resolve CI issues
This turns on clippy checking and also fixes all lints in the code.
Many lints are obvious improvements. Only a small number are slightly annoying, so I think overall worth having a vanilla default config.
I should set up git pre-push hooks. Also, I am surprised this needed a fmt, and would not add all the extra vertical space if it were up to me, but the reason we use default rustfmt is to avoid spending mental energy on such details.
Adds full support for COLRv1 radial gradients based on the two-point conical gradient algorithm at https://skia.org/docs/dev/design/conical/
Also adds robustness to degenerate cases in gradient encoding:
* Radial where p0 == p1 && r0 == r1 renders transparent solid
* Empty stops render as transparent solid
* Single stop renders as solid
This patch implements the pad, repeat and reflect extend modes for gradient brushes. Adds a new example demonstrating the functionality.
Also fixes a few bugs:
* Clamps alpha in blend.wgsl for the `blend_compose` function. The `Plus` mode was generating `alpha > 1.0` leading to incorrect rendering.
* Small change to radial gradients in fine.wgsl to reject pixels outside the cone when the circles don't nest. This requires further work to properly extend the cone when one of the radii is not 0.
The examples logged the total processing time for an SVG including both
parse and GPU buffer encoding times. Times for these two operations are
now logged separately.
This change moves the vello encoding logic to a new crate under
crates/encoding. Combined with the `vello_shaders` crate, this enables
lightweight integration of the Vello pipelines into renderers that don't
depend on wgpu (or perhaps written in languages other than Rust).
The Scene/Fragment API currently remain the vello crate.
Using vector graphics for the image doesn't make a huge amount of sense. The flower photo is by Raph and happily licensed to anyone who wants to use it.
This allows the graph to display at a reasonable scale in the face of
fluctuations and a max recorded sample that is much larger than the
current average.
The Auto* modes should have wider compatibility as they implement
fallback behavior based on what the platform supports. This also means
that on web "vsync off" will likely be incorrect.