diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-14 13:00:09 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-14 13:00:09 (GMT) |
commit | 84066a357e868b7d3f774f4847840014d3bf9e51 (patch) | |
tree | 9881854147d2587ca5625d18d533cc4d4118e1d5 | |
parent | 42894568b699cc72a7363381d2a0a49539a6beb3 (diff) | |
parent | 919c5a0e4b15b993d438dd137b17d4710228c595 (diff) | |
download | Qt-84066a357e868b7d3f774f4847840014d3bf9e51.zip Qt-84066a357e868b7d3f774f4847840014d3bf9e51.tar.gz Qt-84066a357e868b7d3f774f4847840014d3bf9e51.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Skip sub pixel positions test if font smoothing is off
Q_MAC_USE_COCOA -> QT_MAC_USE_COCOA
-rw-r--r-- | tests/auto/qpainter/tst_qpainter.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index 3efc54d..9b8444c 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -4566,10 +4566,35 @@ void tst_QPainter::clipBoundingRect() void tst_QPainter::drawText_subPixelPositionsInRaster_qtbug5053() { -#if !defined(Q_WS_MAC) || !defined(Q_MAC_USE_COCOA) +#if !defined(Q_WS_MAC) || !defined(QT_MAC_USE_COCOA) QSKIP("Only Mac/Cocoa supports sub pixel positions in raster engine currently", SkipAll); #endif + int w = 10, h = 10; + QImage image(w, h, QImage::Format_RGB32); + image.fill(0xffffffff); + QPainter p(&image); + p.drawText(0, h, "X\\"); + p.end(); + + bool foundNonGrayPixel = false; + const int *bits = (const int *) ((const QImage &) image).bits(); + int bpl = image.bytesPerLine() / 4; + for (int y=0; y<w; ++y) { + for (int x=0; x<h; ++x) { + int r = qRed(bits[x]); + int g = qGreen(bits[x]); + int b = qBlue(bits[x]); + if (r != g || r != b) { + foundNonGrayPixel = true; + break; + } + } + bits += bpl; + } + if (!foundNonGrayPixel) + QSKIP("Font smoothing must be turned on for this test", SkipAll); + QFontMetricsF fm(qApp->font()); QImage baseLine(fm.width(QChar::fromLatin1('e')), fm.height(), QImage::Format_RGB32); |