From 312fea50f8f5f2a114061b924a1cbf05850167d9 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 19 Sep 2011 09:23:29 +0200 Subject: Avoid unnecessary detach of a QImage in QPixmapDropShadowFilter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 1374 Reviewed-by: Samuel Rødal --- src/gui/image/qpixmapfilter.cpp | 12 +++++------- 1 file 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); -- cgit v0.12