diff options
author | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-06-10 12:08:23 (GMT) |
---|---|---|
committer | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-06-10 12:08:23 (GMT) |
commit | 14f72183fbe1c7fad7c5434b2af032cc51436f5e (patch) | |
tree | 4a7ad3f61ccfd3160b2ddd45fca3241884496db1 | |
parent | ef0a51654783f942499cfa9fca60d18c2fa6a702 (diff) | |
download | Qt-14f72183fbe1c7fad7c5434b2af032cc51436f5e.zip Qt-14f72183fbe1c7fad7c5434b2af032cc51436f5e.tar.gz Qt-14f72183fbe1c7fad7c5434b2af032cc51436f5e.tar.bz2 |
Revert "greatly speed up QTransform::mapRect() for projective transforms"
This reverts commit 72e083c98c3adb07bb1578fb7f28f121fc3f34ac.
This test broke the tst_QTransform::projectivePathMapping autotest. Lars
is looking into it; for now we take the patch out.
Reviewed-by: Lars
-rw-r--r-- | src/gui/painting/qtransform.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index 86e594c..c00012a 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -1788,7 +1788,7 @@ QRect QTransform::mapRect(const QRect &rect) const y -= h; } return QRect(x, y, w, h); - } else { + } else if (t < TxProject) { // see mapToPolygon for explanations of the algorithm. qreal x = 0, y = 0; MAP(rect.left(), rect.top(), x, y); @@ -1812,6 +1812,10 @@ QRect QTransform::mapRect(const QRect &rect) const xmax = qMax(xmax, x); ymax = qMax(ymax, y); return QRect(qRound(xmin), qRound(ymin), qRound(xmax)-qRound(xmin), qRound(ymax)-qRound(ymin)); + } else { + QPainterPath path; + path.addRect(rect); + return map(path).boundingRect().toRect(); } } @@ -1854,7 +1858,7 @@ QRectF QTransform::mapRect(const QRectF &rect) const y -= h; } return QRectF(x, y, w, h); - } else { + } else if (t < TxProject) { qreal x = 0, y = 0; MAP(rect.x(), rect.y(), x, y); qreal xmin = x; @@ -1877,6 +1881,10 @@ QRectF QTransform::mapRect(const QRectF &rect) const xmax = qMax(xmax, x); ymax = qMax(ymax, y); return QRectF(xmin, ymin, xmax-xmin, ymax - ymin); + } else { + QPainterPath path; + path.addRect(rect); + return map(path).boundingRect(); } } |