summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qglyphrun.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-05-10 13:08:29 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-06-06 14:02:33 (GMT)
commit86d88c5b719fd3d50336d9d8e7127b8045ee82ae (patch)
treecd6ad2732f7eec8d7b3530b0d35908c0f0c130ef /src/gui/text/qglyphrun.h
parent71cd7dfea1b8f0e287eb1616c0cda5493508c3c4 (diff)
downloadQt-86d88c5b719fd3d50336d9d8e7127b8045ee82ae.zip
Qt-86d88c5b719fd3d50336d9d8e7127b8045ee82ae.tar.gz
Qt-86d88c5b719fd3d50336d9d8e7127b8045ee82ae.tar.bz2
Add function QGlyphRun::setRawData()
To provide an optimized way of constructing QGlyphRun objects with no copying or allocation, we add function setRawData() (naming inspired by QByteArray::setRawData()). Data retrieved from QRawFont can be passed directly into this. The logic is now that the data pointers in QGlyphRunPrivate should always point to the current valid data and is what will be used in comparisons and drawing calls. The vectors are optimizations to avoid unnecessary copying if the user wants to use the QVector based API (which makes it easier to manage the memory.) This reflected in the functions that return QVectors, which will return the stored vector if and only if it is identical to the current pointer. Otherwise we will have to copy the memory. The internal addition operators in QGlyphRun have been removed since they really provide no real optimization and have an unclear definition if the two glyph runs are based on different fonts. Reviewed-by: Jiang Jiang
Diffstat (limited to 'src/gui/text/qglyphrun.h')
-rw-r--r--src/gui/text/qglyphrun.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/text/qglyphrun.h b/src/gui/text/qglyphrun.h
index e43f1ef..cf407a8 100644
--- a/src/gui/text/qglyphrun.h
+++ b/src/gui/text/qglyphrun.h
@@ -66,6 +66,10 @@ public:
QRawFont rawFont() const;
void setRawFont(const QRawFont &rawFont);
+ void setRawData(const quint32 *glyphIndexArray,
+ const QPointF *glyphPositionArray,
+ int size);
+
QVector<quint32> glyphIndexes() const;
void setGlyphIndexes(const QVector<quint32> &glyphIndexes);