backend-pipewire: make renderer initialization depend on renderer

Instead of always initializing the Pixman renderer, make the initialization
dependent on the selected renderer. This makes it easier to add other renderers.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
This commit is contained in:
Michael Tretter 2023-05-26 18:13:46 +02:00 committed by Daniel Stone
parent 1effba000e
commit a9d1b5dc50
1 changed files with 4 additions and 2 deletions

View File

@ -943,14 +943,16 @@ pipewire_backend_create(struct weston_compositor *compositor,
switch (config->renderer) {
case WESTON_RENDERER_AUTO:
case WESTON_RENDERER_PIXMAN:
ret = weston_compositor_init_renderer(compositor,
WESTON_RENDERER_PIXMAN,
NULL);
break;
default:
weston_log("Unsupported renderer requested\n");
goto err_compositor;
}
if (weston_compositor_init_renderer(compositor, WESTON_RENDERER_PIXMAN,
NULL) < 0)
if (ret < 0)
goto err_compositor;
compositor->capabilities |= WESTON_CAP_ARBITRARY_MODES;