[cairo-commit] cairo/src cairo_glitz_surface.c, 1.19, 1.20 cairo_image_surface.c, 1.26, 1.27 cairo_pdf_surface.c, 1.15, 1.16 cairo_png_surface.c, 1.16, 1.17 cairo_ps_surface.c, 1.23, 1.24 cairo_surface.c, 1.42, 1.43 cairo_xlib_surface.c, 1.45, 1.46 cairoint.h, 1.100, 1.101

David Reveman commit at pdx.freedesktop.org
Thu Mar 3 18:20:30 PST 2005


Committed by: davidr

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv29383/src

Modified Files:
	cairo_glitz_surface.c cairo_image_surface.c 
	cairo_pdf_surface.c cairo_png_surface.c cairo_ps_surface.c 
	cairo_surface.c cairo_xlib_surface.c cairoint.h 
Log Message:
Removed surface backend functions set_matrix, set_filter and set_repeat

Index: cairo_glitz_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_glitz_surface.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- cairo_glitz_surface.c	4 Mar 2005 02:04:51 -0000	1.19
+++ cairo_glitz_surface.c	4 Mar 2005 02:20:28 -0000	1.20
@@ -396,11 +396,10 @@
     return CAIRO_INT_STATUS_UNSUPPORTED;
 }
 
-static cairo_status_t
-_cairo_glitz_surface_set_matrix (void		*abstract_surface,
-				 cairo_matrix_t *matrix)
+static void
+_cairo_glitz_surface_set_matrix (cairo_glitz_surface_t *surface,
+				 cairo_matrix_t	       *matrix)
 {
-    cairo_glitz_surface_t *surface = abstract_surface;
     glitz_transform_t transform;
 
     transform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]);
@@ -416,20 +415,6 @@
     transform.matrix[2][2] = 1 << 16;
 
     glitz_surface_set_transform (surface->surface, &transform);
-
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_glitz_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
-{
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_glitz_surface_set_repeat (void *abstract_surface, int repeat)
-{
-    return CAIRO_STATUS_SUCCESS;
 }
 
 static glitz_operator_t
@@ -1128,9 +1113,6 @@
     _cairo_glitz_surface_acquire_dest_image,
     _cairo_glitz_surface_release_dest_image,
     _cairo_glitz_surface_clone_similar,
-    _cairo_glitz_surface_set_matrix,
-    _cairo_glitz_surface_set_filter,
-    _cairo_glitz_surface_set_repeat,
     _cairo_glitz_surface_composite,
     _cairo_glitz_surface_fill_rectangles,
     _cairo_glitz_surface_composite_trapezoids,

Index: cairo_image_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_image_surface.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- cairo_image_surface.c	4 Mar 2005 01:40:05 -0000	1.26
+++ cairo_image_surface.c	4 Mar 2005 02:20:28 -0000	1.27
@@ -325,14 +325,6 @@
     return CAIRO_INT_STATUS_UNSUPPORTED;
 }
 
-static cairo_status_t
-_cairo_image_abstract_surface_set_matrix (void			*abstract_surface,
-					  cairo_matrix_t	*matrix)
-{
-    cairo_image_surface_t *surface = abstract_surface;
-    return _cairo_image_surface_set_matrix (surface, matrix);
-}
-
 cairo_status_t
 _cairo_image_surface_set_matrix (cairo_image_surface_t	*surface,
 				 cairo_matrix_t		*matrix)
@@ -356,14 +348,6 @@
     return CAIRO_STATUS_SUCCESS;
 }
 
-static cairo_status_t
-_cairo_image_abstract_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
-{
-    cairo_image_surface_t *surface = abstract_surface;
-
-    return _cairo_image_surface_set_filter (surface, filter);
-}
-
 cairo_status_t
 _cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t filter)
 {
@@ -394,13 +378,6 @@
     return CAIRO_STATUS_SUCCESS;
 }
 
