Skip to main content

Module draw_ctx

Module draw_ctx 

Source
Expand description

DrawCtx — the unified drawing interface shared by the software (GfxCtx) and hardware (GlGfxCtx) rendering paths.

Every Widget::paint implementation receives a &mut dyn DrawCtx. The concrete type is either:

  • GfxCtx — software AGG rasteriser (used when a widget opts into a back-buffer or when GL is unavailable).
  • GlGfxCtx — hardware GL path: shapes are tessellated via tess2 and submitted as GPU draw calls.

The two implementations expose identical method signatures so that widget paint bodies are unchanged regardless of the render target.

Structs§

GradientStop
One color stop in a bridge-level gradient paint.
LinearGradientPaint
Linear gradient fill paint expressed in local drawing coordinates.
PatternPaint
Repeating raster pattern paint expressed in SVG/user drawing coordinates.
RadialGradientPaint
Radial/focal gradient fill paint expressed in local drawing coordinates.

Enums§

FillRule
Fill rule used when rasterizing closed paths.
GradientSpread
How a gradient behaves outside the normalized 0..=1 range.

Traits§

DrawCtx
Unified 2-D drawing context.
GlPaint
Trait for widgets that want to render 3-D (or other GPU) content inline during the widget paint pass.