summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-04-18 14:47:46 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-04-18 20:27:36 +0000
commit9595622e366fcbef6bcc3a2ee08597959e3e2bd2 (patch)
tree0a5879089a280c5444e5af9ede20d2a1aa2df164 /tests/auto
parentfc2f0fb39008f95133f6fd24662fe92195431808 (diff)
QGraphicsBlurEffect: Fix for high DPI scaling
Preserve the device pixel ratio in the various helper functions and when drawing. Task-number: QTBUG-60026 Change-Id: Ieac9360b00044b6aedd0d3e1ad6e3b16d436f20f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/widgets/effects/qpixmapfilter/tst_qpixmapfilter.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/widgets/effects/qpixmapfilter/tst_qpixmapfilter.cpp b/tests/auto/widgets/effects/qpixmapfilter/tst_qpixmapfilter.cpp
index 08f4944d49..7d7c1e79a9 100644
--- a/tests/auto/widgets/effects/qpixmapfilter/tst_qpixmapfilter.cpp
+++ b/tests/auto/widgets/effects/qpixmapfilter/tst_qpixmapfilter.cpp
@@ -390,6 +390,7 @@ QT_END_NAMESPACE
void tst_QPixmapFilter::blurIndexed8()
{
QImage img(16, 32, QImage::Format_Indexed8);
+ img.setDevicePixelRatio(2);
img.setColorCount(256);
for (int i = 0; i < 256; ++i)
img.setColor(i, qRgb(i, i, i));
@@ -399,9 +400,13 @@ void tst_QPixmapFilter::blurIndexed8()
QImage original = img;
qt_blurImage(img, 10, true, false);
QCOMPARE(original.size(), img.size());
+ QVERIFY2(qFuzzyCompare(img.devicePixelRatioF(), qreal(2)),
+ QByteArray::number(img.devicePixelRatioF()).constData());
original = img;
qt_blurImage(img, 10, true, true);
+ QVERIFY2(qFuzzyCompare(img.devicePixelRatioF(), qreal(2)),
+ QByteArray::number(img.devicePixelRatioF()).constData());
QCOMPARE(original.size(), QSize(img.height(), img.width()));
}