From 7550e483ae04e1f1d601d90b5a624036554c1533 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Mon, 15 Jul 2024 14:10:15 +0200 Subject: [PATCH] docs: update comments for wlr_output API changes The old wlr_output_{commit,test}() functions are still mentioned in multiple places. --- examples/output-layers.c | 2 +- include/wlr/types/wlr_output.h | 7 ++++--- include/wlr/types/wlr_output_layer.h | 20 ++++++++++---------- include/wlr/types/wlr_presentation_time.h | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/examples/output-layers.c b/examples/output-layers.c index 5089c6aa..1863d16e 100644 --- a/examples/output-layers.c +++ b/examples/output-layers.c @@ -87,7 +87,7 @@ static void output_handle_frame(struct wl_listener *listener, void *data) { layers_arr.size / sizeof(struct wlr_output_layer_state)); if (!wlr_output_test_state(output->wlr_output, &output_state)) { - wlr_log(WLR_ERROR, "wlr_output_test() failed"); + wlr_log(WLR_ERROR, "wlr_output_test_state() failed"); return; } diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 2fb98780..ead47039 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -121,8 +121,9 @@ struct wlr_render_pass; * The `frame` event will be emitted when it is a good time for the compositor * to submit a new frame. * - * To render a new frame, compositors should call wlr_output_begin_render_pass(), - * perform rendering on that render pass and finally call wlr_output_commit(). + * To render a new frame compositors should call wlr_output_begin_render_pass(), + * perform rendering on that render pass, and finally call + * wlr_output_commit_state(). */ struct wlr_output { const struct wlr_output_impl *impl; @@ -280,7 +281,7 @@ void wlr_output_destroy_global(struct wlr_output *output); * the allocator and renderer to different values. * * Call this function prior to any call to wlr_output_begin_render_pass(), - * wlr_output_commit() or wlr_output_cursor_create(). + * wlr_output_commit_state() or wlr_output_cursor_create(). * * The buffer capabilities of the provided must match the capabilities of the * output's backend. Returns false otherwise. diff --git a/include/wlr/types/wlr_output_layer.h b/include/wlr/types/wlr_output_layer.h index af843d07..461e13dd 100644 --- a/include/wlr/types/wlr_output_layer.h +++ b/include/wlr/types/wlr_output_layer.h @@ -23,16 +23,16 @@ * * To configure output layers, callers should call wlr_output_layer_create() to * create layers, attach struct wlr_output_layer_state onto - * struct wlr_output_state via wlr_output_set_layers() to describe their new - * state, and commit the output via wlr_output_commit(). + * struct wlr_output_state via wlr_output_state_set_layers() to describe their new + * state, and commit the output via wlr_output_commit_state(). * * Backends may have arbitrary limitations when it comes to displaying output * layers. Backends indicate whether or not a layer can be displayed via - * wlr_output_layer_state.accepted after wlr_output_test() or - * wlr_output_commit() is called. Compositors using the output layers API - * directly are expected to setup layers, call wlr_output_test(), paint the - * layers that the backend rejected with the renderer, then call - * wlr_output_commit(). + * wlr_output_layer_state.accepted after wlr_output_test_state() or + * wlr_output_commit_state() is called. Compositors using the output layers API + * directly are expected to setup layers, call wlr_output_test_state(), paint + * the layers that the backend rejected with the renderer, then call + * wlr_output_commit_state(). * * Callers are responsible for disabling output layers when they need the full * output contents to be composited onto a single buffer, e.g. during screen @@ -72,9 +72,9 @@ struct wlr_output_layer_state { // to damage the whole buffer. const pixman_region32_t *damage; - // Populated by the backend after wlr_output_test() and wlr_output_commit(), - // indicates whether the backend has acknowledged and will take care of - // displaying the layer + // Populated by the backend after wlr_output_test_state() and + // wlr_output_commit_state(), indicates whether the backend has acknowledged + // and will take care of displaying the layer bool accepted; }; diff --git a/include/wlr/types/wlr_presentation_time.h b/include/wlr/types/wlr_presentation_time.h index b772295e..bedd77a6 100644 --- a/include/wlr/types/wlr_presentation_time.h +++ b/include/wlr/types/wlr_presentation_time.h @@ -89,7 +89,7 @@ void wlr_presentation_event_from_output(struct wlr_presentation_event *event, * * Instead of calling wlr_presentation_surface_sampled() and managing the * struct wlr_presentation_feedback itself, the compositor can call this function - * before a wlr_output_commit() call to indicate that the surface's current + * before a wlr_output_commit_state() call to indicate that the surface's current * contents have been copied to a buffer which will be displayed on the output. */ void wlr_presentation_surface_textured_on_output(struct wlr_surface *surface,