Commit Graph

3 Commits

Author SHA1 Message Date
Eskil Abrahamsen Blomfeldt
ae3b5b3ab4 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
(cherry picked from commit 86d88c5b719fd3d50336d9d8e7127b8045ee82ae)

Change-Id: Id5bb55ee3d93afb32ffca850f53382e856df7b3e
Reviewed-on: http://codereview.qt.nokia.com/342
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2011-06-07 10:30:57 +02:00
Jyri Tahtela
f9f395c28b Update licenseheader text in source files for qtbase Qt module
Updated version of LGPL and FDL licenseheaders.
Apply release phase licenseheaders for all source files.

Reviewed-by: Trust Me
2011-05-24 12:34:08 +03:00
Eskil Abrahamsen Blomfeldt
051ef6f294 Rename QGlyphs -> QGlyphRun
API clean-up for QGlyphRun:
1. QGlyphs -> QGlyphRun
2. QGlyphRun's font()/setFont() -> rawFont()/setRawFont()
3. QPainter::drawGlyphs() -> drawGlyphRun()
4. QTextLayout and QTextFragment's glyphs() -> glyphRuns()

Reviewed-by: Jiang Jiang
(cherry picked from commit 84ef364302728b68d2d29ea9c4ccbec32c7bb115)
2011-05-10 12:20:13 +02:00