summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qtextureglyphcache.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-08-17 13:29:02 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-01-14 12:55:45 (GMT)
commit5290c50b240abbcd0477df1db1808d33b96ca856 (patch)
treef458300ef95d7c51f70d82dfec0b244faad5b14a /src/gui/painting/qtextureglyphcache.cpp
parent91e96d6c730aac4accef64e5eaab1b289939ef8e (diff)
downloadQt-5290c50b240abbcd0477df1db1808d33b96ca856.zip
Qt-5290c50b240abbcd0477df1db1808d33b96ca856.tar.gz
Qt-5290c50b240abbcd0477df1db1808d33b96ca856.tar.bz2
Support transformations in drawStaticText() and optimize for space
1. Support transformations on the painter in drawStaticText(). Transforming the painter will cause the text layout to be recalculated, except for translations, which are handled by shifting the position of the text items. 2. Make const length arrays of the internal data in QStaticTextItem in order to minimize the memory consumption.
Diffstat (limited to 'src/gui/painting/qtextureglyphcache.cpp')
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 46da88e..5a6a0d9 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -55,9 +55,8 @@ QT_BEGIN_NAMESPACE
// #define CACHE_DEBUG
-void QTextureGlyphCache::populate(QFontEngine *fontEngine,
- const QVarLengthArray<glyph_t> &glyphs,
- const QVarLengthArray<QFixedPoint> &)
+void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs,
+ const QFixedPoint *)
{
#ifdef CACHE_DEBUG
printf("Populating with '%s'\n", QString::fromRawData(ti.chars, ti.num_chars).toLatin1().data());
@@ -71,7 +70,7 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine,
int rowHeight = 0;
// check each glyph for its metrics and get the required rowHeight.
- for (int i=0; i < glyphs.size(); ++i) {
+ for (int i=0; i < numGlyphs; ++i) {
const glyph_t glyph = glyphs[i];
if (coords.contains(glyph))
continue;