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