Trait for objects that need to handle rendering context loss and restoration.

interface RenderingContextHandler {
    onRenderingContextLost(options): void;
    onRenderingContextRestored(options): void;
}

Implemented by

Methods

  • Called when the rendering context has been lost.

    Parameters

    • options: {
          canvas: HTMLCanvasElement;
      }

      The options.

      • canvas: HTMLCanvasElement

        The canvas holding the restored rendering context.

    Returns void

  • Called when the rendering context has been restored.

    Parameters

    • options: {
          canvas: HTMLCanvasElement;
      }

      The options.

      • canvas: HTMLCanvasElement

        The canvas holding the restored rendering context.

    Returns void