painting/qrasterizer.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 "qrasterizer_p.h" -
43 -
44#include <QPoint> -
45#include <QRect> -
46 -
47#include <private/qmath_p.h> -
48#include <private/qdatabuffer_p.h> -
49#include <private/qdrawhelper_p.h> -
50 -
51QT_BEGIN_NAMESPACE -
52 -
53typedef int Q16Dot16; -
54#define Q16Dot16ToFloat(i) ((i)/65536.) -
55#define FloatToQ16Dot16(i) (int)((i) * 65536.) -
56#define IntToQ16Dot16(i) ((i) << 16) -
57#define Q16Dot16ToInt(i) ((i) >> 16) -
58#define Q16Dot16Factor 65536 -
59 -
60#define Q16Dot16Multiply(x, y) (int)((qlonglong(x) * qlonglong(y)) >> 16) -
61#define Q16Dot16FastMultiply(x, y) (((x) * (y)) >> 16) -
62 -
63#define SPAN_BUFFER_SIZE 256 -
64 -
65#define COORD_ROUNDING 1 // 0: round up, 1: round down -
66#define COORD_OFFSET 32 // 26.6, 32 is half a pixel -
67 -
68static inline QT_FT_Vector PointToVector(const QPointF &p) -
69{ -
70 QT_FT_Vector result = { QT_FT_Pos(p.x() * 64), QT_FT_Pos(p.y() * 64) };
executed (the execution status of this line is deduced): QT_FT_Vector result = { QT_FT_Pos(p.x() * 64), QT_FT_Pos(p.y() * 64) };
-
71 return result;
executed: return result;
Execution Count:6
6
72} -
73 -
74class QSpanBuffer { -
75public: -
76 QSpanBuffer(ProcessSpans blend, void *data, const QRect &clipRect) -
77 : m_spanCount(0) -
78 , m_blend(blend) -
79 , m_data(data) -
80 , m_clipRect(clipRect) -
81 { -
82 }
executed: }
Execution Count:121588
121588
83 -
84 ~QSpanBuffer() -
85 { -
86 flushSpans();
executed (the execution status of this line is deduced): flushSpans();
-
87 }
executed: }
Execution Count:121588
121588
88 -
89 void addSpan(int x, unsigned int len, int y, unsigned char coverage) -
90 { -
91 if (!coverage || !len)
evaluated: !coverage
TRUEFALSE
yes
Evaluation Count:646
yes
Evaluation Count:3775787
evaluated: !len
TRUEFALSE
yes
Evaluation Count:666465
yes
Evaluation Count:3109322
646-3775787
92 return;
executed: return;
Execution Count:667111
667111
93 -
94 Q_ASSERT(y >= m_clipRect.top());
executed (the execution status of this line is deduced): qt_noop();
-
95 Q_ASSERT(y <= m_clipRect.bottom());
executed (the execution status of this line is deduced): qt_noop();
-
96 Q_ASSERT(x >= m_clipRect.left());
executed (the execution status of this line is deduced): qt_noop();
-
97 Q_ASSERT(x + int(len) - 1 <= m_clipRect.right());
executed (the execution status of this line is deduced): qt_noop();
-
98 -
99 m_spans[m_spanCount].x = x;
executed (the execution status of this line is deduced): m_spans[m_spanCount].x = x;
-
100 m_spans[m_spanCount].len = len;
executed (the execution status of this line is deduced): m_spans[m_spanCount].len = len;
-
101 m_spans[m_spanCount].y = y;
executed (the execution status of this line is deduced): m_spans[m_spanCount].y = y;
-
102 m_spans[m_spanCount].coverage = coverage;
executed (the execution status of this line is deduced): m_spans[m_spanCount].coverage = coverage;
-
103 -
104 if (++m_spanCount == SPAN_BUFFER_SIZE)
evaluated: ++m_spanCount == 256
TRUEFALSE
yes
Evaluation Count:881
yes
Evaluation Count:3108441
881-3108441
105 flushSpans();
executed: flushSpans();
Execution Count:881
881
106 }
executed: }
Execution Count:3109322
3109322
107 -
108private: -
109 void flushSpans() -
110 { -
111 m_blend(m_spanCount, m_spans, m_data);
executed (the execution status of this line is deduced): m_blend(m_spanCount, m_spans, m_data);
-
112 m_spanCount = 0;
executed (the execution status of this line is deduced): m_spanCount = 0;
-
113 }
executed: }
Execution Count:122469
122469
114 -
115 QT_FT_Span m_spans[SPAN_BUFFER_SIZE]; -
116 int m_spanCount; -
117 -
118 ProcessSpans m_blend; -
119 void *m_data; -
120 -
121 QRect m_clipRect; -
122}; -
123 -
124#define CHUNK_SIZE 64 -
125class QScanConverter -
126{ -
127public: -
128 QScanConverter(); -
129 ~QScanConverter(); -
130 -
131 void begin(int top, int bottom, int left, int right, -
132 Qt::FillRule fillRule, bool legacyRounding, QSpanBuffer *spanBuffer); -
133 void end(); -
134 -
135 void mergeCurve(const QT_FT_Vector &a, const QT_FT_Vector &b, -
136 const QT_FT_Vector &c, const QT_FT_Vector &d); -
137 void mergeLine(QT_FT_Vector a, QT_FT_Vector b); -
138 -
139 struct Line -
140 { -
141 Q16Dot16 x; -
142 Q16Dot16 delta; -
143 -
144 int top, bottom; -
145 -
146 int winding; -
147 }; -
148 -
149private: -
150 struct Intersection -
151 { -
152 int x; -
153 int winding; -
154 -
155 int left, right; -
156 }; -
157 -
158 inline bool clip(Q16Dot16 &xFP, int &iTop, int &iBottom, Q16Dot16 slopeFP, Q16Dot16 edgeFP, int winding); -
159 inline void mergeIntersection(Intersection *head, const Intersection &isect); -
160 -
161 void prepareChunk(); -
162 -
163 void emitNode(const Intersection *node); -
164 void emitSpans(int chunk); -
165 -
166 inline void allocate(int size); -
167 -
168 QDataBuffer<Line> m_lines; -
169 -
170 int m_alloc; -
171 int m_size; -
172 -
173 int m_top; -
174 int m_bottom; -
175 -
176 Q16Dot16 m_leftFP; -
177 Q16Dot16 m_rightFP; -
178 -
179 int m_fillRuleMask; -
180 bool m_legacyRounding; -
181 -
182 int m_x; -
183 int m_y; -
184 int m_winding; -
185 -
186 Intersection *m_intersections; -
187 -
188 QSpanBuffer *m_spanBuffer; -
189 -
190 QDataBuffer<Line *> m_active; -
191 -
192 template <typename T> -
193 friend void qScanConvert(QScanConverter &d, T allVertical); -
194}; -
195 -
196class QRasterizerPrivate -
197{ -
198public: -
199 bool antialiased; -
200 bool legacyRounding; -
201 ProcessSpans blend; -
202 void *data; -
203 QRect clipRect; -
204 -
205 QScanConverter scanConverter; -
206}; -
207 -
208QScanConverter::QScanConverter() -
209 : m_lines(0) -
210 , m_alloc(0) -
211 , m_size(0) -
212 , m_intersections(0) -
213 , m_active(0) -
214{ -
215}
executed: }
Execution Count:5615
5615
216 -
217QScanConverter::~QScanConverter() -
218{ -
219 if (m_intersections)
evaluated: m_intersections
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:5587
17-5587
220 free(m_intersections);
executed: free(m_intersections);
Execution Count:17
17
221}
executed: }
Execution Count:5604
5604
222 -
223void QScanConverter::begin(int top, int bottom, int left, int right, -
224 Qt::FillRule fillRule, bool legacyRounding, -
225 QSpanBuffer *spanBuffer) -
226{ -
227 m_top = top;
executed (the execution status of this line is deduced): m_top = top;
-
228 m_bottom = bottom;
executed (the execution status of this line is deduced): m_bottom = bottom;
-
229 m_leftFP = IntToQ16Dot16(left);
executed (the execution status of this line is deduced): m_leftFP = ((left) << 16);
-
230 m_rightFP = IntToQ16Dot16(right + 1);
executed (the execution status of this line is deduced): m_rightFP = ((right + 1) << 16);
-
231 -
232 m_lines.reset();
executed (the execution status of this line is deduced): m_lines.reset();
-
233 -
234 m_fillRuleMask = fillRule == Qt::WindingFill ? ~0x0 : 0x1;
evaluated: fillRule == Qt::WindingFill
TRUEFALSE
yes
Evaluation Count:907
yes
Evaluation Count:119365
907-119365
235 m_legacyRounding = legacyRounding;
executed (the execution status of this line is deduced): m_legacyRounding = legacyRounding;
-
236 m_spanBuffer = spanBuffer;
executed (the execution status of this line is deduced): m_spanBuffer = spanBuffer;
-
237}
executed: }
Execution Count:120272
120272
238 -
239void QScanConverter::prepareChunk() -
240{ -
241 m_size = CHUNK_SIZE;
executed (the execution status of this line is deduced): m_size = 64;
-
242 -
243 allocate(CHUNK_SIZE);
executed (the execution status of this line is deduced): allocate(64);
-
244 memset(m_intersections, 0, CHUNK_SIZE * sizeof(Intersection));
executed (the execution status of this line is deduced): memset(m_intersections, 0, 64 * sizeof(Intersection));
-
245}
executed: }
Execution Count:1369
1369
246 -
247void QScanConverter::emitNode(const Intersection *node) -
248{ -
249tail_call: -
250 if (node->left)
evaluated: node->left
TRUEFALSE
yes
Evaluation Count:78279
yes
Evaluation Count:205683
78279-205683
251 emitNode(node + node->left);
executed: emitNode(node + node->left);
Execution Count:78279
78279
252 -
253 if (m_winding & m_fillRuleMask)
evaluated: m_winding & m_fillRuleMask
TRUEFALSE
yes
Evaluation Count:97316
yes
Evaluation Count:186646
97316-186646
254 m_spanBuffer->addSpan(m_x, node->x - m_x, m_y, 0xff);
executed: m_spanBuffer->addSpan(m_x, node->x - m_x, m_y, 0xff);
Execution Count:97316
97316
255 -
256 m_x = node->x;
executed (the execution status of this line is deduced): m_x = node->x;
-
257 m_winding += node->winding;
executed (the execution status of this line is deduced): m_winding += node->winding;
-
258 -
259 if (node->right) {
evaluated: node->right
TRUEFALSE
yes
Evaluation Count:118067
yes
Evaluation Count:165895
118067-165895
260 node += node->right;
executed (the execution status of this line is deduced): node += node->right;
-
261 goto tail_call;
executed: goto tail_call;
Execution Count:118067
118067
262 } -
263}
executed: }
Execution Count:165895
165895
264 -
265void QScanConverter::emitSpans(int chunk) -
266{ -
267 for (int dy = 0; dy < CHUNK_SIZE; ++dy) {
evaluated: dy < 64
TRUEFALSE
yes
Evaluation Count:87616
yes
Evaluation Count:1369
1369-87616
268 m_x = 0;
executed (the execution status of this line is deduced): m_x = 0;
-
269 m_y = chunk + dy;
executed (the execution status of this line is deduced): m_y = chunk + dy;
-
270 m_winding = 0;
executed (the execution status of this line is deduced): m_winding = 0;
-
271 -
272 emitNode(&m_intersections[dy]);
executed (the execution status of this line is deduced): emitNode(&m_intersections[dy]);
-
273 }
executed: }
Execution Count:87616
87616
274}
executed: }
Execution Count:1369
1369
275 -
276// split control points b[0] ... b[3] into -
277// left (b[0] ... b[3]) and right (b[3] ... b[6]) -
278static void split(QT_FT_Vector *b) -
279{ -
280 b[6] = b[3];
never executed (the execution status of this line is deduced): b[6] = b[3];
-
281 -
282 { -
283 const QT_FT_Pos temp = (b[1].x + b[2].x)/2;
never executed (the execution status of this line is deduced): const QT_FT_Pos temp = (b[1].x + b[2].x)/2;
-
284 -
285 b[1].x = (b[0].x + b[1].x)/2;
never executed (the execution status of this line is deduced): b[1].x = (b[0].x + b[1].x)/2;
-
286 b[5].x = (b[2].x + b[3].x)/2;
never executed (the execution status of this line is deduced): b[5].x = (b[2].x + b[3].x)/2;
-
287 b[2].x = (b[1].x + temp)/2;
never executed (the execution status of this line is deduced): b[2].x = (b[1].x + temp)/2;
-
288 b[4].x = (b[5].x + temp)/2;
never executed (the execution status of this line is deduced): b[4].x = (b[5].x + temp)/2;
-
289 b[3].x = (b[2].x + b[4].x)/2;
never executed (the execution status of this line is deduced): b[3].x = (b[2].x + b[4].x)/2;
-
290 } -
291 { -
292 const QT_FT_Pos temp = (b[1].y + b[2].y)/2;
never executed (the execution status of this line is deduced): const QT_FT_Pos temp = (b[1].y + b[2].y)/2;
-
293 -
294 b[1].y = (b[0].y + b[1].y)/2;
never executed (the execution status of this line is deduced): b[1].y = (b[0].y + b[1].y)/2;
-
295 b[5].y = (b[2].y + b[3].y)/2;
never executed (the execution status of this line is deduced): b[5].y = (b[2].y + b[3].y)/2;
-
296 b[2].y = (b[1].y + temp)/2;
never executed (the execution status of this line is deduced): b[2].y = (b[1].y + temp)/2;
-
297 b[4].y = (b[5].y + temp)/2;
never executed (the execution status of this line is deduced): b[4].y = (b[5].y + temp)/2;
-
298 b[3].y = (b[2].y + b[4].y)/2;
never executed (the execution status of this line is deduced): b[3].y = (b[2].y + b[4].y)/2;
-
299 } -
300}
never executed: }
0
301 -
302static inline bool topOrder(const QScanConverter::Line &a, const QScanConverter::Line &b) -
303{ -
304 return a.top < b.top;
executed: return a.top < b.top;
Execution Count:1895804
1895804
305} -
306 -
307static inline bool xOrder(const QScanConverter::Line *a, const QScanConverter::Line *b) -
308{ -
309 return a->x < b->x;
executed: return a->x < b->x;
Execution Count:3519283
3519283
310} -
311 -
312template <bool B> -
313struct QBoolToType -
314{ -
315 inline bool operator()() const -
316 { -
317 return B;
executed: return B;
Execution Count:10398045
10398045
318 } -
319}; -
320 -
321// should be a member function but VC6 doesn't support member template functions -
322template <typename T> -
323void qScanConvert(QScanConverter &d, T allVertical) -
324{ -
325 if (!d.m_lines.size()) {
partially evaluated: !d.m_lines.size()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:119241
0-119241
326 d.m_active.reset();
never executed (the execution status of this line is deduced): d.m_active.reset();
-
327 return;
never executed: return;
0
328 } -
329 qSort(d.m_lines.data(), d.m_lines.data() + d.m_lines.size(), QT_PREPEND_NAMESPACE(topOrder));
executed (the execution status of this line is deduced): qSort(d.m_lines.data(), d.m_lines.data() + d.m_lines.size(), ::topOrder);
-
330 int line = 0;
executed (the execution status of this line is deduced): int line = 0;
-
331 for (int y = d.m_lines.first().top; y <= d.m_bottom; ++y) {
evaluated: y <= d.m_bottom
TRUEFALSE
yes
Evaluation Count:3454699
yes
Evaluation Count:119241
119241-3454699
332 for (; line < d.m_lines.size() && d.m_lines.at(line).top == y; ++line) {
evaluated: line < d.m_lines.size()
TRUEFALSE
yes
Evaluation Count:3512233
yes
Evaluation Count:694944
evaluated: d.m_lines.at(line).top == y
TRUEFALSE
yes
Evaluation Count:752478
yes
Evaluation Count:2759755
694944-3512233
333 // add node to active list -
334 if (allVertical()) {
evaluated: allVertical()
TRUEFALSE
yes
Evaluation Count:83145
yes
Evaluation Count:669333
83145-669333
335 QScanConverter::Line *l = &d.m_lines.at(line);
executed (the execution status of this line is deduced): QScanConverter::Line *l = &d.m_lines.at(line);
-
336 d.m_active.resize(d.m_active.size() + 1);
executed (the execution status of this line is deduced): d.m_active.resize(d.m_active.size() + 1);
-
337 int j;
executed (the execution status of this line is deduced): int j;
-
338 for (j = d.m_active.size() - 2; j >= 0 && QT_PREPEND_NAMESPACE(xOrder)(l, d.m_active.at(j)); --j)
evaluated: j >= 0
TRUEFALSE
yes
Evaluation Count:91165
yes
Evaluation Count:57916
evaluated: ::xOrder(l, d.m_active.at(j))
TRUEFALSE
yes
Evaluation Count:65936
yes
Evaluation Count:25229
25229-91165
339 d.m_active.at(j+1) = d.m_active.at(j);
executed: d.m_active.at(j+1) = d.m_active.at(j);
Execution Count:65936
65936
340 d.m_active.at(j+1) = l;
executed (the execution status of this line is deduced): d.m_active.at(j+1) = l;
-
341 } else {
executed: }
Execution Count:83145
83145
342 d.m_active << &d.m_lines.at(line);
executed (the execution status of this line is deduced): d.m_active << &d.m_lines.at(line);
-
343 }
executed: }
Execution Count:669333
669333
344 } -
345 -
346 int numActive = d.m_active.size();
executed (the execution status of this line is deduced): int numActive = d.m_active.size();
-
347 if (!allVertical()) {
evaluated: !allVertical()
TRUEFALSE
yes
Evaluation Count:3415434
yes
Evaluation Count:39265
39265-3415434
348 // use insertion sort instead of qSort, as the active edge list is quite small -
349 // and in the average case already sorted -
350 for (int i = 1; i < numActive; ++i) {
evaluated: i < numActive
TRUEFALSE
yes
Evaluation Count:3426668
yes
Evaluation Count:3415434
3415434-3426668
351 QScanConverter::Line *l = d.m_active.at(i);
executed (the execution status of this line is deduced): QScanConverter::Line *l = d.m_active.at(i);
-
352 int j;
executed (the execution status of this line is deduced): int j;
-
353 for (j = i-1; j >= 0 && QT_PREPEND_NAMESPACE(xOrder)(l, d.m_active.at(j)); --j)
evaluated: j >= 0
TRUEFALSE
yes
Evaluation Count:3428118
yes
Evaluation Count:232080
evaluated: ::xOrder(l, d.m_active.at(j))
TRUEFALSE
yes
Evaluation Count:233530
yes
Evaluation Count:3194588
232080-3428118
354 d.m_active.at(j+1) = d.m_active.at(j);
executed: d.m_active.at(j+1) = d.m_active.at(j);
Execution Count:233530
233530
355 d.m_active.at(j+1) = l;
executed (the execution status of this line is deduced): d.m_active.at(j+1) = l;
-
356 }
executed: }
Execution Count:3426668
3426668
357 }
executed: }
Execution Count:3415434
3415434
358 -
359 int x = 0;
executed (the execution status of this line is deduced): int x = 0;
-
360 int winding = 0;
executed (the execution status of this line is deduced): int winding = 0;
-
361 for (int i = 0; i < numActive; ++i) {
evaluated: i < numActive
TRUEFALSE
yes
Evaluation Count:6943346
yes
Evaluation Count:3454699
3454699-6943346
362 QScanConverter::Line *node = d.m_active.at(i);
executed (the execution status of this line is deduced): QScanConverter::Line *node = d.m_active.at(i);
-
363 -
364 const int current = Q16Dot16ToInt(node->x);
executed (the execution status of this line is deduced): const int current = ((node->x) >> 16);
-
365 if (winding & d.m_fillRuleMask)
evaluated: winding & d.m_fillRuleMask
TRUEFALSE
yes
Evaluation Count:3473534
yes
Evaluation Count:3469812
3469812-3473534
366 d.m_spanBuffer->addSpan(x, current - x, y, 0xff);
executed: d.m_spanBuffer->addSpan(x, current - x, y, 0xff);
Execution Count:3473534
3473534
367 -
368 x = current;
executed (the execution status of this line is deduced): x = current;
-
369 winding += node->winding;
executed (the execution status of this line is deduced): winding += node->winding;
-
370 -
371 if (node->bottom == y) {
evaluated: node->bottom == y
TRUEFALSE
yes
Evaluation Count:752478
yes
Evaluation Count:6190868
752478-6190868
372 // remove node from active list -
373 for (int j = i; j < numActive - 1; ++j)
evaluated: j < numActive - 1
TRUEFALSE
yes
Evaluation Count:451785
yes
Evaluation Count:752478
451785-752478
374 d.m_active.at(j) = d.m_active.at(j+1);
executed: d.m_active.at(j) = d.m_active.at(j+1);
Execution Count:451785
451785
375 -
376 d.m_active.resize(--numActive);
executed (the execution status of this line is deduced): d.m_active.resize(--numActive);
-
377 --i;
executed (the execution status of this line is deduced): --i;
-
378 } else if (!allVertical())
executed: }
Execution Count:752478
evaluated: !allVertical()
TRUEFALSE
yes
Evaluation Count:6172755
yes
Evaluation Count:18113
18113-6172755
379 node->x += node->delta;
executed: node->x += node->delta;
Execution Count:6172755
6172755
380 } -
381 }
executed: }
Execution Count:3454699
3454699
382 d.m_active.reset();
executed (the execution status of this line is deduced): d.m_active.reset();
-
383}
executed: }
Execution Count:119241
119241
384 -
385void QScanConverter::end() -
386{ -
387 if (m_lines.isEmpty())
partially evaluated: m_lines.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:120272
0-120272
388 return;
never executed: return;
0
389 -
390 if (m_lines.size() <= 32) {
evaluated: m_lines.size() <= 32
TRUEFALSE
yes
Evaluation Count:119241
yes
Evaluation Count:1031
1031-119241
391 bool allVertical = true;
executed (the execution status of this line is deduced): bool allVertical = true;
-
392 for (int i = 0; i < m_lines.size(); ++i) {
evaluated: i < m_lines.size()
TRUEFALSE
yes
Evaluation Count:288930
yes
Evaluation Count:16744
16744-288930
393 if (m_lines.at(i).delta) {
evaluated: m_lines.at(i).delta
TRUEFALSE
yes
Evaluation Count:102497
yes
Evaluation Count:186433
102497-186433
394 allVertical = false;
executed (the execution status of this line is deduced): allVertical = false;
-
395 break;
executed: break;
Execution Count:102497
102497
396 } -
397 }
executed: }
Execution Count:186433
186433
398 if (allVertical)
evaluated: allVertical
TRUEFALSE
yes
Evaluation Count:16744
yes
Evaluation Count:102497
16744-102497
399 qScanConvert(*this, QBoolToType<true>());
executed: qScanConvert(*this, QBoolToType<true>());
Execution Count:16744
16744
400 else -
401 qScanConvert(*this, QBoolToType<false>());
executed: qScanConvert(*this, QBoolToType<false>());
Execution Count:102497
102497
402 } else { -
403 for (int chunkTop = m_top; chunkTop <= m_bottom; chunkTop += CHUNK_SIZE) {
evaluated: chunkTop <= m_bottom
TRUEFALSE
yes
Evaluation Count:1369
yes
Evaluation Count:1031
1031-1369
404 prepareChunk();
executed (the execution status of this line is deduced): prepareChunk();
-
405 -
406 Intersection isect = { 0, 0, 0, 0 };
executed (the execution status of this line is deduced): Intersection isect = { 0, 0, 0, 0 };
-
407 -
408 const int chunkBottom = chunkTop + CHUNK_SIZE;
executed (the execution status of this line is deduced): const int chunkBottom = chunkTop + 64;
-
409 for (int i = 0; i < m_lines.size(); ++i) {
evaluated: i < m_lines.size()
TRUEFALSE
yes
Evaluation Count:174964
yes
Evaluation Count:1369
1369-174964
410 Line &line = m_lines.at(i);
executed (the execution status of this line is deduced): Line &line = m_lines.at(i);
-
411 -
412 if ((line.bottom < chunkTop) || (line.top > chunkBottom))
evaluated: (line.bottom < chunkTop)
TRUEFALSE
yes
Evaluation Count:50224
yes
Evaluation Count:124740
evaluated: (line.top > chunkBottom)
TRUEFALSE
yes
Evaluation Count:21160
yes
Evaluation Count:103580
21160-124740
413 continue;
executed: continue;
Execution Count:71384
71384
414 -
415 const int top = qMax(0, line.top - chunkTop);
executed (the execution status of this line is deduced): const int top = qMax(0, line.top - chunkTop);
-
416 const int bottom = qMin(CHUNK_SIZE, line.bottom + 1 - chunkTop);
executed (the execution status of this line is deduced): const int bottom = qMin(64, line.bottom + 1 - chunkTop);
-
417 allocate(m_size + bottom - top);
executed (the execution status of this line is deduced): allocate(m_size + bottom - top);
-
418 -
419 isect.winding = line.winding;
executed (the execution status of this line is deduced): isect.winding = line.winding;
-
420 -
421 Intersection *it = m_intersections + top;
executed (the execution status of this line is deduced): Intersection *it = m_intersections + top;
-
422 Intersection *end = m_intersections + bottom;
executed (the execution status of this line is deduced): Intersection *end = m_intersections + bottom;
-
423 -
424 if (line.delta) {
evaluated: line.delta
TRUEFALSE
yes
Evaluation Count:52502
yes
Evaluation Count:51078
51078-52502
425 for (; it != end; ++it) {
evaluated: it != end
TRUEFALSE
yes
Evaluation Count:176656
yes
Evaluation Count:52502
52502-176656
426 isect.x = Q16Dot16ToInt(line.x);
executed (the execution status of this line is deduced): isect.x = ((line.x) >> 16);
-
427 line.x += line.delta;
executed (the execution status of this line is deduced): line.x += line.delta;
-
428 mergeIntersection(it, isect);
executed (the execution status of this line is deduced): mergeIntersection(it, isect);
-
429 }
executed: }
Execution Count:176656
176656
430 } else {
executed: }
Execution Count:52502
52502
431 isect.x = Q16Dot16ToInt(line.x);
executed (the execution status of this line is deduced): isect.x = ((line.x) >> 16);
-
432 for (; it != end; ++it)
evaluated: it != end
TRUEFALSE
yes
Evaluation Count:91454
yes
Evaluation Count:51078
51078-91454
433 mergeIntersection(it, isect);
executed: mergeIntersection(it, isect);
Execution Count:91454
91454
434 }
executed: }
Execution Count:51078
51078
435 } -
436 -
437 emitSpans(chunkTop);
executed (the execution status of this line is deduced): emitSpans(chunkTop);
-
438 }
executed: }
Execution Count:1369
1369
439 }
executed: }
Execution Count:1031
1031
440 -
441 if (m_alloc > 1024) {
evaluated: m_alloc > 1024
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:120265
7-120265
442 free(m_intersections);
executed (the execution status of this line is deduced): free(m_intersections);
-
443 m_alloc = 0;
executed (the execution status of this line is deduced): m_alloc = 0;
-
444 m_size = 0;
executed (the execution status of this line is deduced): m_size = 0;
-
445 m_intersections = 0;
executed (the execution status of this line is deduced): m_intersections = 0;
-
446 }
executed: }
Execution Count:7
7
447 -
448 if (m_lines.size() > 1024)
evaluated: m_lines.size() > 1024
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:120269
3-120269
449 m_lines.shrink(1024);
executed: m_lines.shrink(1024);
Execution Count:3
3
450}
executed: }
Execution Count:120272
120272
451 -
452inline void QScanConverter::allocate(int size) -
453{ -
454 if (m_alloc < size) {
evaluated: m_alloc < size
TRUEFALSE
yes
Evaluation Count:114
yes
Evaluation Count:104835
114-104835
455 int newAlloc = qMax(size, 2 * m_alloc);
executed (the execution status of this line is deduced): int newAlloc = qMax(size, 2 * m_alloc);
-
456 m_intersections = q_check_ptr((Intersection *)realloc(m_intersections, newAlloc * sizeof(Intersection)));
executed (the execution status of this line is deduced): m_intersections = q_check_ptr((Intersection *)realloc(m_intersections, newAlloc * sizeof(Intersection)));
-
457 m_alloc = newAlloc;
executed (the execution status of this line is deduced): m_alloc = newAlloc;
-
458 }
executed: }
Execution Count:114
114
459}
executed: }
Execution Count:104949
104949
460 -
461inline void QScanConverter::mergeIntersection(Intersection *it, const Intersection &isect) -
462{ -
463 Intersection *current = it;
executed (the execution status of this line is deduced): Intersection *current = it;
-
464 -
465 while (isect.x != current->x) {
evaluated: isect.x != current->x
TRUEFALSE
yes
Evaluation Count:1801602
yes
Evaluation Count:71764
71764-1801602
466 int &next = isect.x < current->x ? current->left : current->right;
evaluated: isect.x < current->x
TRUEFALSE
yes
Evaluation Count:796533
yes
Evaluation Count:1005069
796533-1005069
467 if (next)
evaluated: next
TRUEFALSE
yes
Evaluation Count:1605256
yes
Evaluation Count:196346
196346-1605256
468 current += next;
executed: current += next;
Execution Count:1605256
1605256
469 else { -
470 Intersection *last = m_intersections + m_size;
executed (the execution status of this line is deduced): Intersection *last = m_intersections + m_size;
-
471 next = last - current;
executed (the execution status of this line is deduced): next = last - current;
-
472 *last = isect;
executed (the execution status of this line is deduced): *last = isect;
-
473 ++m_size;
executed (the execution status of this line is deduced): ++m_size;
-
474 return;
executed: return;
Execution Count:196346
196346
475 } -
476 } -
477 -
478 current->winding += isect.winding;
executed (the execution status of this line is deduced): current->winding += isect.winding;
-
479}
executed: }
Execution Count:71764
71764
480 -
481void QScanConverter::mergeCurve(const QT_FT_Vector &pa, const QT_FT_Vector &pb, -
482 const QT_FT_Vector &pc, const QT_FT_Vector &pd) -
483{ -
484 // make room for 32 splits -
485 QT_FT_Vector beziers[4 + 3 * 32];
never executed (the execution status of this line is deduced): QT_FT_Vector beziers[4 + 3 * 32];
-
486 -
487 QT_FT_Vector *b = beziers;
never executed (the execution status of this line is deduced): QT_FT_Vector *b = beziers;
-
488 -
489 b[0] = pa;
never executed (the execution status of this line is deduced): b[0] = pa;
-
490 b[1] = pb;
never executed (the execution status of this line is deduced): b[1] = pb;
-
491 b[2] = pc;
never executed (the execution status of this line is deduced): b[2] = pc;
-
492 b[3] = pd;
never executed (the execution status of this line is deduced): b[3] = pd;
-
493 -
494 const QT_FT_Pos flatness = 16;
never executed (the execution status of this line is deduced): const QT_FT_Pos flatness = 16;
-
495 -
496 while (b >= beziers) {
never evaluated: b >= beziers
0
497 QT_FT_Vector delta = { b[3].x - b[0].x, b[3].y - b[0].y };
never executed (the execution status of this line is deduced): QT_FT_Vector delta = { b[3].x - b[0].x, b[3].y - b[0].y };
-
498 QT_FT_Pos l = qAbs(delta.x) + qAbs(delta.y);
never executed (the execution status of this line is deduced): QT_FT_Pos l = qAbs(delta.x) + qAbs(delta.y);
-
499 -
500 bool belowThreshold;
never executed (the execution status of this line is deduced): bool belowThreshold;
-
501 if (l > 64) {
never evaluated: l > 64
0
502 qlonglong d2 = qAbs(qlonglong(b[1].x-b[0].x) * qlonglong(delta.y) -
never executed (the execution status of this line is deduced): qlonglong d2 = qAbs(qlonglong(b[1].x-b[0].x) * qlonglong(delta.y) -
-
503 qlonglong(b[1].y-b[0].y) * qlonglong(delta.x));
never executed (the execution status of this line is deduced): qlonglong(b[1].y-b[0].y) * qlonglong(delta.x));
-
504 qlonglong d3 = qAbs(qlonglong(b[2].x-b[0].x) * qlonglong(delta.y) -
never executed (the execution status of this line is deduced): qlonglong d3 = qAbs(qlonglong(b[2].x-b[0].x) * qlonglong(delta.y) -
-
505 qlonglong(b[2].y-b[0].y) * qlonglong(delta.x));
never executed (the execution status of this line is deduced): qlonglong(b[2].y-b[0].y) * qlonglong(delta.x));
-
506 -
507 qlonglong d = d2 + d3;
never executed (the execution status of this line is deduced): qlonglong d = d2 + d3;
-
508 -
509 belowThreshold = (d <= qlonglong(flatness) * qlonglong(l));
never executed (the execution status of this line is deduced): belowThreshold = (d <= qlonglong(flatness) * qlonglong(l));
-
510 } else {
never executed: }
0
511 QT_FT_Pos d = qAbs(b[0].x-b[1].x) + qAbs(b[0].y-b[1].y) +
never executed (the execution status of this line is deduced): QT_FT_Pos d = qAbs(b[0].x-b[1].x) + qAbs(b[0].y-b[1].y) +
-
512 qAbs(b[0].x-b[2].x) + qAbs(b[0].y-b[2].y);
never executed (the execution status of this line is deduced): qAbs(b[0].x-b[2].x) + qAbs(b[0].y-b[2].y);
-
513 -
514 belowThreshold = (d <= flatness);
never executed (the execution status of this line is deduced): belowThreshold = (d <= flatness);
-
515 }
never executed: }
0
516 -
517 if (belowThreshold || b == beziers + 3 * 32) {
never evaluated: belowThreshold
never evaluated: b == beziers + 3 * 32
0
518 mergeLine(b[0], b[3]);
never executed (the execution status of this line is deduced): mergeLine(b[0], b[3]);
-
519 b -= 3;
never executed (the execution status of this line is deduced): b -= 3;
-
520 continue;
never executed: continue;
0
521 } -
522 -
523 split(b);
never executed (the execution status of this line is deduced): split(b);
-
524 b += 3;
never executed (the execution status of this line is deduced): b += 3;
-
525 }
never executed: }
0
526}
never executed: }
0
527 -
528inline bool QScanConverter::clip(Q16Dot16 &xFP, int &iTop, int &iBottom, Q16Dot16 slopeFP, Q16Dot16 edgeFP, int winding) -
529{ -
530 bool right = edgeFP == m_rightFP;
executed (the execution status of this line is deduced): bool right = edgeFP == m_rightFP;
-
531 -
532 if (xFP == edgeFP) {
evaluated: xFP == edgeFP
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:748156
16-748156
533 if ((slopeFP > 0) ^ right)
evaluated: (slopeFP > 0) ^ right
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:1
1-15
534 return false;
executed: return false;
Execution Count:15
15
535 else { -
536 Line line = { edgeFP, 0, iTop, iBottom, winding };
executed (the execution status of this line is deduced): Line line = { edgeFP, 0, iTop, iBottom, winding };
-
537 m_lines.add(line);
executed (the execution status of this line is deduced): m_lines.add(line);
-
538 return true;
executed: return true;
Execution Count:1
1
539 } -
540 } -
541 -
542 Q16Dot16 lastFP = xFP + slopeFP * (iBottom - iTop);
executed (the execution status of this line is deduced): Q16Dot16 lastFP = xFP + slopeFP * (iBottom - iTop);
-
543 -
544 if (lastFP == edgeFP) {
evaluated: lastFP == edgeFP
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:748153
3-748153
545 if ((slopeFP < 0) ^ right)
partially evaluated: (slopeFP < 0) ^ right
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
546 return false;
executed: return false;
Execution Count:3
3
547 else { -
548 Line line = { edgeFP, 0, iTop, iBottom, winding };
never executed (the execution status of this line is deduced): Line line = { edgeFP, 0, iTop, iBottom, winding };
-
549 m_lines.add(line);
never executed (the execution status of this line is deduced): m_lines.add(line);
-
550 return true;
never executed: return true;
0
551 } -
552 } -
553 -
554 // does line cross edge? -
555 if ((lastFP < edgeFP) ^ (xFP < edgeFP)) {
evaluated: (lastFP < edgeFP) ^ (xFP < edgeFP)
TRUEFALSE
yes
Evaluation Count:357970
yes
Evaluation Count:390183
357970-390183
556 Q16Dot16 deltaY = Q16Dot16((edgeFP - xFP) / Q16Dot16ToFloat(slopeFP));
executed (the execution status of this line is deduced): Q16Dot16 deltaY = Q16Dot16((edgeFP - xFP) / ((slopeFP)/65536.));
-
557 -
558 if ((xFP < edgeFP) ^ right) {
evaluated: (xFP < edgeFP) ^ right
TRUEFALSE
yes
Evaluation Count:179400
yes
Evaluation Count:178570
178570-179400
559 // top segment needs to be clipped -
560 int iHeight = Q16Dot16ToInt(deltaY + 1);
executed (the execution status of this line is deduced): int iHeight = ((deltaY + 1) >> 16);
-
561 int iMiddle = iTop + iHeight;
executed (the execution status of this line is deduced): int iMiddle = iTop + iHeight;
-
562 -
563 Line line = { edgeFP, 0, iTop, iMiddle, winding };
executed (the execution status of this line is deduced): Line line = { edgeFP, 0, iTop, iMiddle, winding };
-
564 m_lines.add(line);
executed (the execution status of this line is deduced): m_lines.add(line);
-
565 -
566 if (iMiddle != iBottom) {
partially evaluated: iMiddle != iBottom
TRUEFALSE
yes
Evaluation Count:179400
no
Evaluation Count:0
0-179400
567 xFP += slopeFP * (iHeight + 1);
executed (the execution status of this line is deduced): xFP += slopeFP * (iHeight + 1);
-
568 iTop = iMiddle + 1;
executed (the execution status of this line is deduced): iTop = iMiddle + 1;
-
569 } else
executed: }
Execution Count:179400
179400
570 return true;
never executed: return true;
0
571 } else { -
572 // bottom segment needs to be clipped -
573 int iHeight = Q16Dot16ToInt(deltaY);
executed (the execution status of this line is deduced): int iHeight = ((deltaY) >> 16);
-
574 int iMiddle = iTop + iHeight;
executed (the execution status of this line is deduced): int iMiddle = iTop + iHeight;
-
575 -
576 if (iMiddle != iBottom) {
partially evaluated: iMiddle != iBottom
TRUEFALSE
yes
Evaluation Count:178570
no
Evaluation Count:0
0-178570
577 Line line = { edgeFP, 0, iMiddle + 1, iBottom, winding };
executed (the execution status of this line is deduced): Line line = { edgeFP, 0, iMiddle + 1, iBottom, winding };
-
578 m_lines.add(line);
executed (the execution status of this line is deduced): m_lines.add(line);
-
579 -
580 iBottom = iMiddle;
executed (the execution status of this line is deduced): iBottom = iMiddle;
-
581 }
executed: }
Execution Count:178570
178570
582 }
executed: }
Execution Count:178570
178570
583 return false;
executed: return false;
Execution Count:357970
357970
584 } else if ((xFP < edgeFP) ^ right) {
evaluated: (xFP < edgeFP) ^ right
TRUEFALSE
yes
Evaluation Count:28541
yes
Evaluation Count:361642
28541-361642
585 Line line = { edgeFP, 0, iTop, iBottom, winding };
executed (the execution status of this line is deduced): Line line = { edgeFP, 0, iTop, iBottom, winding };
-
586 m_lines.add(line);
executed (the execution status of this line is deduced): m_lines.add(line);
-
587 return true;
executed: return true;
Execution Count:28541
28541
588 } -
589 -
590 return false;
executed: return false;
Execution Count:361642
361642
591} -
592 -
593void QScanConverter::mergeLine(QT_FT_Vector a, QT_FT_Vector b) -
594{ -
595 int winding = 1;
executed (the execution status of this line is deduced): int winding = 1;
-
596 -
597 if (a.y > b.y) {
evaluated: a.y > b.y
TRUEFALSE
yes
Evaluation Count:285830
yes
Evaluation Count:419999
285830-419999
598 qSwap(a, b);
executed (the execution status of this line is deduced): qSwap(a, b);
-
599 winding = -1;
executed (the execution status of this line is deduced): winding = -1;
-
600 }
executed: }
Execution Count:285830
285830
601 -
602 if (m_legacyRounding) {
evaluated: m_legacyRounding
TRUEFALSE
yes
Evaluation Count:4166
yes
Evaluation Count:701663
4166-701663
603 a.x += COORD_OFFSET;
executed (the execution status of this line is deduced): a.x += 32;
-
604 a.y += COORD_OFFSET;
executed (the execution status of this line is deduced): a.y += 32;
-
605 b.x += COORD_OFFSET;
executed (the execution status of this line is deduced): b.x += 32;
-
606 b.y += COORD_OFFSET;
executed (the execution status of this line is deduced): b.y += 32;
-
607 }
executed: }
Execution Count:4166
4166
608 -
609 int rounding = m_legacyRounding ? COORD_ROUNDING : 0;
evaluated: m_legacyRounding
TRUEFALSE
yes
Evaluation Count:4166
yes
Evaluation Count:701663
4166-701663
610 -
611 int iTop = qMax(m_top, int((a.y + 32 - rounding) >> 6));
executed (the execution status of this line is deduced): int iTop = qMax(m_top, int((a.y + 32 - rounding) >> 6));
-
612 int iBottom = qMin(m_bottom, int((b.y - 32 - rounding) >> 6));
executed (the execution status of this line is deduced): int iBottom = qMin(m_bottom, int((b.y - 32 - rounding) >> 6));
-
613 -
614 if (iTop <= iBottom) {
evaluated: iTop <= iBottom
TRUEFALSE
yes
Evaluation Count:496108
yes
Evaluation Count:209721
209721-496108
615 Q16Dot16 aFP = Q16Dot16Factor/2 + (a.x << 10) - rounding;
executed (the execution status of this line is deduced): Q16Dot16 aFP = 65536/2 + (a.x << 10) - rounding;
-
616 -
617 if (b.x == a.x) {
evaluated: b.x == a.x
TRUEFALSE
yes
Evaluation Count:115369
yes
Evaluation Count:380739
115369-380739
618 Line line = { qBound(m_leftFP, aFP, m_rightFP), 0, iTop, iBottom, winding };
executed (the execution status of this line is deduced): Line line = { qBound(m_leftFP, aFP, m_rightFP), 0, iTop, iBottom, winding };
-
619 m_lines.add(line);
executed (the execution status of this line is deduced): m_lines.add(line);
-
620 } else {
executed: }
Execution Count:115369
115369
621 const qreal slope = (b.x - a.x) / qreal(b.y - a.y);
executed (the execution status of this line is deduced): const qreal slope = (b.x - a.x) / qreal(b.y - a.y);
-
622 -
623 const Q16Dot16 slopeFP = FloatToQ16Dot16(slope);
executed (the execution status of this line is deduced): const Q16Dot16 slopeFP = (int)((slope) * 65536.);
-
624 -
625 Q16Dot16 xFP = aFP + Q16Dot16Multiply(slopeFP,
executed (the execution status of this line is deduced): Q16Dot16 xFP = aFP + (int)((qlonglong(slopeFP) * qlonglong(((iTop) << 16) + 65536/2 - (a.y << 10))) >> 16);
-
626 IntToQ16Dot16(iTop) -
627 + Q16Dot16Factor/2 - (a.y << 10)); -
628 -
629 if (clip(xFP, iTop, iBottom, slopeFP, m_leftFP, winding))
evaluated: clip(xFP, iTop, iBottom, slopeFP, m_leftFP, winding)
TRUEFALSE
yes
Evaluation Count:13306
yes
Evaluation Count:367433
13306-367433
630 return;
executed: return;
Execution Count:13306
13306
631 -
632 if (clip(xFP, iTop, iBottom, slopeFP, m_rightFP, winding))
evaluated: clip(xFP, iTop, iBottom, slopeFP, m_rightFP, winding)
TRUEFALSE
yes
Evaluation Count:15236
yes
Evaluation Count:352197
15236-352197
633 return;
executed: return;
Execution Count:15236
15236
634 -
635 Q_ASSERT(xFP >= m_leftFP);
executed (the execution status of this line is deduced): qt_noop();
-
636 -
637 Line line = { xFP, slopeFP, iTop, iBottom, winding };
executed (the execution status of this line is deduced): Line line = { xFP, slopeFP, iTop, iBottom, winding };
-
638 m_lines.add(line);
executed (the execution status of this line is deduced): m_lines.add(line);
-
639 }
executed: }
Execution Count:352197
352197
640 } -
641}
executed: }
Execution Count:677287
677287
642 -
643QRasterizer::QRasterizer() -
644 : d(new QRasterizerPrivate) -
645{ -
646 d->legacyRounding = false;
executed (the execution status of this line is deduced): d->legacyRounding = false;
-
647}
executed: }
Execution Count:5615
5615
648 -
649QRasterizer::~QRasterizer() -
650{ -
651 delete d;
executed (the execution status of this line is deduced): delete d;
-
652}
executed: }
Execution Count:5604
5604
653 -
654void QRasterizer::setAntialiased(bool antialiased) -
655{ -
656 d->antialiased = antialiased;
executed (the execution status of this line is deduced): d->antialiased = antialiased;
-
657}
executed: }
Execution Count:121686
121686
658 -
659void QRasterizer::initialize(ProcessSpans blend, void *data) -
660{ -
661 d->blend = blend;
executed (the execution status of this line is deduced): d->blend = blend;
-
662 d->data = data;
executed (the execution status of this line is deduced): d->data = data;
-
663}
executed: }
Execution Count:121668
121668
664 -
665void QRasterizer::setClipRect(const QRect &clipRect) -
666{ -
667 d->clipRect = clipRect;
executed (the execution status of this line is deduced): d->clipRect = clipRect;
-
668}
executed: }
Execution Count:150404
150404
669 -
670void QRasterizer::setLegacyRoundingEnabled(bool legacyRoundingEnabled) -
671{ -
672 d->legacyRounding = legacyRoundingEnabled;
executed (the execution status of this line is deduced): d->legacyRounding = legacyRoundingEnabled;
-
673}
executed: }
Execution Count:121686
121686
674 -
675static Q16Dot16 intersectPixelFP(int x, Q16Dot16 top, Q16Dot16 bottom, Q16Dot16 leftIntersectX, Q16Dot16 rightIntersectX, Q16Dot16 slope, Q16Dot16 invSlope) -
676{ -
677 Q16Dot16 leftX = IntToQ16Dot16(x);
executed (the execution status of this line is deduced): Q16Dot16 leftX = ((x) << 16);
-
678 Q16Dot16 rightX = IntToQ16Dot16(x) + Q16Dot16Factor;
executed (the execution status of this line is deduced): Q16Dot16 rightX = ((x) << 16) + 65536;
-
679 -
680 Q16Dot16 leftIntersectY, rightIntersectY;
executed (the execution status of this line is deduced): Q16Dot16 leftIntersectY, rightIntersectY;
-
681 if (slope > 0) {
evaluated: slope > 0
TRUEFALSE
yes
Evaluation Count:71106
yes
Evaluation Count:768
768-71106
682 leftIntersectY = top + Q16Dot16Multiply(leftX - leftIntersectX, invSlope);
executed (the execution status of this line is deduced): leftIntersectY = top + (int)((qlonglong(leftX - leftIntersectX) * qlonglong(invSlope)) >> 16);
-
683 rightIntersectY = leftIntersectY + invSlope;
executed (the execution status of this line is deduced): rightIntersectY = leftIntersectY + invSlope;
-
684 } else {
executed: }
Execution Count:71106
71106
685 leftIntersectY = top + Q16Dot16Multiply(leftX - rightIntersectX, invSlope);
executed (the execution status of this line is deduced): leftIntersectY = top + (int)((qlonglong(leftX - rightIntersectX) * qlonglong(invSlope)) >> 16);
-
686 rightIntersectY = leftIntersectY + invSlope;
executed (the execution status of this line is deduced): rightIntersectY = leftIntersectY + invSlope;
-
687 }
executed: }
Execution Count:768
768
688 -
689 if (leftIntersectX >= leftX && rightIntersectX <= rightX) {
evaluated: leftIntersectX >= leftX
TRUEFALSE
yes
Evaluation Count:68669
yes
Evaluation Count:3205
evaluated: rightIntersectX <= rightX
TRUEFALSE
yes
Evaluation Count:65673
yes
Evaluation Count:2996
2996-68669
690 return Q16Dot16Multiply(bottom - top, leftIntersectX - leftX + ((rightIntersectX - leftIntersectX) >> 1));
executed: return (int)((qlonglong(bottom - top) * qlonglong(leftIntersectX - leftX + ((rightIntersectX - leftIntersectX) >> 1))) >> 16);
Execution Count:65673
65673
691 } else if (leftIntersectX >= rightX) {
evaluated: leftIntersectX >= rightX
TRUEFALSE
yes
Evaluation Count:28
yes
Evaluation Count:6173
28-6173
692 return bottom - top;
executed: return bottom - top;
Execution Count:28
28
693 } else if (leftIntersectX >= leftX) {
evaluated: leftIntersectX >= leftX
TRUEFALSE
yes
Evaluation Count:2968
yes
Evaluation Count:3205
2968-3205
694 if (slope > 0) {
evaluated: slope > 0
TRUEFALSE
yes
Evaluation Count:2697
yes
Evaluation Count:271
271-2697
695 return (bottom - top) - Q16Dot16FastMultiply((rightX - leftIntersectX) >> 1, rightIntersectY - top);
executed: return (bottom - top) - ((((rightX - leftIntersectX) >> 1) * (rightIntersectY - top)) >> 16);
Execution Count:2697
2697
696 } else { -
697 return (bottom - top) - Q16Dot16FastMultiply((rightX - leftIntersectX) >> 1, bottom - rightIntersectY);
executed: return (bottom - top) - ((((rightX - leftIntersectX) >> 1) * (bottom - rightIntersectY)) >> 16);
Execution Count:271
271
698 } -
699 } else if (rightIntersectX <= leftX) {
evaluated: rightIntersectX <= leftX
TRUEFALSE
yes
Evaluation Count:48
yes
Evaluation Count:3157
48-3157
700 return 0;
executed: return 0;
Execution Count:48
48
701 } else if (rightIntersectX <= rightX) {
evaluated: rightIntersectX <= rightX
TRUEFALSE
yes
Evaluation Count:2972
yes
Evaluation Count:185
185-2972
702 if (slope > 0) {
evaluated: slope > 0
TRUEFALSE
yes
Evaluation Count:2705
yes
Evaluation Count:267
267-2705
703 return Q16Dot16FastMultiply((rightIntersectX - leftX) >> 1, bottom - leftIntersectY);
executed: return ((((rightIntersectX - leftX) >> 1) * (bottom - leftIntersectY)) >> 16);
Execution Count:2705
2705
704 } else { -
705 return Q16Dot16FastMultiply((rightIntersectX - leftX) >> 1, leftIntersectY - top);
executed: return ((((rightIntersectX - leftX) >> 1) * (leftIntersectY - top)) >> 16);
Execution Count:267
267
706 } -
707 } else { -
708 if (slope > 0) {
evaluated: slope > 0
TRUEFALSE
yes
Evaluation Count:184
yes
Evaluation Count:1
1-184
709 return (bottom - rightIntersectY) + ((rightIntersectY - leftIntersectY) >> 1);
executed: return (bottom - rightIntersectY) + ((rightIntersectY - leftIntersectY) >> 1);
Execution Count:184
184
710 } else { -
711 return (rightIntersectY - top) + ((leftIntersectY - rightIntersectY) >> 1);
executed: return (rightIntersectY - top) + ((leftIntersectY - rightIntersectY) >> 1);
Execution Count:1
1
712 } -
713 } -
714} -
715 -
716static inline bool q26Dot6Compare(qreal p1, qreal p2) -
717{ -
718 return int((p2 - p1) * 64.) == 0;
executed: return int((p2 - p1) * 64.) == 0;
Execution Count:3386
3386
719} -
720 -
721static inline qreal qFloorF(qreal v) -
722{ -
723#ifdef QT_USE_MATH_H_FLOATS -
724 if (sizeof(qreal) == sizeof(float))
partially evaluated: sizeof(qreal) == sizeof(float)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5672
0-5672
725 return floorf(v);
never executed: return floorf(v);
0
726 else -
727#endif -
728 return floor(v);
executed: return floor(v);
Execution Count:5672
5672
729} -
730 -
731static inline QPointF snapTo26Dot6Grid(const QPointF &p) -
732{ -
733 return QPointF(qFloorF(p.x() * 64) * (1 / qreal(64)),
executed: return QPointF(qFloorF(p.x() * 64) * (1 / qreal(64)), qFloorF(p.y() * 64) * (1 / qreal(64)));
Execution Count:2836
2836
734 qFloorF(p.y() * 64) * (1 / qreal(64)));
executed: return QPointF(qFloorF(p.x() * 64) * (1 / qreal(64)), qFloorF(p.y() * 64) * (1 / qreal(64)));
Execution Count:2836
2836
735} -
736 -
737void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bool squareCap) -
738{ -
739 if (a == b || width == 0 || d->clipRect.isEmpty())
partially evaluated: a == b
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1330
partially evaluated: width == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1330
evaluated: d->clipRect.isEmpty()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:1326
0-1330
740 return;
executed: return;
Execution Count:4
4
741 -
742 Q_ASSERT(width > 0.0);
executed (the execution status of this line is deduced): qt_noop();
-
743 -
744 QPointF pa = a;
executed (the execution status of this line is deduced): QPointF pa = a;
-
745 QPointF pb = b;
executed (the execution status of this line is deduced): QPointF pb = b;
-
746 -
747 if (squareCap) {
evaluated: squareCap
TRUEFALSE
yes
Evaluation Count:938
yes
Evaluation Count:388
388-938
748 QPointF delta = pb - pa;
executed (the execution status of this line is deduced): QPointF delta = pb - pa;
-
749 pa -= (0.5f * width) * delta;
executed (the execution status of this line is deduced): pa -= (0.5f * width) * delta;
-
750 pb += (0.5f * width) * delta;
executed (the execution status of this line is deduced): pb += (0.5f * width) * delta;
-
751 }
executed: }
Execution Count:938
938
752 -
753 QPointF offs = QPointF(qAbs(b.y() - a.y()), qAbs(b.x() - a.x())) * width * 0.5;
executed (the execution status of this line is deduced): QPointF offs = QPointF(qAbs(b.y() - a.y()), qAbs(b.x() - a.x())) * width * 0.5;
-
754 const QRectF clip(d->clipRect.topLeft() - offs, d->clipRect.bottomRight() + QPoint(1, 1) + offs);
executed (the execution status of this line is deduced): const QRectF clip(d->clipRect.topLeft() - offs, d->clipRect.bottomRight() + QPoint(1, 1) + offs);
-
755 -
756 if (!clip.contains(pa) || !clip.contains(pb)) {
evaluated: !clip.contains(pa)
TRUEFALSE
yes
Evaluation Count:588
yes
Evaluation Count:738
evaluated: !clip.contains(pb)
TRUEFALSE
yes
Evaluation Count:330
yes
Evaluation Count:408
330-738
757 qreal t1 = 0;
executed (the execution status of this line is deduced): qreal t1 = 0;
-
758 qreal t2 = 1;
executed (the execution status of this line is deduced): qreal t2 = 1;
-
759 -
760 const qreal o[2] = { pa.x(), pa.y() };
executed (the execution status of this line is deduced): const qreal o[2] = { pa.x(), pa.y() };
-
761 const qreal d[2] = { pb.x() - pa.x(), pb.y() - pa.y() };
executed (the execution status of this line is deduced): const qreal d[2] = { pb.x() - pa.x(), pb.y() - pa.y() };
-
762 -
763 const qreal low[2] = { clip.left(), clip.top() };
executed (the execution status of this line is deduced): const qreal low[2] = { clip.left(), clip.top() };
-
764 const qreal high[2] = { clip.right(), clip.bottom() };
executed (the execution status of this line is deduced): const qreal high[2] = { clip.right(), clip.bottom() };
-
765 -
766 for (int i = 0; i < 2; ++i) {
evaluated: i < 2
TRUEFALSE
yes
Evaluation Count:1809
yes
Evaluation Count:793
793-1809
767 if (d[i] == 0) {
evaluated: d[i] == 0
TRUEFALSE
yes
Evaluation Count:164
yes
Evaluation Count:1645
164-1645
768 if (o[i] <= low[i] || o[i] >= high[i])
evaluated: o[i] <= low[i]
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:160
evaluated: o[i] >= high[i]
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:150
4-160
769 return;
executed: return;
Execution Count:14
14
770 continue;
executed: continue;
Execution Count:150
150
771 } -
772 const qreal d_inv = 1 / d[i];
executed (the execution status of this line is deduced): const qreal d_inv = 1 / d[i];
-
773 qreal t_low = (low[i] - o[i]) * d_inv;
executed (the execution status of this line is deduced): qreal t_low = (low[i] - o[i]) * d_inv;
-
774 qreal t_high = (high[i] - o[i]) * d_inv;
executed (the execution status of this line is deduced): qreal t_high = (high[i] - o[i]) * d_inv;
-
775 if (t_low > t_high)
evaluated: t_low > t_high
TRUEFALSE
yes
Evaluation Count:400
yes
Evaluation Count:1245
400-1245
776 qSwap(t_low, t_high);
executed: qSwap(t_low, t_high);
Execution Count:400
400
777 if (t1 < t_low)
evaluated: t1 < t_low
TRUEFALSE
yes
Evaluation Count:616
yes
Evaluation Count:1029
616-1029
778 t1 = t_low;
executed: t1 = t_low;
Execution Count:616
616
779 if (t2 > t_high)
evaluated: t2 > t_high
TRUEFALSE
yes
Evaluation Count:602
yes
Evaluation Count:1043
602-1043
780 t2 = t_high;
executed: t2 = t_high;
Execution Count:602
602
781 if (t1 >= t2)
evaluated: t1 >= t2
TRUEFALSE
yes
Evaluation Count:111
yes
Evaluation Count:1534
111-1534
782 return;
executed: return;
Execution Count:111
111
783 }
executed: }
Execution Count:1534
1534
784 -
785 QPointF npa = pa + (pb - pa) * t1;
executed (the execution status of this line is deduced): QPointF npa = pa + (pb - pa) * t1;
-
786 QPointF npb = pa + (pb - pa) * t2;
executed (the execution status of this line is deduced): QPointF npb = pa + (pb - pa) * t2;
-
787 -
788 pa = npa;
executed (the execution status of this line is deduced): pa = npa;
-
789 pb = npb;
executed (the execution status of this line is deduced): pb = npb;
-
790 }
executed: }
Execution Count:793
793
791 -
792 if (!d->antialiased && d->legacyRounding) {
evaluated: !d->antialiased
TRUEFALSE
yes
Evaluation Count:883
yes
Evaluation Count:318
partially evaluated: d->legacyRounding
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:883
0-883
793 pa.rx() += (COORD_OFFSET - COORD_ROUNDING)/64.;
never executed (the execution status of this line is deduced): pa.rx() += (32 - 1)/64.;
-
794 pa.ry() += (COORD_OFFSET - COORD_ROUNDING)/64.;
never executed (the execution status of this line is deduced): pa.ry() += (32 - 1)/64.;
-
795 pb.rx() += (COORD_OFFSET - COORD_ROUNDING)/64.;
never executed (the execution status of this line is deduced): pb.rx() += (32 - 1)/64.;
-
796 pb.ry() += (COORD_OFFSET - COORD_ROUNDING)/64.;
never executed (the execution status of this line is deduced): pb.ry() += (32 - 1)/64.;
-
797 }
never executed: }
0
798 -
799 { -
800 // old delta -
801 const QPointF d0 = a - b;
executed (the execution status of this line is deduced): const QPointF d0 = a - b;
-
802 const qreal w0 = d0.x() * d0.x() + d0.y() * d0.y();
executed (the execution status of this line is deduced): const qreal w0 = d0.x() * d0.x() + d0.y() * d0.y();
-
803 -
804 // new delta -
805 const QPointF d = pa - pb;
executed (the execution status of this line is deduced): const QPointF d = pa - pb;
-
806 const qreal w = d.x() * d.x() + d.y() * d.y();
executed (the execution status of this line is deduced): const qreal w = d.x() * d.x() + d.y() * d.y();
-
807 -
808 if (w == 0)
partially evaluated: w == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1201
0-1201
809 return;
never executed: return;
0
810 -
811 // adjust width which is given relative to |b - a| -
812 width *= sqrt(w0 / w);
executed (the execution status of this line is deduced): width *= sqrt(w0 / w);
-
813 } -
814 -
815 QSpanBuffer buffer(d->blend, d->data, d->clipRect);
executed (the execution status of this line is deduced): QSpanBuffer buffer(d->blend, d->data, d->clipRect);
-
816 -
817 if (q26Dot6Compare(pa.y(), pb.y())) {
evaluated: q26Dot6Compare(pa.y(), pb.y())
TRUEFALSE
yes
Evaluation Count:430
yes
Evaluation Count:771
430-771
818 const qreal x = (pa.x() + pb.x()) * 0.5f;
executed (the execution status of this line is deduced): const qreal x = (pa.x() + pb.x()) * 0.5f;
-
819 const qreal dx = qAbs(pb.x() - pa.x()) * 0.5f;
executed (the execution status of this line is deduced): const qreal dx = qAbs(pb.x() - pa.x()) * 0.5f;
-
820 -
821 const qreal y = pa.y();
executed (the execution status of this line is deduced): const qreal y = pa.y();
-
822 const qreal dy = width * dx;
executed (the execution status of this line is deduced): const qreal dy = width * dx;
-
823 -
824 pa = QPointF(x, y - dy);
executed (the execution status of this line is deduced): pa = QPointF(x, y - dy);
-
825 pb = QPointF(x, y + dy);
executed (the execution status of this line is deduced): pb = QPointF(x, y + dy);
-
826 -
827 width = 1 / width;
executed (the execution status of this line is deduced): width = 1 / width;
-
828 }
executed: }
Execution Count:430
430
829 -
830 if (q26Dot6Compare(pa.x(), pb.x())) {
evaluated: q26Dot6Compare(pa.x(), pb.x())
TRUEFALSE
yes
Evaluation Count:492
yes
Evaluation Count:709
492-709
831 if (pa.y() > pb.y())
evaluated: pa.y() > pb.y()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:488
4-488
832 qSwap(pa, pb);
executed: qSwap(pa, pb);
Execution Count:4
4
833 -
834 const qreal dy = pb.y() - pa.y();
executed (the execution status of this line is deduced): const qreal dy = pb.y() - pa.y();
-
835 const qreal halfWidth = 0.5f * width * dy;
executed (the execution status of this line is deduced): const qreal halfWidth = 0.5f * width * dy;
-
836 -
837 qreal left = pa.x() - halfWidth;
executed (the execution status of this line is deduced): qreal left = pa.x() - halfWidth;
-
838 qreal right = pa.x() + halfWidth;
executed (the execution status of this line is deduced): qreal right = pa.x() + halfWidth;
-
839 -
840 left = qBound(qreal(d->clipRect.left()), left, qreal(d->clipRect.right() + 1));
executed (the execution status of this line is deduced): left = qBound(qreal(d->clipRect.left()), left, qreal(d->clipRect.right() + 1));
-
841 right = qBound(qreal(d->clipRect.left()), right, qreal(d->clipRect.right() + 1));
executed (the execution status of this line is deduced): right = qBound(qreal(d->clipRect.left()), right, qreal(d->clipRect.right() + 1));
-
842 -
843 pa.ry() = qBound(qreal(d->clipRect.top()), pa.y(), qreal(d->clipRect.bottom() + 1));
executed (the execution status of this line is deduced): pa.ry() = qBound(qreal(d->clipRect.top()), pa.y(), qreal(d->clipRect.bottom() + 1));
-
844 pb.ry() = qBound(qreal(d->clipRect.top()), pb.y(), qreal(d->clipRect.bottom() + 1));
executed (the execution status of this line is deduced): pb.ry() = qBound(qreal(d->clipRect.top()), pb.y(), qreal(d->clipRect.bottom() + 1));
-
845 -
846 if (q26Dot6Compare(left, right) || q26Dot6Compare(pa.y(), pb.y()))
partially evaluated: q26Dot6Compare(left, right)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:492
partially evaluated: q26Dot6Compare(pa.y(), pb.y())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:492
0-492
847 return;
never executed: return;
0
848 -
849 if (d->antialiased) {
evaluated: d->antialiased
TRUEFALSE
yes
Evaluation Count:291
yes
Evaluation Count:201
201-291
850 const Q16Dot16 iLeft = int(left);
executed (the execution status of this line is deduced): const Q16Dot16 iLeft = int(left);
-
851 const Q16Dot16 iRight = int(right);
executed (the execution status of this line is deduced): const Q16Dot16 iRight = int(right);
-
852 const Q16Dot16 leftWidth = IntToQ16Dot16(iLeft + 1)
executed (the execution status of this line is deduced): const Q16Dot16 leftWidth = ((iLeft + 1) << 16)
-
853 - FloatToQ16Dot16(left);
executed (the execution status of this line is deduced): - (int)((left) * 65536.);
-
854 const Q16Dot16 rightWidth = FloatToQ16Dot16(right)
executed (the execution status of this line is deduced): const Q16Dot16 rightWidth = (int)((right) * 65536.)
-
855 - IntToQ16Dot16(iRight);
executed (the execution status of this line is deduced): - ((iRight) << 16);
-
856 -
857 Q16Dot16 coverage[3];
executed (the execution status of this line is deduced): Q16Dot16 coverage[3];
-
858 int x[3];
executed (the execution status of this line is deduced): int x[3];
-
859 int len[3];
executed (the execution status of this line is deduced): int len[3];
-
860 -
861 int n = 1;
executed (the execution status of this line is deduced): int n = 1;
-
862 if (iLeft == iRight) {
partially evaluated: iLeft == iRight
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:291
0-291
863 coverage[0] = (leftWidth + rightWidth) * 255;
never executed (the execution status of this line is deduced): coverage[0] = (leftWidth + rightWidth) * 255;
-
864 x[0] = iLeft;
never executed (the execution status of this line is deduced): x[0] = iLeft;
-
865 len[0] = 1;
never executed (the execution status of this line is deduced): len[0] = 1;
-
866 } else {
never executed: }
0
867 coverage[0] = leftWidth * 255;
executed (the execution status of this line is deduced): coverage[0] = leftWidth * 255;
-
868 x[0] = iLeft;
executed (the execution status of this line is deduced): x[0] = iLeft;
-
869 len[0] = 1;
executed (the execution status of this line is deduced): len[0] = 1;
-
870 if (leftWidth == Q16Dot16Factor) {
evaluated: leftWidth == 65536
TRUEFALSE
yes
Evaluation Count:265
yes
Evaluation Count:26
26-265
871 len[0] = iRight - iLeft;
executed (the execution status of this line is deduced): len[0] = iRight - iLeft;
-
872 } else if (iRight - iLeft > 1) {
executed: }
Execution Count:265
evaluated: iRight - iLeft > 1
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:18
8-265
873 coverage[1] = IntToQ16Dot16(255);
executed (the execution status of this line is deduced): coverage[1] = ((255) << 16);
-
874 x[1] = iLeft + 1;
executed (the execution status of this line is deduced): x[1] = iLeft + 1;
-
875 len[1] = iRight - iLeft - 1;
executed (the execution status of this line is deduced): len[1] = iRight - iLeft - 1;
-
876 ++n;
executed (the execution status of this line is deduced): ++n;
-
877 }
executed: }
Execution Count:8
8
878 if (rightWidth) {
evaluated: rightWidth
TRUEFALSE
yes
Evaluation Count:26
yes
Evaluation Count:265
26-265
879 coverage[n] = rightWidth * 255;
executed (the execution status of this line is deduced): coverage[n] = rightWidth * 255;
-
880 x[n] = iRight;
executed (the execution status of this line is deduced): x[n] = iRight;
-
881 len[n] = 1;
executed (the execution status of this line is deduced): len[n] = 1;
-
882 ++n;
executed (the execution status of this line is deduced): ++n;
-
883 }
executed: }
Execution Count:26
26
884 }
executed: }
Execution Count:291
291
885 -
886 const Q16Dot16 iTopFP = IntToQ16Dot16(int(pa.y()));
executed (the execution status of this line is deduced): const Q16Dot16 iTopFP = ((int(pa.y())) << 16);
-
887 const Q16Dot16 iBottomFP = IntToQ16Dot16(int(pb.y()));
executed (the execution status of this line is deduced): const Q16Dot16 iBottomFP = ((int(pb.y())) << 16);
-
888 const Q16Dot16 yPa = FloatToQ16Dot16(pa.y());
executed (the execution status of this line is deduced): const Q16Dot16 yPa = (int)((pa.y()) * 65536.);
-
889 const Q16Dot16 yPb = FloatToQ16Dot16(pb.y());
executed (the execution status of this line is deduced): const Q16Dot16 yPb = (int)((pb.y()) * 65536.);
-
890 for (Q16Dot16 yFP = iTopFP; yFP <= iBottomFP; yFP += Q16Dot16Factor) {
evaluated: yFP <= iBottomFP
TRUEFALSE
yes
Evaluation Count:4988
yes
Evaluation Count:291
291-4988
891 const Q16Dot16 rowHeight = qMin(yFP + Q16Dot16Factor, yPb)
executed (the execution status of this line is deduced): const Q16Dot16 rowHeight = qMin(yFP + 65536, yPb)
-
892 - qMax(yFP, yPa);
executed (the execution status of this line is deduced): - qMax(yFP, yPa);
-
893 const int y = Q16Dot16ToInt(yFP);
executed (the execution status of this line is deduced): const int y = ((yFP) >> 16);
-
894 for (int i = 0; i < n; ++i) {
evaluated: i < n
TRUEFALSE
yes
Evaluation Count:5106
yes
Evaluation Count:4988
4988-5106
895 buffer.addSpan(x[i], len[i], y,
executed (the execution status of this line is deduced): buffer.addSpan(x[i], len[i], y,
-
896 Q16Dot16ToInt(Q16Dot16Multiply(rowHeight, coverage[i])));
executed (the execution status of this line is deduced): (((int)((qlonglong(rowHeight) * qlonglong(coverage[i])) >> 16)) >> 16));
-
897 }
executed: }
Execution Count:5106
5106
898 }
executed: }
Execution Count:4988
4988
899 } else { // aliased
executed: }
Execution Count:291
291
900 int iTop = int(pa.y() + 0.5f);
executed (the execution status of this line is deduced): int iTop = int(pa.y() + 0.5f);
-
901 int iBottom = pb.y() < 0.5f ? -1 : int(pb.y() - 0.5f);
partially evaluated: pb.y() < 0.5f
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:201
0-201
902 int iLeft = int(left + 0.5f);
executed (the execution status of this line is deduced): int iLeft = int(left + 0.5f);
-
903 int iRight = right < 0.5f ? -1 : int(right - 0.5f);
partially evaluated: right < 0.5f
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:201
0-201
904 -
905 int iWidth = iRight - iLeft + 1;
executed (the execution status of this line is deduced): int iWidth = iRight - iLeft + 1;
-
906 for (int y = iTop; y <= iBottom; ++y)
evaluated: y <= iBottom
TRUEFALSE
yes
Evaluation Count:7760
yes
Evaluation Count:201
201-7760
907 buffer.addSpan(iLeft, iWidth, y, 255);
executed: buffer.addSpan(iLeft, iWidth, y, 255);
Execution Count:7760
7760
908 }
executed: }
Execution Count:201
201
909 } else { -
910 if (pa.y() > pb.y())
evaluated: pa.y() > pb.y()
TRUEFALSE
yes
Evaluation Count:24
yes
Evaluation Count:685
24-685
911 qSwap(pa, pb);
executed: qSwap(pa, pb);
Execution Count:24
24
912 -
913 QPointF delta = pb - pa;
executed (the execution status of this line is deduced): QPointF delta = pb - pa;
-
914 delta *= 0.5f * width;
executed (the execution status of this line is deduced): delta *= 0.5f * width;
-
915 const QPointF perp(delta.y(), -delta.x());
executed (the execution status of this line is deduced): const QPointF perp(delta.y(), -delta.x());
-
916 -
917 QPointF top;
executed (the execution status of this line is deduced): QPointF top;
-
918 QPointF left;
executed (the execution status of this line is deduced): QPointF left;
-
919 QPointF right;
executed (the execution status of this line is deduced): QPointF right;
-
920 QPointF bottom;
executed (the execution status of this line is deduced): QPointF bottom;
-
921 -
922 if (pa.x() < pb.x()) {
evaluated: pa.x() < pb.x()
TRUEFALSE
yes
Evaluation Count:403
yes
Evaluation Count:306
306-403
923 top = pa + perp;
executed (the execution status of this line is deduced): top = pa + perp;
-
924 left = pa - perp;
executed (the execution status of this line is deduced): left = pa - perp;
-
925 right = pb + perp;
executed (the execution status of this line is deduced): right = pb + perp;
-
926 bottom = pb - perp;
executed (the execution status of this line is deduced): bottom = pb - perp;
-
927 } else {
executed: }
Execution Count:403
403
928 top = pa - perp;
executed (the execution status of this line is deduced): top = pa - perp;
-
929 left = pb - perp;
executed (the execution status of this line is deduced): left = pb - perp;
-
930 right = pa + perp;
executed (the execution status of this line is deduced): right = pa + perp;
-
931 bottom = pb + perp;
executed (the execution status of this line is deduced): bottom = pb + perp;
-
932 }
executed: }
Execution Count:306
306
933 -
934 top = snapTo26Dot6Grid(top);
executed (the execution status of this line is deduced): top = snapTo26Dot6Grid(top);
-
935 bottom = snapTo26Dot6Grid(bottom);
executed (the execution status of this line is deduced): bottom = snapTo26Dot6Grid(bottom);
-
936 left = snapTo26Dot6Grid(left);
executed (the execution status of this line is deduced): left = snapTo26Dot6Grid(left);
-
937 right = snapTo26Dot6Grid(right);
executed (the execution status of this line is deduced): right = snapTo26Dot6Grid(right);
-
938 -
939 const qreal topBound = qBound(qreal(d->clipRect.top()), top.y(), qreal(d->clipRect.bottom()));
executed (the execution status of this line is deduced): const qreal topBound = qBound(qreal(d->clipRect.top()), top.y(), qreal(d->clipRect.bottom()));
-
940 const qreal bottomBound = qBound(qreal(d->clipRect.top()), bottom.y(), qreal(d->clipRect.bottom()));
executed (the execution status of this line is deduced): const qreal bottomBound = qBound(qreal(d->clipRect.top()), bottom.y(), qreal(d->clipRect.bottom()));
-
941 -
942 const QPointF topLeftEdge = left - top;
executed (the execution status of this line is deduced): const QPointF topLeftEdge = left - top;
-
943 const QPointF topRightEdge = right - top;
executed (the execution status of this line is deduced): const QPointF topRightEdge = right - top;
-
944 const QPointF bottomLeftEdge = bottom - left;
executed (the execution status of this line is deduced): const QPointF bottomLeftEdge = bottom - left;
-
945 const QPointF bottomRightEdge = bottom - right;
executed (the execution status of this line is deduced): const QPointF bottomRightEdge = bottom - right;
-
946 -
947 const qreal topLeftSlope = topLeftEdge.x() / topLeftEdge.y();
executed (the execution status of this line is deduced): const qreal topLeftSlope = topLeftEdge.x() / topLeftEdge.y();
-
948 const qreal bottomLeftSlope = bottomLeftEdge.x() / bottomLeftEdge.y();
executed (the execution status of this line is deduced): const qreal bottomLeftSlope = bottomLeftEdge.x() / bottomLeftEdge.y();
-
949 -
950 const qreal topRightSlope = topRightEdge.x() / topRightEdge.y();
executed (the execution status of this line is deduced): const qreal topRightSlope = topRightEdge.x() / topRightEdge.y();
-
951 const qreal bottomRightSlope = bottomRightEdge.x() / bottomRightEdge.y();
executed (the execution status of this line is deduced): const qreal bottomRightSlope = bottomRightEdge.x() / bottomRightEdge.y();
-
952 -
953 const Q16Dot16 topLeftSlopeFP = FloatToQ16Dot16(topLeftSlope);
executed (the execution status of this line is deduced): const Q16Dot16 topLeftSlopeFP = (int)((topLeftSlope) * 65536.);
-
954 const Q16Dot16 topRightSlopeFP = FloatToQ16Dot16(topRightSlope);
executed (the execution status of this line is deduced): const Q16Dot16 topRightSlopeFP = (int)((topRightSlope) * 65536.);
-
955 -
956 const Q16Dot16 bottomLeftSlopeFP = FloatToQ16Dot16(bottomLeftSlope);
executed (the execution status of this line is deduced): const Q16Dot16 bottomLeftSlopeFP = (int)((bottomLeftSlope) * 65536.);
-
957 const Q16Dot16 bottomRightSlopeFP = FloatToQ16Dot16(bottomRightSlope);
executed (the execution status of this line is deduced): const Q16Dot16 bottomRightSlopeFP = (int)((bottomRightSlope) * 65536.);
-
958 -
959 const Q16Dot16 invTopLeftSlopeFP = FloatToQ16Dot16(1 / topLeftSlope);
executed (the execution status of this line is deduced): const Q16Dot16 invTopLeftSlopeFP = (int)((1 / topLeftSlope) * 65536.);
-
960 const Q16Dot16 invTopRightSlopeFP = FloatToQ16Dot16(1 / topRightSlope);
executed (the execution status of this line is deduced): const Q16Dot16 invTopRightSlopeFP = (int)((1 / topRightSlope) * 65536.);
-
961 -
962 const Q16Dot16 invBottomLeftSlopeFP = FloatToQ16Dot16(1 / bottomLeftSlope);
executed (the execution status of this line is deduced): const Q16Dot16 invBottomLeftSlopeFP = (int)((1 / bottomLeftSlope) * 65536.);
-
963 const Q16Dot16 invBottomRightSlopeFP = FloatToQ16Dot16(1 / bottomRightSlope);
executed (the execution status of this line is deduced): const Q16Dot16 invBottomRightSlopeFP = (int)((1 / bottomRightSlope) * 65536.);
-
964 -
965 if (d->antialiased) {
evaluated: d->antialiased
TRUEFALSE
yes
Evaluation Count:27
yes
Evaluation Count:682
27-682
966 const Q16Dot16 iTopFP = IntToQ16Dot16(int(topBound));
executed (the execution status of this line is deduced): const Q16Dot16 iTopFP = ((int(topBound)) << 16);
-
967 const Q16Dot16 iLeftFP = IntToQ16Dot16(int(left.y()));
executed (the execution status of this line is deduced): const Q16Dot16 iLeftFP = ((int(left.y())) << 16);
-
968 const Q16Dot16 iRightFP = IntToQ16Dot16(int(right.y()));
executed (the execution status of this line is deduced): const Q16Dot16 iRightFP = ((int(right.y())) << 16);
-
969 const Q16Dot16 iBottomFP = IntToQ16Dot16(int(bottomBound));
executed (the execution status of this line is deduced): const Q16Dot16 iBottomFP = ((int(bottomBound)) << 16);
-
970 -
971 Q16Dot16 leftIntersectAf = FloatToQ16Dot16(top.x() + (int(topBound) - top.y()) * topLeftSlope);
executed (the execution status of this line is deduced): Q16Dot16 leftIntersectAf = (int)((top.x() + (int(topBound) - top.y()) * topLeftSlope) * 65536.);
-
972 Q16Dot16 rightIntersectAf = FloatToQ16Dot16(top.x() + (int(topBound) - top.y()) * topRightSlope);
executed (the execution status of this line is deduced): Q16Dot16 rightIntersectAf = (int)((top.x() + (int(topBound) - top.y()) * topRightSlope) * 65536.);
-
973 Q16Dot16 leftIntersectBf = 0;
executed (the execution status of this line is deduced): Q16Dot16 leftIntersectBf = 0;
-
974 Q16Dot16 rightIntersectBf = 0;
executed (the execution status of this line is deduced): Q16Dot16 rightIntersectBf = 0;
-
975 -
976 if (iLeftFP < iTopFP)
partially evaluated: iLeftFP < iTopFP
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:27
0-27
977 leftIntersectBf = FloatToQ16Dot16(left.x() + (int(topBound) - left.y()) * bottomLeftSlope);
never executed: leftIntersectBf = (int)((left.x() + (int(topBound) - left.y()) * bottomLeftSlope) * 65536.);
0
978 -
979 if (iRightFP < iTopFP)
partially evaluated: iRightFP < iTopFP
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:27
0-27
980 rightIntersectBf = FloatToQ16Dot16(right.x() + (int(topBound) - right.y()) * bottomRightSlope);
never executed: rightIntersectBf = (int)((right.x() + (int(topBound) - right.y()) * bottomRightSlope) * 65536.);
0
981 -
982 Q16Dot16 rowTop, rowBottomLeft, rowBottomRight, rowTopLeft, rowTopRight, rowBottom;
executed (the execution status of this line is deduced): Q16Dot16 rowTop, rowBottomLeft, rowBottomRight, rowTopLeft, rowTopRight, rowBottom;
-
983 Q16Dot16 topLeftIntersectAf, topLeftIntersectBf, topRightIntersectAf, topRightIntersectBf;
executed (the execution status of this line is deduced): Q16Dot16 topLeftIntersectAf, topLeftIntersectBf, topRightIntersectAf, topRightIntersectBf;
-
984 Q16Dot16 bottomLeftIntersectAf, bottomLeftIntersectBf, bottomRightIntersectAf, bottomRightIntersectBf;
executed (the execution status of this line is deduced): Q16Dot16 bottomLeftIntersectAf, bottomLeftIntersectBf, bottomRightIntersectAf, bottomRightIntersectBf;
-
985 -
986 int leftMin, leftMax, rightMin, rightMax;
executed (the execution status of this line is deduced): int leftMin, leftMax, rightMin, rightMax;
-
987 -
988 const Q16Dot16 yTopFP = FloatToQ16Dot16(top.y());
executed (the execution status of this line is deduced): const Q16Dot16 yTopFP = (int)((top.y()) * 65536.);
-
989 const Q16Dot16 yLeftFP = FloatToQ16Dot16(left.y());
executed (the execution status of this line is deduced): const Q16Dot16 yLeftFP = (int)((left.y()) * 65536.);
-
990 const Q16Dot16 yRightFP = FloatToQ16Dot16(right.y());
executed (the execution status of this line is deduced): const Q16Dot16 yRightFP = (int)((right.y()) * 65536.);
-
991 const Q16Dot16 yBottomFP = FloatToQ16Dot16(bottom.y());
executed (the execution status of this line is deduced): const Q16Dot16 yBottomFP = (int)((bottom.y()) * 65536.);
-
992 -
993 rowTop = qMax(iTopFP, yTopFP);
executed (the execution status of this line is deduced): rowTop = qMax(iTopFP, yTopFP);
-
994 topLeftIntersectAf = leftIntersectAf +
executed (the execution status of this line is deduced): topLeftIntersectAf = leftIntersectAf +
-
995 Q16Dot16Multiply(topLeftSlopeFP, rowTop - iTopFP);
executed (the execution status of this line is deduced): (int)((qlonglong(topLeftSlopeFP) * qlonglong(rowTop - iTopFP)) >> 16);
-
996 topRightIntersectAf = rightIntersectAf +
executed (the execution status of this line is deduced): topRightIntersectAf = rightIntersectAf +
-
997 Q16Dot16Multiply(topRightSlopeFP, rowTop - iTopFP);
executed (the execution status of this line is deduced): (int)((qlonglong(topRightSlopeFP) * qlonglong(rowTop - iTopFP)) >> 16);
-
998 -
999 Q16Dot16 yFP = iTopFP;
executed (the execution status of this line is deduced): Q16Dot16 yFP = iTopFP;
-
1000 while (yFP <= iBottomFP) {
evaluated: yFP <= iBottomFP
TRUEFALSE
yes
Evaluation Count:34342
yes
Evaluation Count:27
27-34342
1001 rowBottomLeft = qMin(yFP + Q16Dot16Factor, yLeftFP);
executed (the execution status of this line is deduced): rowBottomLeft = qMin(yFP + 65536, yLeftFP);
-
1002 rowBottomRight = qMin(yFP + Q16Dot16Factor, yRightFP);
executed (the execution status of this line is deduced): rowBottomRight = qMin(yFP + 65536, yRightFP);
-
1003 rowTopLeft = qMax(yFP, yLeftFP);
executed (the execution status of this line is deduced): rowTopLeft = qMax(yFP, yLeftFP);
-
1004 rowTopRight = qMax(yFP, yRightFP);
executed (the execution status of this line is deduced): rowTopRight = qMax(yFP, yRightFP);
-
1005 rowBottom = qMin(yFP + Q16Dot16Factor, yBottomFP);
executed (the execution status of this line is deduced): rowBottom = qMin(yFP + 65536, yBottomFP);
-
1006 -
1007 if (yFP == iLeftFP) {
evaluated: yFP == iLeftFP
TRUEFALSE
yes
Evaluation Count:27
yes
Evaluation Count:34315
27-34315
1008 const int y = Q16Dot16ToInt(yFP);
executed (the execution status of this line is deduced): const int y = ((yFP) >> 16);
-
1009 leftIntersectBf = FloatToQ16Dot16(left.x() + (y - left.y()) * bottomLeftSlope);
executed (the execution status of this line is deduced): leftIntersectBf = (int)((left.x() + (y - left.y()) * bottomLeftSlope) * 65536.);
-
1010 topLeftIntersectBf = leftIntersectBf + Q16Dot16Multiply(bottomLeftSlopeFP, rowTopLeft - yFP);
executed (the execution status of this line is deduced): topLeftIntersectBf = leftIntersectBf + (int)((qlonglong(bottomLeftSlopeFP) * qlonglong(rowTopLeft - yFP)) >> 16);
-
1011 bottomLeftIntersectAf = leftIntersectAf + Q16Dot16Multiply(topLeftSlopeFP, rowBottomLeft - yFP);
executed (the execution status of this line is deduced): bottomLeftIntersectAf = leftIntersectAf + (int)((qlonglong(topLeftSlopeFP) * qlonglong(rowBottomLeft - yFP)) >> 16);
-
1012 } else {
executed: }
Execution Count:27
27
1013 topLeftIntersectBf = leftIntersectBf;
executed (the execution status of this line is deduced): topLeftIntersectBf = leftIntersectBf;
-
1014 bottomLeftIntersectAf = leftIntersectAf + topLeftSlopeFP;
executed (the execution status of this line is deduced): bottomLeftIntersectAf = leftIntersectAf + topLeftSlopeFP;
-
1015 }
executed: }
Execution Count:34315
34315
1016 -
1017 if (yFP == iRightFP) {
evaluated: yFP == iRightFP
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:34323
19-34323
1018 const int y = Q16Dot16ToInt(yFP);
executed (the execution status of this line is deduced): const int y = ((yFP) >> 16);
-
1019 rightIntersectBf = FloatToQ16Dot16(right.x() + (y - right.y()) * bottomRightSlope);
executed (the execution status of this line is deduced): rightIntersectBf = (int)((right.x() + (y - right.y()) * bottomRightSlope) * 65536.);
-
1020 topRightIntersectBf = rightIntersectBf + Q16Dot16Multiply(bottomRightSlopeFP, rowTopRight - yFP);
executed (the execution status of this line is deduced): topRightIntersectBf = rightIntersectBf + (int)((qlonglong(bottomRightSlopeFP) * qlonglong(rowTopRight - yFP)) >> 16);
-
1021 bottomRightIntersectAf = rightIntersectAf + Q16Dot16Multiply(topRightSlopeFP, rowBottomRight - yFP);
executed (the execution status of this line is deduced): bottomRightIntersectAf = rightIntersectAf + (int)((qlonglong(topRightSlopeFP) * qlonglong(rowBottomRight - yFP)) >> 16);
-
1022 } else {
executed: }
Execution Count:19
19
1023 topRightIntersectBf = rightIntersectBf;
executed (the execution status of this line is deduced): topRightIntersectBf = rightIntersectBf;
-
1024 bottomRightIntersectAf = rightIntersectAf + topRightSlopeFP;
executed (the execution status of this line is deduced): bottomRightIntersectAf = rightIntersectAf + topRightSlopeFP;
-
1025 }
executed: }
Execution Count:34323
34323
1026 -
1027 if (yFP == iBottomFP) {
evaluated: yFP == iBottomFP
TRUEFALSE
yes
Evaluation Count:27
yes
Evaluation Count:34315
27-34315
1028 bottomLeftIntersectBf = leftIntersectBf + Q16Dot16Multiply(bottomLeftSlopeFP, rowBottom - yFP);
executed (the execution status of this line is deduced): bottomLeftIntersectBf = leftIntersectBf + (int)((qlonglong(bottomLeftSlopeFP) * qlonglong(rowBottom - yFP)) >> 16);
-
1029 bottomRightIntersectBf = rightIntersectBf + Q16Dot16Multiply(bottomRightSlopeFP, rowBottom - yFP);
executed (the execution status of this line is deduced): bottomRightIntersectBf = rightIntersectBf + (int)((qlonglong(bottomRightSlopeFP) * qlonglong(rowBottom - yFP)) >> 16);
-
1030 } else {
executed: }
Execution Count:27
27
1031 bottomLeftIntersectBf = leftIntersectBf + bottomLeftSlopeFP;
executed (the execution status of this line is deduced): bottomLeftIntersectBf = leftIntersectBf + bottomLeftSlopeFP;
-
1032 bottomRightIntersectBf = rightIntersectBf + bottomRightSlopeFP;
executed (the execution status of this line is deduced): bottomRightIntersectBf = rightIntersectBf + bottomRightSlopeFP;
-
1033 }
executed: }
Execution Count:34315
34315
1034 -
1035 if (yFP < iLeftFP) {
evaluated: yFP < iLeftFP
TRUEFALSE
yes
Evaluation Count:225
yes
Evaluation Count:34117
225-34117
1036 leftMin = Q16Dot16ToInt(bottomLeftIntersectAf);
executed (the execution status of this line is deduced): leftMin = ((bottomLeftIntersectAf) >> 16);
-
1037 leftMax = Q16Dot16ToInt(topLeftIntersectAf);
executed (the execution status of this line is deduced): leftMax = ((topLeftIntersectAf) >> 16);
-
1038 } else if (yFP == iLeftFP) {
executed: }
Execution Count:225
evaluated: yFP == iLeftFP
TRUEFALSE
yes
Evaluation Count:27
yes
Evaluation Count:34090
27-34090
1039 leftMin = Q16Dot16ToInt(qMax(bottomLeftIntersectAf, topLeftIntersectBf));
executed (the execution status of this line is deduced): leftMin = ((qMax(bottomLeftIntersectAf, topLeftIntersectBf)) >> 16);
-
1040 leftMax = Q16Dot16ToInt(qMax(topLeftIntersectAf, bottomLeftIntersectBf));
executed (the execution status of this line is deduced): leftMax = ((qMax(topLeftIntersectAf, bottomLeftIntersectBf)) >> 16);
-
1041 } else {
executed: }
Execution Count:27
27
1042 leftMin = Q16Dot16ToInt(topLeftIntersectBf);
executed (the execution status of this line is deduced): leftMin = ((topLeftIntersectBf) >> 16);
-
1043 leftMax = Q16Dot16ToInt(bottomLeftIntersectBf);
executed (the execution status of this line is deduced): leftMax = ((bottomLeftIntersectBf) >> 16);
-
1044 }
executed: }
Execution Count:34090
34090
1045 -
1046 leftMin = qBound(d->clipRect.left(), leftMin, d->clipRect.right());
executed (the execution status of this line is deduced): leftMin = qBound(d->clipRect.left(), leftMin, d->clipRect.right());
-
1047 leftMax = qBound(d->clipRect.left(), leftMax, d->clipRect.right());
executed (the execution status of this line is deduced): leftMax = qBound(d->clipRect.left(), leftMax, d->clipRect.right());
-
1048 -
1049 if (yFP < iRightFP) {
evaluated: yFP < iRightFP
TRUEFALSE
yes
Evaluation Count:34093
yes
Evaluation Count:249
249-34093
1050 rightMin = Q16Dot16ToInt(topRightIntersectAf);
executed (the execution status of this line is deduced): rightMin = ((topRightIntersectAf) >> 16);
-
1051 rightMax = Q16Dot16ToInt(bottomRightIntersectAf);
executed (the execution status of this line is deduced): rightMax = ((bottomRightIntersectAf) >> 16);
-
1052 } else if (yFP == iRightFP) {
executed: }
Execution Count:34093
evaluated: yFP == iRightFP
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:230
19-34093
1053 rightMin = Q16Dot16ToInt(qMin(topRightIntersectAf, bottomRightIntersectBf));
executed (the execution status of this line is deduced): rightMin = ((qMin(topRightIntersectAf, bottomRightIntersectBf)) >> 16);
-
1054 rightMax = Q16Dot16ToInt(qMin(bottomRightIntersectAf, topRightIntersectBf));
executed (the execution status of this line is deduced): rightMax = ((qMin(bottomRightIntersectAf, topRightIntersectBf)) >> 16);
-
1055 } else {
executed: }
Execution Count:19
19
1056 rightMin = Q16Dot16ToInt(bottomRightIntersectBf);
executed (the execution status of this line is deduced): rightMin = ((bottomRightIntersectBf) >> 16);
-
1057 rightMax = Q16Dot16ToInt(topRightIntersectBf);
executed (the execution status of this line is deduced): rightMax = ((topRightIntersectBf) >> 16);
-
1058 }
executed: }
Execution Count:230
230
1059 -
1060 rightMin = qBound(d->clipRect.left(), rightMin, d->clipRect.right());
executed (the execution status of this line is deduced): rightMin = qBound(d->clipRect.left(), rightMin, d->clipRect.right());
-
1061 rightMax = qBound(d->clipRect.left(), rightMax, d->clipRect.right());
executed (the execution status of this line is deduced): rightMax = qBound(d->clipRect.left(), rightMax, d->clipRect.right());
-
1062 -
1063 if (leftMax > rightMax)
partially evaluated: leftMax > rightMax
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:34342
0-34342
1064 leftMax = rightMax;
never executed: leftMax = rightMax;
0
1065 if (rightMin < leftMin)
partially evaluated: rightMin < leftMin
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:34342
0-34342
1066 rightMin = leftMin;
never executed: rightMin = leftMin;
0
1067 -
1068 Q16Dot16 rowHeight = rowBottom - rowTop;
executed (the execution status of this line is deduced): Q16Dot16 rowHeight = rowBottom - rowTop;
-
1069 -
1070 int x = leftMin;
executed (the execution status of this line is deduced): int x = leftMin;
-
1071 while (x <= leftMax) {
evaluated: x <= leftMax
TRUEFALSE
yes
Evaluation Count:35898
yes
Evaluation Count:34342
34342-35898
1072 Q16Dot16 excluded = 0;
executed (the execution status of this line is deduced): Q16Dot16 excluded = 0;
-
1073 -
1074 if (yFP <= iLeftFP)
evaluated: yFP <= iLeftFP
TRUEFALSE
yes
Evaluation Count:379
yes
Evaluation Count:35519
379-35519
1075 excluded += intersectPixelFP(x, rowTop, rowBottomLeft,
executed: excluded += intersectPixelFP(x, rowTop, rowBottomLeft, bottomLeftIntersectAf, topLeftIntersectAf, topLeftSlopeFP, invTopLeftSlopeFP);
Execution Count:379
379
1076 bottomLeftIntersectAf, topLeftIntersectAf,
executed: excluded += intersectPixelFP(x, rowTop, rowBottomLeft, bottomLeftIntersectAf, topLeftIntersectAf, topLeftSlopeFP, invTopLeftSlopeFP);
Execution Count:379
379
1077 topLeftSlopeFP, invTopLeftSlopeFP);
executed: excluded += intersectPixelFP(x, rowTop, rowBottomLeft, bottomLeftIntersectAf, topLeftIntersectAf, topLeftSlopeFP, invTopLeftSlopeFP);
Execution Count:379
379
1078 if (yFP >= iLeftFP)
evaluated: yFP >= iLeftFP
TRUEFALSE
yes
Evaluation Count:35546
yes
Evaluation Count:352
352-35546
1079 excluded += intersectPixelFP(x, rowTopLeft, rowBottom,
executed: excluded += intersectPixelFP(x, rowTopLeft, rowBottom, topLeftIntersectBf, bottomLeftIntersectBf, bottomLeftSlopeFP, invBottomLeftSlopeFP);
Execution Count:35546
35546
1080 topLeftIntersectBf, bottomLeftIntersectBf,
executed: excluded += intersectPixelFP(x, rowTopLeft, rowBottom, topLeftIntersectBf, bottomLeftIntersectBf, bottomLeftSlopeFP, invBottomLeftSlopeFP);
Execution Count:35546
35546
1081 bottomLeftSlopeFP, invBottomLeftSlopeFP);
executed: excluded += intersectPixelFP(x, rowTopLeft, rowBottom, topLeftIntersectBf, bottomLeftIntersectBf, bottomLeftSlopeFP, invBottomLeftSlopeFP);
Execution Count:35546
35546
1082 -
1083 if (x >= rightMin) {
evaluated: x >= rightMin
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:35893
5-35893
1084 if (yFP <= iRightFP)
evaluated: yFP <= iRightFP
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:2
2-3
1085 excluded += (rowBottomRight - rowTop) - intersectPixelFP(x, rowTop, rowBottomRight,
executed: excluded += (rowBottomRight - rowTop) - intersectPixelFP(x, rowTop, rowBottomRight, topRightIntersectAf, bottomRightIntersectAf, topRightSlopeFP, invTopRightSlopeFP);
Execution Count:3
3
1086 topRightIntersectAf, bottomRightIntersectAf,
executed: excluded += (rowBottomRight - rowTop) - intersectPixelFP(x, rowTop, rowBottomRight, topRightIntersectAf, bottomRightIntersectAf, topRightSlopeFP, invTopRightSlopeFP);
Execution Count:3
3
1087 topRightSlopeFP, invTopRightSlopeFP);
executed: excluded += (rowBottomRight - rowTop) - intersectPixelFP(x, rowTop, rowBottomRight, topRightIntersectAf, bottomRightIntersectAf, topRightSlopeFP, invTopRightSlopeFP);
Execution Count:3
3
1088 if (yFP >= iRightFP)
evaluated: yFP >= iRightFP
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:2
2-3
1089 excluded += (rowBottom - rowTopRight) - intersectPixelFP(x, rowTopRight, rowBottom,
executed: excluded += (rowBottom - rowTopRight) - intersectPixelFP(x, rowTopRight, rowBottom, bottomRightIntersectBf, topRightIntersectBf, bottomRightSlopeFP, invBottomRightSlopeFP);
Execution Count:3
3
1090 bottomRightIntersectBf, topRightIntersectBf,
executed: excluded += (rowBottom - rowTopRight) - intersectPixelFP(x, rowTopRight, rowBottom, bottomRightIntersectBf, topRightIntersectBf, bottomRightSlopeFP, invBottomRightSlopeFP);
Execution Count:3
3
1091 bottomRightSlopeFP, invBottomRightSlopeFP);
executed: excluded += (rowBottom - rowTopRight) - intersectPixelFP(x, rowTopRight, rowBottom, bottomRightIntersectBf, topRightIntersectBf, bottomRightSlopeFP, invBottomRightSlopeFP);
Execution Count:3
3
1092 }
executed: }
Execution Count:5
5
1093 -
1094 Q16Dot16 coverage = rowHeight - excluded;
executed (the execution status of this line is deduced): Q16Dot16 coverage = rowHeight - excluded;
-
1095 buffer.addSpan(x, 1, Q16Dot16ToInt(yFP),
executed (the execution status of this line is deduced): buffer.addSpan(x, 1, ((yFP) >> 16),
-
1096 Q16Dot16ToInt(255 * coverage));
executed (the execution status of this line is deduced): ((255 * coverage) >> 16));
-
1097 ++x;
executed (the execution status of this line is deduced): ++x;
-
1098 }
executed: }
Execution Count:35898
35898
1099 if (x < rightMin) {
evaluated: x < rightMin
TRUEFALSE
yes
Evaluation Count:34239
yes
Evaluation Count:103
103-34239
1100 buffer.addSpan(x, rightMin - x, Q16Dot16ToInt(yFP),
executed (the execution status of this line is deduced): buffer.addSpan(x, rightMin - x, ((yFP) >> 16),
-
1101 Q16Dot16ToInt(255 * rowHeight));
executed (the execution status of this line is deduced): ((255 * rowHeight) >> 16));
-
1102 x = rightMin;
executed (the execution status of this line is deduced): x = rightMin;
-
1103 }
executed: }
Execution Count:34239
34239
1104 while (x <= rightMax) {
evaluated: x <= rightMax
TRUEFALSE
yes
Evaluation Count:35913
yes
Evaluation Count:34342
34342-35913
1105 Q16Dot16 excluded = 0;
executed (the execution status of this line is deduced): Q16Dot16 excluded = 0;
-
1106 if (yFP <= iRightFP)
evaluated: yFP <= iRightFP
TRUEFALSE
yes
Evaluation Count:35557
yes
Evaluation Count:356
356-35557
1107 excluded += (rowBottomRight - rowTop) - intersectPixelFP(x, rowTop, rowBottomRight,
executed: excluded += (rowBottomRight - rowTop) - intersectPixelFP(x, rowTop, rowBottomRight, topRightIntersectAf, bottomRightIntersectAf, topRightSlopeFP, invTopRightSlopeFP);
Execution Count:35557
35557
1108 topRightIntersectAf, bottomRightIntersectAf,
executed: excluded += (rowBottomRight - rowTop) - intersectPixelFP(x, rowTop, rowBottomRight, topRightIntersectAf, bottomRightIntersectAf, topRightSlopeFP, invTopRightSlopeFP);
Execution Count:35557
35557
1109 topRightSlopeFP, invTopRightSlopeFP);
executed: excluded += (rowBottomRight - rowTop) - intersectPixelFP(x, rowTop, rowBottomRight, topRightIntersectAf, bottomRightIntersectAf, topRightSlopeFP, invTopRightSlopeFP);
Execution Count:35557
35557
1110 if (yFP >= iRightFP)
evaluated: yFP >= iRightFP
TRUEFALSE
yes
Evaluation Count:386
yes
Evaluation Count:35527
386-35527
1111 excluded += (rowBottom - rowTopRight) - intersectPixelFP(x, rowTopRight, rowBottom,
executed: excluded += (rowBottom - rowTopRight) - intersectPixelFP(x, rowTopRight, rowBottom, bottomRightIntersectBf, topRightIntersectBf, bottomRightSlopeFP, invBottomRightSlopeFP);
Execution Count:386
386
1112 bottomRightIntersectBf, topRightIntersectBf,
executed: excluded += (rowBottom - rowTopRight) - intersectPixelFP(x, rowTopRight, rowBottom, bottomRightIntersectBf, topRightIntersectBf, bottomRightSlopeFP, invBottomRightSlopeFP);
Execution Count:386
386
1113 bottomRightSlopeFP, invBottomRightSlopeFP);
executed: excluded += (rowBottom - rowTopRight) - intersectPixelFP(x, rowTopRight, rowBottom, bottomRightIntersectBf, topRightIntersectBf, bottomRightSlopeFP, invBottomRightSlopeFP);
Execution Count:386
386
1114 -
1115 Q16Dot16 coverage = rowHeight - excluded;
executed (the execution status of this line is deduced): Q16Dot16 coverage = rowHeight - excluded;
-
1116 buffer.addSpan(x, 1, Q16Dot16ToInt(yFP),
executed (the execution status of this line is deduced): buffer.addSpan(x, 1, ((yFP) >> 16),
-
1117 Q16Dot16ToInt(255 * coverage));
executed (the execution status of this line is deduced): ((255 * coverage) >> 16));
-
1118 ++x;
executed (the execution status of this line is deduced): ++x;
-
1119 }
executed: }
Execution Count:35913
35913
1120 -
1121 leftIntersectAf += topLeftSlopeFP;
executed (the execution status of this line is deduced): leftIntersectAf += topLeftSlopeFP;
-
1122 leftIntersectBf += bottomLeftSlopeFP;
executed (the execution status of this line is deduced): leftIntersectBf += bottomLeftSlopeFP;
-
1123 rightIntersectAf += topRightSlopeFP;
executed (the execution status of this line is deduced): rightIntersectAf += topRightSlopeFP;
-
1124 rightIntersectBf += bottomRightSlopeFP;
executed (the execution status of this line is deduced): rightIntersectBf += bottomRightSlopeFP;
-
1125 topLeftIntersectAf = leftIntersectAf;
executed (the execution status of this line is deduced): topLeftIntersectAf = leftIntersectAf;
-
1126 topRightIntersectAf = rightIntersectAf;
executed (the execution status of this line is deduced): topRightIntersectAf = rightIntersectAf;
-
1127 -
1128 yFP += Q16Dot16Factor;
executed (the execution status of this line is deduced): yFP += 65536;
-
1129 rowTop = yFP;
executed (the execution status of this line is deduced): rowTop = yFP;
-
1130 }
executed: }
Execution Count:34342
34342
1131 } else { // aliased
executed: }
Execution Count:27
27
1132 int iTop = int(top.y() + 0.5f);
executed (the execution status of this line is deduced): int iTop = int(top.y() + 0.5f);
-
1133 int iLeft = left.y() < 0.5f ? -1 : int(left.y() - 0.5f);
evaluated: left.y() < 0.5f
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:680
2-680
1134 int iRight = right.y() < 0.5f ? -1 : int(right.y() - 0.5f);
evaluated: right.y() < 0.5f
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:680
2-680
1135 int iBottom = bottom.y() < 0.5f? -1 : int(bottom.y() - 0.5f);
partially evaluated: bottom.y() < 0.5f
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:682
0-682
1136 int iMiddle = qMin(iLeft, iRight);
executed (the execution status of this line is deduced): int iMiddle = qMin(iLeft, iRight);
-
1137 -
1138 Q16Dot16 leftIntersectAf = FloatToQ16Dot16(top.x() + 0.5f + (iTop + 0.5f - top.y()) * topLeftSlope);
executed (the execution status of this line is deduced): Q16Dot16 leftIntersectAf = (int)((top.x() + 0.5f + (iTop + 0.5f - top.y()) * topLeftSlope) * 65536.);
-
1139 Q16Dot16 leftIntersectBf = FloatToQ16Dot16(left.x() + 0.5f + (iLeft + 1.5f - left.y()) * bottomLeftSlope);
executed (the execution status of this line is deduced): Q16Dot16 leftIntersectBf = (int)((left.x() + 0.5f + (iLeft + 1.5f - left.y()) * bottomLeftSlope) * 65536.);
-
1140 Q16Dot16 rightIntersectAf = FloatToQ16Dot16(top.x() - 0.5f + (iTop + 0.5f - top.y()) * topRightSlope);
executed (the execution status of this line is deduced): Q16Dot16 rightIntersectAf = (int)((top.x() - 0.5f + (iTop + 0.5f - top.y()) * topRightSlope) * 65536.);
-
1141 Q16Dot16 rightIntersectBf = FloatToQ16Dot16(right.x() - 0.5f + (iRight + 1.5f - right.y()) * bottomRightSlope);
executed (the execution status of this line is deduced): Q16Dot16 rightIntersectBf = (int)((right.x() - 0.5f + (iRight + 1.5f - right.y()) * bottomRightSlope) * 65536.);
-
1142 -
1143 int ny;
executed (the execution status of this line is deduced): int ny;
-
1144 int y = iTop;
executed (the execution status of this line is deduced): int y = iTop;
-
1145#define DO_SEGMENT(next, li, ri, ls, rs) \ -
1146 ny = qMin(next + 1, d->clipRect.top()); \ -
1147 if (y < ny) { \ -
1148 li += ls * (ny - y); \ -
1149 ri += rs * (ny - y); \ -
1150 y = ny; \ -
1151 } \ -
1152 if (next > d->clipRect.bottom()) \ -
1153 next = d->clipRect.bottom(); \ -
1154 for (; y <= next; ++y) { \ -
1155 const int x1 = qMax(Q16Dot16ToInt(li), d->clipRect.left()); \ -
1156 const int x2 = qMin(Q16Dot16ToInt(ri), d->clipRect.right()); \ -
1157 if (x2 >= x1) \ -
1158 buffer.addSpan(x1, x2 - x1 + 1, y, 255); \ -
1159 li += ls; \ -
1160 ri += rs; \ -
1161 } -
1162 -
1163 DO_SEGMENT(iMiddle, leftIntersectAf, rightIntersectAf, topLeftSlopeFP, topRightSlopeFP)
executed: }
Execution Count:205
never executed: iMiddle = d->clipRect.bottom();
executed: buffer.addSpan(x1, x2 - x1 + 1, y, 255);
Execution Count:1370
executed: }
Execution Count:1480
evaluated: y < ny
TRUEFALSE
yes
Evaluation Count:205
yes
Evaluation Count:477
partially evaluated: iMiddle > d->clipRect.bottom()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:682
evaluated: x2 >= x1
TRUEFALSE
yes
Evaluation Count:1370
yes
Evaluation Count:110
evaluated: y <= iMiddle
TRUEFALSE
yes
Evaluation Count:1480
yes
Evaluation Count:682
0-1480
1164 DO_SEGMENT(iRight, leftIntersectBf, rightIntersectAf, bottomLeftSlopeFP, topRightSlopeFP)
executed: }
Execution Count:1
never executed: iRight = d->clipRect.bottom();
executed: buffer.addSpan(x1, x2 - x1 + 1, y, 255);
Execution Count:47613
executed: }
Execution Count:47613
evaluated: y < ny
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:681
partially evaluated: iRight > d->clipRect.bottom()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:682
partially evaluated: x2 >= x1
TRUEFALSE
yes
Evaluation Count:47613
no
Evaluation Count:0
evaluated: y <= iRight
TRUEFALSE
yes
Evaluation Count:47613
yes
Evaluation Count:682
0-47613
1165 DO_SEGMENT(iLeft, leftIntersectAf, rightIntersectBf, topLeftSlopeFP, bottomRightSlopeFP);
executed: }
Execution Count:3
executed: iLeft = d->clipRect.bottom();
Execution Count:12
executed: buffer.addSpan(x1, x2 - x1 + 1, y, 255);
Execution Count:36802
executed: }
Execution Count:36857
evaluated: y < ny
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:679
evaluated: iLeft > d->clipRect.bottom()
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:670
evaluated: x2 >= x1
TRUEFALSE
yes
Evaluation Count:36802
yes
Evaluation Count:55
evaluated: y <= iLeft
TRUEFALSE
yes
Evaluation Count:36857
yes
Evaluation Count:682
3-36857
1166 DO_SEGMENT(iBottom, leftIntersectBf, rightIntersectBf, bottomLeftSlopeFP, bottomRightSlopeFP);
never executed: }
executed: iBottom = d->clipRect.bottom();
Execution Count:164
executed: buffer.addSpan(x1, x2 - x1 + 1, y, 255);
Execution Count:882
executed: }
Execution Count:994
partially evaluated: y < ny
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:682
evaluated: iBottom > d->clipRect.bottom()
TRUEFALSE
yes
Evaluation Count:164
yes
Evaluation Count:518
evaluated: x2 >= x1
TRUEFALSE
yes
Evaluation Count:882
yes
Evaluation Count:112
evaluated: y <= iBottom
TRUEFALSE
yes
Evaluation Count:994
yes
Evaluation Count:682
0-994
1167#undef DO_SEGMENT -
1168 }
executed: }
Execution Count:682
682
1169 } -
1170} -
1171 -
1172void QRasterizer::rasterize(const QT_FT_Outline *outline, Qt::FillRule fillRule) -
1173{ -
1174 if (outline->n_points < 3 || outline->n_contours == 0)
evaluated: outline->n_points < 3
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:120386
partially evaluated: outline->n_contours == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:120386
0-120386
1175 return;
executed: return;
Execution Count:9
9
1176 -
1177 const QT_FT_Vector *points = outline->points;
executed (the execution status of this line is deduced): const QT_FT_Vector *points = outline->points;
-
1178 -
1179 QSpanBuffer buffer(d->blend, d->data, d->clipRect);
executed (the execution status of this line is deduced): QSpanBuffer buffer(d->blend, d->data, d->clipRect);
-
1180 -
1181 // ### QT_FT_Outline already has a bounding rect which is -
1182 // ### precomputed at this point, so we should probably just be -
1183 // ### using that instead... -
1184 QT_FT_Pos min_y = points[0].y, max_y = points[0].y;
executed (the execution status of this line is deduced): QT_FT_Pos min_y = points[0].y, max_y = points[0].y;
-
1185 for (int i = 1; i < outline->n_points; ++i) {
evaluated: i < outline->n_points
TRUEFALSE
yes
Evaluation Count:769376
yes
Evaluation Count:120386
120386-769376
1186 const QT_FT_Vector &p = points[i];
executed (the execution status of this line is deduced): const QT_FT_Vector &p = points[i];
-
1187 min_y = qMin(p.y, min_y);
executed (the execution status of this line is deduced): min_y = qMin(p.y, min_y);
-
1188 max_y = qMax(p.y, max_y);
executed (the execution status of this line is deduced): max_y = qMax(p.y, max_y);
-
1189 }
executed: }
Execution Count:769376
769376
1190 -
1191 int rounding = d->legacyRounding ? COORD_OFFSET - COORD_ROUNDING : 0;
evaluated: d->legacyRounding
TRUEFALSE
yes
Evaluation Count:890
yes
Evaluation Count:119496
890-119496
1192 -
1193 int iTopBound = qMax(d->clipRect.top(), int((min_y + 32 + rounding) >> 6));
executed (the execution status of this line is deduced): int iTopBound = qMax(d->clipRect.top(), int((min_y + 32 + rounding) >> 6));
-
1194 int iBottomBound = qMin(d->clipRect.bottom(), int((max_y - 32 + rounding) >> 6));
executed (the execution status of this line is deduced): int iBottomBound = qMin(d->clipRect.bottom(), int((max_y - 32 + rounding) >> 6));
-
1195 -
1196 if (iTopBound > iBottomBound)
evaluated: iTopBound > iBottomBound
TRUEFALSE
yes
Evaluation Count:115
yes
Evaluation Count:120271
115-120271
1197 return;
executed: return;
Execution Count:115
115
1198 -
1199 d->scanConverter.begin(iTopBound, iBottomBound, d->clipRect.left(), d->clipRect.right(), fillRule, d->legacyRounding, &buffer);
executed (the execution status of this line is deduced): d->scanConverter.begin(iTopBound, iBottomBound, d->clipRect.left(), d->clipRect.right(), fillRule, d->legacyRounding, &buffer);
-
1200 -
1201 int first = 0;
executed (the execution status of this line is deduced): int first = 0;
-
1202 for (int i = 0; i < outline->n_contours; ++i) {
evaluated: i < outline->n_contours
TRUEFALSE
yes
Evaluation Count:171311
yes
Evaluation Count:120271
120271-171311
1203 const int last = outline->contours[i];
executed (the execution status of this line is deduced): const int last = outline->contours[i];
-
1204 for (int j = first; j < last; ++j) {
evaluated: j < last
TRUEFALSE
yes
Evaluation Count:705825
yes
Evaluation Count:171311
171311-705825
1205 if (outline->tags[j+1] == QT_FT_CURVE_TAG_CUBIC) {
partially evaluated: outline->tags[j+1] == 2
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:705825
0-705825
1206 Q_ASSERT(outline->tags[j+2] == QT_FT_CURVE_TAG_CUBIC);
never executed (the execution status of this line is deduced): qt_noop();
-
1207 d->scanConverter.mergeCurve(points[j], points[j+1], points[j+2], points[j+3]);
never executed (the execution status of this line is deduced): d->scanConverter.mergeCurve(points[j], points[j+1], points[j+2], points[j+3]);
-
1208 j += 2;
never executed (the execution status of this line is deduced): j += 2;
-
1209 } else {
never executed: }
0
1210 d->scanConverter.mergeLine(points[j], points[j+1]);
executed (the execution status of this line is deduced): d->scanConverter.mergeLine(points[j], points[j+1]);
-
1211 }
executed: }
Execution Count:705825
705825
1212 } -
1213 -
1214 first = last + 1;
executed (the execution status of this line is deduced): first = last + 1;
-
1215 }
executed: }
Execution Count:171311
171311
1216 -
1217 d->scanConverter.end();
executed (the execution status of this line is deduced): d->scanConverter.end();
-
1218}
executed: }
Execution Count:120271
120271
1219 -
1220void QRasterizer::rasterize(const QPainterPath &path, Qt::FillRule fillRule) -
1221{ -
1222 if (path.isEmpty())
partially evaluated: path.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1223 return;
never executed: return;
0
1224 -
1225 QSpanBuffer buffer(d->blend, d->data, d->clipRect);
executed (the execution status of this line is deduced): QSpanBuffer buffer(d->blend, d->data, d->clipRect);
-
1226 -
1227 QRectF bounds = path.controlPointRect();
executed (the execution status of this line is deduced): QRectF bounds = path.controlPointRect();
-
1228 -
1229 double rounding = d->legacyRounding ? (COORD_OFFSET - COORD_ROUNDING) / 64. : 0.0;
partially evaluated: d->legacyRounding
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1230 -
1231 int iTopBound = qMax(d->clipRect.top(), int(bounds.top() + 0.5 + rounding));
executed (the execution status of this line is deduced): int iTopBound = qMax(d->clipRect.top(), int(bounds.top() + 0.5 + rounding));
-
1232 int iBottomBound = qMin(d->clipRect.bottom(), int(bounds.bottom() - 0.5 + rounding));
executed (the execution status of this line is deduced): int iBottomBound = qMin(d->clipRect.bottom(), int(bounds.bottom() - 0.5 + rounding));
-
1233 -
1234 if (iTopBound > iBottomBound)
partially evaluated: iTopBound > iBottomBound
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1235 return;
never executed: return;
0
1236 -
1237 d->scanConverter.begin(iTopBound, iBottomBound, d->clipRect.left(), d->clipRect.right(), fillRule, d->legacyRounding, &buffer);
executed (the execution status of this line is deduced): d->scanConverter.begin(iTopBound, iBottomBound, d->clipRect.left(), d->clipRect.right(), fillRule, d->legacyRounding, &buffer);
-
1238 -
1239 int subpathStart = 0;
executed (the execution status of this line is deduced): int subpathStart = 0;
-
1240 QT_FT_Vector last = { 0, 0 };
executed (the execution status of this line is deduced): QT_FT_Vector last = { 0, 0 };
-
1241 for (int i = 0; i < path.elementCount(); ++i) {
evaluated: i < path.elementCount()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:1
1-5
1242 switch (path.elementAt(i).type) { -
1243 case QPainterPath::LineToElement: -
1244 { -
1245 QT_FT_Vector p1 = last;
executed (the execution status of this line is deduced): QT_FT_Vector p1 = last;
-
1246 QT_FT_Vector p2 = PointToVector(path.elementAt(i));
executed (the execution status of this line is deduced): QT_FT_Vector p2 = PointToVector(path.elementAt(i));
-
1247 d->scanConverter.mergeLine(p1, p2);
executed (the execution status of this line is deduced): d->scanConverter.mergeLine(p1, p2);
-
1248 last = p2;
executed (the execution status of this line is deduced): last = p2;
-
1249 break;
executed: break;
Execution Count:4
4
1250 } -
1251 case QPainterPath::MoveToElement: -
1252 { -
1253 if (i != 0) {
partially evaluated: i != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1254 QT_FT_Vector first = PointToVector(path.elementAt(subpathStart));
never executed (the execution status of this line is deduced): QT_FT_Vector first = PointToVector(path.elementAt(subpathStart));
-
1255 // close previous subpath -
1256 if (first.x != last.x || first.y != last.y)
never evaluated: first.x != last.x
never evaluated: first.y != last.y
0
1257 d->scanConverter.mergeLine(last, first);
never executed: d->scanConverter.mergeLine(last, first);
0
1258 }
never executed: }
0
1259 subpathStart = i;
executed (the execution status of this line is deduced): subpathStart = i;
-
1260 last = PointToVector(path.elementAt(i));
executed (the execution status of this line is deduced): last = PointToVector(path.elementAt(i));
-
1261 break;
executed: break;
Execution Count:1
1
1262 } -
1263 case QPainterPath::CurveToElement: -
1264 { -
1265 QT_FT_Vector p1 = last;
never executed (the execution status of this line is deduced): QT_FT_Vector p1 = last;
-
1266 QT_FT_Vector p2 = PointToVector(path.elementAt(i));
never executed (the execution status of this line is deduced): QT_FT_Vector p2 = PointToVector(path.elementAt(i));
-
1267 QT_FT_Vector p3 = PointToVector(path.elementAt(++i));
never executed (the execution status of this line is deduced): QT_FT_Vector p3 = PointToVector(path.elementAt(++i));
-
1268 QT_FT_Vector p4 = PointToVector(path.elementAt(++i));
never executed (the execution status of this line is deduced): QT_FT_Vector p4 = PointToVector(path.elementAt(++i));
-
1269 d->scanConverter.mergeCurve(p1, p2, p3, p4);
never executed (the execution status of this line is deduced): d->scanConverter.mergeCurve(p1, p2, p3, p4);
-
1270 last = p4;
never executed (the execution status of this line is deduced): last = p4;
-
1271 break;
never executed: break;
0
1272 } -
1273 default: -
1274 Q_ASSERT(false);
never executed (the execution status of this line is deduced): qt_noop();
-
1275 break;
never executed: break;
0
1276 } -
1277 }
executed: }
Execution Count:5
5
1278 -
1279 QT_FT_Vector first = PointToVector(path.elementAt(subpathStart));
executed (the execution status of this line is deduced): QT_FT_Vector first = PointToVector(path.elementAt(subpathStart));
-
1280 -
1281 // close path -
1282 if (first.x != last.x || first.y != last.y)
partially evaluated: first.x != last.x
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: first.y != last.y
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1283 d->scanConverter.mergeLine(last, first);
never executed: d->scanConverter.mergeLine(last, first);
0
1284 -
1285 d->scanConverter.end();
executed (the execution status of this line is deduced): d->scanConverter.end();
-
1286}
executed: }
Execution Count:1
1
1287 -
1288QT_END_NAMESPACE -
1289 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial