From f393f7f45b22990ed22308a912b7a00cc7ddd78e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Tue, 25 Aug 2009 14:07:52 +0200 Subject: Micro-optimization in QPainterPath::toFillPolygons QRectF::intersects was optimized as part of the Falcon project, and is now a bit faster than the inline version used here (drawing of dashed lines was measured to take 16% less time). Reviewed-by: Lars Knoll --- src/gui/painting/qpainterpath.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index eb8b964..a10c4cd 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -1520,12 +1520,6 @@ QList QPainterPath::toSubpathPolygons(const QMatrix &matrix) const return toSubpathPolygons(QTransform(matrix)); } -static inline bool rect_intersects(const QRectF &r1, const QRectF &r2) -{ - return qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) - && qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom()); -} - /*! Converts the path into a list of polygons using the QTransform \a matrix, and returns the list. @@ -1578,7 +1572,7 @@ QList QPainterPath::toFillPolygons(const QTransform &matrix) const continue; QRectF cbounds = bounds.at(j); for (int i=0; i