diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-06-11 12:04:39 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-06-11 12:07:21 +0100 |
commit | 506b2ebe714d61a64972b607a42a55e48d1c722a (patch) | |
tree | 222364f0d7d1f94bba80fdfde224e7dc2701b795 /test | |
parent | edb73b6dcf1adce40d6c10c492e3f78556e22b85 (diff) |
test/pdf2png: Don't use DEST_OVER as poppler starts using subpixel text.
Using DEST_OVER in this form to paint the background white fails in the
presence of subpixel geometry (particular text), so remove the hack and
simply paint the background white prior to passing the surface to
poppler. KISS.
Diffstat (limited to 'test')
-rw-r--r-- | test/any2ppm.c | 9 | ||||
-rw-r--r-- | test/pdf2png.c | 10 |
2 files changed, 9 insertions, 10 deletions
diff --git a/test/any2ppm.c b/test/any2ppm.c index 55b4c7ec..d6bc7796 100644 --- a/test/any2ppm.c +++ b/test/any2ppm.c @@ -357,16 +357,15 @@ _poppler_render_page (const char *filename, poppler_page_get_size (page, &width, &height); - surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); + surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, width, height); cr = cairo_create (surface); - 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); + poppler_page_render (page, cr); + g_object_unref (page); + status = cairo_status (cr); cairo_destroy (cr); diff --git a/test/pdf2png.c b/test/pdf2png.c index f60170cc..279ccfe6 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_ARGB32, width, height); + surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, width, height); cr = cairo_create (surface); cairo_surface_destroy (surface); - poppler_page_render (page, cr); - g_object_unref (page); - - cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OVER); + /* 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); + status = cairo_surface_write_to_png (cairo_get_target (cr), output_filename); cairo_destroy (cr); |