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>
This commit is contained in:
parent
4f598ff062
commit
bec8173347
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user