43 AreaShapeMask = 0x0001,
44 NonConvexShapeMask = 0x0002,
45 CurvedShapeMask = 0x0004,
46 LinesShapeMask = 0x0008,
47 RectangleShapeMask = 0x0010,
51 LinesHint = LinesShapeMask,
52 RectangleHint = AreaShapeMask | RectangleShapeMask,
53 EllipseHint = AreaShapeMask | CurvedShapeMask,
54 ConvexPolygonHint = AreaShapeMask,
55 PolygonHint = AreaShapeMask | NonConvexShapeMask,
56 RoundedRectHint = AreaShapeMask | CurvedShapeMask,
57 ArbitraryShapeHint = AreaShapeMask | NonConvexShapeMask | CurvedShapeMask,
60 IsCachedHint = 0x0100,
61 ShouldUseCacheHint = 0x0200,
62 ControlPointRect = 0x0400,
67 ImplicitClose = 0x4000,
106 static inline uint polygonFlags(QPaintEngine::PolygonDrawMode mode)
109 case QPaintEngine::ConvexMode:
return ConvexPolygonHint | ImplicitClose;
110 case QPaintEngine::OddEvenMode:
return PolygonHint | OddEvenFill | ImplicitClose;
111 case QPaintEngine::WindingMode:
return PolygonHint | WindingFill | ImplicitClose;
112 case QPaintEngine::PolylineMode:
return PolygonHint | ExplicitOpen;
124 CacheEntry *addCacheData(QPaintEngineEx *engine,
void *data, qvectorpath_cache_cleanup cleanup)
const;
136 template <
typename T>
static inline bool isRect(
const T *pts,
int elementCount) {
137 return (elementCount == 5
138 && pts[0] == pts[8] && pts[1] == pts[9]
139 && pts[0] == pts[6] && pts[2] == pts[4]
140 && pts[1] == pts[3] && pts[5] == pts[7]
141 && pts[0] < pts[4] && pts[1] < pts[5]
144 && pts[0] == pts[6] && pts[2] == pts[4]
145 && pts[1] == pts[3] && pts[5] == pts[7]
146 && pts[0] < pts[4] && pts[1] < pts[5]
150 inline bool isRect()
const
152 const QPainterPath::ElementType *
const types = elements();
154 return (shape() == QVectorPath::RectangleHint)
155 || (isRect(points(), elementCount())
156 && (!types || (types[0] == QPainterPath::MoveToElement
157 && types[1] == QPainterPath::LineToElement
158 && types[2] == QPainterPath::LineToElement
159 && types[3] == QPainterPath::LineToElement)));