QtGui: don't hold QPainterPath in QList
QPainterPath isn't marked movable , so holding them in a QList is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Change-Id: Id4dae8037401c52fd57a2274e45399a9b70beb69 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>bb10
parent
aa79adef6f
commit
eb47c18081
|
|
@ -1889,10 +1889,10 @@ bool QPathClipper::handleCrossingEdges(QWingedEdge &list, qreal y, ClipperMode m
|
|||
|
||||
namespace {
|
||||
|
||||
QList<QPainterPath> toSubpaths(const QPainterPath &path)
|
||||
QVector<QPainterPath> toSubpaths(const QPainterPath &path)
|
||||
{
|
||||
|
||||
QList<QPainterPath> subpaths;
|
||||
QVector<QPainterPath> subpaths;
|
||||
if (path.isEmpty())
|
||||
return subpaths;
|
||||
|
||||
|
|
@ -2092,7 +2092,7 @@ QPainterPath clip(const QPainterPath &path, qreal t)
|
|||
|
||||
QPainterPath intersectPath(const QPainterPath &path, const QRectF &rect)
|
||||
{
|
||||
QList<QPainterPath> subpaths = toSubpaths(path);
|
||||
QVector<QPainterPath> subpaths = toSubpaths(path);
|
||||
|
||||
QPainterPath result;
|
||||
result.setFillRule(path.fillRule());
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ public:
|
|||
QPointF brushOrigin;
|
||||
QBrush brush;
|
||||
QPen pen;
|
||||
QList<QPainterPath> clips;
|
||||
QVector<QPainterPath> clips;
|
||||
bool clipEnabled;
|
||||
bool allClipped;
|
||||
bool hasPen;
|
||||
|
|
|
|||
Loading…
Reference in New Issue