QGraphicsDropShadowEffect: Fix for high DPI scaling

Preserve the device pixel ratio.

Task-number: QTBUG-60026
Change-Id: Ie818c582fe2c7b11ceb347b39cfbf7ea49361021
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
Friedemann Kleint 2017-04-18 15:02:08 +02:00
parent 84fb8c5ec9
commit 8b62673d9f

View File

@ -1316,6 +1316,7 @@ void QPixmapDropShadowFilter::draw(QPainter *p,
return; return;
QImage tmp(px.size(), QImage::Format_ARGB32_Premultiplied); QImage tmp(px.size(), QImage::Format_ARGB32_Premultiplied);
tmp.setDevicePixelRatio(px.devicePixelRatioF());
tmp.fill(0); tmp.fill(0);
QPainter tmpPainter(&tmp); QPainter tmpPainter(&tmp);
tmpPainter.setCompositionMode(QPainter::CompositionMode_Source); tmpPainter.setCompositionMode(QPainter::CompositionMode_Source);
@ -1324,6 +1325,7 @@ void QPixmapDropShadowFilter::draw(QPainter *p,
// blur the alpha channel // blur the alpha channel
QImage blurred(tmp.size(), QImage::Format_ARGB32_Premultiplied); QImage blurred(tmp.size(), QImage::Format_ARGB32_Premultiplied);
blurred.setDevicePixelRatio(px.devicePixelRatioF());
blurred.fill(0); blurred.fill(0);
QPainter blurPainter(&blurred); QPainter blurPainter(&blurred);
qt_blurImage(&blurPainter, tmp, d->radius, false, true); qt_blurImage(&blurPainter, tmp, d->radius, false, true);