[cairo-commit] test/fallback-resolution.c

Carl Worth cworth at kemper.freedesktop.org
Wed May 21 10:23:43 PDT 2008


 test/fallback-resolution.c |   28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

New commits:
commit 8efb103600e9c034f8652f495d390d6a4178061e
Author: Carl Worth <cworth at cworth.org>
Date:   Wed May 21 10:23:37 2008 -0700

    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.

diff --git a/test/fallback-resolution.c b/test/fallback-resolution.c
index 07b4f10..2fcf1ac 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);
 	}


More information about the cairo-commit mailing list