aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/scenegraph/qsgdistancefieldglyphnode_p_p.h
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@nokia.com>2011-11-11 16:49:41 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-14 15:28:43 +0100
commitace4b5881c6074b6e525281e0daa3a4740203b15 (patch)
treea9f51f4b1c423764e74fcaa4791d08d0747ccb63 /src/declarative/scenegraph/qsgdistancefieldglyphnode_p_p.h
parentfd58c5fc9fa5dc1aa975cf40a5a58945671e22ee (diff)
Distance field glyph cache refactoring.
The distance field glyph cache is now an abstract class part of the adaptation layer. It can be implemented to define the way the glyphs are stored in graphics memory on a specific platform. The typical use case is for having a cross-process glyph cache. To implement a custom glyph cache, one has to override three pure virtual functions: requestGlyphs(), storeGlyphs() and releaseGlyphs(). The default implementation works the same way as before the refactoring (no cross-process cache). Change-Id: I6e231a119abbffbe36f5f0d690f0b8be0664ff4f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/declarative/scenegraph/qsgdistancefieldglyphnode_p_p.h')
-rw-r--r--src/declarative/scenegraph/qsgdistancefieldglyphnode_p_p.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/declarative/scenegraph/qsgdistancefieldglyphnode_p_p.h b/src/declarative/scenegraph/qsgdistancefieldglyphnode_p_p.h
index 8733edf203..c8c73bfac0 100644
--- a/src/declarative/scenegraph/qsgdistancefieldglyphnode_p_p.h
+++ b/src/declarative/scenegraph/qsgdistancefieldglyphnode_p_p.h
@@ -44,11 +44,10 @@
#include <qsgmaterial.h>
#include "qsgdistancefieldglyphnode_p.h"
+#include "qsgadaptationlayer_p.h"
QT_BEGIN_NAMESPACE
-class QSGDistanceFieldGlyphCache;
-
class QSGDistanceFieldTextMaterial: public QSGMaterial
{
public:
@@ -65,12 +64,18 @@ public:
void setGlyphCache(QSGDistanceFieldGlyphCache *a) { m_glyph_cache = a; }
QSGDistanceFieldGlyphCache *glyphCache() const { return m_glyph_cache; }
- bool updateTexture();
+ void setTexture(const QSGDistanceFieldGlyphCache::Texture * tex) { m_texture = tex; }
+ const QSGDistanceFieldGlyphCache::Texture * texture() const { return m_texture; }
+
+ QSize textureSize() const { return m_size; }
+
+ bool updateCache();
protected:
QSize m_size;
QColor m_color;
QSGDistanceFieldGlyphCache *m_glyph_cache;
+ const QSGDistanceFieldGlyphCache::Texture *m_texture;
};
class QSGDistanceFieldStyledTextMaterial : public QSGDistanceFieldTextMaterial