You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In get a copy of the image contents of a context, we have this line:
Let alphaMode be context.[[configuration]].alphaMode.
This assumes there is a configuration. If the canvas is unconfigured (has never been configured or has been unconfigure()d), we need to specify what should happen. Almost certainly it should return a transparent image (which makes the canvas invisible, but also makes it provide a transparent image when used as an image source), though our default alphaMode is "opaque" so it could also go the other way.
The text was updated successfully, but these errors were encountered:
kainino0x
added
the
needs-cts-issue
This change requires tests (or would need tests if accepted), but may not have a CTS issue filed yet
label
Apr 25, 2024
kainino0x
added
api
WebGPU API
and removed
needs-cts-issue
This change requires tests (or would need tests if accepted), but may not have a CTS issue filed yet
labels
Apr 25, 2024
As promised in the meeting I've looked into the behavior of a canvas with no context. In all browsers it seems to behave exactly the same as a blank 2d canvas with alpha: true: https://codepen.io/kainino0x/pen/PovNWbB
i.e. it returns a blank image of the size of the canvas.
(Tested on Mac with Chrome Canary, Firefox Nightly, and Safari Technology Preview.)
So indeed, it looks like that's what we should do for unconfigured "webgpu" canvases as well, per the meeting consensus. (Incidentally, Chrome and Safari have similar behavior for canvases that do have "2d" contexts but have not been drawn to yet, which you can see if you look at the behavior copying from an alpha: false canvas - it returns a transparent image despite alpha: false. Firefox does what you'd more likely expect and gives you opaque black.)
KN: This is just a corner case. We have a “null pointer exception” in the spec text, in effect. When we try to get the picture out of the canvas, we haven’t defined what happens when the canvas hasn’t been configured at all. So we don’t know what should happen. Blank image? Transparent image? We know the size, because that’s associated with the canvas. I think it should probably be a blank transparent image, which is equivalent to nothing at all when composited
KG: It would be nice if there were not a new intermediate state for this, and do whatever the canvas would have done if you hadn’t gotten a context from it.
KN: Good point. That’s almost certainly a blank transparent image the size of the canvas, but I can work out the details.
(General consensus to make it behave like a canvas that hasn’t had a context attached yet)
In
get a copy of the image contents of a context
, we have this line:This assumes there is a configuration. If the canvas is unconfigured (has never been configured or has been
unconfigure()
d), we need to specify what should happen. Almost certainly it should return a transparent image (which makes the canvas invisible, but also makes it provide a transparent image when used as an image source), though our defaultalphaMode
is"opaque"
so it could also go the other way.CTS PR: Add more cases to canvas reftest with device loss cts#3715
The text was updated successfully, but these errors were encountered: