summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2010-11-10 13:18:08 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2010-11-10 14:27:27 (GMT)
commit46d2d05e3a95eefae1c72f55d57cbea4ce27d14e (patch)
treee03ec2b7d593dda532db338bcade35949d841b0f /tests/auto
parent60a30394e3df9f7674d9c7c5b70f4963c2b1f293 (diff)
downloadQt-46d2d05e3a95eefae1c72f55d57cbea4ce27d14e.zip
Qt-46d2d05e3a95eefae1c72f55d57cbea4ce27d14e.tar.gz
Qt-46d2d05e3a95eefae1c72f55d57cbea4ce27d14e.tar.bz2
Support glyph subpixel positioning without subpixel rendering
Previously subpixel positioning was only used when subpixel rendering is enabled (glyphType == Raster_RGBMask), however, it does not necessarily require that and for Mac OS X it will keep using subpixel positioning even when LCD font smoothing (subpixel rendering) is turned off. To maintain consistency when switching to raster, we should support subpixel positioning in this case. Task-number: QTBUG-5053 Reviewed-by: Jørgen Lind
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index 42303d2..219f920 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -4581,32 +4581,6 @@ void tst_QPainter::drawText_subPixelPositionsInRaster_qtbug5053()
#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);