clip: Check whether an extents only clip contains the box

If we steal the boxes, we leave behind an extents-only clip, i.e. only
without a path or boxes, in which case do not return FALSE for the
is-contained check on a rectangle.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-02-09 22:06:18 +00:00
parent bbdb17fc18
commit fb3a193959

View file

@ -85,6 +85,9 @@ _cairo_clip_contains_rectangle_box (const cairo_clip_t *clip,
if (! _cairo_rectangle_contains_rectangle (&clip->extents, rect))
return FALSE;
if (clip->num_boxes == 0)
return TRUE;
/* Check for a clip-box that wholly contains the rectangle */
for (i = 0; i < clip->num_boxes; i++) {
if (box->p1.x >= clip->boxes[i].p1.x &&