Better dirty marking
authorAlan Alpert <alan.alpert@nokia.com>
Fri, 23 Sep 2011 05:52:06 +0000 (15:52 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 29 Sep 2011 04:12:49 +0000 (06:12 +0200)
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>

src/declarative/particles/qsgcustomparticle.cpp
src/declarative/particles/qsgimageparticle.cpp

index 707f680..5580a48 100644 (file)
@@ -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?
         }
     }
 
index 8579bfb..7632384 100644 (file)
@@ -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)