AnyRender
A Rust 2D drawing abstraction.
AnyRender is a 2D drawing abstaction that allows applications/frameworks to support many rendering backends through a unified API.
Discussion of AnyRender development happens in the Linebender Zulip at https://xi.zulipchat.com/.
Crates
anyrender
The core anyrender crate is a lightweight type/trait-only crate that defines three abstractions:
- The PaintScene trait accepts drawing commands.
Applications and libraries draw by pushing commands into a
PaintScene. Backends generally execute those commands to
produce an output (although they may do other things like store them for later use).
- The WindowRenderer trait abstracts over types that can render to a window
- The ImageRenderer trait abstracts over types that can render to a
Vec<u8> image buffer
Backends
Currently existing backends are:
Contributions for other backends (femtovg, etc) would be very welcome.
Content renderers
These crates sit on top of the the AnyRender abstraction, and allow you render content through it:
- anyrender_svg allows you to render SVGs with AnyRender. usvg is used to parse the SVGs.
- blitz-paint can be used to HTML/CSS (and markdown) that has been parsed, styled, and layouted by blitz-dom using AnyRender.
- polymorpher implements Material Design 3 shape morphing, and can be used with AnyRender by enabling the
kurbo feature.
Utility crates
- wgpu_context is a utility for managing
Devices and other WGPU types
- pixels_window_renderer implements an AnyRender
WindowRenderer for any AnyRenderer ImageRenderer using the pixels crate.
- softbuffer_window_renderer implements an AnyRender
WindowRenderer for any AnyRenderer ImageRenderer using the softbuffer crate.
- image_filters_types defines the filter graph types (
Filter, FilterEffect and the primitive parameters) that anyrender::filters re-exports, generic over the content of feImage.
- pixmap provides minimal RGBA8 pixel buffers (
Pixmap, PixmapRef, PixmapMut) with no dependencies.
Version compatibility
AnyRender crates are released together, so a given anyrender core release lines up with a
specific set of backend, content-renderer and utility crate versions, as well as the upstream
dependency versions they were built against. Use the same release line across all AnyRender
crates in your project.
| AnyRender | 0.6 | 0.7 | 0.8 | 0.9 | 0.10 | 0.11 | 0.12 | 0.13 | 0.14 | 0.15 |
kurbo | 0.12 | 0.13 | 0.13 | 0.13 | 0.13 | 0.13 | 0.13 | 0.13 | 0.13 | 0.13 |
peniko | 0.5 | 0.6 | 0.6 | 0.6 | 0.6 | 0.6 | 0.6 | 0.6 | 0.6 | 0.6 |
| WGPU |
wgpu | 26 | 27 | 28 | 28 | 29 | 29 | 29 | 29 | 30 | 30 |
wgpu_context | 0.1 | 0.2 | 0.4 | 0.5 | 0.6 | 0.6–0.7 | 0.8 | 0.9 | 0.10 | 0.11 |
| Vello |
anyrender_vello | 0.6 | 0.7 | 0.8 | 0.9 | 0.10 | 0.11–0.12 | 0.13 | 0.14 | 0.15 | 0.16 |
vello | 0.6 | 0.7 1 | 0.8 | 0.8 | 0.9 | 0.9 | 0.9 | 0.10 | 0.11 | 0.12 |
| Vello GPU / Hybrid |
vello_hybrid | 0.0.4 | 0.0.6 | 0.0.7 | 0.0.7 | 0.0.8 | 0.0.9 | 0.0.9 | 0.1 | — | — |
vello_gpu | — | — | — | — | — | — | — | — | 0.3 | 0.4 |
anyrender_vello_gpu | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.7–0.8 | 0.9 | 0.10 | 0.11 | 0.12 |
| Vello CPU |
vello_cpu | 0.0.4 | 0.0.6 | 0.0.7 | 0.0.7 | 0.0.8 | 0.0.9 | 0.0.9 | 0.1 | 0.3 | 0.4 |
anyrender_vello_cpu | 0.8 | 0.9 | 0.10 | 0.11 | 0.12 | 0.14 | 0.15 | 0.16–0.17 | 0.18 | 0.19 |
| Skia |
skia-safe | 0.89 | 0.91 | 0.93 | 0.93 | 0.93 2 | 0.97 | 0.97 | 0.99 | 0.153.3 | 0.157.0 |
anyrender_skia | 0.1 | 0.4 | 0.5 | 0.6 | 0.7 | 0.9 | 0.10 | 0.11 | 0.12 | 0.13 |
| Tiny-skia |
anyrender_tiny_skia | — | — | — | — | — | — | — | — | — | 0.1 |
| Content Libs |
image_filters_types | — | — | — | — | — | — | — | — | — | 0.1 |
anyrender_svg | 0.6 | 0.8 | 0.9 | 0.10 | 0.11 | 0.12 | 0.13 | 0.14 | 0.15 | 0.16 |
anyrender_serialize | — | — | 0.1 | 0.2 | 0.3 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 |
CPU WindowRenderers |
pixels_window_renderer | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 0.10 |
softbuffer_window_renderer | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 0.10 |
- The 0.7 release line depended on a git revision of Vello, equivalent to Vello 0.7 and sparse strips 0.0.6.
- Within the 0.10 line,
anyrender_skia 0.8.x upgraded skia-safe from 0.93 to 0.97.
In the 0.14 line, upstream vello_hybrid was renamed to vello_gpu. In the 0.15 line, the AnyRender backend was renamed from anyrender_vello_hybrid to anyrender_vello_gpu (breaking). Earlier versions in the table were published as anyrender_vello_hybrid.
Minimum supported Rust Version (MSRV)
This version of AnyRender has been verified to compile with Rust 1.90 and later.
Future versions of AnyRender might increase the Rust version requirement.
It will not be treated as a breaking change and as such can even happen with small patch releases.
License
Licensed under either of
at your option.
Contribution
Contributions are welcome by pull request. The Rust code of conduct applies.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.