diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2013-04-16 11:25:14 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-16 15:33:17 +0200 |
commit | a6ccf8b484596091b9a38ac37dac43c456cdc730 (patch) | |
tree | 6948e87eb8711878d6230b015a23611cbe9904a5 /src/quick/scenegraph/coreapi/qsgnode.cpp | |
parent | 3dbbcc09e98d768a5b7b6c0a498f8aefd9e25b9e (diff) |
Make QSGNode and friends extensible via a d-pointer
Convert the private void *m_reserved to a d_ptr so as to make QSGNode
inherited classes extensible without breaking binary compatibility.
QSGNode and subclasses do not create a private instance by default.
This is required by a follow-up commit where a new member needs to be
added to QSGSimpleTextureNode. Protected ctors have been added to the
superclasses of QSGSimpleTextureNode in the usual fashion.
Change-Id: I30c5f5d057654145d87f18c34c5d13a6ff5f7b11
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgnode.cpp')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgnode.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgnode.cpp b/src/quick/scenegraph/coreapi/qsgnode.cpp index 6a22e0e7f9..8bf9ae8e76 100644 --- a/src/quick/scenegraph/coreapi/qsgnode.cpp +++ b/src/quick/scenegraph/coreapi/qsgnode.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "qsgnode.h" +#include "qsgnode_p.h" #include "qsgrenderer_p.h" #include "qsgnodeupdater_p.h" #include "qsgmaterial.h" @@ -267,6 +268,26 @@ QSGNode::QSGNode(NodeType type) } /*! + * Constructs a new node with the given node type. + * + * \internal + */ +QSGNode::QSGNode(QSGNodePrivate &dd, NodeType type) + : m_parent(0) + , m_type(type) + , m_firstChild(0) + , m_lastChild(0) + , m_nextSibling(0) + , m_previousSibling(0) + , m_subtreeRenderableCount(type == GeometryNodeType || type == RenderNodeType ? 1 : 0) + , m_nodeFlags(OwnedByParent) + , m_dirtyState(0) + , d_ptr(&dd) +{ + init(); +} + +/*! * \internal */ void QSGNode::init() @@ -678,6 +699,18 @@ QSGBasicGeometryNode::QSGBasicGeometryNode(NodeType type) /*! + \internal + */ +QSGBasicGeometryNode::QSGBasicGeometryNode(QSGBasicGeometryNodePrivate &dd, NodeType type) + : QSGNode(dd, type) + , m_geometry(0) + , m_matrix(0) + , m_clip_list(0) +{ +} + + +/*! Deletes this QSGBasicGeometryNode. If the node has the flag QSGNode::OwnsGeometry set, it will also delete the @@ -808,6 +841,19 @@ QSGGeometryNode::QSGGeometryNode() /*! + \internal + */ +QSGGeometryNode::QSGGeometryNode(QSGGeometryNodePrivate &dd) + : QSGBasicGeometryNode(dd, GeometryNodeType) + , m_render_order(0) + , m_material(0) + , m_opaque_material(0) + , m_opacity(1) +{ +} + + +/*! Deletes this geometry node. The flags QSGNode::OwnsMaterial, QSGNode::OwnsOpaqueMaterial and |