Skip to main content

Module headless

Module headless 

Source
Expand description

§Headless backend

A Painter that draws nothing and records every call, and a HeadlessBackend that has no window and records what the engine asks of it, so a Widget’s paint and a whole Engine can be unit tested without a display.

use pushrod::backend::headless::{PaintCall, RecordingPainter};
use pushrod::color::Color;
use pushrod::paint;

let mut p = RecordingPainter::default();
paint::fill(&mut p, Color::WHITE);
assert_eq!(p.calls, vec![PaintCall::Fill(Color::WHITE)]);

Structs§

HeadlessBackend
A Backend with no window: input is scripted, drawing is recorded, and nothing needs a display.
RecordingPainter
A Painter that records its calls in calls.

Enums§

PaintCall
One call made on a RecordingPainter.