diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-06-17 14:19:19 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-06-17 14:19:19 +0100 |
commit | 650b85ec7721fb1302284e3ca4b7f4b72358abed (patch) | |
tree | 45ab2ec2605d8cada98819f98ad969a156186c89 /src/cairo-clip.c | |
parent | 4bc89e224f74f24272c97dec93d70f0c4dd1963c (diff) |
[clip] Avoid copying region within _cairo_clip_intersect_region()
Within _cairo_clip_intersect_region() we can simply assign the freshly
extracted traps-region if we previously had no region set.
Diffstat (limited to 'src/cairo-clip.c')
-rw-r--r-- | src/cairo-clip.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/cairo-clip.c b/src/cairo-clip.c index bb04a9e2..5edc1243 100644 --- a/src/cairo-clip.c +++ b/src/cairo-clip.c @@ -336,17 +336,11 @@ _cairo_clip_intersect_region (cairo_clip_t *clip, if (clip->region) { status = cairo_region_intersect (clip->region, region); - } else { - clip->region = cairo_region_copy (region); - - assert (clip->region != NULL); - - if ((status = cairo_region_status (clip->region))) - clip->region = NULL; - } + cairo_region_destroy (region); + } else + clip->region = region; clip->serial = _cairo_surface_allocate_clip_serial (target); - cairo_region_destroy (region); if (!clip->region || cairo_region_is_empty (clip->region)) _cairo_clip_set_all_clipped (clip, target); |