[PATCH 4/4 v2 mesa] update test case to support resize by wl_surface_attach2
Zhao Halley
halley.zhao at intel.com
Thu Jun 7 02:42:54 PDT 2012
---
tests/wayland-drm/wayland-drm-test.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/wayland-drm/wayland-drm-test.c b/tests/wayland-drm/wayland-drm-test.c
index aa6f001..5317145 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 int dst_w=0, dst_h=0;
+
+ dst_w = (dst_w + win_width/10) % win_width;
+ dst_h = (dst_h + win_height/10) % win_height;
if (callback)
wl_callback_destroy(callback);
@@ -282,10 +286,10 @@ redraw(void *data, struct wl_callback *callback, int time)
}
// update
- wl_surface_attach(
+ wl_surface_attach2(
window->surface,
window->buffer,
- 0, 0
+ 0, 0, win_width+dst_w, win_height+dst_h
);
wl_surface_damage(
window->surface,
--
1.7.5.4
More information about the wayland-devel
mailing list