summaryrefslogtreecommitdiff
path: root/src/gui/image/qpixmapfilter.cpp
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-08-21 12:27:17 +0200
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-08-21 13:51:43 +0200
commit9d639659f2334bb5f3ea9b16b23bcb0127752f64 (patch)
treeda16d1d4290f5c43a3f1a8c3389e5f7fc9a2a81e /src/gui/image/qpixmapfilter.cpp
parent00d7d50cde5d1e491039149d58502e17dba9b3b7 (diff)
downloadqt4-tools-9d639659f2334bb5f3ea9b16b23bcb0127752f64.tar.gz
Fix broken drop shadow pixmap filter on X11.
Xrender is not rocket science when it comes to composition modes, so we have to use the raster engine for the fill. toImage/fromImage is a no-op on QWS and Windows, and on other platforms it is required, so we don't have to add any ifdefs or clever checks. Reviewed-by: Gunnar
Diffstat (limited to 'src/gui/image/qpixmapfilter.cpp')
-rw-r--r--src/gui/image/qpixmapfilter.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp
index e95cf890ad..f7de80d268 100644
--- a/src/gui/image/qpixmapfilter.cpp
+++ b/src/gui/image/qpixmapfilter.cpp
@@ -1047,7 +1047,7 @@ void QPixmapDropShadowFilter::draw(QPainter *p,
{
Q_D(const QPixmapDropShadowFilter);
- QPixmap tmp = src.isNull() ? px : px.copy(src.toRect());
+ QImage tmp = src.isNull() ? px : px.copy(src.toRect()).toImage();
QPainter tmpPainter(&tmp);
// blacken the image...
@@ -1055,8 +1055,10 @@ void QPixmapDropShadowFilter::draw(QPainter *p,
tmpPainter.fillRect(0, 0, tmp.width(), tmp.height(), d->color);
tmpPainter.end();
+ const QPixmap pixTmp = QPixmap::fromImage(tmp);
+
// draw the blurred drop shadow...
- d->convolution->draw(p, pos + d->offset, tmp);
+ d->convolution->draw(p, pos + d->offset, pixTmp);
// Draw the actual pixmap...
p->drawPixmap(pos, px, src);