From 7f227ec8d3f981dbbf2ca1914bf7fd29d9cdfd05 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 11 Jun 2010 12:54:15 +0100 Subject: [PATCH] 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. --- test/any2ppm.c | 9 +++++---- test/pdf2png.c | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/test/any2ppm.c b/test/any2ppm.c index d6bc77960..55b4c7ec7 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 279ccfe69..f60170cc6 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);