summaryrefslogtreecommitdiffstats
path: root/tests/auto/qstatictext
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2010-08-19 06:03:44 (GMT)
committerGunnar Sletta <gunnar.sletta@nokia.com>2010-08-19 06:48:16 (GMT)
commitee134633f1e084f194ff19c60af57505b89c3861 (patch)
treee0a609fa49eac6067646d4e7ec52260bd472ce32 /tests/auto/qstatictext
parenta202c88f4cad77034d4b03d3221567ccf35c03a8 (diff)
downloadQt-ee134633f1e084f194ff19c60af57505b89c3861.zip
Qt-ee134633f1e084f194ff19c60af57505b89c3861.tar.gz
Qt-ee134633f1e084f194ff19c60af57505b89c3861.tar.bz2
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.
Diffstat (limited to 'tests/auto/qstatictext')
-rw-r--r--tests/auto/qstatictext/tst_qstatictext.cpp21
1 files changed, 20 insertions, 1 deletions
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<qreal>("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()
{