summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-04-15 05:10:44 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-04-15 05:11:50 (GMT)
commit62e52a19f1c7ac81a36f394e43f916c3c8933e8f (patch)
tree8a7bb186996559d641cb8c778f532b074075623e /tools
parent6dba05f9334a82c849806293ff0448c65c33a5d2 (diff)
downloadQt-62e52a19f1c7ac81a36f394e43f916c3c8933e8f.zip
Qt-62e52a19f1c7ac81a36f394e43f916c3c8933e8f.tar.gz
Qt-62e52a19f1c7ac81a36f394e43f916c3c8933e8f.tar.bz2
Visual test updates.
Diffstat (limited to 'tools')
-rw-r--r--tools/qml/qdeclarativetester.cpp18
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();
}
}