[cairo-commit] 3 commits - src/cairo-xlib-surface.c

Benjamin Otte company at kemper.freedesktop.org
Thu Apr 29 09:22:13 PDT 2010


 src/cairo-xlib-surface.c |   32 ++++++++++----------------------
 1 file changed, 10 insertions(+), 22 deletions(-)

New commits:
commit 5d07307b691afccccbb15f773d5231669ba44f5a
Author: Benjamin Otte <otte at redhat.com>
Date:   Thu Apr 29 18:20:59 2010 +0200

    xlib: Don't modify variables that are needed later
    
    In the XCopyArea region code, don't modify src_x/y when they are later
    used in the unbounded fixup code.
    
    Exposed by composite-integer-translate-source test.

diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index bedc3fd..30c08d3 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -2322,10 +2322,10 @@ _cairo_xlib_surface_composite (cairo_operator_t		op,
 		       width, height,
 		       dst_x, dst_y);
 	} else {
-	    int n, num_rects;
+	    int n, num_rects, x, y;
 
-	    src_x += src_attr.x_offset + itx - dst_x;
-	    src_y += src_attr.y_offset + ity - dst_y;
+	    x = src_x + src_attr.x_offset + itx - dst_x;
+	    y = src_y + src_attr.y_offset + ity - dst_y;
 
 	    num_rects = cairo_region_num_rectangles (clip_region);
 	    for (n = 0; n < num_rects; n++) {
@@ -2333,7 +2333,7 @@ _cairo_xlib_surface_composite (cairo_operator_t		op,
 
 		cairo_region_get_rectangle (clip_region, n, &rect);
 		XCopyArea (display->display, src->drawable, dst->drawable, gc,
-			   rect.x + src_x, rect.y + src_y,
+			   rect.x + x, rect.y + y,
 			   rect.width, rect.height,
 			   rect.x, rect.y);
 	    }
commit 90160deb2a84f787dff46243471e37600b24799b
Author: Benjamin Otte <otte at redhat.com>
Date:   Thu Apr 29 18:20:44 2010 +0200

    xlib: Constify some function arguments

diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 73c654a..bedc3fd 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -1503,7 +1503,7 @@ _cairo_xlib_surface_can_repaint_solid_pattern_surface (void *abstract_surface,
 static cairo_status_t
 _cairo_xlib_surface_set_matrix (cairo_xlib_display_t *display,
                                 cairo_xlib_surface_t *surface,
-				cairo_matrix_t	     *matrix,
+				const cairo_matrix_t *matrix,
 				double                xc,
 				double                yc)
 {
@@ -1638,11 +1638,11 @@ _cairo_xlib_surface_set_component_alpha (cairo_xlib_surface_t *surface,
 }
 
 static cairo_int_status_t
-_cairo_xlib_surface_set_attributes (cairo_xlib_display_t            *display,
-                                    cairo_xlib_surface_t	    *surface,
-				    cairo_surface_attributes_t	    *attributes,
-				    double			     xc,
-				    double			     yc)
+_cairo_xlib_surface_set_attributes (cairo_xlib_display_t             *display,
+                                    cairo_xlib_surface_t	     *surface,
+				    const cairo_surface_attributes_t *attributes,
+				    double			      xc,
+				    double			      yc)
 {
     cairo_int_status_t status;
     XRenderPictureAttributes pa;
commit 4da71d1a01c4d4cc84b5e31cc89dd7f297b23359
Author: Benjamin Otte <otte at redhat.com>
Date:   Thu Apr 29 18:11:54 2010 +0200

    xlib: remove unused code

diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index e5f18a3..73c654a 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -2210,11 +2210,9 @@ _cairo_xlib_surface_composite (cairo_operator_t		op,
     cairo_xlib_surface_t	*mask;
     cairo_xlib_display_t        *display;
     cairo_int_status_t		status;
-    cairo_rectangle_int_t	src_extents;
     composite_operation_t       operation;
     int				itx, ity;
     cairo_bool_t		is_integer_translation;
-    cairo_bool_t		needs_alpha_composite;
     GC				gc;
 
     if (mask_pattern != NULL && ! CAIRO_SURFACE_RENDER_HAS_COMPOSITE (dst))
@@ -2227,16 +2225,6 @@ _cairo_xlib_surface_composite (cairo_operator_t		op,
 
     X_DEBUG ((display->display, "composite (dst=%x)", (unsigned int) dst->drawable));
 
-    src_extents.x = src_x;
-    src_extents.y = src_y;
-    src_extents.width  = width;
-    src_extents.height = height;
-    needs_alpha_composite =
-	_operator_needs_alpha_composite (op,
-					 _surface_has_alpha (dst),
-					 ! _cairo_pattern_is_opaque (src_pattern,
-								     &src_extents));
-
     status = _cairo_xlib_display_acquire (dst-> base.device, &display);
     if (unlikely (status))
         return status;


More information about the cairo-commit mailing list