aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-07-11 14:51:40 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-07-11 17:24:39 +0200
commit13374ceb165c44658aa97890c37b206859c9a31c (patch)
tree562362b196a459ee3449a5a1e60e5216a9dd6984 /src/quick/scenegraph/qsgdistancefieldglyphnode.cpp
parentae47deba4c943c496412530a8d2a5a688ae12038 (diff)
parentb5d18be5a03406d0aac83856dd41e1525fd14a28 (diff)
Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Diffstat (limited to 'src/quick/scenegraph/qsgdistancefieldglyphnode.cpp')
-rw-r--r--src/quick/scenegraph/qsgdistancefieldglyphnode.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp b/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp
index ae6336718e..0fa680a244 100644
--- a/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp
+++ b/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp
@@ -224,15 +224,19 @@ void QSGDistanceFieldGlyphNode::updateGeometry()
const QPointF position = positions.at(i);
const QSGDistanceFieldGlyphCache::Texture *texture = m_glyph_cache->glyphTexture(glyphIndex);
- if (texture->textureId && !m_texture)
+ if ((!texture->rhiBased && texture->textureId && !m_texture)
+ || (texture->rhiBased && texture->texture && !m_texture))
+ {
m_texture = texture;
+ }
// As we use UNSIGNED_SHORT indexing in the geometry, we overload the
- // "glyphsInOtherTextures" concept as overflow for if there are more than
- // 65536 vertices to render which would otherwise exceed the maximum index
- // size. This will cause sub-nodes to be recursively created to handle any
- // number of glyphs.
- if (m_texture != texture || vp.size() >= 65536) {
+ // "glyphsInOtherTextures" concept as overflow for if there are more
+ // than 65535 vertices to render which would otherwise exceed the
+ // maximum index size. (leave 0xFFFF unused in order not to clash with
+ // primitive restart) This will cause sub-nodes to be recursively
+ // created to handle any number of glyphs.
+ if (m_texture != texture || vp.size() >= 65535) {
if (texture->textureId) {
GlyphInfo &glyphInfo = glyphsInOtherTextures[texture];
glyphInfo.indexes.append(glyphIndex);