noop-render: Allow solid-color buffers

Refactor the buffer-type check slightly so we can handle solid-color
buffers, which we do exactly nothing with.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2022-01-17 14:56:24 +00:00
parent d82d74e713
commit 493a4c013e

View File

@ -63,7 +63,14 @@ noop_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer)
if (!buffer)
return;
if (buffer->type != WESTON_BUFFER_SHM) {
switch (buffer->type) {
case WESTON_BUFFER_SOLID:
/* no-op, early exit */
return;
case WESTON_BUFFER_SHM:
/* fine */
break;
default:
weston_log("No-op renderer supports only SHM buffers\n");
return;
}