output-damage: stop using enum wlr_output_state_buffer_type

This enum will get dropped in the next commit.
This commit is contained in:
Simon Ser 2021-07-12 18:00:55 +02:00 committed by Simon Zeni
parent 4ddde1a7bd
commit f211bc983a
2 changed files with 5 additions and 11 deletions

View File

@ -43,7 +43,7 @@ struct wlr_output_damage {
pixman_region32_t previous[WLR_OUTPUT_DAMAGE_PREVIOUS_LEN]; pixman_region32_t previous[WLR_OUTPUT_DAMAGE_PREVIOUS_LEN];
size_t previous_idx; size_t previous_idx;
enum wlr_output_state_buffer_type pending_buffer_type; bool pending_attach_render;
struct { struct {
struct wl_signal frame; struct wl_signal frame;

View File

@ -52,11 +52,8 @@ static void output_handle_precommit(struct wl_listener *listener, void *data) {
if (output->pending.committed & WLR_OUTPUT_STATE_BUFFER) { if (output->pending.committed & WLR_OUTPUT_STATE_BUFFER) {
// TODO: find a better way to access this info without a precommit // TODO: find a better way to access this info without a precommit
// handler // handler
if (output->back_buffer != NULL) { output_damage->pending_attach_render = output->back_buffer != NULL ||
output_damage->pending_buffer_type = WLR_OUTPUT_STATE_BUFFER_RENDER; output->pending.buffer_type == WLR_OUTPUT_STATE_BUFFER_RENDER;
} else {
output_damage->pending_buffer_type = output->pending.buffer_type;
}
} }
} }
@ -74,8 +71,7 @@ static void output_handle_commit(struct wl_listener *listener, void *data) {
} }
pixman_region32_t *prev; pixman_region32_t *prev;
switch (output_damage->pending_buffer_type) { if (output_damage->pending_attach_render) {
case WLR_OUTPUT_STATE_BUFFER_RENDER:
// render-buffers have been swapped, rotate the damage // render-buffers have been swapped, rotate the damage
// same as decrementing, but works on unsigned integers // same as decrementing, but works on unsigned integers
@ -84,12 +80,10 @@ static void output_handle_commit(struct wl_listener *listener, void *data) {
prev = &output_damage->previous[output_damage->previous_idx]; prev = &output_damage->previous[output_damage->previous_idx];
pixman_region32_copy(prev, &output_damage->current); pixman_region32_copy(prev, &output_damage->current);
break; } else {
case WLR_OUTPUT_STATE_BUFFER_SCANOUT:
// accumulate render-buffer damage // accumulate render-buffer damage
prev = &output_damage->previous[output_damage->previous_idx]; prev = &output_damage->previous[output_damage->previous_idx];
pixman_region32_union(prev, prev, &output_damage->current); pixman_region32_union(prev, prev, &output_damage->current);
break;
} }
pixman_region32_clear(&output_damage->current); pixman_region32_clear(&output_damage->current);