(release/25.1) fb: Don't widen the planemask over padding bits when ROOTLESS_SAFEALPHA is set - #3591
Open
metux wants to merge 1 commit into
Conversation
…HA is set Wide LineDoubleDash lines drew black on screen under XQuartz while the server's own XGetImage readback showed the correct pixels, because at depth 24 that readback ignores alpha. Opaque text and dashed arcs take the same path. fbValidateGC widens a planemask that covers the drawable's depth to cover its full bits per pixel, so the blit and fill paths can take their all-ones shortcuts. On a rootless server that also writes the alpha channel of the window's premultiplied surface, which CoreGraphics then composites as black. Rootless keeps that alpha opaque by clearing the bits from the planemask, but only its own ValidateGC does so, and mi revalidates the GC in the middle of a drawing operation to swap the foreground for the background pixel. By then the damage layer has unwrapped the rootless funcs down to fb, so the reassertion never happens and the rest of the operation lands with a zero alpha channel. Fixes: XQuartz/XQuartz#230 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
metux
pushed a commit
that referenced
this pull request
Aug 20, 2026
…ESS_SAFEALPHA is set Wide LineDoubleDash lines drew black on screen under XQuartz while the server's own XGetImage readback showed the correct pixels, because at depth 24 that readback ignores alpha. Opaque text and dashed arcs take the same path. fbValidateGC widens a planemask that covers the drawable's depth to cover its full bits per pixel, so the blit and fill paths can take their all-ones shortcuts. On a rootless server that also writes the alpha channel of the window's premultiplied surface, which CoreGraphics then composites as black. Rootless keeps that alpha opaque by clearing the bits from the planemask, but only its own ValidateGC does so, and mi revalidates the GC in the middle of a drawing operation to swap the foreground for the background pixel. By then the damage layer has unwrapped the rootless funcs down to fb, so the reassertion never happens and the rest of the operation lands with a zero alpha channel. Fixes: XQuartz/XQuartz#230 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> PR: #3591
Contributor
Author
Identical cherry-pick of PR #3555 (already reviewed and merged on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wide LineDoubleDash lines drew black on screen under XQuartz while the server's own XGetImage readback showed the
correct pixels, because at depth 24 that readback ignores alpha. Opaque text and dashed arcs take the same path.
fbValidateGC widens a planemask that covers the drawable's depth to cover its full bits per pixel, so the blit and
fill paths can take their all-ones shortcuts. On a rootless server that also writes the alpha channel of the window's
premultiplied surface, which CoreGraphics then composites as black. Rootless keeps that alpha opaque by clearing the
bits from the planemask, but only its own ValidateGC does so, and mi revalidates the GC in the middle of a drawing
operation to swap the foreground for the background pixel. By then the damage layer has unwrapped the rootless funcs
down to fb, so the reassertion never happens and the rest of the operation lands with a zero alpha channel.
Fixes: XQuartz/XQuartz#230
Signed-off-by: Jeremy Huddleston Sequoia jeremyhu@apple.com