[cairo-commit] cairo/test cairo-test.c, 1.27, 1.28 gradient-alpha.c, 1.3, 1.4 mask.c, 1.4, 1.5 move-to-show-surface.c, 1.7, 1.8 select-font-no-show-text.c, 1.2, 1.3 set-source.c, 1.2, 1.3 text-cache-crash.c, 1.7, 1.8 text-rotate.c, 1.8, 1.9 transforms.c, 1.1, 1.2 translate-show-surface.c, 1.3, 1.4 trap-clip.c, 1.2, 1.3

Carl Worth commit at pdx.freedesktop.org
Fri May 6 13:32:56 PDT 2005


Committed by: cworth

Update of /cvs/cairo/cairo/test
In directory gabe:/tmp/cvs-serv23395/test

Modified Files:
	cairo-test.c gradient-alpha.c mask.c move-to-show-surface.c 
	select-font-no-show-text.c set-source.c text-cache-crash.c 
	text-rotate.c transforms.c translate-show-surface.c 
	trap-clip.c 
Log Message:

       * src/cairo.c:
        * src/cairo.h: Eliminate the following deprecated functions from
        cairo's interface:

                cairo_copy
                cairo_get_path
                cairo_get_path_flat
                cairo_matrix_create
                cairo_matrix_destroy
                cairo_matrix_copy
                cairo_matrix_get_affine
                cairo_surface_set_repeat
                cairo_surface_set_matrix
                cairo_surface_get_matrix
                cairo_surface_set_filter
                cairo_surface_get_filter

        Also, eliminate all support for compiling against, or running with
        old, deprecated names for functions.

        * src/cairo-ft-font.c: (_compute_transform):
        * src/cairo-gstate.c:
        * src/cairo-image-surface.c: (cairo_image_surface_create_for_data):
        * src/cairo-matrix.c: (_cairo_matrix_get_affine),
        (_cairo_matrix_compute_adjoint),
        (_cairo_matrix_is_integer_translation):
        * src/cairo-pattern.c: (cairo_pattern_add_color_stop_rgba),
        (cairo_pattern_set_matrix), (cairo_pattern_get_matrix),
        (_cairo_image_data_set_linear), (_cairo_linear_pattern_classify),
        (_cairo_image_data_set_radial):
        * src/cairo-pdf-surface.c: (_cairo_pdf_surface_composite_image),
        (_cairo_pdf_surface_composite_pdf), (emit_surface_pattern),
        (emit_linear_pattern), (emit_radial_pattern):
        * src/cairo-surface.c:
        * src/cairo-xlib-surface.c:
        (_cairo_xlib_surface_acquire_source_image),
        (cairo_xlib_surface_create):
        * src/cairo.c: (cairo_set_source_rgba), (cairo_set_source),
        (cairo_get_source), (cairo_transform), (cairo_identity_matrix),
        (cairo_user_to_device), (cairo_user_to_device_distance),
        (cairo_device_to_user), (cairo_device_to_user_distance),
        (cairo_reset_clip), (cairo_select_font_face), (cairo_font_extents),
        (cairo_set_font_size), (cairo_get_operator), (cairo_get_rgb_color),
        (cairo_get_tolerance), (cairo_get_fill_rule),
        (cairo_get_line_width), (cairo_get_line_cap),
        (cairo_get_line_join), (cairo_get_miter_limit), (cairo_get_matrix),
        (cairo_get_target), (cairo_status), (cairo_status_string):
        * src/cairoint.h:
        * test/cairo-test.c: (cairo_test_create_png_pattern):
        * test/gradient-alpha.c: (draw):
        * test/mask.c: (set_gradient_pattern), (set_image_pattern):
        * test/move-to-show-surface.c: (draw):
        * test/select-font-no-show-text.c: (draw):
        * test/set-source.c: (draw):
        * test/text-cache-crash.c: (draw):
        * test/text-rotate.c: (draw):
        * test/transforms.c: (draw_L_shape):
        * test/translate-show-surface.c: (draw):
        * test/trap-clip.c: (set_gradient_pattern), (set_image_pattern):
        * util/cairo-api-update:

        Deal with all of the removals.


Index: cairo-test.c
===================================================================
RCS file: /cvs/cairo/cairo/test/cairo-test.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- cairo-test.c	6 May 2005 20:26:16 -0000	1.27
+++ cairo-test.c	6 May 2005 20:32:53 -0000	1.28
@@ -410,12 +410,11 @@
     if (status != READ_PNG_SUCCESS)
 	return NULL;
 
-    image = cairo_surface_create_for_image (buffer, CAIRO_FORMAT_ARGB32,
-					    w, h, stride);
-
-    cairo_surface_set_repeat (image, 1);
+    image = cairo_image_surface_create_for_data (buffer, CAIRO_FORMAT_ARGB32,
+						 w, h, stride);
 
     pattern = cairo_pattern_create_for_surface (image);
