mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-15 08:22:07 -04:00
Merge branch 'kdfs' into 'master'
render/pixel_format: generate tables via kdfs See merge request wlroots/wlroots!5271
This commit is contained in:
commit
5d859d09be
7 changed files with 716 additions and 310 deletions
|
|
@ -18,17 +18,15 @@
|
|||
struct wlr_pixel_format_info {
|
||||
uint32_t drm_format;
|
||||
|
||||
/* Equivalent of the format if it has an alpha channel,
|
||||
* DRM_FORMAT_INVALID (0) if NA
|
||||
*/
|
||||
uint32_t opaque_substitute;
|
||||
|
||||
/* Bytes per block (including padding) */
|
||||
uint32_t bytes_per_block;
|
||||
/* Size of a block in pixels (zero for 1×1) */
|
||||
/* Size of a block in pixels */
|
||||
uint32_t block_width, block_height;
|
||||
};
|
||||
|
||||
extern const struct wlr_pixel_format_info pixel_format_info[];
|
||||
extern const size_t pixel_format_info_len;
|
||||
|
||||
/**
|
||||
* Get pixel format information from a DRM FourCC.
|
||||
*
|
||||
|
|
@ -58,6 +56,8 @@ uint32_t convert_wl_shm_format_to_drm(enum wl_shm_format fmt);
|
|||
*/
|
||||
enum wl_shm_format convert_drm_format_to_wl_shm(uint32_t fmt);
|
||||
|
||||
bool pixel_format_is_opaque(uint32_t fmt);
|
||||
|
||||
/**
|
||||
* Return true if the DRM FourCC fmt has an alpha channel, false otherwise.
|
||||
*/
|
||||
|
|
@ -68,4 +68,10 @@ bool pixel_format_has_alpha(uint32_t fmt);
|
|||
*/
|
||||
bool pixel_format_is_ycbcr(uint32_t fmt);
|
||||
|
||||
/**
|
||||
* Get the equivalent opaque variant of a format if it has an alpha channel,
|
||||
* DRM_FORMAT_INVALID otherwise.
|
||||
*/
|
||||
uint32_t pixel_format_get_opaque_substitute(uint32_t fmt);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue