Closed Bug 1698067 Opened 8 months ago Closed 8 months ago

Hamburger menu graphical glitch

Categories

(Core :: Graphics: WebRender, defect)

Firefox 88
Desktop
Windows 10
defect

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox86 --- unaffected
firefox87 --- unaffected
firefox88 --- fixed

People

(Reporter: alice0775, Assigned: lsalzman)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: nightly-community, regression)

Attachments

(5 files, 3 obsolete files)

Attached image screenshot

Reproducible: reproducible on Nightly88.0a1 windows10.

Steps to reproduce:

  1. Open Hamburger menu
  2. Open Sub-view and Sub-sub-view if any
  3. Mouse hover "<" icon at the top-left corner
  4. Repeat from step1

Actual results:
Black rectangles appears at to-right corner of the menu

Expected results:
No glitch

Attached file about:support
Component: Layout → Graphics: Layers

en-US build Nightly88.0a1 is also affected.

FWIW, can repro with Alice's STR. Result is very similar to first screenshot...it's underlying page content in the "black" box.
Also see it progress to messing with appmenu's scrollbar sometimes. (Win10/64, Intel Iris)

When max_update_rects was 0, I did not see the problem. Dirty rect handling seems to have a problem.

When "clearing transparent region" was disabled, I did not saw the problem, though transparent region was black. From it, WebRender seemed not re-render the cleared region correctly.

I wonder if there is a mismatch between dirty region and WebRender rendering region.

:gw, do you have any ideas what could cause the problem?

Flags: needinfo?(gwatson)

When I forced hardware WebRender to popups, Hamburger menu was not shown.

deleted

Flags: needinfo?(lsalzman)
Flags: needinfo?(lsalzman)

PresentableSharedImage::PresentToWindow() seems not handle dirty rects when TransparencyMode is eTransparencyTransparent.

Flags: needinfo?(gwatson)

:lsalzman, do you have any ideas that could cause the problem?

Flags: needinfo?(lsalzman)
See Also: → 1697741

With the patch, the problem was addressed for me. I wonder if wr_swgl_clear_color_rect() does not work as expected.

(In reply to Sotaro Ikeda [:sotaro] from comment #14)

Created attachment 9209298 [details] [diff] [review]
temporal patch - Use DrawTarget::ClearRect() instead of wr_swgl_clear_color_rect() in RenderCompositorSWGL::AllocateMappedBuffer()

With the patch, the problem was addressed for me. I wonder if wr_swgl_clear_color_rect() does not work as expected.

Rather than this, try modifying the parameters to wr_swgl_clear_color_rect(). ClearRect might be clearing to black or transparent depending on surface format, whereas here we are unconditionally clearing to color (0,0,0,0). So try replacing the last 0 parameter with something like: "data && format == gfx::SurfaceFormat::B8G8R8X8 ? 1 : 0". If that doesn't help, then might be a rectangle issue.

Flags: needinfo?(lsalzman)
See Also: → 1698462
See Also: → 1698589
Attachment #9209124 - Attachment is obsolete: true
Attachment #9209008 - Attachment is obsolete: true
Attachment #9209037 - Attachment is obsolete: true
Assignee: nobody → lsalzman
Status: NEW → ASSIGNED

It looks like the root cause of this bug is that in RenderCompositorSWGL, when calling wr_swgl_clear_color_rect, this can cause us to delay some clears on the default framebuffer. We just need to be careful that we flush out the clears before we actually commit the mapped buffer.

Sotaro also helped me tracked down another secondary bug (and most likely the primary cause of this, whereas the flushing issue is probably theoretical and not the real cause), related to a clear region optimization where we collapse a rectangular clear into a single row. This can clear too much of the buffer if the framebuffer in question is actually only a sub-region of a much larger buffer, and in that case we might clear areas outside the sub-region erroneously.

Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f3aeb3726cee
Force color buffer to resolve before committing. r=sotaro

Unable to reproduce anymore with autoland build containing the patch above.

Attachment #9209312 - Attachment description: Bug 1698067 - Force color buffer to resolve before committing. r?sotaro → Bug 1698067 - Only collapse framebuffer clears when stride is packed. r?sotaro
Flags: needinfo?(lsalzman)
Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/269ee52d9d9b
Only collapse framebuffer clears when stride is packed. r=sotaro
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
See Also: → 1697751
See Also: → 1695822
Duplicate of this bug: 1698589
You need to log in before you can comment on or make changes to this bug.