Skip to content

RenderingContext ​

JS
    RenderingContext

The rendering context of a canvas object.

Must be obtained via one of the following:

  • The Canvas.getContext('2d') interface returns a CanvasRenderingContext2D object
  • The Canvas.getContext('webgl') or Canvas.getContext('experimental-webgl') interface returns a WebGLRenderingContext object
  • The Canvas.getContext('webgl2') or Canvas.getContext('experimental-webgl2') interface returns a WebGL2RenderingContext object

2d interface support:

Supports most of the properties and methods defined by HTMl Canvas2D Context

WebGL interface support:

Supports the properties, methods, and constants defined by WebGL 1.0 and WebGL 2.0. Supported extensions are listed in the table below.

Supported extensions

  • ANGLE_instanced_arrays
  • EXT_blend_minmax
  • EXT_color_buffer_half_float
  • EXT_color_buffer_float
  • EXT_float_blend
  • EXT_sRGB
  • EXT_texture_filter_anisotropic
  • OES_element_index_uint
  • OES_fbo_render_mipmap
  • OES_texture_float
  • OES_texture_float_linear
  • OES_texture_half_float
  • OES_texture_half_float_linear
  • OES_vertex_array_object
  • WEBGL_compressed_texture_astc
  • WEBGL_compressed_texture_etc1
  • WEBGL_compressed_texture_etc
  • WEBGL_compressed_texture_pvrtc
  • WEBGL_compressed_texture_s3tc
  • WEBGL_compressed_texture_s3tc_srgb
  • WEBGL_color_buffer_float
  • WEBGL_depth_texture