[poppler] Branch 'xpdf303merge' - splash/Splash.cc splash/SplashXPath.cc splash/SplashXPath.h
Albert Astals Cid
aacid at kemper.freedesktop.org
Sun Sep 11 13:06:47 PDT 2011
splash/Splash.cc | 6 +-----
splash/SplashXPath.cc | 34 ++++------------------------------
splash/SplashXPath.h | 13 ++++---------
3 files changed, 9 insertions(+), 44 deletions(-)
New commits:
commit 59442e5994f3b94d5221cbc90f79fad235fe2611
Author: Albert Astals Cid <aacid at kde.org>
Date: Sun Sep 11 22:10:41 2011 +0200
xpdf303: Remove flags that were never used
diff --git a/splash/Splash.cc b/splash/Splash.cc
index 87dea06..2556652 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -3983,13 +3983,9 @@ void Splash::dumpXPath(SplashXPath *path) {
int i;
for (i = 0; i < path->length; ++i) {
- printf(" %4d: x0=%8.2f y0=%8.2f x1=%8.2f y1=%8.2f %s%s%s%s%s%s%s\n",
+ printf(" %4d: x0=%8.2f y0=%8.2f x1=%8.2f y1=%8.2f %s%s%s\n",
i, (double)path->segs[i].x0, (double)path->segs[i].y0,
(double)path->segs[i].x1, (double)path->segs[i].y1,
- (path->segs[i].flags & splashXPathFirst) ? "F" : " ",
- (path->segs[i].flags & splashXPathLast) ? "L" : " ",
- (path->segs[i].flags & splashXPathEnd0) ? "0" : " ",
- (path->segs[i].flags & splashXPathEnd1) ? "1" : " ",
(path->segs[i].flags & splashXPathHoriz) ? "H" : " ",
(path->segs[i].flags & splashXPathVert) ? "V" : " ",
(path->segs[i].flags & splashXPathFlip) ? "P" : " ");
diff --git a/splash/SplashXPath.cc b/splash/SplashXPath.cc
index d3ed03b..c3cb62c 100644
--- a/splash/SplashXPath.cc
+++ b/splash/SplashXPath.cc
@@ -192,15 +192,7 @@ SplashXPath::SplashXPath(SplashPath *path, SplashCoord *matrix,
} else {
x1 = pts[i].x;
y1 = pts[i].y;
- addSegment(x0, y0, x1, y1,
- path->flags[i-1] & splashPathFirst,
- path->flags[i] & splashPathLast,
- !closeSubpaths &&
- (path->flags[i-1] & splashPathFirst) &&
- !(path->flags[i-1] & splashPathClosed),
- !closeSubpaths &&
- (path->flags[i] & splashPathLast) &&
- !(path->flags[i] & splashPathClosed));
+ addSegment(x0, y0, x1, y1);
x0 = x1;
y0 = y1;
++i;
@@ -211,8 +203,7 @@ SplashXPath::SplashXPath(SplashPath *path, SplashCoord *matrix,
(path->flags[i-1] & splashPathLast) &&
(pts[i-1].x != pts[curSubpath].x ||
pts[i-1].y != pts[curSubpath].y)) {
- addSegment(x0, y0, xsp, ysp,
- gFalse, gTrue, gFalse, gFalse);
+ addSegment(x0, y0, xsp, ysp);
}
}
}
@@ -329,11 +320,7 @@ void SplashXPath::addCurve(SplashCoord x0, SplashCoord y0,
// if the curve is flat enough, or no more subdivisions are
// allowed, add the straight line segment
if (p2 - p1 == 1 || (d1 <= flatness2 && d2 <= flatness2)) {
- addSegment(xl0, yl0, xr3, yr3,
- p1 == 0 && first,
- p2 == splashMaxCurveSplits && last,
- p1 == 0 && end0,
- p2 == splashMaxCurveSplits && end1);
+ addSegment(xl0, yl0, xr3, yr3);
p1 = p2;
// otherwise, subdivide the curve
@@ -364,26 +351,13 @@ void SplashXPath::addCurve(SplashCoord x0, SplashCoord y0,
}
void SplashXPath::addSegment(SplashCoord x0, SplashCoord y0,
- SplashCoord x1, SplashCoord y1,
- GBool first, GBool last, GBool end0, GBool end1) {
+ SplashCoord x1, SplashCoord y1) {
grow(1);
segs[length].x0 = x0;
segs[length].y0 = y0;
segs[length].x1 = x1;
segs[length].y1 = y1;
segs[length].flags = 0;
- if (first) {
- segs[length].flags |= splashXPathFirst;
- }
- if (last) {
- segs[length].flags |= splashXPathLast;
- }
- if (end0) {
- segs[length].flags |= splashXPathEnd0;
- }
- if (end1) {
- segs[length].flags |= splashXPathEnd1;
- }
if (y1 == y0) {
segs[length].dxdy = segs[length].dydx = 0;
segs[length].flags |= splashXPathHoriz;
diff --git a/splash/SplashXPath.h b/splash/SplashXPath.h
index 6b0dd4f..db06978 100644
--- a/splash/SplashXPath.h
+++ b/splash/SplashXPath.h
@@ -32,15 +32,11 @@ struct SplashXPathSeg {
Guint flags;
};
-#define splashXPathFirst 0x01 // first segment of a subpath
-#define splashXPathLast 0x02 // last segment of a subpath
-#define splashXPathEnd0 0x04 // first endpoint is end of an open subpath
-#define splashXPathEnd1 0x08 // second endpoint is end of an open subpath
-#define splashXPathHoriz 0x10 // segment is vertical (y0 == y1)
+#define splashXPathHoriz 0x01 // segment is vertical (y0 == y1)
// (dxdy is undef)
-#define splashXPathVert 0x20 // segment is horizontal (x0 == x1)
+#define splashXPathVert 0x02 // segment is horizontal (x0 == x1)
// (dydx is undef)
-#define splashXPathFlip 0x40 // y0 > y1
+#define splashXPathFlip 0x04 // y0 > y1
//------------------------------------------------------------------------
// SplashXPath
@@ -83,8 +79,7 @@ protected:
SplashCoord flatness,
GBool first, GBool last, GBool end0, GBool end1);
void addSegment(SplashCoord x0, SplashCoord y0,
- SplashCoord x1, SplashCoord y1,
- GBool first, GBool last, GBool end0, GBool end1);
+ SplashCoord x1, SplashCoord y1);
SplashXPathSeg *segs;
int length, size; // length and size of segs array
More information about the poppler
mailing list