From b271abeaf11c9fe0a05d8405f03f6a20218214ed Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Fri, 16 Mar 2012 12:09:29 +0100 Subject: Use a single distance-field cache instance for all sizes of a given font. Previously we had a different cache instance for each font size, but they all shared the same textures and positions. Only the glyph metrics were specific to each font size. The metrics for each font sizes are now calculated by scaling the metrics of the distance-field size (54px). Change-Id: I0d9016990dedd93318893506afb1dba7a5249e2e Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h') diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h b/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h index c4af15a2af..5dc461f30d 100644 --- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h +++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h @@ -67,6 +67,9 @@ public: void setTexture(const QSGDistanceFieldGlyphCache::Texture * tex) { m_texture = tex; } const QSGDistanceFieldGlyphCache::Texture * texture() const { return m_texture; } + void setFontScale(qreal fontScale) { m_fontScale = fontScale; } + qreal fontScale() const { return m_fontScale; } + QSize textureSize() const { return m_size; } bool updateTextureSize(); @@ -76,6 +79,7 @@ protected: QColor m_color; QSGDistanceFieldGlyphCache *m_glyph_cache; const QSGDistanceFieldGlyphCache::Texture *m_texture; + qreal m_fontScale; }; class QSGDistanceFieldStyledTextMaterial : public QSGDistanceFieldTextMaterial -- cgit v1.2.3