diff options
author | Yoann Lopes <yoann.lopes@nokia.com> | 2011-12-15 14:17:33 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-21 12:16:25 +0100 |
commit | 3d8986d7475ef6fdd04ea1286d840d2b570133a0 (patch) | |
tree | 66cec7e44c432c904b0e33dec4ce34ef622c7b67 /src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h | |
parent | 0febfa03b62a4449c42ad1e675777b7b099ebaa3 (diff) |
Reference count glyphs in QSGDistanceFieldGlyphCache.
This was previously done only in the default cache implementation. It
has been moved to the base class.
releaseGlyphs() is called when a glyph is not referenced anymore by any
node.
Added a virtual function referenceGlyphs() that is called everytime glyphs
are being used in a node. This function is called just before
requestGlyphs().
Change-Id: If90f86c328c18ae2a5977847a6adf50b99ea1241
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h')
-rw-r--r-- | src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h index b52ec45107..06f9283bcc 100644 --- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h +++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h @@ -42,8 +42,8 @@ #ifndef QSGDEFAULTDISTANCEFIELDGLYPHCACHE_H #define QSGDEFAULTDISTANCEFIELDGLYPHCACHE_H +#include "qsgadaptationlayer_p.h" #include <QtGui/qopenglfunctions.h> -#include <private/qsgadaptationlayer_p.h> #include <qopenglshaderprogram.h> #include <QtGui/private/qopenglengineshadersource_p.h> @@ -54,9 +54,10 @@ class Q_QUICK_EXPORT QSGDefaultDistanceFieldGlyphCache : public QSGDistanceField public: QSGDefaultDistanceFieldGlyphCache(QSGDistanceFieldGlyphCacheManager *man, QOpenGLContext *c, const QRawFont &font); - void requestGlyphs(const QVector<glyph_t> &glyphs); + void requestGlyphs(const QSet<glyph_t> &glyphs); void storeGlyphs(const QHash<glyph_t, QImage> &glyphs); - void releaseGlyphs(const QVector<glyph_t> &glyphs); + void referenceGlyphs(const QSet<glyph_t> &glyphs); + void releaseGlyphs(const QSet<glyph_t> &glyphs); bool cacheIsFull() const { return m_textureData->currY >= maxTextureSize(); } bool useWorkaroundBrokenFBOReadback() const; @@ -72,7 +73,6 @@ private: GLuint texture; GLuint fbo; QSize size; - QHash<glyph_t, quint32> glyphRefCount; QSet<glyph_t> unusedGlyphs; int currX; int currY; |