summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_ft_p.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-09-16 16:00:04 +0200
committerQt by Nokia <qt-info@nokia.com>2011-09-20 12:00:23 +0200
commit070d9c00c488a5ee6811f04170cf488ead79bf80 (patch)
treeef3511a994b4ec4b8d563393ea2fb1a4783ad095 /src/gui/text/qfontengine_ft_p.h
parent57368c7037c6d2a6c8cc18d9d41399bf740abe5c (diff)
Avoid double caching glyphs in raster/QPA/FreeType
Since FreeType has internal caching, it has had a special code path in the raster engine which avoided using Qt's glyph cache, as that would be redundant. However, when compiling with QPA, we want the same behavior without being able to access the QFontEngineFT class. To achieve this, I've made a new abstraction and added it to QFontEngine which allows the FT engine to provide direct pointers into the alpha maps stored by FT. This requires a locking/unlocking mechanism. Yes, the QFontEngine::alphaMap* API is slowly becoming a horrible mess, but due to time constraints, the task of refactoring these functions into a more flexible API needs to wait. I've added a TODO comment for this. Change-Id: I08237403c2967f8fb952258178676f33a87c0353 Reviewed-on: http://codereview.qt-project.org/5155 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui/text/qfontengine_ft_p.h')
-rw-r--r--src/gui/text/qfontengine_ft_p.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h
index 62edaeec45..a236b79f68 100644
--- a/src/gui/text/qfontengine_ft_p.h
+++ b/src/gui/text/qfontengine_ft_p.h
@@ -265,6 +265,12 @@ private:
QFixed subPixelPosition,
const QTransform &matrix,
QFontEngine::GlyphFormat format);
+ virtual QImage *lockedAlphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition,
+ GlyphFormat neededFormat, const QTransform &t,
+ QPoint *offset);
+ virtual bool hasInternalCaching() const { return true; }
+ virtual void unlockAlphaMapForGlyph();
+
virtual void removeGlyphFromCache(glyph_t glyph);
virtual int glyphCount() const;
@@ -292,7 +298,6 @@ private:
inline Glyph *cachedGlyph(glyph_t g) const { return defaultGlyphSet.getGlyph(g, 0); }
QGlyphSet *loadTransformedGlyphSet(const QTransform &matrix);
- QFixed subPixelPositionForX(QFixed x);
bool loadGlyphs(QGlyphSet *gs, const glyph_t *glyphs, int num_glyphs,
const QFixedPoint *positions,
GlyphFormat format = Format_Render);