densa-draw 0.2.2

GPU-independent display list for densa: a Canvas that batches rectangles and glyphs into instances
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! A frame's display list, independent of any GPU API.
//!
//! Painters draw through a [`Canvas`]: filled rectangles and glyphs (from a shared
//! `densa_text::GlyphCache`) become [`Instance`]s in an [`InstanceBuffer`], one quad each, in
//! the vertex layout `densa-render` uploads and draws in a single instanced draw call. Keeping
//! the list GPU-free makes every painter testable without a GPU, and lets other backends
//! draw the same list.
//!
//! Drawing allocates nothing once the frame's glyphs are cached.

mod canvas;
mod instance;

pub use canvas::{Canvas, CanvasState};
pub use densa_core::{Color, Point, Rect, Size};
pub use instance::{Instance, InstanceBuffer};