From d47e05f8c222c0b7641af85d7ed6f50ee03297c4 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Tue, 6 Sep 2011 23:41:12 +0930 Subject: [PATCH] ps/pdf: fix the polarity of stencil masks --- src/cairo-pdf-surface.c | 3 ++- src/cairo-ps-surface.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c index 6d45422e3..db639a119 100644 --- a/src/cairo-pdf-surface.c +++ b/src/cairo-pdf-surface.c @@ -1972,7 +1972,8 @@ _cairo_pdf_surface_emit_smask (cairo_pdf_surface_t *surface, " /ImageMask true\n" " /Width %d\n" " /Height %d\n" - " /BitsPerComponent 1\n", + " /BitsPerComponent 1\n" + " /Decode [1 0]\n", image->width, image->height); } else { stream_res->id = 0; diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c index 9c1d299d1..fcfb2f1c7 100644 --- a/src/cairo-ps-surface.c +++ b/src/cairo-ps-surface.c @@ -2453,7 +2453,7 @@ _cairo_ps_surface_emit_image (cairo_ps_surface_t *surface, ps_image->height, interpolate, color == CAIRO_IMAGE_IS_MONOCHROME ? 1 : 8, - color == CAIRO_IMAGE_IS_COLOR ? "0 1 0 1 0 1" : "0 1"); + stencil_mask ? "1 0" : color == CAIRO_IMAGE_IS_COLOR ? "0 1 0 1 0 1" : "0 1"); if (surface->use_string_datasource) { _cairo_output_stream_printf (surface->stream, " /DataSource {\n"