From b60694cbc75f87a8dbc454bbbe2f663f3132d28d Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 21 Jul 2011 17:15:08 +0200 Subject: [PATCH] xcb: Work around wrong extent computation in the X server This is basically the same fix as e6c3efdd650a. However, this was lost in b132fae5e843 and thus had to be fixed again. Fixes: clip-fill-eo-unbounded clip-fill-nz-unbounded Signed-off-by: Uli Schlachter --- src/cairo-xcb-surface-render.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c index b09d53230..4995be7ac 100644 --- a/src/cairo-xcb-surface-render.c +++ b/src/cairo-xcb-surface-render.c @@ -2913,9 +2913,21 @@ _composite_polygon (cairo_xcb_surface_t *dst, traps.antialias = antialias; status = trim_extents_to_traps (extents, &traps.traps); if (likely (status == CAIRO_STATUS_SUCCESS)) { - status = _clip_and_composite (dst, op, source, - _composite_traps, NULL, &traps, - extents, need_unbounded_clip (extents)); + unsigned int flags = 0; + + /* 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. + */ + if (! extents->is_bounded) + flags |= FORCE_CLIP_REGION; + + status = _clip_and_composite (dst, op, source, _composite_traps, + NULL, &traps, extents, + need_unbounded_clip (extents) | flags); } }