pixels: Add function to convert from wl_shm format to fourcc
parent
fbd8020778
commit
14768ca6e3
|
@ -23,3 +23,4 @@
|
||||||
|
|
||||||
enum wl_shm_format fourcc_to_wl_shm(uint32_t in);
|
enum wl_shm_format fourcc_to_wl_shm(uint32_t in);
|
||||||
bool fourcc_to_pixman_fmt(pixman_format_code_t* dst, uint32_t src);
|
bool fourcc_to_pixman_fmt(pixman_format_code_t* dst, uint32_t src);
|
||||||
|
uint32_t fourcc_from_wl_shm(enum wl_shm_format in);
|
||||||
|
|
11
src/pixels.c
11
src/pixels.c
|
@ -34,6 +34,17 @@ enum wl_shm_format fourcc_to_wl_shm(uint32_t in)
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t fourcc_from_wl_shm(enum wl_shm_format in)
|
||||||
|
{
|
||||||
|
switch (in) {
|
||||||
|
case WL_SHM_FORMAT_ARGB8888: return DRM_FORMAT_ARGB8888;
|
||||||
|
case WL_SHM_FORMAT_XRGB8888: return DRM_FORMAT_XRGB8888;
|
||||||
|
default:;
|
||||||
|
}
|
||||||
|
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
bool fourcc_to_pixman_fmt(pixman_format_code_t* dst, uint32_t src)
|
bool fourcc_to_pixman_fmt(pixman_format_code_t* dst, uint32_t src)
|
||||||
{
|
{
|
||||||
assert(!(src & DRM_FORMAT_BIG_ENDIAN));
|
assert(!(src & DRM_FORMAT_BIG_ENDIAN));
|
||||||
|
|
Loading…
Reference in New Issue