Expand description
Draw APIs
Multiple drawing APIs are available. Each has a slightly different purpose:
- High-level “themed widget components” are available through
DrawCx
. This is the primary drawing interface for widgets. - Basic drawing components (shapes) are available through
DrawIface
in this module. This can be accessed viaDrawCx::draw_device
. - The graphics backend may support custom pipelines, for example
kas-wgpu::draw::CustomPipe
(used by the Mandlebrot example).
Text may be drawn by either DrawCx
or DrawIface
with a slightly
different API (using theme properties or directly specifying colors and effects).
Draw order
All draw operations happen within a “draw pass”. The first pass corresponds
to the window, while additional passes may be clipped and offset (see
DrawIface::new_pass
). Draw passes are executed sequentially in the order
defined.
Within each pass, draw operations may be batched, thus draw operations may not happen in the order queued. Exact behaviour is defined by the graphics backend. In general, it may be expected that batches are executed in the following order:
- Square-edged primitives (e.g.
Draw::rect
) - Images
- Rounded or other partially-transparent primitives (e.g.
DrawRounded::circle
) - Custom draw routines (
CustomPipe
) - Text
Re-exports
pub use draw::DrawImpl;
internal_doc
pub use draw_rounded::DrawRoundedImpl;
internal_doc
internal_doc
Modules
- Colour types
Structs
- Allocation failed: too large or zero sized
- Draw interface object
- Handle for an image
- Identifier for an image allocation
- Draw pass identifier
- Shared draw state
Enums
- Image formats available for upload
- Type of draw pass
Traits
- Base drawing interface for
DrawIface
- Extension over
Draw
for rounded shapes - Interface over
SharedState