From ee134633f1e084f194ff19c60af57505b89c3861 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Thu, 19 Aug 2010 08:03:44 +0200 Subject: Disable translatedRotatedAndScaledPainter testcase as it is broken. The problem is that the order of rounding to fixedpoint is different in the static and normal text case and this leads to some glyphs occationally being 1 pixel off. In the normal case, the glyphs are laid out and positioned in fixed point, then transformed using the full current matrix including the position which is then snapped to integer device space when drawn. In the static text case, the glyphs are laid out and positioned in fixed point related to 0,0. The actual device position is then added to the glyph positions. --- tests/auto/qstatictext/tst_qstatictext.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp index 0ae5320..6498ae4 100644 --- a/tests/auto/qstatictext/tst_qstatictext.cpp +++ b/tests/auto/qstatictext/tst_qstatictext.cpp @@ -77,8 +77,11 @@ private slots: void rotatedPainter(); void scaledPainter(); void projectedPainter(); +#if 0 + void rotatedScaledAndTranslatedPainter_data(); void rotatedScaledAndTranslatedPainter(); - void transformationChanged(); +#endif + void transformationChanged(); void plainTextVsRichText(); @@ -426,12 +429,26 @@ void tst_QStaticText::projectedPainter() QCOMPARE(imageDrawStaticText, imageDrawText); } +#if 0 +void tst_QStaticText::rotatedScaledAndTranslatedPainter_data() +{ + QTest::addColumn("offset"); + + for (int i=0; i<100; ++i) { + qreal offset = 300 + i / 100.; + QTest::newRow(QByteArray::number(offset).constData()) << offset; + } +} + void tst_QStaticText::rotatedScaledAndTranslatedPainter() { + QFETCH(qreal, offset); + QPixmap imageDrawText(1000, 1000); imageDrawText.fill(Qt::white); { QPainter p(&imageDrawText); + p.translate(offset, 0); p.rotate(45.0); p.scale(2.0, 2.0); p.translate(100, 200); @@ -443,6 +460,7 @@ void tst_QStaticText::rotatedScaledAndTranslatedPainter() imageDrawStaticText.fill(Qt::white); { QPainter p(&imageDrawStaticText); + p.translate(offset, 0); p.rotate(45.0); p.scale(2.0, 2.0); p.translate(100, 200); @@ -462,6 +480,7 @@ void tst_QStaticText::rotatedScaledAndTranslatedPainter() QEXPECT_FAIL("", "Graphics system does not support transformed text on this platform", Abort); QCOMPARE(imageDrawStaticText, imageDrawText); } +#endif void tst_QStaticText::transformationChanged() { -- cgit v0.12