diff options
author | Michael Brasser <michael.brasser@live.com> | 2013-08-01 12:38:36 -0500 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-06 08:10:46 +0200 |
commit | 40206588f941ad8eddf1235f0845aec43213c897 (patch) | |
tree | c0c2d22abf4202eb270c4310b9296830be91ad81 /src/quick/items/qquicktextnodeengine_p.h | |
parent | ce65fb47ed53d8ce2a00cdd399bbe8a28c4fb10d (diff) |
Improve memory usage of QQuickTextNode.
The typical number of BinaryTreeNodes needed for a text line should be
much lower than 256.
Task-number: QTBUG-32770
Change-Id: I85aa161eb7cb6e55657213304b7577a0a33f1b67
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/quick/items/qquicktextnodeengine_p.h')
-rw-r--r-- | src/quick/items/qquicktextnodeengine_p.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/quick/items/qquicktextnodeengine_p.h b/src/quick/items/qquicktextnodeengine_p.h index 6a98d6b470..9de71c6a40 100644 --- a/src/quick/items/qquicktextnodeengine_p.h +++ b/src/quick/items/qquicktextnodeengine_p.h @@ -103,13 +103,13 @@ public: int leftChildIndex; int rightChildIndex; - static void insert(QVarLengthArray<BinaryTreeNode> *binaryTree, const QRectF &rect, const QImage &image, qreal ascent, SelectionState selectionState) + static void insert(QVarLengthArray<BinaryTreeNode, 16> *binaryTree, const QRectF &rect, const QImage &image, qreal ascent, SelectionState selectionState) { insert(binaryTree, BinaryTreeNode(rect, image, selectionState, ascent)); } - static void insert(QVarLengthArray<BinaryTreeNode> *binaryTree, const QGlyphRun &glyphRun, SelectionState selectionState, + static void insert(QVarLengthArray<BinaryTreeNode, 16> *binaryTree, const QGlyphRun &glyphRun, SelectionState selectionState, QQuickTextNode::Decorations decorations, const QColor &textColor, const QColor &backgroundColor, const QPointF &position); - static void insert(QVarLengthArray<BinaryTreeNode> *binaryTree, const BinaryTreeNode &binaryTreeNode); - static void inOrder(const QVarLengthArray<BinaryTreeNode> &binaryTree, QVarLengthArray<int> *sortedIndexes, int currentIndex = 0); + static void insert(QVarLengthArray<BinaryTreeNode, 16> *binaryTree, const BinaryTreeNode &binaryTreeNode); + static void inOrder(const QVarLengthArray<BinaryTreeNode, 16> &binaryTree, QVarLengthArray<int> *sortedIndexes, int currentIndex = 0); }; QQuickTextNodeEngine() : m_hasSelection(false), m_hasContents(false) {} @@ -216,7 +216,7 @@ private: QList<QPair<QRectF, QColor> > m_backgrounds; QList<QRectF> m_selectionRects; - QVarLengthArray<BinaryTreeNode> m_currentLineTree; + QVarLengthArray<BinaryTreeNode, 16> m_currentLineTree; QList<TextDecoration> m_lines; QVector<BinaryTreeNode> m_processedNodes; |