summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_ft_p.h
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-11-04 16:08:57 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-05 02:30:04 +0100
commitb2b30468044d3b1a9afc66e5e33450493c7ce4b3 (patch)
tree245d1b92f7c43ba8b0ac8379fee697bd3b02fc89 /src/gui/text/qfontengine_ft_p.h
parent2b2221fcfa9f1fcc0c27a16f461845b00f532abb (diff)
Allow disabling FreeType internal cache
To disable it, set QT_NO_FT_CACHE environment variable to 1. Change-Id: I086aa93c71cbdf86858a41a2bbad5d2db247cdfb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/gui/text/qfontengine_ft_p.h')
-rw-r--r--src/gui/text/qfontengine_ft_p.h24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h
index 6124eae91b..d4a6def286 100644
--- a/src/gui/text/qfontengine_ft_p.h
+++ b/src/gui/text/qfontengine_ft_p.h
@@ -152,7 +152,6 @@ public:
signed char advance;
signed char format;
uchar *data;
- unsigned int uploadedToServer : 1;
};
enum SubpixelAntialiasingType {
@@ -269,7 +268,7 @@ private:
virtual QImage *lockedAlphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition,
GlyphFormat neededFormat, const QTransform &t,
QPoint *offset);
- virtual bool hasInternalCaching() const { return true; }
+ virtual bool hasInternalCaching() const { return cacheEnabled; }
virtual void unlockAlphaMapForGlyph();
virtual void removeGlyphFromCache(glyph_t glyph);
@@ -290,20 +289,15 @@ private:
inline bool isBitmapFont() const { return defaultFormat == Format_Mono; }
inline Glyph *loadGlyph(uint glyph, QFixed subPixelPosition, GlyphFormat format = Format_None, bool fetchMetricsOnly = false) const
- { return loadGlyph(&defaultGlyphSet, glyph, subPixelPosition, format, fetchMetricsOnly); }
+ { return loadGlyph(cacheEnabled ? &defaultGlyphSet : 0, glyph, subPixelPosition, format, fetchMetricsOnly); }
Glyph *loadGlyph(QGlyphSet *set, uint glyph, QFixed subPixelPosition, GlyphFormat = Format_None, bool fetchMetricsOnly = false) const;
-
- QGlyphSet *defaultGlyphs() { return &defaultGlyphSet; }
- GlyphFormat defaultGlyphFormat() const { return defaultFormat; }
-
- inline Glyph *cachedGlyph(glyph_t g) const { return defaultGlyphSet.getGlyph(g, 0); }
+ Glyph *loadGlyphFor(glyph_t g, QFixed subPixelPosition, GlyphFormat format);
QGlyphSet *loadTransformedGlyphSet(const QTransform &matrix);
bool loadGlyphs(QGlyphSet *gs, const glyph_t *glyphs, int num_glyphs,
const QFixedPoint *positions,
GlyphFormat format = Format_Render);
-
QFontEngineFT(const QFontDef &fd);
virtual ~QFontEngineFT();
@@ -321,28 +315,20 @@ private:
bool initFromFontEngine(const QFontEngineFT *fontEngine);
HintStyle defaultHintStyle() const { return default_hint_style; }
-protected:
-
- void freeGlyphSets();
- virtual bool uploadGlyphToServer(QGlyphSet *set, uint glyphid, Glyph *g, GlyphInfo *info, int glyphDataSize) const;
- virtual unsigned long allocateServerGlyphSet();
- virtual void freeServerGlyphSet(unsigned long id);
+protected:
QFreetypeFace *freetype;
int default_load_flags;
-
-
HintStyle default_hint_style;
-
bool antialias;
bool transform;
bool embolden;
bool obliquen;
SubpixelAntialiasingType subpixelType;
int lcdFilterType;
- bool canUploadGlyphsToServer;
bool embeddedbitmap;
+ bool cacheEnabled;
private:
friend class QFontEngineFTRawFont;