diff options
author | Simon Ser <contact@emersion.fr> | 2021-07-12 17:54:43 +0200 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-07-29 09:48:33 -0400 |
commit | 4ddde1a7bda543c4520bd6b50372c93d051e4395 (patch) | |
tree | b80f63f0278f377412fa4bcfd19c7d15bcc386ed | |
parent | d17a0090627e4e477220dc5a846ff021e297ade5 (diff) |
output: drop wlr_output_impl.{attach,rollback}_render
No backend uses these anymore.
-rw-r--r-- | include/wlr/interfaces/wlr_output.h | 13 | ||||
-rw-r--r-- | types/wlr_output.c | 42 |
2 files changed, 6 insertions, 49 deletions
diff --git a/include/wlr/interfaces/wlr_output.h b/include/wlr/interfaces/wlr_output.h index 376e0875..100754f6 100644 --- a/include/wlr/interfaces/wlr_output.h +++ b/include/wlr/interfaces/wlr_output.h @@ -52,19 +52,6 @@ struct wlr_output_impl { */ void (*destroy)(struct wlr_output *output); /** - * Make the output's back-buffer current for the renderer. - * - * buffer_age must be set to the buffer age in number of frames, or -1 if - * unknown. - */ - bool (*attach_render)(struct wlr_output *output, int *buffer_age); - /** - * Unset the current renderer's buffer. - * - * This is the opposite of attach_render. - */ - void (*rollback_render)(struct wlr_output *output); - /** * Check that the pending output state is a valid configuration. * * If this function returns true, commit can only fail due to a runtime diff --git a/types/wlr_output.c b/types/wlr_output.c index e7b063d0..d31d0c73 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -344,9 +344,6 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) { void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend, const struct wlr_output_impl *impl, struct wl_display *display) { assert(impl->commit); - if (impl->attach_render || impl->rollback_render) { - assert(impl->attach_render && impl->rollback_render); - } if (impl->set_cursor || impl->move_cursor) { assert(impl->set_cursor && impl->move_cursor); } @@ -582,21 +579,10 @@ static void output_clear_back_buffer(struct wlr_output *output) { } bool wlr_output_attach_render(struct wlr_output *output, int *buffer_age) { - if (output->impl->attach_render) { - if (!output->impl->attach_render(output, buffer_age)) { - return false; - } - - output_state_clear_buffer(&output->pending); - output->pending.committed |= WLR_OUTPUT_STATE_BUFFER; - output->pending.buffer_type = WLR_OUTPUT_STATE_BUFFER_RENDER; - } else { - if (!output_attach_back_buffer(output, buffer_age)) { - return false; - } - wlr_output_attach_buffer(output, output->back_buffer); + if (!output_attach_back_buffer(output, buffer_age)) { + return false; } - + wlr_output_attach_buffer(output, output->back_buffer); return true; } @@ -606,23 +592,13 @@ uint32_t wlr_output_preferred_read_format(struct wlr_output *output) { return DRM_FORMAT_INVALID; } - if (output->impl->attach_render) { - if (!output->impl->attach_render(output, NULL)) { - return false; - } - } else { - if (!output_attach_back_buffer(output, NULL)) { - return false; - } + if (!output_attach_back_buffer(output, NULL)) { + return false; } uint32_t fmt = renderer->impl->preferred_read_format(renderer); - if (output->impl->rollback_render) { - output->impl->rollback_render(output); - } else { - output_clear_back_buffer(output); - } + output_clear_back_buffer(output); return fmt; } @@ -927,13 +903,7 @@ bool wlr_output_commit(struct wlr_output *output) { } void wlr_output_rollback(struct wlr_output *output) { - if (output->impl->rollback_render && - (output->pending.committed & WLR_OUTPUT_STATE_BUFFER) && - output->pending.buffer_type == WLR_OUTPUT_STATE_BUFFER_RENDER) { - output->impl->rollback_render(output); - } output_clear_back_buffer(output); - output_state_clear(&output->pending); } |