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

Issue 872845 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 30
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug

Blocking:
issue 877159



Sign in to add a comment

Scissor+clear and draw are y-flipped relative to each other

Project Member Reported by wfurr@google.com, Aug 9

Issue description

Chrome Version: 70.0.3511.0
OS: ChromeOS platform 10934.0.0 dev-channel eve-arcnext

What steps will reproduce the problem?
(1)  Go to keep.google.com
(2)  Create a new drawing note (click the pencil icon)
(3)  Draw some strokes
(4)  Pinch to zoom out and then pan while zoomed out

What is the expected result?

The drawing should move with your fingers.

What happens instead?

The background moves with fingers (drawn with glScissor + glClear) but the strokes and page shadow (drawn with a textured quad) move in the opposite y-direction.

There were some changes recently to flip WebGL buffers for compatibility with hardware overlays (aka direct scanout) that may be related:

https://bugs.chromium.org/p/chromium/issues/detail?id=680851&desc=2#c27
https://bugs.chromium.org/p/chromium/issues/detail?id=869922#c6

 
Note this does not repro in Chrome 68 or 69 on Eve or in Chrome 70.0.3517.0 canary on Windows.
Cc: frkoenig@chromium.org
wfurr@: just to confirm, the "shadow" is a normal (non-lowLatency) WebGL 
canvas, correct ...?

+ frkoenig@ 
(Also - the bug doesn't repro on my scarlet (rockchip)).
Status: Assigned (was: Untriaged)
Yes, Keep is using a bog-standard WebGL2 canvas with MSAA enabled and no other options.

Looks like it might only repro in Chrome 70 canary on ChromeOS and Intel GPU.
wfurr@ I tried to diagnose it further but couldn't, could you do a quick
try with lowLatency disabled throughout, to see if it's a WebGL flip issue
or a lowLatency issue? (To confirm, it works ok on Eve M68).
You can also try http://webgl-ink.firebaseapp.com, which does not use the lowLatency option. On 70.0.3519.3 canary eve, you can actually see that the clear occurs in a different place from the input. This app was written >6mo ago, so it's not doing anything complicated :-)
Could it be that we are using a WebGL canvas on top of another, and then
the y-flip is applied -wrongly- twice?
There's only one canvas on the page.  It's that the glScissor coordinates aren't being flipped the same way as VBOs or triangles.
Cc: -frkoenig@chromium.org mcasas@chromium.org
Owner: frkoenig@chromium.org
--> Assigning to frkoenig@ to investigate, maybe we forgot to look at 
|opengl_flip_y_extension_| [1] somewhere in DrawginBuffer ...?

[1] https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc?type=cs&sq=package:chromium&g=0&l=184
Labels: -LowLatency
Labels: M-70
@frkoenig any updates on this?
I haven't made much progress.  I was looking into the issue that @wfurr linked as an inverted rendering, hoping it would be related.  I haven't been able to solve that one yet.
Status: Started (was: Assigned)
The clipping is clipping the correct area.  The clear is what is failing.  A quick test to show this:
        gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);
        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
        gl.enable(gl.SCISSOR_TEST);
        gl.scissor(0, 0, 1500, 500);
        gl.clearColor(1.0, 0.0, 0.0, 1.0);
        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
The desired outcome is the lower part of the screen will be red.  But instead the upper part is red.

When mesa was changed to handle the flipping internally there were checks that needed to be converted to the new logic.  In particular, rb->Name == 0 is used to denote that it is a system framebuffer instead of a user framebuffer.  This is checked on the renderbuffer, not the framebuffer.  It is the framebuffer that has the FlipY flag on it.

Some of these checks slipped through.  The fix needs to be done in mesa.  In particular, the change needs to be made to |do_single_blorp_clear| to correctly handle the case noted here.
Blocking: 877159
#18 landed in 11004.0.0
Status: Fixed (was: Started)

Sign in to add a comment