summaryrefslogtreecommitdiffstats
path: root/tests/auto/qglyphs
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-06-07 13:24:56 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-06-07 13:59:42 +0200
commit422648966d634b27cfcf8cad8a895724322637cb (patch)
tree89fa1095e043d05e856b7cd6d23e1d403d7df62f /tests/auto/qglyphs
parentbc846277c47cb9980f3b6003ec702b7739568d15 (diff)
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
Diffstat (limited to 'tests/auto/qglyphs')
-rw-r--r--tests/auto/qglyphs/tst_qglyphs.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/auto/qglyphs/tst_qglyphs.cpp b/tests/auto/qglyphs/tst_qglyphs.cpp
index 177b981b15..90309eacee 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<QGlyphs> 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<QGlyphs> glyphsList = textLayout.glyphs();
QCOMPARE(glyphsList.size(), 2);