diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-10-05 05:10:59 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-10-05 05:39:29 (GMT) |
commit | 3909d97e86d62fd94e149925b5f3111c8f391334 (patch) | |
tree | 748a1db0fde9f07136da835c141be7e0cdb5ec29 /src/gui/image | |
parent | 7b19bfec4c496f2112b363cbdc8a0c302a48cfce (diff) | |
download | Qt-3909d97e86d62fd94e149925b5f3111c8f391334.zip Qt-3909d97e86d62fd94e149925b5f3111c8f391334.tar.gz Qt-3909d97e86d62fd94e149925b5f3111c8f391334.tar.bz2 |
Make it possible to implement engine-specific drop shadow filters
It wasn't possible for the paint engine to override the drop
shadow filter because QPixmapDropShadowFilter::draw() was not
asking for an engine-specific filter object.
Also, change the OpenVG filter to use vgGaussianBlur() instead of
vgConvolve(), and draw the original image on top of the shadow.
Task-number: QTBUG-4583
Reviewed-by: trustme
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qpixmapfilter.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp index 749b8f3..df445db 100644 --- a/src/gui/image/qpixmapfilter.cpp +++ b/src/gui/image/qpixmapfilter.cpp @@ -1074,6 +1074,16 @@ void QPixmapDropShadowFilter::draw(QPainter *p, const QRectF &src) const { Q_D(const QPixmapDropShadowFilter); + QPixmapFilter *filter = p->paintEngine() && p->paintEngine()->isExtended() ? + static_cast<QPaintEngineEx *>(p->paintEngine())->pixmapFilter(type(), this) : 0; + QPixmapDropShadowFilter *dropShadowFilter = static_cast<QPixmapDropShadowFilter*>(filter); + if (dropShadowFilter) { + dropShadowFilter->setColor(d->color); + dropShadowFilter->setBlurRadius(d->blurFilter->radius()); + dropShadowFilter->setOffset(d->offset); + dropShadowFilter->draw(p, pos, px, src); + return; + } QImage tmp = src.isNull() ? px.toImage() : px.copy(src.toRect()).toImage(); QPainter tmpPainter(&tmp); |