diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-07-24 17:36:51 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-07-24 17:37:27 +0100 |
commit | 15d5014efd8f3b4d01feb39259f2df0e69ac1b46 (patch) | |
tree | 0376f13334e7f6e98b2a8fd481eb933bcdb8dc1e /src/cairo-clip-boxes.c | |
parent | 52e3814824235ff236bc013f9adc85ed85eb8fb8 (diff) | |
download | cairo-15d5014efd8f3b4d01feb39259f2df0e69ac1b46.tar.gz |
clip: Short-cut the common condition of intersecting with a single box
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-clip-boxes.c')
-rw-r--r-- | src/cairo-clip-boxes.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cairo-clip-boxes.c b/src/cairo-clip-boxes.c index 52843fa34..e18c2f8ed 100644 --- a/src/cairo-clip-boxes.c +++ b/src/cairo-clip-boxes.c @@ -277,6 +277,9 @@ _cairo_clip_intersect_boxes (cairo_clip_t *clip, if (boxes->num_boxes == 0) return _cairo_clip_set_all_clipped (clip); + if (boxes->num_boxes == 1) + return _cairo_clip_intersect_box (clip, boxes->chunks.base); + if (clip == NULL) clip = _cairo_clip_create (); @@ -291,7 +294,7 @@ _cairo_clip_intersect_boxes (cairo_clip_t *clip, boxes = &clip_boxes; } - if(boxes->num_boxes == 1) { + if (boxes->num_boxes == 1) { clip->boxes = &clip->embedded_box; clip->boxes[0] = boxes->chunks.base[0]; clip->num_boxes = 1; |