From 8439c084e10fdcb60eb7c3f8f393a33d256f2e41 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sun, 8 Jan 2023 14:02:13 -0600 Subject: wayland: make vo_wayland_reconfig a bool This was already returning true/false but the type was int. Also simplify a few places in the wayland contexts where we can just return the value of this function instead of doing redundant checks. --- video/out/opengl/context_wayland.c | 5 +---- video/out/vulkan/context_wayland.c | 5 +---- video/out/wayland_common.c | 2 +- video/out/wayland_common.h | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) (limited to 'video/out') diff --git a/video/out/opengl/context_wayland.c b/video/out/opengl/context_wayland.c index ac843f8c43..400da0047d 100644 --- a/video/out/opengl/context_wayland.c +++ b/video/out/opengl/context_wayland.c @@ -149,10 +149,7 @@ static bool egl_create_context(struct ra_ctx *ctx) static bool wayland_egl_reconfig(struct ra_ctx *ctx) { - if (!vo_wayland_reconfig(ctx->vo)) - return false; - - return true; + return vo_wayland_reconfig(ctx->vo); } static void wayland_egl_uninit(struct ra_ctx *ctx) diff --git a/video/out/vulkan/context_wayland.c b/video/out/vulkan/context_wayland.c index fe20336a9e..fb6d91dacd 100644 --- a/video/out/vulkan/context_wayland.c +++ b/video/out/vulkan/context_wayland.c @@ -123,10 +123,7 @@ static bool resize(struct ra_ctx *ctx) static bool wayland_vk_reconfig(struct ra_ctx *ctx) { - if (!vo_wayland_reconfig(ctx->vo)) - return false; - - return true; + return vo_wayland_reconfig(ctx->vo); } static int wayland_vk_control(struct ra_ctx *ctx, int *events, int request, void *arg) diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index dadc93a5ef..dd233119a1 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -2069,7 +2069,7 @@ err: return false; } -int vo_wayland_reconfig(struct vo *vo) +bool vo_wayland_reconfig(struct vo *vo) { struct vo_wayland_state *wl = vo->wl; diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h index b7f2e4645d..4390b7927d 100644 --- a/video/out/wayland_common.h +++ b/video/out/wayland_common.h @@ -154,11 +154,11 @@ struct vo_wayland_state { bool vo_wayland_check_visible(struct vo *vo); bool vo_wayland_init(struct vo *vo); +bool vo_wayland_reconfig(struct vo *vo); bool vo_wayland_supported_format(struct vo *vo, uint32_t format, uint64_t modifier); int vo_wayland_allocate_memfd(struct vo *vo, size_t size); int vo_wayland_control(struct vo *vo, int *events, int request, void *arg); -int vo_wayland_reconfig(struct vo *vo); void vo_wayland_set_opaque_region(struct vo_wayland_state *wl, int alpha); void vo_wayland_sync_swap(struct vo_wayland_state *wl); -- cgit v1.2.3