From f1f334b831c0144cea0482cf8e0429a9687f047c Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Fri, 23 Jul 2021 23:36:40 +0300 Subject: [PATCH] use QSTACKARRAY() macro in QPaintEngineEx Signed-off-by: Ivailo Monev --- src/gui/painting/qpaintengineex.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index 81294c092..3fde019af 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -25,9 +25,9 @@ #include "qpainterpath_p.h" #include "qfontengine_p.h" #include "qstatictext_p.h" - #include "qvarlengtharray.h" #include "qdebug.h" +#include "qcorecommon_p.h" QT_BEGIN_NAMESPACE @@ -500,7 +500,7 @@ void QPaintEngineEx::clip(const QRegion ®ion, Qt::ClipOperation op) QVector rects = region.rects(); if (rects.size() <= 32) { - qreal pts[2*32*4]; + QSTACKARRAY(qreal, pts, 2 * 32 * 4); int pos = 0; for (QVector::const_iterator i = rects.constBegin(); i != rects.constEnd(); ++i) { qreal x1 = i->x(); @@ -523,8 +523,8 @@ void QPaintEngineEx::clip(const QRegion ®ion, Qt::ClipOperation op) QVectorPath vp(pts, rects.size() * 4, qpaintengineex_rect4_types_32); clip(vp, op); } else { - QVarLengthArray pts(rects.size() * 2 * 4); - QVarLengthArray types(rects.size() * 4); + QSTACKARRAY(qreal, pts, rects.size() * 2 * 4); + QSTACKARRAY(QPainterPath::ElementType, types, rects.size() * 4); int ppos = 0; int tpos = 0; @@ -552,7 +552,7 @@ void QPaintEngineEx::clip(const QRegion ®ion, Qt::ClipOperation op) types[tpos++] = QPainterPath::LineToElement; } - QVectorPath vp(pts.data(), rects.size() * 4, types.data()); + QVectorPath vp(pts, rects.size() * 4, types); clip(vp, op); } @@ -663,7 +663,7 @@ void QPaintEngineEx::drawLines(const QLine *lines, int lineCount) while (elementCount > 0) { const int count = qMin(elementCount, 32); - qreal pts[64]; + QSTACKARRAY(qreal, pts, 64); const int count2 = count<<1; for (int i=0; i 0) { int count = qMin(pointCount, 16); - qreal pts[64]; + QSTACKARRAY(qreal, pts, 64); int oset = -1; for (int i=0; i 0) { int count = qMin(pointCount, 16); - qreal pts[64]; + QSTACKARRAY(qreal, pts, 64); int oset = -1; for (int i=0; i