aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/coreapi/qsgnode.h
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2011-11-17 16:36:53 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-14 04:49:01 +0100
commit9db40605bc3c1ddb2715a53724c6fbc4d026e68b (patch)
tree13caa1b07671dab322ad37cf4d1decca6d795651 /src/quick/scenegraph/coreapi/qsgnode.h
parent5676c6c02a5c3869036dbdbebd2338fd994b9473 (diff)
Made QSGNode flags togglable and added StaticSubtreeGeometry.
The UsePreprocess and ChildrenDoNotOverlap flags could previously only be set during node initialization. They can now be toggled. This change also introduces the StaticSubtreeGeometry flag which is meant to be used to indicate that all the nodes in the sub-tree have static matrices and vertex data. Change-Id: I3b182b81f7010aea636f8f654ef22dab19bc6b29 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgnode.h')
-rw-r--r--src/quick/scenegraph/coreapi/qsgnode.h55
1 files changed, 30 insertions, 25 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgnode.h b/src/quick/scenegraph/coreapi/qsgnode.h
index 41c63e27b6..54e50e48be 100644
--- a/src/quick/scenegraph/coreapi/qsgnode.h
+++ b/src/quick/scenegraph/coreapi/qsgnode.h
@@ -74,30 +74,12 @@ public:
UserNodeType = 1024
};
- enum DirtyFlag {
- DirtyMatrix = 0x0001,
- DirtyClipList = 0x0002,
- DirtyNodeAdded = 0x0004,
- DirtyNodeRemoved = 0x0008,
- DirtyGeometry = 0x0010,
- DirtyMaterial = 0x0040,
- DirtyOpacity = 0x0080,
- DirtyForceUpdate = 0x0100,
-
- DirtyPropagationMask = DirtyMatrix
- | DirtyClipList
- | DirtyNodeAdded
- | DirtyOpacity
- | DirtyForceUpdate
-
- };
- Q_DECLARE_FLAGS(DirtyFlags, DirtyFlag)
-
enum Flag {
// Lower 16 bites reserved for general node
OwnedByParent = 0x0001,
UsePreprocess = 0x0002,
ChildrenDoNotOverlap = 0x0004,
+ StaticSubtreeGeometry = 0x0008, // Subtree nodes have fixed matrix and vertex data.
// Upper 16 bits reserved for node subclasses
@@ -108,6 +90,29 @@ public:
};
Q_DECLARE_FLAGS(Flags, Flag)
+ enum DirtyStateBit {
+ DirtyUsePreprocess = UsePreprocess,
+ DirtyChildrenDoNotOverlap = ChildrenDoNotOverlap,
+ DirtyStaticSubtreeGeometry = StaticSubtreeGeometry,
+
+ DirtyMatrix = 0x0100,
+ DirtyClipList = 0x0200,
+ DirtyNodeAdded = 0x0400,
+ DirtyNodeRemoved = 0x0800,
+ DirtyGeometry = 0x1000,
+ DirtyMaterial = 0x2000,
+ DirtyOpacity = 0x4000,
+ DirtyForceUpdate = 0x8000,
+
+ DirtyPropagationMask = DirtyMatrix
+ | DirtyClipList
+ | DirtyNodeAdded
+ | DirtyOpacity
+ | DirtyForceUpdate
+
+ };
+ Q_DECLARE_FLAGS(DirtyState, DirtyStateBit)
+
QSGNode();
virtual ~QSGNode();
@@ -129,9 +134,9 @@ public:
inline NodeType type() const { return m_type; }
- void clearDirty() { m_flags = 0; }
- void markDirty(DirtyFlags flags);
- DirtyFlags dirtyFlags() const { return m_flags; }
+ void clearDirty() { m_dirtyState = 0; }
+ void markDirty(DirtyState bits);
+ DirtyState dirtyState() const { return m_dirtyState; }
virtual bool isSubtreeBlocked() const;
@@ -163,12 +168,12 @@ private:
int m_subtreeGeometryCount;
Flags m_nodeFlags;
- DirtyFlags m_flags;
+ DirtyState m_dirtyState;
void *m_reserved;
};
-Q_DECLARE_OPERATORS_FOR_FLAGS(QSGNode::DirtyFlags)
+Q_DECLARE_OPERATORS_FOR_FLAGS(QSGNode::DirtyState)
Q_DECLARE_OPERATORS_FOR_FLAGS(QSGNode::Flags)
class Q_QUICK_EXPORT QSGBasicGeometryNode : public QSGNode
@@ -284,7 +289,7 @@ public:
~QSGRootNode();
private:
- void notifyNodeChange(QSGNode *node, DirtyFlags flags);
+ void notifyNodeChange(QSGNode *node, DirtyState state);
friend class QSGRenderer;
friend class QSGNode;