From 23e37e7b1d8004fb5361c147239d2e628efbd5e8 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 22 Apr 2019 12:42:37 +0300 Subject: output: refactor frame submission API This is necessary for direct scan-out and other upcoming features. This patch changes the output API to look like the wl_surface API. Outputs now have some double-buffered state: the frame to be submitted (currently only wlr_renderer frames are supported) and the damaged region. To attach a pending frame, use wlr_output_attach_render. To set the pending damaged region, use wlr_output_set_damage. To submit the pending state, call wlr_output_commit. This will submit the pending frame to the backend. To migrate from the old API to the new one: - Replace wlr_output_make_current calls by wlr_output_attach_render - Replace wlr_output_swap_buffers calls by wlr_output_set_damage and wlr_output_commit --- examples/simple.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/simple.c') diff --git a/examples/simple.c b/examples/simple.c index e1c10906..27eb6c20 100644 --- a/examples/simple.c +++ b/examples/simple.c @@ -56,12 +56,12 @@ void output_frame_notify(struct wl_listener *listener, void *data) { sample->dec = inc; } - wlr_output_make_current(sample_output->output, NULL); + wlr_output_attach_render(sample_output->output, NULL); glClearColor(sample->color[0], sample->color[1], sample->color[2], 1.0); glClear(GL_COLOR_BUFFER_BIT); - wlr_output_swap_buffers(sample_output->output, NULL, NULL); + wlr_output_commit(sample_output->output); sample->last_frame = now; } -- cgit v1.2.3