[cairo-commit] cairo/test cairo-test.c, 1.25, 1.26 clip-nesting.c, 1.1, 1.2 mask.c, 1.2, 1.3 path-data.c, 1.3, 1.4 pdf-surface.c, 1.1, 1.2 pixman-rotate.c, 1.8, 1.9 scale-source-surface-paint.c, 1.1, 1.2 self-copy.c, 1.1, 1.2 source-clip.c, 1.1, 1.2 source-surface-scale-paint.c, 1.1, 1.2 surface-pattern.c, 1.1, 1.2

Carl Worth commit at pdx.freedesktop.org
Fri May 6 13:23:44 PDT 2005


Committed by: cworth

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

Modified Files:
	cairo-test.c clip-nesting.c mask.c path-data.c pdf-surface.c 
	pixman-rotate.c scale-source-surface-paint.c self-copy.c 
	source-clip.c source-surface-scale-paint.c surface-pattern.c 
Log Message:

        * src/cairo.c: (cairo_create), (cairo_save), (cairo_get_target):
        * src/cairo.h:
        * src/cairoint.h:
        * src/cairo-gstate.c: (_cairo_gstate_create), (_cairo_gstate_init),
        (_cairo_gstate_get_target):
        * src/cairo-glitz.h:
        * src/cairo-pdf.h:
        * src/cairo-ps.h:
        * src/cairo-quartz-surface.c:
        * src/cairo-quartz.h:
        * src/cairo-surface.c: (_cairo_surface_begin):
        * src/cairo-win32.h:
        * src/cairo-xcb.h:
        * src/cairo-xlib.h: Remove cairo_set_target_surface and all other
        backend-specific cairo_set_target functions. Require a
        cairo_surface_t* to call cairo_create.

        * test/cairo-test.c: (create_image_surface), (cleanup_image),
        (create_glitz_surface), (cleanup_glitz), (create_quartz_surface),
        (cleanup_quartz), (create_win32_surface), (cleanup_win32),
        (create_xcb_surface), (cleanup_xcb), (create_xlib_surface),
        (cleanup_xlib), (cairo_test_for_target), (cairo_test_real):

        Port to use new cairo_create interface.

        * test/clip-nesting.c: (draw):
        * test/mask.c: (mask_polygon), (draw):
        * test/path-data.c: (main):
        * test/pdf-surface.c: (main):
        * test/pixman-rotate.c: (draw):
        * test/scale-source-surface-paint.c: (draw):
        * test/self-copy.c: (draw):
        * test/source-clip.c: (draw):
        * test/source-surface-scale-paint.c: (draw):
        * test/surface-pattern.c: (draw):

        Rewrite all tests that were using cairo_set_target_surface to
        instead create a temporary cairo_t, (eventually to be replaced
        with cairo_begin_group).


Index: cairo-test.c
===================================================================
RCS file: /cvs/cairo/cairo/test/cairo-test.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- cairo-test.c	3 May 2005 15:33:32 -0000	1.25
+++ cairo-test.c	6 May 2005 20:23:41 -0000	1.26
@@ -95,97 +95,94 @@
     }
 }
 
-typedef cairo_test_status_t
-(*cairo_test_set_target_t) (cairo_t *cr, int width, int height, void **closure);
+typedef cairo_surface_t *
+(*cairo_test_create_target_surface_t) (int width, int height, void **closure);
 
 typedef void
 (*cairo_test_cleanup_target_t) (void *closure);
 
 typedef struct _cairo_test_target
 {
-    const char		       *name;
-    cairo_test_set_target_t	set_target;
-    cairo_test_cleanup_target_t cleanup_target;
-    void		       *closure;
+    const char		       	       *name;
+    cairo_test_create_target_surface_t	create_target_surface;
+    cairo_test_cleanup_target_t		cleanup_target;
+    void		       	       *closure;
 } cairo_test_target_t;
 
