diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-06-20 16:45:12 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-06-20 16:45:12 +0200 |
commit | 6213b8145772d3dc584907a544f6c46b8cef74e2 (patch) | |
tree | 4c1902793bb78511e63c09cbe92f9eda6b3d7237 /src/gui/painting | |
parent | 75e9c7d6bc662e62e9ce8b641588183992c1e8bf (diff) | |
parent | 25739bebba0343a8b35775a073c49f0fba080762 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
tools/configure/configureapp.cpp
Change-Id: I3092bd3276af14304b7ab3ae1e1cc05d11cdede0
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qcosmeticstroker.cpp | 42 | ||||
-rw-r--r-- | src/gui/painting/qcosmeticstroker_p.h | 2 | ||||
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 16 | ||||
-rw-r--r-- | src/gui/painting/qdrawhelper_p.h | 4 | ||||
-rw-r--r-- | src/gui/painting/qpolygon.cpp | 12 | ||||
-rw-r--r-- | src/gui/painting/qrasterizer.cpp | 61 | ||||
-rw-r--r-- | src/gui/painting/qregion.cpp | 142 |
7 files changed, 159 insertions, 120 deletions
diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index 0f3cde3efd..39f64224f0 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -133,10 +133,15 @@ struct NoDasher { }; +/* + * The return value is the result of the clipLine() call performed at the start + * of each of the two functions, aka "false" means completely outside the devices + * rect. + */ template<DrawPixel drawPixel, class Dasher> -static void drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); +static bool drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); template<DrawPixel drawPixel, class Dasher> -static void drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); +static bool drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); inline void drawPixel(QCosmeticStroker *stroker, int x, int y, int coverage) { @@ -602,17 +607,20 @@ void QCosmeticStroker::drawPath(const QVectorPath &path) caps |= CapEnd; QCosmeticStroker::Point last = this->lastPixel; - stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); + bool unclipped = stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); /* fix for gaps in polylines with fastpen and aliased in a sequence of points with small distances: if current point p2 has been dropped - out, keep last non dropped point p. */ - if (fastPenAliased) { - if (last.x != lastPixel.x || last.y != lastPixel.y || - points == begin + 2 || points == end - 2 ) { - { - p = p2; - } + out, keep last non dropped point p. + + However, if the line was completely outside the devicerect, we + still need to update p to avoid drawing the line after this one from + a bad starting position. + */ + if (fastPenAliased && unclipped) { + if (last.x != lastPixel.x || last.y != lastPixel.y + || points == begin + 2 || points == end - 2) { + p = p2; } } else { p = p2; @@ -720,10 +728,10 @@ static inline void capAdjust(int caps, int &x1, int &x2, int &y, int yinc) the drawing shifts from horizontal to vertical or back. */ template<DrawPixel drawPixel, class Dasher> -static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) +static bool drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) { if (stroker->clipLine(rx1, ry1, rx2, ry2)) - return; + return false; const int half = stroker->legacyRounding ? 31 : 0; int x1 = toF26Dot6(rx1) + half; @@ -813,7 +821,7 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, } else { // horizontal if (!dx) - return; + return true; QCosmeticStroker::Direction dir = QCosmeticStroker::LeftToRight; @@ -886,14 +894,15 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, } } stroker->lastPixel = last; + return true; } template<DrawPixel drawPixel, class Dasher> -static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) +static bool drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) { if (stroker->clipLine(rx1, ry1, rx2, ry2)) - return; + return false; int x1 = toF26Dot6(rx1); int y1 = toF26Dot6(ry1); @@ -967,7 +976,7 @@ static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx } else { // horizontal if (!dx) - return; + return true; int yinc = F16Dot16FixedDiv(dy, dx); @@ -1029,6 +1038,7 @@ static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx drawPixel(stroker, x, (y>>16) + 1, alpha * alphaEnd >> 6); } } + return true; } QT_END_NAMESPACE diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h index 05c8a2b0cf..5fc3559da4 100644 --- a/src/gui/painting/qcosmeticstroker_p.h +++ b/src/gui/painting/qcosmeticstroker_p.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE class QCosmeticStroker; -typedef void (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); +typedef bool (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); class QCosmeticStroker { diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 3084c8c4c9..c79e8babb6 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -1121,13 +1121,13 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c fx &= fixed_scale - 1; Q_ASSERT((fx >> 16) == 0); while (b < end) { - register int x1 = (fx >> 16); - register int x2 = x1 + 1; + int x1 = (fx >> 16); + int x2 = x1 + 1; Q_ASSERT(x1 >= 0); Q_ASSERT(x2 < count); - register int distx = (fx & 0x0000ffff) >> 8; - register int idistx = 256 - distx; + int distx = (fx & 0x0000ffff) >> 8; + int idistx = 256 - distx; int rb = ((intermediate_buffer[0][x1] * idistx + intermediate_buffer[0][x2] * distx) >> 8) & 0xff00ff; int ag = (intermediate_buffer[1][x1] * idistx + intermediate_buffer[1][x2] * distx) & 0xff00ff00; *b = rb | ag; @@ -1533,13 +1533,13 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper fx &= fixed_scale - 1; Q_ASSERT((fx >> 16) == 0); for (int i = 0; i < length; ++i) { - register int x1 = (fx >> 16); - register int x2 = x1 + 1; + int x1 = (fx >> 16); + int x2 = x1 + 1; Q_ASSERT(x1 >= 0); Q_ASSERT(x2 < count); - register int distx = (fx & 0x0000ffff) >> 8; - register int idistx = 256 - distx; + int distx = (fx & 0x0000ffff) >> 8; + int idistx = 256 - distx; int rb = ((buf1[x1] * idistx + buf1[x2] * distx) >> 8) & 0xff00ff; int ag = (buf2[x1] * idistx + buf2[x2] * distx) & 0xff00ff00; buffer[i] = rb | ag; diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h index 5d9867012f..0b8a41c904 100644 --- a/src/gui/painting/qdrawhelper_p.h +++ b/src/gui/painting/qdrawhelper_p.h @@ -759,7 +759,7 @@ do { \ /* Duff's device */ \ uint *_d = (uint*)(dest) + length; \ const uint *_s = (uint*)(src) + length; \ - register int n = ((length) + 7) / 8; \ + int n = ((length) + 7) / 8; \ switch ((length) & 0x07) \ { \ case 0: do { *--_d = *--_s; \ @@ -779,7 +779,7 @@ do { \ /* Duff's device */ \ ushort *_d = (ushort*)(dest); \ const ushort *_s = (ushort*)(src); \ - register int n = ((length) + 7) / 8; \ + int n = ((length) + 7) / 8; \ switch ((length) & 0x07) \ { \ case 0: do { *_d++ = *_s++; \ diff --git a/src/gui/painting/qpolygon.cpp b/src/gui/painting/qpolygon.cpp index 5398387bcf..34215b53b0 100644 --- a/src/gui/painting/qpolygon.cpp +++ b/src/gui/painting/qpolygon.cpp @@ -218,8 +218,8 @@ void QPolygon::translate(int dx, int dy) if (dx == 0 && dy == 0) return; - register QPoint *p = data(); - register int i = size(); + QPoint *p = data(); + int i = size(); QPoint pt(dx, dy); while (i--) { *p += pt; @@ -447,7 +447,7 @@ QRect QPolygon::boundingRect() const { if (isEmpty()) return QRect(0, 0, 0, 0); - register const QPoint *pd = constData(); + const QPoint *pd = constData(); int minx, maxx, miny, maxy; minx = maxx = pd->x(); miny = maxy = pd->y(); @@ -599,8 +599,8 @@ void QPolygonF::translate(const QPointF &offset) if (offset.isNull()) return; - register QPointF *p = data(); - register int i = size(); + QPointF *p = data(); + int i = size(); while (i--) { *p += offset; ++p; @@ -660,7 +660,7 @@ QRectF QPolygonF::boundingRect() const { if (isEmpty()) return QRectF(0, 0, 0, 0); - register const QPointF *pd = constData(); + const QPointF *pd = constData(); qreal minx, maxx, miny, maxy; minx = maxx = pd->x(); miny = maxy = pd->y(); diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index a6be7c6c78..197d49369e 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -734,6 +734,35 @@ static inline QPointF snapTo26Dot6Grid(const QPointF &p) qFloorF(p.y() * 64) * (1 / qreal(64))); } +/* + The rasterize line function relies on some div by zero which should + result in +/-inf values. However, when floating point exceptions are + enabled, this will cause crashes, so we return high numbers instead. + As the returned value is used in further arithmetic, returning + FLT_MAX/DBL_MAX will also cause values, so instead return a value + that is well outside the int-range. + */ +static inline qreal qSafeDivide(qreal x, qreal y) +{ + if (y == 0) + return x > 0 ? 1e20 : -1e20; + return x / y; +} + +/* Conversion to int fails if the value is too large to fit into INT_MAX or + too small to fit into INT_MIN, so we need this slightly safer conversion + when floating point exceptions are enabled + */ +static inline int qSafeFloatToQ16Dot16(qreal x) +{ + qreal tmp = x * 65536.; + if (tmp > qreal(INT_MAX)) + return INT_MAX; + else if (tmp < qreal(INT_MIN)) + return -INT_MAX; + return int(tmp); +} + void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bool squareCap) { if (a == b || width == 0 || d->clipRect.isEmpty()) @@ -946,23 +975,23 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, const QPointF bottomLeftEdge = bottom - left; const QPointF bottomRightEdge = bottom - right; - const qreal topLeftSlope = topLeftEdge.x() / topLeftEdge.y(); - const qreal bottomLeftSlope = bottomLeftEdge.x() / bottomLeftEdge.y(); + const qreal topLeftSlope = qSafeDivide(topLeftEdge.x(), topLeftEdge.y()); + const qreal bottomLeftSlope = qSafeDivide(bottomLeftEdge.x(), bottomLeftEdge.y()); - const qreal topRightSlope = topRightEdge.x() / topRightEdge.y(); - const qreal bottomRightSlope = bottomRightEdge.x() / bottomRightEdge.y(); + const qreal topRightSlope = qSafeDivide(topRightEdge.x(), topRightEdge.y()); + const qreal bottomRightSlope = qSafeDivide(bottomRightEdge.x(), bottomRightEdge.y()); - const Q16Dot16 topLeftSlopeFP = FloatToQ16Dot16(topLeftSlope); - const Q16Dot16 topRightSlopeFP = FloatToQ16Dot16(topRightSlope); + const Q16Dot16 topLeftSlopeFP = qSafeFloatToQ16Dot16(topLeftSlope); + const Q16Dot16 topRightSlopeFP = qSafeFloatToQ16Dot16(topRightSlope); - const Q16Dot16 bottomLeftSlopeFP = FloatToQ16Dot16(bottomLeftSlope); - const Q16Dot16 bottomRightSlopeFP = FloatToQ16Dot16(bottomRightSlope); + const Q16Dot16 bottomLeftSlopeFP = qSafeFloatToQ16Dot16(bottomLeftSlope); + const Q16Dot16 bottomRightSlopeFP = qSafeFloatToQ16Dot16(bottomRightSlope); - const Q16Dot16 invTopLeftSlopeFP = FloatToQ16Dot16(1 / topLeftSlope); - const Q16Dot16 invTopRightSlopeFP = FloatToQ16Dot16(1 / topRightSlope); + const Q16Dot16 invTopLeftSlopeFP = qSafeFloatToQ16Dot16(qSafeDivide(1, topLeftSlope)); + const Q16Dot16 invTopRightSlopeFP = qSafeFloatToQ16Dot16(qSafeDivide(1, topRightSlope)); - const Q16Dot16 invBottomLeftSlopeFP = FloatToQ16Dot16(1 / bottomLeftSlope); - const Q16Dot16 invBottomRightSlopeFP = FloatToQ16Dot16(1 / bottomRightSlope); + const Q16Dot16 invBottomLeftSlopeFP = qSafeFloatToQ16Dot16(qSafeDivide(1, bottomLeftSlope)); + const Q16Dot16 invBottomRightSlopeFP = qSafeFloatToQ16Dot16(qSafeDivide(1, bottomRightSlope)); if (d->antialiased) { const Q16Dot16 iTopFP = IntToQ16Dot16(int(topBound)); @@ -1137,10 +1166,10 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, int iBottom = bottom.y() < 0.5f? -1 : int(bottom.y() - 0.5f); int iMiddle = qMin(iLeft, iRight); - Q16Dot16 leftIntersectAf = FloatToQ16Dot16(top.x() + 0.5f + (iTop + 0.5f - top.y()) * topLeftSlope); - Q16Dot16 leftIntersectBf = FloatToQ16Dot16(left.x() + 0.5f + (iLeft + 1.5f - left.y()) * bottomLeftSlope); - Q16Dot16 rightIntersectAf = FloatToQ16Dot16(top.x() - 0.5f + (iTop + 0.5f - top.y()) * topRightSlope); - Q16Dot16 rightIntersectBf = FloatToQ16Dot16(right.x() - 0.5f + (iRight + 1.5f - right.y()) * bottomRightSlope); + Q16Dot16 leftIntersectAf = qSafeFloatToQ16Dot16(top.x() + 0.5f + (iTop + 0.5f - top.y()) * topLeftSlope); + Q16Dot16 leftIntersectBf = qSafeFloatToQ16Dot16(left.x() + 0.5f + (iLeft + 1.5f - left.y()) * bottomLeftSlope); + Q16Dot16 rightIntersectAf = qSafeFloatToQ16Dot16(top.x() - 0.5f + (iTop + 0.5f - top.y()) * topRightSlope); + Q16Dot16 rightIntersectBf = qSafeFloatToQ16Dot16(right.x() - 0.5f + (iRight + 1.5f - right.y()) * bottomRightSlope); int ny; int y = iTop; diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index ce5abdbbd9..47668c62b6 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -1585,14 +1585,14 @@ void QRegionPrivate::selfTest() const static QRegionPrivate qrp; QRegion::QRegionData QRegion::shared_empty = {Q_BASIC_ATOMIC_INITIALIZER(1), &qrp}; -typedef void (*OverlapFunc)(register QRegionPrivate &dest, register const QRect *r1, const QRect *r1End, - register const QRect *r2, const QRect *r2End, register int y1, register int y2); -typedef void (*NonOverlapFunc)(register QRegionPrivate &dest, register const QRect *r, const QRect *rEnd, - register int y1, register int y2); +typedef void (*OverlapFunc)(QRegionPrivate &dest, const QRect *r1, const QRect *r1End, + const QRect *r2, const QRect *r2End, int y1, int y2); +typedef void (*NonOverlapFunc)(QRegionPrivate &dest, const QRect *r, const QRect *rEnd, + int y1, int y2); static bool EqualRegion(const QRegionPrivate *r1, const QRegionPrivate *r2); static void UnionRegion(const QRegionPrivate *reg1, const QRegionPrivate *reg2, QRegionPrivate &dest); -static void miRegionOp(register QRegionPrivate &dest, const QRegionPrivate *reg1, const QRegionPrivate *reg2, +static void miRegionOp(QRegionPrivate &dest, const QRegionPrivate *reg1, const QRegionPrivate *reg2, OverlapFunc overlapFunc, NonOverlapFunc nonOverlap1Func, NonOverlapFunc nonOverlap2Func); @@ -1789,7 +1789,7 @@ SOFTWARE. */ /* $XFree86: xc/lib/X11/Region.c,v 1.1.1.2.2.2 1998/10/04 15:22:50 hohndel Exp $ */ -static void UnionRectWithRegion(register const QRect *rect, const QRegionPrivate *source, +static void UnionRectWithRegion(const QRect *rect, const QRegionPrivate *source, QRegionPrivate &dest) { if (rect->isEmpty()) @@ -1824,9 +1824,9 @@ static void UnionRectWithRegion(register const QRect *rect, const QRegionPrivate */ static void miSetExtents(QRegionPrivate &dest) { - register const QRect *pBox, + const QRect *pBox, *pBoxEnd; - register QRect *pExtents; + QRect *pExtents; dest.innerRect.setCoords(0, 0, -1, -1); dest.innerArea = -1; @@ -1871,11 +1871,11 @@ static void miSetExtents(QRegionPrivate &dest) added by raymond */ -static void OffsetRegion(register QRegionPrivate ®ion, register int x, register int y) +static void OffsetRegion(QRegionPrivate ®ion, int x, int y) { if (region.rects.size()) { - register QRect *pbox = region.rects.data(); - register int nbox = region.numRects; + QRect *pbox = region.rects.data(); + int nbox = region.numRects; while (nbox--) { pbox->translate(x, y); @@ -1902,12 +1902,12 @@ static void OffsetRegion(register QRegionPrivate ®ion, register int x, regist * *----------------------------------------------------------------------- */ -static void miIntersectO(register QRegionPrivate &dest, register const QRect *r1, const QRect *r1End, - register const QRect *r2, const QRect *r2End, int y1, int y2) +static void miIntersectO(QRegionPrivate &dest, const QRect *r1, const QRect *r1End, + const QRect *r2, const QRect *r2End, int y1, int y2) { - register int x1; - register int x2; - register QRect *pNextRect; + int x1; + int x2; + QRect *pNextRect; pNextRect = dest.rects.data() + dest.numRects; @@ -1967,11 +1967,11 @@ static void miIntersectO(register QRegionPrivate &dest, register const QRect *r1 * *----------------------------------------------------------------------- */ -static int miCoalesce(register QRegionPrivate &dest, int prevStart, int curStart) +static int miCoalesce(QRegionPrivate &dest, int prevStart, int curStart) { - register QRect *pPrevBox; /* Current box in previous band */ - register QRect *pCurBox; /* Current box in current band */ - register QRect *pRegEnd; /* End of region */ + QRect *pPrevBox; /* Current box in previous band */ + QRect *pCurBox; /* Current box in current band */ + QRect *pRegEnd; /* End of region */ int curNumRects; /* Number of rectangles in current band */ int prevNumRects; /* Number of rectangles in previous band */ int bandY1; /* Y1 coordinate for current band */ @@ -2096,21 +2096,21 @@ static int miCoalesce(register QRegionPrivate &dest, int prevStart, int curStart * *----------------------------------------------------------------------- */ -static void miRegionOp(register QRegionPrivate &dest, +static void miRegionOp(QRegionPrivate &dest, const QRegionPrivate *reg1, const QRegionPrivate *reg2, OverlapFunc overlapFunc, NonOverlapFunc nonOverlap1Func, NonOverlapFunc nonOverlap2Func) { - register const QRect *r1; // Pointer into first region - register const QRect *r2; // Pointer into 2d region + const QRect *r1; // Pointer into first region + const QRect *r2; // Pointer into 2d region const QRect *r1End; // End of 1st region const QRect *r2End; // End of 2d region - register int ybot; // Bottom of intersection - register int ytop; // Top of intersection + int ybot; // Bottom of intersection + int ytop; // Top of intersection int prevBand; // Index of start of previous band in dest int curBand; // Index of start of current band in dest - register const QRect *r1BandEnd; // End of current band in r1 - register const QRect *r2BandEnd; // End of current band in r2 + const QRect *r1BandEnd; // End of current band in r1 + const QRect *r2BandEnd; // End of current band in r2 int top; // Top of non-overlapping band int bot; // Bottom of non-overlapping band @@ -2312,10 +2312,10 @@ static void miRegionOp(register QRegionPrivate &dest, *----------------------------------------------------------------------- */ -static void miUnionNonO(register QRegionPrivate &dest, register const QRect *r, const QRect *rEnd, - register int y1, register int y2) +static void miUnionNonO(QRegionPrivate &dest, const QRect *r, const QRect *rEnd, + int y1, int y2) { - register QRect *pNextRect; + QRect *pNextRect; pNextRect = dest.rects.data() + dest.numRects; @@ -2348,10 +2348,10 @@ static void miUnionNonO(register QRegionPrivate &dest, register const QRect *r, *----------------------------------------------------------------------- */ -static void miUnionO(register QRegionPrivate &dest, register const QRect *r1, const QRect *r1End, - register const QRect *r2, const QRect *r2End, register int y1, register int y2) +static void miUnionO(QRegionPrivate &dest, const QRect *r1, const QRect *r1End, + const QRect *r2, const QRect *r2End, int y1, int y2) { - register QRect *pNextRect; + QRect *pNextRect; pNextRect = dest.rects.data() + dest.numRects; @@ -2437,10 +2437,10 @@ static void UnionRegion(const QRegionPrivate *reg1, const QRegionPrivate *reg2, *----------------------------------------------------------------------- */ -static void miSubtractNonO1(register QRegionPrivate &dest, register const QRect *r, - const QRect *rEnd, register int y1, register int y2) +static void miSubtractNonO1(QRegionPrivate &dest, const QRect *r, + const QRect *rEnd, int y1, int y2) { - register QRect *pNextRect; + QRect *pNextRect; pNextRect = dest.rects.data() + dest.numRects; @@ -2471,11 +2471,11 @@ static void miSubtractNonO1(register QRegionPrivate &dest, register const QRect *----------------------------------------------------------------------- */ -static void miSubtractO(register QRegionPrivate &dest, register const QRect *r1, const QRect *r1End, - register const QRect *r2, const QRect *r2End, register int y1, register int y2) +static void miSubtractO(QRegionPrivate &dest, const QRect *r1, const QRect *r1End, + const QRect *r2, const QRect *r2End, int y1, int y2) { - register QRect *pNextRect; - register int x1; + QRect *pNextRect; + int x1; x1 = r1->left(); @@ -2573,7 +2573,7 @@ static void miSubtractO(register QRegionPrivate &dest, register const QRect *r1, */ static void SubtractRegion(QRegionPrivate *regM, QRegionPrivate *regS, - register QRegionPrivate &dest) + QRegionPrivate &dest) { Q_ASSERT(!isEmptyHelper(regM)); Q_ASSERT(!isEmptyHelper(regS)); @@ -2668,12 +2668,12 @@ static bool PointInRegion(QRegionPrivate *pRegion, int x, int y) return false; } -static bool RectInRegion(register QRegionPrivate *region, int rx, int ry, uint rwidth, uint rheight) +static bool RectInRegion(QRegionPrivate *region, int rx, int ry, uint rwidth, uint rheight) { - register const QRect *pbox; - register const QRect *pboxEnd; + const QRect *pbox; + const QRect *pboxEnd; QRect rect(rx, ry, rwidth, rheight); - register QRect *prect = ▭ + QRect *prect = ▭ int partIn, partOut; if (!region || region->numRects == 0 || !EXTENTCHECK(®ion->extents, prect)) @@ -3094,8 +3094,8 @@ SOFTWARE. static void InsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, ScanLineListBlock **SLLBlock, int *iSLLBlock) { - register EdgeTableEntry *start, *prev; - register ScanLineList *pSLL, *pPrevSLL; + EdgeTableEntry *start, *prev; + ScanLineList *pSLL, *pPrevSLL; ScanLineListBlock *tmpSLLBlock; /* @@ -3172,11 +3172,11 @@ static void InsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, * */ -static void CreateETandAET(register int count, register const QPoint *pts, - EdgeTable *ET, EdgeTableEntry *AET, register EdgeTableEntry *pETEs, +static void CreateETandAET(int count, const QPoint *pts, + EdgeTable *ET, EdgeTableEntry *AET, EdgeTableEntry *pETEs, ScanLineListBlock *pSLLBlock) { - register const QPoint *top, + const QPoint *top, *bottom, *PrevPt, *CurrPt; @@ -3259,10 +3259,10 @@ static void CreateETandAET(register int count, register const QPoint *pts, * */ -static void loadAET(register EdgeTableEntry *AET, register EdgeTableEntry *ETEs) +static void loadAET(EdgeTableEntry *AET, EdgeTableEntry *ETEs) { - register EdgeTableEntry *pPrevAET; - register EdgeTableEntry *tmp; + EdgeTableEntry *pPrevAET; + EdgeTableEntry *tmp; pPrevAET = AET; AET = AET->next; @@ -3303,11 +3303,11 @@ static void loadAET(register EdgeTableEntry *AET, register EdgeTableEntry *ETEs) * V-------------------> V---> ... * */ -static void computeWAET(register EdgeTableEntry *AET) +static void computeWAET(EdgeTableEntry *AET) { - register EdgeTableEntry *pWETE; - register int inside = 1; - register int isInside = 0; + EdgeTableEntry *pWETE; + int inside = 1; + int isInside = 0; AET->nextWETE = 0; pWETE = AET; @@ -3337,12 +3337,12 @@ static void computeWAET(register EdgeTableEntry *AET) * */ -static int InsertionSort(register EdgeTableEntry *AET) +static int InsertionSort(EdgeTableEntry *AET) { - register EdgeTableEntry *pETEchase; - register EdgeTableEntry *pETEinsert; - register EdgeTableEntry *pETEchaseBackTMP; - register int changed = 0; + EdgeTableEntry *pETEchase; + EdgeTableEntry *pETEinsert; + EdgeTableEntry *pETEchaseBackTMP; + int changed = 0; AET = AET->next; while (AET) { @@ -3370,9 +3370,9 @@ static int InsertionSort(register EdgeTableEntry *AET) /* * Clean up our act. */ -static void FreeStorage(register ScanLineListBlock *pSLLBlock) +static void FreeStorage(ScanLineListBlock *pSLLBlock) { - register ScanLineListBlock *tmpSLLBlock; + ScanLineListBlock *tmpSLLBlock; while (pSLLBlock) { tmpSLLBlock = pSLLBlock->next; @@ -3436,7 +3436,7 @@ static inline void flushRow(const QRegionSpan *spans, int y, int numSpans, QRegi * stack by the calling procedure. * */ -static void PtsToRegion(register int numFullPtBlocks, register int iCurPtBlock, +static void PtsToRegion(int numFullPtBlocks, int iCurPtBlock, POINTBLOCK *FirstPtBlock, QRegionPrivate *reg) { int lastRow = 0; @@ -3512,12 +3512,12 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule) //int rule; /* winding rule */ { QRegionPrivate *region; - register EdgeTableEntry *pAET; /* Active Edge Table */ - register int y; /* current scanline */ - register int iPts = 0; /* number of pts in buffer */ - register EdgeTableEntry *pWETE; /* Winding Edge Table Entry*/ - register ScanLineList *pSLL; /* current scanLineList */ - register QPoint *pts; /* output buffer */ + EdgeTableEntry *pAET; /* Active Edge Table */ + int y; /* current scanline */ + int iPts = 0; /* number of pts in buffer */ + EdgeTableEntry *pWETE; /* Winding Edge Table Entry*/ + ScanLineList *pSLL; /* current scanLineList */ + QPoint *pts; /* output buffer */ EdgeTableEntry *pPrevAET; /* ptr to previous AET */ EdgeTable ET; /* header node for ET */ EdgeTableEntry AET; /* header node for AET */ |