summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorBjoern Erik Nilsen <bjorn.nilsen@nokia.com>2009-04-07 14:50:23 (GMT)
committerBjoern Erik Nilsen <bjorn.nilsen@nokia.com>2009-04-08 08:24:38 (GMT)
commit72f84ad17d0905f91e9d3988bb0f6482df6c6c78 (patch)
treefa1c345ee0d052db81733659f9fcdc161ede0b95 /src/opengl
parent6fd4a720870775a4d9a645d9000b0259caa74178 (diff)
downloadQt-72f84ad17d0905f91e9d3988bb0f6482df6c6c78.zip
Qt-72f84ad17d0905f91e9d3988bb0f6482df6c6c78.tar.gz
Qt-72f84ad17d0905f91e9d3988bb0f6482df6c6c78.tar.bz2
Use qIsFuzzyNull rather than the more expensive qFuzzyCompare
See also fde7f3d03782c801901f511131458d6fcb1021a5 Reviewed-by: Olivier Reviewed-by: Samuel
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qpaintengine_opengl.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index 88fd379..11df590 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -1924,15 +1924,15 @@ static void drawTrapezoid(const QGLTrapezoid &trap, const qreal offscreenHeight,
qreal leftB = trap.bottomLeftX + (trap.topLeftX - trap.bottomLeftX) * reciprocal;
qreal rightB = trap.bottomRightX + (trap.topRightX - trap.bottomRightX) * reciprocal;
- const bool topZero = qFuzzyCompare(topDist + 1, 1);
+ const bool topZero = qIsFuzzyNull(topDist);
reciprocal = topZero ? 1.0 / bottomDist : 1.0 / topDist;
qreal leftA = topZero ? (trap.bottomLeftX - leftB) * reciprocal : (trap.topLeftX - leftB) * reciprocal;
qreal rightA = topZero ? (trap.bottomRightX - rightB) * reciprocal : (trap.topRightX - rightB) * reciprocal;
- qreal invLeftA = qFuzzyCompare(leftA + 1, 1) ? 0.0 : 1.0 / leftA;
- qreal invRightA = qFuzzyCompare(rightA + 1, 1) ? 0.0 : 1.0 / rightA;
+ qreal invLeftA = qIsFuzzyNull(leftA) ? 0.0 : 1.0 / leftA;
+ qreal invRightA = qIsFuzzyNull(rightA) ? 0.0 : 1.0 / rightA;
// fragment program needs the negative of invRightA as it mirrors the line
glTexCoord4f(topDist, bottomDist, invLeftA, -invRightA);
@@ -3445,8 +3445,7 @@ QVector<QGLTrapezoid> QGLRectMaskGenerator::generateTrapezoids()
// manhattan distance (no rotation)
qreal width = qAbs(delta.x()) + qAbs(delta.y());
- Q_ASSERT(qFuzzyCompare(delta.x() + 1, static_cast<qreal>(1))
- || qFuzzyCompare(delta.y() + 1, static_cast<qreal>(1)));
+ Q_ASSERT(qIsFuzzyNull(delta.x()) || qIsFuzzyNull(delta.y()));
tessellator.tessellateRect(first, last, width);
} else {