diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2014-02-10 13:59:44 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-19 19:36:25 +0100 |
commit | 4de3c5db238f45404feb6c6ce60810a3e11eae84 (patch) | |
tree | bc0a4d7af2f757fed94c1b52ca6bcd0e74bae25f /src/gui/text/qfontengineglyphcache_p.h | |
parent | 30fd22b9574def54726e7b193127cc0c901c1b4c (diff) | |
download | qtbase-4de3c5db238f45404feb6c6ce60810a3e11eae84.tar.gz |
Unify glyph format between QFontEngine and QFontEngineGlyphCache
Instead of the glyph cache having its own cache type that always mapped
one to one to a font engine glyph format, causing confusion and needless
conversions, the glyph caches now use QFontEngine's glyph format enum.
This also removes the iffy use of an int for the glyphFormat in the font
engines.
Change-Id: I529bad5c179e004f63e152f7dcc311d298c3db98
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/gui/text/qfontengineglyphcache_p.h')
-rw-r--r-- | src/gui/text/qfontengineglyphcache_p.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/gui/text/qfontengineglyphcache_p.h b/src/gui/text/qfontengineglyphcache_p.h index ac01c78399..65be14b90f 100644 --- a/src/gui/text/qfontengineglyphcache_p.h +++ b/src/gui/text/qfontengineglyphcache_p.h @@ -58,6 +58,7 @@ #include "QtCore/qatomic.h" #include <QtCore/qvarlengtharray.h> #include "private/qfont_p.h" +#include "private/qfontengine_p.h" @@ -66,22 +67,18 @@ QT_BEGIN_NAMESPACE class QFontEngineGlyphCache: public QSharedData { public: - enum Type { - Raster_RGBMask, - Raster_A8, - Raster_Mono, - Raster_ARGB - }; - - QFontEngineGlyphCache(const QTransform &matrix, Type type) : m_transform(matrix), m_type(type) { } + QFontEngineGlyphCache(QFontEngine::GlyphFormat format, const QTransform &matrix) : m_format(format), m_transform(matrix) + { + Q_ASSERT(m_format != QFontEngine::Format_None); + } virtual ~QFontEngineGlyphCache() { } - Type cacheType() const { return m_type; } + QFontEngine::GlyphFormat glyphFormat() const { return m_format; } const QTransform &transform() const { return m_transform; } + QFontEngine::GlyphFormat m_format; QTransform m_transform; - QFontEngineGlyphCache::Type m_type; }; typedef QHash<void *, QList<QFontEngineGlyphCache *> > GlyphPointerHash; typedef QHash<int, QList<QFontEngineGlyphCache *> > GlyphIntHash; |