MingaEditor.Renderer.Caches (Minga v0.1.0)

Copy Markdown View Source

Explicit render-pipeline cache state, replacing process-dictionary entries.

Each field corresponds to a former Process.put/get key used across the render pipeline stages. Renderer.Server retains the struct across frames and injects it into RenderPipeline.Input; it never crosses back into Editor state.

Ownership by stage

  • Chrome (chrome_prev_*): RenderPipeline, stage 5 fingerprint cache.
  • Content (search_decoration_cache, doc_highlight_cache): consumed by ContentHelpers.build_render_ctx/3; cleared when the fingerprint changes.
  • Emit (last_title, last_window_bg, last_link_cursor): consumed by Frontend.Emit stage 7.
  • Adapter (adapter_gui_caches): core GUI adapter fingerprint state.

Summary

Functions

Records the frame explicitly applied by the current frontend generation.

Creates a fresh Caches struct with first-frame defaults.

Clears frontend-retained state tracking after the frontend reports ready again.

Types

t()

@type t() :: %MingaEditor.Renderer.Caches{
  adapter_gui_caches: Minga.Frontend.Adapter.GUI.Caches.t(),
  chrome_prev_fingerprint: integer() | nil,
  chrome_prev_result: term(),
  cmd_hover_link_cache: term(),
  doc_highlight_cache: term(),
  frame_render_path: :patch | :full,
  frame_rows_rasterized: non_neg_integer(),
  last_acknowledged_frame_seq: non_neg_integer(),
  last_emitted_frame_seq: non_neg_integer(),
  last_frame_keyframe?: boolean(),
  last_link_cursor: boolean() | nil,
  last_title: String.t() | nil,
  last_window_bg: non_neg_integer() | nil,
  recovery_generation: non_neg_integer(),
  search_decoration_cache: term()
}

Functions

acknowledge_frame(caches, frame_seq, generation)

@spec acknowledge_frame(t(), non_neg_integer(), non_neg_integer()) :: t()

Records the frame explicitly applied by the current frontend generation.

new()

@spec new() :: t()

Creates a fresh Caches struct with first-frame defaults.

reset_frontend_state(caches)

@spec reset_frontend_state(t()) :: t()

Clears frontend-retained state tracking after the frontend reports ready again.