commit b31fa92

Michael Forney  ·  2019-12-19 00:25:55 +0000 UTC
parent a01a330
compositor, surface: Implement protocol version 4 (damage_buffer)

We don't support buffer scaling, so handle this the same way as
damage.
2 files changed,  +10, -3
+3, -3
 1@@ -776,8 +776,8 @@ bind_compositor(struct wl_client *client, void *data, uint32_t version, uint32_t
 2 {
 3 	struct wl_resource *resource;
 4 
 5-	if (version > 3)
 6-		version = 3;
 7+	if (version > 4)
 8+		version = 4;
 9 
10 	resource = wl_resource_create(client, &wl_compositor_interface, version, id);
11 	wl_resource_set_implementation(resource, &compositor_impl, NULL, NULL);
12@@ -789,7 +789,7 @@ compositor_initialize(void)
13 	struct screen *screen;
14 	uint32_t keysym;
15 
16-	compositor.global = wl_global_create(swc.display, &wl_compositor_interface, 3, NULL, &bind_compositor);
17+	compositor.global = wl_global_create(swc.display, &wl_compositor_interface, 4, NULL, &bind_compositor);
18 
19 	if (!compositor.global)
20 		return false;
+7, -0
 1@@ -273,6 +273,12 @@ set_buffer_scale(struct wl_client *client, struct wl_resource *surface, int32_t
 2 	/* TODO: Implement */
 3 }
 4 
 5+static void
 6+damage_buffer(struct wl_client *client, struct wl_resource *surface, int32_t x, int32_t y, int32_t w, int32_t h)
 7+{
 8+	damage(client, surface, x, y, w, h);
 9+}
10+
11 static struct wl_surface_interface surface_impl = {
12 	.destroy = destroy_resource,
13 	.attach = attach,
14@@ -283,6 +289,7 @@ static struct wl_surface_interface surface_impl = {
15 	.commit = commit,
16 	.set_buffer_transform = set_buffer_transform,
17 	.set_buffer_scale = set_buffer_scale,
18+	.damage_buffer = damage_buffer,
19 };
20 
21 static void