/canvas2D

Update Canvas 2D API

OtherNOASSERTION

Update Canvas 2D API

This repo contains proposal for an updated version of the Canvas 2D API.

Feature list

Future iteration

  • Batch text rendering.

  • Text blob.

  • Path2D Inspection. Allow inspection of Path2D objects, that are currently opaque.

  • Element as a source for drawImage

Rationale

The current Canvas 2D API was originally proposed in 2013. Since then, a lot of 2D graphics APIs have appeared and changed what developers expect from a good 2D API. This proposal tries to modernize Canvas 2D API, considering current and future usage of Canvas and considering the following:

  1. Canvas is the web’s direct mode rendering solution that closely matches traditional programming models. This is a particularly common need for games and full featured apps.

  2. A common bottleneck for Canvas2D rendering is how many Javascript functions are needed to render a particular scene. With this in mind, adding more expressive APIs (that allow you to render the same scene with fewer commands) will result in better performance.

  3. Modern 2D developers sometimes have to fallback to GL for features that are expected to be available in 2D but currently aren’t supported by Canvas 2D.

  4. Modern browsers implement a rich set of rendering features that are currently unavailable to developers. Bridging that gap and giving more power to developers is a good thing.