summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-11-21 12:22:08 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-11-21 12:22:08 +0000
commita75efa112be97cd0b809ced4919260863e3a8344 (patch)
tree705296c3701b8bd9494092fdf6ff73ef98d64460
parentFix crash when floating dialog icon is not found (diff)
downloadinkscape-a75efa112be97cd0b809ced4919260863e3a8344.tar.gz
inkscape-a75efa112be97cd0b809ced4919260863e3a8344.zip
Patch from Lubomir Rintel to fix build with Poppler 0.15.1
Fixed bugs: - https://launchpad.net/bugs/676271 (bzr r9910)
-rw-r--r--configure.ac29
-rw-r--r--src/extension/internal/pdfinput/pdf-parser.cpp10
2 files changed, 35 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 9cb50b06e..5b66ddc2c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -612,11 +612,12 @@ if test "x$popplernew" = "xyes"; then
AC_DEFINE(POPPLER_NEW_GFXFONT, 1, [Use GfxFont from Poppler >= 0.8.3])
fi
-AC_MSG_CHECKING(for new color space API in Poppler)
ink_svd_CPPFLAGS=$CPPFLAGS
ink_svd_LIBS=$LIBS
CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
LIBS="$LIBS $POPPLER_LIBS"
+
+AC_MSG_CHECKING(for new color space API in Poppler)
popplercolor="no"
AC_COMPILE_IFELSE([
#include <GfxState.h>
@@ -628,9 +629,6 @@ int main() {
return 0;
}
], [popplercolor=yes])
-CPPFLAGS=$ink_svd_CPPFLAGS
-LIBS=$ink_svd_LIBS
-
if test "x$popplercolor" = "xyes"; then
AC_DEFINE(POPPLER_NEW_COLOR_SPACE_API, 1, [Use color space API from Poppler >= 0.12.2])
AC_MSG_RESULT(yes)
@@ -638,6 +636,29 @@ else
AC_MSG_RESULT(no)
fi
+# Poppler's b604a008 commit changes this
+AC_MSG_CHECKING([whether Poppler's GfxPatch no longer uses GfxColor])
+popplergfxcolor="no"
+AC_COMPILE_IFELSE([
+#include <GfxState.h>
+
+int main() {
+ GfxPatch::ColorValue color = {c: {0}};
+ GfxPatch patch;
+ patch.color[[0]][[0]] = color;
+ return 0;
+}
+], [popplergfxcolor=yes])
+if test "x$popplergfxcolor" = "xyes"; then
+ AC_DEFINE(POPPLER_NEW_GFXPATCH, 1, [GfxPatch no longer uses GfxColor in >= 0.15.1])
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+CPPFLAGS=$ink_svd_CPPFLAGS
+LIBS=$ink_svd_LIBS
+
dnl ******************************
dnl Inkboard dependency checking
dnl ******************************
diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
index b37cbb777..ef31cd39f 100644
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
@@ -1874,6 +1874,9 @@ void PdfParser::doPatchMeshShFill(GfxPatchMeshShading *shading) {
void PdfParser::fillPatch(GfxPatch *patch, int nComps, int depth) {
GfxPatch patch00, patch01, patch10, patch11;
+#ifdef POPPLER_NEW_GFXPATCH
+ GfxColor color;
+#endif
double xx[4][8], yy[4][8];
double xxm, yym;
double patchColorDelta = colorDeltas[pdfPatchMeshShading-1];
@@ -1890,9 +1893,16 @@ void PdfParser::fillPatch(GfxPatch *patch, int nComps, int depth) {
> patchColorDelta) {
break;
}
+#ifdef POPPLER_NEW_GFXPATCH
+ color.c[i] = GfxColorComp(patch->color[0][0].c[i]);
+#endif
}
if (i == nComps || depth == maxDepths[pdfPatchMeshShading-1]) {
+#ifdef POPPLER_NEW_GFXPATCH
+ state->setFillColor(&color);
+#else
state->setFillColor(&patch->color[0][0]);
+#endif
state->moveTo(patch->x[0][0], patch->y[0][0]);
state->curveTo(patch->x[0][1], patch->y[0][1],
patch->x[0][2], patch->y[0][2],