[poppler] poppler/CairoOutputDev.cc

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


 poppler/CairoOutputDev.cc |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit bd8f44289770175a17ac45e4788b0d374cc93d5a
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Fri Apr 9 12:02:38 2010 +0200

    Partially revert "[cairo] Do not change device offset of mask surface"
    
    This partially reverts commit a32f6f9ebaed3e4827b9dc6cb37e307c2798f521.
    It fixed bug #27208, but it's causing regressions on other documents.

diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index cf0b31c..52941d8 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -1269,6 +1269,13 @@ void CairoOutputDev::setSoftMask(GfxState * state, double * bbox, GBool alpha,
     cairo_get_matrix(cairo, &mat);
     cairo_set_matrix(maskCtx, &mat);
 
+    /* make the device offset of the new mask match that of the group */
+    double x_offset, y_offset;
+    cairo_surface_t *pats;
+    cairo_pattern_get_surface(group, &pats);
+    cairo_surface_get_device_offset(pats, &x_offset, &y_offset);
+    cairo_surface_set_device_offset(source, x_offset, y_offset);
+
     /* paint the group */
     cairo_set_source(maskCtx, group);
     cairo_paint(maskCtx);
@@ -1301,7 +1308,9 @@ void CairoOutputDev::setSoftMask(GfxState * state, double * bbox, GBool alpha,
 
     /* setup the new mask pattern */
     mask = cairo_pattern_create_for_surface(source);
-    cairo_pattern_set_matrix(mask, &mat);
+    cairo_matrix_t patMatrix;
+    cairo_pattern_get_matrix(group, &patMatrix);
+    cairo_pattern_set_matrix(mask, &patMatrix);
 
     cairo_surface_destroy(source);
   } else {


More information about the poppler mailing list