interface GlSurface { height : number ; width : number ; addEventListener ( type : string , listener : ( event : Event ) => void ) : void ; getContext ( id : "webgl2" , attributes ?: WebGLContextAttributes , ) : null | WebGL2RenderingContext ; removeEventListener ( type : string , listener : ( event : Event ) => void ) : void ; } Properties MethodsOptionaladd Event Listener addEventListener ( type : string , listener : ( event : Event ) => void ) : void Parameters type : string listener : ( event : Event ) => void Returns void get Context getContext ( id : "webgl2" , attributes ?: WebGLContextAttributes , ) : null | WebGL2RenderingContext Parameters id : "webgl2" Optionalattributes : WebGLContextAttributes Returns null | WebGL2RenderingContext Optionalremove Event Listener removeEventListener ( type : string , listener : ( event : Event ) => void ) : void Parameters type : string listener : ( event : Event ) => void Returns void
What the shared context is created on: a detached canvas or an OffscreenCanvas. Only the members the device touches, so a test can hand in a plain object with a recording context behind
getContext.