NativeCanvasDevice

Render-thread owner of bounded native canvas targets, source leases, and renderer lifetimes.

One instance belongs to one native device, not to a screen. At most three target sets per stable canvas identity and 64 sets across this device may exist, including retired and quarantined sets. A permit is reserved before allocation and is released only after physical destruction is acknowledged, including asynchronous native release queues. Native Canvas payloads in frames retain scalar identifiers only; the device owns every handle and producer until their distinct initialization, capture, and GUI completion fences permit cleanup. Only one GUI batch may be extracted at a time; that batch must be consumed or explicitly cancelled before the next extraction. Ordinary polling and screen cleanup never block on GPU completion or unconsumed GUI work.

Parameters

driver

borrowed version-specific device operations, confined to this object's construction thread.

Constructors

Link copied to clipboard
constructor(driver: NativeCanvasDriver)

Properties

Link copied to clipboard

Owns portable GUI texture generations independently of this device's native Canvas target quota.

Functions

Link copied to clipboard
fun cancel(presentation: NativeCanvasPresentation)

Cancels a prepared batch that has emitted no GUI work, without waiting for any capture fence.

Link copied to clipboard

Destroys device-owned resources after the caller has discarded every unconsumed native GUI queue.

Link copied to clipboard
fun consumed()

Settles the queued batch after the native GUI consumer has consumed its draw queue at the version-owned boundary.

Link copied to clipboard
fun failedGui()

Quarantines queued targets after a GUI consumer failure when complete consumption cannot be established.

Link copied to clipboard
fun poll()

Advances initialization, capture-lease, retired-target, and renderer cleanup without waiting, including when no Strata screen is visible.

Link copied to clipboard
fun prepare(commands: List<DrawCommand>, frameTime: FrameTime, scale: Int): NativeCanvasPresentation

Resolves native attachment requests after final layout, producing each attachment at most once.

Link copied to clipboard
fun queue(presentation: NativeCanvasPresentation)

Validates and marks an entire prepared presentation as queued before the first GUI command is emitted.

Link copied to clipboard

Registers one independently budgeted GUI cache with this device's fence and terminal destruction lifecycle.

Link copied to clipboard
fun reload()

Invalidates active derived generations on a resource reload while preserving external sources and stable canvas limits.

Link copied to clipboard

Reports native payload bytes across independently budgeted registered GUI managers.

Link copied to clipboard

Reports entry reservations across independently budgeted registered GUI managers.

Link copied to clipboard

Reports reserved active and retired target sets on the owning thread for deterministic capacity verification.

Link copied to clipboard
fun source(producerFactory: () -> NativeCanvasProducer, depth: Boolean = false): CanvasSource

Creates an externally reusable description without opening a renderer or allocating a target.

Link copied to clipboard

Borrows one target while the versioned presenter emits its queued GUI draw command.