Skip to main content

Module gpu

Module gpu 

Source
Expand description

GPU renderer — implements madori::RenderCallback backed by garasu’s glyphon-wrapped text renderer. Each frame:

  1. Locks the shared EditorState.
  2. Collects visible buffer lines into a single string.
  3. Builds a glyphon Buffer (re-created each frame — phase 1.B; phase 2 will diff + reuse).
  4. Prepares + renders through madori::RenderContext::text.

Colors are the Vellum fleet theme (warm aged-paper Nord-matte), sourced from escriba_ui::chrome::ChromePalette so the GPU chrome matches the rest of the fleet (mado, tear, frostmourne, …) and escriba’s TUI backend. Text is rendered in snow1 (#E2DBC8, warm cream foreground) over a night0 (#16140E, parchment ground) background. The status line is rendered in ice_cyan (#94BBB8, the matte accent).

Structs§

GpuRenderer
The GPU render callback.

Functions§

build_ecosystem
The highlight registry escriba renders through: tree-sitter grammars (hikari-ts) take precedence for the languages they cover, and the zero-dep table backend fills every other language. So .rs gets real tree-sitter highlighting while .py / .lisp / .json / … get the batteries-included table lexer — and both flow through the same coverage-complete HlClass partition. Registration order is load-bearing: Ecosystem::resolve returns the first matching plugin, so tree-sitter (registered first) wins for its languages; the table backend is skipped for any language tree-sitter already covers (no duplicate). If the tree-sitter host fails to build, the table backend covers everything — never a panic, never an empty registry.
cursor_shape
The CursorShape the GPU backend should draw for mode. Derived from the single typed Mode::cursor_shape mapping shared with the TUI backend — so the GPU cursor (once it gains a dedicated glyph; today the buffer text carries the caret) renders the same shape the TUI does for any given mode. Exposed now so the shape is a typed value at the GPU layer, not a renderer-local literal later.
mode_color
Mode indicator color — used by higher-layer rendering paths that want a glance-readable color. Named by ROLE so the hue follows the active theme: Normal info, Insert success, Visual accent, Command warning.
mode_glyph
Map an editor Mode to its fleet Signal from EscribaSignals.

Type Aliases§

SharedState
Shared handle to the editor state — both the GPU renderer (reads) and the madori on_event callback (writes) hold one.