- Notifications
You must be signed in to change notification settings - Fork353
Clarify behavior of out-of-gamut canvas#4476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
It's OK if out-of-gamut intermediate values are written to the canvas,it only matters what's there when it gets presented.
kainino0x commentedMar 11, 2024
@jimblandy revised, PTAL |
github-actionsbot commentedMar 11, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Previews, as seen when thisbuild job started (fe175dc): |
spec/index.bs Outdated
| {{GPUCanvasAlphaMode/"premultiplied"}}, {{PredefinedColorSpace/"srgb"}}, | ||
| {{GPUTextureFormat/"rgba8unorm"}} canvas, the color `[0.51, 0, 0, 0.5]` represents | ||
| <code><a funcdef>color</a>(srgb 1.02 0 0 / 0.5)</code>, | ||
| however upon presentation it could be internally unpremultiplied before color |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It's probably not actually likely that a browser would unpremultiply like this, as basically everything prefers to operate in premultiplied space. I don't think this is the only case under which bad things would happen. It was the easiest to explain, but could it mislead people to believe this is actually a likely scenario?
The example is not critical, but it's very helpful to demonstrate what we're talking about. Maybe it would be possible to show other examples as well of hypothetical compositing+display pipelines?
kainino0x commentedMar 18, 2024
I thought about this further, and I think there are some cases that this doesn't allow that we need to allow. I'm going to tentatively close this and open a new PR that does that. |
kainino0x commentedMar 18, 2024
Actually, we still need to fix this. I will still open another PR that both reduces the undefined behaviors and expands the examples. |
kainino0x commentedMar 19, 2024
Opened draft#4526. |
kainino0x commentedMar 19, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
(This PR is ready for review though. PTAL) |
ccameron-chromium commentedMar 19, 2024
The change makes sense to me. |
toji left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM, especially if@ccameron-chromium is comfortable with it.
Uh oh!
There was an error while loading.Please reload this page.
It's OK if out-of-gamut intermediate values are written to the canvas, it only matters what's there when it gets presented.
Also move the existing explanation of the undefined behavior to a note,
and expand it with an example.