aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/quick/rendernode/tst_rendernode.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/auto/quick/rendernode/tst_rendernode.cpp b/tests/auto/quick/rendernode/tst_rendernode.cpp
index 782ebf5aee..249612797b 100644
--- a/tests/auto/quick/rendernode/tst_rendernode.cpp
+++ b/tests/auto/quick/rendernode/tst_rendernode.cpp
@@ -212,16 +212,18 @@ void tst_rendernode::renderOrder()
QSKIP("This test does not work at display depths < 24");
QImage fb = runTest("RenderOrder.qml");
- QCOMPARE(fb.width(), 200);
- QCOMPARE(fb.height(), 200);
+ const qreal scaleFactor = QGuiApplication::primaryScreen()->devicePixelRatio();
+ QCOMPARE(fb.width(), qRound(200 * scaleFactor));
+ QCOMPARE(fb.height(), qRound(200 * scaleFactor));
- QCOMPARE(fb.pixel(50, 50), qRgb(0xff, 0xff, 0xff));
- QCOMPARE(fb.pixel(50, 150), qRgb(0xff, 0xff, 0xff));
- QCOMPARE(fb.pixel(150, 50), qRgb(0x00, 0x00, 0xff));
+ QCOMPARE(fb.pixel(50 * scaleFactor, 50 * scaleFactor), qRgb(0xff, 0xff, 0xff));
+ QCOMPARE(fb.pixel(50 * scaleFactor, 150 * scaleFactor), qRgb(0xff, 0xff, 0xff));
+ QCOMPARE(fb.pixel(150 * scaleFactor, 50 * scaleFactor), qRgb(0x00, 0x00, 0xff));
QByteArray errorMessage;
- QVERIFY2(fuzzyCompareColor(fb.pixel(150, 150), qRgb(0x7f, 0x7f, 0xff), &errorMessage),
- msgColorMismatchAt(errorMessage, 150, 150).constData());
+ const qreal coordinate = 150 * scaleFactor;
+ QVERIFY2(fuzzyCompareColor(fb.pixel(coordinate, coordinate), qRgb(0x7f, 0x7f, 0xff), &errorMessage),
+ msgColorMismatchAt(errorMessage, coordinate, coordinate).constData());
}
/* The test uses a number of nested rectangles with clipping