summaryrefslogtreecommitdiff
path: root/src/cairo-clip.c
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <sandmann@redhat.com>2009-03-28 04:26:10 -0400
committerSøren Sandmann Pedersen <sandmann@redhat.com>2009-03-28 04:26:10 -0400
commitc2c637cf1d89fc8fdcced4467d602a55ef0b14e0 (patch)
tree23959a87b6f49249f994f20abe245570ec3ef45d /src/cairo-clip.c
parentfe10cd6467f2ec58532dc7c713bb6d08dab08442 (diff)
Simplify _cairo_clip_intersect_region()
The intermediate intersection region is not necessary because if the operation fails, clip->region will end up as a pixman error region.
Diffstat (limited to 'src/cairo-clip.c')
-rw-r--r--src/cairo-clip.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/cairo-clip.c b/src/cairo-clip.c
index 9aac1154..9455c288 100644
--- a/src/cairo-clip.c
+++ b/src/cairo-clip.c
@@ -357,23 +357,14 @@ _cairo_clip_intersect_region (cairo_clip_t *clip,
if (status)
return status;
- if (!clip->has_region) {
+ if (clip->has_region) {
+ status = _cairo_region_intersect (&clip->region,
+ &clip->region,
+ &region);
+ } else {
status = _cairo_region_copy (&clip->region, &region);
if (status == CAIRO_STATUS_SUCCESS)
clip->has_region = TRUE;
- } else {
- cairo_region_t intersection;
-
- _cairo_region_init (&intersection);
-
- status = _cairo_region_intersect (&intersection,
- &clip->region,
- &region);
-
- if (status == CAIRO_STATUS_SUCCESS)
- status = _cairo_region_copy (&clip->region, &intersection);
-
- _cairo_region_fini (&intersection);
}
clip->serial = _cairo_surface_allocate_clip_serial (target);