summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmapfilter.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-11-09 14:52:45 +0100
committerGunnar Sletta <gunnar@trolltech.com>2009-11-09 15:02:19 +0100
commitcaaf77c971ea96b021bb6efe0bd1796ce8ebec6a (patch)
tree45cb6468b6929e9e29e532a3d77aa03e307390a2 /src/gui/image/qpixmapfilter.cpp
parent9c6e3590da6c49d055d452b08de0e51b0b77f1c4 (diff)
Fixed dropshadow raster implementation since rewrite
Reviewed-by: Samuel
Diffstat (limited to 'src/gui/image/qpixmapfilter.cpp')
-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 d83ef2c9b2..de8f4e0347 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);