MCPcopy Index your code
hub / github.com/DioxusLabs/anyrender

github.com/DioxusLabs/anyrender @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
580 symbols 1,104 edges 49 files 91 documented · 16%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

AnyRender

A Rust 2D drawing abstraction.

Linebender Zulip, #kurbo channel dependency status Apache 2.0 or MIT license. Crates.io Docs

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 (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 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

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

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.

Extension points exported contracts — how you extend this code

WindowRenderer (Interface)
Abstraction for rendering a scene to a window [6 implementers]
crates/anyrender/src/lib.rs
SkiaBackend (Interface)
(no doc) [3 implementers]
crates/anyrender_skia/src/window_renderer.rs
PaintScene (Interface)
Abstraction for drawing a 2D scene [7 implementers]
crates/anyrender/src/lib.rs
RenderContext (Interface)
(no doc) [16 implementers]
crates/anyrender/src/lib.rs
ImageRenderer (Interface)
Abstraction for rendering a scene to an image buffer [4 implementers]
crates/anyrender/src/lib.rs
WindowHandle (Interface)
A raw window handle that is `WasmNotSendSync`. For interop with wgpu. [1 implementers]
crates/anyrender/src/wasm_send_sync.rs

Core symbols most depended-on inside this repo

push
called by 35
crates/anyrender_serialize/src/json_formatter.rs
as_ref
called by 29
crates/anyrender/src/types.rs
insert
called by 18
crates/anyrender_skia/src/cache.rs
fill
called by 13
crates/anyrender_skia/src/scene.rs
fill
called by 13
crates/anyrender/src/recording.rs
device
called by 12
crates/wgpu_context/src/buffer_renderer.rs
pt_from
called by 12
crates/anyrender_skia/src/scene.rs
get_byte
called by 11
crates/anyrender/src/svg_path_parser.rs

Shape

Method 340
Function 106
Class 95
Enum 30
Interface 9

Languages

Rust100%

Modules by API surface

crates/anyrender/src/filters.rs58 symbols
crates/anyrender_skia/src/scene.rs49 symbols
crates/anyrender_serialize/src/lib.rs34 symbols
crates/anyrender/src/recording.rs24 symbols
crates/anyrender_serialize/tests/serialize.rs22 symbols
crates/anyrender_vello/src/window_renderer.rs21 symbols
crates/anyrender_vello_hybrid/src/window_renderer.rs20 symbols
crates/anyrender/src/null_backend.rs20 symbols
crates/wgpu_context/src/surface_renderer.rs19 symbols
crates/anyrender_vello_hybrid/src/scene.rs17 symbols
crates/wgpu_context/src/lib.rs16 symbols
crates/anyrender_vello_hybrid/src/webgl_scene.rs15 symbols

For agents

$ claude mcp add anyrender \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact