One WebGL2 context, its program and its buffers, shared by every backend built for the same surface factory. Reference counted by mounted backends so the drawing buffer is given back once the last chart is destroyed; the context itself is kept, because a canvas whose context has been lost on purpose hands back that same lost context on the next getContext.

Constructors

Properties

Accessors

Methods

Constructors

Properties

colors: ColorCache = ...

Accessors

  • get lost(): boolean
  • True between a context loss and its restoration: frames go through 2D meanwhile.

    Returns boolean

Methods

  • Grow the surface to hold a pane of this bitmap size. Never shrinks while in use.

    Parameters

    • widthPx: number
    • heightPx: number

    Returns void

  • Draw a batch into the top-left widthPx by heightPx of the surface, cleared first. Returns false when the context is lost or absent, in which case nothing was drawn and the caller must not blit.

    Parameters

    Returns boolean