diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-08-09 14:50:07 +0200 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@nokia.com> | 2011-08-11 09:28:45 +0200 |
commit | 2b28e1f18c3d9f8f7c116669049aaffaa220804a (patch) | |
tree | fdb6f51c5e7fd9feea779c07719769e6835d12b7 /src/declarative/items/qsgtextnode.cpp | |
parent | a297bdfc574b757e2f6cebb897a4dddafd6e15a6 (diff) |
Implement VBO caching of larger geometries
Change-Id: If87b70b191a06448287b47d252a288b441af6302
Reviewed-on: http://codereview.qt.nokia.com/2784
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
Diffstat (limited to 'src/declarative/items/qsgtextnode.cpp')
-rw-r--r-- | src/declarative/items/qsgtextnode.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/declarative/items/qsgtextnode.cpp b/src/declarative/items/qsgtextnode.cpp index d36db1b6b6..03a558fe3d 100644 --- a/src/declarative/items/qsgtextnode.cpp +++ b/src/declarative/items/qsgtextnode.cpp @@ -166,9 +166,20 @@ QSGGlyphNode *QSGTextNode::addGlyphs(const QPointF &position, const QGlyphRun &g node->update(); - if (node != prevNode) + // A new node, add it to the graph. + if (node != prevNode) { appendChildNode(node); + /* We flag the geometry as static, but we never call markVertexDataDirty + or markIndexDataDirty on them. This is because all text nodes are + discarded when a change occurs. If we start appending/removing from + existing geometry, then we also need to start marking the geometry as + dirty. + */ + node->geometry()->setIndexDataPattern(QSGGeometry::StaticPattern); + node->geometry()->setVertexDataPattern(QSGGeometry::StaticPattern); + } + return node; } |