diff options
author | Marc Mutz <[email protected]> | 2019-06-06 18:19:14 +0200 |
---|---|---|
committer | Marc Mutz <[email protected]> | 2019-06-06 18:19:16 +0200 |
commit | 7d98307788dfe12d56a660df29c4451534e20f3c (patch) | |
tree | 3e6b98a871e61212ab8c42d3d6bb33e4f3d34b8c /src | |
parent | 8de93acc2b3a0abafaad3aec0c95f22d36bc2f62 (diff) |
Replace remaining QLinkedLists with QVector
In both cases, the container holds pointers, so stability of
references can be ruled out as a cause for using linked lists. Both
containers are also only ever appended to and then consumed, so there
are no insertions in the middle that a linked list may speed up. Last,
it also cannot be the sheer size of the container, as QLinkedList has
3x the memory consumption of a vector.
We conclude that none of the things that make QLinkedList a container
of choice apply here, so we can use a QVector instead.
In QSGAbstractSoftwareRenderer, there was an accessor for the linked
list member, but it appears unused, so was removed.
Change-Id: I273f89c0d1267444019088371a5eb0b3b32a763c
Reviewed-by: Shawn Rutledge <[email protected]>
Reviewed-by: Lars Knoll <[email protected]>
Diffstat (limited to 'src')
3 files changed, 2 insertions, 9 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp index 2e5fdbbe6b..d715d900ba 100644 --- a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp @@ -77,11 +77,6 @@ QSGSoftwareRenderableNode *QSGAbstractSoftwareRenderer::renderableNode(QSGNode * return m_nodes.value(node, nullptr); } -const QLinkedList<QSGSoftwareRenderableNode*> &QSGAbstractSoftwareRenderer::renderableNodes() const -{ - return m_renderableNodes; -} - void QSGAbstractSoftwareRenderer::addNodeMapping(QSGNode *node, QSGSoftwareRenderableNode *renderableNode) { m_nodes.insert(node, renderableNode); diff --git a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h index 99204ef25e..6780aac17e 100644 --- a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h +++ b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h @@ -54,7 +54,6 @@ #include <private/qsgrenderer_p.h> #include <QtCore/QHash> -#include <QtCore/QLinkedList> QT_BEGIN_NAMESPACE @@ -88,7 +87,6 @@ protected: QRect backgroundRect(); // only known after calling optimizeRenderList() bool isOpaque() const { return m_isOpaque; } - const QLinkedList<QSGSoftwareRenderableNode*> &renderableNodes() const; private: void nodeAdded(QSGNode *node); @@ -99,7 +97,7 @@ private: void nodeOpacityUpdated(QSGNode *node); QHash<QSGNode*, QSGSoftwareRenderableNode*> m_nodes; - QLinkedList<QSGSoftwareRenderableNode*> m_renderableNodes; + QVector<QSGSoftwareRenderableNode*> m_renderableNodes; QSGSimpleRectNode *m_background; diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.h b/src/quick/scenegraph/qsgdefaultglyphnode_p.h index cfa1c1dad2..cf8746228f 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.h +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.h @@ -77,7 +77,7 @@ private: void setGlyphNodeType(DefaultGlyphNodeType type) { m_glyphNodeType = type; } DefaultGlyphNodeType m_glyphNodeType; - QLinkedList<QSGNode *> m_nodesToDelete; + QVector<QSGNode *> m_nodesToDelete; struct GlyphInfo { QVector<quint32> indexes; |