summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorBjoern Erik Nilsen <bjorn.nilsen@nokia.com>2009-04-29 15:34:48 (GMT)
committerBjoern Erik Nilsen <bjorn.nilsen@nokia.com>2009-04-29 15:56:11 (GMT)
commit21958b48caca3423320f3e5e0e83096ca46b4d40 (patch)
treede7d5e7766132dcb483b8cc0d23623a59df35f05 /src/gui/painting
parent5969625334270892e39b6b43f4da735b830abdbe (diff)
downloadQt-21958b48caca3423320f3e5e0e83096ca46b4d40.zip
Qt-21958b48caca3423320f3e5e0e83096ca46b4d40.tar.gz
Qt-21958b48caca3423320f3e5e0e83096ca46b4d40.tar.bz2
QTransform::map(const QRegion&) cut-off for single rect regions.
Avoid QRegion<->QPainterPath conversion if possible. Reviewed-by: Samuel
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qtransform.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index af27fd5..2383272 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -1317,12 +1317,16 @@ QRegion QTransform::map(const QRegion &r) const
TransformationType t = type();
if (t == TxNone)
return r;
+
if (t == TxTranslate) {
QRegion copy(r);
copy.translate(qRound(affine._dx), qRound(affine._dy));
return copy;
}
+ if (t == TxScale && r.numRects() == 1)
+ return QRegion(mapRect(r.boundingRect()));
+
QPainterPath p = map(qt_regionToPath(r));
return p.toFillPolygon(QTransform()).toPolygon();
}