Skip to main content

Module canvas

Module canvas 

Source
Expand description

GPUCanvasContext with a native host presenter and bounded readback fallback.

JSC owns logical contexts; expired drawing buffers can move into a native frame owner without retaining CPU pixels. Readback completions are fenced by context/resize epochs, and no JSC value crosses onto a GPU worker.

Structs§

NativePresentation
NativeSource
A borrowed canvas buffer. A presenter must submit its reads before returning.
PresentedFrame
A published canvas buffer: completed CPU pixels or an ordered native frame.

Traits§

NativeFrame
Native texture format is straight-alpha BGRA8 on the renderer’s own device. The pointer is borrowed only for the synchronous copy callback.
NativePresenter

Functions§

present
Published frames only. Native hosts enforce queue ordering during import.
present_size
presentation_stats
(native display frames, asynchronous display readbacks, explicit snapshots).
register_present
set_presenter
take_presented_changed
unregister_present
Keep the weak slot so a retained DOM canvas can be inserted again.