aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-11-18 15:01:13 +0100
committerSimon Ser <contact@emersion.fr>2020-11-30 11:08:44 +0100
commit1f15dd093d8986c783877bdfb25221f67979cad2 (patch)
tree44296a40bfd84afca2ca153d210fb47a8ed781fb /render
parentc94ab99ae26f4d5459b061bfb8ac17261afdc6a7 (diff)
render: assert {X,A}RGB8888 are supported
The Wayland protocol requires those to be supported.
Diffstat (limited to 'render')
-rw-r--r--render/wlr_renderer.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c
index 62ae9474..3703f419 100644
--- a/render/wlr_renderer.c
+++ b/render/wlr_renderer.c
@@ -217,13 +217,22 @@ bool wlr_renderer_init_wl_display(struct wlr_renderer *r,
return false;
}
+ bool argb8888 = false, xrgb8888 = false;
for (size_t i = 0; i < len; ++i) {
- // These formats are already added by default
- if (formats[i] != WL_SHM_FORMAT_ARGB8888 &&
- formats[i] != WL_SHM_FORMAT_XRGB8888) {
+ // ARGB8888 and XRGB8888 must be supported and are implicitly
+ // advertised by wl_display_init_shm
+ 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]);
}
}
+ assert(argb8888 && xrgb8888);
if (r->impl->init_wl_display) {
if (!r->impl->init_wl_display(r, wl_display)) {