You can acquire the CanvasRenderingContext2D object via the Canvas.getContext('2d') interface. CanvasRenderingContext2D implements most attributes and methods defined by HTML Canvas 2D Context. You can acquire the WebGLRenderingContext object via the Canvas.getContext('webgl') interface. WebGLRenderingContext implements all attributes, methods and constants defined by WebGL 1.0.

2D Interface Support Status

2D attributes or interfaces that iOS/Android do not support

  • globalCompositeOperation does not support the following value: source-in source-out destination-atop lighter copy. If used it will not report an error but will come up with inconsistent results.
  • isPointInPath

WebGL Interface Support

WebGL interface that iOS/Android do not support

  • pixelStorei: when the first parameter is gl.UNPACK_COLORSPACE_CONVERSION_WEBGL
  • compressedTexImage2D
  • compressedTexSubImage2D

Android also do not support the WebGL interface

  • getExtension
  • getSupportedExtensions