From 8efb103600e9c034f8652f495d390d6a4178061e Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 21 May 2008 10:23:37 -0700 Subject: [PATCH] Extend fallback-resolution test to expose bug with groups Groups appear to always be rendered with a fallback resolution of 72.0 ppi rather than the desired fallback resolution. --- test/fallback-resolution.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/test/fallback-resolution.c b/test/fallback-resolution.c index 07b4f10a4..2fcf1ac16 100644 --- a/test/fallback-resolution.c +++ b/test/fallback-resolution.c @@ -129,7 +129,33 @@ main (void) { cairo_surface_set_fallback_resolution (surface, ppi[page], ppi[page]); - draw_with_ppi (cr, SIZE, SIZE, ppi[page]); + /* First draw the top half in a conventional way. */ + cairo_save (cr); + { + cairo_rectangle (cr, 0, 0, SIZE, SIZE / 2.0); + cairo_clip (cr); + + draw_with_ppi (cr, SIZE, SIZE, ppi[page]); + } + cairo_restore (cr); + + /* Then draw the bottom half in a separate group, + * (exposing a bug in 1.6.4 with the group not being + * rendered with the correct fallback resolution). */ + cairo_save (cr); + { + cairo_rectangle (cr, 0, SIZE / 2.0, SIZE, SIZE / 2.0); + cairo_clip (cr); + + cairo_push_group (cr); + { + draw_with_ppi (cr, SIZE, SIZE, ppi[page]); + } + cairo_pop_group_to_source (cr); + + cairo_paint (cr); + } + cairo_restore (cr); cairo_show_page (cr); }