aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Orzechowski <orzechowski.alexander@gmail.com>2022-02-26 21:50:41 -0500
committerSimon Ser <contact@emersion.fr>2022-03-08 14:05:36 +0000
commitfbd4d40318c437508342bbbc41a0f90173462160 (patch)
tree92e7a4d55dab70a47f13146a6613817323b3d228
parent4792446ee8f50104bd207d9ccd8558a7e4eb4514 (diff)
wlr_output_damage: Use wlr_output_damage_add for wlr_output_damage_add_box
-rw-r--r--types/wlr_output_damage.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/types/wlr_output_damage.c b/types/wlr_output_damage.c
index 6d24a4bf..08f11207 100644
--- a/types/wlr_output_damage.c
+++ b/types/wlr_output_damage.c
@@ -206,12 +206,9 @@ void wlr_output_damage_add_whole(struct wlr_output_damage *output_damage) {
void wlr_output_damage_add_box(struct wlr_output_damage *output_damage,
struct wlr_box *box) {
- int width, height;
- wlr_output_transformed_resolution(output_damage->output, &width, &height);
-
- pixman_region32_union_rect(&output_damage->current, &output_damage->current,
+ pixman_region32_t damage;
+ pixman_region32_init_rect(&damage,
box->x, box->y, box->width, box->height);
- pixman_region32_intersect_rect(&output_damage->current,
- &output_damage->current, 0, 0, width, height);
- wlr_output_schedule_frame(output_damage->output);
+ wlr_output_damage_add(output_damage, &damage);
+ pixman_region32_fini(&damage);
}