From 852f4811453cb0b082748f2fcefac5898e603ab0 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 25 Nov 2010 15:33:13 +1000 Subject: Fixup visual tests on Mac Disable sub-pixel antialiasing and skip text on 10.5 --- tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp | 8 +++++++- tools/qml/qdeclarativetester.cpp | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp index 2a15102..18fbfca 100644 --- a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp +++ b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp @@ -105,10 +105,16 @@ void tst_qmlvisual::visual_data() files << findQmlFiles(QDir(QT_TEST_SOURCE_DIR)); if (qgetenv("QMLVISUAL_ALL") != "1") { #if defined(Q_WS_X11) - //Text on X11 varies per distro - and the CI system is currently using something outdated. + //Text on X11 varies per version - and the CI system is currently using something outdated. foreach(const QString &str, files.filter(QRegExp(".*text.*"))) files.removeAll(str); #endif +#if defined(Q_WS_MAC) + //Text on Mac also varies per version. Only check the text on 10.6 + if(QSysInfo::MacintoshVersion != QSysInfo::MV_10_6) + foreach(const QString &str, files.filter(QRegExp(".*text.*"))) + files.removeAll(str); +#endif #if defined(Q_WS_QWS) //We don't want QWS test results to mire down the CI system files.clear(); diff --git a/tools/qml/qdeclarativetester.cpp b/tools/qml/qdeclarativetester.cpp index a516fd7..e3a1f59 100644 --- a/tools/qml/qdeclarativetester.cpp +++ b/tools/qml/qdeclarativetester.cpp @@ -274,7 +274,16 @@ void QDeclarativeTester::updateCurrentTime(int msec) if (options & QDeclarativeViewer::TestImages) { img.fill(qRgb(255,255,255)); + +#ifdef Q_WS_MAC + bool oldSmooth = qt_applefontsmoothing_enabled; + qt_applefontsmoothing_enabled = false; +#endif QPainter p(&img); +#ifdef Q_WS_MAC + qt_applefontsmoothing_enabled = oldSmooth; +#endif + m_view->render(&p); } -- cgit v0.12