diff options
Diffstat (limited to 'src/quick/scenegraph/qsgdistancefieldglyphnode.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgdistancefieldglyphnode.cpp | 16 |
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); |