From 422648966d634b27cfcf8cad8a895724322637cb Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 7 Jun 2010 13:24:56 +0200 Subject: Test native graphics engine in tst_QGlyphs Drawing to QImage will always go through the raster engine, so some bugs might not be caught. This also fixes a test failure on X11, since the raster engine on X11 is inconsistent with regards to how it handles subpixel antialiasing into images. See task QTBUG-11268. Reviewed-by: Olivier --- tests/auto/qglyphs/tst_qglyphs.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/auto/qglyphs/tst_qglyphs.cpp b/tests/auto/qglyphs/tst_qglyphs.cpp index 177b981..90309ea 100644 --- a/tests/auto/qglyphs/tst_qglyphs.cpp +++ b/tests/auto/qglyphs/tst_qglyphs.cpp @@ -235,11 +235,11 @@ void tst_QGlyphs::textLayoutGlyphIndexes() void tst_QGlyphs::drawExistingGlyphs() { - QImage textLayoutDraw(1000, 1000, QImage::Format_ARGB32); - QImage drawGlyphs(1000, 1000, QImage::Format_ARGB32); + QPixmap textLayoutDraw(1000, 1000); + QPixmap drawGlyphs(1000, 1000); - textLayoutDraw.fill(0xffffffff); - drawGlyphs.fill(0xffffffff); + textLayoutDraw.fill(Qt::white); + drawGlyphs.fill(Qt::white); QString s; s.append(QLatin1Char('A')); @@ -286,10 +286,10 @@ void tst_QGlyphs::drawNonExistentGlyphs() glyphs.setPositions(glyphPositions); glyphs.setFont(m_testFont); - QImage image(1000, 1000, QImage::Format_ARGB32); - image.fill(0); + QPixmap image(1000, 1000); + image.fill(Qt::white); - QImage imageBefore = image; + QPixmap imageBefore = image; { QPainter p(&image); p.drawGlyphs(QPointF(50, 50), glyphs); @@ -312,11 +312,11 @@ void tst_QGlyphs::drawMultiScriptText1() textLayout.createLine(); textLayout.endLayout(); - QImage textLayoutDraw(1000, 1000, QImage::Format_ARGB32); - textLayoutDraw.fill(0xffffffff); + QPixmap textLayoutDraw(1000, 1000); + textLayoutDraw.fill(Qt::white); - QImage drawGlyphs(1000, 1000, QImage::Format_ARGB32); - drawGlyphs.fill(0xffffffff); + QPixmap drawGlyphs(1000, 1000); + drawGlyphs.fill(Qt::white); QList glyphsList = textLayout.glyphs(); QCOMPARE(glyphsList.size(), 1); @@ -356,11 +356,11 @@ void tst_QGlyphs::drawMultiScriptText2() textLayout.createLine(); textLayout.endLayout(); - QImage textLayoutDraw(1000, 1000, QImage::Format_ARGB32); - textLayoutDraw.fill(0xffffffff); + QPixmap textLayoutDraw(1000, 1000); + textLayoutDraw.fill(Qt::white); - QImage drawGlyphs(1000, 1000, QImage::Format_ARGB32); - drawGlyphs.fill(0xffffffff); + QPixmap drawGlyphs(1000, 1000); + drawGlyphs.fill(Qt::white); QList glyphsList = textLayout.glyphs(); QCOMPARE(glyphsList.size(), 2); -- cgit v0.12