summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/text/qglyphrun
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2012-05-15 20:02:53 +0300
committerQt by Nokia <qt-info@nokia.com>2012-05-16 19:38:01 +0200
commit279562172d2e998e910d82599255cb04b54df823 (patch)
tree39d459e9e6f97a80a156b1efbfb9956dfac1b137 /tests/auto/gui/text/qglyphrun
parent6eae3e1da3ebaf8023f85c62f2fdd177fa39e208 (diff)
enable the text layout's cache where it is seems to be missed
e.g. in QStaticText, the data is used just to get the line's y-position and re-calculates just after the loop to determine the bounding rect and to draw the text; in QWidgetLineControl, the data re-calculated over and over while the result is seems to remain the same; probably the caching is needed here too Change-Id: I0f7eb291532f63eccb9c5f749daebb73ff90632f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'tests/auto/gui/text/qglyphrun')
-rw-r--r--tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
index 8ef030ae60..3cb5760648 100644
--- a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
+++ b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
@@ -244,6 +244,7 @@ void tst_QGlyphRun::textLayoutGlyphIndexes()
QTextLayout layout(s);
layout.setFont(m_testFont);
+ layout.setCacheEnabled(true);
layout.beginLayout();
layout.createLine();
layout.endLayout();
@@ -273,6 +274,7 @@ void tst_QGlyphRun::drawExistingGlyphs()
QTextLayout layout(s);
layout.setFont(m_testFont);
+ layout.setCacheEnabled(true);
layout.beginLayout();
layout.createLine();
layout.endLayout();
@@ -411,6 +413,7 @@ void tst_QGlyphRun::drawMultiScriptText1()
text += QChar(0x03D0); // Greek, beta
QTextLayout textLayout(text);
+ textLayout.setCacheEnabled(true);
textLayout.beginLayout();
textLayout.createLine();
textLayout.endLayout();
@@ -451,6 +454,7 @@ void tst_QGlyphRun::drawMultiScriptText2()
text += QChar(0x03D0); // Greek, beta
QTextLayout textLayout(text);
+ textLayout.setCacheEnabled(true);
textLayout.beginLayout();
textLayout.createLine();
textLayout.endLayout();
@@ -515,6 +519,7 @@ void tst_QGlyphRun::drawStruckOutText()
QTextLayout layout(s);
layout.setFont(font);
+ layout.setCacheEnabled(true);
layout.beginLayout();
layout.createLine();
layout.endLayout();
@@ -556,6 +561,7 @@ void tst_QGlyphRun::drawOverlinedText()
QTextLayout layout(s);
layout.setFont(font);
+ layout.setCacheEnabled(true);
layout.beginLayout();
layout.createLine();
layout.endLayout();
@@ -597,6 +603,7 @@ void tst_QGlyphRun::drawUnderlinedText()
QTextLayout layout(s);
layout.setFont(font);
+ layout.setCacheEnabled(true);
layout.beginLayout();
layout.createLine();
layout.endLayout();
@@ -640,6 +647,7 @@ void tst_QGlyphRun::drawRightToLeft()
QTextLayout layout(s);
layout.setFont(font);
+ layout.setCacheEnabled(true);
layout.beginLayout();
layout.createLine();
layout.endLayout();