css-houdini-drafts icon indicating copy to clipboard operation
css-houdini-drafts copied to clipboard

[css-paint-api] Invalidate paint when `devicePixelRatio` changes?

Open jakearchibald opened this issue 5 years ago • 2 comments

From step 10 of https://drafts.css-houdini.org/css-paint-api-1/#invoke-a-paint-callback

At this stage the user agent may re-use an image from a previous invocation if paintSize, styleMap, inputArguments are equivalent to that previous invocation.

Should this include devicePixelRatio? It isn't clear to me how/why you'd use devicePixelRatio in CSS paint, but it's a bit of paint-relevant state that's available to the worker, and it may change.

jakearchibald avatar Nov 16 '20 10:11 jakearchibald

We don't take the dpr into account when sizing the canvas currently, and you can't adjust the canvas size yourself either, so i'm not sure what re-rendering on dpr change would achieve.

tabatkins avatar Dec 09 '20 18:12 tabatkins

It's a piece of data that's available to the paint API , and that data changes over time.

Maybe dpr should be removed from the global instead? Why is it there?

jakearchibald avatar Dec 10 '20 06:12 jakearchibald