Skip to main content

Crate telar_renderer_core

Crate telar_renderer_core 

Source

Re-exports§

pub use culling::FontMetrics;
pub use culling::extend_bounds;
pub use font_config::FontConfig;

Modules§

culling
dirty
font_config
gpu_sync
Process-global lock serializing GPU/window surface lifecycle against active rendering.
perf
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.

Structs§

BorderRadius
Color
DrawState
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.
Gradient
GradientStop
GradientStops
Up to 8 gradient color stops. Fixed-size array preserves the Copy bound.
ImageData
PathData
PathStyle
RectStyle
RendererBuild
What a renderer is built from, beyond the surface it draws on.
ScaleScratch
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.
Shadow
ShadowLayout
Stroke
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.
TextRun
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::RichText base style, so a run overrides only what varies inline (bold, italic, a link’s colour).
TextStyle

Enums§

BorderWidths
How thick a rect’s border is on each side.
DrawCommand
FillRule
GlyphRaster
Which grid the glyphs are rasterized onto.
GradientKind
ImageFilter
LineCap
LineJoin
Paint
PathVerb
RendererError
TextAlign
Horizontal alignment of text within its box. Start is the writing-direction start (left in LTR).

Constants§

BEZIER_CIRCLE_K

Traits§

ExternalTexture
A texture an application rendered itself, handed to Telar to place in the frame.
RenderBackend
RendererFactory
Builds the renderer for a surface — the seam an out-of-tree frontend installs to draw Telar’s frames itself.
Scale
ShapeStyle
TextMetrics
How much room a string takes — all a widget tree needs to know about text before anything is drawn.

Functions§

blur_padding
blur_sigma
border_inner_shape
The inner edge of a border: the box pulled in by each side’s thickness, with the corners tightened to match.
expand_fill_layers
for_each_with_matrix
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.
hash_draw_commands
hash_draw_commands_into
hash_path_style
hash_pod_slice
line_height
The height of one line of text at font_size. See TextMetrics::line_height.
measure_ink_bounds
The text’s drawn glyph extent (ink_top, ink_height). See TextMetrics::ink_bounds.
measure_rich_text
Measures a paragraph of styled runs. See TextMetrics::measure_runs.
measure_text
Measures the logical (width, height) of text wrapped to max_width. See TextMetrics::measure.
premultiply_rgba
set_default_text_metrics
Installs metrics only if nothing is installed yet, and reports whether it took.
set_text_metrics
Installs the process-wide text measurer, replacing whatever was there.
transform_clip_rect
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.