diff --git a/src/gui/painting/qdatabuffer_p.h b/src/gui/painting/qdatabuffer_p.h index 11f99fc1b..efdc7909a 100644 --- a/src/gui/painting/qdatabuffer_p.h +++ b/src/gui/painting/qdatabuffer_p.h @@ -106,8 +106,6 @@ public: qSwap(buffer, other.buffer); } - inline QDataBuffer &operator<<(const Type &t) { add(t); return *this; } - private: int capacity; int siz; diff --git a/src/gui/painting/qoutlinemapper.cpp b/src/gui/painting/qoutlinemapper.cpp index 2dcef7d30..da1da1105 100644 --- a/src/gui/painting/qoutlinemapper.cpp +++ b/src/gui/painting/qoutlinemapper.cpp @@ -160,18 +160,18 @@ void QOutlineMapper::endOutline() if (m_txop == QTransform::TxTranslate) { for (int i=0; ix()), - qreal_to_fixed_26_6(e->y()) }; + QT_FT_Vector pt_fixed = { + qreal_to_fixed_26_6(e->x()), + qreal_to_fixed_26_6(e->y()) + }; if (i != 0) - m_contours << m_points.size() - 1; - m_points << pt_fixed; - m_tags << QT_FT_CURVE_TAG_ON; + m_contours.add(m_points.size() - 1); + m_points.add(pt_fixed); + m_tags.add(QT_FT_CURVE_TAG_ON); } break; case QPainterPath::LineToElement: { - QT_FT_Vector pt_fixed = { qreal_to_fixed_26_6(e->x()), - qreal_to_fixed_26_6(e->y()) }; - m_points << pt_fixed; - m_tags << QT_FT_CURVE_TAG_ON; + QT_FT_Vector pt_fixed = { + qreal_to_fixed_26_6(e->x()), + qreal_to_fixed_26_6(e->y()) + }; + m_points.add(pt_fixed); + m_tags.add(QT_FT_CURVE_TAG_ON); } break; case QPainterPath::CurveToElement: { - QT_FT_Vector cp1_fixed = { qreal_to_fixed_26_6(e->x()), - qreal_to_fixed_26_6(e->y()) }; + QT_FT_Vector cp1_fixed = { + qreal_to_fixed_26_6(e->x()), + qreal_to_fixed_26_6(e->y()) + }; ++e; - QT_FT_Vector cp2_fixed = { qreal_to_fixed_26_6((e)->x()), - qreal_to_fixed_26_6((e)->y()) }; + QT_FT_Vector cp2_fixed = { + qreal_to_fixed_26_6((e)->x()), + qreal_to_fixed_26_6((e)->y()) + }; ++e; - QT_FT_Vector ep_fixed = { qreal_to_fixed_26_6((e)->x()), - qreal_to_fixed_26_6((e)->y()) }; + QT_FT_Vector ep_fixed = { + qreal_to_fixed_26_6((e)->x()), + qreal_to_fixed_26_6((e)->y()) + }; - m_points << cp1_fixed << cp2_fixed << ep_fixed; - m_tags << QT_FT_CURVE_TAG_CUBIC - << QT_FT_CURVE_TAG_CUBIC - << QT_FT_CURVE_TAG_ON; + m_points.add(cp1_fixed); + m_points.add(cp2_fixed); + m_points.add(ep_fixed); + m_tags.add(QT_FT_CURVE_TAG_CUBIC); + m_tags.add(QT_FT_CURVE_TAG_CUBIC); + m_tags.add(QT_FT_CURVE_TAG_ON); types += 2; i += 2; @@ -277,16 +289,18 @@ void QOutlineMapper::convertElements(const QPointF *elements, const QPointF *last = elements + element_count; const QPointF *e = elements; while (e < last) { - QT_FT_Vector pt_fixed = { qreal_to_fixed_26_6(e->x()), - qreal_to_fixed_26_6(e->y()) }; - m_points << pt_fixed; - m_tags << QT_FT_CURVE_TAG_ON; + QT_FT_Vector pt_fixed = { + qreal_to_fixed_26_6(e->x()), + qreal_to_fixed_26_6(e->y()) + }; + m_points.add(pt_fixed); + m_tags.add(QT_FT_CURVE_TAG_ON); ++e; } } // close the very last subpath - m_contours << m_points.size() - 1; + m_contours.add(m_points.size() - 1); m_outline.n_contours = m_contours.size(); m_outline.n_points = m_points.size(); diff --git a/src/gui/painting/qoutlinemapper_p.h b/src/gui/painting/qoutlinemapper_p.h index db18d9cb4..16cb0ec06 100644 --- a/src/gui/painting/qoutlinemapper_p.h +++ b/src/gui/painting/qoutlinemapper_p.h @@ -118,8 +118,8 @@ public: #endif closeSubpath(); m_subpath_start = m_elements.size(); - m_elements << pt; - m_element_types << QPainterPath::MoveToElement; + m_elements.add(pt); + m_element_types.add(QPainterPath::MoveToElement); } inline void lineTo(const QPointF &pt) { @@ -127,17 +127,19 @@ public: printf("QOutlineMapper::lineTo() (%f, %f)\n", pt.x(), pt.y()); #endif m_elements.add(pt); - m_element_types << QPainterPath::LineToElement; + m_element_types.add(QPainterPath::LineToElement); } inline void curveTo(const QPointF &cp1, const QPointF &cp2, const QPointF &ep) { #ifdef QT_DEBUG_CONVERT printf("QOutlineMapper::curveTo() (%f, %f)\n", ep.x(), ep.y()); #endif - m_elements << cp1 << cp2 << ep; - m_element_types << QPainterPath::CurveToElement - << QPainterPath::CurveToDataElement - << QPainterPath::CurveToDataElement; + m_elements.add(cp1); + m_elements.add(cp2); + m_elements.add(ep); + m_element_types.add(QPainterPath::CurveToElement); + m_element_types.add(QPainterPath::CurveToDataElement); + m_element_types.add(QPainterPath::CurveToDataElement); } inline void closeSubpath() { @@ -156,7 +158,7 @@ public: if (m_element_types.size()) lineTo(pt); else - m_elements << pt; + m_elements.add(pt); } } diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp index d14142605..c70d71ab2 100644 --- a/src/gui/painting/qpathclipper.cpp +++ b/src/gui/painting/qpathclipper.cpp @@ -741,9 +741,9 @@ void QPathSegments::mergePoints() Q_ASSERT(finder.result() != -1); if (finder.result() >= mergedPoints.size()) - mergedPoints << m_points.at(i); + mergedPoints.add(m_points.at(i)); - pointIndices << finder.result(); + pointIndices.add(finder.result()); } for (int i = 0; i < m_segments.size(); ++i) { @@ -776,7 +776,7 @@ void QWingedEdge::intersectAndAdd() const QPathSegments::Intersection *isect = m_segments.intersectionAt(i); while (isect) { - intersections << *isect; + intersections.add(*isect); if (isect->next) { isect += isect->next; @@ -902,24 +902,24 @@ void QPathSegments::addPath(const QPainterPath &path) if (i > 0 && comparePoints(m_points.at(lastMoveTo), currentPoint)) current = lastMoveTo; else - m_points << currentPoint; + m_points.add(currentPoint); switch (path.elementAt(i).type) { case QPainterPath::MoveToElement: if (hasMoveTo && last != lastMoveTo && !comparePoints(m_points.at(last), m_points.at(lastMoveTo))) - m_segments << Segment(m_pathId, last, lastMoveTo); + m_segments.add(Segment(m_pathId, last, lastMoveTo)); hasMoveTo = true; last = lastMoveTo = current; break; case QPainterPath::LineToElement: - m_segments << Segment(m_pathId, last, current); + m_segments.add(Segment(m_pathId, last, current)); last = current; break; case QPainterPath::CurveToElement: { QBezier bezier = QBezier::fromPoints(m_points.at(last), path.elementAt(i), path.elementAt(i+1), path.elementAt(i+2)); if (isLine(bezier)) { - m_segments << Segment(m_pathId, last, current); + m_segments.add(Segment(m_pathId, last, current)); } else { QRectF bounds = bezier.bounds(); @@ -933,13 +933,13 @@ void QPathSegments::addPath(const QPainterPath &path) currentPoint = bezier.pointAt(t * one_over_threshold_minus_1); int index = m_points.size(); - m_segments << Segment(m_pathId, last, index); + m_segments.add(Segment(m_pathId, last, index)); last = index; - m_points << currentPoint; + m_points.add(currentPoint); } - m_segments << Segment(m_pathId, last, current); + m_segments.add(Segment(m_pathId, last, current)); } } last = current; @@ -952,7 +952,7 @@ void QPathSegments::addPath(const QPainterPath &path) } if (hasMoveTo && last != lastMoveTo && !comparePoints(m_points.at(last), m_points.at(lastMoveTo))) - m_segments << Segment(m_pathId, last, lastMoveTo); + m_segments.add(Segment(m_pathId, last, lastMoveTo)); for (int i = firstSegment; i < m_segments.size(); ++i) { const QLineF line = lineAt(i); @@ -1166,7 +1166,7 @@ int QWingedEdge::addEdge(int fi, int si) if (common >= 0) return common; - m_edges << QPathEdge(fi, si); + m_edges.add(QPathEdge(fi, si)); int ei = m_edges.size() - 1; @@ -1249,7 +1249,7 @@ int QWingedEdge::insert(const QPathVertex &vertex) } } - m_vertices << vertex; + m_vertices.add(vertex); return m_vertices.size() - 1; } diff --git a/src/gui/painting/qpathclipper_p.h b/src/gui/painting/qpathclipper_p.h index 44020690b..64205c747 100644 --- a/src/gui/painting/qpathclipper_p.h +++ b/src/gui/painting/qpathclipper_p.h @@ -334,7 +334,7 @@ inline const QPointF &QPathSegments::pointAt(int i) const inline int QPathSegments::addPoint(const QPointF &point) { - m_points << point; + m_points.add(point); return m_points.size() - 1; } @@ -375,7 +375,7 @@ inline int QPathSegments::intersections() const inline void QPathSegments::addIntersection(int index, const Intersection &intersection) { - m_intersections << intersection; + m_intersections.add(intersection); Segment &segment = m_segments.at(index); if (segment.intersection < 0) { @@ -428,7 +428,7 @@ inline int QWingedEdge::vertexCount() const inline int QWingedEdge::addVertex(const QPointF &p) { - m_vertices << p; + m_vertices.add(p); return m_vertices.size() - 1; } diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index cd019ab1b..4228e4759 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -303,7 +303,7 @@ void qScanConvert(QScanConverter &d, bool allVertical) d.m_active.at(j+1) = d.m_active.at(j); d.m_active.at(j+1) = l; } else { - d.m_active << &d.m_lines.at(line); + d.m_active.add(&d.m_lines.at(line)); } }