[poppler] poppler/CairoOutputDev.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Fri Apr 9 03:51:15 PDT 2010


 poppler/CairoOutputDev.cc |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 51aefe1423a068e8c119c21a8791d265aecbeaf5
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Fri Apr 9 12:50:00 2010 +0200

    [cairo] Implement colorizing image masks with pattern colorspace

diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index 52941d8..49fb191 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -1511,6 +1511,9 @@ void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
     return;
   }
 
+  if (state->getFillColorSpace()->getMode() == csPattern)
+    cairo_push_group_with_content (cairo, CAIRO_CONTENT_ALPHA);
+
   /* shape is 1.0 for painted areas, 0.0 for unpainted ones */
 
   cairo_matrix_t matrix;
@@ -1522,6 +1525,12 @@ void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
   } else {
     drawImageMaskRegular(state, ref, str, width, height, invert, interpolate, inlineImg);
   }
+
+  if (state->getFillColorSpace()->getMode() == csPattern) {
+    if (mask)
+      cairo_pattern_destroy (mask);
+    mask = cairo_pop_group (cairo);
+  }
 }
 
 void CairoOutputDev::drawImageMaskRegular(GfxState *state, Object *ref, Stream *str,


More information about the poppler mailing list