xwayland: clear pixmaps after creation in rootless mode
From the commit message:
When a pixmap is created with a backing FBO, the FBO should be cleared to avoid rendering uninitialized memory. This could happen when the pixmap is rendered without being filled in its entirety. One example is when a top-level window without a background is resized. The pixmap would be reallocated to prepare for more pixels, but uninitialized memory would be rendered in the resize offset until the client sends a frame that fills these additional pixels. Another example is when a new top-level window is created without a background. Uninitialized memory would be rendered after the pixmap is allocated and before the client sends its first frame. This issue is only apparent in OpenGL implementations that don't zero the VRAM of allocated buffers by default, such as RadeonSI.
This change was tested in the following scenarios:
- Xwayland in gnome-shell with RadeonSI
- Xwayland in gnome-shell with LLVMpipe
- Xwayland in weston with RadeonSI
- Xorg in gnome-shell with modesetting and RadeonSI (for reference)
How to reproduce
The issue of uninitialized memory being rendered on resize is easily reproducible with
Chromium and the
Steam client, simply resize their windows fast. The issue of uninitialized memory being rendered for new windows is easily reproducible in
Dota Underlords and sometimes
Chromium. As far as I know, this can only be reproduced with RadeonSI since it doesn't zero the VRAM of allocated buffers.
Fixes #636 (closed)