diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-03-05 18:19:20 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-20 12:35:18 +0100 |
commit | dfdea38c843d1ee915e10ee72e6371ced7cd9bd0 (patch) | |
tree | 18317f2fd1ac7e64979283f20dea69fc063563d5 /src/quick/scenegraph/qsgdistancefieldglyphnode_p.h | |
parent | e20c3516945269a43d070809c08e9797c329306d (diff) |
Decouple QSGDistanceFieldGlyphNode from it's cache manager.
To implement a custom distance field glyph node currently it's
necessary to also provide a duplicate implementation of
QSGContext::createDistanceFieldGlyphCache() as the default implemention
references the cache manager created by createGlyphNode(). By isolating
references to the cache manager to just createDistanceFieldGlyph() cache
it becomes possible to just overwrite createGlyphNode() and still use
the default cache.
Change-Id: I7261bdbf247966b55512d2671e2ee85239bcca05
Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
Diffstat (limited to 'src/quick/scenegraph/qsgdistancefieldglyphnode_p.h')
-rw-r--r-- | src/quick/scenegraph/qsgdistancefieldglyphnode_p.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.h b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.h index 9406ee1bc8..f8c8267e4f 100644 --- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.h +++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.h @@ -51,12 +51,13 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE +class QSGContext; class QSGDistanceFieldGlyphCacheManager; class QSGDistanceFieldTextMaterial; -class QSGDistanceFieldGlyphNode: public QSGGlyphNode +class QSGDistanceFieldGlyphNode: public QSGGlyphNode, public QSGDistanceFieldGlyphConsumer { public: - QSGDistanceFieldGlyphNode(QSGDistanceFieldGlyphCacheManager *cacheManager); + QSGDistanceFieldGlyphNode(QSGContext *context); ~QSGDistanceFieldGlyphNode(); virtual QPointF baseLine() const { return m_baseLine; } @@ -80,11 +81,11 @@ private: QColor m_color; QPointF m_baseLine; + QSGContext *m_context; QSGDistanceFieldTextMaterial *m_material; QPointF m_originalPosition; QPointF m_position; QGlyphRun m_glyphs; - QSGDistanceFieldGlyphCacheManager *m_glyph_cacheManager; QSGDistanceFieldGlyphCache *m_glyph_cache; QSGGeometry m_geometry; QQuickText::TextStyle m_style; |