[poppler] poppler/CairoOutputDev.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Thu Feb 21 00:55:05 PST 2008


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

New commits:
commit 053ecae534a4522d152b0139b6aed6da2059d760
Author: Carl Worth <cworth at cworth.org>
Date:   Wed Feb 20 17:21:27 2008 -0800

    Keep cairo and cairo_shape consistent
    
    The 'cairo_shape' state was not always being modified at the same
    time as 'cairo'. In some cases this led to a sequence of ever
    larger matrix scale factors until things just blew up.

diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index 0bc0ab4..43b1ca4 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -158,11 +158,15 @@ void CairoOutputDev::drawLink(Link *link, Catalog *catalog) {
 void CairoOutputDev::saveState(GfxState *state) {
   LOG(printf ("save\n"));
   cairo_save (cairo);
+  if (cairo_shape)
+      cairo_save (cairo_shape);
 }
 
 void CairoOutputDev::restoreState(GfxState *state) {
   LOG(printf ("restore\n"));
   cairo_restore (cairo);
+  if (cairo_shape)
+      cairo_restore (cairo_shape);
 
   /* These aren't restored by cairo_restore() since we keep them in
    * the output device. */
@@ -196,6 +200,8 @@ void CairoOutputDev::setDefaultCTM(double *ctm) {
   matrix.y0 = ctm[5];
 
   cairo_transform (cairo, &matrix);
+  if (shape)
+      cairo_transform (cairo_shape, &matrix);
 
   OutputDev::setDefaultCTM(ctm);
 }


More information about the poppler mailing list