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

Uli Schlachter psychon at kemper.freedesktop.org
Thu Jul 21 10:42:00 PDT 2011


 src/cairo-xcb-surface-render.c |   26 ++++++++++++++++++++------
 src/cairo-xcb-surface.c        |   14 ++++++++++++++
 2 files changed, 34 insertions(+), 6 deletions(-)

New commits:
commit b60694cbc75f87a8dbc454bbbe2f663f3132d28d
Author: Uli Schlachter <psychon at znc.in>
Date:   Thu Jul 21 17:15:08 2011 +0200

    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 <psychon at znc.in>

diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c
index b09d532..4995be7 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);
 	}
     }
 
commit e2150185fc85a8b3c786b8a9ac5606c42f8af167
Author: Uli Schlachter <psychon at znc.in>
Date:   Thu Jul 21 17:53:39 2011 +0200

    xcb: Unset the deferred_clear flag on fallback
    
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c
index b0524fa..66e25a5 100644
--- a/src/cairo-xcb-surface.c
+++ b/src/cairo-xcb-surface.c
@@ -692,6 +692,9 @@ _cairo_xcb_surface_map_to_image (cairo_xcb_surface_t *surface)
     if (unlikely (status))
 	return _cairo_surface_create_in_error (status);
 
+    /* If we had a pending clear, _get_image applied that */
+    surface->deferred_clear = FALSE;
+
     return &image->base;
 }
 
commit de686f1938d19001d287e15f0bb72a01cbff4171
Author: Uli Schlachter <psychon at znc.in>
Date:   Thu Jul 21 17:50:47 2011 +0200

    xcb: Handle deferred_clear in _get_image
    
    Fixes: arc-infinite-loop clip-all clip-empty-group clip-fill-no-op
    pattern-getters
    
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c
index 4fdc5b4..b0524fa 100644
--- a/src/cairo-xcb-surface.c
+++ b/src/cairo-xcb-surface.c
@@ -382,12 +382,23 @@ _get_image (cairo_xcb_surface_t		 *surface,
     cairo_int_status_t status;
 
     if (surface->base.is_clear || surface->deferred_clear) {
+	cairo_color_t color;
+
+	color = surface->deferred_clear_color;
 	image = (cairo_image_surface_t *)
 	    _cairo_image_surface_create_with_pixman_format (NULL,
 							    surface->pixman_format,
 							    surface->width,
 							    surface->height,
 							    0);
+
+	if (surface->deferred_clear && color.alpha > 0) {
+	    cairo_t *cr = cairo_create (&image->base);
+	    cairo_set_source_rgba (cr, color.red, color.green,
+				   color.blue, color.alpha);
+	    cairo_paint (cr);
+	    cairo_destroy (cr);
+	}
 	*image_out = image;
 	return image->base.status;
     }
commit adf026fffece49e6ae5939d53b2ec3fbc1d914cc
Author: Uli Schlachter <psychon at znc.in>
Date:   Thu Jul 21 17:33:13 2011 +0200

    xcb: Fix a NULL dereference
    
    This fixes a crash in the hatchings test case.
    
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c
index 3d14093..b09d532 100644
--- a/src/cairo-xcb-surface-render.c
+++ b/src/cairo-xcb-surface-render.c
@@ -3336,9 +3336,11 @@ _composite_opacity_boxes (void				*closure,
     info.opacity = mask_pattern->color.alpha;
 
     /* XXX for lots of boxes create a clip region for the fully opaque areas */
-    for (i = 0; i < clip->num_boxes; i++)
-	do_unaligned_box(composite_opacity, &info,
-			 &clip->boxes[i], dst_x, dst_y);
+    if (clip) {
+	for (i = 0; i < clip->num_boxes; i++)
+	    do_unaligned_box(composite_opacity, &info,
+			     &clip->boxes[i], dst_x, dst_y);
+    }
     cairo_surface_destroy (&info.src->base);
 
     return CAIRO_STATUS_SUCCESS;


More information about the cairo-commit mailing list