aboutsummaryrefslogtreecommitdiff
path: root/backend/x11
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-04-23 19:26:21 +0300
committerDrew DeVault <sir@cmpwn.com>2019-04-23 14:34:30 -0600
commit9a0f8a194caa35173a7f590208a64a5526290935 (patch)
tree2acebd17a1de27d3d616b2bd13a65301cff9fca5 /backend/x11
parent23e37e7b1d8004fb5361c147239d2e628efbd5e8 (diff)
output: refactor backend API
This updates the backend part of the output API. This is mostly renaming: make_current becomes attach_render and swap_buffers becomes commit. This also fixes the RDP backend to support NULL damage.
Diffstat (limited to 'backend/x11')
-rw-r--r--backend/x11/backend.c2
-rw-r--r--backend/x11/output.c16
2 files changed, 11 insertions, 7 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c
index 38715631..ddd8ab77 100644
--- a/backend/x11/backend.c
+++ b/backend/x11/backend.c
@@ -46,7 +46,7 @@ static void handle_x11_event(struct wlr_x11_backend *x11,
struct wlr_x11_output *output =
get_x11_output_from_window_id(x11, ev->window);
if (output != NULL) {
- wlr_output_update_needs_swap(&output->wlr_output);
+ wlr_output_update_needs_commit(&output->wlr_output);
}
break;
}
diff --git a/backend/x11/output.c b/backend/x11/output.c
index a9bd5c0a..8ee15d51 100644
--- a/backend/x11/output.c
+++ b/backend/x11/output.c
@@ -95,7 +95,7 @@ static void output_destroy(struct wlr_output *wlr_output) {
free(output);
}
-static bool output_make_current(struct wlr_output *wlr_output,
+static bool output_attach_render(struct wlr_output *wlr_output,
int *buffer_age) {
struct wlr_x11_output *output = get_x11_output_from_output(wlr_output);
struct wlr_x11_backend *x11 = output->x11;
@@ -103,11 +103,15 @@ static bool output_make_current(struct wlr_output *wlr_output,
return wlr_egl_make_current(&x11->egl, output->surf, buffer_age);
}
-static bool output_swap_buffers(struct wlr_output *wlr_output,
- pixman_region32_t *damage) {
- struct wlr_x11_output *output = (struct wlr_x11_output *)wlr_output;
+static bool output_commit(struct wlr_output *wlr_output) {
+ struct wlr_x11_output *output = get_x11_output_from_output(wlr_output);
struct wlr_x11_backend *x11 = output->x11;
+ pixman_region32_t *damage = NULL;
+ if (wlr_output->pending.committed & WLR_OUTPUT_STATE_DAMAGE) {
+ damage = &wlr_output->pending.damage;
+ }
+
if (!wlr_egl_swap_buffers(&x11->egl, output->surf, damage)) {
return false;
}
@@ -120,8 +124,8 @@ static const struct wlr_output_impl output_impl = {
.set_custom_mode = output_set_custom_mode,
.transform = output_transform,
.destroy = output_destroy,
- .make_current = output_make_current,
- .swap_buffers = output_swap_buffers,
+ .attach_render = output_attach_render,
+ .commit = output_commit,
};
struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) {