Closed flackr closed 6 years ago
The CSS Working Group just discussed Consider adding property for expected rendered bitmap size.
, and agreed to the following resolutions:
RESOLVED: Add devicePixelRatio to canvasContext, other MQs can be accessed via custom properties
The devicePixelRatio
has been added on the PaintRenderingContext2D
in the above commit.
The rendering context in https://drafts.css-houdini.org/css-paint-api-1/#2d-rendering-context defines the output bitmap size to be the size of the fragment being rendered however the actual size of the rendered bitmap used internally may vary.
In order to allow output density sensitive painting we may want to expose the size of the rendered bitmap we intend to use (or an approximation) so that the author may produce a better rendering for that output size. The author may also use this to reduce the quality of their rendering given an extremely low density (i.e. preview sized renderings may not need to paint as much) or to paint hairline lines.
Options: