summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2011-09-19 07:23:29 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2011-09-19 07:23:29 (GMT)
commit312fea50f8f5f2a114061b924a1cbf05850167d9 (patch)
tree49a284b9e44989f1e9d2a7e6dcda63c80adf6a91
parent6f64c1087245c0ae034bcd09ca7549a33df5a6c7 (diff)
downloadQt-312fea50f8f5f2a114061b924a1cbf05850167d9.zip
Qt-312fea50f8f5f2a114061b924a1cbf05850167d9.tar.gz
Qt-312fea50f8f5f2a114061b924a1cbf05850167d9.tar.bz2
Avoid unnecessary detach of a QImage in QPixmapDropShadowFilter
Merge-request: 1374 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
-rw-r--r--src/gui/image/qpixmapfilter.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp
index a33e173..6c03990 100644
--- a/src/gui/image/qpixmapfilter.cpp
+++ b/src/gui/image/qpixmapfilter.cpp
@@ -1362,16 +1362,14 @@ void QPixmapDropShadowFilter::draw(QPainter *p,
qt_blurImage(&blurPainter, tmp, d->radius, false, true);
blurPainter.end();
- tmp = blurred;
-
// blacken the image...
- tmpPainter.begin(&tmp);
- tmpPainter.setCompositionMode(QPainter::CompositionMode_SourceIn);
- tmpPainter.fillRect(tmp.rect(), d->color);
- tmpPainter.end();
+ QPainter blackenPainter(&blurred);
+ blackenPainter.setCompositionMode(QPainter::CompositionMode_SourceIn);
+ blackenPainter.fillRect(blurred.rect(), d->color);
+ blackenPainter.end();
// draw the blurred drop shadow...
- p->drawImage(pos, tmp);
+ p->drawImage(pos, blurred);
// Draw the actual pixmap...
p->drawPixmap(pos, px, src);