WebGLRenderingContext.commit()

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

Syntax

void WebGLRenderingContext.commit()

Examples

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

// ... some drawing using the gl context ...

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

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'the commit() method of the OffscreenCanvas object's rendering context' in that specification.
Living Standard

Browser compatibility

BCD tables only load in the browser

See also