New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 914204 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Jan 10
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug
Gfx



Sign in to add a comment

WebGL composited incorrectly with Night Light

Project Member Reported by kainino@chromium.org, Dec 12

Issue description

Chrome Version: 72.0.3623.3 (Dev)
OS: Chrome OS

What steps will reproduce the problem?
(1) Go to http://khronos.org/registry/webgl/sdk/tests/conformance/textures/misc/texture-npot-video.html
(2) Turn on Night Light

What happens instead?
formerly "white" canvas at the top of the window (might be partly transparent) "pops" through the Night Light filter

I suspect what could be happening here is that the WebGL canvas has alpha:true,premultipliedAlpha:true
but the test case is outputting invalid colors (e.g. [255, 255, 255, 0]).
I'm not sure about that - not sure why this particular test would be doing that.

I can try to pin it down it further if needed, let me know.
 
night-light-webgl-compositing-bug.jpg
83.3 KB View Download
Sorry, forgot to include: this is Eve:

Google Chrome	72.0.3623.3 (Official Build) dev (64-bit)
Revision	62566d37ac342c0932ceb403043dc1ab699fc21d-refs/branch-heads/3623@{#7}
Platform	11307.0.0 (Official Build) dev-channel eve
Firmware Version	Google_Eve.9584.174.0
Customization ID	GOOGLE-EVE
ARC	5151026
Cc: dcasta...@chromium.org
Labels: Gfx
Owner: dcasta...@chromium.org
Status: Assigned (was: Untriaged)
Cc: hoegsberg@chromium.org
I can repro the issue easily. This happens when we use CTM matrix + HW overlays.
Kai is probably right about pointing out that the colors in the buffers are invalid, since they should be premultiplied, but the three channel are more than the alpha channel.

Why do we produce buffers with invalid values to begin with?

ccing Kristian in case he has any idea how the display controller should behave in these cases.
Here's a super-simple repro case that verifies that the issue is with premultiplied alpha:

<canvas id="canvas"></canvas>
<script>
const gl = canvas.getContext('webgl');
gl.clearColor(1, 1, 1, 0.5);
gl.clear(gl.COLOR_BUFFER_BIT);
</script>
(Use this test case in case we change the original one to not trigger this. I don't think it's supposed to.)
Components: Blink>WebGL
Adding Blink>WebGL because this can only happen with WebGL canvases.
Fundementally, WebGL apps can produce invalid color values when the "premultipliedAlpha" context creation parameter is set to true. The only practical way we could work around this would be to always do a full-canvas blit at the end of the user's rendering when premultipliedAlpha is true, in order to clamp the color values to be less than or equal to the alpha value, which would be prohibitively expensive.

Status: WontFix (was: Assigned)
I don't suspect this is worth fixing.

Sign in to add a comment