From 8b6e0809955f01c369838f7c73db8d92d5953d72 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 14 Oct 2010 14:20:46 +0100 Subject: [PATCH] xcb: Fix reduction of clipping for bounded glyphs. Signed-off-by: Chris Wilson --- src/cairo-xcb-surface-render.c | 38 ++++------------------------------ 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c index afc812e07..637a2408b 100644 --- a/src/cairo-xcb-surface-render.c +++ b/src/cairo-xcb-surface-render.c @@ -4628,42 +4628,12 @@ _cairo_xcb_surface_render_glyphs (cairo_xcb_surface_t *surface, if (_cairo_clip_contains_rectangle (clip, &extents.mask)) clip = NULL; - if (clip != NULL) { + if (clip != NULL && extents.is_bounded) { clip = _cairo_clip_init_copy (&local_clip, clip); - if (extents.is_bounded) { - cairo_region_t *clip_region = NULL; - - status = _cairo_clip_rectangle (clip, &extents.bounded); - if (unlikely (status)) { - _cairo_clip_fini (&local_clip); - return status; - } - - status = _cairo_clip_get_region (clip, &clip_region); - if (unlikely (_cairo_status_is_error (status) || - status == CAIRO_INT_STATUS_NOTHING_TO_DO)) - { - _cairo_clip_fini (&local_clip); - return status; - } - - if (clip_region != NULL) { - cairo_rectangle_int_t rect; - cairo_bool_t is_empty; - - cairo_region_get_extents (clip_region, &rect); - is_empty = ! _cairo_rectangle_intersect (&extents.unbounded, &rect); - if (unlikely (is_empty)) - return CAIRO_STATUS_SUCCESS; - - is_empty = ! _cairo_rectangle_intersect (&extents.bounded, &rect); - if (unlikely (is_empty && extents.is_bounded)) - return CAIRO_STATUS_SUCCESS; + status = _cairo_clip_rectangle (clip, &extents.bounded); + if (unlikely (status)) + return status; - if (cairo_region_num_rectangles (clip_region) == 1) - clip = NULL; - } - } have_clip = TRUE; }