[cairo-commit] src/cairo-xcb-surface-render.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Oct 14 06:16:35 PDT 2010


 src/cairo-xcb-surface-render.c |   38 ++++----------------------------------
 1 file changed, 4 insertions(+), 34 deletions(-)

New commits:
commit 8b6e0809955f01c369838f7c73db8d92d5953d72
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Oct 14 14:20:46 2010 +0100

    xcb: Fix reduction of clipping for bounded glyphs.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c
index afc812e..637a240 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;
     }
 


More information about the cairo-commit mailing list