Lightweight per-phase frame timing, gated on the TELAR_PERF env var. When disabled every
entry point is a single relaxed-atomic load or an early return, so it is safe to leave the
instrumentation compiled into release builds. Enabled it accumulates per-phase durations
across both the UI thread (command build/clone) and the render thread (interpret/gpu) and
dumps rolling averages via tracing — stdout on desktop, logcat on Android.
Flat draw state tracking clips and transforms. Note: PushLayer and PopLayer commands are intentionally not tracked here; layers are managed outside this struct by the caller.
Reusable scratch for scaling draw commands to physical pixels on the software path. Holds the
output buffer plus per-frame caches keyed by the source Arc pointer, so a style shared by many
commands (the common case for a UI tree) is scaled and heap-allocated once per frame rather than
once per command.
Stroke style for drawing primitives. Includes join to control how corners are rendered in paths and rects; for line segments join is unused and defaults to Miter.
One inline run of a rich-text paragraph: a slice of text with its own weight, slant, and colour. Paragraph
metrics (font size, line height, wrapping, alignment) live on the DrawCommand::RichTextbase style,
so a run overrides only what varies inline (bold, italic, a link’s colour).
Iterates cmds calling f(cmd, cumulative_matrix) for every command. PushMatrix/PopMatrix update the matrix before the callback; all other commands see the matrix that was active when they were emitted.
Maps clip rect r (in the currently-active transform’s local space) to window space — the axis-aligned bounds of its four mapped corners. Widgets emit clip rects in their own local space, but the renderer clips in window space, so a clip must be mapped through the active cumulative matrix (scroll/layout translations) to compose correctly.