-static cairo_status_t
-_cairo_image_abstract_surface_set_repeat (void *abstract_surface, int repeat)
-{
-    cairo_image_surface_t *surface = abstract_surface;
-    return _cairo_image_surface_set_repeat (surface, repeat);
-}
-
 cairo_status_t
 _cairo_image_surface_set_repeat (cairo_image_surface_t *surface, int repeat)
 {
@@ -678,9 +655,6 @@
     _cairo_image_surface_acquire_dest_image,
     _cairo_image_surface_release_dest_image,
     _cairo_image_surface_clone_similar,
-    _cairo_image_abstract_surface_set_matrix,
-    _cairo_image_abstract_surface_set_filter,
-    _cairo_image_abstract_surface_set_repeat,
     _cairo_image_surface_composite,
     _cairo_image_surface_fill_rectangles,
     _cairo_image_surface_composite_trapezoids,

Index: cairo_pdf_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_pdf_surface.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- cairo_pdf_surface.c	4 Mar 2005 01:40:05 -0000	1.15
+++ cairo_pdf_surface.c	4 Mar 2005 02:20:28 -0000	1.16
@@ -1138,27 +1138,6 @@
     return CAIRO_INT_STATUS_UNSUPPORTED;
 }
 
-static cairo_status_t
-_cairo_pdf_surface_set_matrix (void		*abstract_surface,
-			       cairo_matrix_t	*matrix)
-{
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_pdf_surface_set_filter (void		*abstract_surface,
-			       cairo_filter_t	filter)
-{
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_pdf_surface_set_repeat (void		*abstract_surface,
-			       int		repeat)
-{
-    return CAIRO_STATUS_SUCCESS;
-}
-
 static void *
 compress_dup (const void *data, unsigned long data_size,
 	      unsigned long *compressed_size)
@@ -1818,9 +1797,6 @@
     _cairo_pdf_surface_acquire_dest_image,
     _cairo_pdf_surface_release_dest_image,
     _cairo_pdf_surface_clone_similar,
-    _cairo_pdf_surface_set_matrix,
-    _cairo_pdf_surface_set_filter,
-    _cairo_pdf_surface_set_repeat,
     _cairo_pdf_surface_composite,
     _cairo_pdf_surface_fill_rectangles,
     _cairo_pdf_surface_composite_trapezoids,

Index: cairo_png_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_png_surface.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- cairo_png_surface.c	22 Feb 2005 19:35:03 -0000	1.16
+++ cairo_png_surface.c	4 Mar 2005 02:20:28 -0000	1.17
@@ -240,33 +240,6 @@
     return CAIRO_INT_STATUS_UNSUPPORTED;
 }
 
-static cairo_status_t
-_cairo_png_surface_set_matrix (void		*abstract_surface,
-			       cairo_matrix_t	*matrix)
-{
-    cairo_png_surface_t *surface = abstract_surface;
-
-    return _cairo_image_surface_set_matrix (surface->image, matrix);
-}
-
-static cairo_status_t
-_cairo_png_surface_set_filter (void		*abstract_surface,
-			       cairo_filter_t	filter)
-{
-    cairo_png_surface_t *surface = abstract_surface;
-
-    return _cairo_image_surface_set_filter (surface->image, filter);
-}
-
-static cairo_status_t
-_cairo_png_surface_set_repeat (void		*abstract_surface,
-			       int		repeat)
-{
-    cairo_png_surface_t *surface = abstract_surface;
-
-    return _cairo_image_surface_set_repeat (surface->image, repeat);
-}
-
 static cairo_int_status_t
 _cairo_png_surface_composite (cairo_operator_t	operator,
 			      cairo_pattern_t	*pattern,
@@ -442,9 +415,6 @@
     _cairo_png_surface_acquire_dest_image,
     _cairo_png_surface_release_dest_image,
     _cairo_png_surface_clone_similar,
-    _cairo_png_surface_set_matrix,
-    _cairo_png_surface_set_filter,
-    _cairo_png_surface_set_repeat,
     _cairo_png_surface_composite,
     _cairo_png_surface_fill_rectangles,
     _cairo_png_surface_composite_trapezoids,

Index: cairo_ps_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_ps_surface.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- cairo_ps_surface.c	4 Mar 2005 01:40:06 -0000	1.23
+++ cairo_ps_surface.c	4 Mar 2005 02:20:28 -0000	1.24
@@ -263,33 +263,6 @@
     return CAIRO_INT_STATUS_UNSUPPORTED;
 }
 
-static cairo_status_t
-_cairo_ps_surface_set_matrix (void		*abstract_surface,
-			      cairo_matrix_t	*matrix)
-{
-    cairo_ps_surface_t *surface = abstract_surface;
-
-    return _cairo_image_surface_set_matrix (surface->image, matrix);
-}
-
-static cairo_status_t
-_cairo_ps_surface_set_filter (void		*abstract_surface,
-			      cairo_filter_t	filter)
-{
-    cairo_ps_surface_t *surface = abstract_surface;
-
-    return _cairo_image_surface_set_filter (surface->image, filter);
-}
-
-static cairo_status_t
-_cairo_ps_surface_set_repeat (void		*abstract_surface,
-			      int		repeat)
-{
-    cairo_ps_surface_t *surface = abstract_surface;
-
-    return _cairo_image_surface_set_repeat (surface->image, repeat);
-}
-
 static cairo_int_status_t
 _cairo_ps_surface_composite (cairo_operator_t	operator,
 			     cairo_pattern_t	*src,
@@ -460,9 +433,6 @@
     _cairo_ps_surface_acquire_dest_image,
     _cairo_ps_surface_release_dest_image,
     _cairo_ps_surface_clone_similar,
-    _cairo_ps_surface_set_matrix,
-    _cairo_ps_surface_set_filter,
-    _cairo_ps_surface_set_repeat,
     _cairo_ps_surface_composite,
     _cairo_ps_surface_fill_rectangles,
     _cairo_ps_surface_composite_trapezoids,

Index: cairo_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_surface.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- cairo_surface.c	22 Feb 2005 19:35:03 -0000	1.42
+++ cairo_surface.c	4 Mar 2005 02:20:28 -0000	1.43
@@ -304,9 +304,7 @@
     if (surface == NULL)
 	return CAIRO_STATUS_NULL_POINTER;
 
-    cairo_matrix_copy (&surface->matrix, matrix);
-
-    return surface->backend->set_matrix (surface, matrix);
+    return cairo_matrix_copy (&surface->matrix, matrix);
 }
 slim_hidden_def(cairo_surface_set_matrix);
 
@@ -327,7 +325,7 @@
 	return CAIRO_STATUS_NULL_POINTER;
 
     surface->filter = filter;
-    return surface->backend->set_filter (surface, filter);
+    return CAIRO_STATUS_SUCCESS;
 }
 
 cairo_filter_t
