mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
render/pixel-format: Move has_alpha into it's own array
Some opaque pixel formats (nv12, p010) require per-plane bytes_per_block info. However, it doesn't make sense to store them in wlr_pixel_format_info, as they will never be useful (currently, this info is used for shm, which doesn't have a concept of multi-planar buffers.) Let's define a separate array and function for determining whether a pixel format has alpha.
This commit is contained in:
parent
3a91dc1b48
commit
71fb55f3bf
5 changed files with 46 additions and 28 deletions
|
|
@ -116,11 +116,5 @@ bool buffer_is_opaque(struct wlr_buffer *buffer) {
|
|||
return false;
|
||||
}
|
||||
|
||||
const struct wlr_pixel_format_info *format_info =
|
||||
drm_get_pixel_format_info(format);
|
||||
if (format_info == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !format_info->has_alpha;
|
||||
return !pixel_format_has_alpha(format);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue