From bf93d2e67c51e7f3f88620999f0225a34c039047 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 19 Jun 2020 15:49:55 +0200 Subject: output: rename impl->rollback to rollback_render The output backend API is now mostly state-less thanks to the atomic hooks (commit and test). There is one exception though: attach_render. This function makes the rendering context current. However sometimes the compositor might decide not to render after attach_render (e.g. when there's nothing new to render to the back buffer). Thus wlr_output_rollback has been introduced to revert the pending state. Because the output backend API is mostly state-less, the only thing wlr_output_impl.rollback needs to do is revert the current rendering context. Rename the function to rollback_render to make this clear. Add a check in the common wlr_output code to only call rollback_render when attach_buffer has been previously called. On the long term, we'll be able to remove attach_render and rollback_render together. --- backend/x11/output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backend/x11') diff --git a/backend/x11/output.c b/backend/x11/output.c index 953c2ba2..07374b61 100644 --- a/backend/x11/output.c +++ b/backend/x11/output.c @@ -160,7 +160,7 @@ static bool output_commit(struct wlr_output *wlr_output) { return true; } -static void output_rollback(struct wlr_output *wlr_output) { +static void output_rollback_render(struct wlr_output *wlr_output) { struct wlr_x11_output *output = get_x11_output_from_output(wlr_output); wlr_egl_unset_current(&output->x11->egl); } @@ -170,7 +170,7 @@ static const struct wlr_output_impl output_impl = { .attach_render = output_attach_render, .test = output_test, .commit = output_commit, - .rollback = output_rollback, + .rollback_render = output_rollback_render, }; struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) { -- cgit v1.2.3