Logo FS-Skia-UI

GlHost Module

The OpenGL/Skia presentation host body (internal helpers hidden; only `run` is reachable).

Types

Type Description

PresentAction

Functions and values

Function or value Description

lastPresentTiming ()

Full Usage: lastPresentTiming ()

Parameters:
    () : unit

Returns: TimeSpan * TimeSpan

Feature 120 (US1, FR-001/002): the most recent present's per-phase durations — the scene→canvas paint walk and the flush + buffer-swap (compose). Live-only, non-golden; consumed by the interactive adapter's `FrameMetrics.PaintDuration`/`ComposeDuration` and the timing baseline.

() : unit
Returns: TimeSpan * TimeSpan

planPresent prev next sizeChanged idleRepresentsRemaining

Full Usage: planPresent prev next sizeChanged idleRepresentsRemaining

Parameters:
    prev : Scene option
    next : Scene
    sizeChanged : bool
    idleRepresentsRemaining : int

Returns: PresentAction

Feature 122 (FR-001/002): the pure present decision. `PaintAndPresent` when `shouldPresent`; otherwise `RepresentLastGood` while `idleRepresentsRemaining > 0` (buffers may still be undrawn), else `SkipPresent` (full idle). Keeping every swapchain buffer populated stops a multi-buffer compositor (Wayland windowed-fullscreen) from rotating an undrawn black buffer into view. Exposed for the present-plan transition test (T011).

prev : Scene option
next : Scene
sizeChanged : bool
idleRepresentsRemaining : int
Returns: PresentAction

run program

Full Usage: run program

Parameters:
Returns: Result<unit, RenderDiagnostic>
Type parameters: 'model, 'msg

Public contract function exposed by this FS.Skia.UI package. Signature shape preserved from the former VulkanHost.run so Host/Viewer.fs routes unchanged.

program : ViewerProgram<'model, 'msg>
Returns: Result<unit, RenderDiagnostic>

shouldAdvanceFrame lastFrameTime now frameInterval

Full Usage: shouldAdvanceFrame lastFrameTime now frameInterval

Parameters:
    lastFrameTime : float
    now : float
    frameInterval : float

Returns: bool

Feature 121 (US1, FR-002): pure frame-pacing decision — advance (update + present) iff at least `frameInterval` seconds elapsed since the last advance. Gates DoUpdate AND DoRender so the `ViewerOptions.FrameRateCap` bounds render cadence. Exposed for the pacing test (T006).

lastFrameTime : float
now : float
frameInterval : float
Returns: bool

shouldPresent prev next sizeChanged

Full Usage: shouldPresent prev next sizeChanged

Parameters:
    prev : Scene option
    next : Scene
    sizeChanged : bool

Returns: bool

Feature 120 (US2): pure present-or-skip decision (present iff first frame, scene changed, or the framebuffer size changed). Exposed for the idle-skip transition test (T016).

prev : Scene option
next : Scene
sizeChanged : bool
Returns: bool

Type something to start searching.