Display of OffscreenCanvas is Y-flipped
Categories
(Core :: Graphics: Canvas2D, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox98 | --- | fixed |
People
(Reporter: aosmond, Assigned: aosmond)
References
Details
Attachments
(2 files)
When we hit the path that we are pulling pixels out of the WebGL context for display instead of being able to use the system specific buffers, we actually forget that we need to do a Y flip since we don't use the texture flags:
Assignee | ||
Comment 1•4 years ago
|
||
This can be reproduced by enabled OffscreenCanvas, disabling the webcompat intervention, and joining a Zoom call from Firefox.
Assignee | ||
Comment 2•4 years ago
|
||
These new methods do both swizzle/premultiply and a Y-flip operation.
Assignee | ||
Comment 3•4 years ago
|
||
On the path that we need to read the pixels from the canvas for display
purposes, instead of using a platform buffer handle, we need to take
into account the need to y-flip for WebGL. This patch ensures that we do
so.
Depends on D136503
Comment 5•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2a1e5a439a3b
https://hg.mozilla.org/mozilla-central/rev/211ffc98eb32
Comment 6•4 years ago
|
||
Backed out for causing failures at webgl-color-offscreen-test.html.
Backout link: https://hg.mozilla.org/integration/autoland/rev/55a910fad5eac403909db1001ca8256b2996fa37
Failure log: https://treeherder.mozilla.org/logviewer?job_id=365834871&repo=autoland&lineNumber=7951
Assignee | ||
Comment 7•4 years ago
|
||
It appears to be failing only for the reftest-snapshot variant. Very interesting.
Assignee | ||
Comment 8•4 years ago
|
||
We are hitting this failure condition:
I think the child ID was legitimately 0. We should just use Maybe instead of a sentinel value.
Assignee | ||
Comment 9•4 years ago
|
||
Actually it was not legitimately zero. The main thread context on Linux doesn't go through IPC, and instead runs in the content process. It isn't backed by a WebGLChild so it doesn't go through CanvasManagerParent. Instead we go on this path:
This is a bit annoying that we have both main thread in content process, and off main thread in compositor process situations for OffscreenCanvas.
Assignee | ||
Comment 10•4 years ago
|
||
I don't understand why this passes on regular reftests.
Assignee | ||
Comment 11•4 years ago
|
||
I think to be consistent we should actually punt main thread contexts through the parent process. That way OffscreenCanvas always works the same and main thread testing is closer to worker thread testing.
Assignee | ||
Comment 12•4 years ago
|
||
For now, I think we can probably just go to the HTMLCanvasElement to get the OffscreenCanvas object. If it is on the main thread, then we will have access to the nsICanvasRenderingContextInternal. From there, we can get the snapshot directly. This only works for the main thread case, but that is all we need it to work for. I'll have to rethink how this should work.
Comment 13•4 years ago
|
||
Comment 14•4 years ago
|
||
Backed out for causing multiple wpt failures on offscreencanvas.resize.html
Failure log crash // Failure log timeout
Failure line crash: PROCESS-CRASH | /html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.resize.html | application crashed [@ mozilla::gl::AndroidSharedBlitGL::Blit(mozilla::jni::Ref<mozilla::java::GeckoSurfaceTexture, _jobject*> const&, mozilla::gfx::IntSizeTyped<mozilla::gfx::UnknownUnits> const&)]
Failure line timeout: TEST-UNEXPECTED-TIMEOUT | /html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.resize.html | TestRunner hit external timeout (this may indicate a hang)
Assignee | ||
Comment 15•4 years ago
|
||
After discussing this with jnicol, it seems likely this test case won't work on Android. We are displaying some of the canvases in html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.resize.html
and then we try to readback the pixels. Apparently this won't work on Android due to platform limitations.
For now, I may just skip this test on Android and we can see if we can do better in a follow up.
Comment 16•4 years ago
|
||
Comment 17•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/659ee118b977
https://hg.mozilla.org/mozilla-central/rev/1ce43bc56fee
Description
•