aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandom human <random.bored.human@gmail.com>2018-09-25 01:38:09 +0530
committerrandom human <random.bored.human@gmail.com>2018-09-25 01:38:09 +0530
commit5eca5d8946cac22ee570cb889e137f29edffa336 (patch)
tree708d43dd8955e57f70635a5c2c2f5a232e5db9cd
parent3fd5da58a0e2279e71431ca411d7a862e2f1157d (diff)
wlr_surface: remove duplicated damage calculation
The damage is already calculated and stored in surface->buffer_damage by surface_update_damage().
-rw-r--r--types/wlr_surface.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/types/wlr_surface.c b/types/wlr_surface.c
index 10e0520b..dde035fb 100644
--- a/types/wlr_surface.c
+++ b/types/wlr_surface.c
@@ -301,29 +301,8 @@ static void surface_apply_damage(struct wlr_surface *surface) {
}
if (surface->buffer != NULL && surface->buffer->released) {
- pixman_region32_t damage;
- pixman_region32_init(&damage);
- pixman_region32_copy(&damage, &surface->current.buffer_damage);
-
- pixman_region32_t surface_damage;
- pixman_region32_init(&surface_damage);
- pixman_region32_copy(&surface_damage, &surface->current.surface_damage);
- wlr_region_transform(&surface_damage, &surface_damage,
- wlr_output_transform_invert(surface->current.transform),
- surface->current.width, surface->current.height);
- wlr_region_scale(&surface_damage, &surface_damage,
- surface->current.scale);
- pixman_region32_union(&damage, &damage, &surface_damage);
- pixman_region32_fini(&surface_damage);
-
- pixman_region32_intersect_rect(&damage, &damage, 0, 0,
- surface->current.buffer_width, surface->current.buffer_height);
-
struct wlr_buffer *updated_buffer =
- wlr_buffer_apply_damage(surface->buffer, resource, &damage);
-
- pixman_region32_fini(&damage);
-
+ wlr_buffer_apply_damage(surface->buffer, resource, &surface->buffer_damage);
if (updated_buffer != NULL) {
surface->buffer = updated_buffer;
return;