diff options
author | Carl Worth <cworth@cworth.org> | 2006-01-12 16:47:05 +0000 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2006-01-12 16:47:05 +0000 |
commit | 4e4b38e75930e3da8c33a02eae77fb736659ff44 (patch) | |
tree | 8ec923ae53c7dd4378ad2c41781df2b99f238c2a /test/multi-page.c | |
parent | 25882cd5e9d51f84338af6278c50d268b3d0091c (diff) | |
download | cairo-4e4b38e75930e3da8c33a02eae77fb736659ff44.tar.gz |
Add a call to cairo_copy_page, so that that gets called at least once within the test suite.
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.)
Diffstat (limited to 'test/multi-page.c')
-rw-r--r-- | test/multi-page.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/test/multi-page.c b/test/multi-page.c index 06024131e..91360843e 100644 --- a/test/multi-page.c +++ b/test/multi-page.c @@ -103,16 +103,24 @@ draw (cairo_t *cr, double width, double height, double smile_ratio) } 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 @@ main (void) return CAIRO_TEST_FAILURE; } - draw_five_pages (surface); + draw_some_pages (surface); cairo_surface_destroy (surface); @@ -159,7 +167,7 @@ main (void) return CAIRO_TEST_FAILURE; } - draw_five_pages (surface); + draw_some_pages (surface); cairo_surface_destroy (surface); |