-static cairo_test_status_t
-set_image_target (cairo_t *cr, int width, int height, void **closure)
+static cairo_surface_t *
+create_image_surface (int width, int height, void **closure)
 {
-    unsigned char *png_buf;
     int stride = 4 * width;
+    unsigned char *buf;
 
-    png_buf = xcalloc (stride * height, 1);
-
-    cairo_set_target_image (cr, png_buf, CAIRO_FORMAT_ARGB32,
-			    width, height, stride);
-
-    *closure = png_buf;
+    *closure = buf = xcalloc (stride * height, 1);
 
-    return CAIRO_TEST_SUCCESS;
+    return cairo_image_surface_create_for_data (buf,
+						CAIRO_FORMAT_ARGB32,
+						width, height, stride);
 }
 
 static void
-cleanup_image_target (void *closure)
+cleanup_image (void *closure)
 {
-    unsigned char *png_buf = closure;
+    unsigned char *buf = closure;
 
-    free (png_buf);
+    free (buf);
 }
 
 /* XXX: Someone who knows glitz better than I do should fix this up to
  * work. */
 #if 0 /* #ifdef CAIRO_HAS_GLITZ_SURFACE */
-static cairo_test_status_t
-set_glitz_target (cairo_t *cr, int width, int height, void **closure)
+static cairo_surface_t *
+create_glitz_surface (int width, int height, void **closure)
 {
 #error Not yet implemented
 }
 
 static void
-cleanup_glitz_target (cairo_t *cr)
+cleanup_glitz (cairo_t *cr)
 {
 #error Not yet implemented
 }
 #endif
 
 #ifdef CAIRO_HAS_QUARTZ_SURFACE
-static cairo_test_status_t
-set_quartz_target (cairo_t *cr, int width, int height, void **closure)
+static cairo_surface_t *
+create_quartz_surface (int width, int height, void **closure)
 {
 #error Not yet implemented
 }
 
 static void
-cleanup_quartz_target (void *closure)
+cleanup_quartz (void *closure)
 {
 #error Not yet implemented
 }
 #endif
 
 #ifdef CAIRO_HAS_WIN32_SURFACE
-static cairo_test_status_t
-set_win32_target (cairo_t *cr, int width, int height, void **closure)
+static cairo_surface_t *
+create_win32_surface (int width, int height, void **closure)
 {
 #error Not yet implemented
 }
 
 static void
-cleanup_win32_target (void *closure)
+cleanup_win32 (void *closure)
 {
 #error Not yet implemented
 }
 #endif
 
 #ifdef CAIRO_HAS_XCB_SURFACE
-static cairo_test_status_t
-set_xcb_target (cairo_t *cr, int width, int height, void **closure)
+static cairo_surface_t *
+create_xcb_surface (int width, int height, void **closure)
 {
 #error Not yet implemented
 }
 
 static void
-cleanup_xcb_target (void *closure)
+cleanup_xcb (void *closure)
 {
 #error Not yet implemented
 }
@@ -198,8 +195,8 @@
     Pixmap pixmap;
 } xlib_target_closure_t;
 
-static cairo_test_status_t
-set_xlib_target (cairo_t *cr, int width, int height, void **closure)
+static cairo_surface_t *
+create_xlib_surface (int width, int height, void **closure)
 {
     xlib_target_closure_t *xtc;
     cairo_surface_t *surface;
@@ -215,22 +212,21 @@
     xtc->dpy = dpy = XOpenDisplay (0);
     if (xtc->dpy == NULL) {
 	fprintf (stderr, "Failed to open display: %s\n", XDisplayName(0));
-	return CAIRO_TEST_FAILURE;
+	return NULL;
     }
 
     xtc->pixmap = XCreatePixmap (dpy, DefaultRootWindow (dpy),
 				 width, height, 32);
 
     surface = cairo_xlib_surface_create_for_pixmap (dpy, xtc->pixmap,
-						    CAIRO_FORMAT_ARGB32);
+							 CAIRO_FORMAT_ARGB32);
     cairo_xlib_surface_set_size (surface, width, height);
-    cairo_set_target_surface (cr, surface);
 
-    return CAIRO_TEST_SUCCESS;
+    return surface;
 }
 
 static void
