qpaintengineex.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/painting/qpaintengineex.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5QVectorPath::~QVectorPath()-
6{-
7 if (m_hints & ShouldUseCacheHint
m_hints & ShouldUseCacheHintDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
8 CacheEntry *e = m_cache;-
9 while (e
eDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
10 if (e->data
e->dataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
11 e->cleanup(e->engine, e->data);
never executed: e->cleanup(e->engine, e->data);
0
12 CacheEntry *n = e->next;-
13 delete e;-
14 e = n;-
15 }
never executed: end of block
0
16 }
never executed: end of block
0
17}
never executed: end of block
0
18-
19-
20QRectF QVectorPath::controlPointRect() const-
21{-
22 if (m_hints & ControlPointRect
m_hints & ControlPointRectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
23 return
never executed: return QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2));
QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2));
never executed: return QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2));
0
24-
25 if (m_count == 0
m_count == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
26 m_cp_rect.x1 = m_cp_rect.x2 = m_cp_rect.y1 = m_cp_rect.y2 = 0;-
27 m_hints |= ControlPointRect;-
28 return
never executed: return QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2));
QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2));
never executed: return QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2));
0
29 }-
30 ((!(m_points && m_count > 0)) ? qt_assert("m_points && m_count > 0",__FILE__,88) : qt_noop());-
31-
32 const qreal *pts = m_points;-
33 m_cp_rect.x1 = m_cp_rect.x2 = *pts;-
34 ++pts;-
35 m_cp_rect.y1 = m_cp_rect.y2 = *pts;-
36 ++pts;-
37-
38 const qreal *epts = m_points + (m_count << 1);-
39 while (pts < epts
pts < eptsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
40 qreal x = *pts;-
41 if (x < m_cp_rect.x1
x < m_cp_rect.x1Description
TRUEnever evaluated
FALSEnever evaluated
) m_cp_rect.x1 = x;
never executed: m_cp_rect.x1 = x;
0
42 else if (x > m_cp_rect.x2
x > m_cp_rect.x2Description
TRUEnever evaluated
FALSEnever evaluated
) m_cp_rect.x2 = x;
never executed: m_cp_rect.x2 = x;
0
43 ++pts;-
44-
45 qreal y = *pts;-
46 if (y < m_cp_rect.y1
y < m_cp_rect.y1Description
TRUEnever evaluated
FALSEnever evaluated
) m_cp_rect.y1 = y;
never executed: m_cp_rect.y1 = y;
0
47 else if (y > m_cp_rect.y2
y > m_cp_rect.y2Description
TRUEnever evaluated
FALSEnever evaluated
) m_cp_rect.y2 = y;
never executed: m_cp_rect.y2 = y;
0
48 ++pts;-
49 }
never executed: end of block
0
50-
51 m_hints |= ControlPointRect;-
52 return
never executed: return QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2));
QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2));
never executed: return QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2));
0
53}-
54-
55-
56QVectorPath::CacheEntry *QVectorPath::addCacheData(QPaintEngineEx *engine, void *data,-
57 qvectorpath_cache_cleanup cleanup) const{-
58 ((!(!lookupCacheData(engine))) ? qt_assert("!lookupCacheData(engine)",__FILE__,116) : qt_noop());-
59 if ((
(m_hints & IsCachedHint) == 0Description
TRUEnever evaluated
FALSEnever evaluated
m_hints & IsCachedHint) == 0
(m_hints & IsCachedHint) == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
60 m_cache = 0;-
61 m_hints |= IsCachedHint;-
62 }
never executed: end of block
0
63 CacheEntry *e = new CacheEntry;-
64 e->engine = engine;-
65 e->data = data;-
66 e->cleanup = cleanup;-
67 e->next = m_cache;-
68 m_cache = e;-
69 return
never executed: return m_cache;
m_cache;
never executed: return m_cache;
0
70}-
71-
72-
73const QVectorPath &qtVectorPathForPath(const QPainterPath &path)-
74{-
75 ((!(path.d_func())) ? qt_assert("path.d_func()",__FILE__,133) : qt_noop());-
76 return
never executed: return path.d_func()->vectorPath();
path.d_func()->vectorPath();
never executed: return path.d_func()->vectorPath();
0
77}-
78-
79-
80QDebug __attribute__((visibility("default"))) &operator<<(QDebug &s, const QVectorPath &path)-
81{-
82 QRectF rf = path.controlPointRect();-
83 s << "QVectorPath(size:" << path.elementCount()-
84 << " hints:" << hex << path.hints()-
85 << rf << ')';-
86 return
never executed: return s;
s;
never executed: return s;
0
87}-
88struct StrokeHandler {-
89 StrokeHandler(int reserve) : pts(reserve), types(reserve) {}
never executed: end of block
0
90 QDataBuffer<qreal> pts;-
91 QDataBuffer<QPainterPath::ElementType> types;-
92};-
93-
94-
95QPaintEngineExPrivate::QPaintEngineExPrivate()-
96 : dasher(&stroker),-
97 strokeHandler(0),-
98 activeStroker(0),-
99 strokerPen(Qt::NoPen)-
100{-
101}
never executed: end of block
0
102-
103-
104QPaintEngineExPrivate::~QPaintEngineExPrivate()-
105{-
106 delete strokeHandler;-
107}
never executed: end of block
0
108-
109-
110void QPaintEngineExPrivate::replayClipOperations()-
111{-
112 QPaintEngineEx * const q = q_func();-
113-
114 QPainter *p = q->painter();-
115 if (!p
!pDescription
TRUEnever evaluated
FALSEnever evaluated
|| !p->d_ptr
!p->d_ptrDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
116 return;
never executed: return;
0
117-
118 const QVector<QPainterClipInfo> &clipInfo = p->d_ptr->state->clipInfo;-
119-
120 QTransform transform = q->state()->matrix;-
121-
122 for (const QPainterClipInfo &info : clipInfo) {-
123-
124 if (info.matrix != q->state()->matrix
info.matrix !=...tate()->matrixDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
125 q->state()->matrix = info.matrix;-
126 q->transformChanged();-
127 }
never executed: end of block
0
128-
129 switch (info.clipType) {-
130 case
never executed: case QPainterClipInfo::RegionClip:
QPainterClipInfo::RegionClip:
never executed: case QPainterClipInfo::RegionClip:
0
131 q->clip(info.region, info.operation);-
132 break;
never executed: break;
0
133 case
never executed: case QPainterClipInfo::PathClip:
QPainterClipInfo::PathClip:
never executed: case QPainterClipInfo::PathClip:
0
134 q->clip(info.path, info.operation);-
135 break;
never executed: break;
0
136 case
never executed: case QPainterClipInfo::RectClip:
QPainterClipInfo::RectClip:
never executed: case QPainterClipInfo::RectClip:
0
137 q->clip(info.rect, info.operation);-
138 break;
never executed: break;
0
139 case
never executed: case QPainterClipInfo::RectFClip:
QPainterClipInfo::RectFClip:
never executed: case QPainterClipInfo::RectFClip:
{
0
140 qreal right = info.rectf.x() + info.rectf.width();-
141 qreal bottom = info.rectf.y() + info.rectf.height();-
142 qreal pts[] = { info.rectf.x(), info.rectf.y(),-
143 right, info.rectf.y(),-
144 right, bottom,-
145 info.rectf.x(), bottom };-
146 QVectorPath vp(pts, 4, 0, QVectorPath::RectangleHint);-
147 q->clip(vp, info.operation);-
148 break;
never executed: break;
0
149 }-
150 }-
151 }
never executed: end of block
0
152-
153 if (transform != q->state()->matrix
transform != q...tate()->matrixDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
154 q->state()->matrix = transform;-
155 q->transformChanged();-
156 }
never executed: end of block
0
157}
never executed: end of block
0
158-
159-
160bool QPaintEngineExPrivate::hasClipOperations() const-
161{-
162 const QPaintEngineEx * const q = q_func();-
163-
164 QPainter *p = q->painter();-
165 if (!p
!pDescription
TRUEnever evaluated
FALSEnever evaluated
|| !p->d_ptr
!p->d_ptrDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
166 return
never executed: return false;
false;
never executed: return false;
0
167-
168 return
never executed: return !p->d_ptr->state->clipInfo.isEmpty();
!p->d_ptr->state->clipInfo.isEmpty();
never executed: return !p->d_ptr->state->clipInfo.isEmpty();
0
169}-
170-
171-
172-
173-
174-
175-
176-
177static const QPainterPath::ElementType qpaintengineex_ellipse_types[] = {-
178 QPainterPath::MoveToElement,-
179 QPainterPath::CurveToElement,-
180 QPainterPath::CurveToDataElement,-
181 QPainterPath::CurveToDataElement,-
182-
183 QPainterPath::CurveToElement,-
184 QPainterPath::CurveToDataElement,-
185 QPainterPath::CurveToDataElement,-
186-
187 QPainterPath::CurveToElement,-
188 QPainterPath::CurveToDataElement,-
189 QPainterPath::CurveToDataElement,-
190-
191 QPainterPath::CurveToElement,-
192 QPainterPath::CurveToDataElement,-
193 QPainterPath::CurveToDataElement-
194};-
195-
196static const QPainterPath::ElementType qpaintengineex_line_types_16[] = {-
197 QPainterPath::MoveToElement, QPainterPath::LineToElement,-
198 QPainterPath::MoveToElement, QPainterPath::LineToElement,-
199 QPainterPath::MoveToElement, QPainterPath::LineToElement,-
200 QPainterPath::MoveToElement, QPainterPath::LineToElement,-
201 QPainterPath::MoveToElement, QPainterPath::LineToElement,-
202 QPainterPath::MoveToElement, QPainterPath::LineToElement,-
203 QPainterPath::MoveToElement, QPainterPath::LineToElement,-
204 QPainterPath::MoveToElement, QPainterPath::LineToElement,-
205 QPainterPath::MoveToElement, QPainterPath::LineToElement,-
206 QPainterPath::MoveToElement, QPainterPath::LineToElement,-
207 QPainterPath::MoveToElement, QPainterPath::LineToElement,-
208 QPainterPath::MoveToElement, QPainterPath::LineToElement,-
209 QPainterPath::MoveToElement, QPainterPath::LineToElement,-
210 QPainterPath::MoveToElement, QPainterPath::LineToElement,-
211 QPainterPath::MoveToElement, QPainterPath::LineToElement,-
212 QPainterPath::MoveToElement, QPainterPath::LineToElement-
213};-
214-
215static const QPainterPath::ElementType qpaintengineex_rect4_types_32[] = {-
216 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
217 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
218 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
219 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
220 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
221 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
222 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
223 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
224 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
225 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
226 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
227 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
228 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
229 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
230 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
231 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
232 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
233 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
234 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
235 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
236 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
237 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
238 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
239 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
240 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
241 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
242 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
243 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
244 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
245 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
246 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
247 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement,-
248};-
249-
250-
251static const QPainterPath::ElementType qpaintengineex_roundedrect_types[] = {-
252 QPainterPath::MoveToElement,-
253 QPainterPath::LineToElement,-
254 QPainterPath::CurveToElement,-
255 QPainterPath::CurveToDataElement,-
256 QPainterPath::CurveToDataElement,-
257 QPainterPath::LineToElement,-
258 QPainterPath::CurveToElement,-
259 QPainterPath::CurveToDataElement,-
260 QPainterPath::CurveToDataElement,-
261 QPainterPath::LineToElement,-
262 QPainterPath::CurveToElement,-
263 QPainterPath::CurveToDataElement,-
264 QPainterPath::CurveToDataElement,-
265 QPainterPath::LineToElement,-
266 QPainterPath::CurveToElement,-
267 QPainterPath::CurveToDataElement,-
268 QPainterPath::CurveToDataElement-
269};-
270-
271-
272-
273static void qpaintengineex_moveTo(qreal x, qreal y, void *data) {-
274 ((StrokeHandler *) data)->pts.add(x);-
275 ((StrokeHandler *) data)->pts.add(y);-
276 ((StrokeHandler *) data)->types.add(QPainterPath::MoveToElement);-
277}
never executed: end of block
0
278-
279static void qpaintengineex_lineTo(qreal x, qreal y, void *data) {-
280 ((StrokeHandler *) data)->pts.add(x);-
281 ((StrokeHandler *) data)->pts.add(y);-
282 ((StrokeHandler *) data)->types.add(QPainterPath::LineToElement);-
283}
never executed: end of block
0
284-
285static void qpaintengineex_cubicTo(qreal c1x, qreal c1y, qreal c2x, qreal c2y, qreal ex, qreal ey, void *data) {-
286 ((StrokeHandler *) data)->pts.add(c1x);-
287 ((StrokeHandler *) data)->pts.add(c1y);-
288 ((StrokeHandler *) data)->types.add(QPainterPath::CurveToElement);-
289-
290 ((StrokeHandler *) data)->pts.add(c2x);-
291 ((StrokeHandler *) data)->pts.add(c2y);-
292 ((StrokeHandler *) data)->types.add(QPainterPath::CurveToDataElement);-
293-
294 ((StrokeHandler *) data)->pts.add(ex);-
295 ((StrokeHandler *) data)->pts.add(ey);-
296 ((StrokeHandler *) data)->types.add(QPainterPath::CurveToDataElement);-
297}
never executed: end of block
0
298-
299QPaintEngineEx::QPaintEngineEx()-
300 : QPaintEngine(*new QPaintEngineExPrivate, AllFeatures)-
301{-
302 extended = true;-
303}
never executed: end of block
0
304-
305QPaintEngineEx::QPaintEngineEx(QPaintEngineExPrivate &data)-
306 : QPaintEngine(data, AllFeatures)-
307{-
308 extended = true;-
309}
never executed: end of block
0
310-
311QPainterState *QPaintEngineEx::createState(QPainterState *orig) const-
312{-
313 if (!orig
!origDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
314 return
never executed: return new QPainterState;
new QPainterState;
never executed: return new QPainterState;
0
315 return
never executed: return new QPainterState(orig);
new QPainterState(orig);
never executed: return new QPainterState(orig);
0
316}-
317-
318__attribute__((visibility("default"))) extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale);-
319-
320void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)-
321{-
322-
323-
324-
325-
326 QPaintEngineExPrivate * const d = d_func();-
327-
328 if (path.isEmpty()
path.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
329 return;
never executed: return;
0
330-
331 if (!d->strokeHandler
!d->strokeHandlerDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
332 d->strokeHandler = new StrokeHandler(path.elementCount()+4);-
333 d->stroker.setMoveToHook(qpaintengineex_moveTo);-
334 d->stroker.setLineToHook(qpaintengineex_lineTo);-
335 d->stroker.setCubicToHook(qpaintengineex_cubicTo);-
336 }
never executed: end of block
0
337-
338 if (!qpen_fast_equals(pen, d->strokerPen)
!qpen_fast_equ...d->strokerPen)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
339 d->strokerPen = pen;-
340 d->stroker.setJoinStyle(pen.joinStyle());-
341 d->stroker.setCapStyle(pen.capStyle());-
342 d->stroker.setMiterLimit(pen.miterLimit());-
343 qreal penWidth = pen.widthF();-
344 if (penWidth == 0
penWidth == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
345 d->stroker.setStrokeWidth(1);
never executed: d->stroker.setStrokeWidth(1);
0
346 else-
347 d->stroker.setStrokeWidth(penWidth);
never executed: d->stroker.setStrokeWidth(penWidth);
0
348-
349 Qt::PenStyle style = pen.style();-
350 if (style == Qt::SolidLine
style == Qt::SolidLineDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
351 d->activeStroker = &d->stroker;-
352 }
never executed: end of block
else if (style == Qt::NoPen
style == Qt::NoPenDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
353 d->activeStroker = 0;-
354 }
never executed: end of block
else {
0
355 d->dasher.setDashPattern(pen.dashPattern());-
356 d->dasher.setDashOffset(pen.dashOffset());-
357 d->activeStroker = &d->dasher;-
358 }
never executed: end of block
0
359 }-
360-
361 if (!d->activeStroker
!d->activeStrokerDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
362 return;
never executed: return;
0
363 }-
364-
365 if (pen.style() > Qt::SolidLine
pen.style() > Qt::SolidLineDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
366 if (qt_pen_is_cosmetic(pen, state()->renderHints)
qt_pen_is_cosm...->renderHints)Description
TRUEnever evaluated
FALSEnever evaluated
){
0
367 d->activeStroker->setClipRect(d->exDeviceRect);-
368 }
never executed: end of block
else {
0
369 QRectF clipRect = state()->matrix.inverted().mapRect(QRectF(d->exDeviceRect));-
370 d->activeStroker->setClipRect(clipRect);-
371 }
never executed: end of block
0
372 }-
373-
374 const QPainterPath::ElementType *types = path.elements();-
375 const qreal *points = path.points();-
376 int pointCount = path.elementCount();-
377-
378 const qreal *lastPoint = points + (pointCount<<1);-
379-
380 d->strokeHandler->types.reset();-
381 d->strokeHandler->pts.reset();-
382-
383-
384 uint flags = QVectorPath::WindingFill;-
385-
386 if (path.elementCount() > 2
path.elementCount() > 2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
387 flags |= QVectorPath::NonConvexShapeMask;
never executed: flags |= QVectorPath::NonConvexShapeMask;
0
388-
389 if (d->stroker.capStyle() == Qt::RoundCap
d->stroker.cap...= Qt::RoundCapDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->stroker.joinStyle() == Qt::RoundJoin
d->stroker.joi... Qt::RoundJoinDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
390 flags |= QVectorPath::CurvedShapeMask;
never executed: flags |= QVectorPath::CurvedShapeMask;
0
391-
392-
393 if (!qt_pen_is_cosmetic(pen, state()->renderHints)
!qt_pen_is_cos...->renderHints)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
394-
395-
396-
397-
398 d->activeStroker->setCurveThresholdFromTransform(state()->matrix);-
399 d->activeStroker->begin(d->strokeHandler);-
400 if (types
typesDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
401 while (points < lastPoint
points < lastPointDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
402 switch (*types) {-
403 case
never executed: case QPainterPath::MoveToElement:
QPainterPath::MoveToElement:
never executed: case QPainterPath::MoveToElement:
0
404 d->activeStroker->moveTo(points[0], points[1]);-
405 points += 2;-
406 ++types;-
407 break;
never executed: break;
0
408 case
never executed: case QPainterPath::LineToElement:
QPainterPath::LineToElement:
never executed: case QPainterPath::LineToElement:
0
409 d->activeStroker->lineTo(points[0], points[1]);-
410 points += 2;-
411 ++types;-
412 break;
never executed: break;
0
413 case
never executed: case QPainterPath::CurveToElement:
QPainterPath::CurveToElement:
never executed: case QPainterPath::CurveToElement:
0
414 d->activeStroker->cubicTo(points[0], points[1],-
415 points[2], points[3],-
416 points[4], points[5]);-
417 points += 6;-
418 types += 3;-
419 flags |= QVectorPath::CurvedShapeMask;-
420 break;
never executed: break;
0
421 default
never executed: default:
:
never executed: default:
0
422 break;
never executed: break;
0
423 }-
424 }-
425 if (path.hasImplicitClose()
path.hasImplicitClose()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
426 d->activeStroker->lineTo(path.points()[0], path.points()[1]);
never executed: d->activeStroker->lineTo(path.points()[0], path.points()[1]);
0
427-
428 }
never executed: end of block
else {
0
429 d->activeStroker->moveTo(points[0], points[1]);-
430 points += 2;-
431 while (points < lastPoint
points < lastPointDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
432 d->activeStroker->lineTo(points[0], points[1]);-
433 points += 2;-
434 }
never executed: end of block
0
435 if (path.hasImplicitClose()
path.hasImplicitClose()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
436 d->activeStroker->lineTo(path.points()[0], path.points()[1]);
never executed: d->activeStroker->lineTo(path.points()[0], path.points()[1]);
0
437 }
never executed: end of block
0
438 d->activeStroker->end();-
439-
440 if (!d->strokeHandler->types.size()
!d->strokeHand...->types.size()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
441 return;
never executed: return;
0
442-
443 QVectorPath strokePath(d->strokeHandler->pts.data(),-
444 d->strokeHandler->types.size(),-
445 d->strokeHandler->types.data(),-
446 flags);-
447 fill(strokePath, pen.brush());-
448 }
never executed: end of block
else {
0
449-
450 if (state()->matrix.type() >= QTransform::TxProject
state()->matri...orm::TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
451 QPainterPath painterPath = state()->matrix.map(path.convertToPainterPath());-
452 d->activeStroker->strokePath(painterPath, d->strokeHandler, QTransform());-
453 }
never executed: end of block
else {
0
454 d->activeStroker->setCurveThresholdFromTransform(QTransform());-
455 d->activeStroker->begin(d->strokeHandler);-
456 if (types
typesDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
457 while (points < lastPoint
points < lastPointDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
458 switch (*types) {-
459 case
never executed: case QPainterPath::MoveToElement:
QPainterPath::MoveToElement:
never executed: case QPainterPath::MoveToElement:
{
0
460 QPointF pt = (*(const QPointF *) points) * state()->matrix;-
461 d->activeStroker->moveTo(pt.x(), pt.y());-
462 points += 2;-
463 ++types;-
464 break;
never executed: break;
0
465 }-
466 case
never executed: case QPainterPath::LineToElement:
QPainterPath::LineToElement:
never executed: case QPainterPath::LineToElement:
{
0
467 QPointF pt = (*(const QPointF *) points) * state()->matrix;-
468 d->activeStroker->lineTo(pt.x(), pt.y());-
469 points += 2;-
470 ++types;-
471 break;
never executed: break;
0
472 }-
473 case
never executed: case QPainterPath::CurveToElement:
QPainterPath::CurveToElement:
never executed: case QPainterPath::CurveToElement:
{
0
474 QPointF c1 = ((const QPointF *) points)[0] * state()->matrix;-
475 QPointF c2 = ((const QPointF *) points)[1] * state()->matrix;-
476 QPointF e = ((const QPointF *) points)[2] * state()->matrix;-
477 d->activeStroker->cubicTo(c1.x(), c1.y(), c2.x(), c2.y(), e.x(), e.y());-
478 points += 6;-
479 types += 3;-
480 flags |= QVectorPath::CurvedShapeMask;-
481 break;
never executed: break;
0
482 }-
483 default
never executed: default:
:
never executed: default:
0
484 break;
never executed: break;
0
485 }-
486 }-
487 if (path.hasImplicitClose()
path.hasImplicitClose()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
488 QPointF pt = * ((const QPointF *) path.points()) * state()->matrix;-
489 d->activeStroker->lineTo(pt.x(), pt.y());-
490 }
never executed: end of block
0
491-
492 }
never executed: end of block
else {
0
493 QPointF p = ((const QPointF *)points)[0] * state()->matrix;-
494 d->activeStroker->moveTo(p.x(), p.y());-
495 points += 2;-
496 while (points < lastPoint
points < lastPointDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
497 QPointF p = ((const QPointF *)points)[0] * state()->matrix;-
498 d->activeStroker->lineTo(p.x(), p.y());-
499 points += 2;-
500 }
never executed: end of block
0
501 if (path.hasImplicitClose()
path.hasImplicitClose()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
502 d->activeStroker->lineTo(p.x(), p.y());
never executed: d->activeStroker->lineTo(p.x(), p.y());
0
503 }
never executed: end of block
0
504 d->activeStroker->end();-
505 }
never executed: end of block
0
506-
507 QVectorPath strokePath(d->strokeHandler->pts.data(),-
508 d->strokeHandler->types.size(),-
509 d->strokeHandler->types.data(),-
510 flags);-
511-
512 QTransform xform = state()->matrix;-
513 state()->matrix = QTransform();-
514 transformChanged();-
515-
516 QBrush brush = pen.brush();-
517 if (qbrush_style(brush) != Qt::SolidPattern
qbrush_style(b...::SolidPatternDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
518 brush.setTransform(brush.transform() * xform);
never executed: brush.setTransform(brush.transform() * xform);
0
519-
520 fill(strokePath, brush);-
521-
522 state()->matrix = xform;-
523 transformChanged();-
524 }
never executed: end of block
0
525}-
526-
527void QPaintEngineEx::draw(const QVectorPath &path)-
528{-
529 const QBrush &brush = state()->brush;-
530 if (qbrush_style(brush) != Qt::NoBrush
qbrush_style(b...!= Qt::NoBrushDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
531 fill(path, brush);
never executed: fill(path, brush);
0
532-
533 const QPen &pen = state()->pen;-
534 if (qpen_style(pen) != Qt::NoPen
qpen_style(pen) != Qt::NoPenDescription
TRUEnever evaluated
FALSEnever evaluated
&& qbrush_style(qpen_brush(pen)) != Qt::NoBrush
qbrush_style(q...!= Qt::NoBrushDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
535 stroke(path, pen);
never executed: stroke(path, pen);
0
536}
never executed: end of block
0
537-
538-
539void QPaintEngineEx::clip(const QRect &r, Qt::ClipOperation op)-
540{-
541 qreal right = r.x() + r.width();-
542 qreal bottom = r.y() + r.height();-
543 qreal pts[] = { qreal(r.x()), qreal(r.y()),-
544 right, qreal(r.y()),-
545 right, bottom,-
546 qreal(r.x()), bottom,-
547 qreal(r.x()), qreal(r.y()) };-
548 QVectorPath vp(pts, 5, 0, QVectorPath::RectangleHint);-
549 clip(vp, op);-
550}
never executed: end of block
0
551-
552void QPaintEngineEx::clip(const QRegion &region, Qt::ClipOperation op)-
553{-
554 if (region.rectCount() == 1
region.rectCount() == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
555 clip(region.boundingRect(), op);
never executed: clip(region.boundingRect(), op);
0
556-
557 QVector<QRect> rects = region.rects();-
558 if (rects.size() <= 32
rects.size() <= 32Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
559 qreal pts[2*32*4];-
560 int pos = 0;-
561 for (QVector<QRect>::const_iterator i = rects.constBegin(); i != rects.constEnd()
i != rects.constEnd()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
562 qreal x1 = i->x();-
563 qreal y1 = i->y();-
564 qreal x2 = i->x() + i->width();-
565 qreal y2 = i->y() + i->height();-
566-
567 pts[pos++] = x1;-
568 pts[pos++] = y1;-
569-
570 pts[pos++] = x2;-
571 pts[pos++] = y1;-
572-
573 pts[pos++] = x2;-
574 pts[pos++] = y2;-
575-
576 pts[pos++] = x1;-
577 pts[pos++] = y2;-
578 }
never executed: end of block
0
579 QVectorPath vp(pts, rects.size() * 4, qpaintengineex_rect4_types_32);-
580 clip(vp, op);-
581 }
never executed: end of block
else {
0
582 QVarLengthArray<qreal> pts(rects.size() * 2 * 4);-
583 QVarLengthArray<QPainterPath::ElementType> types(rects.size() * 4);-
584 int ppos = 0;-
585 int tpos = 0;-
586-
587 for (QVector<QRect>::const_iterator i = rects.constBegin(); i != rects.constEnd()
i != rects.constEnd()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
588 qreal x1 = i->x();-
589 qreal y1 = i->y();-
590 qreal x2 = i->x() + i->width();-
591 qreal y2 = i->y() + i->height();-
592-
593 pts[ppos++] = x1;-
594 pts[ppos++] = y1;-
595-
596 pts[ppos++] = x2;-
597 pts[ppos++] = y1;-
598-
599 pts[ppos++] = x2;-
600 pts[ppos++] = y2;-
601-
602 pts[ppos++] = x1;-
603 pts[ppos++] = y2;-
604-
605 types[tpos++] = QPainterPath::MoveToElement;-
606 types[tpos++] = QPainterPath::LineToElement;-
607 types[tpos++] = QPainterPath::LineToElement;-
608 types[tpos++] = QPainterPath::LineToElement;-
609 }
never executed: end of block
0
610-
611 QVectorPath vp(pts.data(), rects.size() * 4, types.data());-
612 clip(vp, op);-
613 }
never executed: end of block
0
614-
615}-
616-
617void QPaintEngineEx::clip(const QPainterPath &path, Qt::ClipOperation op)-
618{-
619 if (path.isEmpty()
path.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
620 QVectorPath vp(0, 0);-
621 clip(vp, op);-
622 }
never executed: end of block
else {
0
623 clip(qtVectorPathForPath(path), op);-
624 }
never executed: end of block
0
625}-
626-
627void QPaintEngineEx::fillRect(const QRectF &r, const QBrush &brush)-
628{-
629 qreal pts[] = { r.x(), r.y(), r.x() + r.width(), r.y(),-
630 r.x() + r.width(), r.y() + r.height(), r.x(), r.y() + r.height() };-
631 QVectorPath vp(pts, 4, 0, QVectorPath::RectangleHint);-
632 fill(vp, brush);-
633}
never executed: end of block
0
634-
635void QPaintEngineEx::fillRect(const QRectF &r, const QColor &color)-
636{-
637 fillRect(r, QBrush(color));-
638}
never executed: end of block
0
639-
640void QPaintEngineEx::drawRects(const QRect *rects, int rectCount)-
641{-
642 for (int i=0; i<rectCount
i<rectCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
643 const QRect &r = rects[i];-
644-
645 qreal right = r.x() + r.width();-
646 qreal bottom = r.y() + r.height();-
647 qreal pts[] = { qreal(r.x()), qreal(r.y()),-
648 right, qreal(r.y()),-
649 right, bottom,-
650 qreal(r.x()), bottom,-
651 qreal(r.x()), qreal(r.y()) };-
652 QVectorPath vp(pts, 5, 0, QVectorPath::RectangleHint);-
653 draw(vp);-
654 }
never executed: end of block
0
655}
never executed: end of block
0
656-
657void QPaintEngineEx::drawRects(const QRectF *rects, int rectCount)-
658{-
659 for (int i=0; i<rectCount
i<rectCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
660 const QRectF &r = rects[i];-
661 qreal right = r.x() + r.width();-
662 qreal bottom = r.y() + r.height();-
663 qreal pts[] = { r.x(), r.y(),-
664 right, r.y(),-
665 right, bottom,-
666 r.x(), bottom,-
667 r.x(), r.y() };-
668 QVectorPath vp(pts, 5, 0, QVectorPath::RectangleHint);-
669 draw(vp);-
670 }
never executed: end of block
0
671}
never executed: end of block
0
672-
673-
674void QPaintEngineEx::drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius,-
675 Qt::SizeMode mode)-
676{-
677 qreal x1 = rect.left();-
678 qreal x2 = rect.right();-
679 qreal y1 = rect.top();-
680 qreal y2 = rect.bottom();-
681-
682 if (mode == Qt::RelativeSize
mode == Qt::RelativeSizeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
683 xRadius = xRadius * rect.width() / 200.;-
684 yRadius = yRadius * rect.height() / 200.;-
685 }
never executed: end of block
0
686-
687 xRadius = qMin(xRadius, rect.width() / 2);-
688 yRadius = qMin(yRadius, rect.height() / 2);-
689-
690 qreal pts[] = {-
691 x1 + xRadius, y1,-
692 x2 - xRadius, y1,-
693 x2 - (1 - qreal(0.5522847498)) * xRadius, y1,-
694 x2, y1 + (1 - qreal(0.5522847498)) * yRadius,-
695 x2, y1 + yRadius,-
696 x2, y2 - yRadius,-
697 x2, y2 - (1 - qreal(0.5522847498)) * yRadius,-
698 x2 - (1 - qreal(0.5522847498)) * xRadius, y2,-
699 x2 - xRadius, y2,-
700 x1 + xRadius, y2,-
701 x1 + (1 - qreal(0.5522847498)) * xRadius, y2,-
702 x1, y2 - (1 - qreal(0.5522847498)) * yRadius,-
703 x1, y2 - yRadius,-
704 x1, y1 + yRadius,-
705 x1, y1 + (1 - qreal(0.5522847498)) * yRadius,-
706 x1 + (1 - qreal(0.5522847498)) * xRadius, y1,-
707 x1 + xRadius, y1-
708 };-
709-
710 QVectorPath path(pts, 17, qpaintengineex_roundedrect_types, QVectorPath::RoundedRectHint);-
711 draw(path);-
712}
never executed: end of block
0
713-
714-
715-
716void QPaintEngineEx::drawLines(const QLine *lines, int lineCount)-
717{-
718 int elementCount = lineCount << 1;-
719 while (elementCount > 0
elementCount > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
720 int count = qMin(elementCount, 32);-
721-
722 qreal pts[64];-
723 int count2 = count<<1;-
724 for (int i=0; i<count2
i<count2Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
725 pts[i] = ((const int *) lines)[i];
never executed: pts[i] = ((const int *) lines)[i];
0
726-
727 QVectorPath path(pts, count, qpaintengineex_line_types_16, QVectorPath::LinesHint);-
728 stroke(path, state()->pen);-
729-
730 elementCount -= 32;-
731 lines += 16;-
732 }
never executed: end of block
0
733}
never executed: end of block
0
734-
735void QPaintEngineEx::drawLines(const QLineF *lines, int lineCount)-
736{-
737 int elementCount = lineCount << 1;-
738 while (elementCount > 0
elementCount > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
739 int count = qMin(elementCount, 32);-
740-
741 QVectorPath path((const qreal *) lines, count, qpaintengineex_line_types_16,-
742 QVectorPath::LinesHint);-
743 stroke(path, state()->pen);-
744-
745 elementCount -= 32;-
746 lines += 16;-
747 }
never executed: end of block
0
748}
never executed: end of block
0
749-
750void QPaintEngineEx::drawEllipse(const QRectF &r)-
751{-
752 qreal pts[26];-
753 union {-
754 qreal *ptr;-
755 QPointF *points;-
756 } x;-
757 x.ptr = pts;-
758-
759 int point_count = 0;-
760 x.points[0] = qt_curves_for_arc(r, 0, -360, x.points + 1, &point_count);-
761 if (point_count == 0
point_count == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
762 return;
never executed: return;
0
763 QVectorPath vp((qreal *) pts, point_count + 1, qpaintengineex_ellipse_types, QVectorPath::EllipseHint);-
764 draw(vp);-
765}
never executed: end of block
0
766-
767void QPaintEngineEx::drawEllipse(const QRect &r)-
768{-
769 drawEllipse(QRectF(r));-
770}
never executed: end of block
0
771-
772void QPaintEngineEx::drawPath(const QPainterPath &path)-
773{-
774 if (!path.isEmpty()
!path.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
775 draw(qtVectorPathForPath(path));
never executed: draw(qtVectorPathForPath(path));
0
776}
never executed: end of block
0
777-
778-
779void QPaintEngineEx::drawPoints(const QPointF *points, int pointCount)-
780{-
781 QPen pen = state()->pen;-
782 if (pen.capStyle() == Qt::FlatCap
pen.capStyle() == Qt::FlatCapDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
783 pen.setCapStyle(Qt::SquareCap);
never executed: pen.setCapStyle(Qt::SquareCap);
0
784-
785 if (pen.brush().isOpaque()
pen.brush().isOpaque()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
786 while (pointCount > 0
pointCount > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
787 int count = qMin(pointCount, 16);-
788 qreal pts[64];-
789 int oset = -1;-
790 for (int i=0; i<count
i<countDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
791 pts[++oset] = points[i].x();-
792 pts[++oset] = points[i].y();-
793 pts[++oset] = points[i].x() + 1/63.;-
794 pts[++oset] = points[i].y();-
795 }
never executed: end of block
0
796 QVectorPath path(pts, count * 2, qpaintengineex_line_types_16, QVectorPath::LinesHint);-
797 stroke(path, pen);-
798 pointCount -= 16;-
799 points += 16;-
800 }
never executed: end of block
0
801 }
never executed: end of block
else {
0
802 for (int i=0; i<pointCount
i<pointCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
803 qreal pts[] = { points[i].x(), points[i].y(), points[i].x() + qreal(1/63.), points[i].y() };-
804 QVectorPath path(pts, 2, 0);-
805 stroke(path, pen);-
806 }
never executed: end of block
0
807 }
never executed: end of block
0
808}-
809-
810void QPaintEngineEx::drawPoints(const QPoint *points, int pointCount)-
811{-
812 QPen pen = state()->pen;-
813 if (pen.capStyle() == Qt::FlatCap
pen.capStyle() == Qt::FlatCapDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
814 pen.setCapStyle(Qt::SquareCap);
never executed: pen.setCapStyle(Qt::SquareCap);
0
815-
816 if (pen.brush().isOpaque()
pen.brush().isOpaque()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
817 while (pointCount > 0
pointCount > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
818 int count = qMin(pointCount, 16);-
819 qreal pts[64];-
820 int oset = -1;-
821 for (int i=0; i<count
i<countDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
822 pts[++oset] = points[i].x();-
823 pts[++oset] = points[i].y();-
824 pts[++oset] = points[i].x() + 1/63.;-
825 pts[++oset] = points[i].y();-
826 }
never executed: end of block
0
827 QVectorPath path(pts, count * 2, qpaintengineex_line_types_16, QVectorPath::LinesHint);-
828 stroke(path, pen);-
829 pointCount -= 16;-
830 points += 16;-
831 }
never executed: end of block
0
832 }
never executed: end of block
else {
0
833 for (int i=0; i<pointCount
i<pointCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
834 qreal pts[] = { qreal(points[i].x()), qreal(points[i].y()),-
835 qreal(points[i].x() +1/63.), qreal(points[i].y()) };-
836 QVectorPath path(pts, 2, 0);-
837 stroke(path, pen);-
838 }
never executed: end of block
0
839 }
never executed: end of block
0
840}-
841-
842-
843void QPaintEngineEx::drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode)-
844{-
845 QVectorPath path((const qreal *) points, pointCount, 0, QVectorPath::polygonFlags(mode));-
846-
847 if (mode == PolylineMode
mode == PolylineModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
848 stroke(path, state()->pen);
never executed: stroke(path, state()->pen);
0
849 else-
850 draw(path);
never executed: draw(path);
0
851}-
852-
853void QPaintEngineEx::drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode)-
854{-
855 int count = pointCount<<1;-
856 QVarLengthArray<qreal> pts(count);-
857-
858 for (int i=0; i<count
i<countDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
859 pts[i] = ((const int *) points)[i];
never executed: pts[i] = ((const int *) points)[i];
0
860-
861 QVectorPath path(pts.data(), pointCount, 0, QVectorPath::polygonFlags(mode));-
862-
863 if (mode == PolylineMode
mode == PolylineModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
864 stroke(path, state()->pen);
never executed: stroke(path, state()->pen);
0
865 else-
866 draw(path);
never executed: draw(path);
0
867-
868}-
869-
870void QPaintEngineEx::drawPixmap(const QPointF &pos, const QPixmap &pm)-
871{-
872 drawPixmap(QRectF(pos, pm.size() / pm.devicePixelRatio()), pm, pm.rect());-
873}
never executed: end of block
0
874-
875void QPaintEngineEx::drawImage(const QPointF &pos, const QImage &image)-
876{-
877 drawImage(QRectF(pos, image.size() / image.devicePixelRatio()), image, image.rect());-
878}
never executed: end of block
0
879-
880void QPaintEngineEx::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s)-
881{-
882 QBrush brush(state()->pen.color(), pixmap);-
883 QTransform xform = QTransform::fromTranslate(r.x() - s.x(), r.y() - s.y());-
884 brush.setTransform(xform);-
885-
886 qreal pts[] = { r.x(), r.y(),-
887 r.x() + r.width(), r.y(),-
888 r.x() + r.width(), r.y() + r.height(),-
889 r.x(), r.y() + r.height() };-
890-
891 QVectorPath path(pts, 4, 0, QVectorPath::RectangleHint);-
892 fill(path, brush);-
893}
never executed: end of block
0
894-
895void QPaintEngineEx::drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount,-
896 const QPixmap &pixmap, QPainter::PixmapFragmentHints )-
897{-
898 if (pixmap.isNull()
pixmap.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
899 return;
never executed: return;
0
900-
901 qreal oldOpacity = state()->opacity;-
902 QTransform oldTransform = state()->matrix;-
903-
904 for (int i = 0; i < fragmentCount
i < fragmentCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
905 QTransform transform = oldTransform;-
906 transform.translate(fragments[i].x, fragments[i].y);-
907 transform.rotate(fragments[i].rotation);-
908 state()->opacity = oldOpacity * fragments[i].opacity;-
909 state()->matrix = transform;-
910 opacityChanged();-
911 transformChanged();-
912-
913 qreal w = fragments[i].scaleX * fragments[i].width;-
914 qreal h = fragments[i].scaleY * fragments[i].height;-
915 QRectF sourceRect(fragments[i].sourceLeft, fragments[i].sourceTop,-
916 fragments[i].width, fragments[i].height);-
917 drawPixmap(QRectF(-0.5 * w, -0.5 * h, w, h), pixmap, sourceRect);-
918 }
never executed: end of block
0
919-
920 state()->opacity = oldOpacity;-
921 state()->matrix = oldTransform;-
922 opacityChanged();-
923 transformChanged();-
924}
never executed: end of block
0
925-
926void QPaintEngineEx::setState(QPainterState *s)-
927{-
928 QPaintEngine::state = s;-
929}
never executed: end of block
0
930-
931-
932void QPaintEngineEx::updateState(const QPaintEngineState &)-
933{-
934-
935}-
936-
937__attribute__((visibility("default"))) QPainterPath qt_painterPathFromVectorPath(const QVectorPath &path)-
938{-
939 const qreal *points = path.points();-
940 const QPainterPath::ElementType *types = path.elements();-
941-
942 QPainterPath p;-
943 if (types
typesDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
944 int id = 0;-
945 for (int i=0; i<path.elementCount()
i<path.elementCount()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
946 switch(types[i]) {-
947 case
never executed: case QPainterPath::MoveToElement:
QPainterPath::MoveToElement:
never executed: case QPainterPath::MoveToElement:
0
948 p.moveTo(QPointF(points[id], points[id+1]));-
949 id+=2;-
950 break;
never executed: break;
0
951 case
never executed: case QPainterPath::LineToElement:
QPainterPath::LineToElement:
never executed: case QPainterPath::LineToElement:
0
952 p.lineTo(QPointF(points[id], points[id+1]));-
953 id+=2;-
954 break;
never executed: break;
0
955 case
never executed: case QPainterPath::CurveToElement:
QPainterPath::CurveToElement:
never executed: case QPainterPath::CurveToElement:
{
0
956 QPointF p1(points[id], points[id+1]);-
957 QPointF p2(points[id+2], points[id+3]);-
958 QPointF p3(points[id+4], points[id+5]);-
959 p.cubicTo(p1, p2, p3);-
960 id+=6;-
961 break;
never executed: break;
0
962 }-
963 case
never executed: case QPainterPath::CurveToDataElement:
QPainterPath::CurveToDataElement:
never executed: case QPainterPath::CurveToDataElement:
0
964 ;-
965 break;
never executed: break;
0
966 }-
967 }
never executed: end of block
0
968 }
never executed: end of block
else {
0
969 p.moveTo(QPointF(points[0], points[1]));-
970 int id = 2;-
971 for (int i=1; i<path.elementCount()
i<path.elementCount()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
972 p.lineTo(QPointF(points[id], points[id+1]));-
973 id+=2;-
974 }
never executed: end of block
0
975 }
never executed: end of block
0
976 if (path.hints() & QVectorPath::WindingFill
path.hints() &...h::WindingFillDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
977 p.setFillRule(Qt::WindingFill);
never executed: p.setFillRule(Qt::WindingFill);
0
978-
979 return
never executed: return p;
p;
never executed: return p;
0
980}-
981-
982void QPaintEngineEx::drawStaticTextItem(QStaticTextItem *staticTextItem)-
983{-
984 QPainterPath path;-
985 path.setFillRule(Qt::WindingFill);-
986-
987 if (staticTextItem->numGlyphs == 0
staticTextItem->numGlyphs == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
988 return;
never executed: return;
0
989-
990 QFontEngine *fontEngine = staticTextItem->fontEngine();-
991 fontEngine->addGlyphsToPath(staticTextItem->glyphs, staticTextItem->glyphPositions,-
992 staticTextItem->numGlyphs, &path, 0);-
993 if (!path.isEmpty()
!path.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
994 QPainterState *s = state();-
995 QPainter::RenderHints oldHints = s->renderHints;-
996 bool changedHints = false;-
997 if (bool(oldHints & QPainter::TextAntialiasing)
bool(oldHints ...tAntialiasing)Description
TRUEnever evaluated
FALSEnever evaluated
0
998 && !bool(fontEngine->fontDef.styleStrategy & QFont::NoAntialias)
!bool(fontEngi...::NoAntialias)Description
TRUEnever evaluated
FALSEnever evaluated
0
999 && !bool(oldHints & QPainter::Antialiasing)
!bool(oldHints...:Antialiasing)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1000 s->renderHints |= QPainter::Antialiasing;-
1001 renderHintsChanged();-
1002 changedHints = true;-
1003 }
never executed: end of block
0
1004-
1005 fill(qtVectorPathForPath(path), s->pen.brush());-
1006-
1007 if (changedHints
changedHintsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1008 s->renderHints = oldHints;-
1009 renderHintsChanged();-
1010 }
never executed: end of block
0
1011 }
never executed: end of block
0
1012}
never executed: end of block
0
1013-
1014bool QPaintEngineEx::requiresPretransformedGlyphPositions(QFontEngine *, const QTransform &) const-
1015{-
1016 return
never executed: return false;
false;
never executed: return false;
0
1017}-
1018-
1019bool QPaintEngineEx::shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const-
1020{-
1021 if (fontEngine->glyphFormat == QFontEngine::Format_ARGB
fontEngine->gl...e::Format_ARGBDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1022 return
never executed: return true;
true;
never executed: return true;
0
1023-
1024 qreal pixelSize = fontEngine->fontDef.pixelSize;-
1025 return
never executed: return (pixelSize * pixelSize * qAbs(m.determinant())) < 64 * 64;
(pixelSize * pixelSize * qAbs(m.determinant())) <
never executed: return (pixelSize * pixelSize * qAbs(m.determinant())) < 64 * 64;
0
1026 64 * 64;
never executed: return (pixelSize * pixelSize * qAbs(m.determinant())) < 64 * 64;
0
1027}-
1028-
1029-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9