summaryrefslogtreecommitdiff
path: root/test/create-from-png.c
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2008-04-05 13:32:51 +1030
committerChris Wilson <chris@chris-wilson.co.uk>2008-10-30 21:24:54 +0000
commit05fce5bced9718ffa803f5a87df00f96809d1f53 (patch)
tree0d1b29e4d144175f032d8a939fb52e8c4223e056 /test/create-from-png.c
parent2c53bdb82a955c672c8fee2b1b4c991af2654ae0 (diff)
downloadcairo-05fce5bced9718ffa803f5a87df00f96809d1f53.tar.gz
PS/PDF: Set image Interpolation flag
If the filter mode is anything other than DEFAILT, FAST or NEAREST set the Interpolate flag in the image dictionary so that a smoothing filter is applied when rasterising the vector file. As we have no control over the implementation of the Interpolate filter (the PS/PDF specifications leave it undefined) we need to capture the output of poppler/GS and update our reference images. (For a couple of tests, the filtering is irrelevant so for those we set the filter to NEAREST.) Note that GhostScript's Interpolate filter does not work on rotated images (and a variety of other transformations) so several of the PS reference images have use nearest-neighbour sampling instead of a bilinear filter.
Diffstat (limited to 'test/create-from-png.c')
-rw-r--r--test/create-from-png.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/create-from-png.c b/test/create-from-png.c
index 5ed3f6169..9e2ad7f83 100644
--- a/test/create-from-png.c
+++ b/test/create-from-png.c
@@ -72,6 +72,7 @@ draw (cairo_t *cr, int width, int height)
free (filename);
cairo_set_source_surface (cr, surface, 0, 0);
+ cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_NEAREST);
cairo_paint (cr);
cairo_surface_destroy (surface);