From 88942d43fd874292a7a56a90a0452314d99ddff9 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 14 Jul 2023 15:06:13 +0200 Subject: [PATCH] scene: rename output_present event to output_sample Using "present" is confusing here: the event is emitted when the buffer is being sampled to be displayed on an output, not when it's being presented on-screen. Rename to match the presentation-time terminology. --- include/wlr/types/wlr_scene.h | 4 ++-- types/scene/surface.c | 10 +++++----- types/scene/wlr_scene.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h index b5487528..b00f33b4 100644 --- a/include/wlr/types/wlr_scene.h +++ b/include/wlr/types/wlr_scene.h @@ -122,7 +122,7 @@ struct wlr_scene_surface { struct wl_listener outputs_update; struct wl_listener output_enter; struct wl_listener output_leave; - struct wl_listener output_present; + struct wl_listener output_sample; struct wl_listener frame_done; struct wl_listener surface_destroy; struct wl_listener surface_commit; @@ -151,7 +151,7 @@ struct wlr_scene_buffer { struct wl_signal outputs_update; // struct wlr_scene_outputs_update_event struct wl_signal output_enter; // struct wlr_scene_output struct wl_signal output_leave; // struct wlr_scene_output - struct wl_signal output_present; // struct wlr_scene_output + struct wl_signal output_sample; // struct wlr_scene_output struct wl_signal frame_done; // struct timespec } events; diff --git a/types/scene/surface.c b/types/scene/surface.c index c58bcd94..c4b9c39b 100644 --- a/types/scene/surface.c +++ b/types/scene/surface.c @@ -36,10 +36,10 @@ static void handle_scene_buffer_output_leave( wlr_surface_send_leave(surface->surface, output->output); } -static void handle_scene_buffer_output_present( +static void handle_scene_buffer_output_sample( struct wl_listener *listener, void *data) { struct wlr_scene_surface *surface = - wl_container_of(listener, surface, output_present); + wl_container_of(listener, surface, output_sample); struct wlr_scene_output *scene_output = data; if (surface->buffer->primary_output == scene_output) { @@ -157,7 +157,7 @@ static void surface_addon_destroy(struct wlr_addon *addon) { wl_list_remove(&surface->outputs_update.link); wl_list_remove(&surface->output_enter.link); wl_list_remove(&surface->output_leave.link); - wl_list_remove(&surface->output_present.link); + wl_list_remove(&surface->output_sample.link); wl_list_remove(&surface->frame_done.link); wl_list_remove(&surface->surface_destroy.link); wl_list_remove(&surface->surface_commit.link); @@ -208,8 +208,8 @@ struct wlr_scene_surface *wlr_scene_surface_create(struct wlr_scene_tree *parent surface->output_leave.notify = handle_scene_buffer_output_leave; wl_signal_add(&scene_buffer->events.output_leave, &surface->output_leave); - surface->output_present.notify = handle_scene_buffer_output_present; - wl_signal_add(&scene_buffer->events.output_present, &surface->output_present); + surface->output_sample.notify = handle_scene_buffer_output_sample; + wl_signal_add(&scene_buffer->events.output_sample, &surface->output_sample); surface->frame_done.notify = handle_scene_buffer_frame_done; wl_signal_add(&scene_buffer->events.frame_done, &surface->frame_done); diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 32a4460d..cc67bc3e 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -614,7 +614,7 @@ struct wlr_scene_buffer *wlr_scene_buffer_create(struct wlr_scene_tree *parent, wl_signal_init(&scene_buffer->events.outputs_update); wl_signal_init(&scene_buffer->events.output_enter); wl_signal_init(&scene_buffer->events.output_leave); - wl_signal_init(&scene_buffer->events.output_present); + wl_signal_init(&scene_buffer->events.output_sample); wl_signal_init(&scene_buffer->events.frame_done); pixman_region32_init(&scene_buffer->opaque_region); scene_buffer->opacity = 1; @@ -1171,7 +1171,7 @@ static void scene_entry_render(struct render_list_entry *entry, const struct ren WLR_RENDER_BLEND_MODE_PREMULTIPLIED : WLR_RENDER_BLEND_MODE_NONE, }); - wl_signal_emit_mutable(&scene_buffer->events.output_present, data->output); + wl_signal_emit_mutable(&scene_buffer->events.output_sample, data->output); break; } @@ -1572,7 +1572,7 @@ static bool scene_entry_try_direct_scanout(struct render_list_entry *entry, wlr_output_state_copy(state, &pending); wlr_output_state_finish(&pending); - wl_signal_emit_mutable(&buffer->events.output_present, scene_output); + wl_signal_emit_mutable(&buffer->events.output_sample, scene_output); return true; }