|
|
|
@ -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);
|
|
|
|
|