TerminalRenderCache
Caller-owned primitive cache for render frames.
This cache consumes TerminalRenderFrameReader and stores copied primitive row data after the frame callback returns. It deliberately contains no backend-specific glyph runs, font state, paint objects, selection model, or UI timer logic. Swing, Compose, and other renderers can build their local layout and paint caches from this primitive data.
Cell and row planes may have spare capacity when rowCapacityReserve is non-zero. Only the prefix addressed by columns and rows is part of the current frame. The reserve lets renderers change a viewport's logical row count, for example while smooth-scroll overscan is active, without replacing the primitive arrays in the frame-update hot path.
This cache is mutable and requires caller confinement or external serialization. Array properties expose cache-owned storage for allocation-free reading. Do not mutate their contents or retain them across updates/reset, which may reuse or replace storage. Caches borrowed from a publisher are read-only for the duration of its reader lease.
Parameters
initial cache width in cells.
initial cache height in rows.
spare rows retained whenever primitive storage is allocated; must be non-negative.
Constructors
Properties
Last copied active buffer kind.
Packed codepoint storage referenced by clusterRefs.
Copied cluster references in row-major order. Zero means no cluster; other values pack a codepoint offset in the high 32 bits and a codepoint length in the low 32 bits.
Copied code words in row-major order. See TerminalRenderFrame.copyLine.
Last copied TerminalRenderFrame.contentGeneration, including a reader's conservative fallback.
Convenience cursor snapshot for tests and compatibility callers.
Last copied cursor blinking mode.
Whether the most recent updateFrom call changed the cursor state.
Last copied cursor column.
Last copied cursor generation.
Last copied cursor shape.
Last copied cursor visibility.
History lines discarded due to capacity wrapping since initialization.
Copied optional public extra-attribute words in row-major order.
Last copied frame generation.
Last copied image/placement generation, meaningful only while hasFrame is true. Compare for equality and qualify it by source identity and viewport mapping.
Whether any copied visible row contains SGR blinking text.
Last copied retained-history replacement/reflow generation.
Retained history lines reported by the most recent frame.
Copied optional hyperlink identifiers in row-major order. Zero means no hyperlink.
Copied placements borrowed with this cache and replaced on update or reset. Individual TerminalRenderImage resources are immutable and may be retained.
Cached per-row render generations.
Cached per-row marker for visible cells carrying the SGR blink attribute.
Cached per-row soft-wrap flags.
Last copied viewport-independent output boundary; Long.MAX_VALUE means unknown.
Last copied color palette.
Resolved scrollback offset copied by the most recent frame.
Whether the most recent updateFrom call changed the logical frame shape.
Last copied structure generation.
Functions
Copies row data, cursor state, active buffer kind, and color palette from the given frame into this cache's primitive storage.
Returns the codepoint length encoded in ref.
Returns the codepoint offset encoded in ref.
Returns cluster text for diagnostics or compatibility callers.
Copies changed rows and cursor state from reader.
Bulk-copies a stable published cache into this caller-owned cache.
Copies changed rows and cursor state for a caller-owned scrollback viewport.
Copies changed rows and cursor state for a caller-owned scrollback viewport with optional render-only overscan rows.
Copies retained rows in an inclusive absolute range from reader.