summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2015-03-22 02:48:09 +0200
committerwm4 <wm4@nowhere>2015-03-23 21:53:32 +0100
commitc10fb4ce9fcd3dbbf69741eb8499c4cfabbf5412 (patch)
treec5b5c05ae3b98098e665fee994dcf3722710383a
parent3714430cdf0c1515da5dea9e3c098f02802a45ee (diff)
downloadmpv-c10fb4ce9fcd3dbbf69741eb8499c4cfabbf5412.tar.bz2
mpv-c10fb4ce9fcd3dbbf69741eb8499c4cfabbf5412.tar.xz
vo_wayland: define opaque region
This allows compositor to optimize rendering, as it will know mpv is not transparent.
-rw-r--r--video/out/wayland_common.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 5ddd1ad54c..aff3d7c2ee 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -795,6 +795,15 @@ static void schedule_resize(struct vo_wayland_state *wl,
wl->window.events |= VO_EVENT_RESIZE;
wl->vo->dwidth = width;
wl->vo->dheight = height;
+
+ struct wl_region *region = wl_compositor_create_region(wl->display.compositor);
+
+ if (region) {
+ wl_region_add(region, x, y, width, height);
+ wl_surface_set_opaque_region(wl->window.video_surface, region);
+ wl_surface_commit(wl->window.video_surface);
+ wl_region_destroy(region);
+ }
}
static void frame_callback(void *data,