[cairo-commit] 2 commits - src/cairo-directfb-surface.c src/cairo-glitz-surface.c src/cairo-image-surface.c src/cairoint.h src/cairo-pattern.c src/cairo-quartz-surface.c src/cairo-surface.c src/cairo-surface-fallback.c src/cairo-surface-fallback-private.h src/cairo-win32-private.h src/cairo-win32-surface.c src/cairo-xcb-surface.c src/cairo-xlib-surface.c src/test-fallback-surface.c test/Makefile.am

Chris Wilson ickle at kemper.freedesktop.org
Sat Sep 27 09:36:19 PDT 2008


 src/cairo-directfb-surface.c         |   12 ++++++------
 src/cairo-glitz-surface.c            |   18 +++++++++---------
 src/cairo-image-surface.c            |    6 +++---
 src/cairo-pattern.c                  |    6 +++---
 src/cairo-quartz-surface.c           |   16 ++++++++--------
 src/cairo-surface-fallback-private.h |    4 ++--
 src/cairo-surface-fallback.c         |   12 +++++-------
 src/cairo-surface.c                  |   16 ++++++++--------
 src/cairo-win32-private.h            |    4 ++--
 src/cairo-win32-surface.c            |    8 ++++----
 src/cairo-xcb-surface.c              |   12 ++++++------
 src/cairo-xlib-surface.c             |   12 ++++++------
 src/cairoint.h                       |   10 +++++-----
 src/test-fallback-surface.c          |    8 ++++----
 test/Makefile.am                     |    2 --
 15 files changed, 71 insertions(+), 75 deletions(-)

New commits:
commit 871f683367b1a1647b607f9221e1fc2eddc6e5dd
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Sep 27 17:24:57 2008 +0100

    clone_similar(): s/device_offset/clone_offset/
    
    A little bit of sleep and reflection suggested that the use of
    device_offset_[xy] was confusing and clone_offset_[xy] more consistent
    with the function naming.

