mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-02 03:45:58 +01:00
render: assert {X,A}RGB8888 are supported
The Wayland protocol requires those to be supported.
This commit is contained in:
parent
c94ab99ae2
commit
1f15dd093d
1 changed files with 12 additions and 3 deletions
|
@ -217,13 +217,22 @@ bool wlr_renderer_init_wl_display(struct wlr_renderer *r,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool argb8888 = false, xrgb8888 = false;
|
||||||
for (size_t i = 0; i < len; ++i) {
|
for (size_t i = 0; i < len; ++i) {
|
||||||
// These formats are already added by default
|
// ARGB8888 and XRGB8888 must be supported and are implicitly
|
||||||
if (formats[i] != WL_SHM_FORMAT_ARGB8888 &&
|
// advertised by wl_display_init_shm
|
||||||
formats[i] != WL_SHM_FORMAT_XRGB8888) {
|
switch (formats[i]) {
|
||||||
|
case WL_SHM_FORMAT_ARGB8888:
|
||||||
|
argb8888 = true;
|
||||||
|
break;
|
||||||
|
case WL_SHM_FORMAT_XRGB8888:
|
||||||
|
xrgb8888 = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
wl_display_add_shm_format(wl_display, formats[i]);
|
wl_display_add_shm_format(wl_display, formats[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
assert(argb8888 && xrgb8888);
|
||||||
|
|
||||||
if (r->impl->init_wl_display) {
|
if (r->impl->init_wl_display) {
|
||||||
if (!r->impl->init_wl_display(r, wl_display)) {
|
if (!r->impl->init_wl_display(r, wl_display)) {
|
||||||
|
|
Loading…
Reference in a new issue