https://github.com/dioxuslabs/anyrender
2D Canvas abstraction
https://github.com/dioxuslabs/anyrender
Last synced: 8 months 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 (8 months ago)
- Default Branch: main
- Last Pushed: 2025-10-06T01:01:05.000Z (8 months ago)
- Last Synced: 2025-10-06T03:09:33.138Z (8 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](https://docs.rs/anyrender_vello) which draws using [vello](https://docs.rs/vello)
- [anyrender_vello_cpu](https://docs.rs/anyrender_vello_cpu) which draws using [vello_cpu](https://docs.rs/vello_cpu)
Contributions for other backends (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.
### 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.
## 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.
[color]: https://crates.io/crates/color
[kurbo]: https://crates.io/crates/kurbo
[Rust Code of Conduct]: https://www.rust-lang.org/policies/code-of-conduct