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.

Re-exports§

pub use crate::paints::FillRule;
pub use crate::paints::GradientSpread;
pub use crate::paints::GradientStop;
pub use crate::paints::LinearGradientPaint;
pub use crate::paints::PatternPaint;
pub use crate::paints::RadialGradientPaint;

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.