aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-07-12 18:00:55 +0200
committerSimon Zeni <simon@bl4ckb0ne.ca>2021-07-29 09:48:33 -0400
commitf211bc983aeeacd7f4d6af8c47845e8ddc2f7e9b (patch)
treecf2068a71af1ae64e9ecf7a15eeafb96aa11cada
parent4ddde1a7bda543c4520bd6b50372c93d051e4395 (diff)
output-damage: stop using enum wlr_output_state_buffer_type
This enum will get dropped in the next commit.
-rw-r--r--include/wlr/types/wlr_output_damage.h2
-rw-r--r--types/wlr_output_damage.c14
2 files changed, 5 insertions, 11 deletions
diff --git a/include/wlr/types/wlr_output_damage.h b/include/wlr/types/wlr_output_damage.h
index e7c609ed..ba5c88df 100644
--- a/include/wlr/types/wlr_output_damage.h
+++ b/include/wlr/types/wlr_output_damage.h
@@ -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;
diff --git a/types/wlr_output_damage.c b/types/wlr_output_damage.c
index e49df016..3d5a99e3 100644
--- a/types/wlr_output_damage.c
+++ b/types/wlr_output_damage.c
@@ -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);