[cairo-commit] cairo/test multi-page.c,1.1,1.2

Carl Worth commit at pdx.freedesktop.org
Thu Jan 12 16:47:08 PST 2006


Committed by: cworth

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

Modified Files:
	multi-page.c 
Log Message:

2006-01-12  Carl Worth  <cworth at cworth.org>

        * test/multi-page.c: (draw_some_pages), (main): Add a call to
        cairo_copy_page, so that that gets called at least once within the
        test suite.

        * src/cairo-paginated-surface.c:
        (_cairo_paginated_surface_copy_page): Fix broken implementation of
        copy_page in the paginated surface by hiding it from the target
        surface which sees only show_page operations. (It's hard to do
        better than that unless we can guarantee thathe subsequent page
        won't trigger any image fallbacks.)


Index: multi-page.c
===================================================================
RCS file: /cvs/cairo/cairo/test/multi-page.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- multi-page.c	13 Jan 2006 00:35:12 -0000	1.1
+++ multi-page.c	13 Jan 2006 00:47:06 -0000	1.2
@@ -103,16 +103,24 @@
 }
 
 static void
-draw_five_pages (cairo_surface_t *surface)
+draw_some_pages (cairo_surface_t *surface)
 {
     cairo_t *cr;
     int i;
 
     cr = cairo_create (surface);
 
-#define NUM_PAGES 5
-    for (i=0; i < NUM_PAGES; i++) {
-	draw (cr, WIDTH_IN_POINTS, HEIGHT_IN_POINTS, (double) i / (NUM_PAGES - 1));
+#define NUM_FRAMES 5
+    for (i=0; i < NUM_FRAMES; i++) {
+	draw (cr, WIDTH_IN_POINTS, HEIGHT_IN_POINTS,
+	      (double) i / (NUM_FRAMES - 1));
+
+	/* Duplicate the last frame onto another page. (This is just a
+	 * way to sneak cairo_copy_page into the test).
+	 */
+	if (i == (NUM_FRAMES - 1))
+	    cairo_copy_page (cr);
+
 	cairo_show_page (cr);
     }
 
@@ -140,7 +148,7 @@
 	return CAIRO_TEST_FAILURE;
     }
 
-    draw_five_pages (surface);
+    draw_some_pages (surface);
 
     cairo_surface_destroy (surface);
 
@@ -159,7 +167,7 @@
 	return CAIRO_TEST_FAILURE;
     }
 
-    draw_five_pages (surface);
+    draw_some_pages (surface);
 
     cairo_surface_destroy (surface);
 



More information about the cairo-commit mailing list