aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2011-06-10 14:03:55 +0200
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2011-06-10 14:03:55 +0200
commit25af39e9e37109bf79f3b437a6f799aedf399bc4 (patch)
tree25fab00b232778757d2b144051ba2d7bc423dda3
parent5cc65fef81759971e99a45b27186dde697d22b99 (diff)
Cut off blocked sub-trees one node earlier.
Do not even enter the blocked node.
-rw-r--r--src/declarative/scenegraph/coreapi/qsgnode.cpp7
-rw-r--r--src/declarative/scenegraph/coreapi/qsgnodeupdater.cpp10
2 files changed, 8 insertions, 9 deletions
diff --git a/src/declarative/scenegraph/coreapi/qsgnode.cpp b/src/declarative/scenegraph/coreapi/qsgnode.cpp
index 347aad61bc..66ce836565 100644
--- a/src/declarative/scenegraph/coreapi/qsgnode.cpp
+++ b/src/declarative/scenegraph/coreapi/qsgnode.cpp
@@ -939,19 +939,18 @@ void QSGOpacityNode::setCombinedOpacity(qreal opacity)
/*!
- For performance reasons, we block the subtree when the nested opacity
- gets below a certain threshold.
+ For performance reasons, we block the subtree when the opacity
+ is below a certain threshold.
\internal
*/
bool QSGOpacityNode::isSubtreeBlocked() const
{
- return QSGNode::isSubtreeBlocked() || m_combined_opacity < 0.001;
+ return QSGNode::isSubtreeBlocked() || m_opacity < 0.001;
}
-
/*!
\class QSGNodeVisitor
\brief The QSGNodeVisitor class is a helper class for traversing the scene graph.
diff --git a/src/declarative/scenegraph/coreapi/qsgnodeupdater.cpp b/src/declarative/scenegraph/coreapi/qsgnodeupdater.cpp
index 326fd82c48..a6657bf67e 100644
--- a/src/declarative/scenegraph/coreapi/qsgnodeupdater.cpp
+++ b/src/declarative/scenegraph/coreapi/qsgnodeupdater.cpp
@@ -223,11 +223,9 @@ void QSGNodeUpdater::leaveOpacityNode(QSGOpacityNode *o)
void QSGNodeUpdater::visitChildren(QSGNode *n)
{
- if (!n->isSubtreeBlocked()) {
- int count = n->childCount();
- for (int i = 0; i < count; ++i)
- visitNode(n->childAtIndex(i));
- }
+ int count = n->childCount();
+ for (int i = 0; i < count; ++i)
+ visitNode(n->childAtIndex(i));
}
void QSGNodeUpdater::visitNode(QSGNode *n)
@@ -238,6 +236,8 @@ void QSGNodeUpdater::visitNode(QSGNode *n)
if (!n->dirtyFlags() && !m_force_update)
return;
+ if (n->isSubtreeBlocked())
+ return;
bool forceUpdate = n->dirtyFlags() & (QSGNode::DirtyNodeAdded | QSGNode::DirtyForceUpdate);
if (forceUpdate)