diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-10-13 17:21:41 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-10-13 17:21:48 +0200 |
commit | 90fa3414156522ef89f9ebe8cefd6dad303ce06c (patch) | |
tree | 65ba250895722795ce3d14fb9b4341953ffd1733 /tests/auto/quick/rendernode/tst_rendernode.cpp | |
parent | 2a999f870e791d99c5c0463a11be05fc5a14dfcc (diff) | |
parent | a05fec277d0a122e03bb6c7756777729df50b1f2 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Change-Id: Ica09141c3d3c4f9e8585c9dc66a050158a25f446
Diffstat (limited to 'tests/auto/quick/rendernode/tst_rendernode.cpp')
-rw-r--r-- | tests/auto/quick/rendernode/tst_rendernode.cpp | 16 |
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 313e5ac196..e15649e62c 100644 --- a/tests/auto/quick/rendernode/tst_rendernode.cpp +++ b/tests/auto/quick/rendernode/tst_rendernode.cpp @@ -215,16 +215,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); + QQuickView v; + int devicePixelRatio = static_cast<int>(v.devicePixelRatio()); + QCOMPARE(fb.width(), 200 * devicePixelRatio); + QCOMPARE(fb.height(), 200 * devicePixelRatio); - 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 * devicePixelRatio, 50 * devicePixelRatio), qRgb(0xff, 0xff, 0xff)); + QCOMPARE(fb.pixel(50 * devicePixelRatio, 150 * devicePixelRatio), qRgb(0xff, 0xff, 0xff)); + QCOMPARE(fb.pixel(150 * devicePixelRatio, 50 * devicePixelRatio), qRgb(0x00, 0x00, 0xff)); QByteArray errorMessage; - QVERIFY2(fuzzyCompareColor(fb.pixel(150, 150), qRgb(0x7f, 0x7f, 0xff), &errorMessage), - msgColorMismatchAt(errorMessage, 150, 150).constData()); + QVERIFY2(fuzzyCompareColor(fb.pixel(150 * devicePixelRatio, 150 * devicePixelRatio), qRgb(0x7f, 0x7f, 0xff), &errorMessage), + msgColorMismatchAt(errorMessage, 150 * devicePixelRatio, 150 * devicePixelRatio).constData()); } /* The test uses a number of nested rectangles with clipping |