diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2014-08-17 20:44:39 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-06-24 13:21:40 +0000 |
commit | eb47c180810eaaf9a44664e5b67a12b2624a466e (patch) | |
tree | d074bf27b8b3757b2cc0724c170b852e42fb7c56 /src/gui | |
parent | aa79adef6f7ce985138db535ef4d8fe3325b3fc3 (diff) |
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>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qpathclipper.cpp | 6 | ||||
-rw-r--r-- | src/gui/painting/qpdf_p.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp index 0798418c17..513fdfa2b6 100644 --- a/src/gui/painting/qpathclipper.cpp +++ b/src/gui/painting/qpathclipper.cpp @@ -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()); diff --git a/src/gui/painting/qpdf_p.h b/src/gui/painting/qpdf_p.h index 94e74f30b9..2b50cdc6f7 100644 --- a/src/gui/painting/qpdf_p.h +++ b/src/gui/painting/qpdf_p.h @@ -243,7 +243,7 @@ public: QPointF brushOrigin; QBrush brush; QPen pen; - QList<QPainterPath> clips; + QVector<QPainterPath> clips; bool clipEnabled; bool allClipped; bool hasPen; |