Fix infinite loop due to FPU limitation
authorStéphane Cerveau <scerveau@connected-labs.com>
Tue, 17 Jul 2012 06:11:28 +0000 (08:11 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 17 Jul 2012 06:19:31 +0000 (08:19 +0200)
Bug detected with animatedtiles in example/animation.
In qpa mode, using some specific resolution of directfb such as
800x600 causes a bug in FillRectF where there is an infinite loop due
to scalabilty of qreal value: One is rounded and the other not.

Change-Id: I1707e53f34aeeadc0f0fc07b1dca148fbe05b5f1
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
src/gui/painting/qpaintengine_blitter.cpp

index d0b5fd7..ed087d8 100644 (file)
@@ -515,12 +515,12 @@ void QBlitterPaintEngine::fillRect(const QRectF &rect, const QBrush &brush)
                 }
             }
             x+=blitWidth;
-            if (x >= transformedRect.right()) {
+            if (qFuzzyCompare(x, transformedRect.right())) {
                 x = transformedRect.x();
                 srcX = startX;
                 srcY = 0;
                 y += blitHeight;
-                if (y >= transformedRect.bottom())
+                if (qFuzzyCompare(y, transformedRect.bottom()))
                     rectIsFilled = true;
             } else
                 srcX = 0;