From 315b8807e6ef4d1fa2b17d6dab4f7b6a04112089 Mon Sep 17 00:00:00 2001 From: Massimo Valentini Date: Tue, 23 Sep 2014 12:27:33 +0200 Subject: [PATCH] fix overlapping-boxes.x{c,li}b.rgb24 --- src/cairo-traps-compositor.c | 6 +++++- src/cairo-xcb-surface-render.c | 11 ++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/cairo-traps-compositor.c b/src/cairo-traps-compositor.c index 9618e5d..94189f9 100644 --- a/src/cairo-traps-compositor.c +++ b/src/cairo-traps-compositor.c @@ -1732,6 +1732,7 @@ clip_and_composite_boxes (const cairo_traps_compositor_t *compositor, cairo_boxes_t *boxes) { cairo_int_status_t status; + unsigned int flags = 0; TRACE ((stderr, "%s\n", __FUNCTION__)); @@ -1794,9 +1795,12 @@ clip_and_composite_boxes (const cairo_traps_compositor_t *compositor, return status; } + if (! extents->is_bounded) + flags |= FORCE_CLIP_REGION; + return clip_and_composite (compositor, extents, composite_boxes, NULL, boxes, - need_unbounded_clip (extents)); + need_unbounded_clip (extents) | flags); } static cairo_int_status_t diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c index edfa34c..0f297b5 100644 --- a/src/cairo-xcb-surface-render.c +++ b/src/cairo-xcb-surface-render.c @@ -3187,9 +3187,18 @@ _clip_and_composite_boxes (cairo_xcb_surface_t *dst, info.antialias = CAIRO_ANTIALIAS_DEFAULT; status = trim_extents_to_traps (extents, &info.traps); if (status == CAIRO_INT_STATUS_SUCCESS) { + /* For unbounded operations, the X11 server will estimate the + * affected rectangle and apply the operation to that. However, + * there are cases where this is an overestimate (e.g. the + * clip-fill-{eo,nz}-unbounded test). + * + * The clip will trim that overestimate to our expectations. + */ + unsigned flags = extents->is_bounded ? 0 : FORCE_CLIP_REGION; + status = _clip_and_composite (dst, op, src, _composite_traps, NULL, &info, - extents, need_unbounded_clip (extents)); + extents, need_unbounded_clip (extents) | flags); } _cairo_traps_fini (&info.traps); -- 1.9.3