diff options
author | Simon Ser <contact@emersion.fr> | 2019-11-17 00:24:19 +0100 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-11-21 11:19:00 -0500 |
commit | 1d3cbe9f278297fffa83e4e0c99d8ba46903cc3e (patch) | |
tree | 7d34bc02a4b205d4ffba77760064b6d9e70894a7 /sway | |
parent | 5d882cb5fc2d9d9fd68439021e48a90aa2e50e79 (diff) |
Use new presentation-time helper
This has the advantage to (1) reduce boilerplate and (2) make us
correctly handle wlr_output_event_present.commit_seq.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/desktop/output.c | 21 | ||||
-rw-r--r-- | sway/desktop/render.c | 3 |
2 files changed, 4 insertions, 20 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index dea087c6..400f1d66 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -498,7 +498,8 @@ static bool scan_out_fullscreen_view(struct sway_output *output, return false; } - wlr_presentation_surface_sampled(server.presentation, surface); + wlr_presentation_surface_sampled_on_output(server.presentation, surface, + wlr_output); if (!wlr_output_attach_buffer(wlr_output, surface->buffer)) { return false; @@ -842,14 +843,6 @@ static void handle_scale(struct wl_listener *listener, void *data) { update_output_manager_config(output->server); } -static void send_presented_iterator(struct sway_output *output, struct sway_view *view, - struct wlr_surface *surface, struct wlr_box *box, float rotation, - void *data) { - struct wlr_presentation_event *event = data; - wlr_presentation_send_surface_presented(server.presentation, - surface, event); -} - static void handle_present(struct wl_listener *listener, void *data) { struct sway_output *output = wl_container_of(listener, output, present); struct wlr_output_event_present *output_event = data; @@ -860,16 +853,6 @@ static void handle_present(struct wl_listener *listener, void *data) { output->last_presentation = *output_event->when; output->refresh_nsec = output_event->refresh; - - struct wlr_presentation_event event = { - .output = output->wlr_output, - .tv_sec = (uint64_t)output_event->when->tv_sec, - .tv_nsec = (uint32_t)output_event->when->tv_nsec, - .refresh = (uint32_t)output_event->refresh, - .seq = (uint64_t)output_event->seq, - .flags = output_event->flags, - }; - output_for_each_surface(output, send_presented_iterator, &event); } void handle_new_output(struct wl_listener *listener, void *data) { diff --git a/sway/desktop/render.c b/sway/desktop/render.c index c432b476..960fe083 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -121,7 +121,8 @@ static void render_surface_iterator(struct sway_output *output, struct sway_view render_texture(wlr_output, output_damage, texture, &box, matrix, alpha); - wlr_presentation_surface_sampled(server.presentation, surface); + wlr_presentation_surface_sampled_on_output(server.presentation, surface, + wlr_output); } static void render_layer(struct sway_output *output, |