@@ -359,7 +357,7 @@
 
     surface->repeat = repeat;
 
-    return surface->backend->set_repeat (surface, repeat);
+    return CAIRO_STATUS_SUCCESS;
 }
 slim_hidden_def(cairo_surface_set_repeat);
 

Index: cairo_xlib_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_xlib_surface.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- cairo_xlib_surface.c	4 Mar 2005 01:40:06 -0000	1.45
+++ cairo_xlib_surface.c	4 Mar 2005 02:20:28 -0000	1.46
@@ -442,10 +442,6 @@
 	
 	_draw_image_surface (clone, image_src, 0, 0);
 	
-	cairo_surface_set_filter (&clone->base, src->filter);
-	cairo_surface_set_matrix (&clone->base, &src->matrix);
-	cairo_surface_set_repeat (&clone->base, src->repeat);
-	
 	*clone_out = &clone->base;
 
 	return CAIRO_STATUS_SUCCESS;
@@ -455,14 +451,14 @@
 }
 
 static cairo_status_t
-_cairo_xlib_surface_set_matrix (void *abstract_surface, cairo_matrix_t *matrix)
+_cairo_xlib_surface_set_matrix (cairo_xlib_surface_t *surface,
+				cairo_matrix_t	     *matrix)
 {
-    cairo_xlib_surface_t *surface = abstract_surface;
     XTransform xtransform;
 
     if (!surface->picture)
 	return CAIRO_STATUS_SUCCESS;
-
+    
     xtransform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]);
     xtransform.matrix[0][1] = _cairo_fixed_from_double (matrix->m[1][0]);
     xtransform.matrix[0][2] = _cairo_fixed_from_double (matrix->m[2][0]);
