summaryrefslogtreecommitdiff
path: root/Build/source/libs/xpdf/xpdf-src/splash
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2024-02-10 08:13:48 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2024-02-10 08:13:48 +0000
commit90a8327e9b036ece000905d54a316b792d891e0b (patch)
tree45536c0f5666955912b04bcd20c14a57aad31872 /Build/source/libs/xpdf/xpdf-src/splash
parent0357cc55904fda095727bb30f07b68dbf3439f8e (diff)
revert (xpdf 4.05 to xpdf 4.04)
git-svn-id: svn://tug.org/texlive/trunk@69766 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/xpdf/xpdf-src/splash')
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/Splash.cc581
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/Splash.h6
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.cc4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashClip.cc6
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashClip.h14
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.cc4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.h4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashFont.cc4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashFont.h4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.h4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.cc4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.h4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.h4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashPath.cc4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashPath.h4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.cc4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.h4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.cc4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashState.cc4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashState.h4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.cc61
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h11
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.cc4
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.h4
32 files changed, 386 insertions, 397 deletions
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/Splash.cc b/Build/source/libs/xpdf/xpdf-src/splash/Splash.cc
index 0ed8cf5d888..4afe21b4a25 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/Splash.cc
+++ b/Build/source/libs/xpdf/xpdf-src/splash/Splash.cc
@@ -8,6 +8,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include <stdlib.h>
#include <string.h>
#include <limits.h>
@@ -4926,7 +4930,7 @@ void Splash::clear(SplashColorPtr color, Guchar alpha) {
SplashError Splash::stroke(SplashPath *path) {
SplashPath *path2, *dPath;
- SplashCoord w, w2, lineDashMax, lineDashTotal;
+ SplashCoord t0, t1, t2, t3, w, w2, lineDashMax, lineDashTotal;
int lineCap, lineJoin, i;
if (debugMode) {
@@ -4938,9 +4942,6 @@ SplashError Splash::stroke(SplashPath *path) {
if (path->length == 0) {
return splashErrEmptyPath;
}
- if (pathAllOutside(path, gTrue)) {
- return splashOk;
- }
path2 = flattenPath(path, state->matrix, state->flatness);
// Compute an approximation of the transformed line width.
@@ -4952,13 +4953,15 @@ SplashError Splash::stroke(SplashPath *path) {
// [0 +/-s] [+/-s 0]
// well, and still does something reasonable for the uncommon
// case transforms.
- double t0 = splashAbs(state->matrix[0]);
- double t1 = splashAbs(state->matrix[1]);
- double t2 = splashAbs(state->matrix[2]);
- double t3 = splashAbs(state->matrix[3]);
- double t01 = t0 * t0 + t1 * t1;
- double t23 = t2 * t2 + t3 * t3;
- w = sqrt((t01 > t23) ? t01 : t23);
+ t0 = splashAbs(state->matrix[0]);
+ t1 = splashAbs(state->matrix[1]);
+ t2 = splashAbs(state->matrix[2]);
+ t3 = splashAbs(state->matrix[3]);
+ if (t0 * t3 >= t1 * t2) {
+ w = (t0 < t3) ? t0 : t3;
+ } else {
+ w = (t1 < t2) ? t1 : t2;
+ }
w2 = w * state->lineWidth;
// construct the dashed path
@@ -5053,7 +5056,7 @@ void Splash::strokeNarrow(SplashPath *path) {
xPath = new SplashXPath(path, state->matrix, state->flatness, gFalse,
state->enablePathSimplification,
- state->strokeAdjust, state->clip);
+ state->strokeAdjust);
pipeInit(&pipe, state->strokePattern,
(Guchar)splashRound(state->strokeAlpha * 255),
@@ -5071,44 +5074,6 @@ void Splash::strokeNarrow(SplashPath *path) {
x0 = splashFloor(seg->x1);
x1 = splashFloor(seg->x0);
}
-
- // With CAD-mode stroke adjustment, and a simple rectangular clip
- // region, horizontal and vertical stroke-adjusted edges that fall
- // slightly outside the clip region are adjusted back inside the
- // clip region. This avoids problems with narrow lines in
- // slightly mismatched clip rectangles, which appear to be
- // generated somewhat commonly by buggy CAD software. This is
- // similar to the code in SplashXPath::strokeAdjust() -- narrow
- // strokes aren't stroke-adjusted, so this tweak has to be done
- // here.
- if (y0 == y1 &&
- seg->y0 == seg->y1 &&
- state->clip->getIsSimple() &&
- state->strokeAdjust == splashStrokeAdjustCAD) {
- SplashCoord cy0 = state->clip->getYMin();
- SplashCoord cy1 = state->clip->getYMax();
- int cyi0 = state->clip->getYMinI(state->strokeAdjust);
- int cyi1 = state->clip->getYMaxI(state->strokeAdjust);
- if (y0 == cyi0 - 1 && cy0 - seg->y0 < 0.5) {
- y0 = y1 = y0 + 1;
- } else if (y0 == cyi1 + 1 && seg->y0 - cy1 < 0.5) {
- y0 = y1 = y0 - 1;
- }
- } else if (x0 == x1 &&
- seg->x0 == seg->x1 &&
- state->clip->getIsSimple() &&
- state->strokeAdjust == splashStrokeAdjustCAD) {
- SplashCoord cx0 = state->clip->getXMin();
- SplashCoord cx1 = state->clip->getXMax();
- int cxi0 = state->clip->getXMinI(state->strokeAdjust);
- int cxi1 = state->clip->getXMaxI(state->strokeAdjust);
- if (x0 == cxi0 - 1 && cx0 - seg->x0 < 0.5) {
- x0 = x1 = x0 + 1;
- } else if (x0 == cxi1 + 1 && seg->x0 - cx1 < 0.5) {
- x0 = x1 = x0 - 1;
- }
- }
-
if ((clipRes = state->clip->testRect(x0 <= x1 ? x0 : x1, y0,
x0 <= x1 ? x1 : x0, y1,
state->strokeAdjust))
@@ -5119,18 +5084,6 @@ void Splash::strokeNarrow(SplashPath *path) {
} else {
drawStrokeSpan(&pipe, x1, x0, y0, clipRes == splashClipAllInside);
}
- } else if (x0 == x1) {
- y = state->clip->getYMinI(state->strokeAdjust);
- if (y0 < y) {
- y0 = y;
- }
- y = state->clip->getYMaxI(state->strokeAdjust);
- if (y1 > y) {
- y1 = y;
- }
- for (y = y0; y <= y1; ++y) {
- drawStrokeSpan(&pipe, x0, x0, y, clipRes == splashClipAllInside);
- }
} else {
dxdy = seg->dxdy;
y = state->clip->getYMinI(state->strokeAdjust);
@@ -5141,7 +5094,7 @@ void Splash::strokeNarrow(SplashPath *path) {
y = state->clip->getYMaxI(state->strokeAdjust);
if (y1 > y) {
y1 = y;
- x1 = splashFloor(seg->x0 + ((SplashCoord)y1 + 1 - seg->y0) * dxdy);
+ x1 = splashFloor(seg->x0 + ((SplashCoord)y1 - seg->y0) * dxdy);
}
if (x0 <= x1) {
xa = x0;
@@ -5182,7 +5135,6 @@ void Splash::strokeNarrow(SplashPath *path) {
}
++nClipRes[clipRes];
}
-
if (nClipRes[splashClipPartial] ||
(nClipRes[splashClipAllInside] && nClipRes[splashClipAllOutside])) {
opClipRes = splashClipPartial;
@@ -5374,14 +5326,16 @@ SplashPath *Splash::makeDashedPath(SplashPath *path) {
return new SplashPath();
}
lineDashStartPhase = state->lineDashPhase;
- if (lineDashStartPhase > 0) {
- i = splashFloor(lineDashStartPhase / lineDashTotal);
- lineDashStartPhase -= lineDashTotal * i;
- } else {
- i = splashCeil(-lineDashStartPhase / lineDashTotal);
- lineDashStartPhase += lineDashTotal * i;
- }
- lineDashStartOn = !((state->lineDashLength & 1) && (i & 1));
+ if (lineDashStartPhase > lineDashTotal * 2) {
+ i = splashFloor(lineDashStartPhase / (lineDashTotal * 2));
+ lineDashStartPhase -= lineDashTotal * i * 2;
+ } else if (lineDashStartPhase < 0) {
+ i = splashCeil(-lineDashStartPhase / (lineDashTotal * 2));
+ lineDashStartPhase += lineDashTotal * i * 2;
+ }
+ i = splashFloor(lineDashStartPhase / lineDashTotal);
+ lineDashStartPhase -= (SplashCoord)i * lineDashTotal;
+ lineDashStartOn = gTrue;
lineDashStartIdx = 0;
if (lineDashStartPhase > 0) {
while (lineDashStartPhase >= state->lineDash[lineDashStartIdx]) {
@@ -5423,14 +5377,6 @@ SplashPath *Splash::makeDashedPath(SplashPath *path) {
y1 = path->pts[k+1].y;
segLen = splashDist(x0, y0, x1, y1);
- // Special case for zero-length subpath: copy the zero-length
- // segment into the dashed path so that the round line cap
- // special case is handled.
- if (j == i+1 && segLen == 0) {
- dPath->moveTo(x0, y0);
- dPath->lineTo(x0, y0);
- }
-
// process the segment
while (segLen > 0) {
@@ -5531,13 +5477,6 @@ SplashError Splash::fill(SplashPath *path, GBool eo) {
printf("fill [eo:%d]:\n", eo);
dumpPath(path);
}
- if (path->length == 0) {
- return splashErrEmptyPath;
- }
- if (pathAllOutside(path, gFalse)) {
- opClipRes = splashClipAllOutside;
- return splashOk;
- }
return fillWithPattern(path, eo, state->fillPattern, state->fillAlpha);
}
@@ -5551,11 +5490,19 @@ SplashError Splash::fillWithPattern(SplashPath *path, GBool eo,
int xMin, yMin, xMax, xMin2, xMax2, yMax, y, t;
SplashClipResult clipRes;
+ if (path->length == 0) {
+ return splashErrEmptyPath;
+ }
+ if (pathAllOutside(path)) {
+ opClipRes = splashClipAllOutside;
+ return splashOk;
+ }
+
path2 = tweakFillPath(path);
xPath = new SplashXPath(path2, state->matrix, state->flatness, gTrue,
state->enablePathSimplification,
- state->strokeAdjust, state->clip);
+ state->strokeAdjust);
if (path2 != path) {
delete path2;
}
@@ -5731,17 +5678,13 @@ SplashPath *Splash::tweakFillPath(SplashPath *path) {
return path2;
}
-// Returns true if [path] is entirely outside the current clipping
-// path. The path coordinates have not been stroke adjusted, so we
-// compare against the floating point clip rect. If [stroke] is true,
-// allow for the stroke width and miter limit.
-GBool Splash::pathAllOutside(SplashPath *path, GBool stroke) {
+GBool Splash::pathAllOutside(SplashPath *path) {
SplashCoord xMin1, yMin1, xMax1, yMax1;
SplashCoord xMin2, yMin2, xMax2, yMax2;
SplashCoord x, y;
+ int xMinI, yMinI, xMaxI, yMaxI;
int i;
- //--- compute the path's bbox in user space
xMin1 = xMax1 = path->pts[0].x;
yMin1 = yMax1 = path->pts[0].y;
for (i = 1; i < path->length; ++i) {
@@ -5757,19 +5700,6 @@ GBool Splash::pathAllOutside(SplashPath *path, GBool stroke) {
}
}
- //--- allow for stroke width and miter limit
- if (stroke && state->lineWidth > 0) {
- SplashCoord w = state->lineWidth * 0.5;
- if (state->lineJoin == splashLineJoinMiter) {
- w *= state->miterLimit;
- }
- xMin1 -= w;
- yMin1 -= w;
- xMax1 += w;
- yMax1 += w;
- }
-
- //--- convert path bbox to device space
transform(state->matrix, xMin1, yMin1, &x, &y);
xMin2 = xMax2 = x;
yMin2 = yMax2 = y;
@@ -5806,20 +5736,18 @@ GBool Splash::pathAllOutside(SplashPath *path, GBool stroke) {
} else if (y > yMax2) {
yMax2 = y;
}
+ // sanity-check the coordinates - xMinI/yMinI/xMaxI/yMaxI are
+ // 32-bit integers, so coords need to be < 2^31
+ SplashXPath::clampCoords(&xMin2, &yMin2);
+ SplashXPath::clampCoords(&xMax2, &yMax2);
+ xMinI = splashFloor(xMin2);
+ yMinI = splashFloor(yMin2);
+ xMaxI = splashFloor(xMax2);
+ yMaxI = splashFloor(yMax2);
- //--- handle zero-width strokes
- if (stroke && state->lineWidth == 0) {
- xMin1 -= 1;
- yMin1 -= 1;
- xMax1 += 1;
- yMax1 += 1;
- }
-
- //--- check against the clip rect
- return xMin2 > state->clip->getXMax() ||
- xMax2 < state->clip->getXMin() ||
- yMin2 > state->clip->getYMax() ||
- yMax2 < state->clip->getYMin();
+ return state->clip->testRect(xMinI, yMinI, xMaxI, yMaxI,
+ state->strokeAdjust) ==
+ splashClipAllOutside;
}
SplashError Splash::fillChar(SplashCoord x, SplashCoord y,
@@ -6094,9 +6022,6 @@ SplashError Splash::fillImageMask(GString *imageTag,
SplashClipResult clipRes =
state->clip->testRect(xMin, yMin, xMax - 1, yMax - 1,
state->strokeAdjust);
- if (clipRes == splashClipAllOutside) {
- return splashOk;
- }
// If the scaled mask is much wider and/or taller than the clip
// region, we use the "arbitrary" scaling path, to avoid a
// potentially very slow loop in the flips-only path (which scans
@@ -6129,88 +6054,92 @@ SplashError Splash::fillImageMask(GString *imageTag,
//--- horizontal/vertical flips only
if (flipsOnly && !veryLarge) {
- int scaledWidth = xMax - xMin;
- int scaledHeight = yMax - yMin;
- ImageMaskScaler scaler(src, srcData, w, h,
- scaledWidth, scaledHeight, interpolate, antialias);
- Guchar *tmpLine = NULL;
- if (horizFlip) {
- tmpLine = (Guchar *)gmalloc(scaledWidth);
- }
- if (vertFlip) {
- if (horizFlip) { // bottom-up, mirrored
- for (int y = 0; y < scaledHeight; ++y) {
- scaler.nextLine();
- mirrorImageMaskRow(scaler.data(), tmpLine, scaledWidth);
- (this->*drawRowFunc)(&dd, tmpLine,
- xMin, yMax - 1 - y, scaledWidth);
- }
- } else { // bottom-up
- for (int y = 0; y < scaledHeight; ++y) {
- scaler.nextLine();
- (this->*drawRowFunc)(&dd, scaler.data(),
- xMin, yMax - 1 - y, scaledWidth);
- }
+ if (clipRes != splashClipAllOutside) {
+ int scaledWidth = xMax - xMin;
+ int scaledHeight = yMax - yMin;
+ ImageMaskScaler scaler(src, srcData, w, h,
+ scaledWidth, scaledHeight, interpolate, antialias);
+ Guchar *tmpLine = NULL;
+ if (horizFlip) {
+ tmpLine = (Guchar *)gmalloc(scaledWidth);
}
- } else {
- if (horizFlip) { // top-down, mirrored
- for (int y = 0; y < scaledHeight; ++y) {
- scaler.nextLine();
- mirrorImageMaskRow(scaler.data(), tmpLine, scaledWidth);
- (this->*drawRowFunc)(&dd, tmpLine,
- xMin, yMin + y, scaledWidth);
+ if (vertFlip) {
+ if (horizFlip) { // bottom-up, mirrored
+ for (int y = 0; y < scaledHeight; ++y) {
+ scaler.nextLine();
+ mirrorImageMaskRow(scaler.data(), tmpLine, scaledWidth);
+ (this->*drawRowFunc)(&dd, tmpLine,
+ xMin, yMax - 1 - y, scaledWidth);
+ }
+ } else { // bottom-up
+ for (int y = 0; y < scaledHeight; ++y) {
+ scaler.nextLine();
+ (this->*drawRowFunc)(&dd, scaler.data(),
+ xMin, yMax - 1 - y, scaledWidth);
+ }
}
- } else { // top-down
- for (int y = 0; y < scaledHeight; ++y) {
- scaler.nextLine();
- (this->*drawRowFunc)(&dd, scaler.data(),
- xMin, yMin + y, scaledWidth);
+ } else {
+ if (horizFlip) { // top-down, mirrored
+ for (int y = 0; y < scaledHeight; ++y) {
+ scaler.nextLine();
+ mirrorImageMaskRow(scaler.data(), tmpLine, scaledWidth);
+ (this->*drawRowFunc)(&dd, tmpLine,
+ xMin, yMin + y, scaledWidth);
+ }
+ } else { // top-down
+ for (int y = 0; y < scaledHeight; ++y) {
+ scaler.nextLine();
+ (this->*drawRowFunc)(&dd, scaler.data(),
+ xMin, yMin + y, scaledWidth);
+ }
}
}
+ gfree(tmpLine);
}
- gfree(tmpLine);
//--- 90/270 rotation
} else if (rot90Only && !veryLarge) {
+ if (clipRes != splashClipAllOutside) {
- // scale the mask
- int scaledWidth = yMax - yMin;
- int scaledHeight = xMax - xMin;
- ImageMaskScaler scaler(src, srcData, w, h,
- scaledWidth, scaledHeight, interpolate, antialias);
- Guchar *scaledMask = (Guchar *)gmallocn64(scaledHeight, scaledWidth);
- Guchar *ptr = scaledMask;
- for (int y = 0; y < scaledHeight; ++y) {
- scaler.nextLine();
- memcpy(ptr, scaler.data(), scaledWidth);
- ptr += scaledWidth;
- }
-
- // draw it
- Guchar *tmpLine = (Guchar *)gmalloc(scaledHeight);
- for (int y = 0; y < scaledWidth; ++y) {
- if (vertFlip) {
- ptr = scaledMask + (scaledWidth - 1 - y);
- } else {
- ptr = scaledMask + y;
+ // scale the mask
+ int scaledWidth = yMax - yMin;
+ int scaledHeight = xMax - xMin;
+ ImageMaskScaler scaler(src, srcData, w, h,
+ scaledWidth, scaledHeight, interpolate, antialias);
+ Guchar *scaledMask = (Guchar *)gmallocn(scaledHeight, scaledWidth);
+ Guchar *ptr = scaledMask;
+ for (int y = 0; y < scaledHeight; ++y) {
+ scaler.nextLine();
+ memcpy(ptr, scaler.data(), scaledWidth);
+ ptr += scaledWidth;
}
- if (horizFlip) {
- ptr += (scaledHeight - 1) * scaledWidth;
- for (int x = 0; x < scaledHeight; ++x) {
- tmpLine[x] = *ptr;
- ptr -= scaledWidth;
+
+ // draw it
+ Guchar *tmpLine = (Guchar *)gmalloc(scaledHeight);
+ for (int y = 0; y < scaledWidth; ++y) {
+ if (vertFlip) {
+ ptr = scaledMask + (scaledWidth - 1 - y);
+ } else {
+ ptr = scaledMask + y;
}
- } else {
- for (int x = 0; x < scaledHeight; ++x) {
- tmpLine[x] = *ptr;
- ptr += scaledWidth;
+ if (horizFlip) {
+ ptr += (scaledHeight - 1) * scaledWidth;
+ for (int x = 0; x < scaledHeight; ++x) {
+ tmpLine[x] = *ptr;
+ ptr -= scaledWidth;
+ }
+ } else {
+ for (int x = 0; x < scaledHeight; ++x) {
+ tmpLine[x] = *ptr;
+ ptr += scaledWidth;
+ }
}
+ (this->*drawRowFunc)(&dd, tmpLine, xMin, yMin + y, scaledHeight);
}
- (this->*drawRowFunc)(&dd, tmpLine, xMin, yMin + y, scaledHeight);
- }
- gfree(tmpLine);
- gfree(scaledMask);
+ gfree(tmpLine);
+ gfree(scaledMask);
+ }
//--- arbitrary transform
} else {
@@ -6260,7 +6189,7 @@ SplashError Splash::fillImageMask(GString *imageTag,
// if downscaling: store the downscaled image mask
// if upscaling: store the unscaled image mask
- Guchar *scaledMask = (Guchar *)gmallocn64(scaledHeight, scaledWidth);
+ Guchar *scaledMask = (Guchar *)gmallocn(scaledHeight, scaledWidth);
if (downscaling) {
ImageMaskScaler scaler(src, srcData, w, h,
scaledWidth, scaledHeight, interpolate, antialias);
@@ -6342,7 +6271,7 @@ void Splash::drawImageMaskArbitraryNoInterp(
+ (SplashCoord)y * invMat[3] + invMat[5]);
if (xx >= 0 && xx < scaledWidth &&
yy >= 0 && yy < scaledHeight) {
- Guchar *p = scaledMask + (yy * (SplashBitmapRowSize)scaledWidth + xx);
+ Guchar *p = scaledMask + (yy * scaledWidth + xx);
Guchar *q = buf + (x - xMin);
*q = *p;
if (x < rowMin) {
@@ -6420,10 +6349,10 @@ void Splash::drawImageMaskArbitraryInterp(
if (y1 >= scaledHeight) {
y1 = scaledHeight - 1;
}
- Guchar *p00 = scaledMask + (y0 * (SplashBitmapRowSize)scaledWidth + x0);
- Guchar *p10 = scaledMask + (y0 * (SplashBitmapRowSize)scaledWidth + x1);
- Guchar *p01 = scaledMask + (y1 * (SplashBitmapRowSize)scaledWidth + x0);
- Guchar *p11 = scaledMask + (y1 * (SplashBitmapRowSize)scaledWidth + x1);
+ Guchar *p00 = scaledMask + (y0 * scaledWidth + x0);
+ Guchar *p10 = scaledMask + (y0 * scaledWidth + x1);
+ Guchar *p01 = scaledMask + (y1 * scaledWidth + x0);
+ Guchar *p11 = scaledMask + (y1 * scaledWidth + x1);
Guchar *q = buf + (x - xMin);
*q = (Guchar)(int)(sx0 * (sy0 * (int)*p00 + sy1 * (int)*p01) +
sx1 * (sy0 * (int)*p10 + sy1 * (int)*p11));
@@ -6640,9 +6569,6 @@ SplashError Splash::drawImage(GString *imageTag,
SplashClipResult clipRes =
state->clip->testRect(xMin, yMin, xMax - 1, yMax - 1,
state->strokeAdjust);
- if (clipRes == splashClipAllOutside) {
- return splashOk;
- }
// If the scaled image is much wider and/or taller than the clip
// region, we use the arbitrary transform path, to avoid a
// potentially very slow loop in the flips-only path (which scans
@@ -6690,133 +6616,136 @@ SplashError Splash::drawImage(GString *imageTag,
//--- horizontal/vertical flips only
if (flipsOnly && !veryLarge) {
- int scaledWidth = xMax - xMin;
- int scaledHeight = yMax - yMin;
- ImageScaler *scaler = getImageScaler(imageTag, src, srcData,
- w, h, nComps,
- scaledWidth, scaledHeight,
- srcMode, srcAlpha, interpolate);
- Guchar *tmpLine = NULL;
- Guchar *tmpAlphaLine = NULL;
- if (horizFlip) {
- tmpLine = (Guchar *)gmallocn(scaledWidth, nComps);
- if (srcAlpha) {
- tmpAlphaLine = (Guchar *)gmalloc(scaledWidth);
- }
- }
- if (vertFlip) {
- if (horizFlip) { // bottom-up, mirrored
- for (int y = 0; y < scaledHeight; ++y) {
- scaler->nextLine();
- mirrorImageRow(scaler->colorData(), scaler->alphaData(),
- tmpLine, tmpAlphaLine,
- scaledWidth, nComps, srcAlpha);
- (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine,
- xMin, yMax - 1 - y, scaledWidth);
- }
- } else { // bottom-up
- for (int y = 0; y < scaledHeight; ++y) {
- scaler->nextLine();
- (this->*drawRowFunc)(&dd, scaler->colorData(), scaler->alphaData(),
- xMin, yMax - 1 - y, scaledWidth);
+ if (clipRes != splashClipAllOutside) {
+ int scaledWidth = xMax - xMin;
+ int scaledHeight = yMax - yMin;
+ ImageScaler *scaler = getImageScaler(imageTag, src, srcData,
+ w, h, nComps,
+ scaledWidth, scaledHeight,
+ srcMode, srcAlpha, interpolate);
+ Guchar *tmpLine = NULL;
+ Guchar *tmpAlphaLine = NULL;
+ if (horizFlip) {
+ tmpLine = (Guchar *)gmallocn(scaledWidth, nComps);
+ if (srcAlpha) {
+ tmpAlphaLine = (Guchar *)gmalloc(scaledWidth);
}
}
- } else {
- if (horizFlip) { // top-down, mirrored
- for (int y = 0; y < scaledHeight; ++y) {
- scaler->nextLine();
- mirrorImageRow(scaler->colorData(), scaler->alphaData(),
- tmpLine, tmpAlphaLine,
- scaledWidth, nComps, srcAlpha);
- (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine,
- xMin, yMin + y, scaledWidth);
+ if (vertFlip) {
+ if (horizFlip) { // bottom-up, mirrored
+ for (int y = 0; y < scaledHeight; ++y) {
+ scaler->nextLine();
+ mirrorImageRow(scaler->colorData(), scaler->alphaData(),
+ tmpLine, tmpAlphaLine,
+ scaledWidth, nComps, srcAlpha);
+ (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine,
+ xMin, yMax - 1 - y, scaledWidth);
+ }
+ } else { // bottom-up
+ for (int y = 0; y < scaledHeight; ++y) {
+ scaler->nextLine();
+ (this->*drawRowFunc)(&dd, scaler->colorData(), scaler->alphaData(),
+ xMin, yMax - 1 - y, scaledWidth);
+ }
}
- } else { // top-down
- for (int y = 0; y < scaledHeight; ++y) {
- scaler->nextLine();
- (this->*drawRowFunc)(&dd, scaler->colorData(), scaler->alphaData(),
- xMin, yMin + y, scaledWidth);
+ } else {
+ if (horizFlip) { // top-down, mirrored
+ for (int y = 0; y < scaledHeight; ++y) {
+ scaler->nextLine();
+ mirrorImageRow(scaler->colorData(), scaler->alphaData(),
+ tmpLine, tmpAlphaLine,
+ scaledWidth, nComps, srcAlpha);
+ (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine,
+ xMin, yMin + y, scaledWidth);
+ }
+ } else { // top-down
+ for (int y = 0; y < scaledHeight; ++y) {
+ scaler->nextLine();
+ (this->*drawRowFunc)(&dd, scaler->colorData(), scaler->alphaData(),
+ xMin, yMin + y, scaledWidth);
+ }
}
}
+ gfree(tmpLine);
+ gfree(tmpAlphaLine);
+ delete scaler;
}
- gfree(tmpLine);
- gfree(tmpAlphaLine);
- delete scaler;
//--- 90/270 rotation
} else if (rot90Only && !veryLarge) {
-
- // scale the image
- int scaledWidth = yMax - yMin;
- int scaledHeight = xMax - xMin;
- Guchar *scaledColor, *scaledAlpha;
- GBool freeScaledImage;
- getScaledImage(imageTag, src, srcData, w, h, nComps,
- scaledWidth, scaledHeight, srcMode, srcAlpha, interpolate,
- &scaledColor, &scaledAlpha, &freeScaledImage);
-
- // draw it
- Guchar *tmpLine = (Guchar *)gmallocn(scaledHeight, nComps);
- Guchar *tmpAlphaLine = NULL;
- if (srcAlpha) {
- tmpAlphaLine = (Guchar *)gmalloc(scaledHeight);
- }
- for (int y = 0; y < scaledWidth; ++y) {
- Guchar *ptr = NULL;
- Guchar *alphaPtr = NULL;
- if (vertFlip) {
- ptr = scaledColor + ((SplashBitmapRowSize)scaledWidth - 1 - y) * nComps;
- if (srcAlpha) {
- alphaPtr = scaledAlpha + (scaledWidth - 1 - y);
- }
- } else {
- ptr = scaledColor + y * nComps;
- if (srcAlpha) {
- alphaPtr = scaledAlpha + y;
- }
+ if (clipRes != splashClipAllOutside) {
+
+ // scale the image
+ int scaledWidth = yMax - yMin;
+ int scaledHeight = xMax - xMin;
+ Guchar *scaledColor, *scaledAlpha;
+ GBool freeScaledImage;
+ getScaledImage(imageTag, src, srcData, w, h, nComps,
+ scaledWidth, scaledHeight, srcMode, srcAlpha, interpolate,
+ &scaledColor, &scaledAlpha, &freeScaledImage);
+
+ // draw it
+ Guchar *tmpLine = (Guchar *)gmallocn(scaledHeight, nComps);
+ Guchar *tmpAlphaLine = NULL;
+ if (srcAlpha) {
+ tmpAlphaLine = (Guchar *)gmalloc(scaledHeight);
}
- if (horizFlip) {
- ptr += (scaledHeight - 1) * (SplashBitmapRowSize)scaledWidth * nComps;
- Guchar *q = tmpLine;
- for (int x = 0; x < scaledHeight; ++x) {
- for (int i = 0; i < nComps; ++i) {
- *q++ = ptr[i];
+ for (int y = 0; y < scaledWidth; ++y) {
+ Guchar *ptr, *alphaPtr;
+ if (vertFlip) {
+ ptr = scaledColor + (scaledWidth - 1 - y) * nComps;
+ if (srcAlpha) {
+ alphaPtr = scaledAlpha + (scaledWidth - 1 - y);
+ }
+ } else {
+ ptr = scaledColor + y * nComps;
+ if (srcAlpha) {
+ alphaPtr = scaledAlpha + y;
}
- ptr -= scaledWidth * nComps;
}
- if (srcAlpha) {
- alphaPtr += (scaledHeight - 1) * (SplashBitmapRowSize)scaledWidth;
- q = tmpAlphaLine;
+ if (horizFlip) {
+ ptr += (scaledHeight - 1) * scaledWidth * nComps;
+ Guchar *q = tmpLine;
for (int x = 0; x < scaledHeight; ++x) {
- *q++ = *alphaPtr;
- alphaPtr -= scaledWidth;
+ for (int i = 0; i < nComps; ++i) {
+ *q++ = ptr[i];
+ }
+ ptr -= scaledWidth * nComps;
}
- }
- } else {
- Guchar *q = tmpLine;
- for (int x = 0; x < scaledHeight; ++x) {
- for (int i = 0; i < nComps; ++i) {
- *q++ = ptr[i];
+ if (srcAlpha) {
+ alphaPtr += (scaledHeight - 1) * scaledWidth;
+ q = tmpAlphaLine;
+ for (int x = 0; x < scaledHeight; ++x) {
+ *q++ = *alphaPtr;
+ alphaPtr -= scaledWidth;
+ }
}
- ptr += scaledWidth * nComps;
- }
- if (srcAlpha) {
- q = tmpAlphaLine;
+ } else {
+ Guchar *q = tmpLine;
for (int x = 0; x < scaledHeight; ++x) {
- *q++ = *alphaPtr;
- alphaPtr += scaledWidth;
+ for (int i = 0; i < nComps; ++i) {
+ *q++ = ptr[i];
+ }
+ ptr += scaledWidth * nComps;
+ }
+ if (srcAlpha) {
+ q = tmpAlphaLine;
+ for (int x = 0; x < scaledHeight; ++x) {
+ *q++ = *alphaPtr;
+ alphaPtr += scaledWidth;
+ }
}
}
+ (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine,
+ xMin, yMin + y, scaledHeight);
}
- (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine,
- xMin, yMin + y, scaledHeight);
- }
- gfree(tmpLine);
- gfree(tmpAlphaLine);
- if (freeScaledImage) {
- gfree(scaledColor);
- gfree(scaledAlpha);
+ gfree(tmpLine);
+ gfree(tmpAlphaLine);
+ if (freeScaledImage) {
+ gfree(scaledColor);
+ gfree(scaledAlpha);
+ }
}
//--- arbitrary transform
@@ -6922,9 +6851,9 @@ ImageScaler *Splash::getImageScaler(GString *imageTag,
} else {
lineSize = -1;
}
- imageCache->colorData = (Guchar *)gmallocn64(scaledHeight, lineSize);
+ imageCache->colorData = (Guchar *)gmallocn(scaledHeight, lineSize);
if (srcAlpha) {
- imageCache->alphaData = (Guchar *)gmallocn64(scaledHeight, scaledWidth);
+ imageCache->alphaData = (Guchar *)gmallocn(scaledHeight, scaledWidth);
}
return new SavingImageScaler(src, srcData,
w, h, nComps, srcAlpha,
@@ -6965,9 +6894,9 @@ void Splash::getScaledImage(GString *imageTag,
} else {
lineSize = -1;
}
- *scaledColor = (Guchar *)gmallocn64(scaledHeight, lineSize);
+ *scaledColor = (Guchar *)gmallocn(scaledHeight, lineSize);
if (srcAlpha) {
- *scaledAlpha = (Guchar *)gmallocn64(scaledHeight, scaledWidth);
+ *scaledAlpha = (Guchar *)gmallocn(scaledHeight, scaledWidth);
} else {
*scaledAlpha = NULL;
}
@@ -7009,9 +6938,9 @@ void Splash::getScaledImage(GString *imageTag,
} else {
lineSize = -1;
}
- imageCache->colorData = (Guchar *)gmallocn64(scaledHeight, lineSize);
+ imageCache->colorData = (Guchar *)gmallocn(scaledHeight, lineSize);
if (srcAlpha) {
- imageCache->alphaData = (Guchar *)gmallocn64(scaledHeight, scaledWidth);
+ imageCache->alphaData = (Guchar *)gmallocn(scaledHeight, scaledWidth);
}
if (scaledWidth == w && scaledHeight == h) {
Guchar *colorPtr = imageCache->colorData;
@@ -7092,15 +7021,13 @@ void Splash::drawImageArbitraryNoInterp(Guchar *scaledColor,
+ (SplashCoord)y * invMat[3] + invMat[5]);
if (xx >= 0 && xx < scaledWidth &&
yy >= 0 && yy < scaledHeight) {
- Guchar *p = scaledColor +
- (yy * (SplashBitmapRowSize)scaledWidth + xx) * nComps;
+ Guchar *p = scaledColor + (yy * scaledWidth + xx) * nComps;
Guchar *q = colorBuf + (x - xMin) * nComps;
for (int i = 0; i < nComps; ++i) {
*q++ = *p++;
}
if (srcAlpha) {
- alphaBuf[x - xMin] =
- scaledAlpha[yy * (SplashBitmapRowSize)scaledWidth + xx];
+ alphaBuf[x - xMin] = scaledAlpha[yy * scaledWidth + xx];
}
if (x < rowMin) {
rowMin = x;
@@ -7184,24 +7111,20 @@ void Splash::drawImageArbitraryInterp(Guchar *scaledColor, Guchar *scaledAlpha,
if (y1 >= scaledHeight) {
y1 = scaledHeight - 1;
}
- Guchar *p00 = scaledColor +
- (y0 * (SplashBitmapRowSize)scaledWidth + x0) * nComps;
- Guchar *p10 = scaledColor +
- (y0 * (SplashBitmapRowSize)scaledWidth + x1) * nComps;
- Guchar *p01 = scaledColor +
- (y1 * (SplashBitmapRowSize)scaledWidth + x0) * nComps;
- Guchar *p11 = scaledColor +
- (y1 * (SplashBitmapRowSize)scaledWidth + x1) * nComps;
+ Guchar *p00 = scaledColor + (y0 * scaledWidth + x0) * nComps;
+ Guchar *p10 = scaledColor + (y0 * scaledWidth + x1) * nComps;
+ Guchar *p01 = scaledColor + (y1 * scaledWidth + x0) * nComps;
+ Guchar *p11 = scaledColor + (y1 * scaledWidth + x1) * nComps;
Guchar *q = colorBuf + (x - xMin) * nComps;
for (int i = 0; i < nComps; ++i) {
*q++ = (Guchar)(int)(sx0 * (sy0 * (int)*p00++ + sy1 * (int)*p01++) +
sx1 * (sy0 * (int)*p10++ + sy1 * (int)*p11++));
}
if (srcAlpha) {
- p00 = scaledAlpha + (y0 * (SplashBitmapRowSize)scaledWidth + x0);
- p10 = scaledAlpha + (y0 * (SplashBitmapRowSize)scaledWidth + x1);
- p01 = scaledAlpha + (y1 * (SplashBitmapRowSize)scaledWidth + x0);
- p11 = scaledAlpha + (y1 * (SplashBitmapRowSize)scaledWidth + x1);
+ p00 = scaledAlpha + (y0 * scaledWidth + x0);
+ p10 = scaledAlpha + (y0 * scaledWidth + x1);
+ p01 = scaledAlpha + (y1 * scaledWidth + x0);
+ p11 = scaledAlpha + (y1 * scaledWidth + x1);
q = alphaBuf + (x - xMin);
*q = (Guchar)(int)(sx0 * (sy0 * (int)*p00 + sy1 * (int)*p01) +
sx1 * (sy0 * (int)*p10 + sy1 * (int)*p11));
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/Splash.h b/Build/source/libs/xpdf/xpdf-src/splash/Splash.h
index f79a948e045..9622b07fc27 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/Splash.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/Splash.h
@@ -11,6 +11,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
#include "SplashTypes.h"
#include "SplashClip.h"
@@ -421,7 +425,7 @@ private:
SplashError fillWithPattern(SplashPath *path, GBool eo,
SplashPattern *pattern, SplashCoord alpha);
SplashPath *tweakFillPath(SplashPath *path);
- GBool pathAllOutside(SplashPath *path, GBool stroke);
+ GBool pathAllOutside(SplashPath *path);
SplashError fillGlyph2(int x0, int y0, SplashGlyphBitmap *glyph);
void getImageBounds(SplashCoord xyMin, SplashCoord xyMax,
int *xyMinI, int *xyMaxI);
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.cc
index 3870f7a4808..db341d7c733 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.cc
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.cc
@@ -8,6 +8,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include <stdio.h>
#include <limits.h>
#include "gmem.h"
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h
index db9f2f4b2cb..54975a377a2 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h
@@ -11,6 +11,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
#include <stdio.h>
#include <limits.h>
// older compilers won't define SIZE_MAX in stdint.h without this
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.cc
index 4b491aa019d..bf7b802cf0d 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.cc
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.cc
@@ -8,6 +8,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include <stdlib.h>
#include <string.h>
#include "gmem.h"
@@ -206,7 +210,7 @@ SplashError SplashClip::clipToPath(SplashPath *path, SplashCoord *matrix,
xPath = new SplashXPath(path, matrix, flatness, gTrue,
enablePathSimplification,
- strokeAdjust, NULL);
+ strokeAdjust);
// check for an empty path
if (xPath->length == 0) {
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.h
index 093c65c12c4..fb86ed8fd72 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.h
@@ -11,6 +11,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
#include "SplashTypes.h"
#include "SplashMath.h"
@@ -96,9 +100,6 @@ public:
// Get the number of arbitrary paths used by the clip region.
int getNumPaths();
- // Return true if the clip path is a simple rectangle.
- GBool getIsSimple() { return isSimple; }
-
private:
SplashClip(SplashClip *clip);
@@ -109,11 +110,10 @@ private:
hardXMax, hardYMax; // [hardXMin, hardXMax), [hardYMin, hardYMax)
SplashCoord xMin, yMin, // current clip bounding rectangle
- xMax, yMax;
-
- int xMinI, yMinI, // integer clip bounding rectangle
- xMaxI, yMaxI; // (these coordinates are adjusted if
+ xMax, yMax; // (these coordinates may be adjusted if
// stroke adjustment is enabled)
+
+ int xMinI, yMinI, xMaxI, yMaxI;
GBool intBoundsValid; // true if xMinI, etc. are valid
GBool intBoundsStrokeAdjust; // value of strokeAdjust used to compute
// xMinI, etc.
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.cc
index 79849e63cfe..91481444bca 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.cc
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.cc
@@ -10,6 +10,10 @@
#if HAVE_FREETYPE_H
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include <ft2build.h>
#include FT_OUTLINE_H
#include FT_SIZES_H
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.h
index f7254b23d9f..ac08b007747 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.h
@@ -13,6 +13,10 @@
#if HAVE_FREETYPE_H
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
#include <ft2build.h>
#include FT_FREETYPE_H
#include "SplashFont.h"
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc
index 4b995869f24..33939541051 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc
@@ -10,6 +10,10 @@
#if HAVE_FREETYPE_H
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include <stdio.h>
#ifndef _WIN32
# include <unistd.h>
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h
index e6612e13a18..24db3c6cdba 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h
@@ -13,6 +13,10 @@
#if HAVE_FREETYPE_H
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
#include <ft2build.h>
#include FT_FREETYPE_H
#include "gtypes.h"
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc
index b76e5430aef..b5fd02af4a0 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc
@@ -10,6 +10,10 @@
#if HAVE_FREETYPE_H
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include "gmem.h"
#include "gmempp.h"
#include "GString.h"
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h
index 3720d0501ac..3a6b9b7aa43 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h
@@ -13,6 +13,10 @@
#if HAVE_FREETYPE_H
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
#include <ft2build.h>
#include FT_FREETYPE_H
#include "SplashFontFile.h"
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.cc
index eb02c67664c..2fcd83d1266 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.cc
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.cc
@@ -8,6 +8,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include <string.h>
#include "gmem.h"
#include "gmempp.h"
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.h
index 3612924a6a4..2bb96545867 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.h
@@ -11,6 +11,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
#include "gtypes.h"
#include "SplashTypes.h"
#include "SplashMath.h"
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc
index 70338a84666..81afe0cd914 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc
@@ -8,6 +8,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include <stdlib.h>
#include <stdio.h>
#ifndef _WIN32
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.h
index 99d7b1b2b94..59adb95858a 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.h
@@ -11,6 +11,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
#include "gtypes.h"
class GString;
class GList;
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.cc
index 8d846a9376a..2d260e38239 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.cc
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.cc
@@ -8,6 +8,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include <stdio.h>
#ifndef _WIN32
# include <unistd.h>
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.h
index 72c51b84014..133e6ab87dc 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.h
@@ -11,6 +11,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
#include "gtypes.h"
#include "SplashTypes.h"
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc
index 2c03cf10e83..27f52031d50 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc
@@ -8,6 +8,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include "gmempp.h"
#include "SplashFontFileID.h"
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.h
index c4a0d7efa9d..384018a2f3a 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.h
@@ -11,6 +11,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
#include "gtypes.h"
//------------------------------------------------------------------------
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.cc
index ff993d5a8ac..792166715e5 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.cc
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.cc
@@ -8,6 +8,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include <string.h>
#include "gmem.h"
#include "gmempp.h"
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.h
index 648b3208073..b5732b8b408 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.h
@@ -11,6 +11,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
#include "SplashTypes.h"
//------------------------------------------------------------------------
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.cc
index 344a449830e..0c5b5093fd5 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.cc
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.cc
@@ -8,6 +8,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include "gmempp.h"
#include "SplashMath.h"
#include "SplashScreen.h"
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.h
index 45a9dcdc6ba..fcbe21d31cb 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.h
@@ -11,6 +11,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
#include "SplashTypes.h"
class SplashScreen;
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.cc
index 04286836cc2..9993edc2a38 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.cc
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.cc
@@ -8,6 +8,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include <stdlib.h>
#include <string.h>
#if HAVE_STD_SORT
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h
index 9edf8e88e7a..560e2759d82 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h
@@ -11,6 +11,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
#include "SplashTypes.h"
//------------------------------------------------------------------------
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashState.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashState.cc
index e0139fda393..7fc510439b1 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashState.cc
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashState.cc
@@ -8,6 +8,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include <string.h>
#include "gmem.h"
#include "gmempp.h"
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashState.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashState.h
index 695db28b610..be64b472333 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashState.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashState.h
@@ -11,6 +11,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
#include "SplashTypes.h"
class SplashPattern;
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.cc
index 72e8afd4706..4c77765723e 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.cc
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.cc
@@ -8,6 +8,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include <stdlib.h>
#include <string.h>
#if HAVE_STD_SORT
@@ -17,7 +21,6 @@
#include "gmempp.h"
#include "SplashMath.h"
#include "SplashPath.h"
-#include "SplashClip.h"
#include "SplashXPath.h"
//------------------------------------------------------------------------
@@ -80,8 +83,7 @@ void SplashXPath::clampCoords(SplashCoord *x, SplashCoord *y) {
SplashXPath::SplashXPath(SplashPath *path, SplashCoord *matrix,
SplashCoord flatness, GBool closeSubpaths,
GBool simplify,
- SplashStrokeAdjustMode strokeAdjMode,
- SplashClip *clip) {
+ SplashStrokeAdjustMode strokeAdjMode) {
SplashXPathPoint *pts;
SplashCoord x0, y0, x1, y1, x2, y2, x3, y3, xsp, ysp, t;
int curSubpath, firstSegInSubpath, i;
@@ -97,7 +99,7 @@ SplashXPath::SplashXPath(SplashPath *path, SplashCoord *matrix,
//--- do stroke adjustment
if (path->hints) {
adjusted = strokeAdjust(pts, path->hints, path->hintsLength,
- strokeAdjMode, clip);
+ strokeAdjMode);
} else {
adjusted = gFalse;
}
@@ -225,8 +227,7 @@ SplashXPath::SplashXPath(SplashPath *path, SplashCoord *matrix,
GBool SplashXPath::strokeAdjust(SplashXPathPoint *pts,
SplashPathHint *hints, int nHints,
- SplashStrokeAdjustMode strokeAdjMode,
- SplashClip *clip) {
+ SplashStrokeAdjustMode strokeAdjMode) {
SplashXPathAdjust *adjusts, *adjust;
SplashPathHint *hint;
SplashCoord x0, y0, x1, y1, x2, y2, x3, y3;
@@ -237,28 +238,6 @@ GBool SplashXPath::strokeAdjust(SplashXPathPoint *pts,
adjusted = gFalse;
- // With CAD-mode stroke adjustment, and a simple rectangular clip
- // region, stroke-adjusted edges that fall slightly outside the clip
- // region are adjusted back inside the clip region. This avoids
- // problems with narrow lines in slightly mismatched clip
- // rectangles, which appear to be generated somewhat commonly by
- // buggy CAD software. (Note: [clip] is NULL when called to build a
- // clip path.)
- GBool clipTweak = clip && clip->getIsSimple() &&
- strokeAdjMode == splashStrokeAdjustCAD;
- SplashCoord cx0 = 0, cx1 = 0, cy0 = 0, cy1 = 0;
- int cxi0 = 0, cxi1 = 0, cyi0 = 0, cyi1 = 0;
- if (clipTweak) {
- cx0 = clip->getXMin();
- cx1 = clip->getXMax();
- cy0 = clip->getYMin();
- cy1 = clip->getYMax();
- cxi0 = clip->getXMinI(strokeAdjMode);
- cxi1 = clip->getXMaxI(strokeAdjMode);
- cyi0 = clip->getYMinI(strokeAdjMode);
- cyi1 = clip->getYMaxI(strokeAdjMode);
- }
-
// set up the stroke adjustment hints
adjusts = (SplashXPathAdjust *)gmallocn(nHints, sizeof(SplashXPathAdjust));
for (i = 0; i < nHints; ++i) {
@@ -303,32 +282,6 @@ GBool SplashXPath::strokeAdjust(SplashXPathPoint *pts,
adjusts[i].x1a = adj1 - d;
adjusts[i].x1b = adj1 + d;
splashStrokeAdjust(adj0, adj1, &xi0, &xi1, strokeAdjMode, w);
- if (clipTweak) {
- SplashCoord c0, c1;
- int ci0, ci1;
- if (adjusts[i].vert) {
- c0 = cx0;
- c1 = cx1;
- ci0 = cxi0;
- ci1 = cxi1;
- } else {
- c0 = cy0;
- c1 = cy1;
- ci0 = cyi0;
- ci1 = cyi1;
- }
- if (adj0 < c0 && c0 < adj1 && adj1 < c1 &&
- adj1 - c0 > (adj1 - adj0) * 0.2 &&
- xi1 <= ci0) {
- xi0 = ci0;
- xi1 = xi0 + 1;
- } else if (c0 < adj0 && adj0 < c1 && c1 < adj1 &&
- c1 - adj0 > (adj1 - adj0) * 0.2 &&
- ci1 < xi0) {
- xi0 = ci1;
- xi1 = ci1 + 1;
- }
- }
adjusts[i].x0 = (SplashCoord)xi0;
// the "minus epsilon" thing here is needed when vector
// antialiasing is turned off -- otherwise stroke adjusted lines
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h
index 3318866a16e..82d7889c447 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h
@@ -11,10 +11,13 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
#include "SplashTypes.h"
class SplashPath;
-class SplashClip;
struct SplashXPathPoint;
struct SplashPathHint;
@@ -91,8 +94,7 @@ public:
// subpaths.
SplashXPath(SplashPath *path, SplashCoord *matrix,
SplashCoord flatness, GBool closeSubpaths,
- GBool simplify, SplashStrokeAdjustMode strokeAdjMode,
- SplashClip *clip);
+ GBool simplify, SplashStrokeAdjustMode strokeAdjMode);
// Copy an expanded path.
SplashXPath *copy() { return new SplashXPath(this); }
@@ -112,8 +114,7 @@ private:
SplashCoord *xo, SplashCoord *yo);
GBool strokeAdjust(SplashXPathPoint *pts,
SplashPathHint *hints, int nHints,
- SplashStrokeAdjustMode strokeAdjMode,
- SplashClip *clip);
+ SplashStrokeAdjustMode strokeAdjMode);
void grow(int nSegs);
void addCurve(SplashCoord x0, SplashCoord y0,
SplashCoord x1, SplashCoord y1,
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.cc
index 6477abf85c3..3f167b8b311 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.cc
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.cc
@@ -8,6 +8,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
#include <stdlib.h>
#include <string.h>
#if HAVE_STD_SORT
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.h
index decfc50aa7c..39cc0eb022a 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.h
@@ -11,6 +11,10 @@
#include <aconf.h>
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
#include "SplashTypes.h"
#include "SplashXPath.h"