From: Alan Alpert Date: Fri, 23 Sep 2011 05:52:06 +0000 (+1000) Subject: Better dirty marking X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=600e56ad053362dd5d4150f5dec6b93c2fee575b;p=konrad%2Fqtdeclarative.git 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 Reviewed-by: Martin Jones --- diff --git a/src/declarative/particles/qsgcustomparticle.cpp b/src/declarative/particles/qsgcustomparticle.cpp index 707f680..5580a48 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 8579bfb..7632384 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)