aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/scenegraph/coreapi/qsgnode.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/scenegraph/coreapi/qsgnode.h')
-rw-r--r--src/declarative/scenegraph/coreapi/qsgnode.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/declarative/scenegraph/coreapi/qsgnode.h b/src/declarative/scenegraph/coreapi/qsgnode.h
index a391b55bc5..cee6b76869 100644
--- a/src/declarative/scenegraph/coreapi/qsgnode.h
+++ b/src/declarative/scenegraph/coreapi/qsgnode.h
@@ -118,13 +118,18 @@ public:
QSGNode *parent() const { return m_parent; }
void removeChildNode(QSGNode *node);
+ void removeAllChildNodes();
void prependChildNode(QSGNode *node);
void appendChildNode(QSGNode *node);
void insertChildNodeBefore(QSGNode *node, QSGNode *before);
void insertChildNodeAfter(QSGNode *node, QSGNode *after);
- int childCount() const { return m_children.size(); }
- QSGNode *childAtIndex(int i) const { return m_children.at(i); }
+ int childCount() const;
+ QSGNode *childAtIndex(int i) const;
+ QSGNode *firstChild() const { return m_firstChild; }
+ QSGNode *lastChild() const { return m_lastChild; }
+ QSGNode *nextSibling() const { return m_nextSibling; }
+ QSGNode* previousSibling() const { return m_previousSibling; }
inline NodeType type() const { return m_type; }
@@ -132,7 +137,7 @@ public:
void markDirty(DirtyFlags flags);
DirtyFlags dirtyFlags() const { return m_flags; }
- virtual bool isSubtreeBlocked() const { return false; }
+ virtual bool isSubtreeBlocked() const;
Flags flags() const { return m_nodeFlags; }
void setFlag(Flag, bool = true);
@@ -147,20 +152,19 @@ public:
protected:
QSGNode(NodeType type);
- // When a node is destroyed, it will detach from the scene graph and the renderer will be
- // notified about the change. If the node is detached in the base node's destructor, the
- // renderer can't safely cast the node to its original type, since at this point it has been
- // partly destroyed already. To solve this problem, all the node destructors must call a common
- // destroy method.
-
- void destroy();
-
private:
+ friend class QSGRootNode;
+
void init();
+ void destroy();
QSGNode *m_parent;
NodeType m_type;
- QList<QSGNode *> m_children;
+ QSGNode *m_firstChild;
+ QSGNode *m_lastChild;
+ QSGNode *m_nextSibling;
+ QSGNode *m_previousSibling;
+ int m_subtreeGeometryCount;
Flags m_nodeFlags;
DirtyFlags m_flags;