Renderer-side wrapper for a View.

A ViewRenderState bundles the per-view resources needed by the WebGL renderer, including:

  • A reference to the logical View (DOM element, size, index, etc.)
  • Per-view RenderBuffers (eg. snapshot buffers, depth buffers, etc.)
  • Cached DOM bounds used when repositioning/resizing the shared WebGL canvas

The renderer uses a single shared WebGL canvas that is moved/resized to the currently active view. ViewRenderState stores per-view buffers so inactive views can still keep a last-frame snapshot.

Constructors

Properties

renderBuffers: RenderBuffers

Per-view render targets/buffers (eg. snapshot render buffers).

saveCanvasBoundary: DOMRect

Cached DOM bounds of view.htmlElement.

This is typically used when generating snapshots or when restoring the canvas position during view activation/deactivation.

view: View

The logical view this renderer view represents.

Methods

  • Begins a snapshot operation for this view.

    Intended to prepare any render buffers and state required to render the view into an offscreen snapshot target (eg. for displaying the last rendered frame when the view is inactive).

    Parameters

    • Optionalparams: { height: number; width: number }

      Optional snapshot parameters.

      • height: number

        Snapshot height in CSS pixels.

      • width: number

        Snapshot width in CSS pixels.

    Returns void

    This method is currently a stub. A typical implementation might:

    • allocate/resize a "snapshot" render buffer in renderBuffers
    • render the view using RenderManager
    • read pixels to an image for display in the view's HTML element (if it is an <img>)