diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-11-24 13:48:19 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-24 13:03:03 +0100 |
commit | 47a5c708bf4e555cb8febef583f32c99f7d8ea1e (patch) | |
tree | 722842be890fe711a353759b100ac50bef9c2648 /src/quick/scenegraph/qsgadaptationlayer_p.h | |
parent | 635d0a7cf6601b2e46e0eed21a648934bc471c6d (diff) |
Add support for shared glyph cache
Use a shared graphics cache to back the distance fields if
it is available.
Change-Id: Id5e6e7a28e38e349d787e66016b2d0faebc791d7
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'src/quick/scenegraph/qsgadaptationlayer_p.h')
-rw-r--r-- | src/quick/scenegraph/qsgadaptationlayer_p.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgadaptationlayer_p.h b/src/quick/scenegraph/qsgadaptationlayer_p.h index 45826deae8..2d82ca30ba 100644 --- a/src/quick/scenegraph/qsgadaptationlayer_p.h +++ b/src/quick/scenegraph/qsgadaptationlayer_p.h @@ -110,6 +110,8 @@ public: HighQualitySubPixelAntialiasing }; + QSGGlyphNode() : m_ownerElement(0) {} + virtual void setGlyphs(const QPointF &position, const QGlyphRun &glyphs) = 0; virtual void setColor(const QColor &color) = 0; virtual void setStyle(QQuickText::TextStyle style) = 0; @@ -123,8 +125,12 @@ public: virtual void update() = 0; + void setOwnerElement(QQuickItem *ownerElement) { m_ownerElement = ownerElement; } + QQuickItem *ownerElement() const { return m_ownerElement; } + protected: QRectF m_bounding_rect; + QQuickItem *m_ownerElement; }; class Q_QUICK_EXPORT QSGDistanceFieldGlyphCache @@ -185,6 +191,10 @@ public: void registerGlyphNode(QSGDistanceFieldGlyphNode *node); void unregisterGlyphNode(QSGDistanceFieldGlyphNode *node); + virtual void registerOwnerElement(QQuickItem *ownerElement); + virtual void unregisterOwnerElement(QQuickItem *ownerElement); + virtual void processPendingGlyphs(); + protected: struct GlyphPosition { glyph_t glyph; @@ -204,6 +214,7 @@ protected: void updateTexture(GLuint oldTex, GLuint newTex, const QSize &newTexSize); bool containsGlyph(glyph_t glyph) const; + GLuint textureIdForGlyph(glyph_t glyph) const; QOpenGLContext *ctx; |