clients: Allow simple-egl to use wl_surface_damage_buffer
authorDerek Foreman <derekf@osg.samsung.com>
Fri, 19 May 2017 14:39:06 +0000 (09:39 -0500)
committerDerek Foreman <derekf@osg.samsung.com>
Fri, 19 May 2017 21:43:55 +0000 (16:43 -0500)
wl_surface_damage_buffer landed ages ago, but in order for GL to
use it the client must bind a wl_compositor version >= 4 (the
version where damage_buffer was introduced).

This patch updates the bind version and allows
eglSwapBuffersWithDamage to actually use the provided damage
rectangles instead of performing full surface damage.

This log is much longer than the patch.

Reviewed-by: Daniel Stone <daniels@collabora.com>
clients/simple-egl.c

index c4f72a4..dad0f09 100644 (file)
@@ -797,7 +797,8 @@ registry_handle_global(void *data, struct wl_registry *registry,
        if (strcmp(interface, "wl_compositor") == 0) {
                d->compositor =
                        wl_registry_bind(registry, name,
-                                        &wl_compositor_interface, 1);
+                                        &wl_compositor_interface,
+                                        MIN(version, 4));
        } else if (strcmp(interface, "zxdg_shell_v6") == 0) {
                d->shell = wl_registry_bind(registry, name,
                                            &zxdg_shell_v6_interface, 1);