summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2014-06-26 10:37:36 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2014-07-05 01:03:55 -0700
commitef5400843ff53c76ccfac99a80ef84baaee3dc38 (patch)
treefe83e860caa0cc02851ce2873911aa90c4554570
parent32abdbbad97e99cc76409ecfa4b446db63907cc3 (diff)
Use pixman_region32_clear instead of our own empty_region
This requires pixman 0.25.2 Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
-rw-r--r--clients/nested.c9
-rw-r--r--configure.ac2
-rw-r--r--src/compositor.c21
-rw-r--r--src/data-device.c11
4 files changed, 10 insertions, 33 deletions
diff --git a/clients/nested.c b/clients/nested.c
index 44389e40..2a952beb 100644
--- a/clients/nested.c
+++ b/clients/nested.c
@@ -551,13 +551,6 @@ surface_set_input_region(struct wl_client *client,
}
static void
-empty_region(pixman_region32_t *region)
-{
- pixman_region32_fini(region);
- pixman_region32_init(region);
-}
-
-static void
surface_commit(struct wl_client *client, struct wl_resource *resource)
{
struct nested_surface *surface = wl_resource_get_user_data(resource);
@@ -574,7 +567,7 @@ surface_commit(struct wl_client *client, struct wl_resource *resource)
surface->pending.newly_attached = 0;
/* wl_surface.damage */
- empty_region(&surface->pending.damage);
+ pixman_region32_clear(&surface->pending.damage);
/* wl_surface.frame */
wl_list_insert_list(&surface->frame_callback_list,
diff --git a/configure.ac b/configure.ac
index 648bee83..19380781 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,7 +59,7 @@ AC_CHECK_HEADERS([execinfo.h])
AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
-COMPOSITOR_MODULES="wayland-server >= 1.3.90 pixman-1"
+COMPOSITOR_MODULES="wayland-server >= 1.3.90 pixman-1 >= 0.25.2"
AC_ARG_ENABLE(egl, [ --disable-egl],,
enable_egl=yes)
diff --git a/src/compositor.c b/src/compositor.c
index fa8730f4..d414e274 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -330,13 +330,6 @@ surface_handle_pending_buffer_destroy(struct wl_listener *listener, void *data)
}
static void
-empty_region(pixman_region32_t *region)
-{
- pixman_region32_fini(region);
- pixman_region32_init(region);
-}
-
-static void
region_init_infinite(pixman_region32_t *region)
{
pixman_region32_init_rect(region, INT32_MIN, INT32_MIN,
@@ -1561,7 +1554,7 @@ surface_flush_damage(struct weston_surface *surface)
wl_shm_buffer_get(surface->buffer_ref.buffer->resource))
surface->compositor->renderer->flush_damage(surface);
- empty_region(&surface->damage);
+ pixman_region32_clear(&surface->damage);
}
static void
@@ -2020,7 +2013,7 @@ surface_set_opaque_region(struct wl_client *client,
pixman_region32_copy(&surface->pending.opaque,
&region->region);
} else {
- empty_region(&surface->pending.opaque);
+ pixman_region32_clear(&surface->pending.opaque);
}
}
@@ -2083,10 +2076,8 @@ weston_surface_commit(struct weston_surface *surface)
pixman_region32_union(&surface->damage, &surface->damage,
&surface->pending.damage);
pixman_region32_intersect_rect(&surface->damage, &surface->damage,
- 0, 0,
- surface->width,
- surface->height);
- empty_region(&surface->pending.damage);
+ 0, 0, surface->width, surface->height);
+ pixman_region32_clear(&surface->pending.damage);
/* wl_surface.set_opaque_region */
pixman_region32_init_rect(&opaque, 0, 0,
@@ -2334,7 +2325,7 @@ weston_subsurface_commit_from_cache(struct weston_subsurface *sub)
0, 0,
surface->width,
surface->height);
- empty_region(&sub->cached.damage);
+ pixman_region32_clear(&sub->cached.damage);
/* wl_surface.set_opaque_region */
pixman_region32_init_rect(&opaque, 0, 0,
@@ -2386,7 +2377,7 @@ weston_subsurface_commit_to_cache(struct weston_subsurface *sub)
-surface->pending.sx, -surface->pending.sy);
pixman_region32_union(&sub->cached.damage, &sub->cached.damage,
&surface->pending.damage);
- empty_region(&surface->pending.damage);
+ pixman_region32_clear(&surface->pending.damage);
if (surface->pending.newly_attached) {
sub->cached.newly_attached = 1;
diff --git a/src/data-device.c b/src/data-device.c
index 88c6de36..a069b3c0 100644
--- a/src/data-device.c
+++ b/src/data-device.c
@@ -53,13 +53,6 @@ struct weston_touch_drag {
};
static void
-empty_region(pixman_region32_t *region)
-{
- pixman_region32_fini(region);
- pixman_region32_init(region);
-}
-
-static void
data_offer_accept(struct wl_client *client, struct wl_resource *resource,
uint32_t serial, const char *mime_type)
{
@@ -203,7 +196,7 @@ drag_surface_configure(struct weston_drag *drag,
wl_list_remove(&drag->icon->layer_link);
wl_list_insert(list, &drag->icon->layer_link);
weston_view_update_transform(drag->icon);
- empty_region(&es->pending.input);
+ pixman_region32_clear(&es->pending.input);
}
drag->dx += sx;
@@ -358,7 +351,7 @@ data_device_end_drag_grab(struct weston_drag *drag,
weston_view_unmap(drag->icon);
drag->icon->surface->configure = NULL;
- empty_region(&drag->icon->surface->pending.input);
+ pixman_region32_clear(&drag->icon->surface->pending.input);
wl_list_remove(&drag->icon_destroy_listener.link);
weston_view_destroy(drag->icon);
}