https://github.com/dioxuslabs/anyrender
2D Canvas abstraction
https://github.com/dioxuslabs/anyrender
Last synced: 11 days ago
JSON representation
2D Canvas abstraction
- Host: GitHub
- URL: https://github.com/dioxuslabs/anyrender
- Owner: DioxusLabs
- License: apache-2.0
- Created: 2025-10-05T19:02:37.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-10-06T01:01:05.000Z (10 months ago)
- Last Synced: 2025-10-06T03:09:33.138Z (10 months ago)
- Language: Rust
- Size: 249 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# AnyRender
**A Rust 2D drawing abstraction.**
[](https://xi.zulipchat.com)
[](https://deps.rs/repo/github/dioxuslabs/anyrender)
[](#license)
[](https://crates.io/crates/anyrender)
[](https://docs.rs/anyrender)
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 .
## Crates
### `anyrender`
The core [anyrender](https://docs.rs/anyrender) crate is a lightweight type/trait-only crate that defines three abstractions:
- **The [PaintScene](https://docs.rs/anyrender/latest/anyrender/trait.PaintScene.html) 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](https://docs.rs/anyrender/latest/anyrender/trait.WindowRenderer.html) trait abstracts over types that can render to a window**
- **The [ImageRenderer](https://docs.rs/anyrender/latest/anyrender/trait.ImageRenderer.html) trait abstracts over types that can render to a `Vec` image buffer**
### Backends
Currently existing backends are:
- [anyrender_vello_hybrid](https://docs.rs/anyrender_vello_hybrid) which draws using [vello_hybrid](https://docs.rs/vello_hybrid)
- [anyrender_vello_cpu](https://docs.rs/anyrender_vello_cpu) which draws using [vello_cpu](https://docs.rs/vello_cpu)
- [anyrender_vello](https://docs.rs/anyrender_vello) which draws using [vello](https://docs.rs/vello)
- [anyrender_skia](https://crates.io/crates/anyrender_skia) which draws using Skia (via the [skia-safe](https://github.com/rust-skia/rust-skia) crate)
Contributions for other backends (tiny-skia, 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](https://docs.rs/anyrender_svg) allows you to render SVGs with AnyRender. [usvg](https://docs.rs/usvg) is used to parse the SVGs.
- [blitz-paint](https://docs.rs/blitz-paint) can be used to HTML/CSS (and markdown) that has been parsed, styled, and layouted by [blitz-dom](https://docs.rs/blitz-dom) using AnyRender.
- [polymorpher](https://github.com/Aiving/polymorpher) implements Material Design 3 shape morphing, and can be used with AnyRender by enabling the `kurbo` feature.
### Utility crates
- [wgpu_context](https://docs.rs/wgpu_context) is a utility for managing `Device`s and other WGPU types
- [pixels_window_renderer](https://docs.rs/pixels_window_renderer) implements an AnyRender `WindowRenderer` for any AnyRenderer `ImageRenderer` using the [pixels](https://docs.rs/pixels) crate.
- [softbuffer_window_renderer](https://docs.rs/softbuffer_window_renderer) implements an AnyRender `WindowRenderer` for any AnyRenderer `ImageRenderer` using the [softbuffer](https://docs.rs/softbuffer) crate.
## 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.
AnyRender0.60.70.80.90.100.11
kurbo0.120.130.130.130.130.13
peniko0.50.60.60.60.60.6
WGPU
wgpu262728282929
wgpu_context0.10.20.40.50.60.6–0.7
Vello
anyrender_vello0.60.70.80.90.100.11–0.12
vello0.60.7 10.80.80.90.9
Vello Hybrid
vello_hybrid0.0.40.0.60.0.70.0.70.0.80.0.9
anyrender_vello_hybrid0.10.20.30.40.50.7–0.8
Vello CPU
vello_cpu0.0.40.0.60.0.70.0.70.0.80.0.9
anyrender_vello_cpu0.80.90.100.110.120.14
Skia
skia-safe0.890.910.930.930.93 20.97
anyrender_skia0.10.40.50.60.70.9
Content Libs
anyrender_svg0.60.80.90.100.110.12
anyrender_serialize——0.10.20.30.5
CPU WindowRenderers
pixels_window_renderer0.10.20.30.40.50.6
softbuffer_window_renderer0.10.20.30.40.50.6
1. The 0.7 release line depended on a git revision of Vello, equivalent to Vello 0.7 and sparse strips 0.0.6.
2. Within the 0.10 line, `anyrender_skia` 0.8.x upgraded `skia-safe` from 0.93 to 0.97.
## Minimum supported Rust Version (MSRV)
This version of AnyRender has been verified to compile with **Rust 1.86** 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
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or )
- MIT license ([LICENSE-MIT](LICENSE-MIT) or )
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.
[kurbo]: https://crates.io/crates/kurbo
[Rust Code of Conduct]: https://www.rust-lang.org/policies/code-of-conduct