summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextengine.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-08-04 11:41:36 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-01-14 12:48:58 (GMT)
commit4cfca7cf456722ee8659b595f231f3cc2033b80d (patch)
tree696924de1d76bfabf14b5c9f91b9a938ab55983b /src/gui/text/qtextengine.cpp
parentc8621912c17ed15446da2f25760868bc177808c0 (diff)
downloadQt-4cfca7cf456722ee8659b595f231f3cc2033b80d.zip
Qt-4cfca7cf456722ee8659b595f231f3cc2033b80d.tar.gz
Qt-4cfca7cf456722ee8659b595f231f3cc2033b80d.tar.bz2
Speed optimization for QStaticText
Don't use QVector to store the text items, but put them in a regular array for quick access. drawStaticText() is now about 2.7 times the speed of drawText().
Diffstat (limited to 'src/gui/text/qtextengine.cpp')
-rw-r--r--src/gui/text/qtextengine.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index da3a3c0..5343085 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -2637,6 +2637,11 @@ QTextItemInt::QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFo
: justified(false), underlineStyle(QTextCharFormat::NoUnderline), charFormat(format),
num_chars(0), chars(0), logClusters(0), f(0), fontEngine(0)
{
+ init(si, font, format);
+}
+
+void QTextItemInt::init(const QScriptItem &si, QFont *font, const QTextCharFormat &format)
+{
// explicitly initialize flags so that initFontAttributes can be called
// multiple times on the same TextItem
flags = 0;