-cleanup_xlib_target (void *closure)
+cleanup_xlib (void *closure)
 {
     xlib_target_closure_t *xtc = closure;
 
@@ -245,6 +241,7 @@
 		       cairo_test_target_t	 *target)
 {
     cairo_test_status_t status;
+    cairo_surface_t *surface;
     cairo_t *cr;
     char *png_name, *ref_name, *diff_name;
     char *srcdir;
@@ -263,16 +260,15 @@
 	       target->name, CAIRO_TEST_DIFF_SUFFIX);
 
     /* Run the actual drawing code. */
-    cr = cairo_create ();
-
-    status = (target->set_target) (cr,
-				   test->width, test->height,
-				   &target->closure);
-    if (status) {
+    surface = (target->create_target_surface) (test->width, test->height,
+					       &target->closure);
+    if (surface == NULL) {
 	fprintf (stderr, "Error: Failed to set %s target\n", target->name);
 	return CAIRO_TEST_FAILURE;
     }
 
+    cr = cairo_create (surface);
+
     cairo_save (cr);
     cairo_set_source_rgba (cr, 0, 0, 0, 0);
     cairo_set_operator (cr, CAIRO_OPERATOR_SRC);
@@ -298,10 +294,12 @@
 	return CAIRO_TEST_SUCCESS;
     }
 
-    cairo_surface_write_to_png (cairo_get_target_surface (cr), png_name);
+    cairo_surface_write_to_png (surface, png_name);
 
     cairo_destroy (cr);
 
+    cairo_surface_destroy (surface);
+
     target->cleanup_target (target->closure);
 
     pixels_changed = image_diff (png_name, ref_name, diff_name);
@@ -330,21 +328,21 @@
     cairo_test_status_t status, ret;
     cairo_test_target_t targets[] = 
 	{
-	    { "image", set_image_target, cleanup_image_target}, 
+	    { "image", create_image_surface, cleanup_image}, 
 #if 0 /* #ifdef CAIRO_HAS_GLITZ_SURFACE */
-	    { "glitz", set_glitz_target, cleanup_glitz_target}, 
+	    { "glitz", create_glitz_surface, cleanup_glitz}, 
 #endif
 #ifdef CAIRO_HAS_QUARTZ_SURFACE
-	    { "quartz", set_quartz_target, cleanup_quart_target},
+	    { "quartz", create_quartz_surface, cleanup_quartz},
 #endif
 #ifdef CAIRO_HAS_WIN32_SURFACE
-	    { "win32", set_win32_target, cleanup_win32_target},
+	    { "win32", create_win32_surface, cleanup_win32},
 #endif
 #ifdef CAIRO_HAS_XCB_SURFACE
-	    { "xcb", set_xcb_target, cleanup_xcb_target},
+	    { "xcb", create_xcb_surface, cleanup_xcb},
 #endif
 #ifdef CAIRO_HAS_XLIB_SURFACE
-	    { "xlib", set_xlib_target, cleanup_xlib_target},
+	    { "xlib", create_xlib_surface, cleanup_xlib},
 #endif
 	};
     char *log_name;

Index: clip-nesting.c
===================================================================
RCS file: /cvs/cairo/cairo/test/clip-nesting.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- clip-nesting.c	2 May 2005 20:39:34 -0000	1.1
+++ clip-nesting.c	6 May 2005 20:23:41 -0000	1.2
@@ -43,10 +43,9 @@
     cairo_surface_t *target_surface;
     cairo_t *cr2, *cr3;
 
-    target_surface = cairo_get_target_surface (cr);
+    target_surface = cairo_get_target (cr);
 
-    cr2 = cairo_create ();
-    cairo_set_target_surface (cr2, target_surface);
+    cr2 = cairo_create (target_surface);
 
     /* Draw a diagonal line and clip to it */
     
@@ -70,9 +69,7 @@
     /* But doesn't affect another cairo_t that we create temporarily for
      * the same surface
      */
