mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-20 06:46:26 -04:00
shm: fix compilation on pixman without PIXMAN_rgba_float16
This commit is contained in:
parent
8faea42d9e
commit
d6a40dee35
3 changed files with 12 additions and 4 deletions
4
config.c
4
config.c
|
|
@ -2811,9 +2811,7 @@ parse_section_tweak(struct context *ctx)
|
||||||
_Static_assert(sizeof(conf->tweak.surface_bit_depth) == sizeof(int),
|
_Static_assert(sizeof(conf->tweak.surface_bit_depth) == sizeof(int),
|
||||||
"enum is not 32-bit");
|
"enum is not 32-bit");
|
||||||
|
|
||||||
/* TODO: check which version PIXMAN_rgba_float16 ended up in;
|
#if defined(HAVE_PIXMAN_RGBA_FLOAT16)
|
||||||
guessing 0.47.0, but PR is currently stuck at 0.44.3 */
|
|
||||||
#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0, 44, 3)
|
|
||||||
return value_to_enum(
|
return value_to_enum(
|
||||||
ctx,
|
ctx,
|
||||||
(const char *[]){"auto", "8-bit", "10-bit", "16f-bit", NULL},
|
(const char *[]){"auto", "8-bit", "10-bit", "16f-bit", NULL},
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,11 @@ if utf8proc.found()
|
||||||
add_project_arguments('-DFOOT_GRAPHEME_CLUSTERING=1', language: 'c')
|
add_project_arguments('-DFOOT_GRAPHEME_CLUSTERING=1', language: 'c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# TODO: should be 0.47.0?
|
||||||
|
if pixman.version().version_compare('>=0.44.3')
|
||||||
|
add_project_arguments('-DHAVE_PIXMAN_RGBA_FLOAT16', language: 'c')
|
||||||
|
endif
|
||||||
|
|
||||||
tllist = dependency('tllist', version: '>=1.1.0', fallback: 'tllist')
|
tllist = dependency('tllist', version: '>=1.1.0', fallback: 'tllist')
|
||||||
fcft = dependency('fcft', version: ['>=3.3.1', '<4.0.0'], fallback: 'fcft')
|
fcft = dependency('fcft', version: ['>=3.3.1', '<4.0.0'], fallback: 'fcft')
|
||||||
|
|
||||||
|
|
|
||||||
7
shm.c
7
shm.c
|
|
@ -984,9 +984,11 @@ shm_chain_new(struct wayland *wayl, bool scrollable, size_t pix_instances,
|
||||||
enum wl_shm_format shm_fmt_with_alpha = WL_SHM_FORMAT_ARGB8888;
|
enum wl_shm_format shm_fmt_with_alpha = WL_SHM_FORMAT_ARGB8888;
|
||||||
|
|
||||||
static bool have_logged = false;
|
static bool have_logged = false;
|
||||||
static bool have_logged_16f_fallback = false;
|
|
||||||
static bool have_logged_10_fallback = false;
|
static bool have_logged_10_fallback = false;
|
||||||
|
|
||||||
|
#if defined(HAVE_PIXMAN_RGBA_FLOAT16)
|
||||||
|
static bool have_logged_16f_fallback = false;
|
||||||
|
|
||||||
if (desired_bit_depth == SHM_BITS_16F) {
|
if (desired_bit_depth == SHM_BITS_16F) {
|
||||||
if (wayl->shm_have_abgr161616f && wayl->shm_have_xbgr161616f) {
|
if (wayl->shm_have_abgr161616f && wayl->shm_have_xbgr161616f) {
|
||||||
pixman_fmt_without_alpha = PIXMAN_rgba_float16;
|
pixman_fmt_without_alpha = PIXMAN_rgba_float16;
|
||||||
|
|
@ -1010,6 +1012,7 @@ shm_chain_new(struct wayland *wayl, bool scrollable, size_t pix_instances,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (desired_bit_depth == SHM_BITS_10 ||
|
if (desired_bit_depth == SHM_BITS_10 ||
|
||||||
(desired_bit_depth == SHM_BITS_16F &&
|
(desired_bit_depth == SHM_BITS_16F &&
|
||||||
|
|
@ -1097,7 +1100,9 @@ shm_chain_bit_depth(const struct buffer_chain *chain)
|
||||||
|
|
||||||
return fmt == PIXMAN_a8r8g8b8
|
return fmt == PIXMAN_a8r8g8b8
|
||||||
? SHM_BITS_8
|
? SHM_BITS_8
|
||||||
|
#if defined(HAVE_PIXMAN_RGBA_FLOAT16)
|
||||||
: fmt == PIXMAN_rgba_float16
|
: fmt == PIXMAN_rgba_float16
|
||||||
? SHM_BITS_16F
|
? SHM_BITS_16F
|
||||||
|
#endif
|
||||||
: SHM_BITS_10;
|
: SHM_BITS_10;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue