xserver/miext
Jeremy Huddleston Sequoia d2e83a266c rootless: Protect alpha channel for Render operations
The Render extension operates on PictFormats rather than GC, so it
bypasses the rootless layer's GC-based alpha protection
(ROOTLESS_PROTECT_ALPHA).  Depth-24 windows use PICT_x8r8g8b8 where
the 'x' tells pixman the high byte is padding it may freely zero.
The macOS compositor needs this byte to be 0xFF (opaque).

Before each Render operation that targets a rootless window,
temporarily upgrade the destination Picture's format from
PICT_x8r8g8b8 to PICT_a8r8g8b8.  This tells pixman that the alpha
channel is significant and must not be optimized away.  The format
is restored after the operation completes.

This parallels how ROOTLESS_PROTECT_ALPHA handles GC operations (by
masking alpha out of the planemask) and how ROOTLESS_SAFEALPHA
handles PaintWindow (by forcing alpha in solid fills).  The
save/restore approach is analogous to rootlessGC.c's GC_SAVE /
GC_RESTORE pattern.

Fixes [2/2]: https://github.com/XQuartz/XQuartz/issues/31

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2026-03-24 20:22:58 -07:00
..
damage rootless: Use screen_x and screen_y instead of pixmap pointer hacks 2023-01-20 17:10:54 +00:00
rootless rootless: Protect alpha channel for Render operations 2026-03-24 20:22:58 -07:00
shadow Remove autotools support 2021-10-27 13:15:40 +03:00
sync meson: fix build if shmfence is enabled but dri3 & xwayland are not 2026-01-25 10:40:02 -08:00