summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-11-09 13:52:45 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-11-09 14:02:19 (GMT)
commitcaaf77c971ea96b021bb6efe0bd1796ce8ebec6a (patch)
tree45cb6468b6929e9e29e532a3d77aa03e307390a2 /src
parent9c6e3590da6c49d055d452b08de0e51b0b77f1c4 (diff)
downloadQt-caaf77c971ea96b021bb6efe0bd1796ce8ebec6a.zip
Qt-caaf77c971ea96b021bb6efe0bd1796ce8ebec6a.tar.gz
Qt-caaf77c971ea96b021bb6efe0bd1796ce8ebec6a.tar.bz2
Fixed dropshadow raster implementation since rewrite
Reviewed-by: Samuel
Diffstat (limited to 'src')
-rw-r--r--src/gui/image/qpixmapfilter.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp
index d83ef2c..de8f4e0 100644
--- a/src/gui/image/qpixmapfilter.cpp
+++ b/src/gui/image/qpixmapfilter.cpp
@@ -1089,19 +1089,24 @@ void QPixmapDropShadowFilter::draw(QPainter *p,
return;
}
- QImage tmp = src.isNull() ? px.toImage() : px.copy(src.toAlignedRect()).toImage();
+ QImage tmp(px.size(), QImage::Format_ARGB32_Premultiplied);
+ tmp.fill(0);
+ QPainter tmpPainter(&tmp);
+ tmpPainter.setCompositionMode(QPainter::CompositionMode_Source);
+ tmpPainter.drawPixmap(d->offset, px);
+ tmpPainter.end();
// blur the alpha channel
tmp = blurred(tmp, tmp.rect(), qRound(d->radius), true);
// blacken the image...
- QPainter tmpPainter(&tmp);
+ tmpPainter.begin(&tmp);
tmpPainter.setCompositionMode(QPainter::CompositionMode_SourceIn);
- tmpPainter.fillRect(0, 0, tmp.width(), tmp.height(), d->color);
+ tmpPainter.fillRect(tmp.rect(), d->color);
tmpPainter.end();
// draw the blurred drop shadow...
- p->drawImage(pos + d->offset, tmp);
+ p->drawImage(pos, tmp);
// Draw the actual pixmap...
p->drawPixmap(pos, px, src);