summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorMikhail Svetkin <mikhail.svetkin@qt.io>2019-01-03 15:57:37 +0100
committerMikhail Svetkin <mikhail.svetkin@qt.io>2019-01-07 13:07:06 +0000
commitbec817334705d86bc4e99af2e7220bb877f036d3 (patch)
tree8078f87a24032b98f3c20e81306a47f01822f1e7 /src/gui
parent4f598ff06276433c24600b7afbdfc35564216e09 (diff)
QPainter: replace an QVector with QVarLengthArray
We usually do not keep a lot of QPainter states, but we need to call 1 allocation and 1 reallocation for keep 4 states. It will be better to use QVarLengthArray with preallocation for 8 states. Change-Id: Iacb6aa7a73807491534b1a915453f218d6e4305b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/painting/qpainter_p.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/painting/qpainter_p.h b/src/gui/painting/qpainter_p.h
index 2d44577310..930180e9fa 100644
--- a/src/gui/painting/qpainter_p.h
+++ b/src/gui/painting/qpainter_p.h
@@ -51,6 +51,7 @@
// We mean it.
//
+#include <QtCore/qvarlengtharray.h>
#include <QtGui/private/qtguiglobal_p.h>
#include "QtGui/qbrush.h"
#include "QtGui/qfont.h"
@@ -202,7 +203,7 @@ public:
QPainterPrivate **d_ptrs;
QPainterState *state;
- QVector<QPainterState*> states;
+ QVarLengthArray<QPainterState *, 8> states;
mutable QPainterDummyState *dummyState;