Module draw

Module draw 

Source
Expand description

§Draw APIs

Multiple drawing APIs are available. Each has a slightly different purpose:

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:

  1. Square-edged primitives (e.g. Draw::rect)
  2. Images
  3. Rounded or other partially-transparent primitives (e.g. DrawRounded::circle)
  4. Custom draw routines (CustomPipe)
  5. Text

Modules§

color
Colour types

Structs§

AllocError
Allocation failed: too large or zero sized
DrawIface
Draw interface object
ImageHandle
Handle for an image
ImageId
Identifier for an image allocation
PassId
Draw pass identifier
SharedState
Shared draw state

Enums§

ImageFormat
Image formats available for upload
PassType
Type of draw pass

Traits§

Draw
Basic draw interface for DrawIface
DrawImpl
Implementation target for Draw
DrawRounded
Extended draw interface for DrawIface providing rounded drawing
DrawRoundedImpl
Implementation target for DrawRounded
DrawShared
Interface over SharedState
DrawSharedImpl
Implementation target for DrawShared