-    cr3 = cairo_create ();
-    
-    cairo_set_target_surface (cr3, target_surface);
+    cr3 = cairo_create (target_surface);
     cairo_set_source_rgb (cr3, 1, 1, 1); /* White */
     cairo_rectangle (cr3,
 		     SIZE - BORDER - LINE_WIDTH, BORDER,

Index: mask.c
===================================================================
RCS file: /cvs/cairo/cairo/test/mask.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mask.c	6 May 2005 19:00:22 -0000	1.2
+++ mask.c	6 May 2005 20:23:41 -0000	1.3
@@ -73,11 +73,10 @@
     cairo_surface_t *mask_surface;
     cairo_t *cr2;
 
-    mask_surface = cairo_surface_create_similar (cairo_get_target_surface (cr),
+    mask_surface = cairo_surface_create_similar (cairo_get_target (cr),
 						 CAIRO_FORMAT_A8,
 						 WIDTH, HEIGHT);
-    cr2 = cairo_create ();
-    cairo_set_target_surface (cr2, mask_surface);
+    cr2 = cairo_create (mask_surface);
 
     cairo_save (cr2);
     cairo_set_source_rgba (cr2, 0, 0, 0, 0); /* transparent */
@@ -196,11 +195,10 @@
     /* Some of our drawing is unbounded, so we draw each test to
      * a temporary surface and copy over.
      */
-    tmp_surface = cairo_surface_create_similar (cairo_get_target_surface (cr),
+    tmp_surface = cairo_surface_create_similar (cairo_get_target (cr),
 						CAIRO_FORMAT_ARGB32,
 						IMAGE_WIDTH, IMAGE_HEIGHT);
-    cr2 = cairo_create ();
-    cairo_set_target_surface (cr2, tmp_surface);
+    cr2 = cairo_create (tmp_surface);
 
     tmp_pattern = cairo_pattern_create_for_surface (tmp_surface);
     cairo_set_source (cr, tmp_pattern);

Index: path-data.c
===================================================================
RCS file: /cvs/cairo/cairo/test/path-data.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- path-data.c	29 Mar 2005 08:02:19 -0000	1.3
+++ path-data.c	6 May 2005 20:23:41 -0000	1.4
@@ -140,15 +140,18 @@
     cairo_t *cr;
     cairo_path_data_t data;
     cairo_path_t path;
+    cairo_surface_t *surface;
+
+    surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1);
 
     /* Test a few error cases for cairo_append_path_data */
-    cr = cairo_create ();
+    cr = cairo_create (surface);
     cairo_append_path (cr, NULL);
     if (cairo_status (cr) != CAIRO_STATUS_NULL_POINTER)
 	return 1;
     cairo_destroy (cr);
 
-    cr = cairo_create ();
+    cr = cairo_create (surface);
     path.data = NULL;
     path.num_data = 0;
     cairo_append_path (cr, &path);
@@ -156,7 +159,7 @@
 	return 1;
     cairo_destroy (cr);
 
-    cr = cairo_create ();
+    cr = cairo_create (surface);
     /* Intentionally insert bogus header.length value (otherwise would be 2) */
     data.header.type = CAIRO_PATH_MOVE_TO;
     data.header.length = 1;
@@ -168,12 +171,14 @@
     cairo_destroy (cr);
 
     /* And test the degnerate case */
-    cr = cairo_create ();
+    cr = cairo_create (surface);
     path.num_data = 0;
     cairo_append_path (cr, &path);
     if (cairo_status (cr) != CAIRO_STATUS_SUCCESS)
 	return 1;
     cairo_destroy (cr);
 
+    cairo_surface_destroy (surface);
+
     return cairo_test (&test, draw);
 }

Index: pdf-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/test/pdf-surface.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pdf-surface.c	26 Apr 2005 16:43:39 -0000	1.1
+++ pdf-surface.c	6 May 2005 20:23:41 -0000	1.2
@@ -37,6 +37,7 @@
     cairo_t *cr;
     const char *filename = "pdf-surface.pdf";
     FILE *file;
+    cairo_surface_t *surface;
 
     file = fopen (filename, "w");
     if (!file) {
@@ -44,12 +45,11 @@
 	return CAIRO_TEST_FAILURE;
     }
 
-    cr = cairo_create ();
-
-    cairo_set_target_pdf (cr, file,
-			  297 / 25.4,
-			  210 / 25.4,
-			  300.0, 300.0);
+    surface = cairo_pdf_surface_create (file,
+					297 / 25.4,
+					210 / 25.4,
+					300.0, 300.0);
+    cr = cairo_create (surface);
 
     cairo_rectangle (cr, 10, 10, 100, 100);
     cairo_set_source_rgb (cr, 1, 0, 0);
@@ -57,6 +57,7 @@
 
     cairo_show_page (cr);
 
+    cairo_surface_destroy (surface);
     cairo_destroy (cr);
 
     fclose (file);

Index: pixman-rotate.c
===================================================================
RCS file: /cvs/cairo/cairo/test/pixman-rotate.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- pixman-rotate.c	3 May 2005 15:33:32 -0000	1.8
+++ pixman-rotate.c	6 May 2005 20:23:41 -0000	1.9
@@ -24,25 +24,25 @@
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
-    cairo_surface_t *target, *stamp;
-
-    target = cairo_get_target_surface (cr);
-    cairo_surface_reference (target);
+    cairo_surface_t *stamp;
+    cairo_t *cr2;
 
-    stamp = cairo_surface_create_similar (target, CAIRO_FORMAT_ARGB32,
+    stamp = cairo_surface_create_similar (cairo_get_target (cr),
+					  CAIRO_FORMAT_ARGB32,
 					  WIDTH, HEIGHT);
-    cairo_set_target_surface (cr, stamp);
-    cairo_new_path (cr);
-    cairo_rectangle (cr, WIDTH / 4, HEIGHT / 4, WIDTH / 2, HEIGHT / 2);
-    cairo_set_source_rgba (cr, 1, 0, 0, 0.8);
-    cairo_fill (cr);
-
-    cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
-    cairo_set_line_width (cr, 2);
-    cairo_set_source_rgb (cr, 0, 0, 0);
-    cairo_stroke (cr);
+    cr2 = cairo_create (stamp);
+    {
+	cairo_new_path (cr2);
+	cairo_rectangle (cr2, WIDTH / 4, HEIGHT / 4, WIDTH / 2, HEIGHT / 2);
+	cairo_set_source_rgba (cr2, 1, 0, 0, 0.8);
+	cairo_fill (cr2);
 
-    cairo_set_target_surface (cr, target);
+	cairo_rectangle (cr2, 0, 0, WIDTH, HEIGHT);
+	cairo_set_line_width (cr2, 2);
+	cairo_set_source_rgb (cr2, 0, 0, 0);
+	cairo_stroke (cr2);
+    }
+    cairo_destroy (cr2);
 
     /* Draw a translucent rectangle for reference where the rotated
      * image should be. */
@@ -64,7 +64,6 @@
     cairo_show_page (cr);
 
     cairo_surface_destroy (stamp);
-    cairo_surface_destroy (target);
 
     return CAIRO_TEST_SUCCESS;
 }

Index: scale-source-surface-paint.c
===================================================================
RCS file: /cvs/cairo/cairo/test/scale-source-surface-paint.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- scale-source-surface-paint.c	3 May 2005 15:33:32 -0000	1.1
+++ scale-source-surface-paint.c	6 May 2005 20:23:41 -0000	1.2
@@ -42,7 +42,6 @@
 	0xff00ff00, 0xff00ff00,		0xff0000ff, 0xff0000ff,
 	0xff00ff00, 0xff00ff00,		0xff0000ff, 0xff0000ff
     };
