WebGLRenderingContext.commit()

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The WebGLRenderingContext.commit() method pushes frames back to the original HTMLCanvasElement, if the context is not directly fixed to a specific canvas.

Syntax

commit()

Parameters

None.

Return value

None (undefined).

Examples

const htmlCanvas = document.createElement('canvas');
const offscreen = htmlCanvas.transferControlToOffscreen();
const gl = offscreen.getContext('webgl');

// Perform some drawing using the gl context

// Push frames back to the original HTMLCanvasElement
gl.commit();

Specifications

Specification
HTML Standard
# offscreencontext-commit

Browser compatibility

BCD tables only load in the browser

See also