diff options
author | Søren Sandmann Pedersen <sandmann@redhat.com> | 2009-03-28 04:26:10 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <sandmann@redhat.com> | 2009-03-28 04:26:10 -0400 |
commit | c2c637cf1d89fc8fdcced4467d602a55ef0b14e0 (patch) | |
tree | 23959a87b6f49249f994f20abe245570ec3ef45d /src/cairo-clip.c | |
parent | fe10cd6467f2ec58532dc7c713bb6d08dab08442 (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.c | 19 |
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, + ®ion); + } else { status = _cairo_region_copy (&clip->region, ®ion); 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, - ®ion); - - if (status == CAIRO_STATUS_SUCCESS) - status = _cairo_region_copy (&clip->region, &intersection); - - _cairo_region_fini (&intersection); } clip->serial = _cairo_surface_allocate_clip_serial (target); |