diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-05-07 13:22:07 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-05-07 13:26:27 +0200 |
commit | e3716cdf88a09109e368adc4f73fc52ff6325f83 (patch) | |
tree | aae8225ed640befa4a3729e3e11d1e0dd2aaa607 /tests/auto/quick/scenegraph/tst_scenegraph.cpp | |
parent | 6b8a0c932eb60a7839f9d8ae7112c79166e1f49b (diff) | |
parent | 69b7ba225007d68e113ee425ad58ce7e186a92c2 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Change-Id: Ifb69f73ac805afe5e3c8708fa975b7d3c13a4e48
Diffstat (limited to 'tests/auto/quick/scenegraph/tst_scenegraph.cpp')
-rw-r--r-- | tests/auto/quick/scenegraph/tst_scenegraph.cpp | 42 |
1 files changed, 4 insertions, 38 deletions
diff --git a/tests/auto/quick/scenegraph/tst_scenegraph.cpp b/tests/auto/quick/scenegraph/tst_scenegraph.cpp index 6f00d5f9f2..91c872a36a 100644 --- a/tests/auto/quick/scenegraph/tst_scenegraph.cpp +++ b/tests/auto/quick/scenegraph/tst_scenegraph.cpp @@ -44,6 +44,10 @@ #include <private/qsgcontext_p.h> #include <private/qsgrenderloop_p.h> +#include "../shared/visualtestutil.h" + +using namespace QQuickVisualTestUtil; + class PerPixelRect : public QQuickItem { Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) @@ -194,44 +198,6 @@ bool containsSomethingOtherThanWhite(const QImage &image) return false; } -// When running on native Nvidia graphics cards on linux, the -// distance field glyph pixels have a measurable, but not visible -// pixel error. Use a custom compare function to avoid -// -// This was GT-216 with the ubuntu "nvidia-319" driver package. -// llvmpipe does not show the same issue. -// -bool compareImages(const QImage &ia, const QImage &ib) -{ - if (ia.size() != ib.size()) - qDebug() << "images are of different size" << ia.size() << ib.size(); - Q_ASSERT(ia.size() == ib.size()); - Q_ASSERT(ia.format() == ib.format()); - - int w = ia.width(); - int h = ia.height(); - const int tolerance = 5; - for (int y=0; y<h; ++y) { - const uint *as= (const uint *) ia.constScanLine(y); - const uint *bs= (const uint *) ib.constScanLine(y); - for (int x=0; x<w; ++x) { - uint a = as[x]; - uint b = bs[x]; - - // No tolerance for error in the alpha. - if ((a & 0xff000000) != (b & 0xff000000)) - return false; - if (qAbs(qRed(a) - qRed(b)) > tolerance) - return false; - if (qAbs(qRed(a) - qRed(b)) > tolerance) - return false; - if (qAbs(qRed(a) - qRed(b)) > tolerance) - return false; - } - } - return true; -} - void tst_SceneGraph::manyWindows_data() { QTest::addColumn<QString>("file"); |