[cairo-commit] cairo/src Makefile.am, 1.34, 1.35 cairo_pattern.c, 1.16, 1.17

Owen Taylor commit at pdx.freedesktop.org
Sun Jan 30 11:28:16 PST 2005


Committed by: otaylor

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

Modified Files:
	Makefile.am cairo_pattern.c 
Log Message:
2005-01-30  Owen Taylor  <otaylor at redhat.com>

        Fixes from David Reveman:

        * src/cairo_pattern.c (_cairo_pattern_save/restore_surface): Don't
        save to surface part of the union when the pattern isn't a surface
        pattern.
        (_cairo_pattern_get_surface): Create the new surface at the width
        and height of the source.

        * src/Makefile.am (libcairo_ft_sources): Add cairo-ft-private.h


Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/cairo/src/Makefile.am,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- Makefile.am	25 Jan 2005 14:50:33 -0000	1.34
+++ Makefile.am	30 Jan 2005 19:28:14 -0000	1.35
@@ -41,7 +41,7 @@
 
 if CAIRO_HAS_FT_FONT
 libcairo_ft_headers = cairo-ft.h
-libcairo_ft_sources = cairo_ft_font.c
+libcairo_ft_sources = cairo_ft_font.c cairo-ft-private.h
 endif
 
 # These names match automake style variable definition conventions so

Index: cairo_pattern.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_pattern.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- cairo_pattern.c	28 Jan 2005 20:27:23 -0000	1.16
+++ cairo_pattern.c	30 Jan 2005 19:28:14 -0000	1.17
@@ -332,44 +332,42 @@
 _cairo_pattern_prepare_surface (cairo_pattern_t *pattern,
 				cairo_surface_t *surface)
 {
-    cairo_matrix_t device_to_source;
-    cairo_matrix_t user_to_source;
     
-    /* should the surface matrix interface be remove from the API?
-       for now we multiple the surface matrix with the pattern matrix */
-    if (pattern->type == CAIRO_PATTERN_SURFACE) {
-	cairo_surface_get_matrix (pattern->u.surface.surface, &user_to_source);
-	cairo_matrix_multiply (&device_to_source, &pattern->matrix,
-			       &user_to_source);
-	cairo_surface_set_matrix (surface, &device_to_source);
-    }
+    if (pattern->type == CAIRO_PATTERN_SURFACE)
+    {
+	/* storing original surface matrix in pattern */
+	cairo_surface_get_matrix (pattern->u.surface.surface,
+				  &pattern->u.surface.save_matrix);
 
-    /* storing original surface matrix in pattern */
-    pattern->u.surface.save_matrix = user_to_source;
+	/* set pattern matrix */
+	cairo_surface_set_matrix (surface, &pattern->matrix);
 
-    /* storing original surface repeat mode in pattern */
-    pattern->u.surface.save_repeat = surface->repeat;
+	/* storing original surface repeat mode in pattern */
+	pattern->u.surface.save_repeat = surface->repeat;
 
-    /* what do we do with extend types pad and reflect? */
-    if (pattern->extend == CAIRO_EXTEND_REPEAT || surface->repeat == 1)
-	cairo_surface_set_repeat (surface, 1);
-    else
-	cairo_surface_set_repeat (surface, 0);
+	/* what do we do with extend types pad and reflect? */
+	if (pattern->extend == CAIRO_EXTEND_REPEAT || surface->repeat == 1)
+	    cairo_surface_set_repeat (surface, 1);
+	else
+	    cairo_surface_set_repeat (surface, 0);
     
-    /* storing original surface filter in pattern */
-    pattern->u.surface.save_filter = cairo_surface_get_filter (surface);
+	/* storing original surface filter in pattern */
+	pattern->u.surface.save_filter = cairo_surface_get_filter (surface);
     
-    cairo_surface_set_filter (surface, pattern->filter);
+	cairo_surface_set_filter (surface, pattern->filter);
+    }
 }
 
-
 void
 _cairo_pattern_restore_surface (cairo_pattern_t *pattern,
 				cairo_surface_t *surface)
 {
-    cairo_surface_set_matrix (surface, &pattern->u.surface.save_matrix);
-    cairo_surface_set_repeat (surface, pattern->u.surface.save_repeat);
-    cairo_surface_set_filter (surface, pattern->u.surface.save_filter);
+    if (pattern->type == CAIRO_PATTERN_SURFACE)
+    {
+	cairo_surface_set_matrix (surface, &pattern->u.surface.save_matrix);
+	cairo_surface_set_repeat (surface, pattern->u.surface.save_repeat);
+	cairo_surface_set_filter (surface, pattern->u.surface.save_filter);
+    }
 }
 
 #define INTERPOLATE_COLOR_NEAREST(c1, c2, factor) \
@@ -816,7 +814,7 @@
 	    
 	    surface = cairo_surface_create_similar (dst,
 						    CAIRO_FORMAT_ARGB32,
-						    width, height);
+						    image->width, image->height);
 	    if (surface == NULL)
 		return NULL;
 




More information about the cairo-commit mailing list