summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2010-01-15 15:50:54 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2010-01-15 15:54:18 (GMT)
commitfdf827381a5e27c1c4ff6e075196befe88440fb2 (patch)
tree6c0417de738b7e5ac7a1730c96b6eb120b45d408
parent4c9e8b781eca47d6cfde686b360e447f620898fd (diff)
downloadQt-fdf827381a5e27c1c4ff6e075196befe88440fb2.zip
Qt-fdf827381a5e27c1c4ff6e075196befe88440fb2.tar.gz
Qt-fdf827381a5e27c1c4ff6e075196befe88440fb2.tar.bz2
Avoid an unnecessary copy in QImage::scaled().
This comes from the dark ages of Qt 3.x, where QImage was an explicitly shared class. Task-number: QTBUG-7231 Reviewed-by: Kim
-rw-r--r--src/gui/image/qimage.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 4e10b5b..4f5efa1 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -3992,7 +3992,7 @@ QImage QImage::scaled(const QSize& s, Qt::AspectRatioMode aspectMode, Qt::Transf
QSize newSize = size();
newSize.scale(s, aspectMode);
if (newSize == size())
- return copy();
+ return *this;
QTransform wm = QTransform::fromScale((qreal)newSize.width() / width(), (qreal)newSize.height() / height());
QImage img = transformed(wm, mode);