diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2011-09-23 15:52:06 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-29 06:12:49 +0200 |
commit | 600e56ad053362dd5d4150f5dec6b93c2fee575b (patch) | |
tree | 14349ed70e4e9e6dc4c2f65b429b45a61d57b2c6 /src | |
parent | 097d2df377b17413fe271ad722b0bf9df4867339 (diff) |
Better dirty marking
Mark geometry as well per frame, and material when it changes.
Change-Id: I67dd68b67f04f2379534b71f3c8a6e367d9d4bd5
Reviewed-on: http://codereview.qt-project.org/5439
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/particles/qsgcustomparticle.cpp | 3 | ||||
-rw-r--r-- | src/declarative/particles/qsgimageparticle.cpp | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/declarative/particles/qsgcustomparticle.cpp b/src/declarative/particles/qsgcustomparticle.cpp index 707f680db8..5580a4858f 100644 --- a/src/declarative/particles/qsgcustomparticle.cpp +++ b/src/declarative/particles/qsgcustomparticle.cpp @@ -429,9 +429,8 @@ QSGNode *QSGCustomParticle::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDat prepareNextFrame(); if (m_rootNode) { update(); - //### Should I be using dirty geometry too/instead? foreach (QSGGeometryNode* node, m_nodes) - node->markDirty(QSGNode::DirtyMaterial);//done in buildData? + node->markDirty(QSGNode::DirtyGeometry);//done in buildData? } } diff --git a/src/declarative/particles/qsgimageparticle.cpp b/src/declarative/particles/qsgimageparticle.cpp index 8579bfb302..76323840f9 100644 --- a/src/declarative/particles/qsgimageparticle.cpp +++ b/src/declarative/particles/qsgimageparticle.cpp @@ -1148,6 +1148,7 @@ QSGGeometryNode* QSGImageParticle::buildParticleNodes() int count = m_system->m_groupData[gIdx]->size(); QSGGeometryNode* node = new QSGGeometryNode(); node->setMaterial(m_material); + node->markDirty(QSGNode::DirtyMaterial); m_nodes.insert(gIdx, node); m_idxStarts.insert(gIdx, m_lastIdxStart); @@ -1237,9 +1238,8 @@ QSGNode *QSGImageParticle::updatePaintNode(QSGNode *, UpdatePaintNodeData *) prepareNextFrame(); if (m_rootNode) { update(); - //### Should I be using dirty geometry too/instead? foreach (QSGGeometryNode* node, m_nodes) - node->markDirty(QSGNode::DirtyMaterial); + node->markDirty(QSGNode::DirtyGeometry); } } @@ -1298,6 +1298,8 @@ void QSGImageParticle::prepareNextFrame() break; } + foreach (QSGGeometryNode* node, m_nodes) + node->markDirty(QSGNode::DirtyMaterial); } void QSGImageParticle::reloadColor(const Color4ub &c, QSGParticleData* d) |