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.

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

height: number
width: number

Methods

  • Parameters

    • type: string
    • listener: (event: Event) => void

    Returns void

  • Parameters

    • id: "webgl2"
    • Optionalattributes: WebGLContextAttributes

    Returns null | WebGL2RenderingContext

  • Parameters

    • type: string
    • listener: (event: Event) => void

    Returns void