summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_p.h
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2014-02-10 13:59:44 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-19 19:36:25 +0100
commit4de3c5db238f45404feb6c6ce60810a3e11eae84 (patch)
treebc0a4d7af2f757fed94c1b52ca6bcd0e74bae25f /src/gui/text/qfontengine_p.h
parent30fd22b9574def54726e7b193127cc0c901c1b4c (diff)
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/qfontengine_p.h')
-rw-r--r--src/gui/text/qfontengine_p.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 532ebaf8ff..0bfb9e70e2 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -60,11 +60,10 @@
#include "private/qtextengine_p.h"
#include "private/qfont_p.h"
-#include <private/qfontengineglyphcache_p.h>
-
QT_BEGIN_NAMESPACE
class QPainterPath;
+class QFontEngineGlyphCache;
struct QGlyphLayout;
@@ -246,7 +245,7 @@ public:
virtual Type type() const = 0;
virtual int glyphCount() const;
- virtual int glyphMargin(QFontEngineGlyphCache::Type type) { return type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0; }
+ virtual int glyphMargin(GlyphFormat format) { return format == Format_A32 ? 2 : 0; }
virtual QFontEngine *cloneWithSize(qreal /*pixelSize*/) const { return 0; }
@@ -258,7 +257,7 @@ public:
void clearGlyphCache(const void *key);
void setGlyphCache(const void *key, QFontEngineGlyphCache *data);
- QFontEngineGlyphCache *glyphCache(const void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const;
+ QFontEngineGlyphCache *glyphCache(const void *key, GlyphFormat format, const QTransform &transform) const;
static const uchar *getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize);
static quint32 getTrueTypeGlyphIndex(const uchar *cmap, uint unicode);
@@ -300,7 +299,7 @@ public:
QVector<KernPair> kerning_pairs;
void loadKerningPairs(QFixed scalingFactor);
- int glyphFormat;
+ GlyphFormat glyphFormat;
QImage currentlyLockedAlphaMap;
int m_subPixelPositionCount; // Number of positions within a single pixel for this cache
@@ -313,6 +312,12 @@ protected:
private:
struct GlyphCacheEntry {
+ GlyphCacheEntry();
+ GlyphCacheEntry(const GlyphCacheEntry &);
+ ~GlyphCacheEntry();
+
+ GlyphCacheEntry &operator=(const GlyphCacheEntry &);
+
const void *context;
QExplicitlySharedDataPointer<QFontEngineGlyphCache> cache;
bool operator==(const GlyphCacheEntry &other) const { return context == other.context && cache == other.cache; }