mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-29 07:55:59 +01:00
output-damage: stop using enum wlr_output_state_buffer_type
This enum will get dropped in the next commit.
This commit is contained in:
parent
4ddde1a7bd
commit
f211bc983a
2 changed files with 5 additions and 11 deletions
|
@ -43,7 +43,7 @@ struct wlr_output_damage {
|
|||
pixman_region32_t previous[WLR_OUTPUT_DAMAGE_PREVIOUS_LEN];
|
||||
size_t previous_idx;
|
||||
|
||||
enum wlr_output_state_buffer_type pending_buffer_type;
|
||||
bool pending_attach_render;
|
||||
|
||||
struct {
|
||||
struct wl_signal frame;
|
||||
|
|
|
@ -52,11 +52,8 @@ static void output_handle_precommit(struct wl_listener *listener, void *data) {
|
|||
if (output->pending.committed & WLR_OUTPUT_STATE_BUFFER) {
|
||||
// TODO: find a better way to access this info without a precommit
|
||||
// handler
|
||||
if (output->back_buffer != NULL) {
|
||||
output_damage->pending_buffer_type = WLR_OUTPUT_STATE_BUFFER_RENDER;
|
||||
} else {
|
||||
output_damage->pending_buffer_type = output->pending.buffer_type;
|
||||
}
|
||||
output_damage->pending_attach_render = output->back_buffer != NULL ||
|
||||
output->pending.buffer_type == WLR_OUTPUT_STATE_BUFFER_RENDER;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,8 +71,7 @@ static void output_handle_commit(struct wl_listener *listener, void *data) {
|
|||
}
|
||||
|
||||
pixman_region32_t *prev;
|
||||
switch (output_damage->pending_buffer_type) {
|
||||
case WLR_OUTPUT_STATE_BUFFER_RENDER:
|
||||
if (output_damage->pending_attach_render) {
|
||||
// render-buffers have been swapped, rotate the damage
|
||||
|
||||
// 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];
|
||||
pixman_region32_copy(prev, &output_damage->current);
|
||||
break;
|
||||
case WLR_OUTPUT_STATE_BUFFER_SCANOUT:
|
||||
} else {
|
||||
// accumulate render-buffer damage
|
||||
prev = &output_damage->previous[output_damage->previous_idx];
|
||||
pixman_region32_union(prev, prev, &output_damage->current);
|
||||
break;
|
||||
}
|
||||
|
||||
pixman_region32_clear(&output_damage->current);
|
||||
|
|
Loading…
Reference in a new issue