Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/painting/qpathclipper_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    8888
    8989    static bool pathToRect(const QPainterPath &path, QRectF *rect = 0);
     90    static QPainterPath intersect(const QPainterPath &path, const QRectF &rect);
    9091
    9192private:
     
    148149    int second;
    149150
    150     qreal angle;
    151     qreal invAngle;
    152 
    153     const QBezier *bezier;
    154     qreal t0;
    155     qreal t1;
     151    double angle;
     152    double invAngle;
    156153
    157154    int next(Traversal traversal, Direction direction) const;
     
    182179
    183180    struct Segment {
    184         Segment(int pathId, int vertexA, int vertexB, int bezierIndex = -1)
     181        Segment(int pathId, int vertexA, int vertexB)
    185182            : path(pathId)
    186             , bezier(bezierIndex)
    187183            , va(vertexA)
    188184            , vb(vertexB)
     
    192188
    193189        int path;
    194         int bezier;
    195190
    196191        // vertices
     
    205200
    206201
    207     QPathSegments();
     202    QPathSegments(int reserve);
    208203
    209204    void setPath(const QPainterPath &path);
     
    216211    const Segment &segmentAt(int index) const;
    217212    const QLineF lineAt(int index) const;
    218     const QBezier *bezierAt(int index) const;
    219213    const QRectF &elementBounds(int index) const;
    220214    int pathId(int index) const;
     
    231225    QDataBuffer<QPointF> m_points;
    232226    QDataBuffer<Segment> m_segments;
    233     QDataBuffer<QBezier> m_beziers;
    234227    QDataBuffer<Intersection> m_intersections;
    235228
     
    272265    TraversalStatus next(const TraversalStatus &status) const;
    273266
    274     int addEdge(const QPointF &a, const QPointF &b, const QBezier *bezier = 0, qreal t0 = 0, qreal t1 = 1);
    275     int addEdge(int vertexA, int vertexB, const QBezier *bezier = 0, qreal t0 = 0, qreal t1 = 1);
     267    int addEdge(const QPointF &a, const QPointF &b);
     268    int addEdge(int vertexA, int vertexB);
    276269
    277270    bool isInside(qreal x, qreal y) const;
     
    285278    void printNode(int i, FILE *handle);
    286279
    287     QBezier bezierFromIndex(int index) const;
    288 
    289280    void removeEdge(int ei);
    290     void addBezierEdge(const QBezier *bezier, const QPointF &a, const QPointF &b, qreal alphaA, qreal alphaB, int path);
    291     void addBezierEdge(const QBezier *bezier, int vertexA, int vertexB, qreal alphaA, qreal alphaB, int path);
    292281
    293282    int insert(const QPathVertex &vertex);
     
    312301    , angle(0)
    313302    , invAngle(0)
    314     , bezier(0)
    315     , t0(0)
    316     , t1(0)
    317303{
    318304    m_next[0][0] = -1;
     
    360346}
    361347
    362 inline QPathSegments::QPathSegments()
     348inline QPathSegments::QPathSegments(int reserve) :
     349    m_points(reserve),
     350    m_segments(reserve),
     351    m_intersections(reserve)
    363352{
    364353}
     
    394383    const Segment &segment = m_segments.at(index);
    395384    return QLineF(m_points.at(segment.va), m_points.at(segment.vb));
    396 }
    397 
    398 inline const QBezier *QPathSegments::bezierAt(int index) const
    399 {
    400     const Segment &segment = m_segments.at(index);
    401     if (segment.bezier >= 0)
    402         return &m_beziers.at(segment.bezier);
    403     else
    404         return 0;
    405385}
    406386
Note: See TracChangeset for help on using the changeset viewer.