truce-cpu
CPU rendering backend for the truce built-in GUI.
Overview
Provides CpuBackend, a software implementation of
truce_gui_types::RenderBackend built on tiny-skia, plus the fontdue
glyph cache (font) and the ColorExt conversions the rasteriser
needs. This is the default renderer: it works on every platform without
a usable GPU, and its output is deterministic, which makes it the
reliable path for screenshot tests.
truce-cpu is an implementation detail of
truce-gui: BuiltinEditor rasterises the widget tree
into a tiny-skia pixmap through this backend and blits it to a wgpu
surface for compositing. Plugins don't depend on truce-cpu directly —
it's pulled in by truce-gui's default cpu feature. Its peer
truce-gpu provides the wgpu backend behind the gpu
feature.
Key types
CpuBackend-- tiny-skiatruce_gui_types::RenderBackendimplementationColorExt-- extension trait addingto_skia()/to_premultiplied()to the lighttruce_gui_types::theme::Colortype, so that type stays tiny-skia-freefont-- fontdue glyph cache + text measurement, fed by the bundled JetBrains Mono fromtruce-font
Usage
truce-cpu is selected automatically — the default cpu feature on
truce-gui enables it, and editor() renders through it: