aboutsummaryrefslogtreecommitdiff
path: root/examples/fullscreen-shell.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-04-22 12:42:37 +0300
committerDrew DeVault <sir@cmpwn.com>2019-04-23 14:34:30 -0600
commit23e37e7b1d8004fb5361c147239d2e628efbd5e8 (patch)
treecca1f5be5b7b0c750e7ec104c500ce1311d89d19 /examples/fullscreen-shell.c
parent56ceed38bffcc741b5a80741d0207101905370ae (diff)
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
Diffstat (limited to 'examples/fullscreen-shell.c')
-rw-r--r--examples/fullscreen-shell.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/fullscreen-shell.c b/examples/fullscreen-shell.c
index 7f2c9c2b..e9e64ce1 100644
--- a/examples/fullscreen-shell.c
+++ b/examples/fullscreen-shell.c
@@ -89,7 +89,7 @@ static void output_handle_frame(struct wl_listener *listener, void *data) {
int width, height;
wlr_output_effective_resolution(output->wlr_output, &width, &height);
- if (!wlr_output_make_current(output->wlr_output, NULL)) {
+ if (!wlr_output_attach_render(output->wlr_output, NULL)) {
return;
}
@@ -108,7 +108,7 @@ static void output_handle_frame(struct wl_listener *listener, void *data) {
}
wlr_renderer_end(renderer);
- wlr_output_swap_buffers(output->wlr_output, NULL, NULL);
+ wlr_output_commit(output->wlr_output);
}
static void output_set_surface(struct fullscreen_output *output,