mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-06-09 17:58:25 +02:00
image: Fix clip-intersect
Explicitly convert the clearing of the unbounded area. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
e4b3f84d4c
commit
080f81bf5c
2 changed files with 20 additions and 7 deletions
|
|
@ -3671,17 +3671,22 @@ _clip_and_composite_polygon (cairo_image_surface_t *dst,
|
|||
{
|
||||
cairo_status_t status;
|
||||
|
||||
if (polygon->num_edges == 0) {
|
||||
cairo_traps_t traps;
|
||||
if (_cairo_polygon_is_empty (polygon)) {
|
||||
cairo_boxes_t boxes;
|
||||
|
||||
if (extents->is_bounded)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
_cairo_traps_init (&traps);
|
||||
status = _clip_and_composite_trapezoids (dst, op, src,
|
||||
&traps, antialias,
|
||||
extents);
|
||||
_cairo_traps_fini (&traps);
|
||||
status = _cairo_clip_to_boxes (extents->clip, &boxes);
|
||||
if (likely (status == CAIRO_STATUS_SUCCESS)) {
|
||||
extents->is_bounded = _cairo_operator_bounded_by_either (op);
|
||||
extents->mask = extents->bounded = extents->unbounded;
|
||||
status = _clip_and_composite_boxes (dst,
|
||||
CAIRO_OPERATOR_CLEAR,
|
||||
&_cairo_pattern_clear.base,
|
||||
&boxes, extents);
|
||||
_cairo_boxes_fini (&boxes);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2070,6 +2070,14 @@ cairo_private cairo_status_t
|
|||
_cairo_polygon_intersect (cairo_polygon_t *a, int winding_a,
|
||||
cairo_polygon_t *b, int winding_b);
|
||||
|
||||
static inline cairo_bool_t
|
||||
_cairo_polygon_is_empty (const cairo_polygon_t *polygon)
|
||||
{
|
||||
return
|
||||
polygon->num_edges == 0 ||
|
||||
polygon->extents.p2.x <= polygon->extents.p1.x;
|
||||
}
|
||||
|
||||
#define _cairo_polygon_status(P) ((cairo_polygon_t *) (P))->status
|
||||
|
||||
/* cairo-spline.c */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue