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/.
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
Currently existing backends are:
- anyrender_vello which draws using vello
- anyrender_vello_cpu which draws using vello_cpu
- anyrender_vello_hybrid ALPHA which draws using vello_hybrid
- anyrender_skia which draws using Skia (via the skia-safe crate)
Contributions for other backends (tiny-skia, femtovg, etc) would be very welcome.
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
kurbofeature.
- wgpu_context is a utility for managing
Devices and other WGPU types - pixels_window_renderer implements an AnyRender
WindowRendererfor any AnyRendererImageRendererusing the pixels crate. - softbuffer_window_renderer implements an AnyRender
WindowRendererfor any AnyRendererImageRendererusing the softbuffer crate.
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.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
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.