Switch to qvla where makes sense in opengl

For all of these we know in advance that the vast majority of usages
will not exceed a certain number of elements. Also, none of these are
copied or moved ever.

Change-Id: I265afec154939c2fd0d1f902d97a86315ec7bc20
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
bb10
Laszlo Agocs 2020-06-30 09:01:11 +02:00
parent f1ccccb7dd
commit 18eb51b813
3 changed files with 4 additions and 4 deletions

View File

@ -141,7 +141,7 @@ public:
GLenum internalFormat;
QOpenGLSharedResourceGuard *guard;
};
QList<ColorAttachment> colorAttachments;
QVarLengthArray<ColorAttachment, 8> colorAttachments;
inline GLuint fbo() const { return fbo_guard ? fbo_guard->id() : 0; }
};

View File

@ -332,8 +332,8 @@ public:
QTriangulatingStroker stroker;
QDashedStrokeProcessor dasher;
QList<GLuint> unusedVBOSToClean;
QList<GLuint> unusedIBOSToClean;
QVarLengthArray<GLuint, 8> unusedVBOSToClean;
QVarLengthArray<GLuint, 8> unusedIBOSToClean;
const GLfloat *vertexAttribPointers[3];
};

View File

@ -94,7 +94,7 @@ static QRegion deviceRegion(const QRegion &region, QWindow *window, const QPoint
if (offset.isNull() && window->devicePixelRatio() <= 1)
return region;
QList<QRect> rects;
QVarLengthArray<QRect, 4> rects;
rects.reserve(region.rectCount());
for (const QRect &rect : region)
rects.append(deviceRect(rect.translated(offset), window));