diff options
author | Leandro Ribeiro <leandrohr@riseup.net> | 2019-11-27 12:43:01 -0300 |
---|---|---|
committer | Leandro Ribeiro <leandrohr@riseup.net> | 2019-11-27 13:46:51 -0300 |
commit | dd0d0b0df1ed3f14494891d1df22c400750f22ec (patch) | |
tree | 87282b4204897d566defcc15b59bb16cadbd01cd | |
parent | 2619bfe420c493b0adef57cf2f57b3b5fe7d7078 (diff) | |
download | weston-dd0d0b0df1ed3f14494891d1df22c400750f22ec.tar.gz |
screenshooter: stop using frame_signal void *data parameter 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 <leandrohr@riseup.net>
-rw-r--r-- | libweston/screenshooter.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libweston/screenshooter.c b/libweston/screenshooter.c index e741d48f..3b161c61 100644 --- a/libweston/screenshooter.c +++ b/libweston/screenshooter.c @@ -46,6 +46,7 @@ struct screenshooter_frame_listener { struct wl_listener listener; struct weston_buffer *buffer; + struct weston_output *output; weston_screenshooter_done_func_t done; void *data; }; @@ -119,7 +120,7 @@ screenshooter_frame_notify(struct wl_listener *listener, void *data) struct screenshooter_frame_listener *l = container_of(listener, struct screenshooter_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; @@ -202,6 +203,7 @@ weston_screenshooter_shoot(struct weston_output *output, } l->buffer = buffer; + l->output = output; l->done = done; l->data = data; l->listener.notify = screenshooter_frame_notify; @@ -261,7 +263,7 @@ weston_recorder_frame_notify(struct wl_listener *listener, void *data) { struct weston_recorder *recorder = container_of(listener, struct weston_recorder, frame_listener); - struct weston_output *output = data; + struct weston_output *output = recorder->output; struct weston_compositor *compositor = output->compositor; uint32_t msecs = timespec_to_msec(&output->frame_time); pixman_box32_t *r; |