-    int i;
 
     surface = cairo_image_surface_create_for_data ((unsigned char *) data,
 					      CAIRO_FORMAT_ARGB32, 4, 4, 16);

Index: self-copy.c
===================================================================
RCS file: /cvs/cairo/cairo/test/self-copy.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- self-copy.c	2 May 2005 20:39:34 -0000	1.1
+++ self-copy.c	6 May 2005 20:23:41 -0000	1.2
@@ -55,7 +55,7 @@
     /* Create a pattern with the target surface as the source,
      * offset by SIZE/2
      */
-    pattern = cairo_pattern_create_for_surface (cairo_get_target_surface (cr));
+    pattern = cairo_pattern_create_for_surface (cairo_get_target (cr));
     
     cairo_matrix_init_translate (&matrix, - SIZE / 2, - SIZE / 2);
     cairo_pattern_set_matrix (pattern, &matrix);

Index: source-clip.c
===================================================================
RCS file: /cvs/cairo/cairo/test/source-clip.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- source-clip.c	2 May 2005 20:39:34 -0000	1.1
+++ source-clip.c	6 May 2005 20:23:41 -0000	1.2
@@ -42,12 +42,11 @@
     cairo_surface_t *source_surface;
     cairo_t *cr2;
 
-    source_surface = cairo_surface_create_similar (cairo_get_target_surface (cr),
+    source_surface = cairo_surface_create_similar (cairo_get_target (cr),
 						   CAIRO_FORMAT_ARGB32,
 						   SIZE, SIZE);
 
-    cr2 = cairo_create ();
-    cairo_set_target_surface (cr2, source_surface);
+    cr2 = cairo_create (source_surface);
 
     /* Fill the source surface with solid black */
     cairo_set_source_rgb (cr2, 0, 0, 0);

Index: source-surface-scale-paint.c
===================================================================
RCS file: /cvs/cairo/cairo/test/source-surface-scale-paint.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- source-surface-scale-paint.c	3 May 2005 15:33:32 -0000	1.1
+++ source-surface-scale-paint.c	6 May 2005 20:23:41 -0000	1.2
@@ -42,7 +42,6 @@
 	0xff00ff00, 0xff00ff00,		0xff0000ff, 0xff0000ff,
 	0xff00ff00, 0xff00ff00,		0xff0000ff, 0xff0000ff
     };
