diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-05-27 11:36:15 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-05-31 12:42:26 +0000 |
commit | 6f6983aed09a8dce72848b0cf3e3540a04306b08 (patch) | |
tree | e70287c813dfd599f080b89cb39e4b3cecd227a9 /src/quick/scenegraph | |
parent | 9c09687ec017abb9d35b91338ebdf0827dbe4a73 (diff) |
Make matrix and clipList setters' appearance more internal
And start using them from the batch renderer as well.
Change-Id: I20adc3962b06ac712267dc2be95e9e28cea82e21
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 10 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgnode.cpp | 12 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgnode.h | 5 |
3 files changed, 19 insertions, 8 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index e8e1ec7db6..9501b3bb3e 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -356,17 +356,17 @@ void Updater::visitClipNode(Node *n) if (m_roots.last() && m_added > 0) renderer->registerBatchRoot(n, m_roots.last()); - cn->m_clip_list = m_current_clip; + cn->setRendererClipList(m_current_clip); m_current_clip = cn; m_roots << n; m_rootMatrices.add(m_rootMatrices.last() * *m_combined_matrix_stack.last()); extra->matrix = m_rootMatrices.last(); - cn->m_matrix = &extra->matrix; + cn->setRendererMatrix(&extra->matrix); m_combined_matrix_stack << &m_identityMatrix; SHADOWNODE_TRAVERSE(n) visitNode(child); - m_current_clip = cn->m_clip_list; + m_current_clip = cn->clipList(); m_rootMatrices.pop_back(); m_combined_matrix_stack.pop_back(); m_roots.pop_back(); @@ -459,8 +459,8 @@ void Updater::visitGeometryNode(Node *n) { QSGGeometryNode *gn = static_cast<QSGGeometryNode *>(n->sgNode); - gn->m_matrix = m_combined_matrix_stack.last(); - gn->m_clip_list = m_current_clip; + gn->setRendererMatrix(m_combined_matrix_stack.last()); + gn->setRendererClipList(m_current_clip); gn->setInheritedOpacity(m_opacity_stack.last()); if (m_added) { diff --git a/src/quick/scenegraph/coreapi/qsgnode.cpp b/src/quick/scenegraph/coreapi/qsgnode.cpp index 02c0414bc4..f5983fc00d 100644 --- a/src/quick/scenegraph/coreapi/qsgnode.cpp +++ b/src/quick/scenegraph/coreapi/qsgnode.cpp @@ -778,6 +778,18 @@ QSGBasicGeometryNode::~QSGBasicGeometryNode() \internal */ +/*! + \fn void QSGBasicGeometryNode::setRendererMatrix(const QMatrix4x4 *m) + + \internal + */ + +/*! + \fn void QSGBasicGeometryNode::setRendererClipList(const QSGClipNode *c) + + \internal + */ + /*! Sets the geometry of this node to \a geometry. diff --git a/src/quick/scenegraph/coreapi/qsgnode.h b/src/quick/scenegraph/coreapi/qsgnode.h index 627fe6e27f..f7ea6dbe23 100644 --- a/src/quick/scenegraph/coreapi/qsgnode.h +++ b/src/quick/scenegraph/coreapi/qsgnode.h @@ -204,8 +204,8 @@ public: const QMatrix4x4 *matrix() const { return m_matrix; } const QSGClipNode *clipList() const { return m_clip_list; } - void setMatrix(const QMatrix4x4 *m) { m_matrix = m; } - void setClipList(const QSGClipNode *c) { m_clip_list = c; } + void setRendererMatrix(const QMatrix4x4 *m) { m_matrix = m; } + void setRendererClipList(const QSGClipNode *c) { m_clip_list = c; } protected: QSGBasicGeometryNode(NodeType type); @@ -213,7 +213,6 @@ protected: private: friend class QSGNodeUpdater; - friend class QSGBatchRenderer::Updater; QSGGeometry *m_geometry; |