From 0504b123cd462964635c2cff52c7a1f7cd13d7fc Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Thu, 6 Oct 2011 21:05:17 +1030 Subject: [PATCH] ps: emit non repeating patterns in PSOutput with inType3Char = true instead of falling back to Gfx. This avoids emitting the image data twice. --- poppler/PSOutputDev.cc | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-) diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc index 4e6392e..373bb6e 100644 --- a/poppler/PSOutputDev.cc +++ b/poppler/PSOutputDev.cc @@ -4113,8 +4113,23 @@ GBool PSOutputDev::tilingPatternFill(GfxState *state, Catalog *cat, Object *str, double *mat, double *bbox, int x0, int y0, int x1, int y1, double xStep, double yStep) { - if (x1 - x0 == 1 && y1 - y0 == 1) - return gFalse; // Don't need to use patterns if only one instance of the pattern is used + if (x0 == 0 && x1 == 1 && y0 == 0 && y1 == 1) { + // Don't need to use patterns if only one instance of the pattern is used + PDFRectangle box; + Gfx *gfx; + + box.x1 = bbox[0]; + box.y1 = bbox[1]; + box.x2 = bbox[2]; + box.y2 = bbox[3]; + gfx = new Gfx(xref, this, resDict, m_catalog, &box, NULL); + writePSFmt("[{0:.6g} {1:.6g} {2:.6g} {3:.6g} {4:.6g} {5:.6g}] cm\n", mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]); + inType3Char = gTrue; + gfx->display(str); + inType3Char = gFalse; + delete gfx; + return gTrue; + } if (level == psLevel1 || level == psLevel1Sep) { return tilingPatternFillL1(state, cat, str, pmat, paintType, tilingType, resDict, -- 1.7.4.1