painting/qpaintengineex.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -
4** Contact: http://www.qt-project.org/legal -
5** -
6** This file is part of the QtGui module of the Qt Toolkit. -
7** -
8** $QT_BEGIN_LICENSE:LGPL$ -
9** Commercial License Usage -
10** Licensees holding valid commercial Qt licenses may use this file in -
11** accordance with the commercial license agreement provided with the -
12** Software or, alternatively, in accordance with the terms contained in -
13** a written agreement between you and Digia. For licensing terms and -
14** conditions see http://qt.digia.com/licensing. For further information -
15** use the contact form at http://qt.digia.com/contact-us. -
16** -
17** GNU Lesser General Public License Usage -
18** Alternatively, this file may be used under the terms of the GNU Lesser -
19** General Public License version 2.1 as published by the Free Software -
20** Foundation and appearing in the file LICENSE.LGPL included in the -
21** packaging of this file. Please review the following information to -
22** ensure the GNU Lesser General Public License version 2.1 requirements -
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -
24** -
25** In addition, as a special exception, Digia gives you certain additional -
26** rights. These rights are described in the Digia Qt LGPL Exception -
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -
28** -
29** GNU General Public License Usage -
30** Alternatively, this file may be used under the terms of the GNU -
31** General Public License version 3.0 as published by the Free Software -
32** Foundation and appearing in the file LICENSE.GPL included in the -
33** packaging of this file. Please review the following information to -
34** ensure the GNU General Public License version 3.0 requirements will be -
35** met: http://www.gnu.org/copyleft/gpl.html. -
36** -
37** -
38** $QT_END_LICENSE$ -
39** -
40****************************************************************************/ -
41 -
42#include "qpaintengineex_p.h" -
43#include "qpainter_p.h" -
44#include "qstroker_p.h" -
45#include "qbezier_p.h" -
46#include <private/qpainterpath_p.h> -
47#include <private/qfontengine_p.h> -
48#include <private/qstatictext_p.h> -
49 -
50#include <qvarlengtharray.h> -
51#include <qdebug.h> -
52 -
53 -
54QT_BEGIN_NAMESPACE -
55 -
56#if !defined(QT_MAX_CACHED_GLYPH_SIZE) -
57# define QT_MAX_CACHED_GLYPH_SIZE 64 -
58#endif -
59 -
60/******************************************************************************* -
61 * -
62 * class QVectorPath -
63 * -
64 */ -
65QVectorPath::~QVectorPath() -
66{ -
67 if (m_hints & ShouldUseCacheHint) {
partially evaluated: m_hints & ShouldUseCacheHint
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:178001
0-178001
68 CacheEntry *e = m_cache;
never executed (the execution status of this line is deduced): CacheEntry *e = m_cache;
-
69 while (e) {
never evaluated: e
0
70 if (e->data)
never evaluated: e->data
0
71 e->cleanup(e->engine, e->data);
never executed: e->cleanup(e->engine, e->data);
0
72 CacheEntry *n = e->next;
never executed (the execution status of this line is deduced): CacheEntry *n = e->next;
-
73 delete e;
never executed (the execution status of this line is deduced): delete e;
-
74 e = n;
never executed (the execution status of this line is deduced): e = n;
-
75 }
never executed: }
0
76 }
never executed: }
0
77}
executed: }
Execution Count:178001
178001
78 -
79 -
80QRectF QVectorPath::controlPointRect() const -
81{ -
82 if (m_hints & ControlPointRect)
evaluated: m_hints & ControlPointRect
TRUEFALSE
yes
Evaluation Count:32797
yes
Evaluation Count:102314
32797-102314
83 return QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2));
executed: return QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2));
Execution Count:32797
32797
84 -
85 if (m_count == 0) {
partially evaluated: m_count == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:102314
0-102314
86 m_cp_rect.x1 = m_cp_rect.x2 = m_cp_rect.y1 = m_cp_rect.y2 = 0;
never executed (the execution status of this line is deduced): m_cp_rect.x1 = m_cp_rect.x2 = m_cp_rect.y1 = m_cp_rect.y2 = 0;
-
87 m_hints |= ControlPointRect;
never executed (the execution status of this line is deduced): m_hints |= ControlPointRect;
-
88 return 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
89 } -
90 Q_ASSERT(m_points && m_count > 0);
executed (the execution status of this line is deduced): qt_noop();
-
91 -
92 const qreal *pts = m_points;
executed (the execution status of this line is deduced): const qreal *pts = m_points;
-
93 m_cp_rect.x1 = m_cp_rect.x2 = *pts;
executed (the execution status of this line is deduced): m_cp_rect.x1 = m_cp_rect.x2 = *pts;
-
94 ++pts;
executed (the execution status of this line is deduced): ++pts;
-
95 m_cp_rect.y1 = m_cp_rect.y2 = *pts;
executed (the execution status of this line is deduced): m_cp_rect.y1 = m_cp_rect.y2 = *pts;
-
96 ++pts;
executed (the execution status of this line is deduced): ++pts;
-
97 -
98 const qreal *epts = m_points + (m_count << 1);
executed (the execution status of this line is deduced): const qreal *epts = m_points + (m_count << 1);
-
99 while (pts < epts) {
evaluated: pts < epts
TRUEFALSE
yes
Evaluation Count:315219
yes
Evaluation Count:102314
102314-315219
100 qreal x = *pts;
executed (the execution status of this line is deduced): qreal x = *pts;
-
101 if (x < m_cp_rect.x1) m_cp_rect.x1 = x;
executed: m_cp_rect.x1 = x;
Execution Count:106992
evaluated: x < m_cp_rect.x1
TRUEFALSE
yes
Evaluation Count:106992
yes
Evaluation Count:208227
106992-208227
102 else if (x > m_cp_rect.x2) m_cp_rect.x2 = x;
executed: m_cp_rect.x2 = x;
Execution Count:102162
evaluated: x > m_cp_rect.x2
TRUEFALSE
yes
Evaluation Count:102162
yes
Evaluation Count:106065
102162-106065
103 ++pts;
executed (the execution status of this line is deduced): ++pts;
-
104 -
105 qreal y = *pts;
executed (the execution status of this line is deduced): qreal y = *pts;
-
106 if (y < m_cp_rect.y1) m_cp_rect.y1 = y;
executed: m_cp_rect.y1 = y;
Execution Count:87034
evaluated: y < m_cp_rect.y1
TRUEFALSE
yes
Evaluation Count:87034
yes
Evaluation Count:228185
87034-228185
107 else if (y > m_cp_rect.y2) m_cp_rect.y2 = y;
executed: m_cp_rect.y2 = y;
Execution Count:88538
evaluated: y > m_cp_rect.y2
TRUEFALSE
yes
Evaluation Count:88538
yes
Evaluation Count:139647
88538-139647
108 ++pts;
executed (the execution status of this line is deduced): ++pts;
-
109 }
executed: }
Execution Count:315219
315219
110 -
111 m_hints |= ControlPointRect;
executed (the execution status of this line is deduced): m_hints |= ControlPointRect;
-
112 return QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2));
executed: return QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2));
Execution Count:102314
102314
113} -
114 -
115 -
116QVectorPath::CacheEntry *QVectorPath::addCacheData(QPaintEngineEx *engine, void *data, -
117 qvectorpath_cache_cleanup cleanup) const{ -
118 Q_ASSERT(!lookupCacheData(engine));
never executed (the execution status of this line is deduced): qt_noop();
-
119 if ((m_hints & IsCachedHint) == 0) {
never evaluated: (m_hints & IsCachedHint) == 0
0
120 m_cache = 0;
never executed (the execution status of this line is deduced): m_cache = 0;
-
121 m_hints |= IsCachedHint;
never executed (the execution status of this line is deduced): m_hints |= IsCachedHint;
-
122 }
never executed: }
0
123 CacheEntry *e = new CacheEntry;
never executed (the execution status of this line is deduced): CacheEntry *e = new CacheEntry;
-
124 e->engine = engine;
never executed (the execution status of this line is deduced): e->engine = engine;
-
125 e->data = data;
never executed (the execution status of this line is deduced): e->data = data;
-
126 e->cleanup = cleanup;
never executed (the execution status of this line is deduced): e->cleanup = cleanup;
-
127 e->next = m_cache;
never executed (the execution status of this line is deduced): e->next = m_cache;
-
128 m_cache = e;
never executed (the execution status of this line is deduced): m_cache = e;
-
129 return m_cache;
never executed: return m_cache;
0
130} -
131 -
132 -
133const QVectorPath &qtVectorPathForPath(const QPainterPath &path) -
134{ -
135 Q_ASSERT(path.d_func());
executed (the execution status of this line is deduced): qt_noop();
-
136 return path.d_func()->vectorPath();
executed: return path.d_func()->vectorPath();
Execution Count:133669
133669
137} -
138 -
139#ifndef QT_NO_DEBUG_STREAM -
140QDebug Q_GUI_EXPORT &operator<<(QDebug &s, const QVectorPath &path) -
141{ -
142 QRectF rf = path.controlPointRect();
never executed (the execution status of this line is deduced): QRectF rf = path.controlPointRect();
-
143 s << "QVectorPath(size:" << path.elementCount()
never executed (the execution status of this line is deduced): s << "QVectorPath(size:" << path.elementCount()
-
144 << " hints:" << hex << path.hints()
never executed (the execution status of this line is deduced): << " hints:" << hex << path.hints()
-
145 << rf << ')';
never executed (the execution status of this line is deduced): << rf << ')';
-
146 return s;
never executed: return s;
0
147} -
148#endif -
149 -
150/******************************************************************************* -
151 * -
152 * class QPaintEngineExPrivate: -
153 * -
154 */ -
155 -
156 -
157struct StrokeHandler { -
158 StrokeHandler(int reserve) : pts(reserve), types(reserve) {}
executed: }
Execution Count:39
39
159 QDataBuffer<qreal> pts; -
160 QDataBuffer<QPainterPath::ElementType> types; -
161}; -
162 -
163 -
164QPaintEngineExPrivate::QPaintEngineExPrivate() -
165 : dasher(&stroker), -
166 strokeHandler(0), -
167 activeStroker(0), -
168 strokerPen(Qt::NoPen) -
169{ -
170}
executed: }
Execution Count:8557
8557
171 -
172 -
173QPaintEngineExPrivate::~QPaintEngineExPrivate() -
174{ -
175 delete strokeHandler;
executed (the execution status of this line is deduced): delete strokeHandler;
-
176}
executed: }
Execution Count:8546
8546
177 -
178 -
179void QPaintEngineExPrivate::replayClipOperations() -
180{ -
181 Q_Q(QPaintEngineEx);
never executed (the execution status of this line is deduced): QPaintEngineEx * const q = q_func();
-
182 -
183 QPainter *p = q->painter();
never executed (the execution status of this line is deduced): QPainter *p = q->painter();
-
184 if (!p || !p->d_ptr)
never evaluated: !p
never evaluated: !p->d_ptr
0
185 return;
never executed: return;
0
186 -
187 QList<QPainterClipInfo> clipInfo = p->d_ptr->state->clipInfo;
never executed (the execution status of this line is deduced): QList<QPainterClipInfo> clipInfo = p->d_ptr->state->clipInfo;
-
188 -
189 QTransform transform = q->state()->matrix;
never executed (the execution status of this line is deduced): QTransform transform = q->state()->matrix;
-
190 -
191 for (int i = 0; i < clipInfo.size(); ++i) {
never evaluated: i < clipInfo.size()
0
192 const QPainterClipInfo &info = clipInfo.at(i);
never executed (the execution status of this line is deduced): const QPainterClipInfo &info = clipInfo.at(i);
-
193 -
194 if (info.matrix != q->state()->matrix) {
never evaluated: info.matrix != q->state()->matrix
0
195 q->state()->matrix = info.matrix;
never executed (the execution status of this line is deduced): q->state()->matrix = info.matrix;
-
196 q->transformChanged();
never executed (the execution status of this line is deduced): q->transformChanged();
-
197 }
never executed: }
0
198 -
199 switch (info.clipType) { -
200 case QPainterClipInfo::RegionClip: -
201 q->clip(info.region, info.operation);
never executed (the execution status of this line is deduced): q->clip(info.region, info.operation);
-
202 break;
never executed: break;
0
203 case QPainterClipInfo::PathClip: -
204 q->clip(info.path, info.operation);
never executed (the execution status of this line is deduced): q->clip(info.path, info.operation);
-
205 break;
never executed: break;
0
206 case QPainterClipInfo::RectClip: -
207 q->clip(info.rect, info.operation);
never executed (the execution status of this line is deduced): q->clip(info.rect, info.operation);
-
208 break;
never executed: break;
0
209 case QPainterClipInfo::RectFClip: { -
210 qreal right = info.rectf.x() + info.rectf.width();
never executed (the execution status of this line is deduced): qreal right = info.rectf.x() + info.rectf.width();
-
211 qreal bottom = info.rectf.y() + info.rectf.height();
never executed (the execution status of this line is deduced): qreal bottom = info.rectf.y() + info.rectf.height();
-
212 qreal pts[] = { info.rectf.x(), info.rectf.y(),
never executed (the execution status of this line is deduced): qreal pts[] = { info.rectf.x(), info.rectf.y(),
-
213 right, info.rectf.y(),
never executed (the execution status of this line is deduced): right, info.rectf.y(),
-
214 right, bottom,
never executed (the execution status of this line is deduced): right, bottom,
-
215 info.rectf.x(), bottom };
never executed (the execution status of this line is deduced): info.rectf.x(), bottom };
-
216 QVectorPath vp(pts, 4, 0, QVectorPath::RectangleHint);
never executed (the execution status of this line is deduced): QVectorPath vp(pts, 4, 0, QVectorPath::RectangleHint);
-
217 q->clip(vp, info.operation);
never executed (the execution status of this line is deduced): q->clip(vp, info.operation);
-
218 break;
never executed: break;
0
219 } -
220 } -
221 }
never executed: }
0
222 -
223 if (transform != q->state()->matrix) {
never evaluated: transform != q->state()->matrix
0
224 q->state()->matrix = transform;
never executed (the execution status of this line is deduced): q->state()->matrix = transform;
-
225 q->transformChanged();
never executed (the execution status of this line is deduced): q->transformChanged();
-
226 }
never executed: }
0
227}
never executed: }
0
228 -
229 -
230bool QPaintEngineExPrivate::hasClipOperations() const -
231{ -
232 Q_Q(const QPaintEngineEx);
never executed (the execution status of this line is deduced): const QPaintEngineEx * const q = q_func();
-
233 -
234 QPainter *p = q->painter();
never executed (the execution status of this line is deduced): QPainter *p = q->painter();
-
235 if (!p || !p->d_ptr)
never evaluated: !p
never evaluated: !p->d_ptr
0
236 return false;
never executed: return false;
0
237 -
238 QList<QPainterClipInfo> clipInfo = p->d_ptr->state->clipInfo;
never executed (the execution status of this line is deduced): QList<QPainterClipInfo> clipInfo = p->d_ptr->state->clipInfo;
-
239 -
240 return !clipInfo.isEmpty();
never executed: return !clipInfo.isEmpty();
0
241} -
242 -
243/******************************************************************************* -
244 * -
245 * class QPaintEngineEx: -
246 * -
247 */ -
248 -
249static QPainterPath::ElementType qpaintengineex_ellipse_types[] = { -
250 QPainterPath::MoveToElement, -
251 QPainterPath::CurveToElement, -
252 QPainterPath::CurveToDataElement, -
253 QPainterPath::CurveToDataElement, -
254 -
255 QPainterPath::CurveToElement, -
256 QPainterPath::CurveToDataElement, -
257 QPainterPath::CurveToDataElement, -
258 -
259 QPainterPath::CurveToElement, -
260 QPainterPath::CurveToDataElement, -
261 QPainterPath::CurveToDataElement, -
262 -
263 QPainterPath::CurveToElement, -
264 QPainterPath::CurveToDataElement, -
265 QPainterPath::CurveToDataElement -
266}; -
267 -
268static QPainterPath::ElementType qpaintengineex_line_types_16[] = { -
269 QPainterPath::MoveToElement, QPainterPath::LineToElement, -
270 QPainterPath::MoveToElement, QPainterPath::LineToElement, -
271 QPainterPath::MoveToElement, QPainterPath::LineToElement, -
272 QPainterPath::MoveToElement, QPainterPath::LineToElement, -
273 QPainterPath::MoveToElement, QPainterPath::LineToElement, -
274 QPainterPath::MoveToElement, QPainterPath::LineToElement, -
275 QPainterPath::MoveToElement, QPainterPath::LineToElement, -
276 QPainterPath::MoveToElement, QPainterPath::LineToElement, -
277 QPainterPath::MoveToElement, QPainterPath::LineToElement, -
278 QPainterPath::MoveToElement, QPainterPath::LineToElement, -
279 QPainterPath::MoveToElement, QPainterPath::LineToElement, -
280 QPainterPath::MoveToElement, QPainterPath::LineToElement, -
281 QPainterPath::MoveToElement, QPainterPath::LineToElement, -
282 QPainterPath::MoveToElement, QPainterPath::LineToElement, -
283 QPainterPath::MoveToElement, QPainterPath::LineToElement, -
284 QPainterPath::MoveToElement, QPainterPath::LineToElement -
285}; -
286 -
287static QPainterPath::ElementType qpaintengineex_rect4_types_32[] = { -
288 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 1 -
289 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 2 -
290 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 3 -
291 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 4 -
292 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 5 -
293 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 6 -
294 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 7 -
295 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 8 -
296 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 9 -
297 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 10 -
298 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 11 -
299 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 12 -
300 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 13 -
301 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 14 -
302 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 15 -
303 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 16 -
304 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 17 -
305 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 18 -
306 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 19 -
307 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 20 -
308 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 21 -
309 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 22 -
310 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 23 -
311 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 24 -
312 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 25 -
313 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 26 -
314 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 27 -
315 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 28 -
316 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 29 -
317 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 30 -
318 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 31 -
319 QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, // 32 -
320}; -
321 -
322 -
323static QPainterPath::ElementType qpaintengineex_roundedrect_types[] = { -
324 QPainterPath::MoveToElement, -
325 QPainterPath::LineToElement, -
326 QPainterPath::CurveToElement, -
327 QPainterPath::CurveToDataElement, -
328 QPainterPath::CurveToDataElement, -
329 QPainterPath::LineToElement, -
330 QPainterPath::CurveToElement, -
331 QPainterPath::CurveToDataElement, -
332 QPainterPath::CurveToDataElement, -
333 QPainterPath::LineToElement, -
334 QPainterPath::CurveToElement, -
335 QPainterPath::CurveToDataElement, -
336 QPainterPath::CurveToDataElement, -
337 QPainterPath::LineToElement, -
338 QPainterPath::CurveToElement, -
339 QPainterPath::CurveToDataElement, -
340 QPainterPath::CurveToDataElement -
341}; -
342 -
343 -
344 -
345static void qpaintengineex_moveTo(qreal x, qreal y, void *data) { -
346 ((StrokeHandler *) data)->pts.add(x);
executed (the execution status of this line is deduced): ((StrokeHandler *) data)->pts.add(x);
-
347 ((StrokeHandler *) data)->pts.add(y);
executed (the execution status of this line is deduced): ((StrokeHandler *) data)->pts.add(y);
-
348 ((StrokeHandler *) data)->types.add(QPainterPath::MoveToElement);
executed (the execution status of this line is deduced): ((StrokeHandler *) data)->types.add(QPainterPath::MoveToElement);
-
349}
executed: }
Execution Count:1876
1876
350 -
351static void qpaintengineex_lineTo(qreal x, qreal y, void *data) { -
352 ((StrokeHandler *) data)->pts.add(x);
executed (the execution status of this line is deduced): ((StrokeHandler *) data)->pts.add(x);
-
353 ((StrokeHandler *) data)->pts.add(y);
executed (the execution status of this line is deduced): ((StrokeHandler *) data)->pts.add(y);
-
354 ((StrokeHandler *) data)->types.add(QPainterPath::LineToElement);
executed (the execution status of this line is deduced): ((StrokeHandler *) data)->types.add(QPainterPath::LineToElement);
-
355}
executed: }
Execution Count:3304
3304
356 -
357static void qpaintengineex_cubicTo(qreal c1x, qreal c1y, qreal c2x, qreal c2y, qreal ex, qreal ey, void *data) { -
358 ((StrokeHandler *) data)->pts.add(c1x);
executed (the execution status of this line is deduced): ((StrokeHandler *) data)->pts.add(c1x);
-
359 ((StrokeHandler *) data)->pts.add(c1y);
executed (the execution status of this line is deduced): ((StrokeHandler *) data)->pts.add(c1y);
-
360 ((StrokeHandler *) data)->types.add(QPainterPath::CurveToElement);
executed (the execution status of this line is deduced): ((StrokeHandler *) data)->types.add(QPainterPath::CurveToElement);
-
361 -
362 ((StrokeHandler *) data)->pts.add(c2x);
executed (the execution status of this line is deduced): ((StrokeHandler *) data)->pts.add(c2x);
-
363 ((StrokeHandler *) data)->pts.add(c2y);
executed (the execution status of this line is deduced): ((StrokeHandler *) data)->pts.add(c2y);
-
364 ((StrokeHandler *) data)->types.add(QPainterPath::CurveToDataElement);
executed (the execution status of this line is deduced): ((StrokeHandler *) data)->types.add(QPainterPath::CurveToDataElement);
-
365 -
366 ((StrokeHandler *) data)->pts.add(ex);
executed (the execution status of this line is deduced): ((StrokeHandler *) data)->pts.add(ex);
-
367 ((StrokeHandler *) data)->pts.add(ey);
executed (the execution status of this line is deduced): ((StrokeHandler *) data)->pts.add(ey);
-
368 ((StrokeHandler *) data)->types.add(QPainterPath::CurveToDataElement);
executed (the execution status of this line is deduced): ((StrokeHandler *) data)->types.add(QPainterPath::CurveToDataElement);
-
369}
executed: }
Execution Count:6960
6960
370 -
371QPaintEngineEx::QPaintEngineEx() -
372 : QPaintEngine(*new QPaintEngineExPrivate, AllFeatures) -
373{ -
374 extended = true;
executed (the execution status of this line is deduced): extended = true;
-
375}
executed: }
Execution Count:2942
2942
376 -
377QPaintEngineEx::QPaintEngineEx(QPaintEngineExPrivate &data) -
378 : QPaintEngine(data, AllFeatures) -
379{ -
380 extended = true;
executed (the execution status of this line is deduced): extended = true;
-
381}
executed: }
Execution Count:5615
5615
382 -
383QPainterState *QPaintEngineEx::createState(QPainterState *orig) const -
384{ -
385 if (!orig)
never evaluated: !orig
0
386 return new QPainterState;
never executed: return new QPainterState;
0
387 return new QPainterState(orig);
never executed: return new QPainterState(orig);
0
388} -
389 -
390Q_GUI_EXPORT extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp -
391 -
392void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen) -
393{ -
394#ifdef QT_DEBUG_DRAW -
395 qDebug() << "QPaintEngineEx::stroke()" << pen; -
396#endif -
397 -
398 Q_D(QPaintEngineEx);
executed (the execution status of this line is deduced): QPaintEngineExPrivate * const d = d_func();
-
399 -
400 if (path.isEmpty())
partially evaluated: path.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:938
0-938
401 return;
never executed: return;
0
402 -
403 if (!d->strokeHandler) {
evaluated: !d->strokeHandler
TRUEFALSE
yes
Evaluation Count:39
yes
Evaluation Count:899
39-899
404 d->strokeHandler = new StrokeHandler(path.elementCount()+4);
executed (the execution status of this line is deduced): d->strokeHandler = new StrokeHandler(path.elementCount()+4);
-
405 d->stroker.setMoveToHook(qpaintengineex_moveTo);
executed (the execution status of this line is deduced): d->stroker.setMoveToHook(qpaintengineex_moveTo);
-
406 d->stroker.setLineToHook(qpaintengineex_lineTo);
executed (the execution status of this line is deduced): d->stroker.setLineToHook(qpaintengineex_lineTo);
-
407 d->stroker.setCubicToHook(qpaintengineex_cubicTo);
executed (the execution status of this line is deduced): d->stroker.setCubicToHook(qpaintengineex_cubicTo);
-
408 }
executed: }
Execution Count:39
39
409 -
410 if (!qpen_fast_equals(pen, d->strokerPen)) {
evaluated: !qpen_fast_equals(pen, d->strokerPen)
TRUEFALSE
yes
Evaluation Count:39
yes
Evaluation Count:899
39-899
411 d->strokerPen = pen;
executed (the execution status of this line is deduced): d->strokerPen = pen;
-
412 d->stroker.setJoinStyle(pen.joinStyle());
executed (the execution status of this line is deduced): d->stroker.setJoinStyle(pen.joinStyle());
-
413 d->stroker.setCapStyle(pen.capStyle());
executed (the execution status of this line is deduced): d->stroker.setCapStyle(pen.capStyle());
-
414 d->stroker.setMiterLimit(pen.miterLimit());
executed (the execution status of this line is deduced): d->stroker.setMiterLimit(pen.miterLimit());
-
415 qreal penWidth = pen.widthF();
executed (the execution status of this line is deduced): qreal penWidth = pen.widthF();
-
416 if (penWidth == 0)
partially evaluated: penWidth == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:39
0-39
417 d->stroker.setStrokeWidth(1);
never executed: d->stroker.setStrokeWidth(1);
0
418 else -
419 d->stroker.setStrokeWidth(penWidth);
executed: d->stroker.setStrokeWidth(penWidth);
Execution Count:39
39
420 -
421 Qt::PenStyle style = pen.style();
never executed (the execution status of this line is deduced): Qt::PenStyle style = pen.style();
-
422 if (style == Qt::SolidLine) {
partially evaluated: style == Qt::SolidLine
TRUEFALSE
yes
Evaluation Count:39
no
Evaluation Count:0
0-39
423 d->activeStroker = &d->stroker;
executed (the execution status of this line is deduced): d->activeStroker = &d->stroker;
-
424 } else if (style == Qt::NoPen) {
executed: }
Execution Count:39
never evaluated: style == Qt::NoPen
0-39
425 d->activeStroker = 0;
never executed (the execution status of this line is deduced): d->activeStroker = 0;
-
426 } else {
never executed: }
0
427 d->dasher.setDashPattern(pen.dashPattern());
never executed (the execution status of this line is deduced): d->dasher.setDashPattern(pen.dashPattern());
-
428 d->dasher.setDashOffset(pen.dashOffset());
never executed (the execution status of this line is deduced): d->dasher.setDashOffset(pen.dashOffset());
-
429 d->activeStroker = &d->dasher;
never executed (the execution status of this line is deduced): d->activeStroker = &d->dasher;
-
430 }
never executed: }
0
431 } -
432 -
433 if (!d->activeStroker) {
partially evaluated: !d->activeStroker
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:938
0-938
434 return;
never executed: return;
0
435 } -
436 -
437 if (pen.style() > Qt::SolidLine) {
partially evaluated: pen.style() > Qt::SolidLine
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:938
0-938
438 if (qt_pen_is_cosmetic(pen, state()->renderHints)){
never evaluated: qt_pen_is_cosmetic(pen, state()->renderHints)
0
439 d->activeStroker->setClipRect(d->exDeviceRect);
never executed (the execution status of this line is deduced): d->activeStroker->setClipRect(d->exDeviceRect);
-
440 } else {
never executed: }
0
441 QRectF clipRect = state()->matrix.inverted().mapRect(QRectF(d->exDeviceRect));
never executed (the execution status of this line is deduced): QRectF clipRect = state()->matrix.inverted().mapRect(QRectF(d->exDeviceRect));
-
442 d->activeStroker->setClipRect(clipRect);
never executed (the execution status of this line is deduced): d->activeStroker->setClipRect(clipRect);
-
443 }
never executed: }
0
444 } -
445 -
446 const QPainterPath::ElementType *types = path.elements();
executed (the execution status of this line is deduced): const QPainterPath::ElementType *types = path.elements();
-
447 const qreal *points = path.points();
executed (the execution status of this line is deduced): const qreal *points = path.points();
-
448 int pointCount = path.elementCount();
executed (the execution status of this line is deduced): int pointCount = path.elementCount();
-
449 -
450 const qreal *lastPoint = points + (pointCount<<1);
executed (the execution status of this line is deduced): const qreal *lastPoint = points + (pointCount<<1);
-
451 -
452 d->strokeHandler->types.reset();
executed (the execution status of this line is deduced): d->strokeHandler->types.reset();
-
453 d->strokeHandler->pts.reset();
executed (the execution status of this line is deduced): d->strokeHandler->pts.reset();
-
454 -
455 // Some engines might decide to optimize for the non-shape hint later on... -
456 uint flags = QVectorPath::WindingFill;
executed (the execution status of this line is deduced): uint flags = QVectorPath::WindingFill;
-
457 -
458 if (path.elementCount() > 2)
partially evaluated: path.elementCount() > 2
TRUEFALSE
yes
Evaluation Count:938
no
Evaluation Count:0
0-938
459 flags |= QVectorPath::NonConvexShapeMask;
executed: flags |= QVectorPath::NonConvexShapeMask;
Execution Count:938
938
460 -
461 if (d->stroker.capStyle() == Qt::RoundCap || d->stroker.joinStyle() == Qt::RoundJoin)
partially evaluated: d->stroker.capStyle() == Qt::RoundCap
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:938
partially evaluated: d->stroker.joinStyle() == Qt::RoundJoin
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:938
0-938
462 flags |= QVectorPath::CurvedShapeMask;
never executed: flags |= QVectorPath::CurvedShapeMask;
0
463 -
464 // ### Perspective Xforms are currently not supported... -
465 if (!qt_pen_is_cosmetic(pen, state()->renderHints)) {
partially evaluated: !qt_pen_is_cosmetic(pen, state()->renderHints)
TRUEFALSE
yes
Evaluation Count:938
no
Evaluation Count:0
0-938
466 // We include cosmetic pens in this case to avoid having to -
467 // change the current transform. Normal transformed, -
468 // non-cosmetic pens will be transformed as part of fill -
469 // later, so they are also covered here.. -
470 d->activeStroker->setCurveThresholdFromTransform(state()->matrix);
executed (the execution status of this line is deduced): d->activeStroker->setCurveThresholdFromTransform(state()->matrix);
-
471 d->activeStroker->begin(d->strokeHandler);
executed (the execution status of this line is deduced): d->activeStroker->begin(d->strokeHandler);
-
472 if (types) {
evaluated: types
TRUEFALSE
yes
Evaluation Count:876
yes
Evaluation Count:62
62-876
473 while (points < lastPoint) {
evaluated: points < lastPoint
TRUEFALSE
yes
Evaluation Count:4388
yes
Evaluation Count:876
876-4388
474 switch (*types) { -
475 case QPainterPath::MoveToElement: -
476 d->activeStroker->moveTo(points[0], points[1]);
executed (the execution status of this line is deduced): d->activeStroker->moveTo(points[0], points[1]);
-
477 points += 2;
executed (the execution status of this line is deduced): points += 2;
-
478 ++types;
executed (the execution status of this line is deduced): ++types;
-
479 break;
executed: break;
Execution Count:876
876
480 case QPainterPath::LineToElement: -
481 d->activeStroker->lineTo(points[0], points[1]);
executed (the execution status of this line is deduced): d->activeStroker->lineTo(points[0], points[1]);
-
482 points += 2;
executed (the execution status of this line is deduced): points += 2;
-
483 ++types;
executed (the execution status of this line is deduced): ++types;
-
484 break;
executed: break;
Execution Count:36
36
485 case QPainterPath::CurveToElement: -
486 d->activeStroker->cubicTo(points[0], points[1],
executed (the execution status of this line is deduced): d->activeStroker->cubicTo(points[0], points[1],
-
487 points[2], points[3],
executed (the execution status of this line is deduced): points[2], points[3],
-
488 points[4], points[5]);
executed (the execution status of this line is deduced): points[4], points[5]);
-
489 points += 6;
executed (the execution status of this line is deduced): points += 6;
-
490 types += 3;
executed (the execution status of this line is deduced): types += 3;
-
491 flags |= QVectorPath::CurvedShapeMask;
executed (the execution status of this line is deduced): flags |= QVectorPath::CurvedShapeMask;
-
492 break;
executed: break;
Execution Count:3476
3476
493 default: -
494 break;
never executed: break;
0
495 } -
496 }
executed: }
Execution Count:4388
4388
497 if (path.hasImplicitClose())
partially evaluated: path.hasImplicitClose()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:876
0-876
498 d->activeStroker->lineTo(path.points()[0], path.points()[1]);
never executed: d->activeStroker->lineTo(path.points()[0], path.points()[1]);
0
499 -
500 } else {
executed: }
Execution Count:876
876
501 d->activeStroker->moveTo(points[0], points[1]);
executed (the execution status of this line is deduced): d->activeStroker->moveTo(points[0], points[1]);
-
502 points += 2;
executed (the execution status of this line is deduced): points += 2;
-
503 while (points < lastPoint) {
evaluated: points < lastPoint
TRUEFALSE
yes
Evaluation Count:642
yes
Evaluation Count:62
62-642
504 d->activeStroker->lineTo(points[0], points[1]);
executed (the execution status of this line is deduced): d->activeStroker->lineTo(points[0], points[1]);
-
505 points += 2;
executed (the execution status of this line is deduced): points += 2;
-
506 }
executed: }
Execution Count:642
642
507 if (path.hasImplicitClose())
evaluated: path.hasImplicitClose()
TRUEFALSE
yes
Evaluation Count:54
yes
Evaluation Count:8
8-54
508 d->activeStroker->lineTo(path.points()[0], path.points()[1]);
executed: d->activeStroker->lineTo(path.points()[0], path.points()[1]);
Execution Count:54
54
509 }
executed: }
Execution Count:62
62
510 d->activeStroker->end();
executed (the execution status of this line is deduced): d->activeStroker->end();
-
511 -
512 if (!d->strokeHandler->types.size()) // an empty path...
partially evaluated: !d->strokeHandler->types.size()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:938
0-938
513 return;
never executed: return;
0
514 -
515 QVectorPath strokePath(d->strokeHandler->pts.data(),
executed (the execution status of this line is deduced): QVectorPath strokePath(d->strokeHandler->pts.data(),
-
516 d->strokeHandler->types.size(),
executed (the execution status of this line is deduced): d->strokeHandler->types.size(),
-
517 d->strokeHandler->types.data(),
executed (the execution status of this line is deduced): d->strokeHandler->types.data(),
-
518 flags);
executed (the execution status of this line is deduced): flags);
-
519 fill(strokePath, pen.brush());
executed (the execution status of this line is deduced): fill(strokePath, pen.brush());
-
520 } else {
executed: }
Execution Count:938
938
521 // For cosmetic pens we need a bit of trickery... We to process xform the input points -
522 if (state()->matrix.type() >= QTransform::TxProject) {
never evaluated: state()->matrix.type() >= QTransform::TxProject
0
523 QPainterPath painterPath = state()->matrix.map(path.convertToPainterPath());
never executed (the execution status of this line is deduced): QPainterPath painterPath = state()->matrix.map(path.convertToPainterPath());
-
524 d->activeStroker->strokePath(painterPath, d->strokeHandler, QTransform());
never executed (the execution status of this line is deduced): d->activeStroker->strokePath(painterPath, d->strokeHandler, QTransform());
-
525 } else {
never executed: }
0
526 d->activeStroker->setCurveThresholdFromTransform(QTransform());
never executed (the execution status of this line is deduced): d->activeStroker->setCurveThresholdFromTransform(QTransform());
-
527 d->activeStroker->begin(d->strokeHandler);
never executed (the execution status of this line is deduced): d->activeStroker->begin(d->strokeHandler);
-
528 if (types) {
never evaluated: types
0
529 while (points < lastPoint) {
never evaluated: points < lastPoint
0
530 switch (*types) { -
531 case QPainterPath::MoveToElement: { -
532 QPointF pt = (*(QPointF *) points) * state()->matrix;
never executed (the execution status of this line is deduced): QPointF pt = (*(QPointF *) points) * state()->matrix;
-
533 d->activeStroker->moveTo(pt.x(), pt.y());
never executed (the execution status of this line is deduced): d->activeStroker->moveTo(pt.x(), pt.y());
-
534 points += 2;
never executed (the execution status of this line is deduced): points += 2;
-
535 ++types;
never executed (the execution status of this line is deduced): ++types;
-
536 break;
never executed: break;
0
537 } -
538 case QPainterPath::LineToElement: { -
539 QPointF pt = (*(QPointF *) points) * state()->matrix;
never executed (the execution status of this line is deduced): QPointF pt = (*(QPointF *) points) * state()->matrix;
-
540 d->activeStroker->lineTo(pt.x(), pt.y());
never executed (the execution status of this line is deduced): d->activeStroker->lineTo(pt.x(), pt.y());
-
541 points += 2;
never executed (the execution status of this line is deduced): points += 2;
-
542 ++types;
never executed (the execution status of this line is deduced): ++types;
-
543 break;
never executed: break;
0
544 } -
545 case QPainterPath::CurveToElement: { -
546 QPointF c1 = ((QPointF *) points)[0] * state()->matrix;
never executed (the execution status of this line is deduced): QPointF c1 = ((QPointF *) points)[0] * state()->matrix;
-
547 QPointF c2 = ((QPointF *) points)[1] * state()->matrix;
never executed (the execution status of this line is deduced): QPointF c2 = ((QPointF *) points)[1] * state()->matrix;
-
548 QPointF e = ((QPointF *) points)[2] * state()->matrix;
never executed (the execution status of this line is deduced): QPointF e = ((QPointF *) points)[2] * state()->matrix;
-
549 d->activeStroker->cubicTo(c1.x(), c1.y(), c2.x(), c2.y(), e.x(), e.y());
never executed (the execution status of this line is deduced): d->activeStroker->cubicTo(c1.x(), c1.y(), c2.x(), c2.y(), e.x(), e.y());
-
550 points += 6;
never executed (the execution status of this line is deduced): points += 6;
-
551 types += 3;
never executed (the execution status of this line is deduced): types += 3;
-
552 flags |= QVectorPath::CurvedShapeMask;
never executed (the execution status of this line is deduced): flags |= QVectorPath::CurvedShapeMask;
-
553 break;
never executed: break;
0
554 } -
555 default: -
556 break;
never executed: break;
0
557 } -
558 }
never executed: }
0
559 if (path.hasImplicitClose()) {
never evaluated: path.hasImplicitClose()
0
560 QPointF pt = * ((QPointF *) path.points()) * state()->matrix;
never executed (the execution status of this line is deduced): QPointF pt = * ((QPointF *) path.points()) * state()->matrix;
-
561 d->activeStroker->lineTo(pt.x(), pt.y());
never executed (the execution status of this line is deduced): d->activeStroker->lineTo(pt.x(), pt.y());
-
562 }
never executed: }
0
563 -
564 } else {
never executed: }
0
565 QPointF p = ((QPointF *)points)[0] * state()->matrix;
never executed (the execution status of this line is deduced): QPointF p = ((QPointF *)points)[0] * state()->matrix;
-
566 d->activeStroker->moveTo(p.x(), p.y());
never executed (the execution status of this line is deduced): d->activeStroker->moveTo(p.x(), p.y());
-
567 points += 2;
never executed (the execution status of this line is deduced): points += 2;
-
568 while (points < lastPoint) {
never evaluated: points < lastPoint
0
569 QPointF p = ((QPointF *)points)[0] * state()->matrix;
never executed (the execution status of this line is deduced): QPointF p = ((QPointF *)points)[0] * state()->matrix;
-
570 d->activeStroker->lineTo(p.x(), p.y());
never executed (the execution status of this line is deduced): d->activeStroker->lineTo(p.x(), p.y());
-
571 points += 2;
never executed (the execution status of this line is deduced): points += 2;
-
572 }
never executed: }
0
573 if (path.hasImplicitClose())
never evaluated: path.hasImplicitClose()
0
574 d->activeStroker->lineTo(p.x(), p.y());
never executed: d->activeStroker->lineTo(p.x(), p.y());
0
575 }
never executed: }
0
576 d->activeStroker->end();
never executed (the execution status of this line is deduced): d->activeStroker->end();
-
577 }
never executed: }
0
578 -
579 QVectorPath strokePath(d->strokeHandler->pts.data(),
never executed (the execution status of this line is deduced): QVectorPath strokePath(d->strokeHandler->pts.data(),
-
580 d->strokeHandler->types.size(),
never executed (the execution status of this line is deduced): d->strokeHandler->types.size(),
-
581 d->strokeHandler->types.data(),
never executed (the execution status of this line is deduced): d->strokeHandler->types.data(),
-
582 flags);
never executed (the execution status of this line is deduced): flags);
-
583 -
584 QTransform xform = state()->matrix;
never executed (the execution status of this line is deduced): QTransform xform = state()->matrix;
-
585 state()->matrix = QTransform();
never executed (the execution status of this line is deduced): state()->matrix = QTransform();
-
586 transformChanged();
never executed (the execution status of this line is deduced): transformChanged();
-
587 -
588 QBrush brush = pen.brush();
never executed (the execution status of this line is deduced): QBrush brush = pen.brush();
-
589 if (qbrush_style(brush) != Qt::SolidPattern)
never evaluated: qbrush_style(brush) != Qt::SolidPattern
0
590 brush.setTransform(brush.transform() * xform);
never executed: brush.setTransform(brush.transform() * xform);
0
591 -
592 fill(strokePath, brush);
never executed (the execution status of this line is deduced): fill(strokePath, brush);
-
593 -
594 state()->matrix = xform;
never executed (the execution status of this line is deduced): state()->matrix = xform;
-
595 transformChanged();
never executed (the execution status of this line is deduced): transformChanged();
-
596 }
never executed: }
0
597} -
598 -
599void QPaintEngineEx::draw(const QVectorPath &path) -
600{ -
601 const QBrush &brush = state()->brush;
executed (the execution status of this line is deduced): const QBrush &brush = state()->brush;
-
602 if (qbrush_style(brush) != Qt::NoBrush)
evaluated: qbrush_style(brush) != Qt::NoBrush
TRUEFALSE
yes
Evaluation Count:39319
yes
Evaluation Count:345
345-39319
603 fill(path, brush);
executed: fill(path, brush);
Execution Count:39319
39319
604 -
605 const QPen &pen = state()->pen;
executed (the execution status of this line is deduced): const QPen &pen = state()->pen;
-
606 if (qpen_style(pen) != Qt::NoPen && qbrush_style(qpen_brush(pen)) != Qt::NoBrush)
evaluated: qpen_style(pen) != Qt::NoPen
TRUEFALSE
yes
Evaluation Count:1212
yes
Evaluation Count:38452
partially evaluated: qbrush_style(qpen_brush(pen)) != Qt::NoBrush
TRUEFALSE
yes
Evaluation Count:1212
no
Evaluation Count:0
0-38452
607 stroke(path, pen);
executed: stroke(path, pen);
Execution Count:1212
1212
608}
executed: }
Execution Count:39664
39664
609 -
610 -
611void QPaintEngineEx::clip(const QRect &r, Qt::ClipOperation op) -
612{ -
613 qreal right = r.x() + r.width();
executed (the execution status of this line is deduced): qreal right = r.x() + r.width();
-
614 qreal bottom = r.y() + r.height();
executed (the execution status of this line is deduced): qreal bottom = r.y() + r.height();
-
615 qreal pts[] = { qreal(r.x()), qreal(r.y()),
executed (the execution status of this line is deduced): qreal pts[] = { qreal(r.x()), qreal(r.y()),
-
616 right, qreal(r.y()),
executed (the execution status of this line is deduced): right, qreal(r.y()),
-
617 right, bottom,
executed (the execution status of this line is deduced): right, bottom,
-
618 qreal(r.x()), bottom,
executed (the execution status of this line is deduced): qreal(r.x()), bottom,
-
619 qreal(r.x()), qreal(r.y()) };
executed (the execution status of this line is deduced): qreal(r.x()), qreal(r.y()) };
-
620 QVectorPath vp(pts, 5, 0, QVectorPath::RectangleHint);
executed (the execution status of this line is deduced): QVectorPath vp(pts, 5, 0, QVectorPath::RectangleHint);
-
621 clip(vp, op);
executed (the execution status of this line is deduced): clip(vp, op);
-
622}
executed: }
Execution Count:364
364
623 -
624void QPaintEngineEx::clip(const QRegion &region, Qt::ClipOperation op) -
625{ -
626 if (region.rectCount() == 1)
evaluated: region.rectCount() == 1
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:16
3-16
627 clip(region.boundingRect(), op);
executed: clip(region.boundingRect(), op);
Execution Count:3
3
628 -
629 QVector<QRect> rects = region.rects();
executed (the execution status of this line is deduced): QVector<QRect> rects = region.rects();
-
630 if (rects.size() <= 32) {
evaluated: rects.size() <= 32
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:4
4-15
631 qreal pts[2*32*4];
executed (the execution status of this line is deduced): qreal pts[2*32*4];
-
632 int pos = 0;
executed (the execution status of this line is deduced): int pos = 0;
-
633 for (QVector<QRect>::const_iterator i = rects.constBegin(); i != rects.constEnd(); ++i) {
evaluated: i != rects.constEnd()
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:15
15-23
634 qreal x1 = i->x();
executed (the execution status of this line is deduced): qreal x1 = i->x();
-
635 qreal y1 = i->y();
executed (the execution status of this line is deduced): qreal y1 = i->y();
-
636 qreal x2 = i->x() + i->width();
executed (the execution status of this line is deduced): qreal x2 = i->x() + i->width();
-
637 qreal y2 = i->y() + i->height();
executed (the execution status of this line is deduced): qreal y2 = i->y() + i->height();
-
638 -
639 pts[pos++] = x1;
executed (the execution status of this line is deduced): pts[pos++] = x1;
-
640 pts[pos++] = y1;
executed (the execution status of this line is deduced): pts[pos++] = y1;
-
641 -
642 pts[pos++] = x2;
executed (the execution status of this line is deduced): pts[pos++] = x2;
-
643 pts[pos++] = y1;
executed (the execution status of this line is deduced): pts[pos++] = y1;
-
644 -
645 pts[pos++] = x2;
executed (the execution status of this line is deduced): pts[pos++] = x2;
-
646 pts[pos++] = y2;
executed (the execution status of this line is deduced): pts[pos++] = y2;
-
647 -
648 pts[pos++] = x1;
executed (the execution status of this line is deduced): pts[pos++] = x1;
-
649 pts[pos++] = y2;
executed (the execution status of this line is deduced): pts[pos++] = y2;
-
650 }
executed: }
Execution Count:23
23
651 QVectorPath vp(pts, rects.size() * 4, qpaintengineex_rect4_types_32);
executed (the execution status of this line is deduced): QVectorPath vp(pts, rects.size() * 4, qpaintengineex_rect4_types_32);
-
652 clip(vp, op);
executed (the execution status of this line is deduced): clip(vp, op);
-
653 } else {
executed: }
Execution Count:15
15
654 QVarLengthArray<qreal> pts(rects.size() * 2 * 4);
executed (the execution status of this line is deduced): QVarLengthArray<qreal> pts(rects.size() * 2 * 4);
-
655 QVarLengthArray<QPainterPath::ElementType> types(rects.size() * 4);
executed (the execution status of this line is deduced): QVarLengthArray<QPainterPath::ElementType> types(rects.size() * 4);
-
656 int ppos = 0;
executed (the execution status of this line is deduced): int ppos = 0;
-
657 int tpos = 0;
executed (the execution status of this line is deduced): int tpos = 0;
-
658 -
659 for (QVector<QRect>::const_iterator i = rects.constBegin(); i != rects.constEnd(); ++i) {
evaluated: i != rects.constEnd()
TRUEFALSE
yes
Evaluation Count:582
yes
Evaluation Count:4
4-582
660 qreal x1 = i->x();
executed (the execution status of this line is deduced): qreal x1 = i->x();
-
661 qreal y1 = i->y();
executed (the execution status of this line is deduced): qreal y1 = i->y();
-
662 qreal x2 = i->x() + i->width();
executed (the execution status of this line is deduced): qreal x2 = i->x() + i->width();
-
663 qreal y2 = i->y() + i->height();
executed (the execution status of this line is deduced): qreal y2 = i->y() + i->height();
-
664 -
665 pts[ppos++] = x1;
executed (the execution status of this line is deduced): pts[ppos++] = x1;
-
666 pts[ppos++] = y1;
executed (the execution status of this line is deduced): pts[ppos++] = y1;
-
667 -
668 pts[ppos++] = x2;
executed (the execution status of this line is deduced): pts[ppos++] = x2;
-
669 pts[ppos++] = y1;
executed (the execution status of this line is deduced): pts[ppos++] = y1;
-
670 -
671 pts[ppos++] = x2;
executed (the execution status of this line is deduced): pts[ppos++] = x2;
-
672 pts[ppos++] = y2;
executed (the execution status of this line is deduced): pts[ppos++] = y2;
-
673 -
674 pts[ppos++] = x1;
executed (the execution status of this line is deduced): pts[ppos++] = x1;
-
675 pts[ppos++] = y2;
executed (the execution status of this line is deduced): pts[ppos++] = y2;
-
676 -
677 types[tpos++] = QPainterPath::MoveToElement;
executed (the execution status of this line is deduced): types[tpos++] = QPainterPath::MoveToElement;
-
678 types[tpos++] = QPainterPath::LineToElement;
executed (the execution status of this line is deduced): types[tpos++] = QPainterPath::LineToElement;
-
679 types[tpos++] = QPainterPath::LineToElement;
executed (the execution status of this line is deduced): types[tpos++] = QPainterPath::LineToElement;
-
680 types[tpos++] = QPainterPath::LineToElement;
executed (the execution status of this line is deduced): types[tpos++] = QPainterPath::LineToElement;
-
681 }
executed: }
Execution Count:582
582
682 -
683 QVectorPath vp(pts.data(), rects.size() * 4, types.data());
executed (the execution status of this line is deduced): QVectorPath vp(pts.data(), rects.size() * 4, types.data());
-
684 clip(vp, op);
executed (the execution status of this line is deduced): clip(vp, op);
-
685 }
executed: }
Execution Count:4
4
686 -
687} -
688 -
689void QPaintEngineEx::clip(const QPainterPath &path, Qt::ClipOperation op) -
690{ -
691 if (path.isEmpty()) {
evaluated: path.isEmpty()
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:328
7-328
692 QVectorPath vp(0, 0);
executed (the execution status of this line is deduced): QVectorPath vp(0, 0);
-
693 clip(vp, op);
executed (the execution status of this line is deduced): clip(vp, op);
-
694 } else {
executed: }
Execution Count:7
7
695 clip(qtVectorPathForPath(path), op);
executed (the execution status of this line is deduced): clip(qtVectorPathForPath(path), op);
-
696 }
executed: }
Execution Count:328
328
697} -
698 -
699void QPaintEngineEx::fillRect(const QRectF &r, const QBrush &brush) -
700{ -
701 qreal pts[] = { r.x(), r.y(), r.x() + r.width(), r.y(),
executed (the execution status of this line is deduced): qreal pts[] = { r.x(), r.y(), r.x() + r.width(), r.y(),
-
702 r.x() + r.width(), r.y() + r.height(), r.x(), r.y() + r.height() };
executed (the execution status of this line is deduced): r.x() + r.width(), r.y() + r.height(), r.x(), r.y() + r.height() };
-
703 QVectorPath vp(pts, 4, 0, QVectorPath::RectangleHint);
executed (the execution status of this line is deduced): QVectorPath vp(pts, 4, 0, QVectorPath::RectangleHint);
-
704 fill(vp, brush);
executed (the execution status of this line is deduced): fill(vp, brush);
-
705}
executed: }
Execution Count:2792
2792
706 -
707void QPaintEngineEx::fillRect(const QRectF &r, const QColor &color) -
708{ -
709 fillRect(r, QBrush(color));
never executed (the execution status of this line is deduced): fillRect(r, QBrush(color));
-
710}
never executed: }
0
711 -
712void QPaintEngineEx::drawRects(const QRect *rects, int rectCount) -
713{ -
714 for (int i=0; i<rectCount; ++i) {
evaluated: i<rectCount
TRUEFALSE
yes
Evaluation Count:5167
yes
Evaluation Count:5167
5167
715 const QRect &r = rects[i];
executed (the execution status of this line is deduced): const QRect &r = rects[i];
-
716 // ### Is there a one off here? -
717 qreal right = r.x() + r.width();
executed (the execution status of this line is deduced): qreal right = r.x() + r.width();
-
718 qreal bottom = r.y() + r.height();
executed (the execution status of this line is deduced): qreal bottom = r.y() + r.height();
-
719 qreal pts[] = { qreal(r.x()), qreal(r.y()),
executed (the execution status of this line is deduced): qreal pts[] = { qreal(r.x()), qreal(r.y()),
-
720 right, qreal(r.y()),
executed (the execution status of this line is deduced): right, qreal(r.y()),
-
721 right, bottom,
executed (the execution status of this line is deduced): right, bottom,
-
722 qreal(r.x()), bottom,
executed (the execution status of this line is deduced): qreal(r.x()), bottom,
-
723 qreal(r.x()), qreal(r.y()) };
executed (the execution status of this line is deduced): qreal(r.x()), qreal(r.y()) };
-
724 QVectorPath vp(pts, 5, 0, QVectorPath::RectangleHint);
executed (the execution status of this line is deduced): QVectorPath vp(pts, 5, 0, QVectorPath::RectangleHint);
-
725 draw(vp);
executed (the execution status of this line is deduced): draw(vp);
-
726 }
executed: }
Execution Count:5167
5167
727}
executed: }
Execution Count:5167
5167
728 -
729void QPaintEngineEx::drawRects(const QRectF *rects, int rectCount) -
730{ -
731 for (int i=0; i<rectCount; ++i) {
evaluated: i<rectCount
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:8
8
732 const QRectF &r = rects[i];
executed (the execution status of this line is deduced): const QRectF &r = rects[i];
-
733 qreal right = r.x() + r.width();
executed (the execution status of this line is deduced): qreal right = r.x() + r.width();
-
734 qreal bottom = r.y() + r.height();
executed (the execution status of this line is deduced): qreal bottom = r.y() + r.height();
-
735 qreal pts[] = { r.x(), r.y(),
executed (the execution status of this line is deduced): qreal pts[] = { r.x(), r.y(),
-
736 right, r.y(),
executed (the execution status of this line is deduced): right, r.y(),
-
737 right, bottom,
executed (the execution status of this line is deduced): right, bottom,
-
738 r.x(), bottom,
executed (the execution status of this line is deduced): r.x(), bottom,
-
739 r.x(), r.y() };
executed (the execution status of this line is deduced): r.x(), r.y() };
-
740 QVectorPath vp(pts, 5, 0, QVectorPath::RectangleHint);
executed (the execution status of this line is deduced): QVectorPath vp(pts, 5, 0, QVectorPath::RectangleHint);
-
741 draw(vp);
executed (the execution status of this line is deduced): draw(vp);
-
742 }
executed: }
Execution Count:8
8
743}
executed: }
Execution Count:8
8
744 -
745 -
746void QPaintEngineEx::drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, -
747 Qt::SizeMode mode) -
748{ -
749 qreal x1 = rect.left();
executed (the execution status of this line is deduced): qreal x1 = rect.left();
-
750 qreal x2 = rect.right();
executed (the execution status of this line is deduced): qreal x2 = rect.right();
-
751 qreal y1 = rect.top();
executed (the execution status of this line is deduced): qreal y1 = rect.top();
-
752 qreal y2 = rect.bottom();
executed (the execution status of this line is deduced): qreal y2 = rect.bottom();
-
753 -
754 if (mode == Qt::RelativeSize) {
evaluated: mode == Qt::RelativeSize
TRUEFALSE
yes
Evaluation Count:223
yes
Evaluation Count:82
82-223
755 xRadius = xRadius * rect.width() / 200.;
executed (the execution status of this line is deduced): xRadius = xRadius * rect.width() / 200.;
-
756 yRadius = yRadius * rect.height() / 200.;
executed (the execution status of this line is deduced): yRadius = yRadius * rect.height() / 200.;
-
757 }
executed: }
Execution Count:223
223
758 -
759 xRadius = qMin(xRadius, rect.width() / 2);
executed (the execution status of this line is deduced): xRadius = qMin(xRadius, rect.width() / 2);
-
760 yRadius = qMin(yRadius, rect.height() / 2);
executed (the execution status of this line is deduced): yRadius = qMin(yRadius, rect.height() / 2);
-
761 -
762 qreal pts[] = {
executed (the execution status of this line is deduced): qreal pts[] = {
-
763 x1 + xRadius, y1, // MoveTo
executed (the execution status of this line is deduced): x1 + xRadius, y1,
-
764 x2 - xRadius, y1, // LineTo
executed (the execution status of this line is deduced): x2 - xRadius, y1,
-
765 x2 - (1 - KAPPA) * xRadius, y1, // CurveTo
executed (the execution status of this line is deduced): x2 - (1 - qreal(0.5522847498)) * xRadius, y1,
-
766 x2, y1 + (1 - KAPPA) * yRadius,
executed (the execution status of this line is deduced): x2, y1 + (1 - qreal(0.5522847498)) * yRadius,
-
767 x2, y1 + yRadius,
executed (the execution status of this line is deduced): x2, y1 + yRadius,
-
768 x2, y2 - yRadius, // LineTo
executed (the execution status of this line is deduced): x2, y2 - yRadius,
-
769 x2, y2 - (1 - KAPPA) * yRadius, // CurveTo
executed (the execution status of this line is deduced): x2, y2 - (1 - qreal(0.5522847498)) * yRadius,
-
770 x2 - (1 - KAPPA) * xRadius, y2,
executed (the execution status of this line is deduced): x2 - (1 - qreal(0.5522847498)) * xRadius, y2,
-
771 x2 - xRadius, y2,
executed (the execution status of this line is deduced): x2 - xRadius, y2,
-
772 x1 + xRadius, y2, // LineTo
executed (the execution status of this line is deduced): x1 + xRadius, y2,
-
773 x1 + (1 - KAPPA) * xRadius, y2, // CurveTo
executed (the execution status of this line is deduced): x1 + (1 - qreal(0.5522847498)) * xRadius, y2,
-
774 x1, y2 - (1 - KAPPA) * yRadius,
executed (the execution status of this line is deduced): x1, y2 - (1 - qreal(0.5522847498)) * yRadius,
-
775 x1, y2 - yRadius,
executed (the execution status of this line is deduced): x1, y2 - yRadius,
-
776 x1, y1 + yRadius, // LineTo
executed (the execution status of this line is deduced): x1, y1 + yRadius,
-
777 x1, y1 + (1 - KAPPA) * yRadius, // CurveTo
executed (the execution status of this line is deduced): x1, y1 + (1 - qreal(0.5522847498)) * yRadius,
-
778 x1 + (1 - KAPPA) * xRadius, y1,
executed (the execution status of this line is deduced): x1 + (1 - qreal(0.5522847498)) * xRadius, y1,
-
779 x1 + xRadius, y1
executed (the execution status of this line is deduced): x1 + xRadius, y1
-
780 };
executed (the execution status of this line is deduced): };
-
781 -
782 QVectorPath path(pts, 17, qpaintengineex_roundedrect_types, QVectorPath::RoundedRectHint);
executed (the execution status of this line is deduced): QVectorPath path(pts, 17, qpaintengineex_roundedrect_types, QVectorPath::RoundedRectHint);
-
783 draw(path);
executed (the execution status of this line is deduced): draw(path);
-
784}
executed: }
Execution Count:305
305
785 -
786 -
787 -
788void QPaintEngineEx::drawLines(const QLine *lines, int lineCount) -
789{ -
790 int elementCount = lineCount << 1;
executed (the execution status of this line is deduced): int elementCount = lineCount << 1;
-
791 while (elementCount > 0) {
evaluated: elementCount > 0
TRUEFALSE
yes
Evaluation Count:58
yes
Evaluation Count:58
58
792 int count = qMin(elementCount, 32);
executed (the execution status of this line is deduced): int count = qMin(elementCount, 32);
-
793 -
794 qreal pts[64];
executed (the execution status of this line is deduced): qreal pts[64];
-
795 int count2 = count<<1;
executed (the execution status of this line is deduced): int count2 = count<<1;
-
796 for (int i=0; i<count2; ++i)
evaluated: i<count2
TRUEFALSE
yes
Evaluation Count:232
yes
Evaluation Count:58
58-232
797 pts[i] = ((int *) lines)[i];
executed: pts[i] = ((int *) lines)[i];
Execution Count:232
232
798 -
799 QVectorPath path(pts, count, qpaintengineex_line_types_16, QVectorPath::LinesHint);
executed (the execution status of this line is deduced): QVectorPath path(pts, count, qpaintengineex_line_types_16, QVectorPath::LinesHint);
-
800 stroke(path, state()->pen);
executed (the execution status of this line is deduced): stroke(path, state()->pen);
-
801 -
802 elementCount -= 32;
executed (the execution status of this line is deduced): elementCount -= 32;
-
803 lines += 16;
executed (the execution status of this line is deduced): lines += 16;
-
804 }
executed: }
Execution Count:58
58
805}
executed: }
Execution Count:58
58
806 -
807void QPaintEngineEx::drawLines(const QLineF *lines, int lineCount) -
808{ -
809 int elementCount = lineCount << 1;
executed (the execution status of this line is deduced): int elementCount = lineCount << 1;
-
810 while (elementCount > 0) {
evaluated: elementCount > 0
TRUEFALSE
yes
Evaluation Count:834
yes
Evaluation Count:834
834
811 int count = qMin(elementCount, 32);
executed (the execution status of this line is deduced): int count = qMin(elementCount, 32);
-
812 -
813 QVectorPath path((qreal *) lines, count, qpaintengineex_line_types_16,
executed (the execution status of this line is deduced): QVectorPath path((qreal *) lines, count, qpaintengineex_line_types_16,
-
814 QVectorPath::LinesHint);
executed (the execution status of this line is deduced): QVectorPath::LinesHint);
-
815 stroke(path, state()->pen);
executed (the execution status of this line is deduced): stroke(path, state()->pen);
-
816 -
817 elementCount -= 32;
executed (the execution status of this line is deduced): elementCount -= 32;
-
818 lines += 16;
executed (the execution status of this line is deduced): lines += 16;
-
819 }
executed: }
Execution Count:834
834
820}
executed: }
Execution Count:834
834
821 -
822void QPaintEngineEx::drawEllipse(const QRectF &r) -
823{ -
824 qreal pts[26]; // QPointF[13] without constructors...
executed (the execution status of this line is deduced): qreal pts[26];
-
825 union {
executed (the execution status of this line is deduced): union {
-
826 qreal *ptr;
executed (the execution status of this line is deduced): qreal *ptr;
-
827 QPointF *points;
executed (the execution status of this line is deduced): QPointF *points;
-
828 } x;
executed (the execution status of this line is deduced): } x;
-
829 x.ptr = pts;
executed (the execution status of this line is deduced): x.ptr = pts;
-
830 -
831 int point_count = 0;
executed (the execution status of this line is deduced): int point_count = 0;
-
832 x.points[0] = qt_curves_for_arc(r, 0, -360, x.points + 1, &point_count);
executed (the execution status of this line is deduced): x.points[0] = qt_curves_for_arc(r, 0, -360, x.points + 1, &point_count);
-
833 QVectorPath vp((qreal *) pts, point_count + 1, qpaintengineex_ellipse_types, QVectorPath::EllipseHint);
executed (the execution status of this line is deduced): QVectorPath vp((qreal *) pts, point_count + 1, qpaintengineex_ellipse_types, QVectorPath::EllipseHint);
-
834 draw(vp);
executed (the execution status of this line is deduced): draw(vp);
-
835}
executed: }
Execution Count:872
872
836 -
837void QPaintEngineEx::drawEllipse(const QRect &r) -
838{ -
839 drawEllipse(QRectF(r));
executed (the execution status of this line is deduced): drawEllipse(QRectF(r));
-
840}
executed: }
Execution Count:985
985
841 -
842void QPaintEngineEx::drawPath(const QPainterPath &path) -
843{ -
844 if (!path.isEmpty())
partially evaluated: !path.isEmpty()
TRUEFALSE
yes
Evaluation Count:33309
no
Evaluation Count:0
0-33309
845 draw(qtVectorPathForPath(path));
executed: draw(qtVectorPathForPath(path));
Execution Count:33309
33309
846}
executed: }
Execution Count:33309
33309
847 -
848 -
849void QPaintEngineEx::drawPoints(const QPointF *points, int pointCount) -
850{ -
851 QPen pen = state()->pen;
never executed (the execution status of this line is deduced): QPen pen = state()->pen;
-
852 if (pen.capStyle() == Qt::FlatCap)
never evaluated: pen.capStyle() == Qt::FlatCap
0
853 pen.setCapStyle(Qt::SquareCap);
never executed: pen.setCapStyle(Qt::SquareCap);
0
854 -
855 if (pen.brush().isOpaque()) {
never evaluated: pen.brush().isOpaque()
0
856 while (pointCount > 0) {
never evaluated: pointCount > 0
0
857 int count = qMin(pointCount, 16);
never executed (the execution status of this line is deduced): int count = qMin(pointCount, 16);
-
858 qreal pts[64];
never executed (the execution status of this line is deduced): qreal pts[64];
-
859 int oset = -1;
never executed (the execution status of this line is deduced): int oset = -1;
-
860 for (int i=0; i<count; ++i) {
never evaluated: i<count
0
861 pts[++oset] = points[i].x();
never executed (the execution status of this line is deduced): pts[++oset] = points[i].x();
-
862 pts[++oset] = points[i].y();
never executed (the execution status of this line is deduced): pts[++oset] = points[i].y();
-
863 pts[++oset] = points[i].x() + 1/63.;
never executed (the execution status of this line is deduced): pts[++oset] = points[i].x() + 1/63.;
-
864 pts[++oset] = points[i].y();
never executed (the execution status of this line is deduced): pts[++oset] = points[i].y();
-
865 }
never executed: }
0
866 QVectorPath path(pts, count * 2, qpaintengineex_line_types_16, QVectorPath::LinesHint);
never executed (the execution status of this line is deduced): QVectorPath path(pts, count * 2, qpaintengineex_line_types_16, QVectorPath::LinesHint);
-
867 stroke(path, pen);
never executed (the execution status of this line is deduced): stroke(path, pen);
-
868 pointCount -= 16;
never executed (the execution status of this line is deduced): pointCount -= 16;
-
869 points += 16;
never executed (the execution status of this line is deduced): points += 16;
-
870 }
never executed: }
0
871 } else {
never executed: }
0
872 for (int i=0; i<pointCount; ++i) {
never evaluated: i<pointCount
0
873 qreal pts[] = { points[i].x(), points[i].y(), points[i].x() + qreal(1/63.), points[i].y() };
never executed (the execution status of this line is deduced): qreal pts[] = { points[i].x(), points[i].y(), points[i].x() + qreal(1/63.), points[i].y() };
-
874 QVectorPath path(pts, 2, 0);
never executed (the execution status of this line is deduced): QVectorPath path(pts, 2, 0);
-
875 stroke(path, pen);
never executed (the execution status of this line is deduced): stroke(path, pen);
-
876 }
never executed: }
0
877 }
never executed: }
0
878} -
879 -
880void QPaintEngineEx::drawPoints(const QPoint *points, int pointCount) -
881{ -
882 QPen pen = state()->pen;
executed (the execution status of this line is deduced): QPen pen = state()->pen;
-
883 if (pen.capStyle() == Qt::FlatCap)
partially evaluated: pen.capStyle() == Qt::FlatCap
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
884 pen.setCapStyle(Qt::SquareCap);
never executed: pen.setCapStyle(Qt::SquareCap);
0
885 -
886 if (pen.brush().isOpaque()) {
partially evaluated: pen.brush().isOpaque()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
887 while (pointCount > 0) {
evaluated: pointCount > 0
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
888 int count = qMin(pointCount, 16);
executed (the execution status of this line is deduced): int count = qMin(pointCount, 16);
-
889 qreal pts[64];
executed (the execution status of this line is deduced): qreal pts[64];
-
890 int oset = -1;
executed (the execution status of this line is deduced): int oset = -1;
-
891 for (int i=0; i<count; ++i) {
evaluated: i<count
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
892 pts[++oset] = points[i].x();
executed (the execution status of this line is deduced): pts[++oset] = points[i].x();
-
893 pts[++oset] = points[i].y();
executed (the execution status of this line is deduced): pts[++oset] = points[i].y();
-
894 pts[++oset] = points[i].x() + 1/63.;
executed (the execution status of this line is deduced): pts[++oset] = points[i].x() + 1/63.;
-
895 pts[++oset] = points[i].y();
executed (the execution status of this line is deduced): pts[++oset] = points[i].y();
-
896 }
executed: }
Execution Count:1
1
897 QVectorPath path(pts, count * 2, qpaintengineex_line_types_16, QVectorPath::LinesHint);
executed (the execution status of this line is deduced): QVectorPath path(pts, count * 2, qpaintengineex_line_types_16, QVectorPath::LinesHint);
-
898 stroke(path, pen);
executed (the execution status of this line is deduced): stroke(path, pen);
-
899 pointCount -= 16;
executed (the execution status of this line is deduced): pointCount -= 16;
-
900 points += 16;
executed (the execution status of this line is deduced): points += 16;
-
901 }
executed: }
Execution Count:1
1
902 } else {
executed: }
Execution Count:1
1
903 for (int i=0; i<pointCount; ++i) {
never evaluated: i<pointCount
0
904 qreal pts[] = { qreal(points[i].x()), qreal(points[i].y()),
never executed (the execution status of this line is deduced): qreal pts[] = { qreal(points[i].x()), qreal(points[i].y()),
-
905 qreal(points[i].x() +1/63.), qreal(points[i].y()) };
never executed (the execution status of this line is deduced): qreal(points[i].x() +1/63.), qreal(points[i].y()) };
-
906 QVectorPath path(pts, 2, 0);
never executed (the execution status of this line is deduced): QVectorPath path(pts, 2, 0);
-
907 stroke(path, pen);
never executed (the execution status of this line is deduced): stroke(path, pen);
-
908 }
never executed: }
0
909 }
never executed: }
0
910} -
911 -
912 -
913void QPaintEngineEx::drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) -
914{ -
915 QVectorPath path((qreal *) points, pointCount, 0, QVectorPath::polygonFlags(mode));
executed (the execution status of this line is deduced): QVectorPath path((qreal *) points, pointCount, 0, QVectorPath::polygonFlags(mode));
-
916 -
917 if (mode == PolylineMode)
partially evaluated: mode == PolylineMode
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
918 stroke(path, state()->pen);
never executed: stroke(path, state()->pen);
0
919 else -
920 draw(path);
executed: draw(path);
Execution Count:3
3
921} -
922 -
923void QPaintEngineEx::drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) -
924{ -
925 int count = pointCount<<1;
executed (the execution status of this line is deduced): int count = pointCount<<1;
-
926 QVarLengthArray<qreal> pts(count);
executed (the execution status of this line is deduced): QVarLengthArray<qreal> pts(count);
-
927 -
928 for (int i=0; i<count; ++i)
evaluated: i<count
TRUEFALSE
yes
Evaluation Count:66972
yes
Evaluation Count:11162
11162-66972
929 pts[i] = ((int *) points)[i];
executed: pts[i] = ((int *) points)[i];
Execution Count:66972
66972
930 -
931 QVectorPath path(pts.data(), pointCount, 0, QVectorPath::polygonFlags(mode));
executed (the execution status of this line is deduced): QVectorPath path(pts.data(), pointCount, 0, QVectorPath::polygonFlags(mode));
-
932 -
933 if (mode == PolylineMode)
partially evaluated: mode == PolylineMode
TRUEFALSE
yes
Evaluation Count:11162
no
Evaluation Count:0
0-11162
934 stroke(path, state()->pen);
executed: stroke(path, state()->pen);
Execution Count:11162
11162
935 else -
936 draw(path);
never executed: draw(path);
0
937 -
938} -
939 -
940void QPaintEngineEx::drawPixmap(const QPointF &pos, const QPixmap &pm) -
941{ -
942 drawPixmap(QRectF(pos, pm.size() / pm.devicePixelRatio()), pm, pm.rect());
executed (the execution status of this line is deduced): drawPixmap(QRectF(pos, pm.size() / pm.devicePixelRatio()), pm, pm.rect());
-
943}
executed: }
Execution Count:3
3
944 -
945void QPaintEngineEx::drawImage(const QPointF &pos, const QImage &image) -
946{ -
947 drawImage(QRectF(pos, image.size() / image.devicePixelRatio()), image, image.rect());
never executed (the execution status of this line is deduced): drawImage(QRectF(pos, image.size() / image.devicePixelRatio()), image, image.rect());
-
948}
never executed: }
0
949 -
950void QPaintEngineEx::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) -
951{ -
952 QBrush brush(state()->pen.color(), pixmap);
never executed (the execution status of this line is deduced): QBrush brush(state()->pen.color(), pixmap);
-
953 QTransform xform = QTransform::fromTranslate(r.x() - s.x(), r.y() - s.y());
never executed (the execution status of this line is deduced): QTransform xform = QTransform::fromTranslate(r.x() - s.x(), r.y() - s.y());
-
954 brush.setTransform(xform);
never executed (the execution status of this line is deduced): brush.setTransform(xform);
-
955 -
956 qreal pts[] = { r.x(), r.y(),
never executed (the execution status of this line is deduced): qreal pts[] = { r.x(), r.y(),
-
957 r.x() + r.width(), r.y(),
never executed (the execution status of this line is deduced): r.x() + r.width(), r.y(),
-
958 r.x() + r.width(), r.y() + r.height(),
never executed (the execution status of this line is deduced): r.x() + r.width(), r.y() + r.height(),
-
959 r.x(), r.y() + r.height() };
never executed (the execution status of this line is deduced): r.x(), r.y() + r.height() };
-
960 -
961 QVectorPath path(pts, 4, 0, QVectorPath::RectangleHint);
never executed (the execution status of this line is deduced): QVectorPath path(pts, 4, 0, QVectorPath::RectangleHint);
-
962 fill(path, brush);
never executed (the execution status of this line is deduced): fill(path, brush);
-
963}
never executed: }
0
964 -
965void QPaintEngineEx::drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, -
966 const QPixmap &pixmap, QPainter::PixmapFragmentHints /*hints*/) -
967{ -
968 if (pixmap.isNull())
partially evaluated: pixmap.isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
969 return;
never executed: return;
0
970 -
971 qreal oldOpacity = state()->opacity;
executed (the execution status of this line is deduced): qreal oldOpacity = state()->opacity;
-
972 QTransform oldTransform = state()->matrix;
executed (the execution status of this line is deduced): QTransform oldTransform = state()->matrix;
-
973 -
974 for (int i = 0; i < fragmentCount; ++i) {
evaluated: i < fragmentCount
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:3
3-19
975 QTransform transform = oldTransform;
executed (the execution status of this line is deduced): QTransform transform = oldTransform;
-
976 transform.translate(fragments[i].x, fragments[i].y);
executed (the execution status of this line is deduced): transform.translate(fragments[i].x, fragments[i].y);
-
977 transform.rotate(fragments[i].rotation);
executed (the execution status of this line is deduced): transform.rotate(fragments[i].rotation);
-
978 state()->opacity = oldOpacity * fragments[i].opacity;
executed (the execution status of this line is deduced): state()->opacity = oldOpacity * fragments[i].opacity;
-
979 state()->matrix = transform;
executed (the execution status of this line is deduced): state()->matrix = transform;
-
980 opacityChanged();
executed (the execution status of this line is deduced): opacityChanged();
-
981 transformChanged();
executed (the execution status of this line is deduced): transformChanged();
-
982 -
983 qreal w = fragments[i].scaleX * fragments[i].width;
executed (the execution status of this line is deduced): qreal w = fragments[i].scaleX * fragments[i].width;
-
984 qreal h = fragments[i].scaleY * fragments[i].height;
executed (the execution status of this line is deduced): qreal h = fragments[i].scaleY * fragments[i].height;
-
985 QRectF sourceRect(fragments[i].sourceLeft, fragments[i].sourceTop,
executed (the execution status of this line is deduced): QRectF sourceRect(fragments[i].sourceLeft, fragments[i].sourceTop,
-
986 fragments[i].width, fragments[i].height);
executed (the execution status of this line is deduced): fragments[i].width, fragments[i].height);
-
987 drawPixmap(QRectF(-0.5 * w, -0.5 * h, w, h), pixmap, sourceRect);
executed (the execution status of this line is deduced): drawPixmap(QRectF(-0.5 * w, -0.5 * h, w, h), pixmap, sourceRect);
-
988 }
executed: }
Execution Count:19
19
989 -
990 state()->opacity = oldOpacity;
executed (the execution status of this line is deduced): state()->opacity = oldOpacity;
-
991 state()->matrix = oldTransform;
executed (the execution status of this line is deduced): state()->matrix = oldTransform;
-
992 opacityChanged();
executed (the execution status of this line is deduced): opacityChanged();
-
993 transformChanged();
executed (the execution status of this line is deduced): transformChanged();
-
994}
executed: }
Execution Count:3
3
995 -
996void QPaintEngineEx::setState(QPainterState *s) -
997{ -
998 QPaintEngine::state = s;
executed (the execution status of this line is deduced): QPaintEngine::state = s;
-
999}
executed: }
Execution Count:93235
93235
1000 -
1001 -
1002void QPaintEngineEx::updateState(const QPaintEngineState &) -
1003{ -
1004 // do nothing... -
1005} -
1006 -
1007Q_GUI_EXPORT QPainterPath qt_painterPathFromVectorPath(const QVectorPath &path) -
1008{ -
1009 const qreal *points = path.points();
never executed (the execution status of this line is deduced): const qreal *points = path.points();
-
1010 const QPainterPath::ElementType *types = path.elements();
never executed (the execution status of this line is deduced): const QPainterPath::ElementType *types = path.elements();
-
1011 -
1012 QPainterPath p;
never executed (the execution status of this line is deduced): QPainterPath p;
-
1013 if (types) {
never evaluated: types
0
1014 int id = 0;
never executed (the execution status of this line is deduced): int id = 0;
-
1015 for (int i=0; i<path.elementCount(); ++i) {
never evaluated: i<path.elementCount()
0
1016 switch(types[i]) { -
1017 case QPainterPath::MoveToElement: -
1018 p.moveTo(QPointF(points[id], points[id+1]));
never executed (the execution status of this line is deduced): p.moveTo(QPointF(points[id], points[id+1]));
-
1019 id+=2;
never executed (the execution status of this line is deduced): id+=2;
-
1020 break;
never executed: break;
0
1021 case QPainterPath::LineToElement: -
1022 p.lineTo(QPointF(points[id], points[id+1]));
never executed (the execution status of this line is deduced): p.lineTo(QPointF(points[id], points[id+1]));
-
1023 id+=2;
never executed (the execution status of this line is deduced): id+=2;
-
1024 break;
never executed: break;
0
1025 case QPainterPath::CurveToElement: { -
1026 QPointF p1(points[id], points[id+1]);
never executed (the execution status of this line is deduced): QPointF p1(points[id], points[id+1]);
-
1027 QPointF p2(points[id+2], points[id+3]);
never executed (the execution status of this line is deduced): QPointF p2(points[id+2], points[id+3]);
-
1028 QPointF p3(points[id+4], points[id+5]);
never executed (the execution status of this line is deduced): QPointF p3(points[id+4], points[id+5]);
-
1029 p.cubicTo(p1, p2, p3);
never executed (the execution status of this line is deduced): p.cubicTo(p1, p2, p3);
-
1030 id+=6;
never executed (the execution status of this line is deduced): id+=6;
-
1031 break;
never executed: break;
0
1032 } -
1033 case QPainterPath::CurveToDataElement: -
1034 ; -
1035 break;
never executed: break;
0
1036 } -
1037 }
never executed: }
0
1038 } else {
never executed: }
0
1039 p.moveTo(QPointF(points[0], points[1]));
never executed (the execution status of this line is deduced): p.moveTo(QPointF(points[0], points[1]));
-
1040 int id = 2;
never executed (the execution status of this line is deduced): int id = 2;
-
1041 for (int i=1; i<path.elementCount(); ++i) {
never evaluated: i<path.elementCount()
0
1042 p.lineTo(QPointF(points[id], points[id+1]));
never executed (the execution status of this line is deduced): p.lineTo(QPointF(points[id], points[id+1]));
-
1043 id+=2;
never executed (the execution status of this line is deduced): id+=2;
-
1044 }
never executed: }
0
1045 }
never executed: }
0
1046 if (path.hints() & QVectorPath::WindingFill)
never evaluated: path.hints() & QVectorPath::WindingFill
0
1047 p.setFillRule(Qt::WindingFill);
never executed: p.setFillRule(Qt::WindingFill);
0
1048 -
1049 return p;
never executed: return p;
0
1050} -
1051 -
1052void QPaintEngineEx::drawStaticTextItem(QStaticTextItem *staticTextItem) -
1053{ -
1054 QPainterPath path;
executed (the execution status of this line is deduced): QPainterPath path;
-
1055 path.setFillRule(Qt::WindingFill);
executed (the execution status of this line is deduced): path.setFillRule(Qt::WindingFill);
-
1056 -
1057 if (staticTextItem->numGlyphs == 0)
partially evaluated: staticTextItem->numGlyphs == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:19
0-19
1058 return;
never executed: return;
0
1059 -
1060 QFontEngine *fontEngine = staticTextItem->fontEngine();
executed (the execution status of this line is deduced): QFontEngine *fontEngine = staticTextItem->fontEngine();
-
1061 fontEngine->addGlyphsToPath(staticTextItem->glyphs, staticTextItem->glyphPositions,
executed (the execution status of this line is deduced): fontEngine->addGlyphsToPath(staticTextItem->glyphs, staticTextItem->glyphPositions,
-
1062 staticTextItem->numGlyphs, &path, 0);
executed (the execution status of this line is deduced): staticTextItem->numGlyphs, &path, 0);
-
1063 if (!path.isEmpty()) {
partially evaluated: !path.isEmpty()
TRUEFALSE
yes
Evaluation Count:19
no
Evaluation Count:0
0-19
1064 QPainterState *s = state();
executed (the execution status of this line is deduced): QPainterState *s = state();
-
1065 QPainter::RenderHints oldHints = s->renderHints;
executed (the execution status of this line is deduced): QPainter::RenderHints oldHints = s->renderHints;
-
1066 bool changedHints = false;
executed (the execution status of this line is deduced): bool changedHints = false;
-
1067 if (bool(oldHints & QPainter::TextAntialiasing)
partially evaluated: bool(oldHints & QPainter::TextAntialiasing)
TRUEFALSE
yes
Evaluation Count:19
no
Evaluation Count:0
0-19
1068 && !bool(fontEngine->fontDef.styleStrategy & QFont::NoAntialias)
partially evaluated: !bool(fontEngine->fontDef.styleStrategy & QFont::NoAntialias)
TRUEFALSE
yes
Evaluation Count:19
no
Evaluation Count:0
0-19
1069 && !bool(oldHints & QPainter::Antialiasing)) {
partially evaluated: !bool(oldHints & QPainter::Antialiasing)
TRUEFALSE
yes
Evaluation Count:19
no
Evaluation Count:0
0-19
1070 s->renderHints |= QPainter::Antialiasing;
executed (the execution status of this line is deduced): s->renderHints |= QPainter::Antialiasing;
-
1071 renderHintsChanged();
executed (the execution status of this line is deduced): renderHintsChanged();
-
1072 changedHints = true;
executed (the execution status of this line is deduced): changedHints = true;
-
1073 }
executed: }
Execution Count:19
19
1074 -
1075 fill(qtVectorPathForPath(path), s->pen.brush());
executed (the execution status of this line is deduced): fill(qtVectorPathForPath(path), s->pen.brush());
-
1076 -
1077 if (changedHints) {
partially evaluated: changedHints
TRUEFALSE
yes
Evaluation Count:19
no
Evaluation Count:0
0-19
1078 s->renderHints = oldHints;
executed (the execution status of this line is deduced): s->renderHints = oldHints;
-
1079 renderHintsChanged();
executed (the execution status of this line is deduced): renderHintsChanged();
-
1080 }
executed: }
Execution Count:19
19
1081 }
executed: }
Execution Count:19
19
1082}
executed: }
Execution Count:19
19
1083 -
1084bool QPaintEngineEx::supportsTransformations(QFontEngine *fontEngine, const QTransform &m) const -
1085{ -
1086 Q_UNUSED(fontEngine);
never executed (the execution status of this line is deduced): (void)fontEngine;;
-
1087 -
1088 if (!m.isAffine())
never evaluated: !m.isAffine()
0
1089 return true;
never executed: return true;
0
1090 -
1091 return false;
never executed: return false;
0
1092} -
1093 -
1094bool QPaintEngineEx::shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const -
1095{ -
1096 qreal pixelSize = fontEngine->fontDef.pixelSize;
executed (the execution status of this line is deduced): qreal pixelSize = fontEngine->fontDef.pixelSize;
-
1097 return (pixelSize * pixelSize * qAbs(m.determinant())) <
executed: return (pixelSize * pixelSize * qAbs(m.determinant())) < 64 * 64;
Execution Count:23041
23041
1098 QT_MAX_CACHED_GLYPH_SIZE * QT_MAX_CACHED_GLYPH_SIZE;
executed: return (pixelSize * pixelSize * qAbs(m.determinant())) < 64 * 64;
Execution Count:23041
23041
1099} -
1100 -
1101QT_END_NAMESPACE -
1102 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial