pixman-renderer: Replace output-create flags with struct

pixman_renderer_output_create currently takes a flags enum bitmask for
its options. Switch this to using a structure, so we can introduce other
non-boolean options.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone
2020-03-06 12:46:30 +00:00
committed by Pekka Paalanen
parent 786490cb53
commit 61abf35ec4
8 changed files with 39 additions and 23 deletions
+8 -4
View File
@@ -836,6 +836,9 @@ x11_output_switch_mode(struct weston_output *base, struct weston_mode *mode)
output->mode.height = mode->height;
if (b->use_pixman) {
const struct pixman_renderer_output_options options = {
.use_shadow = true,
};
pixman_renderer_output_destroy(&output->base);
x11_output_deinit_shm(b, output);
@@ -846,8 +849,7 @@ x11_output_switch_mode(struct weston_output *base, struct weston_mode *mode)
return -1;
}
if (pixman_renderer_output_create(&output->base,
PIXMAN_RENDERER_OUTPUT_USE_SHADOW) < 0) {
if (pixman_renderer_output_create(&output->base, &options) < 0) {
weston_log("Failed to create pixman renderer for output\n");
x11_output_deinit_shm(b, output);
return -1;
@@ -1014,14 +1016,16 @@ x11_output_enable(struct weston_output *base)
x11_output_wait_for_map(b, output);
if (b->use_pixman) {
const struct pixman_renderer_output_options options = {
.use_shadow = true,
};
if (x11_output_init_shm(b, output,
output->base.current_mode->width,
output->base.current_mode->height) < 0) {
weston_log("Failed to initialize SHM for the X11 output\n");
goto err;
}
if (pixman_renderer_output_create(&output->base,
PIXMAN_RENDERER_OUTPUT_USE_SHADOW) < 0) {
if (pixman_renderer_output_create(&output->base, &options) < 0) {
weston_log("Failed to create pixman renderer for output\n");
x11_output_deinit_shm(b, output);
goto err;