-    int i;
 
     surface = cairo_image_surface_create_for_data ((unsigned char *) data,
 					      CAIRO_FORMAT_ARGB32, 4, 4, 16);

Index: surface-pattern.c
===================================================================
RCS file: /cvs/cairo/cairo/test/surface-pattern.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- surface-pattern.c	18 Apr 2005 23:26:14 -0000	1.1
+++ surface-pattern.c	6 May 2005 20:23:41 -0000	1.2
@@ -35,25 +35,24 @@
 draw (cairo_t *cr, int width, int height)
 {
     cairo_surface_t *surface;
+    cairo_t *cr2;
     cairo_pattern_t *pattern;
     surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
 					  6, 6);
 
-    cairo_save (cr);
+    cr2 = cairo_create (surface);
     {
-	cairo_set_target_surface (cr, surface);
-
-	cairo_rectangle (cr, 0, 0, 3, 3);
-	cairo_rectangle (cr, 3, 3, 3, 3);
-	cairo_set_source_rgb (cr, 1, 1, 0);
-	cairo_fill (cr);
-
-	cairo_rectangle (cr, 3, 0, 3, 3);
-	cairo_rectangle (cr, 0, 3, 3, 3);
-	cairo_set_source_rgb (cr, 0, 0, 1);
-	cairo_fill (cr);
+	cairo_rectangle (cr2, 0, 0, 3, 3);
+	cairo_rectangle (cr2, 3, 3, 3, 3);
+	cairo_set_source_rgb (cr2, 1, 1, 0);
+	cairo_fill (cr2);
+    
+	cairo_rectangle (cr2, 3, 0, 3, 3);
+	cairo_rectangle (cr2, 0, 3, 3, 3);
+	cairo_set_source_rgb (cr2, 0, 0, 1);
+	cairo_fill (cr2);
     }
-    cairo_restore (cr);
+    cairo_destroy (cr2);
 
     pattern = cairo_pattern_create_for_surface (surface);
     cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);




More information about the cairo-commit mailing list