+    cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
 
     return pattern;
 }

Index: gradient-alpha.c
===================================================================
RCS file: /cvs/cairo/cairo/test/gradient-alpha.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- gradient-alpha.c	19 Apr 2005 23:29:05 -0000	1.3
+++ gradient-alpha.c	6 May 2005 20:32:53 -0000	1.4
@@ -38,14 +38,14 @@
 
     gradient = cairo_pattern_create_linear (0, -height,
 					    0, height);
-    cairo_pattern_add_color_stop (gradient, 0.0,
-				  1.0, 0.0, 0.0,
-				  1.0);
-    cairo_pattern_add_color_stop (gradient, 1.0,
-				  0.0, 0.0, 1.0,
-				  0.5);
+    cairo_pattern_add_color_stop_rgba (gradient, 0.0,
+				       1.0, 0.0, 0.0,
+				       1.0);
+    cairo_pattern_add_color_stop_rgba (gradient, 1.0,
+				       0.0, 0.0, 1.0,
+				       0.5);
 
-    cairo_set_pattern (cr, gradient);
+    cairo_set_source (cr, gradient);
 
     cairo_paint (cr);
 

Index: mask.c
===================================================================
RCS file: /cvs/cairo/cairo/test/mask.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- mask.c	6 May 2005 20:26:16 -0000	1.4
+++ mask.c	6 May 2005 20:32:53 -0000	1.5
@@ -53,9 +53,9 @@
 
     pattern =
 	cairo_pattern_create_linear (x, y, x + WIDTH, y + HEIGHT);
-    cairo_pattern_add_color_stop (pattern, 0, 1, 1, 1, 1);
-    cairo_pattern_add_color_stop (pattern, 1, 0, 0, 0.4, 1);
-    cairo_set_pattern (cr, pattern);
+    cairo_pattern_add_color_stop_rgba (pattern, 0, 1, 1, 1, 1);
+    cairo_pattern_add_color_stop_rgba (pattern, 1, 0, 0, 0.4, 1);
+    cairo_set_source (cr, pattern);
 }
 
 static void
@@ -64,7 +64,7 @@
     cairo_pattern_t *pattern;
 
     pattern = cairo_test_create_png_pattern (cr, png_filename);
-    cairo_set_pattern (cr, pattern);
+    cairo_set_source (cr, pattern);
 }
 
 static void

Index: move-to-show-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/test/move-to-show-surface.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- move-to-show-surface.c	3 May 2005 15:33:32 -0000	1.7
+++ move-to-show-surface.c	6 May 2005 20:32:53 -0000	1.8
@@ -62,8 +62,9 @@
     int i;
 
     for (i=0; i < 4; i++) {
-	surface = cairo_surface_create_for_image ((unsigned char *) &colors[i],
-						  CAIRO_FORMAT_ARGB32, 1, 1, 4);
+	surface = cairo_image_surface_create_for_data ((unsigned char *) &colors[i],
+						       CAIRO_FORMAT_ARGB32,
+						       1, 1, 4);
 	cairo_set_source_surface (cr, surface,
 				  i % 2, i / 2);
 	cairo_paint (cr);

Index: select-font-no-show-text.c
===================================================================
RCS file: /cvs/cairo/cairo/test/select-font-no-show-text.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- select-font-no-show-text.c	14 Apr 2005 13:05:59 -0000	1.2
+++ select-font-no-show-text.c	6 May 2005 20:32:53 -0000	1.3
@@ -50,9 +50,9 @@
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
-    cairo_select_font (cr, "Bitstream Vera Sans",
-		       CAIRO_FONT_SLANT_NORMAL,
-		       CAIRO_FONT_WEIGHT_BOLD);
+    cairo_select_font_face (cr, "Bitstream Vera Sans",
+			    CAIRO_FONT_SLANT_NORMAL,
+			    CAIRO_FONT_WEIGHT_BOLD);
 
     return CAIRO_TEST_SUCCESS;
 }

Index: set-source.c
===================================================================
RCS file: /cvs/cairo/cairo/test/set-source.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- set-source.c	14 Apr 2005 21:42:27 -0000	1.2
+++ set-source.c	6 May 2005 20:32:53 -0000	1.3
@@ -41,8 +41,8 @@
     cairo_surface_t *surface;
     cairo_pattern_t *pattern;
 
-    surface = cairo_surface_create_for_image ((unsigned char *) &color,
-					      CAIRO_FORMAT_ARGB32, 1, 1, 4);
+    surface = cairo_image_surface_create_for_data ((unsigned char *) &color,
+						   CAIRO_FORMAT_ARGB32, 1, 1, 4);
     pattern = cairo_pattern_create_for_surface (surface);
     cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
 

