Skip to main content

Crate truce_cpu

Crate truce_cpu 

Source
Expand description

CPU rendering backend for truce plugins (tiny-skia + fontdue).

Parallels truce-gpu at the same level of the crate graph: both implement truce_gui_types::RenderBackend on their respective primitives (CpuBackend uses tiny-skia software rasterization; truce_gpu::WgpuBackend uses wgpu). The built-in editor (truce_gui::BuiltinEditor) holds an internal CpuBackend for its iOS / pre-blit rendering path; GpuEditor routes through WgpuBackend for non-iOS.

Plugin authors don’t usually depend on this crate directly - truce-gui::default_editor pulls it in. Custom-editor plugins (egui / iced / slint) that want a software RenderBackend for testing without a GPU can opt in here.

Modules§

font
Font rendering using fontdue (TrueType rasterization).

Structs§

CpuBackend
CPU-based rendering backend.

Traits§

ColorExt
Extension trait giving truce_gui_types::theme::Color the to_skia / to_premultiplied methods. Lives here (next to the tiny-skia rasterizer that consumes them) so truce-gui-types stays rasterizer-free.