[cairo-commit] test/any2ppm.c test/pdf2png.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Jun 11 05:11:51 PDT 2010


 test/any2ppm.c |    9 +++++----
 test/pdf2png.c |   10 +++++-----
 2 files changed, 10 insertions(+), 9 deletions(-)

New commits:
commit 7f227ec8d3f981dbbf2ca1914bf7fd29d9cdfd05
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jun 11 12:54:15 2010 +0100

    Revert "test/pdf2png: Don't use DEST_OVER as poppler starts using subpixel text."
    
    This reverts commit 506b2ebe714d61a64972b607a42a55e48d1c722a.
    
    We have conflicting requirements here. In order to support extended
    blend modes correctly we need to use DEST_OVER, at the expense of
    supporting subpixel text. More thought required.

diff --git a/test/any2ppm.c b/test/any2ppm.c
index d6bc779..55b4c7e 100644
--- a/test/any2ppm.c
+++ b/test/any2ppm.c
@@ -357,15 +357,16 @@ _poppler_render_page (const char *filename,
 
     poppler_page_get_size (page, &width, &height);
 
-    surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, width, height);
+    surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
     cr = cairo_create (surface);
 
-    cairo_set_source_rgb (cr, 1., 1., 1.);
-    cairo_paint (cr);
-
     poppler_page_render (page, cr);
     g_object_unref (page);
 
+    cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OVER);
+    cairo_set_source_rgb (cr, 1., 1., 1.);
+    cairo_paint (cr);
+
     status = cairo_status (cr);
     cairo_destroy (cr);
 
diff --git a/test/pdf2png.c b/test/pdf2png.c
index 279ccfe..f60170c 100644
--- a/test/pdf2png.c
+++ b/test/pdf2png.c
@@ -74,17 +74,17 @@ int main (int argc, char *argv[])
 
     poppler_page_get_size (page, &width, &height);
 
-    surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, width, height);
+    surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
     cr = cairo_create (surface);
     cairo_surface_destroy (surface);
 
-    /* fill the background with white */
-    cairo_set_source_rgb (cr, 1., 1., 1.);
-    cairo_paint (cr);
-
     poppler_page_render (page, cr);
     g_object_unref (page);
 
+    cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OVER);
+    cairo_set_source_rgb (cr, 1., 1., 1.);
+    cairo_paint (cr);
+
     status = cairo_surface_write_to_png (cairo_get_target (cr),
 					 output_filename);
     cairo_destroy (cr);


More information about the cairo-commit mailing list