Updated functionality for the Canvas2D API. Adds nine new features/functions to CanvasRenderingContext2D: - "ContextLost" and "ContextRestored" events - "willReadFrequently" option for canvases where lots of readback is expected - CSSColorValues as style inputs - More CSS text modifier support - A reset function - A roundRect draw primitive - Full 4x4 transformation matrices - Conic gradients - Better support for SVG filters https://github.com/fserb/canvas2d

Motivation

Canvas is the web’s direct mode rendering solution that closely matches traditional programming models. This is particularly targeted for games and full featured apps. 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. There's a always a balance to be struck when adding new APIs to the web. That said, it's important that Canvas2D is able to address developer's use cases in game development and text manipulation. 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 3 pillars: 1. feature parity with other 2D APIs; 2. access to current capabilities of the Web/CSS; 3. performance improvement. https://github.com/fserb/canvas2D/blob/master/rationale.md

Status in Chromium

Blink>Canvas


No active development (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

Owners

Last updated on 2021-04-22