Runtime
paintOnce()
Wait for one Prism-owned paint pass.
paintOnce() waits for a Prism-owned paint pass. It does not export image data.
await document.fonts.ready;
await runtime.paintOnce();
const blob = await new Promise<Blob | null>((resolve) => {
canvas.toBlob(resolve, "image/png");
});Use it when you need a deterministic readiness point before calling normal canvas APIs such as toBlob() or toDataURL().
paintOnce() works without starting the runtime loop.
Multiple pending paintOnce() calls resolve from the same completed paint pass.
If paintOnce() is called during onPaint(), it waits for the next paint pass. It does not resolve from the pass already in progress.
Pending paintOnce() waiters reject if a paint handler throws or the runtime is destroyed.
Prism