Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally submit 10 bit buffers #54

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mstoeckl
Copy link
Collaborator

@mstoeckl mstoeckl commented Jan 8, 2023

This PR makes Swaybg submit 10-bit buffers when the background image it is given is a 16-bit deep PNG file.

This PR builds on top of !53, and makes Swaybg submit 10-bit buffers when the background image it is given is a 16-bit deep PNG file. (#53 is necessary since Cairo does not have an equivalent to CAIRO_FORMAT_RGB30 with an alpha channel; without #53, this code would render transparent 8-bit PNGs with alpha and 16-bit PNGs without.)

Note: loading 16-bit PNG images gave incorrect results with Cairo 1.17.2 through 1.17.5. Since 16 bit PNG images are rare, and most distributions either use stable releases (latest 1.16.0), or development snapshots (latest 1.17.6), this bug is unlikely to affect anyone. Cairo versions before 1.17.2 reduce 16-bit PNG files to 8-bit on loading; swaybg will continue to submit 8-bit buffers for these. Edit: Cairo 1.18 has now been out for a while.

This requires that the compositor support either XRGB2101010 or XBGR2101010,
and that the background image is a 16-bit PNG.
@mstoeckl mstoeckl changed the title Draft: Optionally submit 10 bit buffers Optionally submit 10 bit buffers Oct 27, 2024
@mstoeckl mstoeckl marked this pull request as ready for review October 27, 2024 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant