mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-06 16:18:15 +02:00
composite: Reduce an unaligned clip
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
c0016e6ac9
commit
1b2709d8c0
1 changed files with 3 additions and 6 deletions
|
|
@ -371,20 +371,17 @@ _cairo_composite_rectangles_can_reduce_clip (cairo_composite_rectangles_t *compo
|
|||
cairo_clip_t *clip)
|
||||
{
|
||||
cairo_rectangle_int_t extents;
|
||||
cairo_box_t box;
|
||||
|
||||
if (clip == NULL)
|
||||
return TRUE;
|
||||
|
||||
/* XXX In the not a region case, we could still search through the boxes */
|
||||
if (! _cairo_clip_is_region (clip))
|
||||
return FALSE;
|
||||
|
||||
extents = composite->destination;
|
||||
if (composite->is_bounded & CAIRO_OPERATOR_BOUND_BY_SOURCE)
|
||||
_cairo_rectangle_intersect (&extents, &composite->source);
|
||||
if (composite->is_bounded & CAIRO_OPERATOR_BOUND_BY_MASK)
|
||||
_cairo_rectangle_intersect (&extents, &composite->mask);
|
||||
|
||||
return cairo_region_contains_rectangle (_cairo_clip_get_region (clip),
|
||||
&extents) == CAIRO_REGION_OVERLAP_IN;
|
||||
_cairo_box_from_rectangle (&box, &extents);
|
||||
return _cairo_clip_contains_box (clip, &box);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue