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.
This commit is contained in:
Simon Ser 2019-04-23 19:26:21 +03:00 committed by Drew DeVault
parent 23e37e7b1d
commit 9a0f8a194c
14 changed files with 136 additions and 108 deletions

View file

@ -50,7 +50,7 @@ static bool output_set_custom_mode(struct wlr_output *wlr_output,
return true;
}
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_wl_output *output =
get_wl_output_from_output(wlr_output);
@ -58,8 +58,7 @@ static bool output_make_current(struct wlr_output *wlr_output,
buffer_age);
}
static bool output_swap_buffers(struct wlr_output *wlr_output,
pixman_region32_t *damage) {
static bool output_commit(struct wlr_output *wlr_output) {
struct wlr_wl_output *output =
get_wl_output_from_output(wlr_output);
@ -71,6 +70,11 @@ static bool output_swap_buffers(struct wlr_output *wlr_output,
output->frame_callback = wl_surface_frame(output->surface);
wl_callback_add_listener(output->frame_callback, &frame_listener, output);
pixman_region32_t *damage = NULL;
if (wlr_output->pending.committed & WLR_OUTPUT_STATE_DAMAGE) {
damage = &wlr_output->pending.damage;
}
if (!wlr_egl_swap_buffers(&output->backend->egl,
output->egl_surface, damage)) {
return false;
@ -220,8 +224,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,
.set_cursor = output_set_cursor,
.move_cursor = output_move_cursor,
.schedule_frame = output_schedule_frame,