diff --git a/src/cairo-directfb-surface.c b/src/cairo-directfb-surface.c
index c24320b..d14f8f1 100644
--- a/src/cairo-directfb-surface.c
+++ b/src/cairo-directfb-surface.c
@@ -616,8 +616,8 @@ _cairo_directfb_surface_clone_similar (void             *abstract_surface,
                                        int               src_y,
                                        int               width,
                                        int               height,
-                                       int              *device_offset_x,
-                                       int              *device_offset_y,
+                                       int              *clone_offset_x,
+                                       int              *clone_offset_y,
                                        cairo_surface_t **clone_out)
 {
     cairo_directfb_surface_t *surface = abstract_surface;
@@ -627,8 +627,8 @@ _cairo_directfb_surface_clone_similar (void             *abstract_surface,
                 "%s( surface=%p, src=%p ).\n", __FUNCTION__, surface, src);
 
     if (src->backend == surface->base.backend) {
-	*device_offset_x = 0;
-	*device_offset_y = 0;
+	*clone_offset_x = 0;
+	*clone_offset_y = 0;
 	*clone_out = cairo_surface_reference (src);
 
         return CAIRO_STATUS_SUCCESS;
@@ -689,8 +689,8 @@ _cairo_directfb_surface_clone_similar (void             *abstract_surface,
         
         clone->dfbsurface->Unlock (clone->dfbsurface);
 
-	*device_offset_x = 0;
-	*device_offset_y = 0;
+	*clone_offset_x = 0;
+	*clone_offset_y = 0;
         *clone_out = &clone->base;
         return CAIRO_STATUS_SUCCESS;
     }
diff --git a/src/cairo-glitz-surface.c b/src/cairo-glitz-surface.c
index 4d05e62..b2046fb 100644
--- a/src/cairo-glitz-surface.c
+++ b/src/cairo-glitz-surface.c
@@ -511,8 +511,8 @@ _cairo_glitz_surface_clone_similar (void	    *abstract_surface,
 				    int              src_y,
 				    int              width,
 				    int              height,
-				    int              *device_offset_x,
-				    int              *device_offset_y,
+				    int             *clone_offset_x,
+				    int             *clone_offset_y,
 				    cairo_surface_t **clone_out)
 {
     cairo_glitz_surface_t *surface = abstract_surface;
@@ -524,8 +524,8 @@ _cairo_glitz_surface_clone_similar (void	    *abstract_surface,
 
     if (src->backend == surface->base.backend)
     {
-	*device_offset_x = 0;
-	*device_offset_y = 0;
+	*clone_offset_x = 0;
+	*clone_offset_y = 0;
 	*clone_out = cairo_surface_reference (src);
 
 	return CAIRO_STATUS_SUCCESS;
@@ -2248,7 +2248,7 @@ _cairo_glitz_surface_old_show_glyphs (cairo_scaled_font_t *scaled_font,
 	    if (!glyph_private || !glyph_private->area)
 	    {
 		int glyph_width, glyph_height;
-		int device_offset_x, device_offset_y;
+		int clone_offset_x, clone_offset_y;
 
 		image = &scaled_glyphs[i]->surface->base;
 		glyph_width = scaled_glyphs[i]->surface->width;
@@ -2260,15 +2260,15 @@ _cairo_glitz_surface_old_show_glyphs (cairo_scaled_font_t *scaled_font,
 							0,
 							glyph_width,
 							glyph_height,
-							&device_offset_x,
-							&device_offset_y
+							&clone_offset_x,
+							&clone_offset_y
 							(cairo_surface_t **)
 							&clone);
 		if (status)
 		    goto UNLOCK;
 
-		assert (device_offset_x = 0);
-		assert (device_offset_y = 0);
+		assert (clone_offset_x = 0);
+		assert (clone_offset_y = 0);
 
 		x_offset = scaled_glyphs[i]->surface->base.device_transform.x0;
 		y_offset = scaled_glyphs[i]->surface->base.device_transform.y0;
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 7a42966..daae8d1 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -779,14 +779,14 @@ _cairo_image_surface_clone_similar (void		*abstract_surface,
 				    int                  src_y,
 				    int                  width,
 				    int                  height,
-				    int                 *device_offset_x,
-				    int                 *device_offset_y,
+				    int                 *clone_offset_x,
+				    int                 *clone_offset_y,
 				    cairo_surface_t    **clone_out)
 {
     cairo_image_surface_t *surface = abstract_surface;
 
     if (src->backend == surface->base.backend) {
-	*device_offset_x = *device_offset_y = 0;
+	*clone_offset_x = *clone_offset_y = 0;
 	*clone_out = cairo_surface_reference (src);
 
 	return CAIRO_STATUS_SUCCESS;
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index b6db8cf..fce9b6b 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -1247,7 +1247,7 @@ _cairo_pattern_acquire_surface_for_gradient (cairo_gradient_pattern_t *pattern,
     pixman_gradient_stop_t pixman_stops_static[2];
     pixman_gradient_stop_t *pixman_stops = pixman_stops_static;
     unsigned int i;
-    int device_offset_x, device_offset_y;
+    int clone_offset_x, clone_offset_y;
 
     if (pattern->n_stops > ARRAY_LENGTH(pixman_stops_static)) {
 	pixman_stops = _cairo_malloc_ab (pattern->n_stops, sizeof(pixman_gradient_stop_t));
@@ -1398,8 +1398,8 @@ _cairo_pattern_acquire_surface_for_gradient (cairo_gradient_pattern_t *pattern,
 
     status = _cairo_surface_clone_similar (dst, &image->base,
 					   0, 0, width, height,
-					   &device_offset_x,
-					   &device_offset_y,
+					   &clone_offset_x,
+					   &clone_offset_y,
 					   out);
 
     cairo_surface_destroy (&image->base);
diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index 13c6d72..658ce88 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -1580,8 +1580,8 @@ _cairo_quartz_surface_clone_similar (void *abstract_surface,
 				     int              src_y,
 				     int              width,
 				     int              height,
-				     int             *device_offset_x,
-				     int             *device_offset_y,
+				     int             *clone_offset_x,
+				     int             *clone_offset_y,
 				     cairo_surface_t **clone_out)
 {
     cairo_quartz_surface_t *new_surface = NULL;
@@ -1600,8 +1600,8 @@ _cairo_quartz_surface_clone_similar (void *abstract_surface,
 	*clone_out = (cairo_surface_t*)
 	    _cairo_quartz_surface_create_internal (NULL, CAIRO_CONTENT_COLOR_ALPHA,
 						   width, height);
-	*device_offset_x = 0;
-	*device_offset_y = 0;
+	*clone_offset_x = 0;
+	*clone_offset_y = 0;
 	return CAIRO_STATUS_SUCCESS;
     }
 
@@ -1612,8 +1612,8 @@ _cairo_quartz_surface_clone_similar (void *abstract_surface,
 	    *clone_out = (cairo_surface_t*)
 		_cairo_quartz_surface_create_internal (NULL, CAIRO_CONTENT_COLOR_ALPHA,
 						       qsurf->extents.width, qsurf->extents.height);
-	    *device_offset_x = 0;
-	    *device_offset_y = 0;
+	    *clone_offset_x = 0;
+	    *clone_offset_y = 0;
 	    return CAIRO_STATUS_SUCCESS;
 	}
     }
@@ -1653,8 +1653,8 @@ _cairo_quartz_surface_clone_similar (void *abstract_surface,
     CGImageRelease (quartz_image);
 
 FINISH:
-    *device_offset_x = src_x;
-    *device_offset_y = src_y;
+    *clone_offset_x = src_x;
+    *clone_offset_y = src_y;
     *clone_out = (cairo_surface_t*) new_surface;
 
     return CAIRO_STATUS_SUCCESS;
diff --git a/src/cairo-surface-fallback-private.h b/src/cairo-surface-fallback-private.h
index a4a05dc..2e10241 100644
--- a/src/cairo-surface-fallback-private.h
+++ b/src/cairo-surface-fallback-private.h
@@ -124,8 +124,8 @@ _cairo_surface_fallback_clone_similar (cairo_surface_t  *surface,
 				       int               src_y,
 				       int               width,
 				       int               height,
-				       int              *device_offset_x,
-				       int              *device_offset_y,
+				       int              *clone_offset_x,
+				       int              *clone_offset_y,
 				       cairo_surface_t **clone_out);
 
 #endif
diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c
index e744b91..8bafb34 100644
--- a/src/cairo-surface-fallback.c
+++ b/src/cairo-surface-fallback.c
@@ -1249,8 +1249,8 @@ _cairo_surface_fallback_clone_similar (cairo_surface_t	*surface,
 				       int		 src_y,
 				       int		 width,
 				       int		 height,
-				       int		*device_offset_x,
-				       int		*device_offset_y,
+				       int		*clone_offset_x,
+				       int		*clone_offset_y,
 				       cairo_surface_t **clone_out)
 {
     cairo_status_t status;
@@ -1281,8 +1281,8 @@ _cairo_surface_fallback_clone_similar (cairo_surface_t	*surface,
     cairo_destroy (cr);
 
     if (status == CAIRO_STATUS_SUCCESS) {
-	*device_offset_x = src_x;
-	*device_offset_y = src_y;
+	*clone_offset_x = src_x;
+	*clone_offset_y = src_y;
 	*clone_out = new_surface;
     } else
 	cairo_surface_destroy (new_surface);
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 6ca877b..d3b735f 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -1127,8 +1127,8 @@ _cairo_surface_clone_similar (cairo_surface_t  *surface,
 			      int               src_y,
 			      int               width,
 			      int               height,
-			      int              *device_offset_x,
-			      int              *device_offset_y,
+			      int              *clone_offset_x,
+			      int              *clone_offset_y,
 			      cairo_surface_t **clone_out)
 {
     cairo_status_t status = CAIRO_INT_STATUS_UNSUPPORTED;
@@ -1145,8 +1145,8 @@ _cairo_surface_clone_similar (cairo_surface_t  *surface,
 	status = surface->backend->clone_similar (surface, src,
 						  src_x, src_y,
 						  width, height,
-						  device_offset_x,
-						  device_offset_y,
+						  clone_offset_x,
+						  clone_offset_y,
 						  clone_out);
 
 	if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
@@ -1157,8 +1157,8 @@ _cairo_surface_clone_similar (cairo_surface_t  *surface,
 		    surface->backend->clone_similar (surface, &image->base,
 						     src_x, src_y,
 						     width, height,
-						     device_offset_x,
-						     device_offset_y,
+						     clone_offset_x,
+						     clone_offset_y,
 						     clone_out);
 
 		_cairo_surface_release_source_image (src, image, image_extra);
@@ -1172,8 +1172,8 @@ _cairo_surface_clone_similar (cairo_surface_t  *surface,
 	    _cairo_surface_fallback_clone_similar (surface, src,
 						   src_x, src_y,
 						   width, height,
-						   device_offset_x,
-						   device_offset_y,
+						   clone_offset_x,
+						   clone_offset_y,
 						   clone_out);
 
     /* We should never get UNSUPPORTED here, so if we have an error, bail. */
diff --git a/src/cairo-win32-private.h b/src/cairo-win32-private.h
index dd05a2d..21b04be 100644
--- a/src/cairo-win32-private.h
+++ b/src/cairo-win32-private.h
@@ -160,8 +160,8 @@ _cairo_win32_surface_clone_similar (void *abstract_surface,
 				    int src_y,
 				    int width,
 				    int height,
-				    int *device_offset_x,
-				    int *device_offset_y,
+				    int *clone_offset_x,
+				    int *clone_offset_y,
 				    cairo_surface_t **clone_out);
 
 static inline void
diff --git a/src/cairo-win32-surface.c b/src/cairo-win32-surface.c
index 883441c..5a9eca3 100644
--- a/src/cairo-win32-surface.c
+++ b/src/cairo-win32-surface.c
@@ -443,8 +443,8 @@ _cairo_win32_surface_clone_similar (void *abstract_surface,
 				    int src_y,
 				    int width,
 				    int height,
-				    int *device_offset_x,
-				    int *device_offset_y,
+				    int *clone_offset_x,
+				    int *clone_offset_y,
 				    cairo_surface_t **clone_out)
 {
     cairo_content_t src_content;
@@ -473,8 +473,8 @@ _cairo_win32_surface_clone_similar (void *abstract_surface,
     _cairo_pattern_fini (&pattern.base);
 
     if (status == CAIRO_STATUS_SUCCESS) {
-	*device_offset_x = src_x;
-	*device_offset_y = src_y;
+	*clone_offset_x = src_x;
+	*clone_offset_y = src_y;
 	*clone_out = new_surface;
     } else
 	cairo_surface_destroy (new_surface);
diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c
index 7aa80bd..7a84007 100644
--- a/src/cairo-xcb-surface.c
+++ b/src/cairo-xcb-surface.c
@@ -695,8 +695,8 @@ _cairo_xcb_surface_clone_similar (void			*abstract_surface,
 				  int                    src_y,
 				  int                    width,
 				  int                    height,
-				  int                   *device_offset_x,
-				  int                   *device_offset_y,
+				  int                   *clone_offset_x,
+				  int                   *clone_offset_y,
 				  cairo_surface_t     **clone_out)
 {
     cairo_xcb_surface_t *surface = abstract_surface;
@@ -706,8 +706,8 @@ _cairo_xcb_surface_clone_similar (void			*abstract_surface,
 	cairo_xcb_surface_t *xcb_src = (cairo_xcb_surface_t *)src;
 
 	if (_cairo_xcb_surface_same_screen(surface, xcb_src)) {
-	    *device_offset_x = 0;
-	    *device_offset_y = 0;
+	    *clone_offset_x = 0;
+	    *clone_offset_y = 0;
 	    *clone_out = cairo_surface_reference (src);
 
 	    return CAIRO_STATUS_SUCCESS;
@@ -732,8 +732,8 @@ _cairo_xcb_surface_clone_similar (void			*abstract_surface,
 	    return status;
 	}
 
-	*device_offset_x = src_x;
-	*device_offset_y = src_y;
+	*clone_offset_x = src_x;
+	*clone_offset_y = src_y;
 	*clone_out = &clone->base;
 
 	return CAIRO_STATUS_SUCCESS;
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index ed534c1..6012cfe 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -1134,8 +1134,8 @@ _cairo_xlib_surface_clone_similar (void			*abstract_surface,
 				   int                   src_y,
 				   int                   width,
 				   int                   height,
-				   int                  *device_offset_x,
-				   int                  *device_offset_y,
+				   int                  *clone_offset_x,
+				   int                  *clone_offset_y,
 				   cairo_surface_t     **clone_out)
 {
     cairo_xlib_surface_t *surface = abstract_surface;
@@ -1148,8 +1148,8 @@ _cairo_xlib_surface_clone_similar (void			*abstract_surface,
 	cairo_xlib_surface_t *xlib_src = (cairo_xlib_surface_t *)src;
 
 	if (_cairo_xlib_surface_same_screen (surface, xlib_src)) {
-	    *device_offset_x = 0;
-	    *device_offset_y = 0;
+	    *clone_offset_x = 0;
+	    *clone_offset_y = 0;
 	    *clone_out = cairo_surface_reference (src);
 
 	    return CAIRO_STATUS_SUCCESS;
@@ -1182,8 +1182,8 @@ _cairo_xlib_surface_clone_similar (void			*abstract_surface,
 	    return status;
 	}
 
-	*device_offset_x = src_x;
-	*device_offset_y = src_y;
+	*clone_offset_x = src_x;
+	*clone_offset_y = src_y;
 	*clone_out = &clone->base;
 
 	return CAIRO_STATUS_SUCCESS;
diff --git a/src/cairoint.h b/src/cairoint.h
index b55a05f..323004c 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -554,7 +554,7 @@ struct _cairo_surface_backend {
      * 2. It has the same contents as @src within the given rectangle.
      *
      * 3. The offset of the similar surface with respect to the original
-     *    surface is returned in the device transform vector.
+     *    surface is returned in the clone_offset vector.
      *    - if you clone the entire surface, this vector is zero.
      *    - if you clone (src_x, src_y)x(w, h) the vector is (src_x, src_y);
      */
@@ -565,8 +565,8 @@ struct _cairo_surface_backend {
 				 int                     src_y,
 				 int                     width,
 				 int                     height,
-				 int                    *device_offset_x,
-				 int                    *device_offset_y,
+				 int                    *clone_offset_x,
+				 int                    *clone_offset_y,
 				 cairo_surface_t       **clone_out);
 
     /* XXX: dst should be the first argument for consistency */
@@ -1824,8 +1824,8 @@ _cairo_surface_clone_similar (cairo_surface_t  *surface,
 			      int               src_y,
 			      int               width,
 			      int               height,
-			      int              *device_offset_x,
-			      int              *device_offset_y,
+			      int              *clone_offset_x,
+			      int              *clone_offset_y,
 			      cairo_surface_t **clone_out);
 
 cairo_private cairo_surface_t *
diff --git a/src/test-fallback-surface.c b/src/test-fallback-surface.c
index 94f352f..883941d 100644
--- a/src/test-fallback-surface.c
+++ b/src/test-fallback-surface.c
@@ -176,15 +176,15 @@ _test_fallback_surface_clone_similar (void		  *abstract_surface,
 				      int                  src_y,
 				      int                  width,
 				      int                  height,
-				      int                 *device_offset_x,
-				      int                 *device_offset_y,
+				      int                 *clone_offset_x,
+				      int                 *clone_offset_y,
 				      cairo_surface_t    **clone_out)
 {
     test_fallback_surface_t *surface = abstract_surface;
 
     if (src->backend == surface->base.backend) {
-	*device_offset_x = 0;
-	*device_offset_y = 0;
+	*clone_offset_x = 0;
+	*clone_offset_y = 0;
 	*clone_out = cairo_surface_reference (src);
 
 	return CAIRO_STATUS_SUCCESS;
commit 95c3c069326a77a28eb49053c0ace9f1977e0378
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Sep 27 17:13:32 2008 +0100

    [surface] Only return early for no traps if the operator is bounded by a mask.
    
    If the operator is unbounded, then its area of effect extends beyond
    the definition of the mask by the trapezoids and so we must always perform
    the image composition.
    
    Fixes test/operator*.

diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c
index 056ea4e..e744b91 100644
--- a/src/cairo-surface-fallback.c
+++ b/src/cairo-surface-fallback.c
@@ -527,16 +527,14 @@ _clip_and_composite_trapezoids (cairo_pattern_t *src,
     cairo_rectangle_int_t extents;
     cairo_composite_traps_info_t traps_info;
 
-    if (traps->num_traps == 0)
+    if (_cairo_operator_bounded_by_mask (op) && traps->num_traps == 0)
         return CAIRO_STATUS_SUCCESS;
 
     status = _cairo_surface_get_extents (dst, &extents);
-
     if (status)
         return status;
 
     status = _cairo_traps_extract_region (traps, &trap_region);
-
     if (CAIRO_INT_STATUS_UNSUPPORTED == status) {
         has_trap_region = FALSE;
     } else if (status) {
diff --git a/test/Makefile.am b/test/Makefile.am
index 02f4383..fcc3fc8 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -910,8 +910,6 @@ extend-pad$(EXEEXT)				\
 filter-nearest-offset$(EXEEXT)			\
 filter-bilinear-extents$(EXEEXT)		\
 long-lines$(EXEEXT)				\
-operator$(EXEEXT)				\
-operator-alpha$(EXEEXT)				\
 self-copy-overlap$(EXEEXT)			\
 self-intersecting$(EXEEXT)			\
 surface-pattern$(EXEEXT)			\


More information about the cairo-commit mailing list