mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 09:32:40 +00:00
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.
This commit is contained in:
parent
8006ff6cf6
commit
8a43fc0e9a
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
struct ra_ctx_opts {
|
struct ra_ctx_opts {
|
||||||
bool allow_sw; // allow software renderers
|
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 debug; // enable debugging layers/callbacks etc.
|
||||||
bool probing; // the backend was auto-probed
|
bool probing; // the backend was auto-probed
|
||||||
char *context_name; // filter by `ra_ctx_fns.name`
|
char *context_name; // filter by `ra_ctx_fns.name`
|
||||||
|
@ -189,7 +189,7 @@ static void resize(struct vo *vo)
|
|||||||
const int width = mp_rect_w(wl->geometry);
|
const int width = mp_rect_w(wl->geometry);
|
||||||
const int height = mp_rect_h(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->dwidth = width;
|
||||||
vo->dheight = height;
|
vo->dheight = height;
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ static int resize(struct vo *vo)
|
|||||||
const int32_t height = mp_rect_h(wl->geometry);
|
const int32_t height = mp_rect_h(wl->geometry);
|
||||||
struct buffer *buf;
|
struct buffer *buf;
|
||||||
|
|
||||||
vo_wayland_set_opaque_region(wl, 0);
|
vo_wayland_set_opaque_region(wl, false);
|
||||||
vo->want_redraw = true;
|
vo->want_redraw = true;
|
||||||
vo->dwidth = width;
|
vo->dwidth = width;
|
||||||
vo->dheight = height;
|
vo->dheight = height;
|
||||||
|
@ -2242,7 +2242,7 @@ bool vo_wayland_reconfig(struct vo *vo)
|
|||||||
return true;
|
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 width = mp_rect_w(wl->geometry);
|
||||||
const int32_t height = mp_rect_h(wl->geometry);
|
const int32_t height = mp_rect_h(wl->geometry);
|
||||||
|
@ -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);
|
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_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_sync_swap(struct vo_wayland_state *wl);
|
||||||
void vo_wayland_uninit(struct vo *vo);
|
void vo_wayland_uninit(struct vo *vo);
|
||||||
void vo_wayland_wait_events(struct vo *vo, int64_t until_time_us);
|
void vo_wayland_wait_events(struct vo *vo, int64_t until_time_us);
|
||||||
|
Loading…
Reference in New Issue
Block a user