Index: text-cache-crash.c
===================================================================
RCS file: /cvs/cairo/cairo/test/text-cache-crash.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- text-cache-crash.c	7 Apr 2005 20:29:32 -0000	1.7
+++ text-cache-crash.c	6 May 2005 20:32:53 -0000	1.8
@@ -73,13 +73,15 @@
 draw (cairo_t *cr, int width, int height)
 {
     /* Once there was a bug that choked when selecting the same font twice. */
-    cairo_select_font(cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
-    cairo_set_font_size(cr, 40.0);
+    cairo_select_font_face (cr, "sans",
+			    CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
+    cairo_set_font_size (cr, 40.0);
 
-    cairo_select_font(cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
-    cairo_set_font_size(cr, 40.0);
-    cairo_move_to(cr, 10, 50);
-    cairo_show_text(cr, "hello");
+    cairo_select_font_face (cr, "sans",
+			    CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
+    cairo_set_font_size (cr, 40.0);
+    cairo_move_to (cr, 10, 50);
+    cairo_show_text (cr, "hello");
 
     /* Then there was a bug that choked when selecting a font too big
      * for the cache. */

Index: text-rotate.c
===================================================================
RCS file: /cvs/cairo/cairo/test/text-rotate.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- text-rotate.c	14 Apr 2005 21:42:27 -0000	1.8
+++ text-rotate.c	6 May 2005 20:32:53 -0000	1.9
@@ -78,9 +78,9 @@
     cairo_text_extents_t extents;
     static char text[] = "cairo";
 
-    cairo_select_font (cr, "Bitstream Vera Sans",
-		       CAIRO_FONT_SLANT_NORMAL,
-		       CAIRO_FONT_WEIGHT_NORMAL);
+    cairo_select_font_face (cr, "Bitstream Vera Sans",
+			    CAIRO_FONT_SLANT_NORMAL,
+			    CAIRO_FONT_WEIGHT_NORMAL);
     cairo_set_font_size (cr, TEXT_SIZE);
 
     cairo_set_source_rgb (cr, 0, 0, 0);

Index: transforms.c
===================================================================
RCS file: /cvs/cairo/cairo/test/transforms.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- transforms.c	7 Apr 2005 17:01:49 -0000	1.1
+++ transforms.c	6 May 2005 20:32:53 -0000	1.2
@@ -42,7 +42,7 @@
     cairo_rel_line_to (cr, 5, 0);
 
     cairo_save (cr);
-    cairo_default_matrix (cr);
+    cairo_identity_matrix (cr);
     cairo_set_line_width (cr, 2.0);
     cairo_stroke (cr);
     cairo_restore (cr);

Index: translate-show-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/test/translate-show-surface.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- translate-show-surface.c	3 May 2005 15:33:32 -0000	1.3
+++ translate-show-surface.c	6 May 2005 20:32:53 -0000	1.4
@@ -60,8 +60,9 @@
     int i;
 
     for (i=0; i < 4; i++) {
-	surface = cairo_surface_create_for_image ((unsigned char *) &colors[i],
-						  CAIRO_FORMAT_ARGB32, 1, 1, 4);
+	surface = cairo_image_surface_create_for_data ((unsigned char *) &colors[i],
+						       CAIRO_FORMAT_ARGB32,
+						       1, 1, 4);
 	cairo_save (cr);
 	{
 	    cairo_translate (cr, i % 2, i / 2);

Index: trap-clip.c
===================================================================
RCS file: /cvs/cairo/cairo/test/trap-clip.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- trap-clip.c	14 Apr 2005 21:42:27 -0000	1.2
+++ trap-clip.c	6 May 2005 20:32:53 -0000	1.3
@@ -52,9 +52,9 @@
 
     pattern =
 	cairo_pattern_create_linear (x, y, x + WIDTH, y + HEIGHT);
-    cairo_pattern_add_color_stop (pattern, 0, 1, 1, 1, 1);
-    cairo_pattern_add_color_stop (pattern, 1, 0, 0, 0.4, 1);
-    cairo_set_pattern (cr, pattern);
+    cairo_pattern_add_color_stop_rgba (pattern, 0, 1, 1, 1, 1);
+    cairo_pattern_add_color_stop_rgba (pattern, 1, 0, 0, 0.4, 1);
+    cairo_set_source (cr, pattern);
 }
 
 static void
@@ -63,7 +63,7 @@
     cairo_pattern_t *pattern;
 
     pattern = cairo_test_create_png_pattern (cr, png_filename);
-    cairo_set_pattern (cr, pattern);
+    cairo_set_source (cr, pattern);
 }
 
 static void




More information about the cairo-commit mailing list