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

WIP Format API #186

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

WIP Format API #186

wants to merge 4 commits into from

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Dec 13, 2023

Very initial implementation for #98. No conversion support, and Wayland only, but allows listing available formats and selecting which to use. Seems good to get a start on this and see how things work.

It should be easy to add basic format conversion support swapping the first and third component. I'm not sure exactly about alpha. If a platform always uses alpha, a format like BGRX can't be supported without conversion (setting the fourth component to 255). If a platform doesn't support alpha, formats with alpha probably shouldn't be supported even with conversion? Instead of just listing Format, it could list structs with that and a native: bool field to indicate that the format is native and doesn't require conversion...

@ids1024
Copy link
Member Author

ids1024 commented Dec 18, 2023

Handling conversion isn't hard (unless we add more unusual formats), though I'm thinking about how I'd want to integrate it.

  • A conversion API that is internally used within each backend and called into by the backend's implementation of (at least) pixels/pixels_mut/present
  • Code in toplevel pixels/present/etc. that either calls to the conversion code, or the backend directly
  • A new variant of BufferDispatch that does conversion first, then calls through to the backend.

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