summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorRay Smith <rsmith@brightsign.biz>2023-02-27 11:12:09 +0000
committerDudemanguy <random342@airmail.cc>2023-02-28 14:53:32 +0000
commit8a43fc0e9ae10741b2ccdb59e370ea1bf5013393 (patch)
tree4101c2527a6526322297b76fd3725f6de5e3267c /video/out
parent8006ff6cf6af462944cfbb9d4d816e40961a5de1 (diff)
downloadmpv-8a43fc0e9ae10741b2ccdb59e370ea1bf5013393.tar.bz2
mpv-8a43fc0e9ae10741b2ccdb59e370ea1bf5013393.tar.xz
wayland: use bool type for alpha framebuffer tracking
ra_ctx_opts.want_alpha and vo_wayland_set_opaque_region's alpha argument are only used as bool but both are ints. Particularly for the function argument, passing a 0 or 1 is confusing - at first glance it looks like you're specifying an alpha value of 0 or 1. Since they're only used as bools, make them bools.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/gpu/context.h2
-rw-r--r--video/out/vo_dmabuf_wayland.c2
-rw-r--r--video/out/vo_wlshm.c2
-rw-r--r--video/out/wayland_common.c2
-rw-r--r--video/out/wayland_common.h2
5 files changed, 5 insertions, 5 deletions
diff --git a/video/out/gpu/context.h b/video/out/gpu/context.h
index a7510c2afd..8ad77a6698 100644
--- a/video/out/gpu/context.h
+++ b/video/out/gpu/context.h
@@ -7,7 +7,7 @@
struct ra_ctx_opts {
bool allow_sw; // allow software renderers
- int want_alpha; // create an alpha framebuffer if possible
+ bool want_alpha; // create an alpha framebuffer if possible
bool debug; // enable debugging layers/callbacks etc.
bool probing; // the backend was auto-probed
char *context_name; // filter by `ra_ctx_fns.name`
diff --git a/video/out/vo_dmabuf_wayland.c b/video/out/vo_dmabuf_wayland.c
index 0ce9d82e90..6b85bdf226 100644
--- a/video/out/vo_dmabuf_wayland.c
+++ b/video/out/vo_dmabuf_wayland.c
@@ -189,7 +189,7 @@ static void resize(struct vo *vo)
const int width = mp_rect_w(wl->geometry);
const int height = mp_rect_h(wl->geometry);
- vo_wayland_set_opaque_region(wl, 0);
+ vo_wayland_set_opaque_region(wl, false);
vo->dwidth = width;
vo->dheight = height;
diff --git a/video/out/vo_wlshm.c b/video/out/vo_wlshm.c
index 44983465da..2ccdd7d681 100644
--- a/video/out/vo_wlshm.c
+++ b/video/out/vo_wlshm.c
@@ -186,7 +186,7 @@ static int resize(struct vo *vo)
const int32_t height = mp_rect_h(wl->geometry);
struct buffer *buf;
- vo_wayland_set_opaque_region(wl, 0);
+ vo_wayland_set_opaque_region(wl, false);
vo->want_redraw = true;
vo->dwidth = width;
vo->dheight = height;
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index efa00075f9..ba34273f39 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -2242,7 +2242,7 @@ bool vo_wayland_reconfig(struct vo *vo)
return true;
}
-void vo_wayland_set_opaque_region(struct vo_wayland_state *wl, int alpha)
+void vo_wayland_set_opaque_region(struct vo_wayland_state *wl, bool alpha)
{
const int32_t width = mp_rect_w(wl->geometry);
const int32_t height = mp_rect_h(wl->geometry);
diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h
index a518b8b93f..80d0835fab 100644
--- a/video/out/wayland_common.h
+++ b/video/out/wayland_common.h
@@ -171,7 +171,7 @@ int vo_wayland_allocate_memfd(struct vo *vo, size_t size);
int vo_wayland_control(struct vo *vo, int *events, int request, void *arg);
void vo_wayland_handle_fractional_scale(struct vo_wayland_state *wl);
-void vo_wayland_set_opaque_region(struct vo_wayland_state *wl, int alpha);
+void vo_wayland_set_opaque_region(struct vo_wayland_state *wl, bool alpha);
void vo_wayland_sync_swap(struct vo_wayland_state *wl);
void vo_wayland_uninit(struct vo *vo);
void vo_wayland_wait_events(struct vo *vo, int64_t until_time_us);