mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-12-22 09:59:48 +01:00
output: Drop back_buffer
This commit is contained in:
parent
fc6000251c
commit
7702a19739
3 changed files with 0 additions and 33 deletions
|
@ -200,7 +200,6 @@ struct wlr_output {
|
|||
struct wlr_allocator *allocator;
|
||||
struct wlr_renderer *renderer;
|
||||
struct wlr_swapchain *swapchain;
|
||||
struct wlr_buffer *back_buffer;
|
||||
|
||||
struct wl_listener display_destroy;
|
||||
|
||||
|
|
|
@ -440,7 +440,6 @@ void wlr_output_destroy(struct wlr_output *output) {
|
|||
}
|
||||
|
||||
wlr_output_destroy_global(output);
|
||||
output_clear_back_buffer(output);
|
||||
|
||||
wl_list_remove(&output->display_destroy.link);
|
||||
|
||||
|
@ -761,12 +760,6 @@ bool wlr_output_test_state(struct wlr_output *output,
|
|||
bool wlr_output_test(struct wlr_output *output) {
|
||||
struct wlr_output_state state = output->pending;
|
||||
|
||||
if (output->back_buffer != NULL) {
|
||||
assert((state.committed & WLR_OUTPUT_STATE_BUFFER) == 0);
|
||||
state.committed |= WLR_OUTPUT_STATE_BUFFER;
|
||||
state.buffer = output->back_buffer;
|
||||
}
|
||||
|
||||
return wlr_output_test_state(output, &state);
|
||||
}
|
||||
|
||||
|
@ -840,22 +833,12 @@ bool wlr_output_commit(struct wlr_output *output) {
|
|||
struct wlr_output_state state = {0};
|
||||
output_state_move(&state, &output->pending);
|
||||
|
||||
// output_clear_back_buffer detaches the buffer from the renderer. This is
|
||||
// important to do before calling impl->commit(), because this marks an
|
||||
// implicit rendering synchronization point. The backend needs it to avoid
|
||||
// displaying a buffer when asynchronous GPU work isn't finished.
|
||||
if (output->back_buffer != NULL) {
|
||||
wlr_output_state_set_buffer(&state, output->back_buffer);
|
||||
output_clear_back_buffer(output);
|
||||
}
|
||||
|
||||
bool ok = wlr_output_commit_state(output, &state);
|
||||
wlr_output_state_finish(&state);
|
||||
return ok;
|
||||
}
|
||||
|
||||
void wlr_output_rollback(struct wlr_output *output) {
|
||||
output_clear_back_buffer(output);
|
||||
output_state_clear(&output->pending);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
bool wlr_output_init_render(struct wlr_output *output,
|
||||
struct wlr_allocator *allocator, struct wlr_renderer *renderer) {
|
||||
assert(allocator != NULL && renderer != NULL);
|
||||
assert(output->back_buffer == NULL);
|
||||
|
||||
uint32_t backend_caps = backend_get_buffer_caps(output->backend);
|
||||
uint32_t renderer_caps = renderer_get_render_buffer_caps(renderer);
|
||||
|
@ -43,20 +42,6 @@ bool wlr_output_init_render(struct wlr_output *output,
|
|||
return true;
|
||||
}
|
||||
|
||||
void output_clear_back_buffer(struct wlr_output *output) {
|
||||
if (output->back_buffer == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
struct wlr_renderer *renderer = output->renderer;
|
||||
assert(renderer != NULL);
|
||||
|
||||
renderer_bind_buffer(renderer, NULL);
|
||||
|
||||
wlr_buffer_unlock(output->back_buffer);
|
||||
output->back_buffer = NULL;
|
||||
}
|
||||
|
||||
static struct wlr_buffer *output_acquire_empty_buffer(struct wlr_output *output,
|
||||
const struct wlr_output_state *state) {
|
||||
assert(!(state->committed & WLR_OUTPUT_STATE_BUFFER));
|
||||
|
|
Loading…
Reference in a new issue