compositor: Use pixman_region32_intersect_rect() instead of temp region

We avoid reusing 'opaque' and don't leak the region.
Kristian Høgsberg 12 years ago
parent b4f4a5980f
commit 4d0214c62b
  1. 9
      src/compositor.c

@ -1262,13 +1262,12 @@ surface_commit(struct wl_client *client, struct wl_resource *resource)
surface->pending.sy = 0;
/* wl_surface.damage */
pixman_region32_init_rect(&opaque, 0, 0,
surface->geometry.width,
surface->geometry.height);
pixman_region32_union(&surface->damage, &surface->damage,
&surface->pending.damage);
pixman_region32_intersect(&surface->damage, &surface->damage,
&opaque);
pixman_region32_intersect_rect(&surface->damage, &surface->damage,
0, 0,
surface->geometry.width,
surface->geometry.height);
empty_region(&surface->pending.damage);
/* wl_surface.set_opaque_region */

Loading…
Cancel
Save