[PATCH 4/4 test] use wl_surface_damage2 for resize

Zhao Halley halley.zhao at intel.com
Wed Jun 6 20:33:57 PDT 2012


---
 tests/wayland-drm/wayland-drm-test.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/tests/wayland-drm/wayland-drm-test.c b/tests/wayland-drm/wayland-drm-test.c
index aa6f001..2f29072 100755
--- a/tests/wayland-drm/wayland-drm-test.c
+++ b/tests/wayland-drm/wayland-drm-test.c
@@ -271,6 +271,10 @@ static void
 redraw(void *data, struct wl_callback *callback, int time)
 {
 	struct window *window = data;
+    static unsigned int damage_w=0, damage_h=0;
+
+    damage_w = (damage_w + win_width/10) % win_width;
+    damage_h = (damage_h + win_height/10) % win_height;
 	if (callback)
 		wl_callback_destroy(callback);
 
@@ -287,11 +291,12 @@ redraw(void *data, struct wl_callback *callback, int time)
         window->buffer,
         0, 0
     );
-    wl_surface_damage(
+    wl_surface_damage2(
         window->surface,
-        0, 0, win_width, win_height
+        0, 0, win_width, win_height, 
+        win_width+damage_w, win_height+damage_h
     );
-    
+
 	window->callback = wl_surface_frame(window->surface);
 	wl_callback_add_listener(window->callback, &frame_listener, window);
     sleep(1);
-- 
1.7.5.4



More information about the wayland-devel mailing list