Ignore:
Timestamp:
Mar 8, 2010, 12:52:58 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.2 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

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

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    9898        {
    9999            int ptsPos = 0;
     100            bool isLines = true;
    100101            for (int i=0; i<path.size(); ++i) {
    101102                const QPainterPath::Element &e = path.at(i);
     
    105106                if (e.type == QPainterPath::CurveToElement)
    106107                    flags |= QVectorPath::CurvedShapeMask;
     108
     109                // This is to check if the path contains only alternating lineTo/moveTo,
     110                // in which case we can set the LinesHint in the path. MoveTo is 0 and
     111                // LineTo is 1 so the i%2 gets us what we want cheaply.
     112                isLines = isLines && e.type == (QPainterPath::ElementType) (i%2);
    107113            }
    108114
     
    112118                flags |= QVectorPath::OddEvenFill;
    113119
    114             if (!convex)
    115                 flags |= QVectorPath::NonConvexShapeMask;
     120            if (isLines)
     121                flags |= QVectorPath::LinesShapeMask;
     122            else {
     123                flags |= QVectorPath::AreaShapeMask;
     124                if (!convex)
     125                    flags |= QVectorPath::NonConvexShapeMask;
     126            }
     127
    116128        }
    117129        QVarLengthArray<QPainterPath::ElementType> elements;
Note: See TracChangeset for help on using the changeset viewer.