@@ -475,26 +471,41 @@
     xtransform.matrix[2][1] = 0;
     xtransform.matrix[2][2] = _cairo_fixed_from_double (1);
 
-    if (CAIRO_SURFACE_RENDER_HAS_PICTURE_TRANSFORM (surface))
+    if (!CAIRO_SURFACE_RENDER_HAS_PICTURE_TRANSFORM (surface))
     {
-	XRenderSetPictureTransform (surface->dpy, surface->picture, &xtransform);
-    } else {
-	/* XXX: Need support here if using an old RENDER without support
-	   for SetPictureTransform */
+	static const XTransform identity = { {
+	    { 1 << 16, 0x00000, 0x00000 },
+	    { 0x00000, 1 << 16, 0x00000 },
+	    { 0x00000, 0x00000, 1 << 16 },
+	} };
+
+	if (memcmp (&xtransform, &identity, sizeof (XTransform)) == 0)
+	    return CAIRO_STATUS_SUCCESS;
+	
+	return CAIRO_INT_STATUS_UNSUPPORTED;
     }
 
+    XRenderSetPictureTransform (surface->dpy, surface->picture, &xtransform);
+
     return CAIRO_STATUS_SUCCESS;
 }
 
 static cairo_status_t
-_cairo_xlib_surface_set_filter (void *abstract_surface, cairo_filter_t filter)
+_cairo_xlib_surface_set_filter (cairo_xlib_surface_t *surface,
+				cairo_filter_t	     filter)
 {
-    cairo_xlib_surface_t *surface = abstract_surface;
     char *render_filter;
 
-    if (!(surface->picture 
-	  && CAIRO_SURFACE_RENDER_HAS_FILTERS(surface)))
+    if (!surface->picture)
 	return CAIRO_STATUS_SUCCESS;
+
+    if (!CAIRO_SURFACE_RENDER_HAS_FILTERS (surface))
+    {
+	if (filter == CAIRO_FILTER_FAST || filter == CAIRO_FILTER_NEAREST)
+	    return CAIRO_STATUS_SUCCESS;
+	
+	return CAIRO_INT_STATUS_UNSUPPORTED;
+    }
     
     switch (filter) {
     case CAIRO_FILTER_FAST:
@@ -524,11 +535,10 @@
 }
 
 static cairo_status_t
-_cairo_xlib_surface_set_repeat (void *abstract_surface, int repeat)
+_cairo_xlib_surface_set_repeat (cairo_xlib_surface_t *surface, int repeat)
 {
-    cairo_xlib_surface_t *surface = abstract_surface;
-    unsigned long mask;
     XRenderPictureAttributes pa;
+    unsigned long	     mask;
 
     if (!surface->picture)
 	return CAIRO_STATUS_SUCCESS;
@@ -857,9 +867,6 @@
     _cairo_xlib_surface_acquire_dest_image,
     _cairo_xlib_surface_release_dest_image,
     _cairo_xlib_surface_clone_similar,
-    _cairo_xlib_surface_set_matrix,
-    _cairo_xlib_surface_set_filter,
-    _cairo_xlib_surface_set_repeat,
     _cairo_xlib_surface_composite,
     _cairo_xlib_surface_fill_rectangles,
     _cairo_xlib_surface_composite_trapezoids,

Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- cairoint.h	4 Mar 2005 01:40:06 -0000	1.100
+++ cairoint.h	4 Mar 2005 02:20:28 -0000	1.101
@@ -585,18 +585,6 @@
 				 cairo_surface_t        *src,
 				 cairo_surface_t       **clone_out);
 				 
-    cairo_status_t
-    (*set_matrix)		(void			*surface,
-				 cairo_matrix_t		*matrix);
-
-    cairo_status_t
-    (*set_filter)		(void			*surface,
-				 cairo_filter_t		filter);
-
-    cairo_status_t
-    (*set_repeat)		(void			*surface,
-				 int			 repeat);
-
     /* XXX: dst should be the first argument for consistency */
     cairo_int_status_t
     (*composite)		(cairo_operator_t	operator,




More information about the cairo-commit mailing list