diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-04-15 05:10:44 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-04-15 05:11:50 (GMT) |
commit | 62e52a19f1c7ac81a36f394e43f916c3c8933e8f (patch) | |
tree | 8a7bb186996559d641cb8c778f532b074075623e /tools/qml | |
parent | 6dba05f9334a82c849806293ff0448c65c33a5d2 (diff) | |
download | Qt-62e52a19f1c7ac81a36f394e43f916c3c8933e8f.zip Qt-62e52a19f1c7ac81a36f394e43f916c3c8933e8f.tar.gz Qt-62e52a19f1c7ac81a36f394e43f916c3c8933e8f.tar.bz2 |
Visual test updates.
Diffstat (limited to 'tools/qml')
-rw-r--r-- | tools/qml/qdeclarativetester.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/qml/qdeclarativetester.cpp b/tools/qml/qdeclarativetester.cpp index cf537ee..11fa22f 100644 --- a/tools/qml/qdeclarativetester.cpp +++ b/tools/qml/qdeclarativetester.cpp @@ -332,6 +332,24 @@ void QDeclarativeTester::updateCurrentTime(int msec) qWarning() << "QDeclarativeTester: Image mismatch. Reject saved to:" << reject; img.save(reject); + bool doDiff = (goodImage.size() == img.size()); + if (doDiff) { + QImage diffimg(m_view->width(), m_view->height(), QImage::Format_RGB32); + diffimg.fill(qRgb(255,255,255)); + QPainter p(&diffimg); + int diffCount = 0; + for (int x = 0; x < img.width(); ++x) { + for (int y = 0; y < img.height(); ++y) { + if (goodImage.pixel(x,y) != img.pixel(x,y)) { + ++diffCount; + p.drawPoint(x,y); + } + } + } + QString diff(frame->image().toLocalFile() + ".diff.png"); + diffimg.save(diff); + qWarning().nospace() << " Diff (" << diffCount << " pixels differed) saved to: " << diff; + } imagefailure(); } } |