From 442ffcb755737c4f96e1140a7bdaec5dd741879a Mon Sep 17 00:00:00 2001 From: Leandro Ribeiro Date: Wed, 27 Nov 2019 12:47:19 -0300 Subject: [PATCH] tests: stop using frame_signal 'void *data' argument to get weston_output Instead of getting weston_output from the frame_signal argument 'void *data', add weston_output in the private data struct of the users that are listening to frame_signal. With this change we are able to pass previous_damage as the data argument. Signed-off-by: Leandro Ribeiro --- tests/weston-test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/weston-test.c b/tests/weston-test.c index 4b9f1135..c404f281 100644 --- a/tests/weston-test.c +++ b/tests/weston-test.c @@ -367,6 +367,7 @@ struct test_screenshot { struct test_screenshot_frame_listener { struct wl_listener listener; struct weston_buffer *buffer; + struct weston_output *output; weston_test_screenshot_done_func_t done; void *data; }; @@ -441,7 +442,7 @@ test_screenshot_frame_notify(struct wl_listener *listener, void *data) struct test_screenshot_frame_listener *l = container_of(listener, struct test_screenshot_frame_listener, listener); - struct weston_output *output = data; + struct weston_output *output = l->output; struct weston_compositor *compositor = output->compositor; int32_t stride; uint8_t *pixels, *d, *s; @@ -536,6 +537,7 @@ weston_test_screenshot_shoot(struct weston_output *output, /* Set up the listener */ l->buffer = buffer; + l->output = output; l->done = done; l->data = data; l->listener.notify = test_screenshot_frame_notify;