summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/context.h
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-04-06 23:01:21 -0500
committerDudemanguy <random342@airmail.cc>2022-04-11 18:14:22 +0000
commit2c2a856f2512843d12931a1f6f5b15ea76db8502 (patch)
tree075f6fd3e2d1b44b01b86861bc03f4a56ae90137 /video/out/opengl/context.h
parent5edc49adc96b45479383483a0d53db7f48d1e362 (diff)
downloadmpv-2c2a856f2512843d12931a1f6f5b15ea76db8502.tar.bz2
mpv-2c2a856f2512843d12931a1f6f5b15ea76db8502.tar.xz
wayland: unify visibility checking code
A bit of a personal pet peeve. vulkan, opengl, and wlshm all had different methods for doing wayland's "check for visibility before drawing" thing. The specific backend doesn't matter in this case and the logic should all be shared. Additionally, the external swapchain that the opengl code on wayland uses is done away with and it instead copies vulkan by using a param. This keeps things looking more uniform across backends and also makes it easier to extend to other platforms (see the next couple of commits).
Diffstat (limited to 'video/out/opengl/context.h')
-rw-r--r--video/out/opengl/context.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/video/out/opengl/context.h b/video/out/opengl/context.h
index 222661ad83..19521ff54b 100644
--- a/video/out/opengl/context.h
+++ b/video/out/opengl/context.h
@@ -21,6 +21,10 @@ enum gles_mode ra_gl_ctx_get_glesmode(struct ra_ctx *ctx);
// clean them up)
struct ra_gl_ctx_params {
+ // For special contexts (i.e. wayland) that want to check visibility
+ // before drawing a frame.
+ bool (*check_visible)(struct ra_ctx *ctx);
+
// Set to the platform-specific function to swap buffers, like
// glXSwapBuffers, eglSwapBuffers etc. This will be called by
// ra_gl_ctx_swap_buffers. Required unless you either never call that