painting/qpaintengine_raster.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 <QtCore/qglobal.h> -
43#include <QtCore/qmutex.h> -
44 -
45#define QT_FT_BEGIN_HEADER -
46#define QT_FT_END_HEADER -
47 -
48#include <private/qrasterdefs_p.h> -
49#include <private/qgrayraster_p.h> -
50 -
51#include <qpainterpath.h> -
52#include <qdebug.h> -
53#include <qhash.h> -
54#include <qbitmap.h> -
55#include <qmath.h> -
56 -
57// #include <private/qdatabuffer_p.h> -
58// #include <private/qpainter_p.h> -
59#include <private/qmath_p.h> -
60#include <private/qtextengine_p.h> -
61#include <private/qfontengine_p.h> -
62#include <private/qpixmap_raster_p.h> -
63// #include <private/qpolygonclipper_p.h> -
64// #include <private/qrasterizer_p.h> -
65#include <private/qimage_p.h> -
66#include <private/qstatictext_p.h> -
67#include <private/qcosmeticstroker_p.h> -
68#include "qmemrotate_p.h" -
69 -
70#include "qpaintengine_raster_p.h" -
71// #include "qbezier_p.h" -
72#include "qoutlinemapper_p.h" -
73 -
74#include <limits.h> -
75 -
76#ifdef Q_OS_WIN -
77# include <qvarlengtharray.h> -
78# include <private/qfontengine_p.h> -
79# include <qt_windows.h> -
80#ifdef Q_OS_WIN64 -
81# include <malloc.h> -
82# endif -
83#endif -
84 -
85QT_BEGIN_NAMESPACE -
86 -
87class QRectVectorPath : public QVectorPath { -
88public: -
89 inline void set(const QRect &r) { -
90 qreal left = r.x();
executed (the execution status of this line is deduced): qreal left = r.x();
-
91 qreal right = r.x() + r.width();
executed (the execution status of this line is deduced): qreal right = r.x() + r.width();
-
92 qreal top = r.y();
executed (the execution status of this line is deduced): qreal top = r.y();
-
93 qreal bottom = r.y() + r.height();
executed (the execution status of this line is deduced): qreal bottom = r.y() + r.height();
-
94 pts[0] = left;
executed (the execution status of this line is deduced): pts[0] = left;
-
95 pts[1] = top;
executed (the execution status of this line is deduced): pts[1] = top;
-
96 pts[2] = right;
executed (the execution status of this line is deduced): pts[2] = right;
-
97 pts[3] = top;
executed (the execution status of this line is deduced): pts[3] = top;
-
98 pts[4] = right;
executed (the execution status of this line is deduced): pts[4] = right;
-
99 pts[5] = bottom;
executed (the execution status of this line is deduced): pts[5] = bottom;
-
100 pts[6] = left;
executed (the execution status of this line is deduced): pts[6] = left;
-
101 pts[7] = bottom;
executed (the execution status of this line is deduced): pts[7] = bottom;
-
102 }
executed: }
Execution Count:2397
2397
103 -
104 inline void set(const QRectF &r) { -
105 qreal left = r.x();
executed (the execution status of this line is deduced): qreal left = r.x();
-
106 qreal right = r.x() + r.width();
executed (the execution status of this line is deduced): qreal right = r.x() + r.width();
-
107 qreal top = r.y();
executed (the execution status of this line is deduced): qreal top = r.y();
-
108 qreal bottom = r.y() + r.height();
executed (the execution status of this line is deduced): qreal bottom = r.y() + r.height();
-
109 pts[0] = left;
executed (the execution status of this line is deduced): pts[0] = left;
-
110 pts[1] = top;
executed (the execution status of this line is deduced): pts[1] = top;
-
111 pts[2] = right;
executed (the execution status of this line is deduced): pts[2] = right;
-
112 pts[3] = top;
executed (the execution status of this line is deduced): pts[3] = top;
-
113 pts[4] = right;
executed (the execution status of this line is deduced): pts[4] = right;
-
114 pts[5] = bottom;
executed (the execution status of this line is deduced): pts[5] = bottom;
-
115 pts[6] = left;
executed (the execution status of this line is deduced): pts[6] = left;
-
116 pts[7] = bottom;
executed (the execution status of this line is deduced): pts[7] = bottom;
-
117 }
executed: }
Execution Count:361
361
118 inline QRectVectorPath(const QRect &r) -
119 : QVectorPath(pts, 4, 0, QVectorPath::RectangleHint | QVectorPath::ImplicitClose) -
120 { -
121 set(r);
never executed (the execution status of this line is deduced): set(r);
-
122 }
never executed: }
0
123 inline QRectVectorPath(const QRectF &r) -
124 : QVectorPath(pts, 4, 0, QVectorPath::RectangleHint | QVectorPath::ImplicitClose) -
125 { -
126 set(r);
never executed (the execution status of this line is deduced): set(r);
-
127 }
never executed: }
0
128 inline QRectVectorPath() -
129 : QVectorPath(pts, 4, 0, QVectorPath::RectangleHint | QVectorPath::ImplicitClose) -
130 { }
executed: }
Execution Count:2758
2758
131 -
132 qreal pts[8]; -
133}; -
134 -
135Q_GUI_EXPORT extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp -
136 -
137#define qreal_to_fixed_26_6(f) (int(f * 64)) -
138#define qt_swap_int(x, y) { int tmp = (x); (x) = (y); (y) = tmp; } -
139#define qt_swap_qreal(x, y) { qreal tmp = (x); (x) = (y); (y) = tmp; } -
140 -
141// #define QT_DEBUG_DRAW -
142#ifdef QT_DEBUG_DRAW -
143void dumpClip(int width, int height, const QClipData *clip); -
144#endif -
145 -
146#define QT_FAST_SPANS -
147 -
148 -
149// A little helper macro to get a better approximation of dimensions. -
150// If we have a rect that starting at 0.5 of width 3.5 it should span -
151// 4 pixels. -
152#define int_dim(pos, dim) (int(pos+dim) - int(pos)) -
153 -
154static const qreal aliasedCoordinateDelta = 0.5 - 0.015625; -
155 -
156#ifdef Q_OS_WIN -
157 -
158static inline bool winClearTypeFontsEnabled() -
159{ -
160 UINT result = 0; -
161#if !defined(SPI_GETFONTSMOOTHINGTYPE) // MinGW -
162# define SPI_GETFONTSMOOTHINGTYPE 0x200A -
163# define FE_FONTSMOOTHINGCLEARTYPE 0x002 -
164#endif -
165 SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &result, 0); -
166 return result == FE_FONTSMOOTHINGCLEARTYPE; -
167} -
168 -
169/*! -
170 \internal -
171 */ -
172bool QRasterPaintEngine::clearTypeFontsEnabled() -
173{ -
174 static const bool result = winClearTypeFontsEnabled(); -
175 return result; -
176} -
177 -
178#endif // Q_OS_WIN -
179 -
180 -
181 -
182/******************************************************************************** -
183 * Span functions -
184 */ -
185static void qt_span_fill_clipRect(int count, const QSpan *spans, void *userData); -
186static void qt_span_fill_clipped(int count, const QSpan *spans, void *userData); -
187static void qt_span_clip(int count, const QSpan *spans, void *userData); -
188 -
189struct ClipData -
190{ -
191 QClipData *oldClip; -
192 QClipData *newClip; -
193 Qt::ClipOperation operation; -
194}; -
195 -
196enum LineDrawMode { -
197 LineDrawClipped, -
198 LineDrawNormal, -
199 LineDrawIncludeLastPixel -
200}; -
201 -
202static void drawEllipse_midpoint_i(const QRect &rect, const QRect &clip, -
203 ProcessSpans pen_func, ProcessSpans brush_func, -
204 QSpanData *pen_data, QSpanData *brush_data); -
205 -
206struct QRasterFloatPoint { -
207 qreal x; -
208 qreal y; -
209}; -
210 -
211#ifdef QT_DEBUG_DRAW -
212static const QRectF boundingRect(const QPointF *points, int pointCount) -
213{ -
214 const QPointF *e = points; -
215 const QPointF *last = points + pointCount; -
216 qreal minx, maxx, miny, maxy; -
217 minx = maxx = e->x(); -
218 miny = maxy = e->y(); -
219 while (++e < last) { -
220 if (e->x() < minx) -
221 minx = e->x(); -
222 else if (e->x() > maxx) -
223 maxx = e->x(); -
224 if (e->y() < miny) -
225 miny = e->y(); -
226 else if (e->y() > maxy) -
227 maxy = e->y(); -
228 } -
229 return QRectF(QPointF(minx, miny), QPointF(maxx, maxy)); -
230} -
231#endif -
232 -
233template <typename T> static inline bool isRect(const T *pts, int elementCount) { -
234 return (elementCount == 5 // 5-point polygon, check for closed rect
executed: return (elementCount == 5 && pts[0] == pts[8] && pts[1] == pts[9] && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] ) || (elementCount == 4 && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] );
Execution Count:1671
1671
235 && pts[0] == pts[8] && pts[1] == pts[9] // last point == first point
executed: return (elementCount == 5 && pts[0] == pts[8] && pts[1] == pts[9] && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] ) || (elementCount == 4 && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] );
Execution Count:1671
1671
236 && pts[0] == pts[6] && pts[2] == pts[4] // x values equal
executed: return (elementCount == 5 && pts[0] == pts[8] && pts[1] == pts[9] && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] ) || (elementCount == 4 && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] );
Execution Count:1671
1671
237 && pts[1] == pts[3] && pts[5] == pts[7] // y values equal...
executed: return (elementCount == 5 && pts[0] == pts[8] && pts[1] == pts[9] && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] ) || (elementCount == 4 && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] );
Execution Count:1671
1671
238 && pts[0] < pts[4] && pts[1] < pts[5]
executed: return (elementCount == 5 && pts[0] == pts[8] && pts[1] == pts[9] && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] ) || (elementCount == 4 && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] );
Execution Count:1671
1671
239 ) ||
executed: return (elementCount == 5 && pts[0] == pts[8] && pts[1] == pts[9] && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] ) || (elementCount == 4 && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] );
Execution Count:1671
1671
240 (elementCount == 4 // 4-point polygon, check for unclosed rect
executed: return (elementCount == 5 && pts[0] == pts[8] && pts[1] == pts[9] && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] ) || (elementCount == 4 && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] );
Execution Count:1671
1671
241 && pts[0] == pts[6] && pts[2] == pts[4] // x values equal
executed: return (elementCount == 5 && pts[0] == pts[8] && pts[1] == pts[9] && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] ) || (elementCount == 4 && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] );
Execution Count:1671
1671
242 && pts[1] == pts[3] && pts[5] == pts[7] // y values equal...
executed: return (elementCount == 5 && pts[0] == pts[8] && pts[1] == pts[9] && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] ) || (elementCount == 4 && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] );
Execution Count:1671
1671
243 && pts[0] < pts[4] && pts[1] < pts[5]
executed: return (elementCount == 5 && pts[0] == pts[8] && pts[1] == pts[9] && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] ) || (elementCount == 4 && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] );
Execution Count:1671
1671
244 );
executed: return (elementCount == 5 && pts[0] == pts[8] && pts[1] == pts[9] && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] ) || (elementCount == 4 && pts[0] == pts[6] && pts[2] == pts[4] && pts[1] == pts[3] && pts[5] == pts[7] && pts[0] < pts[4] && pts[1] < pts[5] );
Execution Count:1671
1671
245} -
246 -
247 -
248static void qt_ft_outline_move_to(qfixed x, qfixed y, void *data) -
249{ -
250 ((QOutlineMapper *) data)->moveTo(QPointF(qt_fixed_to_real(x), qt_fixed_to_real(y)));
never executed (the execution status of this line is deduced): ((QOutlineMapper *) data)->moveTo(QPointF(x, y));
-
251}
never executed: }
0
252 -
253static void qt_ft_outline_line_to(qfixed x, qfixed y, void *data) -
254{ -
255 ((QOutlineMapper *) data)->lineTo(QPointF(qt_fixed_to_real(x), qt_fixed_to_real(y)));
never executed (the execution status of this line is deduced): ((QOutlineMapper *) data)->lineTo(QPointF(x, y));
-
256}
never executed: }
0
257 -
258static void qt_ft_outline_cubic_to(qfixed c1x, qfixed c1y, -
259 qfixed c2x, qfixed c2y, -
260 qfixed ex, qfixed ey, -
261 void *data) -
262{ -
263 ((QOutlineMapper *) data)->curveTo(QPointF(qt_fixed_to_real(c1x), qt_fixed_to_real(c1y)),
never executed (the execution status of this line is deduced): ((QOutlineMapper *) data)->curveTo(QPointF(c1x, c1y),
-
264 QPointF(qt_fixed_to_real(c2x), qt_fixed_to_real(c2y)),
never executed (the execution status of this line is deduced): QPointF(c2x, c2y),
-
265 QPointF(qt_fixed_to_real(ex), qt_fixed_to_real(ey)));
never executed (the execution status of this line is deduced): QPointF(ex, ey));
-
266}
never executed: }
0
267 -
268 -
269#if !defined(QT_NO_DEBUG) && 0 -
270static void qt_debug_path(const QPainterPath &path) -
271{ -
272 const char *names[] = { -
273 "MoveTo ", -
274 "LineTo ", -
275 "CurveTo ", -
276 "CurveToData" -
277 }; -
278 -
279 fprintf(stderr,"\nQPainterPath: elementCount=%d\n", path.elementCount()); -
280 for (int i=0; i<path.elementCount(); ++i) { -
281 const QPainterPath::Element &e = path.elementAt(i); -
282 Q_ASSERT(e.type >= 0 && e.type <= QPainterPath::CurveToDataElement); -
283 fprintf(stderr," - %3d:: %s, (%.2f, %.2f)\n", i, names[e.type], e.x, e.y); -
284 } -
285} -
286#endif -
287 -
288QRasterPaintEnginePrivate::QRasterPaintEnginePrivate() : -
289 QPaintEngineExPrivate(), -
290 cachedLines(0) -
291{ -
292}
executed: }
Execution Count:5615
5615
293 -
294 -
295/*! -
296 \class QRasterPaintEngine -
297 \preliminary -
298 \ingroup qws -
299 \inmodule QtGui -
300 \since 4.2 -
301 -
302 \brief The QRasterPaintEngine class enables hardware acceleration -
303 of painting operations in Qt for Embedded Linux. -
304 -
305 Note that this functionality is only available in -
306 \l{Qt for Embedded Linux}. -
307 -
308 In \l{Qt for Embedded Linux}, painting is a pure software -
309 implementation. But starting with Qt 4.2, it is -
310 possible to add an accelerated graphics driver to take advantage -
311 of available hardware resources. -
312 -
313 Hardware acceleration is accomplished by creating a custom screen -
314 driver, accelerating the copying from memory to the screen, and -
315 implementing a custom paint engine accelerating the various -
316 painting operations. Then a custom paint device (derived from the -
317 QCustomRasterPaintDevice class) and a custom window surface -
318 (derived from QWSWindowSurface) must be implemented to make -
319 \l{Qt for Embedded Linux} aware of the accelerated driver. -
320 -
321 \note The QRasterPaintEngine class does not support 8-bit images. -
322 Instead, they need to be converted to a supported format, such as -
323 QImage::Format_ARGB32_Premultiplied. -
324 -
325 See the \l {Adding an Accelerated Graphics Driver to Qt for Embedded Linux} -
326 documentation for details. -
327 -
328 \sa QCustomRasterPaintDevice, QPaintEngine -
329*/ -
330 -
331/*! -
332 \fn Type QRasterPaintEngine::type() const -
333 \reimp -
334*/ -
335 -
336/*! -
337 \typedef QSpan -
338 \relates QRasterPaintEngine -
339 -
340 A struct equivalent to QT_FT_Span, containing a position (x, -
341 y), the span's length in pixels and its color/coverage (a value -
342 ranging from 0 to 255). -
343*/ -
344 -
345/*! -
346 \since 4.5 -
347 -
348 Creates a raster based paint engine for operating on the given -
349 \a device, with the complete set of \l -
350 {QPaintEngine::PaintEngineFeature}{paint engine features and -
351 capabilities}. -
352*/ -
353QRasterPaintEngine::QRasterPaintEngine(QPaintDevice *device) -
354 : QPaintEngineEx(*(new QRasterPaintEnginePrivate)) -
355{ -
356 d_func()->device = device;
executed (the execution status of this line is deduced): d_func()->device = device;
-
357 init();
executed (the execution status of this line is deduced): init();
-
358}
executed: }
Execution Count:5614
5614
359 -
360/*! -
361 \internal -
362*/ -
363QRasterPaintEngine::QRasterPaintEngine(QRasterPaintEnginePrivate &dd, QPaintDevice *device) -
364 : QPaintEngineEx(dd) -
365{ -
366 d_func()->device = device;
never executed (the execution status of this line is deduced): d_func()->device = device;
-
367 init();
never executed (the execution status of this line is deduced): init();
-
368}
never executed: }
0
369 -
370void QRasterPaintEngine::init() -
371{ -
372 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
373 -
374 -
375#ifdef Q_OS_WIN -
376 d->hdc = 0; -
377#endif -
378 -
379 // The antialiasing raster. -
380 d->grayRaster.reset(new QT_FT_Raster);
executed (the execution status of this line is deduced): d->grayRaster.reset(new QT_FT_Raster);
-
381 Q_CHECK_PTR(d->grayRaster.data());
executed (the execution status of this line is deduced): qt_noop();
-
382 if (qt_ft_grays_raster.raster_new(d->grayRaster.data()))
partially evaluated: qt_ft_grays_raster.raster_new(d->grayRaster.data())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5615
0-5615
383 QT_THROW(std::bad_alloc()); // an error creating the raster is caused by a bad malloc
never executed: qt_noop();
0
384 -
385 -
386 d->rasterizer.reset(new QRasterizer);
executed (the execution status of this line is deduced): d->rasterizer.reset(new QRasterizer);
-
387 d->rasterBuffer.reset(new QRasterBuffer());
executed (the execution status of this line is deduced): d->rasterBuffer.reset(new QRasterBuffer());
-
388 d->outlineMapper.reset(new QOutlineMapper);
executed (the execution status of this line is deduced): d->outlineMapper.reset(new QOutlineMapper);
-
389 d->outlinemapper_xform_dirty = true;
executed (the execution status of this line is deduced): d->outlinemapper_xform_dirty = true;
-
390 -
391 d->basicStroker.setMoveToHook(qt_ft_outline_move_to);
executed (the execution status of this line is deduced): d->basicStroker.setMoveToHook(qt_ft_outline_move_to);
-
392 d->basicStroker.setLineToHook(qt_ft_outline_line_to);
executed (the execution status of this line is deduced): d->basicStroker.setLineToHook(qt_ft_outline_line_to);
-
393 d->basicStroker.setCubicToHook(qt_ft_outline_cubic_to);
executed (the execution status of this line is deduced): d->basicStroker.setCubicToHook(qt_ft_outline_cubic_to);
-
394 -
395 d->baseClip.reset(new QClipData(d->device->height()));
executed (the execution status of this line is deduced): d->baseClip.reset(new QClipData(d->device->height()));
-
396 d->baseClip->setClipRect(QRect(0, 0, d->device->width(), d->device->height()));
executed (the execution status of this line is deduced): d->baseClip->setClipRect(QRect(0, 0, d->device->width(), d->device->height()));
-
397 -
398 d->image_filler.init(d->rasterBuffer.data(), this);
executed (the execution status of this line is deduced): d->image_filler.init(d->rasterBuffer.data(), this);
-
399 d->image_filler.type = QSpanData::Texture;
executed (the execution status of this line is deduced): d->image_filler.type = QSpanData::Texture;
-
400 -
401 d->image_filler_xform.init(d->rasterBuffer.data(), this);
executed (the execution status of this line is deduced): d->image_filler_xform.init(d->rasterBuffer.data(), this);
-
402 d->image_filler_xform.type = QSpanData::Texture;
executed (the execution status of this line is deduced): d->image_filler_xform.type = QSpanData::Texture;
-
403 -
404 d->solid_color_filler.init(d->rasterBuffer.data(), this);
executed (the execution status of this line is deduced): d->solid_color_filler.init(d->rasterBuffer.data(), this);
-
405 d->solid_color_filler.type = QSpanData::Solid;
executed (the execution status of this line is deduced): d->solid_color_filler.type = QSpanData::Solid;
-
406 -
407 d->deviceDepth = d->device->depth();
executed (the execution status of this line is deduced): d->deviceDepth = d->device->depth();
-
408 -
409 d->mono_surface = false;
executed (the execution status of this line is deduced): d->mono_surface = false;
-
410 gccaps &= ~PorterDuff;
executed (the execution status of this line is deduced): gccaps &= ~PorterDuff;
-
411 -
412 QImage::Format format = QImage::Format_Invalid;
executed (the execution status of this line is deduced): QImage::Format format = QImage::Format_Invalid;
-
413 -
414 switch (d->device->devType()) { -
415 case QInternal::Pixmap: -
416 qWarning("QRasterPaintEngine: unsupported for pixmaps...");
never executed (the execution status of this line is deduced): QMessageLogger("painting/qpaintengine_raster.cpp", 416, __PRETTY_FUNCTION__).warning("QRasterPaintEngine: unsupported for pixmaps...");
-
417 break;
never executed: break;
0
418 case QInternal::Image: -
419 format = d->rasterBuffer->prepare(static_cast<QImage *>(d->device));
executed (the execution status of this line is deduced): format = d->rasterBuffer->prepare(static_cast<QImage *>(d->device));
-
420 break;
executed: break;
Execution Count:5614
5614
421 default: -
422 qWarning("QRasterPaintEngine: unsupported target device %d\n", d->device->devType());
never executed (the execution status of this line is deduced): QMessageLogger("painting/qpaintengine_raster.cpp", 422, __PRETTY_FUNCTION__).warning("QRasterPaintEngine: unsupported target device %d\n", d->device->devType());
-
423 d->device = 0;
never executed (the execution status of this line is deduced): d->device = 0;
-
424 return;
never executed: return;
0
425 } -
426 -
427 switch (format) { -
428 case QImage::Format_MonoLSB: -
429 case QImage::Format_Mono: -
430 d->mono_surface = true;
executed (the execution status of this line is deduced): d->mono_surface = true;
-
431 break;
executed: break;
Execution Count:143
143
432 case QImage::Format_ARGB8565_Premultiplied: -
433 case QImage::Format_ARGB8555_Premultiplied: -
434 case QImage::Format_ARGB6666_Premultiplied: -
435 case QImage::Format_ARGB4444_Premultiplied: -
436 case QImage::Format_ARGB32_Premultiplied: -
437 case QImage::Format_ARGB32: -
438 gccaps |= PorterDuff;
executed (the execution status of this line is deduced): gccaps |= PorterDuff;
-
439 break;
executed: break;
Execution Count:2570
2570
440 case QImage::Format_RGB32: -
441 case QImage::Format_RGB444: -
442 case QImage::Format_RGB555: -
443 case QImage::Format_RGB666: -
444 case QImage::Format_RGB888: -
445 case QImage::Format_RGB16: -
446 break;
executed: break;
Execution Count:2900
2900
447 default: -
448 break;
executed: break;
Execution Count:1
1
449 } -
450}
executed: }
Execution Count:5614
5614
451 -
452 -
453 -
454 -
455/*! -
456 Destroys this paint engine. -
457*/ -
458QRasterPaintEngine::~QRasterPaintEngine() -
459{ -
460 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
461 -
462 qt_ft_grays_raster.raster_done(*d->grayRaster.data());
executed (the execution status of this line is deduced): qt_ft_grays_raster.raster_done(*d->grayRaster.data());
-
463}
executed: }
Execution Count:5604
5604
464 -
465/*! -
466 \reimp -
467*/ -
468bool QRasterPaintEngine::begin(QPaintDevice *device) -
469{ -
470 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
471 -
472 if (device->devType() == QInternal::Pixmap) {
evaluated: device->devType() == QInternal::Pixmap
TRUEFALSE
yes
Evaluation Count:833
yes
Evaluation Count:27903
833-27903
473 QPixmap *pixmap = static_cast<QPixmap *>(device);
executed (the execution status of this line is deduced): QPixmap *pixmap = static_cast<QPixmap *>(device);
-
474 QPlatformPixmap *pd = pixmap->handle();
executed (the execution status of this line is deduced): QPlatformPixmap *pd = pixmap->handle();
-
475 if (pd->classId() == QPlatformPixmap::RasterClass || pd->classId() == QPlatformPixmap::BlitterClass)
partially evaluated: pd->classId() == QPlatformPixmap::RasterClass
TRUEFALSE
yes
Evaluation Count:833
no
Evaluation Count:0
never evaluated: pd->classId() == QPlatformPixmap::BlitterClass
0-833
476 d->device = pd->buffer();
executed: d->device = pd->buffer();
Execution Count:833
833
477 } else {
executed: }
Execution Count:833
833
478 d->device = device;
executed (the execution status of this line is deduced): d->device = device;
-
479 }
executed: }
Execution Count:27903
27903
480 -
481 // Make sure QPaintEngine::paintDevice() returns the proper device. -
482 d->pdev = d->device;
executed (the execution status of this line is deduced): d->pdev = d->device;
-
483 -
484 Q_ASSERT(d->device->devType() == QInternal::Image
executed (the execution status of this line is deduced): qt_noop();
-
485 || d->device->devType() == QInternal::CustomRaster); -
486 -
487 d->systemStateChanged();
executed (the execution status of this line is deduced): d->systemStateChanged();
-
488 -
489 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
490 ensureOutlineMapper();
executed (the execution status of this line is deduced): ensureOutlineMapper();
-
491 d->outlineMapper->m_clip_rect = d->deviceRect;
executed (the execution status of this line is deduced): d->outlineMapper->m_clip_rect = d->deviceRect;
-
492 -
493 if (d->outlineMapper->m_clip_rect.width() > QT_RASTER_COORD_LIMIT)
partially evaluated: d->outlineMapper->m_clip_rect.width() > QT_RASTER_COORD_LIMIT
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:28736
0-28736
494 d->outlineMapper->m_clip_rect.setWidth(QT_RASTER_COORD_LIMIT);
never executed: d->outlineMapper->m_clip_rect.setWidth(QT_RASTER_COORD_LIMIT);
0
495 if (d->outlineMapper->m_clip_rect.height() > QT_RASTER_COORD_LIMIT)
partially evaluated: d->outlineMapper->m_clip_rect.height() > QT_RASTER_COORD_LIMIT
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:28736
0-28736
496 d->outlineMapper->m_clip_rect.setHeight(QT_RASTER_COORD_LIMIT);
never executed: d->outlineMapper->m_clip_rect.setHeight(QT_RASTER_COORD_LIMIT);
0
497 -
498 d->rasterizer->setClipRect(d->deviceRect);
executed (the execution status of this line is deduced): d->rasterizer->setClipRect(d->deviceRect);
-
499 -
500 s->penData.init(d->rasterBuffer.data(), this);
executed (the execution status of this line is deduced): s->penData.init(d->rasterBuffer.data(), this);
-
501 s->penData.setup(s->pen.brush(), s->intOpacity, s->composition_mode);
executed (the execution status of this line is deduced): s->penData.setup(s->pen.brush(), s->intOpacity, s->composition_mode);
-
502 s->stroker = &d->basicStroker;
executed (the execution status of this line is deduced): s->stroker = &d->basicStroker;
-
503 d->basicStroker.setClipRect(d->deviceRect);
executed (the execution status of this line is deduced): d->basicStroker.setClipRect(d->deviceRect);
-
504 -
505 s->brushData.init(d->rasterBuffer.data(), this);
executed (the execution status of this line is deduced): s->brushData.init(d->rasterBuffer.data(), this);
-
506 s->brushData.setup(s->brush, s->intOpacity, s->composition_mode);
executed (the execution status of this line is deduced): s->brushData.setup(s->brush, s->intOpacity, s->composition_mode);
-
507 -
508 d->rasterBuffer->compositionMode = QPainter::CompositionMode_SourceOver;
executed (the execution status of this line is deduced): d->rasterBuffer->compositionMode = QPainter::CompositionMode_SourceOver;
-
509 -
510 setDirty(DirtyBrushOrigin);
executed (the execution status of this line is deduced): setDirty(DirtyBrushOrigin);
-
511 -
512#ifdef QT_DEBUG_DRAW -
513 qDebug() << "QRasterPaintEngine::begin(" << (void *) device -
514 << ") devType:" << device->devType() -
515 << "devRect:" << d->deviceRect; -
516 if (d->baseClip) { -
517 dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), &*d->baseClip); -
518 } -
519#endif -
520 -
521 if (d->mono_surface)
evaluated: d->mono_surface
TRUEFALSE
yes
Evaluation Count:167
yes
Evaluation Count:28569
167-28569
522 d->glyphCacheType = QFontEngineGlyphCache::Raster_Mono;
executed: d->glyphCacheType = QFontEngineGlyphCache::Raster_Mono;
Execution Count:167
167
523#if defined(Q_OS_WIN) -
524 else if (clearTypeFontsEnabled()) -
525#else -
526 else if (false)
partially evaluated: false
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:28569
0-28569
527#endif -
528 { -
529 QImage::Format format = static_cast<QImage *>(d->device)->format();
never executed (the execution status of this line is deduced): QImage::Format format = static_cast<QImage *>(d->device)->format();
-
530 if (format == QImage::Format_ARGB32_Premultiplied || format == QImage::Format_RGB32)
never evaluated: format == QImage::Format_ARGB32_Premultiplied
never evaluated: format == QImage::Format_RGB32
0
531 d->glyphCacheType = QFontEngineGlyphCache::Raster_RGBMask;
never executed: d->glyphCacheType = QFontEngineGlyphCache::Raster_RGBMask;
0
532 else -
533 d->glyphCacheType = QFontEngineGlyphCache::Raster_A8;
never executed: d->glyphCacheType = QFontEngineGlyphCache::Raster_A8;
0
534 } else -
535 d->glyphCacheType = QFontEngineGlyphCache::Raster_A8;
executed: d->glyphCacheType = QFontEngineGlyphCache::Raster_A8;
Execution Count:28569
28569
536 -
537 setActive(true);
executed (the execution status of this line is deduced): setActive(true);
-
538 return true;
executed: return true;
Execution Count:28736
28736
539} -
540 -
541/*! -
542 \reimp -
543*/ -
544bool QRasterPaintEngine::end() -
545{ -
546#ifdef QT_DEBUG_DRAW -
547 Q_D(QRasterPaintEngine); -
548 qDebug() << "QRasterPaintEngine::end devRect:" << d->deviceRect; -
549 if (d->baseClip) { -
550 dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), &*d->baseClip); -
551 } -
552#endif -
553 -
554 return true;
executed: return true;
Execution Count:28736
28736
555} -
556 -
557/*! -
558 \internal -
559*/ -
560void QRasterPaintEngine::releaseBuffer() -
561{ -
562 Q_D(QRasterPaintEngine);
never executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
563 d->rasterBuffer.reset(new QRasterBuffer);
never executed (the execution status of this line is deduced): d->rasterBuffer.reset(new QRasterBuffer);
-
564}
never executed: }
0
565 -
566/*! -
567 \internal -
568*/ -
569QSize QRasterPaintEngine::size() const -
570{ -
571 Q_D(const QRasterPaintEngine);
never executed (the execution status of this line is deduced): const QRasterPaintEnginePrivate * const d = d_func();
-
572 return QSize(d->rasterBuffer->width(), d->rasterBuffer->height());
never executed: return QSize(d->rasterBuffer->width(), d->rasterBuffer->height());
0
573} -
574 -
575/*! -
576 \internal -
577*/ -
578#ifndef QT_NO_DEBUG -
579void QRasterPaintEngine::saveBuffer(const QString &s) const -
580{ -
581 Q_D(const QRasterPaintEngine); -
582 d->rasterBuffer->bufferImage().save(s, "PNG"); -
583} -
584#endif -
585 -
586/*! -
587 \internal -
588*/ -
589void QRasterPaintEngine::updateMatrix(const QTransform &matrix) -
590{ -
591 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
592 // FALCON: get rid of this line, see drawImage call below. -
593 s->matrix = matrix;
executed (the execution status of this line is deduced): s->matrix = matrix;
-
594 QTransform::TransformationType txop = s->matrix.type();
executed (the execution status of this line is deduced): QTransform::TransformationType txop = s->matrix.type();
-
595 -
596 switch (txop) { -
597 -
598 case QTransform::TxNone: -
599 s->flags.int_xform = true;
executed (the execution status of this line is deduced): s->flags.int_xform = true;
-
600 break;
executed: break;
Execution Count:13
13
601 -
602 case QTransform::TxTranslate: -
603 s->flags.int_xform = qreal(int(s->matrix.dx())) == s->matrix.dx()
evaluated: qreal(int(s->matrix.dx())) == s->matrix.dx()
TRUEFALSE
yes
Evaluation Count:23737
yes
Evaluation Count:46
46-23737
604 && qreal(int(s->matrix.dy())) == s->matrix.dy();
partially evaluated: qreal(int(s->matrix.dy())) == s->matrix.dy()
TRUEFALSE
yes
Evaluation Count:23737
no
Evaluation Count:0
0-23737
605 break;
executed: break;
Execution Count:23783
23783
606 -
607 case QTransform::TxScale: -
608 s->flags.int_xform = qreal(int(s->matrix.dx())) == s->matrix.dx()
evaluated: qreal(int(s->matrix.dx())) == s->matrix.dx()
TRUEFALSE
yes
Evaluation Count:73
yes
Evaluation Count:2
2-73
609 && qreal(int(s->matrix.dy())) == s->matrix.dy()
partially evaluated: qreal(int(s->matrix.dy())) == s->matrix.dy()
TRUEFALSE
yes
Evaluation Count:73
no
Evaluation Count:0
0-73
610 && qreal(int(s->matrix.m11())) == s->matrix.m11()
evaluated: qreal(int(s->matrix.m11())) == s->matrix.m11()
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:56
17-56
611 && qreal(int(s->matrix.m22())) == s->matrix.m22();
evaluated: qreal(int(s->matrix.m22())) == s->matrix.m22()
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:1
1-16
612 break;
executed: break;
Execution Count:75
75
613 -
614 default: // shear / perspective... -
615 s->flags.int_xform = false;
executed (the execution status of this line is deduced): s->flags.int_xform = false;
-
616 break;
executed: break;
Execution Count:1716
1716
617 } -
618 -
619 s->flags.tx_noshear = qt_scaleForTransform(s->matrix, &s->txscale);
executed (the execution status of this line is deduced): s->flags.tx_noshear = qt_scaleForTransform(s->matrix, &s->txscale);
-
620 -
621 ensureOutlineMapper();
executed (the execution status of this line is deduced): ensureOutlineMapper();
-
622}
executed: }
Execution Count:25587
25587
623 -
624 -
625 -
626QRasterPaintEngineState::~QRasterPaintEngineState() -
627{ -
628 if (flags.has_clip_ownership)
evaluated: flags.has_clip_ownership
TRUEFALSE
yes
Evaluation Count:22363
yes
Evaluation Count:37152
22363-37152
629 delete clip;
executed: delete clip;
Execution Count:22363
22363
630}
executed: }
Execution Count:59515
59515
631 -
632 -
633QRasterPaintEngineState::QRasterPaintEngineState() -
634{ -
635 stroker = 0;
executed (the execution status of this line is deduced): stroker = 0;
-
636 -
637 fillFlags = 0;
executed (the execution status of this line is deduced): fillFlags = 0;
-
638 strokeFlags = 0;
executed (the execution status of this line is deduced): strokeFlags = 0;
-
639 pixmapFlags = 0;
executed (the execution status of this line is deduced): pixmapFlags = 0;
-
640 -
641 intOpacity = 256;
executed (the execution status of this line is deduced): intOpacity = 256;
-
642 -
643 txscale = 1.;
executed (the execution status of this line is deduced): txscale = 1.;
-
644 -
645 flags.fast_pen = true;
executed (the execution status of this line is deduced): flags.fast_pen = true;
-
646 flags.antialiased = false;
executed (the execution status of this line is deduced): flags.antialiased = false;
-
647 flags.bilinear = false;
executed (the execution status of this line is deduced): flags.bilinear = false;
-
648 flags.legacy_rounding = false;
executed (the execution status of this line is deduced): flags.legacy_rounding = false;
-
649 flags.fast_text = true;
executed (the execution status of this line is deduced): flags.fast_text = true;
-
650 flags.int_xform = true;
executed (the execution status of this line is deduced): flags.int_xform = true;
-
651 flags.tx_noshear = true;
executed (the execution status of this line is deduced): flags.tx_noshear = true;
-
652 flags.fast_images = true;
executed (the execution status of this line is deduced): flags.fast_images = true;
-
653 -
654 clip = 0;
executed (the execution status of this line is deduced): clip = 0;
-
655 flags.has_clip_ownership = false;
executed (the execution status of this line is deduced): flags.has_clip_ownership = false;
-
656 -
657 dirty = 0;
executed (the execution status of this line is deduced): dirty = 0;
-
658}
executed: }
Execution Count:28736
28736
659 -
660QRasterPaintEngineState::QRasterPaintEngineState(QRasterPaintEngineState &s) -
661 : QPainterState(s) -
662 , lastPen(s.lastPen) -
663 , penData(s.penData) -
664 , stroker(s.stroker) -
665 , strokeFlags(s.strokeFlags) -
666 , lastBrush(s.lastBrush) -
667 , brushData(s.brushData) -
668 , fillFlags(s.fillFlags) -
669 , pixmapFlags(s.pixmapFlags) -
670 , intOpacity(s.intOpacity) -
671 , txscale(s.txscale) -
672 , clip(s.clip) -
673 , dirty(s.dirty) -
674 , flag_bits(s.flag_bits) -
675{ -
676 brushData.tempImage = 0;
executed (the execution status of this line is deduced): brushData.tempImage = 0;
-
677 penData.tempImage = 0;
executed (the execution status of this line is deduced): penData.tempImage = 0;
-
678 flags.has_clip_ownership = false;
executed (the execution status of this line is deduced): flags.has_clip_ownership = false;
-
679}
executed: }
Execution Count:30778
30778
680 -
681/*! -
682 \internal -
683*/ -
684QPainterState *QRasterPaintEngine::createState(QPainterState *orig) const -
685{ -
686 QRasterPaintEngineState *s;
executed (the execution status of this line is deduced): QRasterPaintEngineState *s;
-
687 if (!orig)
evaluated: !orig
TRUEFALSE
yes
Evaluation Count:28737
yes
Evaluation Count:30778
28737-30778
688 s = new QRasterPaintEngineState();
executed: s = new QRasterPaintEngineState();
Execution Count:28737
28737
689 else -
690 s = new QRasterPaintEngineState(*static_cast<QRasterPaintEngineState *>(orig));
executed: s = new QRasterPaintEngineState(*static_cast<QRasterPaintEngineState *>(orig));
Execution Count:30778
30778
691 -
692 return s;
executed: return s;
Execution Count:59514
59514
693} -
694 -
695/*! -
696 \internal -
697*/ -
698void QRasterPaintEngine::setState(QPainterState *s) -
699{ -
700 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
701 QPaintEngineEx::setState(s);
executed (the execution status of this line is deduced): QPaintEngineEx::setState(s);
-
702 d->rasterBuffer->compositionMode = s->composition_mode;
executed (the execution status of this line is deduced): d->rasterBuffer->compositionMode = s->composition_mode;
-
703}
executed: }
Execution Count:93235
93235
704 -
705/*! -
706 \fn QRasterPaintEngineState *QRasterPaintEngine::state() -
707 \internal -
708*/ -
709 -
710/*! -
711 \fn const QRasterPaintEngineState *QRasterPaintEngine::state() const -
712 \internal -
713*/ -
714 -
715/*! -
716 \internal -
717*/ -
718void QRasterPaintEngine::penChanged() -
719{ -
720#ifdef QT_DEBUG_DRAW -
721 qDebug() << "QRasterPaintEngine::penChanged():" << state()->pen; -
722#endif -
723 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
724 s->strokeFlags |= DirtyPen;
executed (the execution status of this line is deduced): s->strokeFlags |= DirtyPen;
-
725 s->dirty |= DirtyPen;
executed (the execution status of this line is deduced): s->dirty |= DirtyPen;
-
726}
executed: }
Execution Count:135958
135958
727 -
728/*! -
729 \internal -
730*/ -
731void QRasterPaintEngine::updatePen(const QPen &pen) -
732{ -
733 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
734 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
735#ifdef QT_DEBUG_DRAW -
736 qDebug() << "QRasterPaintEngine::updatePen():" << s->pen; -
737#endif -
738 -
739 Qt::PenStyle pen_style = qpen_style(pen);
executed (the execution status of this line is deduced): Qt::PenStyle pen_style = qpen_style(pen);
-
740 -
741 s->lastPen = pen;
executed (the execution status of this line is deduced): s->lastPen = pen;
-
742 s->strokeFlags = 0;
executed (the execution status of this line is deduced): s->strokeFlags = 0;
-
743 -
744 s->penData.clip = d->clip();
executed (the execution status of this line is deduced): s->penData.clip = d->clip();
-
745 s->penData.setup(pen_style == Qt::NoPen ? QBrush() : pen.brush(), s->intOpacity, s->composition_mode);
executed (the execution status of this line is deduced): s->penData.setup(pen_style == Qt::NoPen ? QBrush() : pen.brush(), s->intOpacity, s->composition_mode);
-
746 -
747 if (s->strokeFlags & QRasterPaintEngine::DirtyTransform
partially evaluated: s->strokeFlags & QRasterPaintEngine::DirtyTransform
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:96143
0-96143
748 || pen.brush().transform().type() >= QTransform::TxNone) {
partially evaluated: pen.brush().transform().type() >= QTransform::TxNone
TRUEFALSE
yes
Evaluation Count:96143
no
Evaluation Count:0
0-96143
749 d->updateMatrixData(&s->penData, pen.brush(), s->matrix);
executed (the execution status of this line is deduced): d->updateMatrixData(&s->penData, pen.brush(), s->matrix);
-
750 }
executed: }
Execution Count:96143
96143
751 -
752 // Slightly ugly handling of an uncommon case... We need to change -
753 // the pen because it is reused in draw_midpoint to decide dashed -
754 // or non-dashed. -
755 if (pen_style == Qt::CustomDashLine && pen.dashPattern().size() == 0) {
evaluated: pen_style == Qt::CustomDashLine
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:96142
partially evaluated: pen.dashPattern().size() == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-96142
756 pen_style = Qt::SolidLine;
never executed (the execution status of this line is deduced): pen_style = Qt::SolidLine;
-
757 s->lastPen.setStyle(Qt::SolidLine);
never executed (the execution status of this line is deduced): s->lastPen.setStyle(Qt::SolidLine);
-
758 }
never executed: }
0
759 -
760 d->basicStroker.setJoinStyle(qpen_joinStyle(pen));
executed (the execution status of this line is deduced): d->basicStroker.setJoinStyle(qpen_joinStyle(pen));
-
761 d->basicStroker.setCapStyle(qpen_capStyle(pen));
executed (the execution status of this line is deduced): d->basicStroker.setCapStyle(qpen_capStyle(pen));
-
762 d->basicStroker.setMiterLimit(pen.miterLimit());
executed (the execution status of this line is deduced): d->basicStroker.setMiterLimit(pen.miterLimit());
-
763 -
764 qreal penWidth = qpen_widthf(pen);
executed (the execution status of this line is deduced): qreal penWidth = qpen_widthf(pen);
-
765 if (penWidth == 0)
evaluated: penWidth == 0
TRUEFALSE
yes
Evaluation Count:752
yes
Evaluation Count:95391
752-95391
766 d->basicStroker.setStrokeWidth(1);
executed: d->basicStroker.setStrokeWidth(1);
Execution Count:752
752
767 else -
768 d->basicStroker.setStrokeWidth(penWidth);
executed: d->basicStroker.setStrokeWidth(penWidth);
Execution Count:95391
95391
769 -
770 if(pen_style == Qt::SolidLine) {
evaluated: pen_style == Qt::SolidLine
TRUEFALSE
yes
Evaluation Count:93825
yes
Evaluation Count:2318
2318-93825
771 s->stroker = &d->basicStroker;
executed (the execution status of this line is deduced): s->stroker = &d->basicStroker;
-
772 } else if (pen_style != Qt::NoPen) {
executed: }
Execution Count:93825
evaluated: pen_style != Qt::NoPen
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:2302
16-93825
773 if (!d->dashStroker)
evaluated: !d->dashStroker
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:7
7-9
774 d->dashStroker.reset(new QDashStroker(&d->basicStroker));
executed: d->dashStroker.reset(new QDashStroker(&d->basicStroker));
Execution Count:9
9
775 if (qt_pen_is_cosmetic(pen, s->renderHints)) {
evaluated: qt_pen_is_cosmetic(pen, s->renderHints)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:15
1-15
776 d->dashStroker->setClipRect(d->deviceRect);
executed (the execution status of this line is deduced): d->dashStroker->setClipRect(d->deviceRect);
-
777 } else {
executed: }
Execution Count:1
1
778 // ### I've seen this inverted devrect multiple places now... -
779 QRectF clipRect = s->matrix.inverted().mapRect(QRectF(d->deviceRect));
executed (the execution status of this line is deduced): QRectF clipRect = s->matrix.inverted().mapRect(QRectF(d->deviceRect));
-
780 d->dashStroker->setClipRect(clipRect);
executed (the execution status of this line is deduced): d->dashStroker->setClipRect(clipRect);
-
781 }
executed: }
Execution Count:15
15
782 d->dashStroker->setDashPattern(pen.dashPattern());
executed (the execution status of this line is deduced): d->dashStroker->setDashPattern(pen.dashPattern());
-
783 d->dashStroker->setDashOffset(pen.dashOffset());
executed (the execution status of this line is deduced): d->dashStroker->setDashOffset(pen.dashOffset());
-
784 s->stroker = d->dashStroker.data();
executed (the execution status of this line is deduced): s->stroker = d->dashStroker.data();
-
785 } else {
executed: }
Execution Count:16
16
786 s->stroker = 0;
executed (the execution status of this line is deduced): s->stroker = 0;
-
787 }
executed: }
Execution Count:2302
2302
788 -
789 ensureRasterState(); // needed because of tx_noshear...
executed (the execution status of this line is deduced): ensureRasterState();
-
790 bool cosmetic = qt_pen_is_cosmetic(pen, s->renderHints);
executed (the execution status of this line is deduced): bool cosmetic = qt_pen_is_cosmetic(pen, s->renderHints);
-
791 s->flags.fast_pen = pen_style > Qt::NoPen
evaluated: pen_style > Qt::NoPen
TRUEFALSE
yes
Evaluation Count:93841
yes
Evaluation Count:2302
2302-93841
792 && s->penData.blend
evaluated: s->penData.blend
TRUEFALSE
yes
Evaluation Count:93828
yes
Evaluation Count:13
13-93828
793 && ((cosmetic && penWidth <= 1)
evaluated: cosmetic
TRUEFALSE
yes
Evaluation Count:1711
yes
Evaluation Count:92117
partially evaluated: penWidth <= 1
TRUEFALSE
yes
Evaluation Count:1711
no
Evaluation Count:0
0-92117
794 || (!cosmetic && s->flags.tx_noshear && penWidth * s->txscale <= 1));
partially evaluated: !cosmetic
TRUEFALSE
yes
Evaluation Count:92117
no
Evaluation Count:0
evaluated: s->flags.tx_noshear
TRUEFALSE
yes
Evaluation Count:91897
yes
Evaluation Count:220
evaluated: penWidth * s->txscale <= 1
TRUEFALSE
yes
Evaluation Count:90340
yes
Evaluation Count:1557
0-92117
795 -
796 s->flags.non_complex_pen = qpen_capStyle(s->lastPen) <= Qt::SquareCap && s->flags.tx_noshear;
evaluated: qpen_capStyle(s->lastPen) <= Qt::SquareCap
TRUEFALSE
yes
Evaluation Count:96139
yes
Evaluation Count:4
evaluated: s->flags.tx_noshear
TRUEFALSE
yes
Evaluation Count:95919
yes
Evaluation Count:220
4-96139
797 -
798 s->strokeFlags = 0;
executed (the execution status of this line is deduced): s->strokeFlags = 0;
-
799}
executed: }
Execution Count:96143
96143
800 -
801 -
802 -
803/*! -
804 \internal -
805*/ -
806void QRasterPaintEngine::brushOriginChanged() -
807{ -
808 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
809#ifdef QT_DEBUG_DRAW -
810 qDebug() << "QRasterPaintEngine::brushOriginChanged()" << s->brushOrigin; -
811#endif -
812 -
813 s->fillFlags |= DirtyBrushOrigin;
executed (the execution status of this line is deduced): s->fillFlags |= DirtyBrushOrigin;
-
814}
executed: }
Execution Count:21057
21057
815 -
816 -
817/*! -
818 \internal -
819*/ -
820void QRasterPaintEngine::brushChanged() -
821{ -
822 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
823#ifdef QT_DEBUG_DRAW -
824 qDebug() << "QRasterPaintEngine::brushChanged():" << s->brush; -
825#endif -
826 s->fillFlags |= DirtyBrush;
executed (the execution status of this line is deduced): s->fillFlags |= DirtyBrush;
-
827}
executed: }
Execution Count:10963
10963
828 -
829 -
830 -
831 -
832/*! -
833 \internal -
834*/ -
835void QRasterPaintEngine::updateBrush(const QBrush &brush) -
836{ -
837#ifdef QT_DEBUG_DRAW -
838 qDebug() << "QRasterPaintEngine::updateBrush()" << brush; -
839#endif -
840 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
841 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
842 // must set clip prior to setup, as setup uses it... -
843 s->brushData.clip = d->clip();
executed (the execution status of this line is deduced): s->brushData.clip = d->clip();
-
844 s->brushData.setup(brush, s->intOpacity, s->composition_mode);
executed (the execution status of this line is deduced): s->brushData.setup(brush, s->intOpacity, s->composition_mode);
-
845 if (s->fillFlags & DirtyTransform
evaluated: s->fillFlags & DirtyTransform
TRUEFALSE
yes
Evaluation Count:52202
yes
Evaluation Count:142481
52202-142481
846 || brush.transform().type() >= QTransform::TxNone)
partially evaluated: brush.transform().type() >= QTransform::TxNone
TRUEFALSE
yes
Evaluation Count:142480
no
Evaluation Count:0
0-142480
847 d_func()->updateMatrixData(&s->brushData, brush, d->brushMatrix());
executed: d_func()->updateMatrixData(&s->brushData, brush, d->brushMatrix());
Execution Count:194683
194683
848 s->lastBrush = brush;
executed (the execution status of this line is deduced): s->lastBrush = brush;
-
849 s->fillFlags = 0;
executed (the execution status of this line is deduced): s->fillFlags = 0;
-
850}
executed: }
Execution Count:194682
194682
851 -
852void QRasterPaintEngine::updateOutlineMapper() -
853{ -
854 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
855 d->outlineMapper->setMatrix(state()->matrix);
executed (the execution status of this line is deduced): d->outlineMapper->setMatrix(state()->matrix);
-
856}
executed: }
Execution Count:191264
191264
857 -
858void QRasterPaintEngine::updateRasterState() -
859{ -
860 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
861 -
862 if (s->dirty & DirtyTransform)
evaluated: s->dirty & DirtyTransform
TRUEFALSE
yes
Evaluation Count:25587
yes
Evaluation Count:69325
25587-69325
863 updateMatrix(s->matrix);
executed: updateMatrix(s->matrix);
Execution Count:25587
25587
864 -
865 if (s->dirty & (DirtyPen|DirtyCompositionMode|DirtyOpacity)) {
evaluated: s->dirty & (DirtyPen|DirtyCompositionMode|DirtyOpacity)
TRUEFALSE
yes
Evaluation Count:94649
yes
Evaluation Count:263
263-94649
866 const QPainter::CompositionMode mode = s->composition_mode;
executed (the execution status of this line is deduced): const QPainter::CompositionMode mode = s->composition_mode;
-
867 s->flags.fast_text = (s->penData.type == QSpanData::Solid)
evaluated: (s->penData.type == QSpanData::Solid)
TRUEFALSE
yes
Evaluation Count:94456
yes
Evaluation Count:193
193-94456
868 && s->intOpacity == 256
evaluated: s->intOpacity == 256
TRUEFALSE
yes
Evaluation Count:94422
yes
Evaluation Count:34
34-94422
869 && (mode == QPainter::CompositionMode_Source
evaluated: mode == QPainter::CompositionMode_Source
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:94420
2-94420
870 || (mode == QPainter::CompositionMode_SourceOver
partially evaluated: mode == QPainter::CompositionMode_SourceOver
TRUEFALSE
yes
Evaluation Count:94420
no
Evaluation Count:0
0-94420
871 && qAlpha(s->penData.solid.color) == 255));
evaluated: qAlpha(s->penData.solid.color) == 255
TRUEFALSE
yes
Evaluation Count:92834
yes
Evaluation Count:1586
1586-92834
872 }
executed: }
Execution Count:94649
94649
873 -
874 s->dirty = 0;
executed (the execution status of this line is deduced): s->dirty = 0;
-
875}
executed: }
Execution Count:94912
94912
876 -
877 -
878/*! -
879 \internal -
880*/ -
881void QRasterPaintEngine::opacityChanged() -
882{ -
883 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
884 -
885#ifdef QT_DEBUG_DRAW -
886 qDebug() << "QRasterPaintEngine::opacityChanged()" << s->opacity; -
887#endif -
888 -
889 s->fillFlags |= DirtyOpacity;
executed (the execution status of this line is deduced): s->fillFlags |= DirtyOpacity;
-
890 s->strokeFlags |= DirtyOpacity;
executed (the execution status of this line is deduced): s->strokeFlags |= DirtyOpacity;
-
891 s->pixmapFlags |= DirtyOpacity;
executed (the execution status of this line is deduced): s->pixmapFlags |= DirtyOpacity;
-
892 s->dirty |= DirtyOpacity;
executed (the execution status of this line is deduced): s->dirty |= DirtyOpacity;
-
893 s->intOpacity = (int) (s->opacity * 256);
executed (the execution status of this line is deduced): s->intOpacity = (int) (s->opacity * 256);
-
894}
executed: }
Execution Count:438
438
895 -
896/*! -
897 \internal -
898*/ -
899void QRasterPaintEngine::compositionModeChanged() -
900{ -
901 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
902 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
903 -
904#ifdef QT_DEBUG_DRAW -
905 qDebug() << "QRasterPaintEngine::compositionModeChanged()" << s->composition_mode; -
906#endif -
907 -
908 s->fillFlags |= DirtyCompositionMode;
executed (the execution status of this line is deduced): s->fillFlags |= DirtyCompositionMode;
-
909 s->dirty |= DirtyCompositionMode;
executed (the execution status of this line is deduced): s->dirty |= DirtyCompositionMode;
-
910 -
911 s->strokeFlags |= DirtyCompositionMode;
executed (the execution status of this line is deduced): s->strokeFlags |= DirtyCompositionMode;
-
912 d->rasterBuffer->compositionMode = s->composition_mode;
executed (the execution status of this line is deduced): d->rasterBuffer->compositionMode = s->composition_mode;
-
913 -
914 d->recalculateFastImages();
executed (the execution status of this line is deduced): d->recalculateFastImages();
-
915}
executed: }
Execution Count:6985
6985
916 -
917/*! -
918 \internal -
919*/ -
920void QRasterPaintEngine::renderHintsChanged() -
921{ -
922 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
923 -
924#ifdef QT_DEBUG_DRAW -
925 qDebug() << "QRasterPaintEngine::renderHintsChanged()" << hex << s->renderHints; -
926#endif -
927 -
928 bool was_aa = s->flags.antialiased;
executed (the execution status of this line is deduced): bool was_aa = s->flags.antialiased;
-
929 bool was_bilinear = s->flags.bilinear;
executed (the execution status of this line is deduced): bool was_bilinear = s->flags.bilinear;
-
930 -
931 s->flags.antialiased = bool(s->renderHints & QPainter::Antialiasing);
executed (the execution status of this line is deduced): s->flags.antialiased = bool(s->renderHints & QPainter::Antialiasing);
-
932 s->flags.bilinear = bool(s->renderHints & QPainter::SmoothPixmapTransform);
executed (the execution status of this line is deduced): s->flags.bilinear = bool(s->renderHints & QPainter::SmoothPixmapTransform);
-
933 s->flags.legacy_rounding = !bool(s->renderHints & QPainter::Antialiasing) && bool(s->renderHints & QPainter::Qt4CompatiblePainting);
evaluated: !bool(s->renderHints & QPainter::Antialiasing)
TRUEFALSE
yes
Evaluation Count:4681
yes
Evaluation Count:783
evaluated: bool(s->renderHints & QPainter::Qt4CompatiblePainting)
TRUEFALSE
yes
Evaluation Count:899
yes
Evaluation Count:3782
783-4681
934 -
935 if (was_aa != s->flags.antialiased)
evaluated: was_aa != s->flags.antialiased
TRUEFALSE
yes
Evaluation Count:855
yes
Evaluation Count:4609
855-4609
936 s->strokeFlags |= DirtyHints;
executed: s->strokeFlags |= DirtyHints;
Execution Count:855
855
937 -
938 if (was_bilinear != s->flags.bilinear) {
evaluated: was_bilinear != s->flags.bilinear
TRUEFALSE
yes
Evaluation Count:32
yes
Evaluation Count:5432
32-5432
939 s->strokeFlags |= DirtyPen;
executed (the execution status of this line is deduced): s->strokeFlags |= DirtyPen;
-
940 s->fillFlags |= DirtyBrush;
executed (the execution status of this line is deduced): s->fillFlags |= DirtyBrush;
-
941 }
executed: }
Execution Count:32
32
942 -
943 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
944 d->recalculateFastImages();
executed (the execution status of this line is deduced): d->recalculateFastImages();
-
945}
executed: }
Execution Count:5464
5464
946 -
947/*! -
948 \internal -
949*/ -
950void QRasterPaintEngine::transformChanged() -
951{ -
952 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
953 -
954#ifdef QT_DEBUG_DRAW -
955 qDebug() << "QRasterPaintEngine::transformChanged()" << s->matrix; -
956#endif -
957 -
958 s->fillFlags |= DirtyTransform;
executed (the execution status of this line is deduced): s->fillFlags |= DirtyTransform;
-
959 s->strokeFlags |= DirtyTransform;
executed (the execution status of this line is deduced): s->strokeFlags |= DirtyTransform;
-
960 -
961 s->dirty |= DirtyTransform;
executed (the execution status of this line is deduced): s->dirty |= DirtyTransform;
-
962 -
963 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
964 d->recalculateFastImages();
executed (the execution status of this line is deduced): d->recalculateFastImages();
-
965}
executed: }
Execution Count:57734
57734
966 -
967/*! -
968 \internal -
969*/ -
970void QRasterPaintEngine::clipEnabledChanged() -
971{ -
972 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
973 -
974#ifdef QT_DEBUG_DRAW -
975 qDebug() << "QRasterPaintEngine::clipEnabledChanged()" << s->clipEnabled; -
976#endif -
977 -
978 if (s->clip) {
partially evaluated: s->clip
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
979 s->clip->enabled = s->clipEnabled;
executed (the execution status of this line is deduced): s->clip->enabled = s->clipEnabled;
-
980 s->fillFlags |= DirtyClipEnabled;
executed (the execution status of this line is deduced): s->fillFlags |= DirtyClipEnabled;
-
981 s->strokeFlags |= DirtyClipEnabled;
executed (the execution status of this line is deduced): s->strokeFlags |= DirtyClipEnabled;
-
982 s->pixmapFlags |= DirtyClipEnabled;
executed (the execution status of this line is deduced): s->pixmapFlags |= DirtyClipEnabled;
-
983 }
executed: }
Execution Count:4
4
984}
executed: }
Execution Count:4
4
985 -
986void QRasterPaintEnginePrivate::drawImage(const QPointF &pt, -
987 const QImage &img, -
988 SrcOverBlendFunc func, -
989 const QRect &clip, -
990 int alpha, -
991 const QRect &sr) -
992{ -
993 if (alpha == 0 || !clip.isValid())
evaluated: alpha == 0
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:10009
partially evaluated: !clip.isValid()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10009
0-10009
994 return;
executed: return;
Execution Count:5
5
995 -
996 Q_ASSERT(img.depth() >= 8);
executed (the execution status of this line is deduced): qt_noop();
-
997 -
998 int srcBPL = img.bytesPerLine();
executed (the execution status of this line is deduced): int srcBPL = img.bytesPerLine();
-
999 const uchar *srcBits = img.bits();
executed (the execution status of this line is deduced): const uchar *srcBits = img.bits();
-
1000 int srcSize = img.depth() >> 3; // This is the part that is incompatible with lower than 8-bit..
executed (the execution status of this line is deduced): int srcSize = img.depth() >> 3;
-
1001 int iw = img.width();
executed (the execution status of this line is deduced): int iw = img.width();
-
1002 int ih = img.height();
executed (the execution status of this line is deduced): int ih = img.height();
-
1003 -
1004 if (!sr.isEmpty()) {
evaluated: !sr.isEmpty()
TRUEFALSE
yes
Evaluation Count:3771
yes
Evaluation Count:6238
3771-6238
1005 iw = sr.width();
executed (the execution status of this line is deduced): iw = sr.width();
-
1006 ih = sr.height();
executed (the execution status of this line is deduced): ih = sr.height();
-
1007 // Adjust the image according to the source offset... -
1008 srcBits += ((sr.y() * srcBPL) + sr.x() * srcSize);
executed (the execution status of this line is deduced): srcBits += ((sr.y() * srcBPL) + sr.x() * srcSize);
-
1009 }
executed: }
Execution Count:3771
3771
1010 -
1011 // adapt the x parameters -
1012 int x = qRound(pt.x());
executed (the execution status of this line is deduced): int x = qRound(pt.x());
-
1013 int cx1 = clip.x();
executed (the execution status of this line is deduced): int cx1 = clip.x();
-
1014 int cx2 = clip.x() + clip.width();
executed (the execution status of this line is deduced): int cx2 = clip.x() + clip.width();
-
1015 if (x < cx1) {
evaluated: x < cx1
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:9993
16-9993
1016 int d = cx1 - x;
executed (the execution status of this line is deduced): int d = cx1 - x;
-
1017 srcBits += srcSize * d;
executed (the execution status of this line is deduced): srcBits += srcSize * d;
-
1018 iw -= d;
executed (the execution status of this line is deduced): iw -= d;
-
1019 x = cx1;
executed (the execution status of this line is deduced): x = cx1;
-
1020 }
executed: }
Execution Count:16
16
1021 if (x + iw > cx2) {
evaluated: x + iw > cx2
TRUEFALSE
yes
Evaluation Count:197
yes
Evaluation Count:9812
197-9812
1022 int d = x + iw - cx2;
executed (the execution status of this line is deduced): int d = x + iw - cx2;
-
1023 iw -= d;
executed (the execution status of this line is deduced): iw -= d;
-
1024 }
executed: }
Execution Count:197
197
1025 if (iw <= 0)
evaluated: iw <= 0
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:9986
23-9986
1026 return;
executed: return;
Execution Count:23
23
1027 -
1028 // adapt the y paremeters... -
1029 int cy1 = clip.y();
executed (the execution status of this line is deduced): int cy1 = clip.y();
-
1030 int cy2 = clip.y() + clip.height();
executed (the execution status of this line is deduced): int cy2 = clip.y() + clip.height();
-
1031 int y = qRound(pt.y());
executed (the execution status of this line is deduced): int y = qRound(pt.y());
-
1032 if (y < cy1) {
evaluated: y < cy1
TRUEFALSE
yes
Evaluation Count:58
yes
Evaluation Count:9928
58-9928
1033 int d = cy1 - y;
executed (the execution status of this line is deduced): int d = cy1 - y;
-
1034 srcBits += srcBPL * d;
executed (the execution status of this line is deduced): srcBits += srcBPL * d;
-
1035 ih -= d;
executed (the execution status of this line is deduced): ih -= d;
-
1036 y = cy1;
executed (the execution status of this line is deduced): y = cy1;
-
1037 }
executed: }
Execution Count:58
58
1038 if (y + ih > cy2) {
evaluated: y + ih > cy2
TRUEFALSE
yes
Evaluation Count:115
yes
Evaluation Count:9871
115-9871
1039 int d = y + ih - cy2;
executed (the execution status of this line is deduced): int d = y + ih - cy2;
-
1040 ih -= d;
executed (the execution status of this line is deduced): ih -= d;
-
1041 }
executed: }
Execution Count:115
115
1042 if (ih <= 0)
evaluated: ih <= 0
TRUEFALSE
yes
Evaluation Count:112
yes
Evaluation Count:9874
112-9874
1043 return;
executed: return;
Execution Count:112
112
1044 -
1045 // call the blend function... -
1046 int dstSize = rasterBuffer->bytesPerPixel();
executed (the execution status of this line is deduced): int dstSize = rasterBuffer->bytesPerPixel();
-
1047 int dstBPL = rasterBuffer->bytesPerLine();
executed (the execution status of this line is deduced): int dstBPL = rasterBuffer->bytesPerLine();
-
1048 func(rasterBuffer->buffer() + x * dstSize + y * dstBPL, dstBPL,
executed (the execution status of this line is deduced): func(rasterBuffer->buffer() + x * dstSize + y * dstBPL, dstBPL,
-
1049 srcBits, srcBPL,
executed (the execution status of this line is deduced): srcBits, srcBPL,
-
1050 iw, ih,
executed (the execution status of this line is deduced): iw, ih,
-
1051 alpha);
executed (the execution status of this line is deduced): alpha);
-
1052}
executed: }
Execution Count:9874
9874
1053 -
1054 -
1055void QRasterPaintEnginePrivate::systemStateChanged() -
1056{ -
1057 deviceRectUnclipped = QRect(0, 0,
executed (the execution status of this line is deduced): deviceRectUnclipped = QRect(0, 0,
-
1058 qMin(QT_RASTER_COORD_LIMIT, device->width()),
executed (the execution status of this line is deduced): qMin(QT_RASTER_COORD_LIMIT, device->width()),
-
1059 qMin(QT_RASTER_COORD_LIMIT, device->height()));
executed (the execution status of this line is deduced): qMin(QT_RASTER_COORD_LIMIT, device->height()));
-
1060 -
1061 if (!systemClip.isEmpty()) {
evaluated: !systemClip.isEmpty()
TRUEFALSE
yes
Evaluation Count:14829
yes
Evaluation Count:13971
13971-14829
1062 QRegion clippedDeviceRgn = systemClip & deviceRectUnclipped;
executed (the execution status of this line is deduced): QRegion clippedDeviceRgn = systemClip & deviceRectUnclipped;
-
1063 deviceRect = clippedDeviceRgn.boundingRect();
executed (the execution status of this line is deduced): deviceRect = clippedDeviceRgn.boundingRect();
-
1064 baseClip->setClipRegion(clippedDeviceRgn);
executed (the execution status of this line is deduced): baseClip->setClipRegion(clippedDeviceRgn);
-
1065 } else {
executed: }
Execution Count:14829
14829
1066 deviceRect = deviceRectUnclipped;
executed (the execution status of this line is deduced): deviceRect = deviceRectUnclipped;
-
1067 baseClip->setClipRect(deviceRect);
executed (the execution status of this line is deduced): baseClip->setClipRect(deviceRect);
-
1068 }
executed: }
Execution Count:13971
13971
1069#ifdef QT_DEBUG_DRAW -
1070 qDebug() << "systemStateChanged" << this << "deviceRect" << deviceRect << deviceRectUnclipped << systemClip; -
1071#endif -
1072 -
1073 exDeviceRect = deviceRect;
executed (the execution status of this line is deduced): exDeviceRect = deviceRect;
-
1074 -
1075 Q_Q(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEngine * const q = q_func();
-
1076 if (q->state()) {
partially evaluated: q->state()
TRUEFALSE
yes
Evaluation Count:28800
no
Evaluation Count:0
0-28800
1077 q->state()->strokeFlags |= QPaintEngine::DirtyClipRegion;
executed (the execution status of this line is deduced): q->state()->strokeFlags |= QPaintEngine::DirtyClipRegion;
-
1078 q->state()->fillFlags |= QPaintEngine::DirtyClipRegion;
executed (the execution status of this line is deduced): q->state()->fillFlags |= QPaintEngine::DirtyClipRegion;
-
1079 q->state()->pixmapFlags |= QPaintEngine::DirtyClipRegion;
executed (the execution status of this line is deduced): q->state()->pixmapFlags |= QPaintEngine::DirtyClipRegion;
-
1080 }
executed: }
Execution Count:28800
28800
1081}
executed: }
Execution Count:28800
28800
1082 -
1083void QRasterPaintEnginePrivate::updateMatrixData(QSpanData *spanData, const QBrush &b, const QTransform &m) -
1084{ -
1085 if (b.d->style == Qt::NoBrush || b.d->style == Qt::SolidPattern)
evaluated: b.d->style == Qt::NoBrush
TRUEFALSE
yes
Evaluation Count:1154
yes
Evaluation Count:289669
evaluated: b.d->style == Qt::SolidPattern
TRUEFALSE
yes
Evaluation Count:262713
yes
Evaluation Count:26960
1154-289669
1086 return;
executed: return;
Execution Count:263867
263867
1087 -
1088 Q_Q(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEngine * const q = q_func();
-
1089 bool bilinear = q->state()->flags.bilinear;
executed (the execution status of this line is deduced): bool bilinear = q->state()->flags.bilinear;
-
1090 -
1091 if (b.d->transform.type() > QTransform::TxNone) { // FALCON: optimize
evaluated: b.d->transform.type() > QTransform::TxNone
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:26956
3-26956
1092 spanData->setupMatrix(b.transform() * m, bilinear);
executed (the execution status of this line is deduced): spanData->setupMatrix(b.transform() * m, bilinear);
-
1093 } else {
executed: }
Execution Count:3
3
1094 if (m.type() <= QTransform::TxTranslate) {
evaluated: m.type() <= QTransform::TxTranslate
TRUEFALSE
yes
Evaluation Count:26946
yes
Evaluation Count:4
4-26946
1095 // specialize setupMatrix for translation matrices -
1096 // to avoid needless matrix inversion -
1097 spanData->m11 = 1;
executed (the execution status of this line is deduced): spanData->m11 = 1;
-
1098 spanData->m12 = 0;
executed (the execution status of this line is deduced): spanData->m12 = 0;
-
1099 spanData->m13 = 0;
executed (the execution status of this line is deduced): spanData->m13 = 0;
-
1100 spanData->m21 = 0;
executed (the execution status of this line is deduced): spanData->m21 = 0;
-
1101 spanData->m22 = 1;
executed (the execution status of this line is deduced): spanData->m22 = 1;
-
1102 spanData->m23 = 0;
executed (the execution status of this line is deduced): spanData->m23 = 0;
-
1103 spanData->m33 = 1;
executed (the execution status of this line is deduced): spanData->m33 = 1;
-
1104 spanData->dx = -m.dx();
executed (the execution status of this line is deduced): spanData->dx = -m.dx();
-
1105 spanData->dy = -m.dy();
executed (the execution status of this line is deduced): spanData->dy = -m.dy();
-
1106 spanData->txop = m.type();
executed (the execution status of this line is deduced): spanData->txop = m.type();
-
1107 spanData->bilinear = bilinear;
executed (the execution status of this line is deduced): spanData->bilinear = bilinear;
-
1108 spanData->fast_matrix = qAbs(m.dx()) < 1e4 && qAbs(m.dy()) < 1e4;
partially evaluated: qAbs(m.dx()) < 1e4
TRUEFALSE
yes
Evaluation Count:26947
no
Evaluation Count:0
partially evaluated: qAbs(m.dy()) < 1e4
TRUEFALSE
yes
Evaluation Count:26948
no
Evaluation Count:0
0-26948
1109 spanData->adjustSpanMethods();
executed (the execution status of this line is deduced): spanData->adjustSpanMethods();
-
1110 } else {
executed: }
Execution Count:26937
26937
1111 spanData->setupMatrix(m, bilinear);
executed (the execution status of this line is deduced): spanData->setupMatrix(m, bilinear);
-
1112 }
executed: }
Execution Count:4
4
1113 } -
1114} -
1115 -
1116// #define QT_CLIPPING_RATIOS -
1117 -
1118#ifdef QT_CLIPPING_RATIOS -
1119int rectClips; -
1120int regionClips; -
1121int totalClips; -
1122 -
1123static void checkClipRatios(QRasterPaintEnginePrivate *d) -
1124{ -
1125 if (d->clip()->hasRectClip) -
1126 rectClips++; -
1127 if (d->clip()->hasRegionClip) -
1128 regionClips++; -
1129 totalClips++; -
1130 -
1131 if ((totalClips % 5000) == 0) { -
1132 printf("Clipping ratio: rectangular=%f%%, region=%f%%, complex=%f%%\n", -
1133 rectClips * 100.0 / (qreal) totalClips, -
1134 regionClips * 100.0 / (qreal) totalClips, -
1135 (totalClips - rectClips - regionClips) * 100.0 / (qreal) totalClips); -
1136 totalClips = 0; -
1137 rectClips = 0; -
1138 regionClips = 0; -
1139 } -
1140 -
1141} -
1142#endif -
1143 -
1144static void qrasterpaintengine_state_setNoClip(QRasterPaintEngineState *s) -
1145{ -
1146 if (s->flags.has_clip_ownership)
never evaluated: s->flags.has_clip_ownership
0
1147 delete s->clip;
never executed: delete s->clip;
0
1148 s->clip = 0;
never executed (the execution status of this line is deduced): s->clip = 0;
-
1149 s->flags.has_clip_ownership = false;
never executed (the execution status of this line is deduced): s->flags.has_clip_ownership = false;
-
1150}
never executed: }
0
1151 -
1152static void qrasterpaintengine_dirty_clip(QRasterPaintEnginePrivate *d, QRasterPaintEngineState *s) -
1153{ -
1154 s->fillFlags |= QPaintEngine::DirtyClipPath;
executed (the execution status of this line is deduced): s->fillFlags |= QPaintEngine::DirtyClipPath;
-
1155 s->strokeFlags |= QPaintEngine::DirtyClipPath;
executed (the execution status of this line is deduced): s->strokeFlags |= QPaintEngine::DirtyClipPath;
-
1156 s->pixmapFlags |= QPaintEngine::DirtyClipPath;
executed (the execution status of this line is deduced): s->pixmapFlags |= QPaintEngine::DirtyClipPath;
-
1157 -
1158 d->solid_color_filler.clip = d->clip();
executed (the execution status of this line is deduced): d->solid_color_filler.clip = d->clip();
-
1159 d->solid_color_filler.adjustSpanMethods();
executed (the execution status of this line is deduced): d->solid_color_filler.adjustSpanMethods();
-
1160 -
1161#ifdef QT_DEBUG_DRAW -
1162 dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), &*d->clip()); -
1163#endif -
1164 -
1165}
executed: }
Execution Count:25052
25052
1166 -
1167 -
1168/*! -
1169 \internal -
1170*/ -
1171void QRasterPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) -
1172{ -
1173#ifdef QT_DEBUG_DRAW -
1174 qDebug() << "QRasterPaintEngine::clip(): " << path << op; -
1175 -
1176 if (path.elements()) { -
1177 for (int i=0; i<path.elementCount(); ++i) { -
1178 qDebug() << " - " << path.elements()[i] -
1179 << '(' << path.points()[i*2] << ", " << path.points()[i*2+1] << ')'; -
1180 } -
1181 } else { -
1182 for (int i=0; i<path.elementCount(); ++i) { -
1183 qDebug() << " ---- " -
1184 << '(' << path.points()[i*2] << ", " << path.points()[i*2+1] << ')'; -
1185 } -
1186 } -
1187#endif -
1188 -
1189 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
1190 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
1191 -
1192 const qreal *points = path.points();
executed (the execution status of this line is deduced): const qreal *points = path.points();
-
1193 const QPainterPath::ElementType *types = path.elements();
executed (the execution status of this line is deduced): const QPainterPath::ElementType *types = path.elements();
-
1194 -
1195 // There are some cases that are not supported by clip(QRect) -
1196 if (op != Qt::IntersectClip || !s->clip || s->clip->hasRectClip || s->clip->hasRegionClip) {
evaluated: op != Qt::IntersectClip
TRUEFALSE
yes
Evaluation Count:244
yes
Evaluation Count:810
evaluated: !s->clip
TRUEFALSE
yes
Evaluation Count:306
yes
Evaluation Count:504
evaluated: s->clip->hasRectClip
TRUEFALSE
yes
Evaluation Count:119
yes
Evaluation Count:385
evaluated: s->clip->hasRegionClip
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:377
8-810
1197 if (s->matrix.type() <= QTransform::TxScale
evaluated: s->matrix.type() <= QTransform::TxScale
TRUEFALSE
yes
Evaluation Count:561
yes
Evaluation Count:116
116-561
1198 && ((path.shape() == QVectorPath::RectangleHint)
evaluated: (path.shape() == QVectorPath::RectangleHint)
TRUEFALSE
yes
Evaluation Count:243
yes
Evaluation Count:318
243-318
1199 || (isRect(points, path.elementCount())
evaluated: isRect(points, path.elementCount())
TRUEFALSE
yes
Evaluation Count:225
yes
Evaluation Count:93
93-225
1200 && (!types || (types[0] == QPainterPath::MoveToElement
partially evaluated: !types
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:225
partially evaluated: types[0] == QPainterPath::MoveToElement
TRUEFALSE
yes
Evaluation Count:225
no
Evaluation Count:0
0-225
1201 && types[1] == QPainterPath::LineToElement
partially evaluated: types[1] == QPainterPath::LineToElement
TRUEFALSE
yes
Evaluation Count:225
no
Evaluation Count:0
0-225
1202 && types[2] == QPainterPath::LineToElement
partially evaluated: types[2] == QPainterPath::LineToElement
TRUEFALSE
yes
Evaluation Count:225
no
Evaluation Count:0
0-225
1203 && types[3] == QPainterPath::LineToElement))))) {
partially evaluated: types[3] == QPainterPath::LineToElement
TRUEFALSE
yes
Evaluation Count:225
no
Evaluation Count:0
0-225
1204#ifdef QT_DEBUG_DRAW -
1205 qDebug() << " --- optimizing vector clip to rect clip..."; -
1206#endif -
1207 -
1208 QRectF r(points[0], points[1], points[4]-points[0], points[5]-points[1]);
executed (the execution status of this line is deduced): QRectF r(points[0], points[1], points[4]-points[0], points[5]-points[1]);
-
1209 if (setClipRectInDeviceCoords(s->matrix.mapRect(r).toRect(), op))
partially evaluated: setClipRectInDeviceCoords(s->matrix.mapRect(r).toRect(), op)
TRUEFALSE
yes
Evaluation Count:468
no
Evaluation Count:0
0-468
1210 return;
executed: return;
Execution Count:468
468
1211 }
never executed: }
0
1212 }
executed: }
Execution Count:209
209
1213 -
1214 if (op == Qt::NoClip) {
partially evaluated: op == Qt::NoClip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:586
0-586
1215 qrasterpaintengine_state_setNoClip(s);
never executed (the execution status of this line is deduced): qrasterpaintengine_state_setNoClip(s);
-
1216 -
1217 } else {
never executed: }
0
1218 QClipData *base = d->baseClip.data();
executed (the execution status of this line is deduced): QClipData *base = d->baseClip.data();
-
1219 -
1220 // Intersect with current clip when available... -
1221 if (op == Qt::IntersectClip && s->clip)
evaluated: op == Qt::IntersectClip
TRUEFALSE
yes
Evaluation Count:543
yes
Evaluation Count:43
evaluated: s->clip
TRUEFALSE
yes
Evaluation Count:437
yes
Evaluation Count:106
43-543
1222 base = s->clip;
executed: base = s->clip;
Execution Count:437
437
1223 -
1224 // We always intersect, except when there is nothing to -
1225 // intersect with, in which case we simplify the operation to -
1226 // a replace... -
1227 Qt::ClipOperation isectOp = Qt::IntersectClip;
executed (the execution status of this line is deduced): Qt::ClipOperation isectOp = Qt::IntersectClip;
-
1228 if (base == 0)
partially evaluated: base == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:586
0-586
1229 isectOp = Qt::ReplaceClip;
never executed: isectOp = Qt::ReplaceClip;
0
1230 -
1231 QClipData *newClip = new QClipData(d->rasterBuffer->height());
executed (the execution status of this line is deduced): QClipData *newClip = new QClipData(d->rasterBuffer->height());
-
1232 newClip->initialize();
executed (the execution status of this line is deduced): newClip->initialize();
-
1233 ClipData clipData = { base, newClip, isectOp };
executed (the execution status of this line is deduced): ClipData clipData = { base, newClip, isectOp };
-
1234 ensureOutlineMapper();
executed (the execution status of this line is deduced): ensureOutlineMapper();
-
1235 d->rasterize(d->outlineMapper->convertPath(path), qt_span_clip, &clipData, 0);
executed (the execution status of this line is deduced): d->rasterize(d->outlineMapper->convertPath(path), qt_span_clip, &clipData, 0);
-
1236 -
1237 newClip->fixup();
executed (the execution status of this line is deduced): newClip->fixup();
-
1238 -
1239 if (s->flags.has_clip_ownership)
evaluated: s->flags.has_clip_ownership
TRUEFALSE
yes
Evaluation Count:384
yes
Evaluation Count:202
202-384
1240 delete s->clip;
executed: delete s->clip;
Execution Count:384
384
1241 -
1242 s->clip = newClip;
executed (the execution status of this line is deduced): s->clip = newClip;
-
1243 s->flags.has_clip_ownership = true;
executed (the execution status of this line is deduced): s->flags.has_clip_ownership = true;
-
1244 }
executed: }
Execution Count:586
586
1245 qrasterpaintengine_dirty_clip(d, s);
executed (the execution status of this line is deduced): qrasterpaintengine_dirty_clip(d, s);
-
1246}
executed: }
Execution Count:586
586
1247 -
1248 -
1249 -
1250/*! -
1251 \internal -
1252*/ -
1253void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) -
1254{ -
1255#ifdef QT_DEBUG_DRAW -
1256 qDebug() << "QRasterPaintEngine::clip(): " << rect << op; -
1257#endif -
1258 -
1259 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
1260 -
1261 if (op == Qt::NoClip) {
partially evaluated: op == Qt::NoClip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:22084
0-22084
1262 qrasterpaintengine_state_setNoClip(s);
never executed (the execution status of this line is deduced): qrasterpaintengine_state_setNoClip(s);
-
1263 -
1264 } else if (s->matrix.type() > QTransform::TxScale) {
never executed: }
evaluated: s->matrix.type() > QTransform::TxScale
TRUEFALSE
yes
Evaluation Count:359
yes
Evaluation Count:21725
0-21725
1265 QPaintEngineEx::clip(rect, op);
executed (the execution status of this line is deduced): QPaintEngineEx::clip(rect, op);
-
1266 return;
executed: return;
Execution Count:359
359
1267 -
1268 } else if (!setClipRectInDeviceCoords(s->matrix.mapRect(rect), op)) {
evaluated: !setClipRectInDeviceCoords(s->matrix.mapRect(rect), op)
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:21723
2-21723
1269 QPaintEngineEx::clip(rect, op);
executed (the execution status of this line is deduced): QPaintEngineEx::clip(rect, op);
-
1270 return;
executed: return;
Execution Count:2
2
1271 } -
1272} -
1273 -
1274 -
1275bool QRasterPaintEngine::setClipRectInDeviceCoords(const QRect &r, Qt::ClipOperation op) -
1276{ -
1277 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
1278 QRect clipRect = r & d->deviceRect;
executed (the execution status of this line is deduced): QRect clipRect = r & d->deviceRect;
-
1279 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
1280 -
1281 if (op == Qt::ReplaceClip || s->clip == 0) {
evaluated: op == Qt::ReplaceClip
TRUEFALSE
yes
Evaluation Count:21918
yes
Evaluation Count:275
evaluated: s->clip == 0
TRUEFALSE
yes
Evaluation Count:201
yes
Evaluation Count:74
74-21918
1282 -
1283 // No current clip, hence we intersect with sysclip and be -
1284 // done with it... -
1285 QRegion clipRegion = systemClip();
executed (the execution status of this line is deduced): QRegion clipRegion = systemClip();
-
1286 QClipData *clip = new QClipData(d->rasterBuffer->height());
executed (the execution status of this line is deduced): QClipData *clip = new QClipData(d->rasterBuffer->height());
-
1287 -
1288 if (clipRegion.isEmpty())
evaluated: clipRegion.isEmpty()
TRUEFALSE
yes
Evaluation Count:1338
yes
Evaluation Count:20781
1338-20781
1289 clip->setClipRect(clipRect);
executed: clip->setClipRect(clipRect);
Execution Count:1338
1338
1290 else -
1291 clip->setClipRegion(clipRegion & clipRect);
executed: clip->setClipRegion(clipRegion & clipRect);
Execution Count:20781
20781
1292 -
1293 if (s->flags.has_clip_ownership)
evaluated: s->flags.has_clip_ownership
TRUEFALSE
yes
Evaluation Count:92
yes
Evaluation Count:22027
92-22027
1294 delete s->clip;
executed: delete s->clip;
Execution Count:92
92
1295 -
1296 s->clip = clip;
executed (the execution status of this line is deduced): s->clip = clip;
-
1297 s->clip->enabled = true;
executed (the execution status of this line is deduced): s->clip->enabled = true;
-
1298 s->flags.has_clip_ownership = true;
executed (the execution status of this line is deduced): s->flags.has_clip_ownership = true;
-
1299 -
1300 } else if (op == Qt::IntersectClip){ // intersect clip with current clip
executed: }
Execution Count:22119
partially evaluated: op == Qt::IntersectClip
TRUEFALSE
yes
Evaluation Count:74
no
Evaluation Count:0
0-22119
1301 QClipData *base = s->clip;
executed (the execution status of this line is deduced): QClipData *base = s->clip;
-
1302 -
1303 Q_ASSERT(base);
executed (the execution status of this line is deduced): qt_noop();
-
1304 if (base->hasRectClip || base->hasRegionClip) {
evaluated: base->hasRectClip
TRUEFALSE
yes
Evaluation Count:72
yes
Evaluation Count:2
partially evaluated: base->hasRegionClip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-72
1305 if (!s->flags.has_clip_ownership) {
evaluated: !s->flags.has_clip_ownership
TRUEFALSE
yes
Evaluation Count:62
yes
Evaluation Count:10
10-62
1306 s->clip = new QClipData(d->rasterBuffer->height());
executed (the execution status of this line is deduced): s->clip = new QClipData(d->rasterBuffer->height());
-
1307 s->flags.has_clip_ownership = true;
executed (the execution status of this line is deduced): s->flags.has_clip_ownership = true;
-
1308 }
executed: }
Execution Count:62
62
1309 if (base->hasRectClip)
partially evaluated: base->hasRectClip
TRUEFALSE
yes
Evaluation Count:72
no
Evaluation Count:0
0-72
1310 s->clip->setClipRect(base->clipRect & clipRect);
executed: s->clip->setClipRect(base->clipRect & clipRect);
Execution Count:72
72
1311 else -
1312 s->clip->setClipRegion(base->clipRegion & clipRect);
never executed: s->clip->setClipRegion(base->clipRegion & clipRect);
0
1313 s->clip->enabled = true;
executed (the execution status of this line is deduced): s->clip->enabled = true;
-
1314 } else {
executed: }
Execution Count:72
72
1315 return false;
executed: return false;
Execution Count:2
2
1316 } -
1317 } else { -
1318 return false;
never executed: return false;
0
1319 } -
1320 -
1321 qrasterpaintengine_dirty_clip(d, s);
executed (the execution status of this line is deduced): qrasterpaintengine_dirty_clip(d, s);
-
1322 return true;
executed: return true;
Execution Count:22191
22191
1323} -
1324 -
1325 -
1326/*! -
1327 \internal -
1328*/ -
1329void QRasterPaintEngine::clip(const QRegion &region, Qt::ClipOperation op) -
1330{ -
1331#ifdef QT_DEBUG_DRAW -
1332 qDebug() << "QRasterPaintEngine::clip(): " << region << op; -
1333#endif -
1334 -
1335 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
1336 -
1337 if (region.rectCount() == 1) {
evaluated: region.rectCount() == 1
TRUEFALSE
yes
Evaluation Count:154
yes
Evaluation Count:2291
154-2291
1338 clip(region.boundingRect(), op);
executed (the execution status of this line is deduced): clip(region.boundingRect(), op);
-
1339 return;
executed: return;
Execution Count:154
154
1340 } -
1341 -
1342 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
1343 const QClipData *clip = d->clip();
executed (the execution status of this line is deduced): const QClipData *clip = d->clip();
-
1344 const QClipData *baseClip = d->baseClip.data();
executed (the execution status of this line is deduced): const QClipData *baseClip = d->baseClip.data();
-
1345 -
1346 if (op == Qt::NoClip) {
partially evaluated: op == Qt::NoClip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2291
0-2291
1347 qrasterpaintengine_state_setNoClip(s);
never executed (the execution status of this line is deduced): qrasterpaintengine_state_setNoClip(s);
-
1348 } else if (s->matrix.type() > QTransform::TxScale
never executed: }
evaluated: s->matrix.type() > QTransform::TxScale
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:2283
0-2283
1349 || (op == Qt::IntersectClip && !clip->hasRectClip && !clip->hasRegionClip)
evaluated: op == Qt::IntersectClip
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:2265
evaluated: !clip->hasRectClip
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:1
evaluated: !clip->hasRegionClip
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:9
1-2265
1350 || (op == Qt::ReplaceClip && !baseClip->hasRectClip && !baseClip->hasRegionClip)) {
evaluated: op == Qt::ReplaceClip
TRUEFALSE
yes
Evaluation Count:2265
yes
Evaluation Count:10
evaluated: !baseClip->hasRectClip
TRUEFALSE
yes
Evaluation Count:261
yes
Evaluation Count:2004
partially evaluated: !baseClip->hasRegionClip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:261
0-2265
1351 QPaintEngineEx::clip(region, op);
executed (the execution status of this line is deduced): QPaintEngineEx::clip(region, op);
-
1352 } else {
executed: }
Execution Count:16
16
1353 const QClipData *curClip;
executed (the execution status of this line is deduced): const QClipData *curClip;
-
1354 QClipData *newClip;
executed (the execution status of this line is deduced): QClipData *newClip;
-
1355 -
1356 if (op == Qt::IntersectClip)
evaluated: op == Qt::IntersectClip
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:2265
10-2265
1357 curClip = clip;
executed: curClip = clip;
Execution Count:10
10
1358 else -
1359 curClip = baseClip;
executed: curClip = baseClip;
Execution Count:2265
2265
1360 -
1361 if (s->flags.has_clip_ownership) {
evaluated: s->flags.has_clip_ownership
TRUEFALSE
yes
Evaluation Count:2203
yes
Evaluation Count:72
72-2203
1362 newClip = s->clip;
executed (the execution status of this line is deduced): newClip = s->clip;
-
1363 Q_ASSERT(newClip);
executed (the execution status of this line is deduced): qt_noop();
-
1364 } else {
executed: }
Execution Count:2203
2203
1365 newClip = new QClipData(d->rasterBuffer->height());
executed (the execution status of this line is deduced): newClip = new QClipData(d->rasterBuffer->height());
-
1366 s->clip = newClip;
executed (the execution status of this line is deduced): s->clip = newClip;
-
1367 s->flags.has_clip_ownership = true;
executed (the execution status of this line is deduced): s->flags.has_clip_ownership = true;
-
1368 }
executed: }
Execution Count:72
72
1369 -
1370 QRegion r = s->matrix.map(region);
executed (the execution status of this line is deduced): QRegion r = s->matrix.map(region);
-
1371 if (curClip->hasRectClip)
evaluated: curClip->hasRectClip
TRUEFALSE
yes
Evaluation Count:2005
yes
Evaluation Count:270
270-2005
1372 newClip->setClipRegion(r & curClip->clipRect);
executed: newClip->setClipRegion(r & curClip->clipRect);
Execution Count:2005
2005
1373 else if (curClip->hasRegionClip)
partially evaluated: curClip->hasRegionClip
TRUEFALSE
yes
Evaluation Count:270
no
Evaluation Count:0
0-270
1374 newClip->setClipRegion(r & curClip->clipRegion);
executed: newClip->setClipRegion(r & curClip->clipRegion);
Execution Count:270
270
1375 -
1376 qrasterpaintengine_dirty_clip(d, s);
executed (the execution status of this line is deduced): qrasterpaintengine_dirty_clip(d, s);
-
1377 }
executed: }
Execution Count:2275
2275
1378} -
1379 -
1380/*! -
1381 \fn const QClipData *QRasterPaintEngine::clipData() const -
1382 -
1383 \internal -
1384*/ -
1385 -
1386 -
1387/*! -
1388 \internal -
1389*/ -
1390void QRasterPaintEngine::fillPath(const QPainterPath &path, QSpanData *fillData) -
1391{ -
1392#ifdef QT_DEBUG_DRAW -
1393 qDebug() << " --- fillPath, bounds=" << path.boundingRect(); -
1394#endif -
1395 -
1396 if (!fillData->blend)
partially evaluated: !fillData->blend
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
1397 return;
never executed: return;
0
1398 -
1399 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
1400 -
1401 const QRectF controlPointRect = path.controlPointRect();
executed (the execution status of this line is deduced): const QRectF controlPointRect = path.controlPointRect();
-
1402 -
1403 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
1404 const QRect deviceRect = s->matrix.mapRect(controlPointRect).toRect();
executed (the execution status of this line is deduced): const QRect deviceRect = s->matrix.mapRect(controlPointRect).toRect();
-
1405 ProcessSpans blend = d->getBrushFunc(deviceRect, fillData);
executed (the execution status of this line is deduced): ProcessSpans blend = d->getBrushFunc(deviceRect, fillData);
-
1406 const bool do_clip = (deviceRect.left() < -QT_RASTER_COORD_LIMIT
partially evaluated: deviceRect.left() < -QT_RASTER_COORD_LIMIT
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
1407 || deviceRect.right() > QT_RASTER_COORD_LIMIT
partially evaluated: deviceRect.right() > QT_RASTER_COORD_LIMIT
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
1408 || deviceRect.top() < -QT_RASTER_COORD_LIMIT
partially evaluated: deviceRect.top() < -QT_RASTER_COORD_LIMIT
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
1409 || deviceRect.bottom() > QT_RASTER_COORD_LIMIT);
partially evaluated: deviceRect.bottom() > QT_RASTER_COORD_LIMIT
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
1410 -
1411 if (!s->flags.antialiased && !do_clip) {
evaluated: !s->flags.antialiased
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:4
partially evaluated: !do_clip
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-4
1412 d->initializeRasterizer(fillData);
executed (the execution status of this line is deduced): d->initializeRasterizer(fillData);
-
1413 d->rasterizer->rasterize(path * s->matrix, path.fillRule());
executed (the execution status of this line is deduced): d->rasterizer->rasterize(path * s->matrix, path.fillRule());
-
1414 return;
executed: return;
Execution Count:1
1
1415 } -
1416 -
1417 ensureOutlineMapper();
executed (the execution status of this line is deduced): ensureOutlineMapper();
-
1418 d->rasterize(d->outlineMapper->convertPath(path), blend, fillData, d->rasterBuffer.data());
executed (the execution status of this line is deduced): d->rasterize(d->outlineMapper->convertPath(path), blend, fillData, d->rasterBuffer.data());
-
1419}
executed: }
Execution Count:4
4
1420 -
1421static void fillRect_normalized(const QRect &r, QSpanData *data, -
1422 QRasterPaintEnginePrivate *pe) -
1423{ -
1424 int x1, x2, y1, y2;
never executed (the execution status of this line is deduced): int x1, x2, y1, y2;
-
1425 -
1426 bool rectClipped = true;
never executed (the execution status of this line is deduced): bool rectClipped = true;
-
1427 -
1428 if (data->clip) {
partially evaluated: data->clip
TRUEFALSE
yes
Evaluation Count:80581
no
Evaluation Count:0
0-80581
1429 x1 = qMax(r.x(), data->clip->xmin);
executed (the execution status of this line is deduced): x1 = qMax(r.x(), data->clip->xmin);
-
1430 x2 = qMin(r.x() + r.width(), data->clip->xmax);
executed (the execution status of this line is deduced): x2 = qMin(r.x() + r.width(), data->clip->xmax);
-
1431 y1 = qMax(r.y(), data->clip->ymin);
executed (the execution status of this line is deduced): y1 = qMax(r.y(), data->clip->ymin);
-
1432 y2 = qMin(r.y() + r.height(), data->clip->ymax);
executed (the execution status of this line is deduced): y2 = qMin(r.y() + r.height(), data->clip->ymax);
-
1433 rectClipped = data->clip->hasRectClip;
executed (the execution status of this line is deduced): rectClipped = data->clip->hasRectClip;
-
1434 -
1435 } else if (pe) {
executed: }
Execution Count:80581
never evaluated: pe
0-80581
1436 x1 = qMax(r.x(), pe->deviceRect.x());
never executed (the execution status of this line is deduced): x1 = qMax(r.x(), pe->deviceRect.x());
-
1437 x2 = qMin(r.x() + r.width(), pe->deviceRect.x() + pe->deviceRect.width());
never executed (the execution status of this line is deduced): x2 = qMin(r.x() + r.width(), pe->deviceRect.x() + pe->deviceRect.width());
-
1438 y1 = qMax(r.y(), pe->deviceRect.y());
never executed (the execution status of this line is deduced): y1 = qMax(r.y(), pe->deviceRect.y());
-
1439 y2 = qMin(r.y() + r.height(), pe->deviceRect.y() + pe->deviceRect.height());
never executed (the execution status of this line is deduced): y2 = qMin(r.y() + r.height(), pe->deviceRect.y() + pe->deviceRect.height());
-
1440 } else {
never executed: }
0
1441 x1 = qMax(r.x(), 0);
never executed (the execution status of this line is deduced): x1 = qMax(r.x(), 0);
-
1442 x2 = qMin(r.x() + r.width(), data->rasterBuffer->width());
never executed (the execution status of this line is deduced): x2 = qMin(r.x() + r.width(), data->rasterBuffer->width());
-
1443 y1 = qMax(r.y(), 0);
never executed (the execution status of this line is deduced): y1 = qMax(r.y(), 0);
-
1444 y2 = qMin(r.y() + r.height(), data->rasterBuffer->height());
never executed (the execution status of this line is deduced): y2 = qMin(r.y() + r.height(), data->rasterBuffer->height());
-
1445 }
never executed: }
0
1446 -
1447 if (x2 <= x1 || y2 <= y1)
evaluated: x2 <= x1
TRUEFALSE
yes
Evaluation Count:525
yes
Evaluation Count:80056
evaluated: y2 <= y1
TRUEFALSE
yes
Evaluation Count:355
yes
Evaluation Count:79703
355-80056
1448 return;
executed: return;
Execution Count:880
880
1449 -
1450 const int width = x2 - x1;
executed (the execution status of this line is deduced): const int width = x2 - x1;
-
1451 const int height = y2 - y1;
executed (the execution status of this line is deduced): const int height = y2 - y1;
-
1452 -
1453 bool isUnclipped = rectClipped
evaluated: rectClipped
TRUEFALSE
yes
Evaluation Count:78035
yes
Evaluation Count:1669
1669-78035
1454 || (pe && pe->isUnclipped_normalized(QRect(x1, y1, width, height)));
partially evaluated: pe
TRUEFALSE
yes
Evaluation Count:1669
no
Evaluation Count:0
evaluated: pe->isUnclipped_normalized(QRect(x1, y1, width, height))
TRUEFALSE
yes
Evaluation Count:442
yes
Evaluation Count:1227
0-1669
1455 -
1456 if (pe && isUnclipped) {
partially evaluated: pe
TRUEFALSE
yes
Evaluation Count:79704
no
Evaluation Count:0
evaluated: isUnclipped
TRUEFALSE
yes
Evaluation Count:78476
yes
Evaluation Count:1227
0-79704
1457 const QPainter::CompositionMode mode = pe->rasterBuffer->compositionMode;
executed (the execution status of this line is deduced): const QPainter::CompositionMode mode = pe->rasterBuffer->compositionMode;
-
1458 -
1459 if (data->fillRect && (mode == QPainter::CompositionMode_Source
evaluated: data->fillRect
TRUEFALSE
yes
Evaluation Count:41168
yes
Evaluation Count:37309
evaluated: mode == QPainter::CompositionMode_Source
TRUEFALSE
yes
Evaluation Count:9021
yes
Evaluation Count:32147
9021-41168
1460 || (mode == QPainter::CompositionMode_SourceOver
evaluated: mode == QPainter::CompositionMode_SourceOver
TRUEFALSE
yes
Evaluation Count:32034
yes
Evaluation Count:113
113-32034
1461 && qAlpha(data->solid.color) == 255)))
evaluated: qAlpha(data->solid.color) == 255
TRUEFALSE
yes
Evaluation Count:32008
yes
Evaluation Count:26
26-32008
1462 { -
1463 data->fillRect(data->rasterBuffer, x1, y1, width, height,
executed (the execution status of this line is deduced): data->fillRect(data->rasterBuffer, x1, y1, width, height,
-
1464 data->solid.color);
executed (the execution status of this line is deduced): data->solid.color);
-
1465 return;
executed: return;
Execution Count:41029
41029
1466 } -
1467 }
executed: }
Execution Count:37444
37444
1468 -
1469 ProcessSpans blend = isUnclipped ? data->unclipped_blend : data->blend;
evaluated: isUnclipped
TRUEFALSE
yes
Evaluation Count:37444
yes
Evaluation Count:1227
1227-37444
1470 -
1471 const int nspans = 256;
executed (the execution status of this line is deduced): const int nspans = 256;
-
1472 QT_FT_Span spans[nspans];
executed (the execution status of this line is deduced): QT_FT_Span spans[nspans];
-
1473 -
1474 Q_ASSERT(data->blend);
executed (the execution status of this line is deduced): qt_noop();
-
1475 int y = y1;
executed (the execution status of this line is deduced): int y = y1;
-
1476 while (y < y2) {
evaluated: y < y2
TRUEFALSE
yes
Evaluation Count:38708
yes
Evaluation Count:38665
38665-38708
1477 int n = qMin(nspans, y2 - y);
executed (the execution status of this line is deduced): int n = qMin(nspans, y2 - y);
-
1478 int i = 0;
executed (the execution status of this line is deduced): int i = 0;
-
1479 while (i < n) {
evaluated: i < n
TRUEFALSE
yes
Evaluation Count:632253
yes
Evaluation Count:38709
38709-632253
1480 spans[i].x = x1;
executed (the execution status of this line is deduced): spans[i].x = x1;
-
1481 spans[i].len = width;
executed (the execution status of this line is deduced): spans[i].len = width;
-
1482 spans[i].y = y + i;
executed (the execution status of this line is deduced): spans[i].y = y + i;
-
1483 spans[i].coverage = 255;
executed (the execution status of this line is deduced): spans[i].coverage = 255;
-
1484 ++i;
executed (the execution status of this line is deduced): ++i;
-
1485 }
executed: }
Execution Count:632255
632255
1486 -
1487 blend(n, spans, data);
executed (the execution status of this line is deduced): blend(n, spans, data);
-
1488 y += n;
executed (the execution status of this line is deduced): y += n;
-
1489 }
executed: }
Execution Count:38703
38703
1490}
executed: }
Execution Count:38666
38666
1491 -
1492/*! -
1493 \reimp -
1494*/ -
1495void QRasterPaintEngine::drawRects(const QRect *rects, int rectCount) -
1496{ -
1497#ifdef QT_DEBUG_DRAW -
1498 qDebug(" - QRasterPaintEngine::drawRect(), rectCount=%d", rectCount); -
1499#endif -
1500 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
1501 ensureRasterState();
executed (the execution status of this line is deduced): ensureRasterState();
-
1502 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
1503 -
1504 // Fill -
1505 ensureBrush();
executed (the execution status of this line is deduced): ensureBrush();
-
1506 if (s->brushData.blend) {
evaluated: s->brushData.blend
TRUEFALSE
yes
Evaluation Count:6418
yes
Evaluation Count:2013
2013-6418
1507 if (!s->flags.antialiased && s->matrix.type() <= QTransform::TxTranslate) {
evaluated: !s->flags.antialiased
TRUEFALSE
yes
Evaluation Count:6408
yes
Evaluation Count:10
evaluated: s->matrix.type() <= QTransform::TxTranslate
TRUEFALSE
yes
Evaluation Count:6405
yes
Evaluation Count:3
3-6408
1508 const QRect *r = rects;
executed (the execution status of this line is deduced): const QRect *r = rects;
-
1509 const QRect *lastRect = rects + rectCount;
executed (the execution status of this line is deduced): const QRect *lastRect = rects + rectCount;
-
1510 -
1511 int offset_x = int(s->matrix.dx());
executed (the execution status of this line is deduced): int offset_x = int(s->matrix.dx());
-
1512 int offset_y = int(s->matrix.dy());
executed (the execution status of this line is deduced): int offset_y = int(s->matrix.dy());
-
1513 while (r < lastRect) {
evaluated: r < lastRect
TRUEFALSE
yes
Evaluation Count:6405
yes
Evaluation Count:6405
6405
1514 QRect rect = r->normalized();
executed (the execution status of this line is deduced): QRect rect = r->normalized();
-
1515 QRect rr = rect.translated(offset_x, offset_y);
executed (the execution status of this line is deduced): QRect rr = rect.translated(offset_x, offset_y);
-
1516 fillRect_normalized(rr, &s->brushData, d);
executed (the execution status of this line is deduced): fillRect_normalized(rr, &s->brushData, d);
-
1517 ++r;
executed (the execution status of this line is deduced): ++r;
-
1518 }
executed: }
Execution Count:6405
6405
1519 } else {
executed: }
Execution Count:6405
6405
1520 QRectVectorPath path;
executed (the execution status of this line is deduced): QRectVectorPath path;
-
1521 for (int i=0; i<rectCount; ++i) {
evaluated: i<rectCount
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:13
13
1522 path.set(rects[i]);
executed (the execution status of this line is deduced): path.set(rects[i]);
-
1523 fill(path, s->brush);
executed (the execution status of this line is deduced): fill(path, s->brush);
-
1524 }
executed: }
Execution Count:13
13
1525 }
executed: }
Execution Count:13
13
1526 } -
1527 -
1528 ensurePen();
executed (the execution status of this line is deduced): ensurePen();
-
1529 if (s->penData.blend) {
evaluated: s->penData.blend
TRUEFALSE
yes
Evaluation Count:2384
yes
Evaluation Count:6047
2384-6047
1530 QRectVectorPath path;
executed (the execution status of this line is deduced): QRectVectorPath path;
-
1531 if (s->flags.fast_pen) {
evaluated: s->flags.fast_pen
TRUEFALSE
yes
Evaluation Count:2378
yes
Evaluation Count:6
6-2378
1532 QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
-
1533 stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
-
1534 for (int i = 0; i < rectCount; ++i) {
evaluated: i < rectCount
TRUEFALSE
yes
Evaluation Count:2378
yes
Evaluation Count:2378
2378
1535 path.set(rects[i]);
executed (the execution status of this line is deduced): path.set(rects[i]);
-
1536 stroker.drawPath(path);
executed (the execution status of this line is deduced): stroker.drawPath(path);
-
1537 }
executed: }
Execution Count:2378
2378
1538 } else {
executed: }
Execution Count:2378
2378
1539 for (int i = 0; i < rectCount; ++i) {
evaluated: i < rectCount
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:6
6
1540 path.set(rects[i]);
executed (the execution status of this line is deduced): path.set(rects[i]);
-
1541 stroke(path, s->pen);
executed (the execution status of this line is deduced): stroke(path, s->pen);
-
1542 }
executed: }
Execution Count:6
6
1543 }
executed: }
Execution Count:6
6
1544 } -
1545}
executed: }
Execution Count:8431
8431
1546 -
1547/*! -
1548 \reimp -
1549*/ -
1550void QRasterPaintEngine::drawRects(const QRectF *rects, int rectCount) -
1551{ -
1552#ifdef QT_DEBUG_DRAW -
1553 qDebug(" - QRasterPaintEngine::drawRect(QRectF*), rectCount=%d", rectCount); -
1554#endif -
1555#ifdef QT_FAST_SPANS -
1556 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
1557 ensureRasterState();
executed (the execution status of this line is deduced): ensureRasterState();
-
1558 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
1559 -
1560 -
1561 if (s->flags.tx_noshear) {
evaluated: s->flags.tx_noshear
TRUEFALSE
yes
Evaluation Count:616
yes
Evaluation Count:8
8-616
1562 ensureBrush();
executed (the execution status of this line is deduced): ensureBrush();
-
1563 if (s->brushData.blend) {
evaluated: s->brushData.blend
TRUEFALSE
yes
Evaluation Count:313
yes
Evaluation Count:303
303-313
1564 d->initializeRasterizer(&s->brushData);
executed (the execution status of this line is deduced): d->initializeRasterizer(&s->brushData);
-
1565 for (int i = 0; i < rectCount; ++i) {
evaluated: i < rectCount
TRUEFALSE
yes
Evaluation Count:313
yes
Evaluation Count:313
313
1566 const QRectF &rect = rects[i].normalized();
executed (the execution status of this line is deduced): const QRectF &rect = rects[i].normalized();
-
1567 if (rect.isEmpty())
evaluated: rect.isEmpty()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:311
2-311
1568 continue;
executed: continue;
Execution Count:2
2
1569 const QPointF a = s->matrix.map((rect.topLeft() + rect.bottomLeft()) * 0.5f);
executed (the execution status of this line is deduced): const QPointF a = s->matrix.map((rect.topLeft() + rect.bottomLeft()) * 0.5f);
-
1570 const QPointF b = s->matrix.map((rect.topRight() + rect.bottomRight()) * 0.5f);
executed (the execution status of this line is deduced): const QPointF b = s->matrix.map((rect.topRight() + rect.bottomRight()) * 0.5f);
-
1571 d->rasterizer->rasterizeLine(a, b, rect.height() / rect.width());
executed (the execution status of this line is deduced): d->rasterizer->rasterizeLine(a, b, rect.height() / rect.width());
-
1572 }
executed: }
Execution Count:311
311
1573 }
executed: }
Execution Count:313
313
1574 -
1575 ensurePen();
executed (the execution status of this line is deduced): ensurePen();
-
1576 if (s->penData.blend) {
evaluated: s->penData.blend
TRUEFALSE
yes
Evaluation Count:361
yes
Evaluation Count:255
255-361
1577 QRectVectorPath path;
executed (the execution status of this line is deduced): QRectVectorPath path;
-
1578 if (s->flags.fast_pen) {
evaluated: s->flags.fast_pen
TRUEFALSE
yes
Evaluation Count:337
yes
Evaluation Count:24
24-337
1579 QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
-
1580 stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
-
1581 for (int i = 0; i < rectCount; ++i) {
evaluated: i < rectCount
TRUEFALSE
yes
Evaluation Count:337
yes
Evaluation Count:337
337
1582 path.set(rects[i]);
executed (the execution status of this line is deduced): path.set(rects[i]);
-
1583 stroker.drawPath(path);
executed (the execution status of this line is deduced): stroker.drawPath(path);
-
1584 }
executed: }
Execution Count:337
337
1585 } else {
executed: }
Execution Count:337
337
1586 for (int i = 0; i < rectCount; ++i) {
evaluated: i < rectCount
TRUEFALSE
yes
Evaluation Count:24
yes
Evaluation Count:24
24
1587 path.set(rects[i]);
executed (the execution status of this line is deduced): path.set(rects[i]);
-
1588 QPaintEngineEx::stroke(path, s->lastPen);
executed (the execution status of this line is deduced): QPaintEngineEx::stroke(path, s->lastPen);
-
1589 }
executed: }
Execution Count:24
24
1590 }
executed: }
Execution Count:24
24
1591 } -
1592 -
1593 return;
executed: return;
Execution Count:616
616
1594 } -
1595#endif // QT_FAST_SPANS -
1596 QPaintEngineEx::drawRects(rects, rectCount);
executed (the execution status of this line is deduced): QPaintEngineEx::drawRects(rects, rectCount);
-
1597}
executed: }
Execution Count:8
8
1598 -
1599 -
1600/*! -
1601 \internal -
1602*/ -
1603void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen) -
1604{ -
1605 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
1606 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
1607 -
1608 ensurePen(pen);
executed (the execution status of this line is deduced): ensurePen(pen);
-
1609 if (!s->penData.blend)
evaluated: !s->penData.blend
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:13272
13-13272
1610 return;
executed: return;
Execution Count:13
13
1611 -
1612 if (s->flags.fast_pen) {
evaluated: s->flags.fast_pen
TRUEFALSE
yes
Evaluation Count:11507
yes
Evaluation Count:1765
1765-11507
1613 QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
-
1614 stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
-
1615 stroker.drawPath(path);
executed (the execution status of this line is deduced): stroker.drawPath(path);
-
1616 } else if (s->flags.non_complex_pen && path.shape() == QVectorPath::LinesHint) {
executed: }
Execution Count:11507
evaluated: s->flags.non_complex_pen
TRUEFALSE
yes
Evaluation Count:1545
yes
Evaluation Count:220
evaluated: path.shape() == QVectorPath::LinesHint
TRUEFALSE
yes
Evaluation Count:875
yes
Evaluation Count:670
220-11507
1617 qreal width = qt_pen_is_cosmetic(s->lastPen, s->renderHints)
partially evaluated: qt_pen_is_cosmetic(s->lastPen, s->renderHints)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:875
0-875
1618 ? (qpen_widthf(s->lastPen) == 0 ? 1 : qpen_widthf(s->lastPen))
executed (the execution status of this line is deduced): ? (qpen_widthf(s->lastPen) == 0 ? 1 : qpen_widthf(s->lastPen))
-
1619 : qpen_widthf(s->lastPen) * s->txscale;
executed (the execution status of this line is deduced): : qpen_widthf(s->lastPen) * s->txscale;
-
1620 int dashIndex = 0;
executed (the execution status of this line is deduced): int dashIndex = 0;
-
1621 qreal dashOffset = s->lastPen.dashOffset();
executed (the execution status of this line is deduced): qreal dashOffset = s->lastPen.dashOffset();
-
1622 bool inDash = true;
executed (the execution status of this line is deduced): bool inDash = true;
-
1623 qreal patternLength = 0;
executed (the execution status of this line is deduced): qreal patternLength = 0;
-
1624 const QVector<qreal> pattern = s->lastPen.dashPattern();
executed (the execution status of this line is deduced): const QVector<qreal> pattern = s->lastPen.dashPattern();
-
1625 for (int i = 0; i < pattern.size(); ++i)
evaluated: i < pattern.size()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:875
6-875
1626 patternLength += pattern.at(i);
executed: patternLength += pattern.at(i);
Execution Count:6
6
1627 -
1628 if (patternLength > 0) {
evaluated: patternLength > 0
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:874
1-874
1629 int n = qFloor(dashOffset / patternLength);
executed (the execution status of this line is deduced): int n = qFloor(dashOffset / patternLength);
-
1630 dashOffset -= n * patternLength;
executed (the execution status of this line is deduced): dashOffset -= n * patternLength;
-
1631 while (dashOffset >= pattern.at(dashIndex)) {
partially evaluated: dashOffset >= pattern.at(dashIndex)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1632 dashOffset -= pattern.at(dashIndex);
never executed (the execution status of this line is deduced): dashOffset -= pattern.at(dashIndex);
-
1633 if (++dashIndex >= pattern.size())
never evaluated: ++dashIndex >= pattern.size()
0
1634 dashIndex = 0;
never executed: dashIndex = 0;
0
1635 inDash = !inDash;
never executed (the execution status of this line is deduced): inDash = !inDash;
-
1636 }
never executed: }
0
1637 }
executed: }
Execution Count:1
1
1638 -
1639 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
1640 d->initializeRasterizer(&s->penData);
executed (the execution status of this line is deduced): d->initializeRasterizer(&s->penData);
-
1641 int lineCount = path.elementCount() / 2;
executed (the execution status of this line is deduced): int lineCount = path.elementCount() / 2;
-
1642 const QLineF *lines = reinterpret_cast<const QLineF *>(path.points());
executed (the execution status of this line is deduced): const QLineF *lines = reinterpret_cast<const QLineF *>(path.points());
-
1643 -
1644 for (int i = 0; i < lineCount; ++i) {
evaluated: i < lineCount
TRUEFALSE
yes
Evaluation Count:876
yes
Evaluation Count:875
875-876
1645 if (lines[i].p1() == lines[i].p2()) {
evaluated: lines[i].p1() == lines[i].p2()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:875
1-875
1646 if (s->lastPen.capStyle() != Qt::FlatCap) {
partially evaluated: s->lastPen.capStyle() != Qt::FlatCap
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
1647 QPointF p = lines[i].p1();
executed (the execution status of this line is deduced): QPointF p = lines[i].p1();
-
1648 QLineF line = s->matrix.map(QLineF(QPointF(p.x() - width*0.5, p.y()),
executed (the execution status of this line is deduced): QLineF line = s->matrix.map(QLineF(QPointF(p.x() - width*0.5, p.y()),
-
1649 QPointF(p.x() + width*0.5, p.y())));
executed (the execution status of this line is deduced): QPointF(p.x() + width*0.5, p.y())));
-
1650 d->rasterizer->rasterizeLine(line.p1(), line.p2(), 1);
executed (the execution status of this line is deduced): d->rasterizer->rasterizeLine(line.p1(), line.p2(), 1);
-
1651 }
executed: }
Execution Count:1
1
1652 continue;
executed: continue;
Execution Count:1
1
1653 } -
1654 -
1655 const QLineF line = s->matrix.map(lines[i]);
executed (the execution status of this line is deduced): const QLineF line = s->matrix.map(lines[i]);
-
1656 if (qpen_style(s->lastPen) == Qt::SolidLine) {
evaluated: qpen_style(s->lastPen) == Qt::SolidLine
TRUEFALSE
yes
Evaluation Count:872
yes
Evaluation Count:3
3-872
1657 d->rasterizer->rasterizeLine(line.p1(), line.p2(),
executed (the execution status of this line is deduced): d->rasterizer->rasterizeLine(line.p1(), line.p2(),
-
1658 width / line.length(),
executed (the execution status of this line is deduced): width / line.length(),
-
1659 s->lastPen.capStyle() == Qt::SquareCap);
executed (the execution status of this line is deduced): s->lastPen.capStyle() == Qt::SquareCap);
-
1660 } else {
executed: }
Execution Count:872
872
1661 d->rasterizeLine_dashed(line, width,
executed (the execution status of this line is deduced): d->rasterizeLine_dashed(line, width,
-
1662 &dashIndex, &dashOffset, &inDash);
executed (the execution status of this line is deduced): &dashIndex, &dashOffset, &inDash);
-
1663 }
executed: }
Execution Count:3
3
1664 } -
1665 }
executed: }
Execution Count:875
875
1666 else -
1667 QPaintEngineEx::stroke(path, pen);
executed: QPaintEngineEx::stroke(path, pen);
Execution Count:890
890
1668} -
1669 -
1670QRect QRasterPaintEngine::toNormalizedFillRect(const QRectF &rect) -
1671{ -
1672 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
1673 -
1674 qreal delta = s->flags.legacy_rounding ? aliasedCoordinateDelta : qreal(0);
evaluated: s->flags.legacy_rounding
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:72909
1-72909
1675 -
1676 int x1 = qRound(rect.x() + delta);
executed (the execution status of this line is deduced): int x1 = qRound(rect.x() + delta);
-
1677 int y1 = qRound(rect.y() + delta);
executed (the execution status of this line is deduced): int y1 = qRound(rect.y() + delta);
-
1678 int x2 = qRound(rect.right() + delta);
executed (the execution status of this line is deduced): int x2 = qRound(rect.right() + delta);
-
1679 int y2 = qRound(rect.bottom() + delta);
executed (the execution status of this line is deduced): int y2 = qRound(rect.bottom() + delta);
-
1680 -
1681 if (x2 < x1)
partially evaluated: x2 < x1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:72904
0-72904
1682 qSwap(x1, x2);
never executed: qSwap(x1, x2);
0
1683 if (y2 < y1)
partially evaluated: y2 < y1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:72909
0-72909
1684 qSwap(y1, y2);
never executed: qSwap(y1, y2);
0
1685 -
1686 return QRect(x1, y1, x2 - x1, y2 - y1);
executed: return QRect(x1, y1, x2 - x1, y2 - y1);
Execution Count:72909
72909
1687} -
1688 -
1689/*! -
1690 \internal -
1691*/ -
1692void QRasterPaintEngine::fill(const QVectorPath &path, const QBrush &brush) -
1693{ -
1694 if (path.isEmpty())
partially evaluated: path.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:148247
0-148247
1695 return;
never executed: return;
0
1696#ifdef QT_DEBUG_DRAW -
1697 QRectF rf = path.controlPointRect(); -
1698 qDebug() << "QRasterPaintEngine::fill(): " -
1699 << "size=" << path.elementCount() -
1700 << ", hints=" << hex << path.hints() -
1701 << rf << brush; -
1702#endif -
1703 -
1704 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
1705 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
1706 -
1707 ensureBrush(brush);
executed (the execution status of this line is deduced): ensureBrush(brush);
-
1708 if (!s->brushData.blend)
evaluated: !s->brushData.blend
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:148246
1-148246
1709 return;
executed: return;
Execution Count:1
1
1710 -
1711 if (path.shape() == QVectorPath::RectangleHint) {
evaluated: path.shape() == QVectorPath::RectangleHint
TRUEFALSE
yes
Evaluation Count:13137
yes
Evaluation Count:135109
13137-135109
1712 if (!s->flags.antialiased && s->matrix.type() <= QTransform::TxScale) {
evaluated: !s->flags.antialiased
TRUEFALSE
yes
Evaluation Count:13127
yes
Evaluation Count:10
partially evaluated: s->matrix.type() <= QTransform::TxScale
TRUEFALSE
yes
Evaluation Count:13127
no
Evaluation Count:0
0-13127
1713 const qreal *p = path.points();
executed (the execution status of this line is deduced): const qreal *p = path.points();
-
1714 QPointF tl = QPointF(p[0], p[1]) * s->matrix;
executed (the execution status of this line is deduced): QPointF tl = QPointF(p[0], p[1]) * s->matrix;
-
1715 QPointF br = QPointF(p[4], p[5]) * s->matrix;
executed (the execution status of this line is deduced): QPointF br = QPointF(p[4], p[5]) * s->matrix;
-
1716 fillRect_normalized(toNormalizedFillRect(QRectF(tl, br)), &s->brushData, d);
executed (the execution status of this line is deduced): fillRect_normalized(toNormalizedFillRect(QRectF(tl, br)), &s->brushData, d);
-
1717 return;
executed: return;
Execution Count:13127
13127
1718 } -
1719 ensureRasterState();
executed (the execution status of this line is deduced): ensureRasterState();
-
1720 if (s->flags.tx_noshear) {
partially evaluated: s->flags.tx_noshear
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
0-10
1721 d->initializeRasterizer(&s->brushData);
executed (the execution status of this line is deduced): d->initializeRasterizer(&s->brushData);
-
1722 // ### Is normalizing really necessary here? -
1723 const qreal *p = path.points();
executed (the execution status of this line is deduced): const qreal *p = path.points();
-
1724 QRectF r = QRectF(p[0], p[1], p[2] - p[0], p[7] - p[1]).normalized();
executed (the execution status of this line is deduced): QRectF r = QRectF(p[0], p[1], p[2] - p[0], p[7] - p[1]).normalized();
-
1725 if (!r.isEmpty()) {
partially evaluated: !r.isEmpty()
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
0-10
1726 const QPointF a = s->matrix.map((r.topLeft() + r.bottomLeft()) * 0.5f);
executed (the execution status of this line is deduced): const QPointF a = s->matrix.map((r.topLeft() + r.bottomLeft()) * 0.5f);
-
1727 const QPointF b = s->matrix.map((r.topRight() + r.bottomRight()) * 0.5f);
executed (the execution status of this line is deduced): const QPointF b = s->matrix.map((r.topRight() + r.bottomRight()) * 0.5f);
-
1728 d->rasterizer->rasterizeLine(a, b, r.height() / r.width());
executed (the execution status of this line is deduced): d->rasterizer->rasterizeLine(a, b, r.height() / r.width());
-
1729 }
executed: }
Execution Count:10
10
1730 return;
executed: return;
Execution Count:10
10
1731 } -
1732 }
never executed: }
0
1733 -
1734 // ### Optimize for non transformed ellipses and rectangles... -
1735 QRectF cpRect = path.controlPointRect();
executed (the execution status of this line is deduced): QRectF cpRect = path.controlPointRect();
-
1736 const QRect deviceRect = s->matrix.mapRect(cpRect).toRect();
executed (the execution status of this line is deduced): const QRect deviceRect = s->matrix.mapRect(cpRect).toRect();
-
1737 ProcessSpans blend = d->getBrushFunc(deviceRect, &s->brushData);
executed (the execution status of this line is deduced): ProcessSpans blend = d->getBrushFunc(deviceRect, &s->brushData);
-
1738 -
1739 // ### Falcon -
1740// const bool do_clip = (deviceRect.left() < -QT_RASTER_COORD_LIMIT -
1741// || deviceRect.right() > QT_RASTER_COORD_LIMIT -
1742// || deviceRect.top() < -QT_RASTER_COORD_LIMIT -
1743// || deviceRect.bottom() > QT_RASTER_COORD_LIMIT); -
1744 -
1745 // ### Falonc: implement.... -
1746// if (!s->flags.antialiased && !do_clip) { -
1747// d->initializeRasterizer(&s->brushData); -
1748// d->rasterizer->rasterize(path * d->matrix, path.fillRule()); -
1749// return; -
1750// } -
1751 -
1752 ensureOutlineMapper();
executed (the execution status of this line is deduced): ensureOutlineMapper();
-
1753 d->rasterize(d->outlineMapper->convertPath(path), blend, &s->brushData, d->rasterBuffer.data());
executed (the execution status of this line is deduced): d->rasterize(d->outlineMapper->convertPath(path), blend, &s->brushData, d->rasterBuffer.data());
-
1754}
executed: }
Execution Count:135109
135109
1755 -
1756void QRasterPaintEngine::fillRect(const QRectF &r, QSpanData *data) -
1757{ -
1758 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
1759 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
1760 -
1761 if (!s->flags.antialiased) {
evaluated: !s->flags.antialiased
TRUEFALSE
yes
Evaluation Count:59814
yes
Evaluation Count:30
30-59814
1762 uint txop = s->matrix.type();
executed (the execution status of this line is deduced): uint txop = s->matrix.type();
-
1763 if (txop == QTransform::TxNone) {
evaluated: txop == QTransform::TxNone
TRUEFALSE
yes
Evaluation Count:31267
yes
Evaluation Count:28544
28544-31267
1764 fillRect_normalized(toNormalizedFillRect(r), data, d);
executed (the execution status of this line is deduced): fillRect_normalized(toNormalizedFillRect(r), data, d);
-
1765 return;
executed: return;
Execution Count:31263
31263
1766 } else if (txop == QTransform::TxTranslate) {
evaluated: txop == QTransform::TxTranslate
TRUEFALSE
yes
Evaluation Count:28480
yes
Evaluation Count:64
64-28480
1767 const QRect rr = toNormalizedFillRect(r.translated(s->matrix.dx(), s->matrix.dy()));
executed (the execution status of this line is deduced): const QRect rr = toNormalizedFillRect(r.translated(s->matrix.dx(), s->matrix.dy()));
-
1768 fillRect_normalized(rr, data, d);
executed (the execution status of this line is deduced): fillRect_normalized(rr, data, d);
-
1769 return;
executed: return;
Execution Count:28480
28480
1770 } else if (txop == QTransform::TxScale) {
evaluated: txop == QTransform::TxScale
TRUEFALSE
yes
Evaluation Count:37
yes
Evaluation Count:27
27-37
1771 const QRect rr = toNormalizedFillRect(s->matrix.mapRect(r));
executed (the execution status of this line is deduced): const QRect rr = toNormalizedFillRect(s->matrix.mapRect(r));
-
1772 fillRect_normalized(rr, data, d);
executed (the execution status of this line is deduced): fillRect_normalized(rr, data, d);
-
1773 return;
executed: return;
Execution Count:37
37
1774 } -
1775 } -
1776 ensureRasterState();
executed (the execution status of this line is deduced): ensureRasterState();
-
1777 if (s->flags.tx_noshear) {
evaluated: s->flags.tx_noshear
TRUEFALSE
yes
Evaluation Count:56
yes
Evaluation Count:1
1-56
1778 d->initializeRasterizer(data);
executed (the execution status of this line is deduced): d->initializeRasterizer(data);
-
1779 QRectF nr = r.normalized();
executed (the execution status of this line is deduced): QRectF nr = r.normalized();
-
1780 if (!nr.isEmpty()) {
evaluated: !nr.isEmpty()
TRUEFALSE
yes
Evaluation Count:52
yes
Evaluation Count:4
4-52
1781 const QPointF a = s->matrix.map((nr.topLeft() + nr.bottomLeft()) * 0.5f);
executed (the execution status of this line is deduced): const QPointF a = s->matrix.map((nr.topLeft() + nr.bottomLeft()) * 0.5f);
-
1782 const QPointF b = s->matrix.map((nr.topRight() + nr.bottomRight()) * 0.5f);
executed (the execution status of this line is deduced): const QPointF b = s->matrix.map((nr.topRight() + nr.bottomRight()) * 0.5f);
-
1783 d->rasterizer->rasterizeLine(a, b, nr.height() / nr.width());
executed (the execution status of this line is deduced): d->rasterizer->rasterizeLine(a, b, nr.height() / nr.width());
-
1784 }
executed: }
Execution Count:52
52
1785 return;
executed: return;
Execution Count:56
56
1786 } -
1787 -
1788 QPainterPath path;
executed (the execution status of this line is deduced): QPainterPath path;
-
1789 path.addRect(r);
executed (the execution status of this line is deduced): path.addRect(r);
-
1790 ensureOutlineMapper();
executed (the execution status of this line is deduced): ensureOutlineMapper();
-
1791 fillPath(path, data);
executed (the execution status of this line is deduced): fillPath(path, data);
-
1792}
executed: }
Execution Count:1
1
1793 -
1794/*! -
1795 \reimp -
1796*/ -
1797void QRasterPaintEngine::fillRect(const QRectF &r, const QBrush &brush) -
1798{ -
1799#ifdef QT_DEBUG_DRAW -
1800 qDebug() << "QRasterPaintEngine::fillRecct(): " << r << brush; -
1801#endif -
1802 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
1803 -
1804 ensureBrush(brush);
executed (the execution status of this line is deduced): ensureBrush(brush);
-
1805 if (!s->brushData.blend)
evaluated: !s->brushData.blend
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:56817
4-56817
1806 return;
executed: return;
Execution Count:4
4
1807 -
1808 fillRect(r, &s->brushData);
executed (the execution status of this line is deduced): fillRect(r, &s->brushData);
-
1809}
executed: }
Execution Count:56813
56813
1810 -
1811/*! -
1812 \reimp -
1813*/ -
1814void QRasterPaintEngine::fillRect(const QRectF &r, const QColor &color) -
1815{ -
1816#ifdef QT_DEBUG_DRAW -
1817 qDebug() << "QRasterPaintEngine::fillRect(): " << r << color; -
1818#endif -
1819 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
1820 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
1821 -
1822 d->solid_color_filler.solid.color = PREMUL(ARGB_COMBINE_ALPHA(color.rgba(), s->intOpacity));
executed (the execution status of this line is deduced): d->solid_color_filler.solid.color = PREMUL(((((color.rgba() >> 24) * s->intOpacity) >> 8) << 24) | (color.rgba() & 0x00ffffff));
-
1823 if ((d->solid_color_filler.solid.color & 0xff000000) == 0
evaluated: (d->solid_color_filler.solid.color & 0xff000000) == 0
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:3020
3-3020
1824 && s->composition_mode == QPainter::CompositionMode_SourceOver) {
partially evaluated: s->composition_mode == QPainter::CompositionMode_SourceOver
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1825 return;
never executed: return;
0
1826 } -
1827 d->solid_color_filler.clip = d->clip();
executed (the execution status of this line is deduced): d->solid_color_filler.clip = d->clip();
-
1828 d->solid_color_filler.adjustSpanMethods();
executed (the execution status of this line is deduced): d->solid_color_filler.adjustSpanMethods();
-
1829 fillRect(r, &d->solid_color_filler);
executed (the execution status of this line is deduced): fillRect(r, &d->solid_color_filler);
-
1830}
executed: }
Execution Count:3023
3023
1831 -
1832static inline bool isAbove(const QPointF *a, const QPointF *b) -
1833{ -
1834 return a->y() < b->y();
never executed: return a->y() < b->y();
0
1835} -
1836 -
1837static bool splitPolygon(const QPointF *points, int pointCount, QVector<QPointF> *upper, QVector<QPointF> *lower) -
1838{ -
1839 Q_ASSERT(upper);
never executed (the execution status of this line is deduced): qt_noop();
-
1840 Q_ASSERT(lower);
never executed (the execution status of this line is deduced): qt_noop();
-
1841 -
1842 Q_ASSERT(pointCount >= 2);
never executed (the execution status of this line is deduced): qt_noop();
-
1843 -
1844 QVector<const QPointF *> sorted;
never executed (the execution status of this line is deduced): QVector<const QPointF *> sorted;
-
1845 sorted.reserve(pointCount);
never executed (the execution status of this line is deduced): sorted.reserve(pointCount);
-
1846 -
1847 upper->reserve(pointCount * 3 / 4);
never executed (the execution status of this line is deduced): upper->reserve(pointCount * 3 / 4);
-
1848 lower->reserve(pointCount * 3 / 4);
never executed (the execution status of this line is deduced): lower->reserve(pointCount * 3 / 4);
-
1849 -
1850 for (int i = 0; i < pointCount; ++i)
never evaluated: i < pointCount
0
1851 sorted << points + i;
never executed: sorted << points + i;
0
1852 -
1853 qSort(sorted.begin(), sorted.end(), isAbove);
never executed (the execution status of this line is deduced): qSort(sorted.begin(), sorted.end(), isAbove);
-
1854 -
1855 qreal splitY = sorted.at(sorted.size() / 2)->y();
never executed (the execution status of this line is deduced): qreal splitY = sorted.at(sorted.size() / 2)->y();
-
1856 -
1857 const QPointF *end = points + pointCount;
never executed (the execution status of this line is deduced): const QPointF *end = points + pointCount;
-
1858 const QPointF *last = end - 1;
never executed (the execution status of this line is deduced): const QPointF *last = end - 1;
-
1859 -
1860 QVector<QPointF> *bin[2] = { upper, lower };
never executed (the execution status of this line is deduced): QVector<QPointF> *bin[2] = { upper, lower };
-
1861 -
1862 for (const QPointF *p = points; p < end; ++p) {
never evaluated: p < end
0
1863 int side = p->y() < splitY;
never executed (the execution status of this line is deduced): int side = p->y() < splitY;
-
1864 int lastSide = last->y() < splitY;
never executed (the execution status of this line is deduced): int lastSide = last->y() < splitY;
-
1865 -
1866 if (side != lastSide) {
never evaluated: side != lastSide
0
1867 if (qFuzzyCompare(p->y(), splitY)) {
never evaluated: qFuzzyCompare(p->y(), splitY)
0
1868 bin[!side]->append(*p);
never executed (the execution status of this line is deduced): bin[!side]->append(*p);
-
1869 } else if (qFuzzyCompare(last->y(), splitY)) {
never executed: }
never evaluated: qFuzzyCompare(last->y(), splitY)
0
1870 bin[side]->append(*last);
never executed (the execution status of this line is deduced): bin[side]->append(*last);
-
1871 } else {
never executed: }
0
1872 QPointF delta = *p - *last;
never executed (the execution status of this line is deduced): QPointF delta = *p - *last;
-
1873 QPointF intersection(p->x() + delta.x() * (splitY - p->y()) / delta.y(), splitY);
never executed (the execution status of this line is deduced): QPointF intersection(p->x() + delta.x() * (splitY - p->y()) / delta.y(), splitY);
-
1874 -
1875 bin[0]->append(intersection);
never executed (the execution status of this line is deduced): bin[0]->append(intersection);
-
1876 bin[1]->append(intersection);
never executed (the execution status of this line is deduced): bin[1]->append(intersection);
-
1877 }
never executed: }
0
1878 } -
1879 -
1880 bin[side]->append(*p);
never executed (the execution status of this line is deduced): bin[side]->append(*p);
-
1881 -
1882 last = p;
never executed (the execution status of this line is deduced): last = p;
-
1883 }
never executed: }
0
1884 -
1885 // give up if we couldn't reduce the point count -
1886 return upper->size() < pointCount && lower->size() < pointCount;
never executed: return upper->size() < pointCount && lower->size() < pointCount;
0
1887} -
1888 -
1889/*! -
1890 \internal -
1891 */ -
1892void QRasterPaintEngine::fillPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) -
1893{ -
1894 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
1895 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
1896 -
1897 const int maxPoints = 0xffff;
executed (the execution status of this line is deduced): const int maxPoints = 0xffff;
-
1898 -
1899 // max amount of points that raster engine can reliably handle -
1900 if (pointCount > maxPoints) {
partially evaluated: pointCount > maxPoints
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:391
0-391
1901 QVector<QPointF> upper, lower;
never executed (the execution status of this line is deduced): QVector<QPointF> upper, lower;
-
1902 -
1903 if (splitPolygon(points, pointCount, &upper, &lower)) {
never evaluated: splitPolygon(points, pointCount, &upper, &lower)
0
1904 fillPolygon(upper.constData(), upper.size(), mode);
never executed (the execution status of this line is deduced): fillPolygon(upper.constData(), upper.size(), mode);
-
1905 fillPolygon(lower.constData(), lower.size(), mode);
never executed (the execution status of this line is deduced): fillPolygon(lower.constData(), lower.size(), mode);
-
1906 } else
never executed: }
0
1907 qWarning("Polygon too complex for filling.");
never executed: QMessageLogger("painting/qpaintengine_raster.cpp", 1907, __PRETTY_FUNCTION__).warning("Polygon too complex for filling.");
0
1908 -
1909 return;
never executed: return;
0
1910 } -
1911 -
1912 // Compose polygon fill.., -
1913 QVectorPath vp((qreal *) points, pointCount, 0, QVectorPath::polygonFlags(mode));
executed (the execution status of this line is deduced): QVectorPath vp((qreal *) points, pointCount, 0, QVectorPath::polygonFlags(mode));
-
1914 ensureOutlineMapper();
executed (the execution status of this line is deduced): ensureOutlineMapper();
-
1915 QT_FT_Outline *outline = d->outlineMapper->convertPath(vp);
executed (the execution status of this line is deduced): QT_FT_Outline *outline = d->outlineMapper->convertPath(vp);
-
1916 -
1917 // scanconvert. -
1918 ProcessSpans brushBlend = d->getBrushFunc(d->outlineMapper->controlPointRect,
executed (the execution status of this line is deduced): ProcessSpans brushBlend = d->getBrushFunc(d->outlineMapper->controlPointRect,
-
1919 &s->brushData);
executed (the execution status of this line is deduced): &s->brushData);
-
1920 d->rasterize(outline, brushBlend, &s->brushData, d->rasterBuffer.data());
executed (the execution status of this line is deduced): d->rasterize(outline, brushBlend, &s->brushData, d->rasterBuffer.data());
-
1921}
executed: }
Execution Count:391
391
1922 -
1923/*! -
1924 \reimp -
1925*/ -
1926void QRasterPaintEngine::drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) -
1927{ -
1928 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
1929 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
1930 -
1931#ifdef QT_DEBUG_DRAW -
1932 qDebug(" - QRasterPaintEngine::drawPolygon(F), pointCount=%d", pointCount); -
1933 for (int i=0; i<pointCount; ++i) -
1934 qDebug() << " - " << points[i]; -
1935#endif -
1936 Q_ASSERT(pointCount >= 2);
executed (the execution status of this line is deduced): qt_noop();
-
1937 -
1938 if (mode != PolylineMode && isRect((qreal *) points, pointCount)) {
partially evaluated: mode != PolylineMode
TRUEFALSE
yes
Evaluation Count:447
no
Evaluation Count:0
evaluated: isRect((qreal *) points, pointCount)
TRUEFALSE
yes
Evaluation Count:20
yes
Evaluation Count:427
0-447
1939 QRectF r(points[0], points[2]);
executed (the execution status of this line is deduced): QRectF r(points[0], points[2]);
-
1940 drawRects(&r, 1);
executed (the execution status of this line is deduced): drawRects(&r, 1);
-
1941 return;
executed: return;
Execution Count:20
20
1942 } -
1943 -
1944 ensurePen();
executed (the execution status of this line is deduced): ensurePen();
-
1945 if (mode != PolylineMode) {
partially evaluated: mode != PolylineMode
TRUEFALSE
yes
Evaluation Count:427
no
Evaluation Count:0
0-427
1946 // Do the fill... -
1947 ensureBrush();
executed (the execution status of this line is deduced): ensureBrush();
-
1948 if (s->brushData.blend)
evaluated: s->brushData.blend
TRUEFALSE
yes
Evaluation Count:391
yes
Evaluation Count:36
36-391
1949 fillPolygon(points, pointCount, mode);
executed: fillPolygon(points, pointCount, mode);
Execution Count:391
391
1950 }
executed: }
Execution Count:427
427
1951 -
1952 // Do the outline... -
1953 if (s->penData.blend) {
evaluated: s->penData.blend
TRUEFALSE
yes
Evaluation Count:408
yes
Evaluation Count:19
19-408
1954 QVectorPath vp((qreal *) points, pointCount, 0, QVectorPath::polygonFlags(mode));
executed (the execution status of this line is deduced): QVectorPath vp((qreal *) points, pointCount, 0, QVectorPath::polygonFlags(mode));
-
1955 if (s->flags.fast_pen) {
evaluated: s->flags.fast_pen
TRUEFALSE
yes
Evaluation Count:396
yes
Evaluation Count:12
12-396
1956 QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
-
1957 stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
-
1958 stroker.drawPath(vp);
executed (the execution status of this line is deduced): stroker.drawPath(vp);
-
1959 } else {
executed: }
Execution Count:396
396
1960 QPaintEngineEx::stroke(vp, s->lastPen);
executed (the execution status of this line is deduced): QPaintEngineEx::stroke(vp, s->lastPen);
-
1961 }
executed: }
Execution Count:12
12
1962 } -
1963}
executed: }
Execution Count:427
427
1964 -
1965/*! -
1966 \reimp -
1967*/ -
1968void QRasterPaintEngine::drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) -
1969{ -
1970 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
1971 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
1972 -
1973#ifdef QT_DEBUG_DRAW -
1974 qDebug(" - QRasterPaintEngine::drawPolygon(I), pointCount=%d", pointCount); -
1975 for (int i=0; i<pointCount; ++i) -
1976 qDebug() << " - " << points[i]; -
1977#endif -
1978 Q_ASSERT(pointCount >= 2);
executed (the execution status of this line is deduced): qt_noop();
-
1979 if (mode != PolylineMode && isRect((int *) points, pointCount)) {
evaluated: mode != PolylineMode
TRUEFALSE
yes
Evaluation Count:906
yes
Evaluation Count:50052
evaluated: isRect((int *) points, pointCount)
TRUEFALSE
yes
Evaluation Count:20
yes
Evaluation Count:886
20-50052
1980 QRect r(points[0].x(),
executed (the execution status of this line is deduced): QRect r(points[0].x(),
-
1981 points[0].y(),
executed (the execution status of this line is deduced): points[0].y(),
-
1982 points[2].x() - points[0].x(),
executed (the execution status of this line is deduced): points[2].x() - points[0].x(),
-
1983 points[2].y() - points[0].y());
executed (the execution status of this line is deduced): points[2].y() - points[0].y());
-
1984 drawRects(&r, 1);
executed (the execution status of this line is deduced): drawRects(&r, 1);
-
1985 return;
executed: return;
Execution Count:20
20
1986 } -
1987 -
1988 ensurePen();
executed (the execution status of this line is deduced): ensurePen();
-
1989 -
1990 // Do the fill -
1991 if (mode != PolylineMode) {
evaluated: mode != PolylineMode
TRUEFALSE
yes
Evaluation Count:886
yes
Evaluation Count:50052
886-50052
1992 ensureBrush();
executed (the execution status of this line is deduced): ensureBrush();
-
1993 if (s->brushData.blend) {
evaluated: s->brushData.blend
TRUEFALSE
yes
Evaluation Count:850
yes
Evaluation Count:36
36-850
1994 // Compose polygon fill.., -
1995 ensureOutlineMapper();
executed (the execution status of this line is deduced): ensureOutlineMapper();
-
1996 d->outlineMapper->beginOutline(mode == WindingMode ? Qt::WindingFill : Qt::OddEvenFill);
executed (the execution status of this line is deduced): d->outlineMapper->beginOutline(mode == WindingMode ? Qt::WindingFill : Qt::OddEvenFill);
-
1997 d->outlineMapper->moveTo(*points);
executed (the execution status of this line is deduced): d->outlineMapper->moveTo(*points);
-
1998 const QPoint *p = points;
executed (the execution status of this line is deduced): const QPoint *p = points;
-
1999 const QPoint *ep = points + pointCount - 1;
executed (the execution status of this line is deduced): const QPoint *ep = points + pointCount - 1;
-
2000 do { -
2001 d->outlineMapper->lineTo(*(++p));
executed (the execution status of this line is deduced): d->outlineMapper->lineTo(*(++p));
-
2002 } while (p < ep);
executed: }
Execution Count:2317
evaluated: p < ep
TRUEFALSE
yes
Evaluation Count:1467
yes
Evaluation Count:850
850-2317
2003 d->outlineMapper->endOutline();
executed (the execution status of this line is deduced): d->outlineMapper->endOutline();
-
2004 -
2005 // scanconvert. -
2006 ProcessSpans brushBlend = d->getBrushFunc(d->outlineMapper->controlPointRect,
executed (the execution status of this line is deduced): ProcessSpans brushBlend = d->getBrushFunc(d->outlineMapper->controlPointRect,
-
2007 &s->brushData);
executed (the execution status of this line is deduced): &s->brushData);
-
2008 d->rasterize(d->outlineMapper->outline(), brushBlend, &s->brushData, d->rasterBuffer.data());
executed (the execution status of this line is deduced): d->rasterize(d->outlineMapper->outline(), brushBlend, &s->brushData, d->rasterBuffer.data());
-
2009 }
executed: }
Execution Count:850
850
2010 }
executed: }
Execution Count:886
886
2011 -
2012 // Do the outline... -
2013 if (s->penData.blend) {
evaluated: s->penData.blend
TRUEFALSE
yes
Evaluation Count:50920
yes
Evaluation Count:18
18-50920
2014 int count = pointCount * 2;
executed (the execution status of this line is deduced): int count = pointCount * 2;
-
2015 QVarLengthArray<qreal> fpoints(count);
executed (the execution status of this line is deduced): QVarLengthArray<qreal> fpoints(count);
-
2016 for (int i=0; i<count; ++i)
evaluated: i<count
TRUEFALSE
yes
Evaluation Count:309350
yes
Evaluation Count:50920
50920-309350
2017 fpoints[i] = ((int *) points)[i];
executed: fpoints[i] = ((int *) points)[i];
Execution Count:309350
309350
2018 QVectorPath vp((qreal *) fpoints.data(), pointCount, 0, QVectorPath::polygonFlags(mode));
executed (the execution status of this line is deduced): QVectorPath vp((qreal *) fpoints.data(), pointCount, 0, QVectorPath::polygonFlags(mode));
-
2019 -
2020 if (s->flags.fast_pen) {
evaluated: s->flags.fast_pen
TRUEFALSE
yes
Evaluation Count:50908
yes
Evaluation Count:12
12-50908
2021 QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
-
2022 stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
-
2023 stroker.drawPath(vp);
executed (the execution status of this line is deduced): stroker.drawPath(vp);
-
2024 } else {
executed: }
Execution Count:50908
50908
2025 QPaintEngineEx::stroke(vp, s->lastPen);
executed (the execution status of this line is deduced): QPaintEngineEx::stroke(vp, s->lastPen);
-
2026 }
executed: }
Execution Count:12
12
2027 } -
2028}
executed: }
Execution Count:50938
50938
2029 -
2030/*! -
2031 \internal -
2032*/ -
2033void QRasterPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pixmap) -
2034{ -
2035#ifdef QT_DEBUG_DRAW -
2036 qDebug() << " - QRasterPaintEngine::drawPixmap(), pos=" << pos << " pixmap=" << pixmap.size() << "depth=" << pixmap.depth(); -
2037#endif -
2038 -
2039 QPlatformPixmap *pd = pixmap.handle();
executed (the execution status of this line is deduced): QPlatformPixmap *pd = pixmap.handle();
-
2040 if (pd->classId() == QPlatformPixmap::RasterClass) {
partially evaluated: pd->classId() == QPlatformPixmap::RasterClass
TRUEFALSE
yes
Evaluation Count:6209
no
Evaluation Count:0
0-6209
2041 const QImage &image = static_cast<QRasterPlatformPixmap *>(pd)->image;
executed (the execution status of this line is deduced): const QImage &image = static_cast<QRasterPlatformPixmap *>(pd)->image;
-
2042 if (image.depth() == 1) {
partially evaluated: image.depth() == 1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6209
0-6209
2043 Q_D(QRasterPaintEngine);
never executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
2044 QRasterPaintEngineState *s = state();
never executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
2045 if (s->matrix.type() <= QTransform::TxTranslate) {
never evaluated: s->matrix.type() <= QTransform::TxTranslate
0
2046 ensurePen();
never executed (the execution status of this line is deduced): ensurePen();
-
2047 drawBitmap(pos + QPointF(s->matrix.dx(), s->matrix.dy()), image, &s->penData);
never executed (the execution status of this line is deduced): drawBitmap(pos + QPointF(s->matrix.dx(), s->matrix.dy()), image, &s->penData);
-
2048 } else {
never executed: }
0
2049 drawImage(pos, d->rasterBuffer->colorizeBitmap(image, s->pen.color()));
never executed (the execution status of this line is deduced): drawImage(pos, d->rasterBuffer->colorizeBitmap(image, s->pen.color()));
-
2050 }
never executed: }
0
2051 } else { -
2052 QRasterPaintEngine::drawImage(pos, image);
executed (the execution status of this line is deduced): QRasterPaintEngine::drawImage(pos, image);
-
2053 }
executed: }
Execution Count:6209
6209
2054 } else { -
2055 const QImage image = pixmap.toImage();
never executed (the execution status of this line is deduced): const QImage image = pixmap.toImage();
-
2056 if (pixmap.depth() == 1) {
never evaluated: pixmap.depth() == 1
0
2057 Q_D(QRasterPaintEngine);
never executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
2058 QRasterPaintEngineState *s = state();
never executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
2059 if (s->matrix.type() <= QTransform::TxTranslate) {
never evaluated: s->matrix.type() <= QTransform::TxTranslate
0
2060 ensurePen();
never executed (the execution status of this line is deduced): ensurePen();
-
2061 drawBitmap(pos + QPointF(s->matrix.dx(), s->matrix.dy()), image, &s->penData);
never executed (the execution status of this line is deduced): drawBitmap(pos + QPointF(s->matrix.dx(), s->matrix.dy()), image, &s->penData);
-
2062 } else {
never executed: }
0
2063 drawImage(pos, d->rasterBuffer->colorizeBitmap(image, s->pen.color()));
never executed (the execution status of this line is deduced): drawImage(pos, d->rasterBuffer->colorizeBitmap(image, s->pen.color()));
-
2064 }
never executed: }
0
2065 } else { -
2066 QRasterPaintEngine::drawImage(pos, image);
never executed (the execution status of this line is deduced): QRasterPaintEngine::drawImage(pos, image);
-
2067 }
never executed: }
0
2068 } -
2069} -
2070 -
2071/*! -
2072 \reimp -
2073*/ -
2074void QRasterPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap, const QRectF &sr) -
2075{ -
2076#ifdef QT_DEBUG_DRAW -
2077 qDebug() << " - QRasterPaintEngine::drawPixmap(), r=" << r << " sr=" << sr << " pixmap=" << pixmap.size() << "depth=" << pixmap.depth(); -
2078#endif -
2079 -
2080 QPlatformPixmap* pd = pixmap.handle();
executed (the execution status of this line is deduced): QPlatformPixmap* pd = pixmap.handle();
-
2081 if (pd->classId() == QPlatformPixmap::RasterClass) {
partially evaluated: pd->classId() == QPlatformPixmap::RasterClass
TRUEFALSE
yes
Evaluation Count:4195
no
Evaluation Count:0
0-4195
2082 const QImage &image = static_cast<QRasterPlatformPixmap *>(pd)->image;
executed (the execution status of this line is deduced): const QImage &image = static_cast<QRasterPlatformPixmap *>(pd)->image;
-
2083 if (image.depth() == 1) {
evaluated: image.depth() == 1
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:4194
1-4194
2084 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
2085 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
2086 if (s->matrix.type() <= QTransform::TxTranslate
partially evaluated: s->matrix.type() <= QTransform::TxTranslate
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2087 && r.size() == sr.size()
partially evaluated: r.size() == sr.size()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2088 && r.size() == pixmap.size()) {
partially evaluated: r.size() == pixmap.size()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2089 ensurePen();
executed (the execution status of this line is deduced): ensurePen();
-
2090 drawBitmap(r.topLeft() + QPointF(s->matrix.dx(), s->matrix.dy()), image, &s->penData);
executed (the execution status of this line is deduced): drawBitmap(r.topLeft() + QPointF(s->matrix.dx(), s->matrix.dy()), image, &s->penData);
-
2091 return;
executed: return;
Execution Count:1
1
2092 } else { -
2093 drawImage(r, d->rasterBuffer->colorizeBitmap(image, s->pen.color()), sr);
never executed (the execution status of this line is deduced): drawImage(r, d->rasterBuffer->colorizeBitmap(image, s->pen.color()), sr);
-
2094 }
never executed: }
0
2095 } else { -
2096 drawImage(r, image, sr);
executed (the execution status of this line is deduced): drawImage(r, image, sr);
-
2097 }
executed: }
Execution Count:4194
4194
2098 } else { -
2099 QRect clippedSource = sr.toAlignedRect().intersected(pixmap.rect());
never executed (the execution status of this line is deduced): QRect clippedSource = sr.toAlignedRect().intersected(pixmap.rect());
-
2100 const QImage image = pd->toImage(clippedSource);
never executed (the execution status of this line is deduced): const QImage image = pd->toImage(clippedSource);
-
2101 QRectF translatedSource = sr.translated(-clippedSource.topLeft());
never executed (the execution status of this line is deduced): QRectF translatedSource = sr.translated(-clippedSource.topLeft());
-
2102 if (image.depth() == 1) {
never evaluated: image.depth() == 1
0
2103 Q_D(QRasterPaintEngine);
never executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
2104 QRasterPaintEngineState *s = state();
never executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
2105 if (s->matrix.type() <= QTransform::TxTranslate
never evaluated: s->matrix.type() <= QTransform::TxTranslate
0
2106 && r.size() == sr.size()
never evaluated: r.size() == sr.size()
0
2107 && r.size() == pixmap.size()) {
never evaluated: r.size() == pixmap.size()
0
2108 ensurePen();
never executed (the execution status of this line is deduced): ensurePen();
-
2109 drawBitmap(r.topLeft() + QPointF(s->matrix.dx(), s->matrix.dy()), image, &s->penData);
never executed (the execution status of this line is deduced): drawBitmap(r.topLeft() + QPointF(s->matrix.dx(), s->matrix.dy()), image, &s->penData);
-
2110 return;
never executed: return;
0
2111 } else { -
2112 drawImage(r, d->rasterBuffer->colorizeBitmap(image, s->pen.color()), translatedSource);
never executed (the execution status of this line is deduced): drawImage(r, d->rasterBuffer->colorizeBitmap(image, s->pen.color()), translatedSource);
-
2113 }
never executed: }
0
2114 } else { -
2115 drawImage(r, image, translatedSource);
never executed (the execution status of this line is deduced): drawImage(r, image, translatedSource);
-
2116 }
never executed: }
0
2117 } -
2118} -
2119 -
2120static inline int fast_ceil_positive(const qreal &v) -
2121{ -
2122 const int iv = int(v);
executed (the execution status of this line is deduced): const int iv = int(v);
-
2123 if (v - iv == 0)
partially evaluated: v - iv == 0
TRUEFALSE
yes
Evaluation Count:710
no
Evaluation Count:0
0-710
2124 return iv;
executed: return iv;
Execution Count:710
710
2125 else -
2126 return iv + 1;
never executed: return iv + 1;
0
2127} -
2128 -
2129static inline const QRect toAlignedRect_positive(const QRectF &rect) -
2130{ -
2131 const int xmin = int(rect.x());
executed (the execution status of this line is deduced): const int xmin = int(rect.x());
-
2132 const int xmax = int(fast_ceil_positive(rect.right()));
executed (the execution status of this line is deduced): const int xmax = int(fast_ceil_positive(rect.right()));
-
2133 const int ymin = int(rect.y());
executed (the execution status of this line is deduced): const int ymin = int(rect.y());
-
2134 const int ymax = int(fast_ceil_positive(rect.bottom()));
executed (the execution status of this line is deduced): const int ymax = int(fast_ceil_positive(rect.bottom()));
-
2135 return QRect(xmin, ymin, xmax - xmin, ymax - ymin);
executed: return QRect(xmin, ymin, xmax - xmin, ymax - ymin);
Execution Count:355
355
2136} -
2137 -
2138/*! -
2139 \internal -
2140*/ -
2141void QRasterPaintEngine::drawImage(const QPointF &p, const QImage &img) -
2142{ -
2143#ifdef QT_DEBUG_DRAW -
2144 qDebug() << " - QRasterPaintEngine::drawImage(), p=" << p << " image=" << img.size() << "depth=" << img.depth(); -
2145#endif -
2146 -
2147 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
2148 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
2149 qreal scale = img.devicePixelRatio();
executed (the execution status of this line is deduced): qreal scale = img.devicePixelRatio();
-
2150 -
2151 if (scale > 1.0 || s->matrix.type() > QTransform::TxTranslate) {
partially evaluated: scale > 1.0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8528
evaluated: s->matrix.type() > QTransform::TxTranslate
TRUEFALSE
yes
Evaluation Count:1367
yes
Evaluation Count:7161
0-8528
2152 drawImage(QRectF(p.x(), p.y(), img.width() / scale, img.height() / scale),
executed (the execution status of this line is deduced): drawImage(QRectF(p.x(), p.y(), img.width() / scale, img.height() / scale),
-
2153 img,
executed (the execution status of this line is deduced): img,
-
2154 QRectF(0, 0, img.width(), img.height()));
executed (the execution status of this line is deduced): QRectF(0, 0, img.width(), img.height()));
-
2155 } else {
executed: }
Execution Count:1367
1367
2156 -
2157 const QClipData *clip = d->clip();
executed (the execution status of this line is deduced): const QClipData *clip = d->clip();
-
2158 QPointF pt(p.x() + s->matrix.dx(), p.y() + s->matrix.dy());
executed (the execution status of this line is deduced): QPointF pt(p.x() + s->matrix.dx(), p.y() + s->matrix.dy());
-
2159 -
2160 if (d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img)) {
evaluated: d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img)
TRUEFALSE
yes
Evaluation Count:7143
yes
Evaluation Count:18
18-7143
2161 SrcOverBlendFunc func = qBlendFunctions[d->rasterBuffer->format][img.format()];
executed (the execution status of this line is deduced): SrcOverBlendFunc func = qBlendFunctions[d->rasterBuffer->format][img.format()];
-
2162 if (func) {
evaluated: func
TRUEFALSE
yes
Evaluation Count:6239
yes
Evaluation Count:904
904-6239
2163 if (!clip) {
partially evaluated: !clip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6239
0-6239
2164 d->drawImage(pt, img, func, d->deviceRect, s->intOpacity);
never executed (the execution status of this line is deduced): d->drawImage(pt, img, func, d->deviceRect, s->intOpacity);
-
2165 return;
never executed: return;
0
2166 } else if (clip->hasRectClip) {
partially evaluated: clip->hasRectClip
TRUEFALSE
yes
Evaluation Count:6239
no
Evaluation Count:0
0-6239
2167 d->drawImage(pt, img, func, clip->clipRect, s->intOpacity);
executed (the execution status of this line is deduced): d->drawImage(pt, img, func, clip->clipRect, s->intOpacity);
-
2168 return;
executed: return;
Execution Count:6239
6239
2169 } -
2170 } -
2171 }
executed: }
Execution Count:904
904
2172 -
2173 -
2174 -
2175 d->image_filler.clip = clip;
executed (the execution status of this line is deduced): d->image_filler.clip = clip;
-
2176 d->image_filler.initTexture(&img, s->intOpacity, QTextureData::Plain, img.rect());
executed (the execution status of this line is deduced): d->image_filler.initTexture(&img, s->intOpacity, QTextureData::Plain, img.rect());
-
2177 if (!d->image_filler.blend)
evaluated: !d->image_filler.blend
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:921
1-921
2178 return;
executed: return;
Execution Count:1
1
2179 d->image_filler.dx = -pt.x();
executed (the execution status of this line is deduced): d->image_filler.dx = -pt.x();
-
2180 d->image_filler.dy = -pt.y();
executed (the execution status of this line is deduced): d->image_filler.dy = -pt.y();
-
2181 QRect rr = img.rect().translated(qRound(pt.x()), qRound(pt.y()));
executed (the execution status of this line is deduced): QRect rr = img.rect().translated(qRound(pt.x()), qRound(pt.y()));
-
2182 -
2183 fillRect_normalized(rr, &d->image_filler, d);
executed (the execution status of this line is deduced): fillRect_normalized(rr, &d->image_filler, d);
-
2184 }
executed: }
Execution Count:921
921
2185 -
2186} -
2187 -
2188QRectF qt_mapRect_non_normalizing(const QRectF &r, const QTransform &t) -
2189{ -
2190 return QRectF(r.topLeft() * t, r.bottomRight() * t);
executed: return QRectF(r.topLeft() * t, r.bottomRight() * t);
Execution Count:1652
1652
2191} -
2192 -
2193namespace { -
2194 enum RotationType { -
2195 Rotation90, -
2196 Rotation180, -
2197 Rotation270, -
2198 NoRotation -
2199 }; -
2200 -
2201 inline RotationType qRotationType(const QTransform &transform) -
2202 { -
2203 QTransform::TransformationType type = transform.type();
executed (the execution status of this line is deduced): QTransform::TransformationType type = transform.type();
-
2204 -
2205 if (type > QTransform::TxRotate)
partially evaluated: type > QTransform::TxRotate
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
2206 return NoRotation;
never executed: return NoRotation;
0
2207 -
2208 if (type == QTransform::TxRotate && qFuzzyIsNull(transform.m11()) && qFuzzyCompare(transform.m12(), qreal(-1))
evaluated: type == QTransform::TxRotate
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:6
partially evaluated: qFuzzyIsNull(transform.m11())
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
evaluated: qFuzzyCompare(transform.m12(), qreal(-1))
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
0-6
2209 && qFuzzyCompare(transform.m21(), qreal(1)) && qFuzzyIsNull(transform.m22()))
partially evaluated: qFuzzyCompare(transform.m21(), qreal(1))
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
partially evaluated: qFuzzyIsNull(transform.m22())
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2210 return Rotation90;
executed: return Rotation90;
Execution Count:1
1
2211 -
2212 if (type == QTransform::TxScale && qFuzzyCompare(transform.m11(), qreal(-1)) && qFuzzyIsNull(transform.m12())
evaluated: type == QTransform::TxScale
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:1
evaluated: qFuzzyCompare(transform.m11(), qreal(-1))
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:4
partially evaluated: qFuzzyIsNull(transform.m12())
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-6
2213 && qFuzzyIsNull(transform.m21()) && qFuzzyCompare(transform.m22(), qreal(-1)))
partially evaluated: qFuzzyIsNull(transform.m21())
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
partially evaluated: qFuzzyCompare(transform.m22(), qreal(-1))
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
2214 return Rotation180;
executed: return Rotation180;
Execution Count:2
2
2215 -
2216 if (type == QTransform::TxRotate && qFuzzyIsNull(transform.m11()) && qFuzzyCompare(transform.m12(), qreal(1))
evaluated: type == QTransform::TxRotate
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:4
partially evaluated: qFuzzyIsNull(transform.m11())
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
partially evaluated: qFuzzyCompare(transform.m12(), qreal(1))
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-4
2217 && qFuzzyCompare(transform.m21(), qreal(-1)) && qFuzzyIsNull(transform.m22()))
partially evaluated: qFuzzyCompare(transform.m21(), qreal(-1))
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
partially evaluated: qFuzzyIsNull(transform.m22())
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2218 return Rotation270;
executed: return Rotation270;
Execution Count:1
1
2219 -
2220 return NoRotation;
executed: return NoRotation;
Execution Count:4
4
2221 } -
2222 -
2223 inline bool isPixelAligned(const QRectF &rect) { -
2224 return QRectF(rect.toRect()) == rect;
never executed: return QRectF(rect.toRect()) == rect;
0
2225 } -
2226} -
2227 -
2228/*! -
2229 \reimp -
2230*/ -
2231void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRectF &sr, -
2232 Qt::ImageConversionFlags) -
2233{ -
2234#ifdef QT_DEBUG_DRAW -
2235 qDebug() << " - QRasterPaintEngine::drawImage(), r=" << r << " sr=" << sr << " image=" << img.size() << "depth=" << img.depth(); -
2236#endif -
2237 -
2238 if (r.isEmpty())
partially evaluated: r.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5788
0-5788
2239 return;
never executed: return;
0
2240 -
2241 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
2242 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
2243 int sr_l = qFloor(sr.left());
executed (the execution status of this line is deduced): int sr_l = qFloor(sr.left());
-
2244 int sr_r = qCeil(sr.right()) - 1;
executed (the execution status of this line is deduced): int sr_r = qCeil(sr.right()) - 1;
-
2245 int sr_t = qFloor(sr.top());
executed (the execution status of this line is deduced): int sr_t = qFloor(sr.top());
-
2246 int sr_b = qCeil(sr.bottom()) - 1;
executed (the execution status of this line is deduced): int sr_b = qCeil(sr.bottom()) - 1;
-
2247 -
2248 if (s->matrix.type() <= QTransform::TxScale && !s->flags.antialiased && sr_l == sr_r && sr_t == sr_b) {
evaluated: s->matrix.type() <= QTransform::TxScale
TRUEFALSE
yes
Evaluation Count:5776
yes
Evaluation Count:12
evaluated: !s->flags.antialiased
TRUEFALSE
yes
Evaluation Count:5774
yes
Evaluation Count:2
evaluated: sr_l == sr_r
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:5773
partially evaluated: sr_t == sr_b
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-5776
2249 // as fillRect will apply the aliased coordinate delta we need to -
2250 // subtract it here as we don't use it for image drawing -
2251 QTransform old = s->matrix;
executed (the execution status of this line is deduced): QTransform old = s->matrix;
-
2252 -
2253 if (s->flags.legacy_rounding)
partially evaluated: s->flags.legacy_rounding
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
2254 s->matrix = s->matrix * QTransform::fromTranslate(-aliasedCoordinateDelta, -aliasedCoordinateDelta);
never executed: s->matrix = s->matrix * QTransform::fromTranslate(-aliasedCoordinateDelta, -aliasedCoordinateDelta);
0
2255 -
2256 // Do whatever fillRect() does, but without premultiplying the color if it's already premultiplied. -
2257 QRgb color = img.pixel(sr_l, sr_t);
executed (the execution status of this line is deduced): QRgb color = img.pixel(sr_l, sr_t);
-
2258 switch (img.format()) { -
2259 case QImage::Format_ARGB32_Premultiplied: -
2260 case QImage::Format_ARGB8565_Premultiplied: -
2261 case QImage::Format_ARGB6666_Premultiplied: -
2262 case QImage::Format_ARGB8555_Premultiplied: -
2263 case QImage::Format_ARGB4444_Premultiplied: -
2264 // Combine premultiplied color with the opacity set on the painter. -
2265 d->solid_color_filler.solid.color =
executed (the execution status of this line is deduced): d->solid_color_filler.solid.color =
-
2266 ((((color & 0x00ff00ff) * s->intOpacity) >> 8) & 0x00ff00ff)
executed (the execution status of this line is deduced): ((((color & 0x00ff00ff) * s->intOpacity) >> 8) & 0x00ff00ff)
-
2267 | ((((color & 0xff00ff00) >> 8) * s->intOpacity) & 0xff00ff00);
executed (the execution status of this line is deduced): | ((((color & 0xff00ff00) >> 8) * s->intOpacity) & 0xff00ff00);
-
2268 break;
executed: break;
Execution Count:1
1
2269 default: -
2270 d->solid_color_filler.solid.color = PREMUL(ARGB_COMBINE_ALPHA(color, s->intOpacity));
never executed (the execution status of this line is deduced): d->solid_color_filler.solid.color = PREMUL(((((color >> 24) * s->intOpacity) >> 8) << 24) | (color & 0x00ffffff));
-
2271 break;
never executed: break;
0
2272 } -
2273 -
2274 if ((d->solid_color_filler.solid.color & 0xff000000) == 0
partially evaluated: (d->solid_color_filler.solid.color & 0xff000000) == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
2275 && s->composition_mode == QPainter::CompositionMode_SourceOver) {
never evaluated: s->composition_mode == QPainter::CompositionMode_SourceOver
0
2276 return;
never executed: return;
0
2277 } -
2278 -
2279 d->solid_color_filler.clip = d->clip();
executed (the execution status of this line is deduced): d->solid_color_filler.clip = d->clip();
-
2280 d->solid_color_filler.adjustSpanMethods();
executed (the execution status of this line is deduced): d->solid_color_filler.adjustSpanMethods();
-
2281 fillRect(r, &d->solid_color_filler);
executed (the execution status of this line is deduced): fillRect(r, &d->solid_color_filler);
-
2282 -
2283 s->matrix = old;
executed (the execution status of this line is deduced): s->matrix = old;
-
2284 return;
executed: return;
Execution Count:1
1
2285 } -
2286 -
2287 bool stretch_sr = r.width() != sr.width() || r.height() != sr.height();
evaluated: r.width() != sr.width()
TRUEFALSE
yes
Evaluation Count:305
yes
Evaluation Count:5482
evaluated: r.height() != sr.height()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:5478
4-5482
2288 -
2289 const QClipData *clip = d->clip();
executed (the execution status of this line is deduced): const QClipData *clip = d->clip();
-
2290 -
2291 if (s->matrix.type() > QTransform::TxTranslate
evaluated: s->matrix.type() > QTransform::TxTranslate
TRUEFALSE
yes
Evaluation Count:1374
yes
Evaluation Count:4413
1374-4413
2292 && !stretch_sr
evaluated: !stretch_sr
TRUEFALSE
yes
Evaluation Count:1372
yes
Evaluation Count:2
2-1372
2293 && (!clip || clip->hasRectClip)
partially evaluated: !clip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1372
partially evaluated: clip->hasRectClip
TRUEFALSE
yes
Evaluation Count:1372
no
Evaluation Count:0
0-1372
2294 && s->intOpacity == 256
partially evaluated: s->intOpacity == 256
TRUEFALSE
yes
Evaluation Count:1372
no
Evaluation Count:0
0-1372
2295 && (d->rasterBuffer->compositionMode == QPainter::CompositionMode_SourceOver
evaluated: d->rasterBuffer->compositionMode == QPainter::CompositionMode_SourceOver
TRUEFALSE
yes
Evaluation Count:1371
yes
Evaluation Count:1
1-1371
2296 || d->rasterBuffer->compositionMode == QPainter::CompositionMode_Source)
partially evaluated: d->rasterBuffer->compositionMode == QPainter::CompositionMode_Source
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2297 && d->rasterBuffer->format == img.format()
evaluated: d->rasterBuffer->format == img.format()
TRUEFALSE
yes
Evaluation Count:1362
yes
Evaluation Count:10
10-1362
2298 && (d->rasterBuffer->format == QImage::Format_RGB16
partially evaluated: d->rasterBuffer->format == QImage::Format_RGB16
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1362
0-1362
2299 || d->rasterBuffer->format == QImage::Format_RGB32
evaluated: d->rasterBuffer->format == QImage::Format_RGB32
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:1354
8-1354
2300 || (d->rasterBuffer->format == QImage::Format_ARGB32_Premultiplied
partially evaluated: d->rasterBuffer->format == QImage::Format_ARGB32_Premultiplied
TRUEFALSE
yes
Evaluation Count:1354
no
Evaluation Count:0
0-1354
2301 && d->rasterBuffer->compositionMode == QPainter::CompositionMode_Source)))
partially evaluated: d->rasterBuffer->compositionMode == QPainter::CompositionMode_Source
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1354
0-1354
2302 { -
2303 RotationType rotationType = qRotationType(s->matrix);
executed (the execution status of this line is deduced): RotationType rotationType = qRotationType(s->matrix);
-
2304 -
2305 if (rotationType != NoRotation && qMemRotateFunctions[d->rasterBuffer->format][rotationType] && img.rect().contains(sr.toAlignedRect())) {
evaluated: rotationType != NoRotation
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:4
partially evaluated: qMemRotateFunctions[d->rasterBuffer->format][rotationType]
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
partially evaluated: img.rect().contains(sr.toAlignedRect())
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
2306 QRectF transformedTargetRect = s->matrix.mapRect(r);
executed (the execution status of this line is deduced): QRectF transformedTargetRect = s->matrix.mapRect(r);
-
2307 -
2308 if ((!(s->renderHints & QPainter::SmoothPixmapTransform) && !(s->renderHints & QPainter::Antialiasing))
partially evaluated: !(s->renderHints & QPainter::SmoothPixmapTransform)
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
partially evaluated: !(s->renderHints & QPainter::Antialiasing)
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
2309 || (isPixelAligned(transformedTargetRect) && isPixelAligned(sr)))
never evaluated: isPixelAligned(transformedTargetRect)
never evaluated: isPixelAligned(sr)
0
2310 { -
2311 QRect clippedTransformedTargetRect = transformedTargetRect.toRect().intersected(clip ? clip->clipRect : d->deviceRect);
executed (the execution status of this line is deduced): QRect clippedTransformedTargetRect = transformedTargetRect.toRect().intersected(clip ? clip->clipRect : d->deviceRect);
-
2312 if (clippedTransformedTargetRect.isNull())
partially evaluated: clippedTransformedTargetRect.isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
2313 return;
never executed: return;
0
2314 -
2315 QRectF clippedTargetRect = s->matrix.inverted().mapRect(QRectF(clippedTransformedTargetRect));
executed (the execution status of this line is deduced): QRectF clippedTargetRect = s->matrix.inverted().mapRect(QRectF(clippedTransformedTargetRect));
-
2316 -
2317 QRect clippedSourceRect
executed (the execution status of this line is deduced): QRect clippedSourceRect
-
2318 = QRectF(sr.x() + clippedTargetRect.x() - r.x(), sr.y() + clippedTargetRect.y() - r.y(),
executed (the execution status of this line is deduced): = QRectF(sr.x() + clippedTargetRect.x() - r.x(), sr.y() + clippedTargetRect.y() - r.y(),
-
2319 clippedTargetRect.width(), clippedTargetRect.height()).toRect();
executed (the execution status of this line is deduced): clippedTargetRect.width(), clippedTargetRect.height()).toRect();
-
2320 -
2321 uint dbpl = d->rasterBuffer->bytesPerLine();
executed (the execution status of this line is deduced): uint dbpl = d->rasterBuffer->bytesPerLine();
-
2322 uint sbpl = img.bytesPerLine();
executed (the execution status of this line is deduced): uint sbpl = img.bytesPerLine();
-
2323 -
2324 uchar *dst = d->rasterBuffer->buffer();
executed (the execution status of this line is deduced): uchar *dst = d->rasterBuffer->buffer();
-
2325 uint bpp = img.depth() >> 3;
executed (the execution status of this line is deduced): uint bpp = img.depth() >> 3;
-
2326 -
2327 const uchar *srcBase = img.bits() + clippedSourceRect.y() * sbpl + clippedSourceRect.x() * bpp;
executed (the execution status of this line is deduced): const uchar *srcBase = img.bits() + clippedSourceRect.y() * sbpl + clippedSourceRect.x() * bpp;
-
2328 uchar *dstBase = dst + clippedTransformedTargetRect.y() * dbpl + clippedTransformedTargetRect.x() * bpp;
executed (the execution status of this line is deduced): uchar *dstBase = dst + clippedTransformedTargetRect.y() * dbpl + clippedTransformedTargetRect.x() * bpp;
-
2329 -
2330 uint cw = clippedSourceRect.width();
executed (the execution status of this line is deduced): uint cw = clippedSourceRect.width();
-
2331 uint ch = clippedSourceRect.height();
executed (the execution status of this line is deduced): uint ch = clippedSourceRect.height();
-
2332 -
2333 qMemRotateFunctions[d->rasterBuffer->format][rotationType](srcBase, cw, ch, sbpl, dstBase, dbpl);
executed (the execution status of this line is deduced): qMemRotateFunctions[d->rasterBuffer->format][rotationType](srcBase, cw, ch, sbpl, dstBase, dbpl);
-
2334 -
2335 return;
executed: return;
Execution Count:4
4
2336 } -
2337 }
never executed: }
0
2338 }
executed: }
Execution Count:4
4
2339 -
2340 if (s->matrix.type() > QTransform::TxTranslate || stretch_sr) {
evaluated: s->matrix.type() > QTransform::TxTranslate
TRUEFALSE
yes
Evaluation Count:1370
yes
Evaluation Count:4413
evaluated: stretch_sr
TRUEFALSE
yes
Evaluation Count:307
yes
Evaluation Count:4106
307-4413
2341 -
2342 QRectF targetBounds = s->matrix.mapRect(r);
executed (the execution status of this line is deduced): QRectF targetBounds = s->matrix.mapRect(r);
-
2343 bool exceedsPrecision = targetBounds.width() > 0xffff
partially evaluated: targetBounds.width() > 0xffff
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1677
0-1677
2344 || targetBounds.height() > 0xffff;
partially evaluated: targetBounds.height() > 0xffff
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1677
0-1677
2345 -
2346 if (!exceedsPrecision && d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img)) {
partially evaluated: !exceedsPrecision
TRUEFALSE
yes
Evaluation Count:1677
no
Evaluation Count:0
evaluated: d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img)
TRUEFALSE
yes
Evaluation Count:1656
yes
Evaluation Count:21
0-1677
2347 if (s->matrix.type() > QTransform::TxScale) {
evaluated: s->matrix.type() > QTransform::TxScale
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1654
2-1654
2348 SrcOverTransformFunc func = qTransformFunctions[d->rasterBuffer->format][img.format()];
executed (the execution status of this line is deduced): SrcOverTransformFunc func = qTransformFunctions[d->rasterBuffer->format][img.format()];
-
2349 if (func && (!clip || clip->hasRectClip)) {
evaluated: func
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
partially evaluated: !clip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
partially evaluated: clip->hasRectClip
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2350 func(d->rasterBuffer->buffer(), d->rasterBuffer->bytesPerLine(), img.bits(),
executed (the execution status of this line is deduced): func(d->rasterBuffer->buffer(), d->rasterBuffer->bytesPerLine(), img.bits(),
-
2351 img.bytesPerLine(), r, sr, !clip ? d->deviceRect : clip->clipRect,
executed (the execution status of this line is deduced): img.bytesPerLine(), r, sr, !clip ? d->deviceRect : clip->clipRect,
-
2352 s->matrix, s->intOpacity);
executed (the execution status of this line is deduced): s->matrix, s->intOpacity);
-
2353 return;
executed: return;
Execution Count:1
1
2354 } -
2355 } else {
executed: }
Execution Count:1
1
2356 // Test for optimized high-dpi case: 2x source on 2x target. (Could be generalized to nX.) -
2357 bool sourceRect2x = r.width() * 2 == sr.width() && r.height() * 2 == sr.height();
evaluated: r.width() * 2 == sr.width()
TRUEFALSE
yes
Evaluation Count:296
yes
Evaluation Count:1358
partially evaluated: r.height() * 2 == sr.height()
TRUEFALSE
yes
Evaluation Count:296
no
Evaluation Count:0
0-1358
2358 bool scale2x = (s->matrix.m11() == qreal(2)) && (s->matrix.m22() == qreal(2));
evaluated: (s->matrix.m11() == qreal(2))
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:1651
partially evaluated: (s->matrix.m22() == qreal(2))
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-1651
2359 if (s->matrix.type() == QTransform::TxScale && sourceRect2x && scale2x) {
evaluated: s->matrix.type() == QTransform::TxScale
TRUEFALSE
yes
Evaluation Count:1356
yes
Evaluation Count:298
partially evaluated: sourceRect2x
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1356
never evaluated: scale2x
0-1356
2360 SrcOverBlendFunc func = qBlendFunctions[d->rasterBuffer->format][img.format()];
never executed (the execution status of this line is deduced): SrcOverBlendFunc func = qBlendFunctions[d->rasterBuffer->format][img.format()];
-
2361 if (func) {
never evaluated: func
0
2362 QPointF pt(r.x() * 2 + s->matrix.dx(), r.y() * 2 + s->matrix.dy());
never executed (the execution status of this line is deduced): QPointF pt(r.x() * 2 + s->matrix.dx(), r.y() * 2 + s->matrix.dy());
-
2363 if (!clip) {
never evaluated: !clip
0
2364 d->drawImage(pt, img, func, d->deviceRect, s->intOpacity, sr.toRect());
never executed (the execution status of this line is deduced): d->drawImage(pt, img, func, d->deviceRect, s->intOpacity, sr.toRect());
-
2365 return;
never executed: return;
0
2366 } else if (clip->hasRectClip) {
never evaluated: clip->hasRectClip
0
2367 d->drawImage(pt, img, func, clip->clipRect, s->intOpacity, sr.toRect());
never executed (the execution status of this line is deduced): d->drawImage(pt, img, func, clip->clipRect, s->intOpacity, sr.toRect());
-
2368 return;
never executed: return;
0
2369 } -
2370 } -
2371 }
never executed: }
0
2372 SrcOverScaleFunc func = qScaleFunctions[d->rasterBuffer->format][img.format()];
executed (the execution status of this line is deduced): SrcOverScaleFunc func = qScaleFunctions[d->rasterBuffer->format][img.format()];
-
2373 if (func && (!clip || clip->hasRectClip)) {
evaluated: func
TRUEFALSE
yes
Evaluation Count:1652
yes
Evaluation Count:2
partially evaluated: !clip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1652
partially evaluated: clip->hasRectClip
TRUEFALSE
yes
Evaluation Count:1652
no
Evaluation Count:0
0-1652
2374 func(d->rasterBuffer->buffer(), d->rasterBuffer->bytesPerLine(),
executed (the execution status of this line is deduced): func(d->rasterBuffer->buffer(), d->rasterBuffer->bytesPerLine(),
-
2375 img.bits(), img.bytesPerLine(),
executed (the execution status of this line is deduced): img.bits(), img.bytesPerLine(),
-
2376 qt_mapRect_non_normalizing(r, s->matrix), sr,
executed (the execution status of this line is deduced): qt_mapRect_non_normalizing(r, s->matrix), sr,
-
2377 !clip ? d->deviceRect : clip->clipRect,
executed (the execution status of this line is deduced): !clip ? d->deviceRect : clip->clipRect,
-
2378 s->intOpacity);
executed (the execution status of this line is deduced): s->intOpacity);
-
2379 return;
executed: return;
Execution Count:1652
1652
2380 } -
2381 }
executed: }
Execution Count:2
2
2382 } -
2383 -
2384 QTransform copy = s->matrix;
executed (the execution status of this line is deduced): QTransform copy = s->matrix;
-
2385 copy.translate(r.x(), r.y());
executed (the execution status of this line is deduced): copy.translate(r.x(), r.y());
-
2386 if (stretch_sr)
evaluated: stretch_sr
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:13
11-13
2387 copy.scale(r.width() / sr.width(), r.height() / sr.height());
executed: copy.scale(r.width() / sr.width(), r.height() / sr.height());
Execution Count:11
11
2388 copy.translate(-sr.x(), -sr.y());
executed (the execution status of this line is deduced): copy.translate(-sr.x(), -sr.y());
-
2389 -
2390 d->image_filler_xform.clip = clip;
executed (the execution status of this line is deduced): d->image_filler_xform.clip = clip;
-
2391 d->image_filler_xform.initTexture(&img, s->intOpacity, QTextureData::Plain, toAlignedRect_positive(sr));
executed (the execution status of this line is deduced): d->image_filler_xform.initTexture(&img, s->intOpacity, QTextureData::Plain, toAlignedRect_positive(sr));
-
2392 if (!d->image_filler_xform.blend)
partially evaluated: !d->image_filler_xform.blend
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:24
0-24
2393 return;
never executed: return;
0
2394 d->image_filler_xform.setupMatrix(copy, s->flags.bilinear);
executed (the execution status of this line is deduced): d->image_filler_xform.setupMatrix(copy, s->flags.bilinear);
-
2395 -
2396 if (!s->flags.antialiased && s->matrix.type() == QTransform::TxScale) {
evaluated: !s->flags.antialiased
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:10
evaluated: s->matrix.type() == QTransform::TxScale
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:12
2-14
2397 QRectF rr = s->matrix.mapRect(r);
executed (the execution status of this line is deduced): QRectF rr = s->matrix.mapRect(r);
-
2398 -
2399 const int x1 = qRound(rr.x());
executed (the execution status of this line is deduced): const int x1 = qRound(rr.x());
-
2400 const int y1 = qRound(rr.y());
executed (the execution status of this line is deduced): const int y1 = qRound(rr.y());
-
2401 const int x2 = qRound(rr.right());
executed (the execution status of this line is deduced): const int x2 = qRound(rr.right());
-
2402 const int y2 = qRound(rr.bottom());
executed (the execution status of this line is deduced): const int y2 = qRound(rr.bottom());
-
2403 -
2404 fillRect_normalized(QRect(x1, y1, x2-x1, y2-y1), &d->image_filler_xform, d);
executed (the execution status of this line is deduced): fillRect_normalized(QRect(x1, y1, x2-x1, y2-y1), &d->image_filler_xform, d);
-
2405 return;
executed: return;
Execution Count:2
2
2406 } -
2407 -
2408#ifdef QT_FAST_SPANS -
2409 ensureRasterState();
executed (the execution status of this line is deduced): ensureRasterState();
-
2410 if (s->flags.tx_noshear || s->matrix.type() == QTransform::TxScale) {
evaluated: s->flags.tx_noshear
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:4
partially evaluated: s->matrix.type() == QTransform::TxScale
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-18
2411 d->initializeRasterizer(&d->image_filler_xform);
executed (the execution status of this line is deduced): d->initializeRasterizer(&d->image_filler_xform);
-
2412 d->rasterizer->setAntialiased(s->flags.antialiased);
executed (the execution status of this line is deduced): d->rasterizer->setAntialiased(s->flags.antialiased);
-
2413 d->rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding);
executed (the execution status of this line is deduced): d->rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding);
-
2414 -
2415 const QPointF offs = s->flags.legacy_rounding ? QPointF(aliasedCoordinateDelta, aliasedCoordinateDelta) : QPointF();
partially evaluated: s->flags.legacy_rounding
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:18
0-18
2416 -
2417 const QRectF &rect = r.normalized();
executed (the execution status of this line is deduced): const QRectF &rect = r.normalized();
-
2418 const QPointF a = s->matrix.map((rect.topLeft() + rect.bottomLeft()) * 0.5f) - offs;
executed (the execution status of this line is deduced): const QPointF a = s->matrix.map((rect.topLeft() + rect.bottomLeft()) * 0.5f) - offs;
-
2419 const QPointF b = s->matrix.map((rect.topRight() + rect.bottomRight()) * 0.5f) - offs;
executed (the execution status of this line is deduced): const QPointF b = s->matrix.map((rect.topRight() + rect.bottomRight()) * 0.5f) - offs;
-
2420 -
2421 if (s->flags.tx_noshear)
partially evaluated: s->flags.tx_noshear
TRUEFALSE
yes
Evaluation Count:18
no
Evaluation Count:0
0-18
2422 d->rasterizer->rasterizeLine(a, b, rect.height() / rect.width());
executed: d->rasterizer->rasterizeLine(a, b, rect.height() / rect.width());
Execution Count:18
18
2423 else -
2424 d->rasterizer->rasterizeLine(a, b, qAbs((s->matrix.m22() * rect.height()) / (s->matrix.m11() * rect.width())));
never executed: d->rasterizer->rasterizeLine(a, b, qAbs((s->matrix.m22() * rect.height()) / (s->matrix.m11() * rect.width())));
0
2425 return;
executed: return;
Execution Count:18
18
2426 } -
2427#endif -
2428 const qreal offs = s->flags.legacy_rounding ? aliasedCoordinateDelta : qreal(0);
partially evaluated: s->flags.legacy_rounding
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
2429 QPainterPath path;
executed (the execution status of this line is deduced): QPainterPath path;
-
2430 path.addRect(r);
executed (the execution status of this line is deduced): path.addRect(r);
-
2431 QTransform m = s->matrix;
executed (the execution status of this line is deduced): QTransform m = s->matrix;
-
2432 s->matrix = QTransform(m.m11(), m.m12(), m.m13(),
executed (the execution status of this line is deduced): s->matrix = QTransform(m.m11(), m.m12(), m.m13(),
-
2433 m.m21(), m.m22(), m.m23(),
executed (the execution status of this line is deduced): m.m21(), m.m22(), m.m23(),
-
2434 m.m31() - offs, m.m32() - offs, m.m33());
executed (the execution status of this line is deduced): m.m31() - offs, m.m32() - offs, m.m33());
-
2435 fillPath(path, &d->image_filler_xform);
executed (the execution status of this line is deduced): fillPath(path, &d->image_filler_xform);
-
2436 s->matrix = m;
executed (the execution status of this line is deduced): s->matrix = m;
-
2437 } else {
executed: }
Execution Count:4
4
2438 if (d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img)) {
evaluated: d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img)
TRUEFALSE
yes
Evaluation Count:4095
yes
Evaluation Count:11
11-4095
2439 SrcOverBlendFunc func = qBlendFunctions[d->rasterBuffer->format][img.format()];
executed (the execution status of this line is deduced): SrcOverBlendFunc func = qBlendFunctions[d->rasterBuffer->format][img.format()];
-
2440 if (func) {
evaluated: func
TRUEFALSE
yes
Evaluation Count:3915
yes
Evaluation Count:180
180-3915
2441 QPointF pt(r.x() + s->matrix.dx(), r.y() + s->matrix.dy());
executed (the execution status of this line is deduced): QPointF pt(r.x() + s->matrix.dx(), r.y() + s->matrix.dy());
-
2442 if (!clip) {
partially evaluated: !clip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3915
0-3915
2443 d->drawImage(pt, img, func, d->deviceRect, s->intOpacity, sr.toRect());
never executed (the execution status of this line is deduced): d->drawImage(pt, img, func, d->deviceRect, s->intOpacity, sr.toRect());
-
2444 return;
never executed: return;
0
2445 } else if (clip->hasRectClip) {
evaluated: clip->hasRectClip
TRUEFALSE
yes
Evaluation Count:3775
yes
Evaluation Count:140
140-3775
2446 d->drawImage(pt, img, func, clip->clipRect, s->intOpacity, sr.toRect());
executed (the execution status of this line is deduced): d->drawImage(pt, img, func, clip->clipRect, s->intOpacity, sr.toRect());
-
2447 return;
executed: return;
Execution Count:3775
3775
2448 } -
2449 } -
2450 }
executed: }
Execution Count:320
320
2451 -
2452 d->image_filler.clip = clip;
executed (the execution status of this line is deduced): d->image_filler.clip = clip;
-
2453 d->image_filler.initTexture(&img, s->intOpacity, QTextureData::Plain, toAlignedRect_positive(sr));
executed (the execution status of this line is deduced): d->image_filler.initTexture(&img, s->intOpacity, QTextureData::Plain, toAlignedRect_positive(sr));
-
2454 if (!d->image_filler.blend)
partially evaluated: !d->image_filler.blend
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:331
0-331
2455 return;
never executed: return;
0
2456 d->image_filler.dx = -(r.x() + s->matrix.dx()) + sr.x();
executed (the execution status of this line is deduced): d->image_filler.dx = -(r.x() + s->matrix.dx()) + sr.x();
-
2457 d->image_filler.dy = -(r.y() + s->matrix.dy()) + sr.y();
executed (the execution status of this line is deduced): d->image_filler.dy = -(r.y() + s->matrix.dy()) + sr.y();
-
2458 -
2459 QRectF rr = r;
executed (the execution status of this line is deduced): QRectF rr = r;
-
2460 rr.translate(s->matrix.dx(), s->matrix.dy());
executed (the execution status of this line is deduced): rr.translate(s->matrix.dx(), s->matrix.dy());
-
2461 -
2462 const int x1 = qRound(rr.x());
executed (the execution status of this line is deduced): const int x1 = qRound(rr.x());
-
2463 const int y1 = qRound(rr.y());
executed (the execution status of this line is deduced): const int y1 = qRound(rr.y());
-
2464 const int x2 = qRound(rr.right());
executed (the execution status of this line is deduced): const int x2 = qRound(rr.right());
-
2465 const int y2 = qRound(rr.bottom());
executed (the execution status of this line is deduced): const int y2 = qRound(rr.bottom());
-
2466 -
2467 fillRect_normalized(QRect(x1, y1, x2-x1, y2-y1), &d->image_filler, d);
executed (the execution status of this line is deduced): fillRect_normalized(QRect(x1, y1, x2-x1, y2-y1), &d->image_filler, d);
-
2468 }
executed: }
Execution Count:331
331
2469} -
2470 -
2471/*! -
2472 \reimp -
2473*/ -
2474void QRasterPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &sr) -
2475{ -
2476#ifdef QT_DEBUG_DRAW -
2477 qDebug() << " - QRasterPaintEngine::drawTiledPixmap(), r=" << r << "pixmap=" << pixmap.size(); -
2478#endif -
2479 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
2480 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
2481 -
2482 QImage image;
executed (the execution status of this line is deduced): QImage image;
-
2483 -
2484 QPlatformPixmap *pd = pixmap.handle();
executed (the execution status of this line is deduced): QPlatformPixmap *pd = pixmap.handle();
-
2485 if (pd->classId() == QPlatformPixmap::RasterClass) {
partially evaluated: pd->classId() == QPlatformPixmap::RasterClass
TRUEFALSE
yes
Evaluation Count:9
no
Evaluation Count:0
0-9
2486 image = static_cast<QRasterPlatformPixmap *>(pd)->image;
executed (the execution status of this line is deduced): image = static_cast<QRasterPlatformPixmap *>(pd)->image;
-
2487 } else {
executed: }
Execution Count:9
9
2488 image = pixmap.toImage();
never executed (the execution status of this line is deduced): image = pixmap.toImage();
-
2489 }
never executed: }
0
2490 -
2491 if (image.depth() == 1)
partially evaluated: image.depth() == 1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9
0-9
2492 image = d->rasterBuffer->colorizeBitmap(image, s->pen.color());
never executed: image = d->rasterBuffer->colorizeBitmap(image, s->pen.color());
0
2493 -
2494 if (s->matrix.type() > QTransform::TxTranslate) {
partially evaluated: s->matrix.type() > QTransform::TxTranslate
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9
0-9
2495 QTransform copy = s->matrix;
never executed (the execution status of this line is deduced): QTransform copy = s->matrix;
-
2496 copy.translate(r.x(), r.y());
never executed (the execution status of this line is deduced): copy.translate(r.x(), r.y());
-
2497 copy.translate(-sr.x(), -sr.y());
never executed (the execution status of this line is deduced): copy.translate(-sr.x(), -sr.y());
-
2498 d->image_filler_xform.clip = d->clip();
never executed (the execution status of this line is deduced): d->image_filler_xform.clip = d->clip();
-
2499 d->image_filler_xform.initTexture(&image, s->intOpacity, QTextureData::Tiled);
never executed (the execution status of this line is deduced): d->image_filler_xform.initTexture(&image, s->intOpacity, QTextureData::Tiled);
-
2500 if (!d->image_filler_xform.blend)
never evaluated: !d->image_filler_xform.blend
0
2501 return;
never executed: return;
0
2502 d->image_filler_xform.setupMatrix(copy, s->flags.bilinear);
never executed (the execution status of this line is deduced): d->image_filler_xform.setupMatrix(copy, s->flags.bilinear);
-
2503 -
2504#ifdef QT_FAST_SPANS -
2505 ensureRasterState();
never executed (the execution status of this line is deduced): ensureRasterState();
-
2506 if (s->flags.tx_noshear || s->matrix.type() == QTransform::TxScale) {
never evaluated: s->flags.tx_noshear
never evaluated: s->matrix.type() == QTransform::TxScale
0
2507 d->initializeRasterizer(&d->image_filler_xform);
never executed (the execution status of this line is deduced): d->initializeRasterizer(&d->image_filler_xform);
-
2508 d->rasterizer->setAntialiased(s->flags.antialiased);
never executed (the execution status of this line is deduced): d->rasterizer->setAntialiased(s->flags.antialiased);
-
2509 d->rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding);
never executed (the execution status of this line is deduced): d->rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding);
-
2510 -
2511 const QRectF &rect = r.normalized();
never executed (the execution status of this line is deduced): const QRectF &rect = r.normalized();
-
2512 const QPointF a = s->matrix.map((rect.topLeft() + rect.bottomLeft()) * 0.5f);
never executed (the execution status of this line is deduced): const QPointF a = s->matrix.map((rect.topLeft() + rect.bottomLeft()) * 0.5f);
-
2513 const QPointF b = s->matrix.map((rect.topRight() + rect.bottomRight()) * 0.5f);
never executed (the execution status of this line is deduced): const QPointF b = s->matrix.map((rect.topRight() + rect.bottomRight()) * 0.5f);
-
2514 if (s->flags.tx_noshear)
never evaluated: s->flags.tx_noshear
0
2515 d->rasterizer->rasterizeLine(a, b, rect.height() / rect.width());
never executed: d->rasterizer->rasterizeLine(a, b, rect.height() / rect.width());
0
2516 else -
2517 d->rasterizer->rasterizeLine(a, b, qAbs((s->matrix.m22() * rect.height()) / (s->matrix.m11() * rect.width())));
never executed: d->rasterizer->rasterizeLine(a, b, qAbs((s->matrix.m22() * rect.height()) / (s->matrix.m11() * rect.width())));
0
2518 return;
never executed: return;
0
2519 } -
2520#endif -
2521 QPainterPath path;
never executed (the execution status of this line is deduced): QPainterPath path;
-
2522 path.addRect(r);
never executed (the execution status of this line is deduced): path.addRect(r);
-
2523 fillPath(path, &d->image_filler_xform);
never executed (the execution status of this line is deduced): fillPath(path, &d->image_filler_xform);
-
2524 } else {
never executed: }
0
2525 d->image_filler.clip = d->clip();
executed (the execution status of this line is deduced): d->image_filler.clip = d->clip();
-
2526 -
2527 d->image_filler.initTexture(&image, s->intOpacity, QTextureData::Tiled);
executed (the execution status of this line is deduced): d->image_filler.initTexture(&image, s->intOpacity, QTextureData::Tiled);
-
2528 if (!d->image_filler.blend)
partially evaluated: !d->image_filler.blend
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9
0-9
2529 return;
never executed: return;
0
2530 d->image_filler.dx = -(r.x() + s->matrix.dx()) + sr.x();
executed (the execution status of this line is deduced): d->image_filler.dx = -(r.x() + s->matrix.dx()) + sr.x();
-
2531 d->image_filler.dy = -(r.y() + s->matrix.dy()) + sr.y();
executed (the execution status of this line is deduced): d->image_filler.dy = -(r.y() + s->matrix.dy()) + sr.y();
-
2532 -
2533 QRectF rr = r;
executed (the execution status of this line is deduced): QRectF rr = r;
-
2534 rr.translate(s->matrix.dx(), s->matrix.dy());
executed (the execution status of this line is deduced): rr.translate(s->matrix.dx(), s->matrix.dy());
-
2535 fillRect_normalized(rr.toRect().normalized(), &d->image_filler, d);
executed (the execution status of this line is deduced): fillRect_normalized(rr.toRect().normalized(), &d->image_filler, d);
-
2536 }
executed: }
Execution Count:9
9
2537} -
2538 -
2539 -
2540//QWS hack -
2541static inline bool monoVal(const uchar* s, int x) -
2542{ -
2543 return (s[x>>3] << (x&7)) & 0x80;
executed: return (s[x>>3] << (x&7)) & 0x80;
Execution Count:392
392
2544} -
2545 -
2546/*! -
2547 \internal -
2548 */ -
2549QRasterBuffer *QRasterPaintEngine::rasterBuffer() -
2550{ -
2551 Q_D(QRasterPaintEngine);
never executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
2552 return d->rasterBuffer.data();
never executed: return d->rasterBuffer.data();
0
2553} -
2554 -
2555/*! -
2556 \internal -
2557*/ -
2558void QRasterPaintEngine::alphaPenBlt(const void* src, int bpl, int depth, int rx,int ry,int w,int h) -
2559{ -
2560 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
2561 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
2562 -
2563 if (!s->penData.blend)
partially evaluated: !s->penData.blend
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:133733
0-133733
2564 return;
never executed: return;
0
2565 -
2566 QRasterBuffer *rb = d->rasterBuffer.data();
executed (the execution status of this line is deduced): QRasterBuffer *rb = d->rasterBuffer.data();
-
2567 -
2568 const QRect rect(rx, ry, w, h);
executed (the execution status of this line is deduced): const QRect rect(rx, ry, w, h);
-
2569 const QClipData *clip = d->clip();
executed (the execution status of this line is deduced): const QClipData *clip = d->clip();
-
2570 bool unclipped = false;
executed (the execution status of this line is deduced): bool unclipped = false;
-
2571 if (clip) {
partially evaluated: clip
TRUEFALSE
yes
Evaluation Count:133733
no
Evaluation Count:0
0-133733
2572 // inlined QRect::intersects -
2573 const bool intersects = qMax(clip->xmin, rect.left()) <= qMin(clip->xmax - 1, rect.right())
evaluated: qMax(clip->xmin, rect.left()) <= qMin(clip->xmax - 1, rect.right())
TRUEFALSE
yes
Evaluation Count:119001
yes
Evaluation Count:14732
14732-119001
2574 && qMax(clip->ymin, rect.top()) <= qMin(clip->ymax - 1, rect.bottom());
evaluated: qMax(clip->ymin, rect.top()) <= qMin(clip->ymax - 1, rect.bottom())
TRUEFALSE
yes
Evaluation Count:110045
yes
Evaluation Count:8956
8956-110045
2575 -
2576 if (clip->hasRectClip) {
evaluated: clip->hasRectClip
TRUEFALSE
yes
Evaluation Count:127092
yes
Evaluation Count:6641
6641-127092
2577 unclipped = rx > clip->xmin
evaluated: rx > clip->xmin
TRUEFALSE
yes
Evaluation Count:126097
yes
Evaluation Count:995
995-126097
2578 && rx + w < clip->xmax
evaluated: rx + w < clip->xmax
TRUEFALSE
yes
Evaluation Count:114514
yes
Evaluation Count:11583
11583-114514
2579 && ry > clip->ymin
evaluated: ry > clip->ymin
TRUEFALSE
yes
Evaluation Count:114122
yes
Evaluation Count:392
392-114122
2580 && ry + h < clip->ymax;
evaluated: ry + h < clip->ymax
TRUEFALSE
yes
Evaluation Count:101491
yes
Evaluation Count:12631
12631-101491
2581 }
executed: }
Execution Count:127092
127092
2582 -
2583 if (!intersects)
evaluated: !intersects
TRUEFALSE
yes
Evaluation Count:23688
yes
Evaluation Count:110045
23688-110045
2584 return;
executed: return;
Execution Count:23688
23688
2585 } else {
executed: }
Execution Count:110045
110045
2586 // inlined QRect::intersects -
2587 const bool intersects = qMax(0, rect.left()) <= qMin(rb->width() - 1, rect.right())
never evaluated: qMax(0, rect.left()) <= qMin(rb->width() - 1, rect.right())
0
2588 && qMax(0, rect.top()) <= qMin(rb->height() - 1, rect.bottom());
never evaluated: qMax(0, rect.top()) <= qMin(rb->height() - 1, rect.bottom())
0
2589 if (!intersects)
never evaluated: !intersects
0
2590 return;
never executed: return;
0
2591 -
2592 // inlined QRect::contains -
2593 const bool contains = rect.left() >= 0 && rect.right() < rb->width()
never evaluated: rect.left() >= 0
never evaluated: rect.right() < rb->width()
0
2594 && rect.top() >= 0 && rect.bottom() < rb->height();
never evaluated: rect.top() >= 0
never evaluated: rect.bottom() < rb->height()
0
2595 -
2596 unclipped = contains && d->isUnclipped_normalized(rect);
never evaluated: contains
never evaluated: d->isUnclipped_normalized(rect)
0
2597 }
never executed: }
0
2598 -
2599 ProcessSpans blend = unclipped ? s->penData.unclipped_blend : s->penData.blend;
evaluated: unclipped
TRUEFALSE
yes
Evaluation Count:101491
yes
Evaluation Count:8554
8554-101491
2600 const uchar * scanline = static_cast<const uchar *>(src);
executed (the execution status of this line is deduced): const uchar * scanline = static_cast<const uchar *>(src);
-
2601 -
2602 if (s->flags.fast_text) {
evaluated: s->flags.fast_text
TRUEFALSE
yes
Evaluation Count:110040
yes
Evaluation Count:5
5-110040
2603 if (unclipped) {
evaluated: unclipped
TRUEFALSE
yes
Evaluation Count:101488
yes
Evaluation Count:8552
8552-101488
2604 if (depth == 1) {
evaluated: depth == 1
TRUEFALSE
yes
Evaluation Count:370
yes
Evaluation Count:101118
370-101118
2605 if (s->penData.bitmapBlit) {
partially evaluated: s->penData.bitmapBlit
TRUEFALSE
yes
Evaluation Count:370
no
Evaluation Count:0
0-370
2606 s->penData.bitmapBlit(rb, rx, ry, s->penData.solid.color,
executed (the execution status of this line is deduced): s->penData.bitmapBlit(rb, rx, ry, s->penData.solid.color,
-
2607 scanline, w, h, bpl);
executed (the execution status of this line is deduced): scanline, w, h, bpl);
-
2608 return;
executed: return;
Execution Count:370
370
2609 } -
2610 } else if (depth == 8) {
never executed: }
partially evaluated: depth == 8
TRUEFALSE
yes
Evaluation Count:101118
no
Evaluation Count:0
0-101118
2611 if (s->penData.alphamapBlit) {
partially evaluated: s->penData.alphamapBlit
TRUEFALSE
yes
Evaluation Count:101118
no
Evaluation Count:0
0-101118
2612 s->penData.alphamapBlit(rb, rx, ry, s->penData.solid.color,
executed (the execution status of this line is deduced): s->penData.alphamapBlit(rb, rx, ry, s->penData.solid.color,
-
2613 scanline, w, h, bpl, 0);
executed (the execution status of this line is deduced): scanline, w, h, bpl, 0);
-
2614 return;
executed: return;
Execution Count:101118
101118
2615 } -
2616 } else if (depth == 32) {
never executed: }
never evaluated: depth == 32
0
2617 // (A)RGB Alpha mask where the alpha component is not used. -
2618 if (s->penData.alphaRGBBlit) {
never evaluated: s->penData.alphaRGBBlit
0
2619 s->penData.alphaRGBBlit(rb, rx, ry, s->penData.solid.color,
never executed (the execution status of this line is deduced): s->penData.alphaRGBBlit(rb, rx, ry, s->penData.solid.color,
-
2620 (const uint *) scanline, w, h, bpl / 4, 0);
never executed (the execution status of this line is deduced): (const uint *) scanline, w, h, bpl / 4, 0);
-
2621 return;
never executed: return;
0
2622 } -
2623 }
never executed: }
0
2624 } else if (d->deviceDepth == 32 && (depth == 8 || depth == 32)) {
evaluated: d->deviceDepth == 32
TRUEFALSE
yes
Evaluation Count:517
yes
Evaluation Count:8035
evaluated: depth == 8
TRUEFALSE
yes
Evaluation Count:513
yes
Evaluation Count:4
partially evaluated: depth == 32
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-8035
2625 // (A)RGB Alpha mask where the alpha component is not used. -
2626 if (!clip) {
partially evaluated: !clip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:513
0-513
2627 int nx = qMax(0, rx);
never executed (the execution status of this line is deduced): int nx = qMax(0, rx);
-
2628 int ny = qMax(0, ry);
never executed (the execution status of this line is deduced): int ny = qMax(0, ry);
-
2629 -
2630 // Move scanline pointer to compensate for moved x and y -
2631 int xdiff = nx - rx;
never executed (the execution status of this line is deduced): int xdiff = nx - rx;
-
2632 int ydiff = ny - ry;
never executed (the execution status of this line is deduced): int ydiff = ny - ry;
-
2633 scanline += ydiff * bpl;
never executed (the execution status of this line is deduced): scanline += ydiff * bpl;
-
2634 scanline += xdiff * (depth == 32 ? 4 : 1);
never executed (the execution status of this line is deduced): scanline += xdiff * (depth == 32 ? 4 : 1);
-
2635 -
2636 w -= xdiff;
never executed (the execution status of this line is deduced): w -= xdiff;
-
2637 h -= ydiff;
never executed (the execution status of this line is deduced): h -= ydiff;
-
2638 -
2639 if (nx + w > d->rasterBuffer->width())
never evaluated: nx + w > d->rasterBuffer->width()
0
2640 w = d->rasterBuffer->width() - nx;
never executed: w = d->rasterBuffer->width() - nx;
0
2641 if (ny + h > d->rasterBuffer->height())
never evaluated: ny + h > d->rasterBuffer->height()
0
2642 h = d->rasterBuffer->height() - ny;
never executed: h = d->rasterBuffer->height() - ny;
0
2643 -
2644 rx = nx;
never executed (the execution status of this line is deduced): rx = nx;
-
2645 ry = ny;
never executed (the execution status of this line is deduced): ry = ny;
-
2646 }
never executed: }
0
2647 if (depth == 8 && s->penData.alphamapBlit) {
partially evaluated: depth == 8
TRUEFALSE
yes
Evaluation Count:513
no
Evaluation Count:0
partially evaluated: s->penData.alphamapBlit
TRUEFALSE
yes
Evaluation Count:513
no
Evaluation Count:0
0-513
2648 s->penData.alphamapBlit(rb, rx, ry, s->penData.solid.color,
executed (the execution status of this line is deduced): s->penData.alphamapBlit(rb, rx, ry, s->penData.solid.color,
-
2649 scanline, w, h, bpl, clip);
executed (the execution status of this line is deduced): scanline, w, h, bpl, clip);
-
2650 } else if (depth == 32 && s->penData.alphaRGBBlit) {
executed: }
Execution Count:513
never evaluated: depth == 32
never evaluated: s->penData.alphaRGBBlit
0-513
2651 s->penData.alphaRGBBlit(rb, rx, ry, s->penData.solid.color,
never executed (the execution status of this line is deduced): s->penData.alphaRGBBlit(rb, rx, ry, s->penData.solid.color,
-
2652 (const uint *) scanline, w, h, bpl / 4, clip);
never executed (the execution status of this line is deduced): (const uint *) scanline, w, h, bpl / 4, clip);
-
2653 }
never executed: }
0
2654 return;
executed: return;
Execution Count:513
513
2655 } -
2656 } -
2657 -
2658 int x0 = 0;
executed (the execution status of this line is deduced): int x0 = 0;
-
2659 if (rx < 0) {
evaluated: rx < 0
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:8035
9-8035
2660 x0 = -rx;
executed (the execution status of this line is deduced): x0 = -rx;
-
2661 w -= x0;
executed (the execution status of this line is deduced): w -= x0;
-
2662 }
executed: }
Execution Count:9
9
2663 -
2664 int y0 = 0;
executed (the execution status of this line is deduced): int y0 = 0;
-
2665 if (ry < 0) {
evaluated: ry < 0
TRUEFALSE
yes
Evaluation Count:102
yes
Evaluation Count:7942
102-7942
2666 y0 = -ry;
executed (the execution status of this line is deduced): y0 = -ry;
-
2667 scanline += bpl * y0;
executed (the execution status of this line is deduced): scanline += bpl * y0;
-
2668 h -= y0;
executed (the execution status of this line is deduced): h -= y0;
-
2669 }
executed: }
Execution Count:102
102
2670 -
2671 w = qMin(w, rb->width() - qMax(0, rx));
executed (the execution status of this line is deduced): w = qMin(w, rb->width() - qMax(0, rx));
-
2672 h = qMin(h, rb->height() - qMax(0, ry));
executed (the execution status of this line is deduced): h = qMin(h, rb->height() - qMax(0, ry));
-
2673 -
2674 if (w <= 0 || h <= 0)
partially evaluated: w <= 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8044
partially evaluated: h <= 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8044
0-8044
2675 return;
never executed: return;
0
2676 -
2677 const int NSPANS = 256;
executed (the execution status of this line is deduced): const int NSPANS = 256;
-
2678 QSpan spans[NSPANS];
executed (the execution status of this line is deduced): QSpan spans[NSPANS];
-
2679 int current = 0;
executed (the execution status of this line is deduced): int current = 0;
-
2680 -
2681 const int x1 = x0 + w;
executed (the execution status of this line is deduced): const int x1 = x0 + w;
-
2682 const int y1 = y0 + h;
executed (the execution status of this line is deduced): const int y1 = y0 + h;
-
2683 -
2684 if (depth == 1) {
evaluated: depth == 1
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:8040
4-8040
2685 for (int y = y0; y < y1; ++y) {
evaluated: y < y1
TRUEFALSE
yes
Evaluation Count:44
yes
Evaluation Count:4
4-44
2686 for (int x = x0; x < x1; ) {
evaluated: x < x1
TRUEFALSE
yes
Evaluation Count:316
yes
Evaluation Count:44
44-316
2687 if (!monoVal(scanline, x)) {
evaluated: !monoVal(scanline, x)
TRUEFALSE
yes
Evaluation Count:264
yes
Evaluation Count:52
52-264
2688 ++x;
executed (the execution status of this line is deduced): ++x;
-
2689 continue;
executed: continue;
Execution Count:264
264
2690 } -
2691 -
2692 if (current == NSPANS) {
partially evaluated: current == NSPANS
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:52
0-52
2693 blend(current, spans, &s->penData);
never executed (the execution status of this line is deduced): blend(current, spans, &s->penData);
-
2694 current = 0;
never executed (the execution status of this line is deduced): current = 0;
-
2695 }
never executed: }
0
2696 spans[current].x = x + rx;
executed (the execution status of this line is deduced): spans[current].x = x + rx;
-
2697 spans[current].y = y + ry;
executed (the execution status of this line is deduced): spans[current].y = y + ry;
-
2698 spans[current].coverage = 255;
executed (the execution status of this line is deduced): spans[current].coverage = 255;
-
2699 int len = 1;
executed (the execution status of this line is deduced): int len = 1;
-
2700 ++x;
executed (the execution status of this line is deduced): ++x;
-
2701 // extend span until we find a different one. -
2702 while (x < x1 && monoVal(scanline, x)) {
evaluated: x < x1
TRUEFALSE
yes
Evaluation Count:76
yes
Evaluation Count:12
evaluated: monoVal(scanline, x)
TRUEFALSE
yes
Evaluation Count:36
yes
Evaluation Count:40
12-76
2703 ++x;
executed (the execution status of this line is deduced): ++x;
-
2704 ++len;
executed (the execution status of this line is deduced): ++len;
-
2705 }
executed: }
Execution Count:36
36
2706 spans[current].len = len;
executed (the execution status of this line is deduced): spans[current].len = len;
-
2707 ++current;
executed (the execution status of this line is deduced): ++current;
-
2708 }
executed: }
Execution Count:52
52
2709 scanline += bpl;
executed (the execution status of this line is deduced): scanline += bpl;
-
2710 }
executed: }
Execution Count:44
44
2711 } else if (depth == 8) {
executed: }
Execution Count:4
partially evaluated: depth == 8
TRUEFALSE
yes
Evaluation Count:8040
no
Evaluation Count:0
0-8040
2712 for (int y = y0; y < y1; ++y) {
evaluated: y < y1
TRUEFALSE
yes
Evaluation Count:49031
yes
Evaluation Count:8040
8040-49031
2713 for (int x = x0; x < x1; ) {
evaluated: x < x1
TRUEFALSE
yes
Evaluation Count:349673
yes
Evaluation Count:49031
49031-349673
2714 // Skip those with 0 coverage -
2715 if (scanline[x] == 0) {
evaluated: scanline[x] == 0
TRUEFALSE
yes
Evaluation Count:164618
yes
Evaluation Count:185055
164618-185055
2716 ++x;
executed (the execution status of this line is deduced): ++x;
-
2717 continue;
executed: continue;
Execution Count:164618
164618
2718 } -
2719 -
2720 if (current == NSPANS) {
partially evaluated: current == NSPANS
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:185055
0-185055
2721 blend(current, spans, &s->penData);
never executed (the execution status of this line is deduced): blend(current, spans, &s->penData);
-
2722 current = 0;
never executed (the execution status of this line is deduced): current = 0;
-
2723 }
never executed: }
0
2724 int coverage = scanline[x];
executed (the execution status of this line is deduced): int coverage = scanline[x];
-
2725 spans[current].x = x + rx;
executed (the execution status of this line is deduced): spans[current].x = x + rx;
-
2726 spans[current].y = y + ry;
executed (the execution status of this line is deduced): spans[current].y = y + ry;
-
2727 spans[current].coverage = coverage;
executed (the execution status of this line is deduced): spans[current].coverage = coverage;
-
2728 int len = 1;
executed (the execution status of this line is deduced): int len = 1;
-
2729 ++x;
executed (the execution status of this line is deduced): ++x;
-
2730 -
2731 // extend span until we find a different one. -
2732 while (x < x1 && scanline[x] == coverage) {
evaluated: x < x1
TRUEFALSE
yes
Evaluation Count:192142
yes
Evaluation Count:22104
evaluated: scanline[x] == coverage
TRUEFALSE
yes
Evaluation Count:29191
yes
Evaluation Count:162951
22104-192142
2733 ++x;
executed (the execution status of this line is deduced): ++x;
-
2734 ++len;
executed (the execution status of this line is deduced): ++len;
-
2735 }
executed: }
Execution Count:29191
29191
2736 spans[current].len = len;
executed (the execution status of this line is deduced): spans[current].len = len;
-
2737 ++current;
executed (the execution status of this line is deduced): ++current;
-
2738 }
executed: }
Execution Count:185055
185055
2739 scanline += bpl;
executed (the execution status of this line is deduced): scanline += bpl;
-
2740 }
executed: }
Execution Count:49031
49031
2741 } else { // 32-bit alpha...
executed: }
Execution Count:8040
8040
2742 uint *sl = (uint *) src;
never executed (the execution status of this line is deduced): uint *sl = (uint *) src;
-
2743 for (int y = y0; y < y1; ++y) {
never evaluated: y < y1
0
2744 for (int x = x0; x < x1; ) {
never evaluated: x < x1
0
2745 // Skip those with 0 coverage -
2746 if ((sl[x] & 0x00ffffff) == 0) {
never evaluated: (sl[x] & 0x00ffffff) == 0
0
2747 ++x;
never executed (the execution status of this line is deduced): ++x;
-
2748 continue;
never executed: continue;
0
2749 } -
2750 -
2751 if (current == NSPANS) {
never evaluated: current == NSPANS
0
2752 blend(current, spans, &s->penData);
never executed (the execution status of this line is deduced): blend(current, spans, &s->penData);
-
2753 current = 0;
never executed (the execution status of this line is deduced): current = 0;
-
2754 }
never executed: }
0
2755 uint rgbCoverage = sl[x];
never executed (the execution status of this line is deduced): uint rgbCoverage = sl[x];
-
2756 int coverage = qGreen(rgbCoverage);
never executed (the execution status of this line is deduced): int coverage = qGreen(rgbCoverage);
-
2757 spans[current].x = x + rx;
never executed (the execution status of this line is deduced): spans[current].x = x + rx;
-
2758 spans[current].y = y + ry;
never executed (the execution status of this line is deduced): spans[current].y = y + ry;
-
2759 spans[current].coverage = coverage;
never executed (the execution status of this line is deduced): spans[current].coverage = coverage;
-
2760 int len = 1;
never executed (the execution status of this line is deduced): int len = 1;
-
2761 ++x;
never executed (the execution status of this line is deduced): ++x;
-
2762 -
2763 // extend span until we find a different one. -
2764 while (x < x1 && sl[x] == rgbCoverage) {
never evaluated: x < x1
never evaluated: sl[x] == rgbCoverage
0
2765 ++x;
never executed (the execution status of this line is deduced): ++x;
-
2766 ++len;
never executed (the execution status of this line is deduced): ++len;
-
2767 }
never executed: }
0
2768 spans[current].len = len;
never executed (the execution status of this line is deduced): spans[current].len = len;
-
2769 ++current;
never executed (the execution status of this line is deduced): ++current;
-
2770 }
never executed: }
0
2771 sl += bpl / sizeof(uint);
never executed (the execution status of this line is deduced): sl += bpl / sizeof(uint);
-
2772 }
never executed: }
0
2773 }
never executed: }
0
2774// qDebug() << "alphaPenBlt: num spans=" << current -
2775// << "span:" << spans->x << spans->y << spans->len << spans->coverage; -
2776 // Call span func for current set of spans. -
2777 if (current != 0)
partially evaluated: current != 0
TRUEFALSE
yes
Evaluation Count:8044
no
Evaluation Count:0
0-8044
2778 blend(current, spans, &s->penData);
executed: blend(current, spans, &s->penData);
Execution Count:8044
8044
2779}
executed: }
Execution Count:8044
8044
2780 -
2781/*! -
2782 \internal -
2783*/ -
2784bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, -
2785 const QFixedPoint *positions, QFontEngine *fontEngine) -
2786{ -
2787 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
2788 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
2789 -
2790 if (fontEngine->hasInternalCaching()) {
evaluated: fontEngine->hasInternalCaching()
TRUEFALSE
yes
Evaluation Count:23002
yes
Evaluation Count:8
8-23002
2791 QFontEngine::GlyphFormat neededFormat =
executed (the execution status of this line is deduced): QFontEngine::GlyphFormat neededFormat =
-
2792 painter()->device()->devType() == QInternal::Widget
evaluated: painter()->device()->devType() == QInternal::Widget
TRUEFALSE
yes
Evaluation Count:22054
yes
Evaluation Count:948
948-22054
2793 ? QFontEngine::Format_None
executed (the execution status of this line is deduced): ? QFontEngine::Format_None
-
2794 : QFontEngine::Format_A8;
executed (the execution status of this line is deduced): : QFontEngine::Format_A8;
-
2795 -
2796 if (d_func()->mono_surface) // alphaPenBlt can handle mono, too
evaluated: d_func()->mono_surface
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:23001
1-23001
2797 neededFormat = QFontEngine::Format_Mono;
executed: neededFormat = QFontEngine::Format_Mono;
Execution Count:1
1
2798 -
2799 for (int i = 0; i < numGlyphs; i++) {
evaluated: i < numGlyphs
TRUEFALSE
yes
Evaluation Count:145074
yes
Evaluation Count:23002
23002-145074
2800 QFixed spp = fontEngine->subPixelPositionForX(positions[i].x);
executed (the execution status of this line is deduced): QFixed spp = fontEngine->subPixelPositionForX(positions[i].x);
-
2801 -
2802 QPoint offset;
executed (the execution status of this line is deduced): QPoint offset;
-
2803 QImage *alphaMap = fontEngine->lockedAlphaMapForGlyph(glyphs[i], spp, neededFormat, s->matrix,
executed (the execution status of this line is deduced): QImage *alphaMap = fontEngine->lockedAlphaMapForGlyph(glyphs[i], spp, neededFormat, s->matrix,
-
2804 &offset);
executed (the execution status of this line is deduced): &offset);
-
2805 if (alphaMap == 0 || alphaMap->isNull())
evaluated: alphaMap == 0
TRUEFALSE
yes
Evaluation Count:11364
yes
Evaluation Count:133710
evaluated: alphaMap->isNull()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:133709
1-133710
2806 continue;
executed: continue;
Execution Count:11365
11365
2807 -
2808 alphaPenBlt(alphaMap->bits(), alphaMap->bytesPerLine(), alphaMap->depth(),
executed (the execution status of this line is deduced): alphaPenBlt(alphaMap->bits(), alphaMap->bytesPerLine(), alphaMap->depth(),
-
2809 qFloor(positions[i].x) + offset.x(),
executed (the execution status of this line is deduced): qFloor(positions[i].x) + offset.x(),
-
2810 qRound(positions[i].y) + offset.y(),
executed (the execution status of this line is deduced): qRound(positions[i].y) + offset.y(),
-
2811 alphaMap->width(), alphaMap->height());
executed (the execution status of this line is deduced): alphaMap->width(), alphaMap->height());
-
2812 -
2813 fontEngine->unlockAlphaMapForGlyph();
executed (the execution status of this line is deduced): fontEngine->unlockAlphaMapForGlyph();
-
2814 }
executed: }
Execution Count:133709
133709
2815 -
2816 } else {
executed: }
Execution Count:23002
23002
2817 QFontEngineGlyphCache::Type glyphType = fontEngine->glyphFormat >= 0 ? QFontEngineGlyphCache::Type(fontEngine->glyphFormat) : d->glyphCacheType;
partially evaluated: fontEngine->glyphFormat >= 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
2818 -
2819 QImageTextureGlyphCache *cache =
executed (the execution status of this line is deduced): QImageTextureGlyphCache *cache =
-
2820 static_cast<QImageTextureGlyphCache *>(fontEngine->glyphCache(0, glyphType, s->matrix));
executed (the execution status of this line is deduced): static_cast<QImageTextureGlyphCache *>(fontEngine->glyphCache(0, glyphType, s->matrix));
-
2821 if (!cache) {
evaluated: !cache
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:7
1-7
2822 cache = new QImageTextureGlyphCache(glyphType, s->matrix);
executed (the execution status of this line is deduced): cache = new QImageTextureGlyphCache(glyphType, s->matrix);
-
2823 fontEngine->setGlyphCache(0, cache);
executed (the execution status of this line is deduced): fontEngine->setGlyphCache(0, cache);
-
2824 }
executed: }
Execution Count:1
1
2825 -
2826 cache->populate(fontEngine, numGlyphs, glyphs, positions);
executed (the execution status of this line is deduced): cache->populate(fontEngine, numGlyphs, glyphs, positions);
-
2827 cache->fillInPendingGlyphs();
executed (the execution status of this line is deduced): cache->fillInPendingGlyphs();
-
2828 -
2829 const QImage &image = cache->image();
executed (the execution status of this line is deduced): const QImage &image = cache->image();
-
2830 int bpl = image.bytesPerLine();
executed (the execution status of this line is deduced): int bpl = image.bytesPerLine();
-
2831 -
2832 int depth = image.depth();
executed (the execution status of this line is deduced): int depth = image.depth();
-
2833 int rightShift = 0;
executed (the execution status of this line is deduced): int rightShift = 0;
-
2834 int leftShift = 0;
executed (the execution status of this line is deduced): int leftShift = 0;
-
2835 if (depth == 32)
partially evaluated: depth == 32
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
2836 leftShift = 2; // multiply by 4
never executed: leftShift = 2;
0
2837 else if (depth == 1)
partially evaluated: depth == 1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
2838 rightShift = 3; // divide by 8
never executed: rightShift = 3;
0
2839 -
2840 int margin = fontEngine->glyphMargin(glyphType);
executed (the execution status of this line is deduced): int margin = fontEngine->glyphMargin(glyphType);
-
2841 const uchar *bits = image.bits();
executed (the execution status of this line is deduced): const uchar *bits = image.bits();
-
2842 for (int i=0; i<numGlyphs; ++i) {
evaluated: i<numGlyphs
TRUEFALSE
yes
Evaluation Count:24
yes
Evaluation Count:8
8-24
2843 -
2844 QFixed subPixelPosition = fontEngine->subPixelPositionForX(positions[i].x);
executed (the execution status of this line is deduced): QFixed subPixelPosition = fontEngine->subPixelPositionForX(positions[i].x);
-
2845 QTextureGlyphCache::GlyphAndSubPixelPosition glyph(glyphs[i], subPixelPosition);
executed (the execution status of this line is deduced): QTextureGlyphCache::GlyphAndSubPixelPosition glyph(glyphs[i], subPixelPosition);
-
2846 const QTextureGlyphCache::Coord &c = cache->coords[glyph];
executed (the execution status of this line is deduced): const QTextureGlyphCache::Coord &c = cache->coords[glyph];
-
2847 if (c.isNull())
partially evaluated: c.isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:24
0-24
2848 continue;
never executed: continue;
0
2849 -
2850 int x = qFloor(positions[i].x) + c.baseLineX - margin;
executed (the execution status of this line is deduced): int x = qFloor(positions[i].x) + c.baseLineX - margin;
-
2851 int y = qRound(positions[i].y) - c.baseLineY - margin;
executed (the execution status of this line is deduced): int y = qRound(positions[i].y) - c.baseLineY - margin;
-
2852 -
2853 // printf("drawing [%d %d %d %d] baseline [%d %d], glyph: %d, to: %d %d, pos: %d %d\n", -
2854 // c.x, c.y, -
2855 // c.w, c.h, -
2856 // c.baseLineX, c.baseLineY, -
2857 // glyphs[i], -
2858 // x, y, -
2859 // positions[i].x.toInt(), positions[i].y.toInt()); -
2860 -
2861 alphaPenBlt(bits + ((c.x << leftShift) >> rightShift) + c.y * bpl, bpl, depth, x, y, c.w, c.h);
executed (the execution status of this line is deduced): alphaPenBlt(bits + ((c.x << leftShift) >> rightShift) + c.y * bpl, bpl, depth, x, y, c.w, c.h);
-
2862 }
executed: }
Execution Count:24
24
2863 }
executed: }
Execution Count:8
8
2864 return true;
executed: return true;
Execution Count:23010
23010
2865} -
2866 -
2867 -
2868/*! -
2869 * Returns true if the rectangle is completely within the current clip -
2870 * state of the paint engine. -
2871 */ -
2872bool QRasterPaintEnginePrivate::isUnclipped_normalized(const QRect &r) const -
2873{ -
2874 const QClipData *cl = clip();
executed (the execution status of this line is deduced): const QClipData *cl = clip();
-
2875 if (!cl) {
partially evaluated: !cl
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1669
0-1669
2876 // inline contains() for performance (we know the rects are normalized) -
2877 const QRect &r1 = deviceRect;
never executed (the execution status of this line is deduced): const QRect &r1 = deviceRect;
-
2878 return (r.left() >= r1.left() && r.right() <= r1.right()
never executed: return (r.left() >= r1.left() && r.right() <= r1.right() && r.top() >= r1.top() && r.bottom() <= r1.bottom());
0
2879 && r.top() >= r1.top() && r.bottom() <= r1.bottom());
never executed: return (r.left() >= r1.left() && r.right() <= r1.right() && r.top() >= r1.top() && r.bottom() <= r1.bottom());
0
2880 } -
2881 -
2882 -
2883 if (cl->hasRectClip) {
partially evaluated: cl->hasRectClip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1669
0-1669
2884 // currently all painting functions clips to deviceRect internally -
2885 if (cl->clipRect == deviceRect)
never evaluated: cl->clipRect == deviceRect
0
2886 return true;
never executed: return true;
0
2887 -
2888 // inline contains() for performance (we know the rects are normalized) -
2889 const QRect &r1 = cl->clipRect;
never executed (the execution status of this line is deduced): const QRect &r1 = cl->clipRect;
-
2890 return (r.left() >= r1.left() && r.right() <= r1.right()
never executed: return (r.left() >= r1.left() && r.right() <= r1.right() && r.top() >= r1.top() && r.bottom() <= r1.bottom());
0
2891 && r.top() >= r1.top() && r.bottom() <= r1.bottom());
never executed: return (r.left() >= r1.left() && r.right() <= r1.right() && r.top() >= r1.top() && r.bottom() <= r1.bottom());
0
2892 } else { -
2893 return qt_region_strictContains(cl->clipRegion, r);
executed: return qt_region_strictContains(cl->clipRegion, r);
Execution Count:1669
1669
2894 } -
2895} -
2896 -
2897bool QRasterPaintEnginePrivate::isUnclipped(const QRect &rect, -
2898 int penWidth) const -
2899{ -
2900 Q_Q(const QRasterPaintEngine);
executed (the execution status of this line is deduced): const QRasterPaintEngine * const q = q_func();
-
2901 const QRasterPaintEngineState *s = q->state();
executed (the execution status of this line is deduced): const QRasterPaintEngineState *s = q->state();
-
2902 const QClipData *cl = clip();
executed (the execution status of this line is deduced): const QClipData *cl = clip();
-
2903 if (!cl) {
partially evaluated: !cl
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:138665
0-138665
2904 QRect r = rect.normalized();
never executed (the execution status of this line is deduced): QRect r = rect.normalized();
-
2905 // inline contains() for performance (we know the rects are normalized) -
2906 const QRect &r1 = deviceRect;
never executed (the execution status of this line is deduced): const QRect &r1 = deviceRect;
-
2907 return (r.left() >= r1.left() && r.right() <= r1.right()
never executed: return (r.left() >= r1.left() && r.right() <= r1.right() && r.top() >= r1.top() && r.bottom() <= r1.bottom());
0
2908 && r.top() >= r1.top() && r.bottom() <= r1.bottom());
never executed: return (r.left() >= r1.left() && r.right() <= r1.right() && r.top() >= r1.top() && r.bottom() <= r1.bottom());
0
2909 } -
2910 -
2911 -
2912 // currently all painting functions that call this function clip to deviceRect internally -
2913 if (cl->hasRectClip && cl->clipRect == deviceRect)
evaluated: cl->hasRectClip
TRUEFALSE
yes
Evaluation Count:137688
yes
Evaluation Count:977
evaluated: cl->clipRect == deviceRect
TRUEFALSE
yes
Evaluation Count:137530
yes
Evaluation Count:158
158-137688
2914 return true;
executed: return true;
Execution Count:137530
137530
2915 -
2916 if (s->flags.antialiased)
evaluated: s->flags.antialiased
TRUEFALSE
yes
Evaluation Count:78
yes
Evaluation Count:1057
78-1057
2917 ++penWidth;
executed: ++penWidth;
Execution Count:78
78
2918 -
2919 QRect r = rect.normalized();
executed (the execution status of this line is deduced): QRect r = rect.normalized();
-
2920 if (penWidth > 0) {
evaluated: penWidth > 0
TRUEFALSE
yes
Evaluation Count:149
yes
Evaluation Count:986
149-986
2921 r.setX(r.x() - penWidth);
executed (the execution status of this line is deduced): r.setX(r.x() - penWidth);
-
2922 r.setY(r.y() - penWidth);
executed (the execution status of this line is deduced): r.setY(r.y() - penWidth);
-
2923 r.setWidth(r.width() + 2 * penWidth);
executed (the execution status of this line is deduced): r.setWidth(r.width() + 2 * penWidth);
-
2924 r.setHeight(r.height() + 2 * penWidth);
executed (the execution status of this line is deduced): r.setHeight(r.height() + 2 * penWidth);
-
2925 }
executed: }
Execution Count:149
149
2926 -
2927 if (cl->hasRectClip) {
evaluated: cl->hasRectClip
TRUEFALSE
yes
Evaluation Count:158
yes
Evaluation Count:977
158-977
2928 // inline contains() for performance (we know the rects are normalized) -
2929 const QRect &r1 = cl->clipRect;
executed (the execution status of this line is deduced): const QRect &r1 = cl->clipRect;
-
2930 return (r.left() >= r1.left() && r.right() <= r1.right()
executed: return (r.left() >= r1.left() && r.right() <= r1.right() && r.top() >= r1.top() && r.bottom() <= r1.bottom());
Execution Count:158
158
2931 && r.top() >= r1.top() && r.bottom() <= r1.bottom());
executed: return (r.left() >= r1.left() && r.right() <= r1.right() && r.top() >= r1.top() && r.bottom() <= r1.bottom());
Execution Count:158
158
2932 } else { -
2933 return qt_region_strictContains(cl->clipRegion, r);
executed: return qt_region_strictContains(cl->clipRegion, r);
Execution Count:977
977
2934 } -
2935} -
2936 -
2937inline bool QRasterPaintEnginePrivate::isUnclipped(const QRectF &rect, -
2938 int penWidth) const -
2939{ -
2940 return isUnclipped(rect.normalized().toAlignedRect(), penWidth);
executed: return isUnclipped(rect.normalized().toAlignedRect(), penWidth);
Execution Count:3551
3551
2941} -
2942 -
2943inline ProcessSpans -
2944QRasterPaintEnginePrivate::getBrushFunc(const QRect &rect, -
2945 const QSpanData *data) const -
2946{ -
2947 return isUnclipped(rect, 0) ? data->unclipped_blend : data->blend;
executed: return isUnclipped(rect, 0) ? data->unclipped_blend : data->blend;
Execution Count:135114
135114
2948} -
2949 -
2950inline ProcessSpans -
2951QRasterPaintEnginePrivate::getBrushFunc(const QRectF &rect, -
2952 const QSpanData *data) const -
2953{ -
2954 return isUnclipped(rect, 0) ? data->unclipped_blend : data->blend;
executed: return isUnclipped(rect, 0) ? data->unclipped_blend : data->blend;
Execution Count:2396
2396
2955} -
2956 -
2957inline ProcessSpans -
2958QRasterPaintEnginePrivate::getPenFunc(const QRectF &rect, -
2959 const QSpanData *data) const -
2960{ -
2961 Q_Q(const QRasterPaintEngine);
executed (the execution status of this line is deduced): const QRasterPaintEngine * const q = q_func();
-
2962 const QRasterPaintEngineState *s = q->state();
executed (the execution status of this line is deduced): const QRasterPaintEngineState *s = q->state();
-
2963 -
2964 if (!s->flags.fast_pen && s->matrix.type() > QTransform::TxTranslate)
evaluated: !s->flags.fast_pen
TRUEFALSE
yes
Evaluation Count:97
yes
Evaluation Count:1058
partially evaluated: s->matrix.type() > QTransform::TxTranslate
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:97
0-1058
2965 return data->blend;
never executed: return data->blend;
0
2966 const int penWidth = s->flags.fast_pen ? 1 : qCeil(s->lastPen.widthF());
evaluated: s->flags.fast_pen
TRUEFALSE
yes
Evaluation Count:1058
yes
Evaluation Count:97
97-1058
2967 return isUnclipped(rect, penWidth) ? data->unclipped_blend : data->blend;
executed: return isUnclipped(rect, penWidth) ? data->unclipped_blend : data->blend;
Execution Count:1155
1155
2968} -
2969 -
2970static QPair<int, int> visibleGlyphRange(const QRectF &clip, QFontEngine *fontEngine, -
2971 glyph_t *glyphs, QFixedPoint *positions, int numGlyphs) -
2972{ -
2973 QFixed clipLeft = QFixed::fromReal(clip.left());
executed (the execution status of this line is deduced): QFixed clipLeft = QFixed::fromReal(clip.left());
-
2974 QFixed clipRight = QFixed::fromReal(clip.right());
executed (the execution status of this line is deduced): QFixed clipRight = QFixed::fromReal(clip.right());
-
2975 QFixed clipTop = QFixed::fromReal(clip.top());
executed (the execution status of this line is deduced): QFixed clipTop = QFixed::fromReal(clip.top());
-
2976 QFixed clipBottom = QFixed::fromReal(clip.bottom());
executed (the execution status of this line is deduced): QFixed clipBottom = QFixed::fromReal(clip.bottom());
-
2977 -
2978 int first = 0;
executed (the execution status of this line is deduced): int first = 0;
-
2979 while (first < numGlyphs) {
partially evaluated: first < numGlyphs
TRUEFALSE
yes
Evaluation Count:217
no
Evaluation Count:0
0-217
2980 glyph_metrics_t metrics = fontEngine->boundingBox(glyphs[first]);
executed (the execution status of this line is deduced): glyph_metrics_t metrics = fontEngine->boundingBox(glyphs[first]);
-
2981 QFixed left = metrics.x + positions[first].x;
executed (the execution status of this line is deduced): QFixed left = metrics.x + positions[first].x;
-
2982 QFixed top = metrics.y + positions[first].y;
executed (the execution status of this line is deduced): QFixed top = metrics.y + positions[first].y;
-
2983 QFixed right = left + metrics.width;
executed (the execution status of this line is deduced): QFixed right = left + metrics.width;
-
2984 QFixed bottom = top + metrics.height;
executed (the execution status of this line is deduced): QFixed bottom = top + metrics.height;
-
2985 if (left < clipRight && right > clipLeft && top < clipBottom && bottom > clipTop)
partially evaluated: left < clipRight
TRUEFALSE
yes
Evaluation Count:217
no
Evaluation Count:0
evaluated: right > clipLeft
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:198
partially evaluated: top < clipBottom
TRUEFALSE
yes
Evaluation Count:19
no
Evaluation Count:0
partially evaluated: bottom > clipTop
TRUEFALSE
yes
Evaluation Count:19
no
Evaluation Count:0
0-217
2986 break;
executed: break;
Execution Count:19
19
2987 ++first;
executed (the execution status of this line is deduced): ++first;
-
2988 }
executed: }
Execution Count:198
198
2989 int last = numGlyphs - 1;
executed (the execution status of this line is deduced): int last = numGlyphs - 1;
-
2990 while (last > first) {
partially evaluated: last > first
TRUEFALSE
yes
Evaluation Count:254
no
Evaluation Count:0
0-254
2991 glyph_metrics_t metrics = fontEngine->boundingBox(glyphs[last]);
executed (the execution status of this line is deduced): glyph_metrics_t metrics = fontEngine->boundingBox(glyphs[last]);
-
2992 QFixed left = metrics.x + positions[last].x;
executed (the execution status of this line is deduced): QFixed left = metrics.x + positions[last].x;
-
2993 QFixed top = metrics.y + positions[last].y;
executed (the execution status of this line is deduced): QFixed top = metrics.y + positions[last].y;
-
2994 QFixed right = left + metrics.width;
executed (the execution status of this line is deduced): QFixed right = left + metrics.width;
-
2995 QFixed bottom = top + metrics.height;
executed (the execution status of this line is deduced): QFixed bottom = top + metrics.height;
-
2996 if (left < clipRight && right > clipLeft && top < clipBottom && bottom > clipTop)
evaluated: left < clipRight
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:235
partially evaluated: right > clipLeft
TRUEFALSE
yes
Evaluation Count:19
no
Evaluation Count:0
partially evaluated: top < clipBottom
TRUEFALSE
yes
Evaluation Count:19
no
Evaluation Count:0
partially evaluated: bottom > clipTop
TRUEFALSE
yes
Evaluation Count:19
no
Evaluation Count:0
0-235
2997 break;
executed: break;
Execution Count:19
19
2998 --last;
executed (the execution status of this line is deduced): --last;
-
2999 }
executed: }
Execution Count:235
235
3000 return QPair<int, int>(first, last + 1);
executed: return QPair<int, int>(first, last + 1);
Execution Count:19
19
3001} -
3002 -
3003/*! -
3004 \reimp -
3005*/ -
3006void QRasterPaintEngine::drawStaticTextItem(QStaticTextItem *textItem) -
3007{ -
3008 if (textItem->numGlyphs == 0)
partially evaluated: textItem->numGlyphs == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
0-12
3009 return;
never executed: return;
0
3010 -
3011 ensurePen();
never executed (the execution status of this line is deduced): ensurePen();
-
3012 ensureRasterState();
never executed (the execution status of this line is deduced): ensureRasterState();
-
3013 -
3014 QFontEngine *fontEngine = textItem->fontEngine();
never executed (the execution status of this line is deduced): QFontEngine *fontEngine = textItem->fontEngine();
-
3015 if (!supportsTransformations(fontEngine)) {
partially evaluated: !supportsTransformations(fontEngine)
TRUEFALSE
yes
Evaluation Count:12
no
Evaluation Count:0
0-12
3016 drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->glyphPositions,
executed (the execution status of this line is deduced): drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->glyphPositions,
-
3017 fontEngine);
executed (the execution status of this line is deduced): fontEngine);
-
3018 } else if (state()->matrix.type() < QTransform::TxProject) {
executed: }
Execution Count:12
never evaluated: state()->matrix.type() < QTransform::TxProject
0-12
3019 bool invertible;
never executed (the execution status of this line is deduced): bool invertible;
-
3020 QTransform invMat = state()->matrix.inverted(&invertible);
never executed (the execution status of this line is deduced): QTransform invMat = state()->matrix.inverted(&invertible);
-
3021 if (!invertible)
never evaluated: !invertible
0
3022 return;
never executed: return;
0
3023 -
3024 QPair<int, int> range = visibleGlyphRange(invMat.mapRect(clipBoundingRect()),
never executed (the execution status of this line is deduced): QPair<int, int> range = visibleGlyphRange(invMat.mapRect(clipBoundingRect()),
-
3025 textItem->fontEngine(), textItem->glyphs,
never executed (the execution status of this line is deduced): textItem->fontEngine(), textItem->glyphs,
-
3026 textItem->glyphPositions, textItem->numGlyphs);
never executed (the execution status of this line is deduced): textItem->glyphPositions, textItem->numGlyphs);
-
3027 QStaticTextItem copy = *textItem;
never executed (the execution status of this line is deduced): QStaticTextItem copy = *textItem;
-
3028 copy.glyphs += range.first;
never executed (the execution status of this line is deduced): copy.glyphs += range.first;
-
3029 copy.glyphPositions += range.first;
never executed (the execution status of this line is deduced): copy.glyphPositions += range.first;
-
3030 copy.numGlyphs = range.second - range.first;
never executed (the execution status of this line is deduced): copy.numGlyphs = range.second - range.first;
-
3031 QPaintEngineEx::drawStaticTextItem(&copy);
never executed (the execution status of this line is deduced): QPaintEngineEx::drawStaticTextItem(&copy);
-
3032 } else {
never executed: }
0
3033 QPaintEngineEx::drawStaticTextItem(textItem);
never executed (the execution status of this line is deduced): QPaintEngineEx::drawStaticTextItem(textItem);
-
3034 }
never executed: }
0
3035} -
3036 -
3037/*! -
3038 \reimp -
3039*/ -
3040void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem) -
3041{ -
3042 const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);
executed (the execution status of this line is deduced): const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);
-
3043 -
3044#ifdef QT_DEBUG_DRAW -
3045 Q_D(QRasterPaintEngine); -
3046 fprintf(stderr," - QRasterPaintEngine::drawTextItem(), (%.2f,%.2f), string=%s ct=%d\n", -
3047 p.x(), p.y(), QString::fromRawData(ti.chars, ti.num_chars).toLatin1().data(), -
3048 d->glyphCacheType); -
3049#endif -
3050 -
3051 if (ti.glyphs.numGlyphs == 0)
partially evaluated: ti.glyphs.numGlyphs == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:23017
0-23017
3052 return;
never executed: return;
0
3053 ensurePen();
executed (the execution status of this line is deduced): ensurePen();
-
3054 ensureRasterState();
executed (the execution status of this line is deduced): ensureRasterState();
-
3055 -
3056 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
3057 QTransform matrix = s->matrix;
executed (the execution status of this line is deduced): QTransform matrix = s->matrix;
-
3058 -
3059 if (!supportsTransformations(ti.fontEngine)) {
evaluated: !supportsTransformations(ti.fontEngine)
TRUEFALSE
yes
Evaluation Count:22998
yes
Evaluation Count:19
19-22998
3060 QVarLengthArray<QFixedPoint> positions;
executed (the execution status of this line is deduced): QVarLengthArray<QFixedPoint> positions;
-
3061 QVarLengthArray<glyph_t> glyphs;
executed (the execution status of this line is deduced): QVarLengthArray<glyph_t> glyphs;
-
3062 -
3063 matrix.translate(p.x(), p.y());
executed (the execution status of this line is deduced): matrix.translate(p.x(), p.y());
-
3064 ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);
executed (the execution status of this line is deduced): ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);
-
3065 -
3066 drawCachedGlyphs(glyphs.size(), glyphs.constData(), positions.constData(), ti.fontEngine);
executed (the execution status of this line is deduced): drawCachedGlyphs(glyphs.size(), glyphs.constData(), positions.constData(), ti.fontEngine);
-
3067 } else if (matrix.type() < QTransform::TxProject) {
executed: }
Execution Count:22998
partially evaluated: matrix.type() < QTransform::TxProject
TRUEFALSE
yes
Evaluation Count:19
no
Evaluation Count:0
0-22998
3068 bool invertible;
executed (the execution status of this line is deduced): bool invertible;
-
3069 QTransform invMat = matrix.inverted(&invertible);
executed (the execution status of this line is deduced): QTransform invMat = matrix.inverted(&invertible);
-
3070 if (!invertible)
partially evaluated: !invertible
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:19
0-19
3071 return;
never executed: return;
0
3072 -
3073 QVarLengthArray<QFixedPoint> positions;
executed (the execution status of this line is deduced): QVarLengthArray<QFixedPoint> positions;
-
3074 QVarLengthArray<glyph_t> glyphs;
executed (the execution status of this line is deduced): QVarLengthArray<glyph_t> glyphs;
-
3075 -
3076 ti.fontEngine->getGlyphPositions(ti.glyphs, QTransform::fromTranslate(p.x(), p.y()),
executed (the execution status of this line is deduced): ti.fontEngine->getGlyphPositions(ti.glyphs, QTransform::fromTranslate(p.x(), p.y()),
-
3077 ti.flags, glyphs, positions);
executed (the execution status of this line is deduced): ti.flags, glyphs, positions);
-
3078 QPair<int, int> range = visibleGlyphRange(invMat.mapRect(clipBoundingRect()),
executed (the execution status of this line is deduced): QPair<int, int> range = visibleGlyphRange(invMat.mapRect(clipBoundingRect()),
-
3079 ti.fontEngine, glyphs.data(), positions.data(),
executed (the execution status of this line is deduced): ti.fontEngine, glyphs.data(), positions.data(),
-
3080 glyphs.size());
executed (the execution status of this line is deduced): glyphs.size());
-
3081 -
3082 if (range.first >= range.second)
partially evaluated: range.first >= range.second
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:19
0-19
3083 return;
never executed: return;
0
3084 -
3085 QStaticTextItem staticTextItem;
executed (the execution status of this line is deduced): QStaticTextItem staticTextItem;
-
3086 staticTextItem.color = s->pen.color();
executed (the execution status of this line is deduced): staticTextItem.color = s->pen.color();
-
3087 staticTextItem.font = s->font;
executed (the execution status of this line is deduced): staticTextItem.font = s->font;
-
3088 staticTextItem.setFontEngine(ti.fontEngine);
executed (the execution status of this line is deduced): staticTextItem.setFontEngine(ti.fontEngine);
-
3089 staticTextItem.numGlyphs = range.second - range.first;
executed (the execution status of this line is deduced): staticTextItem.numGlyphs = range.second - range.first;
-
3090 staticTextItem.glyphs = glyphs.data() + range.first;
executed (the execution status of this line is deduced): staticTextItem.glyphs = glyphs.data() + range.first;
-
3091 staticTextItem.glyphPositions = positions.data() + range.first;
executed (the execution status of this line is deduced): staticTextItem.glyphPositions = positions.data() + range.first;
-
3092 QPaintEngineEx::drawStaticTextItem(&staticTextItem);
executed (the execution status of this line is deduced): QPaintEngineEx::drawStaticTextItem(&staticTextItem);
-
3093 } else {
executed: }
Execution Count:19
19
3094 QPaintEngineEx::drawTextItem(p, ti);
never executed (the execution status of this line is deduced): QPaintEngineEx::drawTextItem(p, ti);
-
3095 }
never executed: }
0
3096} -
3097 -
3098/*! -
3099 \reimp -
3100*/ -
3101void QRasterPaintEngine::drawPoints(const QPointF *points, int pointCount) -
3102{ -
3103 Q_D(QRasterPaintEngine);
never executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
3104 QRasterPaintEngineState *s = state();
never executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
3105 -
3106 ensurePen();
never executed (the execution status of this line is deduced): ensurePen();
-
3107 if (!s->penData.blend)
never evaluated: !s->penData.blend
0
3108 return;
never executed: return;
0
3109 -
3110 if (!s->flags.fast_pen) {
never evaluated: !s->flags.fast_pen
0
3111 QPaintEngineEx::drawPoints(points, pointCount);
never executed (the execution status of this line is deduced): QPaintEngineEx::drawPoints(points, pointCount);
-
3112 return;
never executed: return;
0
3113 } -
3114 -
3115 QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
never executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
-
3116 stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
never executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
-
3117 stroker.drawPoints(points, pointCount);
never executed (the execution status of this line is deduced): stroker.drawPoints(points, pointCount);
-
3118}
never executed: }
0
3119 -
3120 -
3121void QRasterPaintEngine::drawPoints(const QPoint *points, int pointCount) -
3122{ -
3123 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
3124 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
3125 -
3126 ensurePen();
executed (the execution status of this line is deduced): ensurePen();
-
3127 if (!s->penData.blend)
partially evaluated: !s->penData.blend
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136
0-136
3128 return;
never executed: return;
0
3129 -
3130 if (!s->flags.fast_pen) {
evaluated: !s->flags.fast_pen
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:135
1-135
3131 QPaintEngineEx::drawPoints(points, pointCount);
executed (the execution status of this line is deduced): QPaintEngineEx::drawPoints(points, pointCount);
-
3132 return;
executed: return;
Execution Count:1
1
3133 } -
3134 -
3135 QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
-
3136 stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
-
3137 stroker.drawPoints(points, pointCount);
executed (the execution status of this line is deduced): stroker.drawPoints(points, pointCount);
-
3138}
executed: }
Execution Count:135
135
3139 -
3140/*! -
3141 \reimp -
3142*/ -
3143void QRasterPaintEngine::drawLines(const QLine *lines, int lineCount) -
3144{ -
3145#ifdef QT_DEBUG_DRAW -
3146 qDebug() << " - QRasterPaintEngine::drawLines(QLine*)" << lineCount; -
3147#endif -
3148 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
3149 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
3150 -
3151 ensurePen();
executed (the execution status of this line is deduced): ensurePen();
-
3152 if (!s->penData.blend)
evaluated: !s->penData.blend
TRUEFALSE
yes
Evaluation Count:48
yes
Evaluation Count:4988
48-4988
3153 return;
executed: return;
Execution Count:48
48
3154 -
3155 if (s->flags.fast_pen) {
evaluated: s->flags.fast_pen
TRUEFALSE
yes
Evaluation Count:4933
yes
Evaluation Count:55
55-4933
3156 QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
-
3157 stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
-
3158 for (int i=0; i<lineCount; ++i) {
evaluated: i<lineCount
TRUEFALSE
yes
Evaluation Count:4933
yes
Evaluation Count:4933
4933
3159 const QLine &l = lines[i];
executed (the execution status of this line is deduced): const QLine &l = lines[i];
-
3160 stroker.drawLine(l.p1(), l.p2());
executed (the execution status of this line is deduced): stroker.drawLine(l.p1(), l.p2());
-
3161 }
executed: }
Execution Count:4933
4933
3162 } else {
executed: }
Execution Count:4933
4933
3163 QPaintEngineEx::drawLines(lines, lineCount);
executed (the execution status of this line is deduced): QPaintEngineEx::drawLines(lines, lineCount);
-
3164 }
executed: }
Execution Count:55
55
3165} -
3166 -
3167void QRasterPaintEnginePrivate::rasterizeLine_dashed(QLineF line, -
3168 qreal width, -
3169 int *dashIndex, -
3170 qreal *dashOffset, -
3171 bool *inDash) -
3172{ -
3173 Q_Q(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEngine * const q = q_func();
-
3174 QRasterPaintEngineState *s = q->state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = q->state();
-
3175 -
3176 const QPen &pen = s->lastPen;
executed (the execution status of this line is deduced): const QPen &pen = s->lastPen;
-
3177 const bool squareCap = (pen.capStyle() == Qt::SquareCap);
executed (the execution status of this line is deduced): const bool squareCap = (pen.capStyle() == Qt::SquareCap);
-
3178 const QVector<qreal> pattern = pen.dashPattern();
executed (the execution status of this line is deduced): const QVector<qreal> pattern = pen.dashPattern();
-
3179 -
3180 qreal patternLength = 0;
executed (the execution status of this line is deduced): qreal patternLength = 0;
-
3181 for (int i = 0; i < pattern.size(); ++i)
evaluated: i < pattern.size()
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:3
3-10
3182 patternLength += pattern.at(i);
executed: patternLength += pattern.at(i);
Execution Count:10
10
3183 -
3184 if (patternLength <= 0)
evaluated: patternLength <= 0
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2
1-2
3185 return;
executed: return;
Execution Count:1
1
3186 -
3187 qreal length = line.length();
executed (the execution status of this line is deduced): qreal length = line.length();
-
3188 Q_ASSERT(length > 0);
executed (the execution status of this line is deduced): qt_noop();
-
3189 while (length > 0) {
evaluated: length > 0
TRUEFALSE
yes
Evaluation Count:130
yes
Evaluation Count:2
2-130
3190 const bool rasterize = *inDash;
executed (the execution status of this line is deduced): const bool rasterize = *inDash;
-
3191 qreal dash = (pattern.at(*dashIndex) - *dashOffset) * width;
executed (the execution status of this line is deduced): qreal dash = (pattern.at(*dashIndex) - *dashOffset) * width;
-
3192 QLineF l = line;
executed (the execution status of this line is deduced): QLineF l = line;
-
3193 -
3194 if (dash >= length) {
evaluated: dash >= length
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:128
2-128
3195 dash = length;
executed (the execution status of this line is deduced): dash = length;
-
3196 *dashOffset += dash / width;
executed (the execution status of this line is deduced): *dashOffset += dash / width;
-
3197 length = 0;
executed (the execution status of this line is deduced): length = 0;
-
3198 } else {
executed: }
Execution Count:2
2
3199 *dashOffset = 0;
executed (the execution status of this line is deduced): *dashOffset = 0;
-
3200 *inDash = !(*inDash);
executed (the execution status of this line is deduced): *inDash = !(*inDash);
-
3201 if (++*dashIndex >= pattern.size())
evaluated: ++*dashIndex >= pattern.size()
TRUEFALSE
yes
Evaluation Count:32
yes
Evaluation Count:96
32-96
3202 *dashIndex = 0;
executed: *dashIndex = 0;
Execution Count:32
32
3203 length -= dash;
executed (the execution status of this line is deduced): length -= dash;
-
3204 l.setLength(dash);
executed (the execution status of this line is deduced): l.setLength(dash);
-
3205 line.setP1(l.p2());
executed (the execution status of this line is deduced): line.setP1(l.p2());
-
3206 }
executed: }
Execution Count:128
128
3207 -
3208 if (rasterize && dash > 0)
evaluated: rasterize
TRUEFALSE
yes
Evaluation Count:66
yes
Evaluation Count:64
partially evaluated: dash > 0
TRUEFALSE
yes
Evaluation Count:66
no
Evaluation Count:0
0-66
3209 rasterizer->rasterizeLine(l.p1(), l.p2(), width / dash, squareCap);
executed: rasterizer->rasterizeLine(l.p1(), l.p2(), width / dash, squareCap);
Execution Count:66
66
3210 }
executed: }
Execution Count:130
130
3211}
executed: }
Execution Count:2
2
3212 -
3213/*! -
3214 \reimp -
3215*/ -
3216void QRasterPaintEngine::drawLines(const QLineF *lines, int lineCount) -
3217{ -
3218#ifdef QT_DEBUG_DRAW -
3219 qDebug() << " - QRasterPaintEngine::drawLines(QLineF *)" << lineCount; -
3220#endif -
3221 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
3222 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
3223 -
3224 ensurePen();
executed (the execution status of this line is deduced): ensurePen();
-
3225 if (!s->penData.blend)
evaluated: !s->penData.blend
TRUEFALSE
yes
Evaluation Count:48
yes
Evaluation Count:1925
48-1925
3226 return;
executed: return;
Execution Count:48
48
3227 if (s->flags.fast_pen) {
evaluated: s->flags.fast_pen
TRUEFALSE
yes
Evaluation Count:1106
yes
Evaluation Count:819
819-1106
3228 QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
-
3229 stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
-
3230 for (int i=0; i<lineCount; ++i) {
evaluated: i<lineCount
TRUEFALSE
yes
Evaluation Count:1595
yes
Evaluation Count:1106
1106-1595
3231 QLineF line = lines[i];
executed (the execution status of this line is deduced): QLineF line = lines[i];
-
3232 stroker.drawLine(line.p1(), line.p2());
executed (the execution status of this line is deduced): stroker.drawLine(line.p1(), line.p2());
-
3233 }
executed: }
Execution Count:1595
1595
3234 } else {
executed: }
Execution Count:1106
1106
3235 QPaintEngineEx::drawLines(lines, lineCount);
executed (the execution status of this line is deduced): QPaintEngineEx::drawLines(lines, lineCount);
-
3236 }
executed: }
Execution Count:819
819
3237} -
3238 -
3239 -
3240/*! -
3241 \reimp -
3242*/ -
3243void QRasterPaintEngine::drawEllipse(const QRectF &rect) -
3244{ -
3245 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
3246 QRasterPaintEngineState *s = state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state();
-
3247 -
3248 ensurePen();
executed (the execution status of this line is deduced): ensurePen();
-
3249 if (((qpen_style(s->lastPen) == Qt::SolidLine && s->flags.fast_pen)
evaluated: qpen_style(s->lastPen) == Qt::SolidLine
TRUEFALSE
yes
Evaluation Count:1922
yes
Evaluation Count:102
evaluated: s->flags.fast_pen
TRUEFALSE
yes
Evaluation Count:1062
yes
Evaluation Count:860
102-1922
3250 || (qpen_style(s->lastPen) == Qt::NoPen))
evaluated: (qpen_style(s->lastPen) == Qt::NoPen)
TRUEFALSE
yes
Evaluation Count:102
yes
Evaluation Count:860
102-860
3251 && !s->flags.antialiased
evaluated: !s->flags.antialiased
TRUEFALSE
yes
Evaluation Count:1155
yes
Evaluation Count:9
9-1155
3252 && qMax(rect.width(), rect.height()) < QT_RASTER_COORD_LIMIT
partially evaluated: qMax(rect.width(), rect.height()) < QT_RASTER_COORD_LIMIT
TRUEFALSE
yes
Evaluation Count:1155
no
Evaluation Count:0
0-1155
3253 && !rect.isEmpty()
partially evaluated: !rect.isEmpty()
TRUEFALSE
yes
Evaluation Count:1155
no
Evaluation Count:0
0-1155
3254 && s->matrix.type() <= QTransform::TxScale) // no shear
partially evaluated: s->matrix.type() <= QTransform::TxScale
TRUEFALSE
yes
Evaluation Count:1155
no
Evaluation Count:0
0-1155
3255 { -
3256 ensureBrush();
executed (the execution status of this line is deduced): ensureBrush();
-
3257 const QRectF r = s->matrix.mapRect(rect);
executed (the execution status of this line is deduced): const QRectF r = s->matrix.mapRect(rect);
-
3258 ProcessSpans penBlend = d->getPenFunc(r, &s->penData);
executed (the execution status of this line is deduced): ProcessSpans penBlend = d->getPenFunc(r, &s->penData);
-
3259 ProcessSpans brushBlend = d->getBrushFunc(r, &s->brushData);
executed (the execution status of this line is deduced): ProcessSpans brushBlend = d->getBrushFunc(r, &s->brushData);
-
3260 const QRect brect = QRect(int(r.x()), int(r.y()),
executed (the execution status of this line is deduced): const QRect brect = QRect(int(r.x()), int(r.y()),
-
3261 int_dim(r.x(), r.width()),
executed (the execution status of this line is deduced): (int(r.x()+r.width()) - int(r.x())),
-
3262 int_dim(r.y(), r.height()));
executed (the execution status of this line is deduced): (int(r.y()+r.height()) - int(r.y())));
-
3263 if (brect == r) {
partially evaluated: brect == r
TRUEFALSE
yes
Evaluation Count:1155
no
Evaluation Count:0
0-1155
3264 drawEllipse_midpoint_i(brect, d->deviceRect, penBlend, brushBlend,
executed (the execution status of this line is deduced): drawEllipse_midpoint_i(brect, d->deviceRect, penBlend, brushBlend,
-
3265 &s->penData, &s->brushData);
executed (the execution status of this line is deduced): &s->penData, &s->brushData);
-
3266 return;
executed: return;
Execution Count:1155
1155
3267 } -
3268 }
never executed: }
0
3269 QPaintEngineEx::drawEllipse(rect);
executed (the execution status of this line is deduced): QPaintEngineEx::drawEllipse(rect);
-
3270}
executed: }
Execution Count:869
869
3271 -
3272 -
3273#ifdef Q_OS_WIN -
3274/*! -
3275 \internal -
3276*/ -
3277void QRasterPaintEngine::setDC(HDC hdc) { -
3278 Q_D(QRasterPaintEngine); -
3279 d->hdc = hdc; -
3280} -
3281 -
3282/*! -
3283 \internal -
3284*/ -
3285HDC QRasterPaintEngine::getDC() const -
3286{ -
3287 Q_D(const QRasterPaintEngine); -
3288 return d->hdc; -
3289} -
3290 -
3291/*! -
3292 \internal -
3293*/ -
3294void QRasterPaintEngine::releaseDC(HDC) const -
3295{ -
3296} -
3297 -
3298#endif -
3299 -
3300/*! -
3301 \internal -
3302*/ -
3303bool QRasterPaintEngine::supportsTransformations(QFontEngine *fontEngine) const -
3304{ -
3305 const QTransform &m = state()->matrix;
executed (the execution status of this line is deduced): const QTransform &m = state()->matrix;
-
3306 return supportsTransformations(fontEngine, m);
executed: return supportsTransformations(fontEngine, m);
Execution Count:23029
23029
3307} -
3308 -
3309/*! -
3310 \internal -
3311*/ -
3312bool QRasterPaintEngine::supportsTransformations(QFontEngine *fontEngine, const QTransform &m) const -
3313{ -
3314 if (fontEngine->supportsTransformations(m))
partially evaluated: fontEngine->supportsTransformations(m)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:23041
0-23041
3315 return true;
never executed: return true;
0
3316 -
3317 return !shouldDrawCachedGlyphs(fontEngine, m);
executed: return !shouldDrawCachedGlyphs(fontEngine, m);
Execution Count:23041
23041
3318} -
3319 -
3320/*! -
3321 \internal -
3322*/ -
3323QPoint QRasterPaintEngine::coordinateOffset() const -
3324{ -
3325 return QPoint(0, 0);
executed: return QPoint(0, 0);
Execution Count:28776
28776
3326} -
3327 -
3328void QRasterPaintEngine::drawBitmap(const QPointF &pos, const QImage &image, QSpanData *fg) -
3329{ -
3330 Q_ASSERT(fg);
executed (the execution status of this line is deduced): qt_noop();
-
3331 if (!fg->blend)
partially evaluated: !fg->blend
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
3332 return;
never executed: return;
0
3333 Q_D(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func();
-
3334 -
3335 Q_ASSERT(image.depth() == 1);
executed (the execution status of this line is deduced): qt_noop();
-
3336 -
3337 const int spanCount = 256;
executed (the execution status of this line is deduced): const int spanCount = 256;
-
3338 QT_FT_Span spans[spanCount];
executed (the execution status of this line is deduced): QT_FT_Span spans[spanCount];
-
3339 int n = 0;
executed (the execution status of this line is deduced): int n = 0;
-
3340 -
3341 // Boundaries -
3342 int w = image.width();
executed (the execution status of this line is deduced): int w = image.width();
-
3343 int h = image.height();
executed (the execution status of this line is deduced): int h = image.height();
-
3344 int ymax = qMin(qRound(pos.y() + h), d->rasterBuffer->height());
executed (the execution status of this line is deduced): int ymax = qMin(qRound(pos.y() + h), d->rasterBuffer->height());
-
3345 int ymin = qMax(qRound(pos.y()), 0);
executed (the execution status of this line is deduced): int ymin = qMax(qRound(pos.y()), 0);
-
3346 int xmax = qMin(qRound(pos.x() + w), d->rasterBuffer->width());
executed (the execution status of this line is deduced): int xmax = qMin(qRound(pos.x() + w), d->rasterBuffer->width());
-
3347 int xmin = qMax(qRound(pos.x()), 0);
executed (the execution status of this line is deduced): int xmin = qMax(qRound(pos.x()), 0);
-
3348 -
3349 int x_offset = xmin - qRound(pos.x());
executed (the execution status of this line is deduced): int x_offset = xmin - qRound(pos.x());
-
3350 -
3351 QImage::Format format = image.format();
executed (the execution status of this line is deduced): QImage::Format format = image.format();
-
3352 for (int y = ymin; y < ymax; ++y) {
evaluated: y < ymax
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:1
1-10
3353 const uchar *src = image.scanLine(y - qRound(pos.y()));
executed (the execution status of this line is deduced): const uchar *src = image.scanLine(y - qRound(pos.y()));
-
3354 if (format == QImage::Format_MonoLSB) {
partially evaluated: format == QImage::Format_MonoLSB
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
0-10
3355 for (int x = 0; x < xmax - xmin; ++x) {
evaluated: x < xmax - xmin
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:10
10
3356 int src_x = x + x_offset;
executed (the execution status of this line is deduced): int src_x = x + x_offset;
-
3357 uchar pixel = src[src_x >> 3];
executed (the execution status of this line is deduced): uchar pixel = src[src_x >> 3];
-
3358 if (!pixel) {
partially evaluated: !pixel
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
3359 x += 7 - (src_x%8);
never executed (the execution status of this line is deduced): x += 7 - (src_x%8);
-
3360 continue;
never executed: continue;
0
3361 } -
3362 if (pixel & (0x1 << (src_x & 7))) {
partially evaluated: pixel & (0x1 << (src_x & 7))
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
0-10
3363 spans[n].x = xmin + x;
executed (the execution status of this line is deduced): spans[n].x = xmin + x;
-
3364 spans[n].y = y;
executed (the execution status of this line is deduced): spans[n].y = y;
-
3365 spans[n].coverage = 255;
executed (the execution status of this line is deduced): spans[n].coverage = 255;
-
3366 int len = 1;
executed (the execution status of this line is deduced): int len = 1;
-
3367 while (src_x+1 < w && src[(src_x+1) >> 3] & (0x1 << ((src_x+1) & 7))) {
evaluated: src_x+1 < w
TRUEFALSE
yes
Evaluation Count:90
yes
Evaluation Count:10
partially evaluated: src[(src_x+1) >> 3] & (0x1 << ((src_x+1) & 7))
TRUEFALSE
yes
Evaluation Count:90
no
Evaluation Count:0
0-90
3368 ++src_x;
executed (the execution status of this line is deduced): ++src_x;
-
3369 ++len;
executed (the execution status of this line is deduced): ++len;
-
3370 }
executed: }
Execution Count:90
90
3371 spans[n].len = ((len + spans[n].x) > xmax) ? (xmax - spans[n].x) : len;
partially evaluated: ((len + spans[n].x) > xmax)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
3372 x += len;
executed (the execution status of this line is deduced): x += len;
-
3373 ++n;
executed (the execution status of this line is deduced): ++n;
-
3374 if (n == spanCount) {
partially evaluated: n == spanCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
3375 fg->blend(n, spans, fg);
never executed (the execution status of this line is deduced): fg->blend(n, spans, fg);
-
3376 n = 0;
never executed (the execution status of this line is deduced): n = 0;
-
3377 }
never executed: }
0
3378 }
executed: }
Execution Count:10
10
3379 }
executed: }
Execution Count:10
10
3380 } else {
executed: }
Execution Count:10
10
3381 for (int x = 0; x < xmax - xmin; ++x) {
never evaluated: x < xmax - xmin
0
3382 int src_x = x + x_offset;
never executed (the execution status of this line is deduced): int src_x = x + x_offset;
-
3383 uchar pixel = src[src_x >> 3];
never executed (the execution status of this line is deduced): uchar pixel = src[src_x >> 3];
-
3384 if (!pixel) {
never evaluated: !pixel
0
3385 x += 7 - (src_x%8);
never executed (the execution status of this line is deduced): x += 7 - (src_x%8);
-
3386 continue;
never executed: continue;
0
3387 } -
3388 if (pixel & (0x80 >> (x & 7))) {
never evaluated: pixel & (0x80 >> (x & 7))
0
3389 spans[n].x = xmin + x;
never executed (the execution status of this line is deduced): spans[n].x = xmin + x;
-
3390 spans[n].y = y;
never executed (the execution status of this line is deduced): spans[n].y = y;
-
3391 spans[n].coverage = 255;
never executed (the execution status of this line is deduced): spans[n].coverage = 255;
-
3392 int len = 1;
never executed (the execution status of this line is deduced): int len = 1;
-
3393 while (src_x+1 < w && src[(src_x+1) >> 3] & (0x80 >> ((src_x+1) & 7))) {
never evaluated: src_x+1 < w
never evaluated: src[(src_x+1) >> 3] & (0x80 >> ((src_x+1) & 7))
0
3394 ++src_x;
never executed (the execution status of this line is deduced): ++src_x;
-
3395 ++len;
never executed (the execution status of this line is deduced): ++len;
-
3396 }
never executed: }
0
3397 spans[n].len = ((len + spans[n].x) > xmax) ? (xmax - spans[n].x) : len;
never evaluated: ((len + spans[n].x) > xmax)
0
3398 x += len;
never executed (the execution status of this line is deduced): x += len;
-
3399 ++n;
never executed (the execution status of this line is deduced): ++n;
-
3400 if (n == spanCount) {
never evaluated: n == spanCount
0
3401 fg->blend(n, spans, fg);
never executed (the execution status of this line is deduced): fg->blend(n, spans, fg);
-
3402 n = 0;
never executed (the execution status of this line is deduced): n = 0;
-
3403 }
never executed: }
0
3404 }
never executed: }
0
3405 }
never executed: }
0
3406 }
never executed: }
0
3407 } -
3408 if (n) {
partially evaluated: n
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
3409 fg->blend(n, spans, fg);
executed (the execution status of this line is deduced): fg->blend(n, spans, fg);
-
3410 n = 0;
executed (the execution status of this line is deduced): n = 0;
-
3411 }
executed: }
Execution Count:1
1
3412}
executed: }
Execution Count:1
1
3413 -
3414/*! -
3415 \enum QRasterPaintEngine::ClipType -
3416 \internal -
3417 -
3418 \value RectClip Indicates that the currently set clip is a single rectangle. -
3419 \value ComplexClip Indicates that the currently set clip is a combination of several shapes. -
3420*/ -
3421 -
3422/*! -
3423 \internal -
3424 Returns the type of the clip currently set. -
3425*/ -
3426QRasterPaintEngine::ClipType QRasterPaintEngine::clipType() const -
3427{ -
3428 Q_D(const QRasterPaintEngine);
executed (the execution status of this line is deduced): const QRasterPaintEnginePrivate * const d = d_func();
-
3429 -
3430 const QClipData *clip = d->clip();
executed (the execution status of this line is deduced): const QClipData *clip = d->clip();
-
3431 if (!clip || clip->hasRectClip)
partially evaluated: !clip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
partially evaluated: clip->hasRectClip
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
3432 return RectClip;
executed: return RectClip;
Execution Count:2
2
3433 else -
3434 return ComplexClip;
never executed: return ComplexClip;
0
3435} -
3436 -
3437/*! -
3438 \internal -
3439 Returns the bounding rect of the currently set clip. -
3440*/ -
3441QRect QRasterPaintEngine::clipBoundingRect() const -
3442{ -
3443 Q_D(const QRasterPaintEngine);
executed (the execution status of this line is deduced): const QRasterPaintEnginePrivate * const d = d_func();
-
3444 -
3445 const QClipData *clip = d->clip();
executed (the execution status of this line is deduced): const QClipData *clip = d->clip();
-
3446 -
3447 if (!clip)
partially evaluated: !clip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:21
0-21
3448 return d->deviceRect;
never executed: return d->deviceRect;
0
3449 -
3450 if (clip->hasRectClip)
partially evaluated: clip->hasRectClip
TRUEFALSE
yes
Evaluation Count:21
no
Evaluation Count:0
0-21
3451 return clip->clipRect;
executed: return clip->clipRect;
Execution Count:21
21
3452 -
3453 return QRect(clip->xmin, clip->ymin, clip->xmax - clip->xmin, clip->ymax - clip->ymin);
never executed: return QRect(clip->xmin, clip->ymin, clip->xmax - clip->xmin, clip->ymax - clip->ymin);
0
3454} -
3455 -
3456void QRasterPaintEnginePrivate::initializeRasterizer(QSpanData *data) -
3457{ -
3458 Q_Q(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEngine * const q = q_func();
-
3459 QRasterPaintEngineState *s = q->state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = q->state();
-
3460 -
3461 rasterizer->setAntialiased(s->flags.antialiased);
executed (the execution status of this line is deduced): rasterizer->setAntialiased(s->flags.antialiased);
-
3462 rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding);
executed (the execution status of this line is deduced): rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding);
-
3463 -
3464 QRect clipRect(deviceRect);
executed (the execution status of this line is deduced): QRect clipRect(deviceRect);
-
3465 ProcessSpans blend;
executed (the execution status of this line is deduced): ProcessSpans blend;
-
3466 // ### get from optimized rectbased QClipData -
3467 -
3468 const QClipData *c = clip();
executed (the execution status of this line is deduced): const QClipData *c = clip();
-
3469 if (c) {
partially evaluated: c
TRUEFALSE
yes
Evaluation Count:121082
no
Evaluation Count:0
0-121082
3470 const QRect r(QPoint(c->xmin, c->ymin),
executed (the execution status of this line is deduced): const QRect r(QPoint(c->xmin, c->ymin),
-
3471 QSize(c->xmax - c->xmin, c->ymax - c->ymin));
executed (the execution status of this line is deduced): QSize(c->xmax - c->xmin, c->ymax - c->ymin));
-
3472 clipRect = clipRect.intersected(r);
executed (the execution status of this line is deduced): clipRect = clipRect.intersected(r);
-
3473 blend = data->blend;
executed (the execution status of this line is deduced): blend = data->blend;
-
3474 } else {
executed: }
Execution Count:121082
121082
3475 blend = data->unclipped_blend;
never executed (the execution status of this line is deduced): blend = data->unclipped_blend;
-
3476 }
never executed: }
0
3477 -
3478 rasterizer->setClipRect(clipRect);
executed (the execution status of this line is deduced): rasterizer->setClipRect(clipRect);
-
3479 rasterizer->initialize(blend, data);
executed (the execution status of this line is deduced): rasterizer->initialize(blend, data);
-
3480}
executed: }
Execution Count:121082
121082
3481 -
3482void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline, -
3483 ProcessSpans callback, -
3484 QSpanData *spanData, QRasterBuffer *rasterBuffer) -
3485{ -
3486 if (!callback || !outline)
partially evaluated: !callback
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136354
partially evaluated: !outline
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:136354
0-136354
3487 return;
never executed: return;
0
3488 -
3489 Q_Q(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEngine * const q = q_func();
-
3490 QRasterPaintEngineState *s = q->state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = q->state();
-
3491 -
3492 if (!s->flags.antialiased) {
evaluated: !s->flags.antialiased
TRUEFALSE
yes
Evaluation Count:119809
yes
Evaluation Count:16545
16545-119809
3493 initializeRasterizer(spanData);
executed (the execution status of this line is deduced): initializeRasterizer(spanData);
-
3494 -
3495 const Qt::FillRule fillRule = outline->flags == QT_FT_OUTLINE_NONE
evaluated: outline->flags == 0x0
TRUEFALSE
yes
Evaluation Count:957
yes
Evaluation Count:118852
957-118852
3496 ? Qt::WindingFill
executed (the execution status of this line is deduced): ? Qt::WindingFill
-
3497 : Qt::OddEvenFill;
executed (the execution status of this line is deduced): : Qt::OddEvenFill;
-
3498 -
3499 rasterizer->rasterize(outline, fillRule);
executed (the execution status of this line is deduced): rasterizer->rasterize(outline, fillRule);
-
3500 return;
executed: return;
Execution Count:119809
119809
3501 } -
3502 -
3503 rasterize(outline, callback, (void *)spanData, rasterBuffer);
executed (the execution status of this line is deduced): rasterize(outline, callback, (void *)spanData, rasterBuffer);
-
3504}
executed: }
Execution Count:16545
16545
3505 -
3506extern "C" { -
3507 int q_gray_rendered_spans(QT_FT_Raster raster); -
3508} -
3509 -
3510static inline uchar *alignAddress(uchar *address, quintptr alignmentMask) -
3511{ -
3512 return (uchar *)(((quintptr)address + alignmentMask) & ~alignmentMask);
executed: return (uchar *)(((quintptr)address + alignmentMask) & ~alignmentMask);
Execution Count:16545
16545
3513} -
3514 -
3515void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline, -
3516 ProcessSpans callback, -
3517 void *userData, QRasterBuffer *) -
3518{ -
3519 if (!callback || !outline)
partially evaluated: !callback
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17131
partially evaluated: !outline
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17131
0-17131
3520 return;
never executed: return;
0
3521 -
3522 Q_Q(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEngine * const q = q_func();
-
3523 QRasterPaintEngineState *s = q->state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = q->state();
-
3524 -
3525 if (!s->flags.antialiased) {
evaluated: !s->flags.antialiased
TRUEFALSE
yes
Evaluation Count:586
yes
Evaluation Count:16545
586-16545
3526 rasterizer->setAntialiased(s->flags.antialiased);
executed (the execution status of this line is deduced): rasterizer->setAntialiased(s->flags.antialiased);
-
3527 rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding);
executed (the execution status of this line is deduced): rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding);
-
3528 rasterizer->setClipRect(deviceRect);
executed (the execution status of this line is deduced): rasterizer->setClipRect(deviceRect);
-
3529 rasterizer->initialize(callback, userData);
executed (the execution status of this line is deduced): rasterizer->initialize(callback, userData);
-
3530 -
3531 const Qt::FillRule fillRule = outline->flags == QT_FT_OUTLINE_NONE
evaluated: outline->flags == 0x0
TRUEFALSE
yes
Evaluation Count:21
yes
Evaluation Count:565
21-565
3532 ? Qt::WindingFill
executed (the execution status of this line is deduced): ? Qt::WindingFill
-
3533 : Qt::OddEvenFill;
executed (the execution status of this line is deduced): : Qt::OddEvenFill;
-
3534 -
3535 rasterizer->rasterize(outline, fillRule);
executed (the execution status of this line is deduced): rasterizer->rasterize(outline, fillRule);
-
3536 return;
executed: return;
Execution Count:586
586
3537 } -
3538 -
3539 // Initial size for raster pool is MINIMUM_POOL_SIZE so as to -
3540 // minimize memory reallocations. However if initial size for -
3541 // raster pool is changed for lower value, reallocations will -
3542 // occur normally. -
3543 int rasterPoolSize = MINIMUM_POOL_SIZE;
executed (the execution status of this line is deduced): int rasterPoolSize = 8192;
-
3544 uchar rasterPoolOnStack[MINIMUM_POOL_SIZE + 0xf];
executed (the execution status of this line is deduced): uchar rasterPoolOnStack[8192 + 0xf];
-
3545 uchar *rasterPoolBase = alignAddress(rasterPoolOnStack, 0xf);
executed (the execution status of this line is deduced): uchar *rasterPoolBase = alignAddress(rasterPoolOnStack, 0xf);
-
3546 uchar *rasterPoolOnHeap = 0;
executed (the execution status of this line is deduced): uchar *rasterPoolOnHeap = 0;
-
3547 -
3548 qt_ft_grays_raster.raster_reset(*grayRaster.data(), rasterPoolBase, rasterPoolSize);
executed (the execution status of this line is deduced): qt_ft_grays_raster.raster_reset(*grayRaster.data(), rasterPoolBase, rasterPoolSize);
-
3549 -
3550 void *data = userData;
executed (the execution status of this line is deduced): void *data = userData;
-
3551 -
3552 QT_FT_BBox clip_box = { deviceRect.x(),
executed (the execution status of this line is deduced): QT_FT_BBox clip_box = { deviceRect.x(),
-
3553 deviceRect.y(),
executed (the execution status of this line is deduced): deviceRect.y(),
-
3554 deviceRect.x() + deviceRect.width(),
executed (the execution status of this line is deduced): deviceRect.x() + deviceRect.width(),
-
3555 deviceRect.y() + deviceRect.height() };
executed (the execution status of this line is deduced): deviceRect.y() + deviceRect.height() };
-
3556 -
3557 QT_FT_Raster_Params rasterParams;
executed (the execution status of this line is deduced): QT_FT_Raster_Params rasterParams;
-
3558 rasterParams.target = 0;
executed (the execution status of this line is deduced): rasterParams.target = 0;
-
3559 rasterParams.source = outline;
executed (the execution status of this line is deduced): rasterParams.source = outline;
-
3560 rasterParams.flags = QT_FT_RASTER_FLAG_CLIP;
executed (the execution status of this line is deduced): rasterParams.flags = 0x4;
-
3561 rasterParams.gray_spans = 0;
executed (the execution status of this line is deduced): rasterParams.gray_spans = 0;
-
3562 rasterParams.black_spans = 0;
executed (the execution status of this line is deduced): rasterParams.black_spans = 0;
-
3563 rasterParams.bit_test = 0;
executed (the execution status of this line is deduced): rasterParams.bit_test = 0;
-
3564 rasterParams.bit_set = 0;
executed (the execution status of this line is deduced): rasterParams.bit_set = 0;
-
3565 rasterParams.user = data;
executed (the execution status of this line is deduced): rasterParams.user = data;
-
3566 rasterParams.clip_box = clip_box;
executed (the execution status of this line is deduced): rasterParams.clip_box = clip_box;
-
3567 -
3568 bool done = false;
executed (the execution status of this line is deduced): bool done = false;
-
3569 int error;
executed (the execution status of this line is deduced): int error;
-
3570 -
3571 int rendered_spans = 0;
executed (the execution status of this line is deduced): int rendered_spans = 0;
-
3572 -
3573 while (!done) {
evaluated: !done
TRUEFALSE
yes
Evaluation Count:16545
yes
Evaluation Count:16545
16545
3574 -
3575 rasterParams.flags |= (QT_FT_RASTER_FLAG_AA | QT_FT_RASTER_FLAG_DIRECT);
executed (the execution status of this line is deduced): rasterParams.flags |= (0x1 | 0x2);
-
3576 rasterParams.gray_spans = callback;
executed (the execution status of this line is deduced): rasterParams.gray_spans = callback;
-
3577 rasterParams.skip_spans = rendered_spans;
executed (the execution status of this line is deduced): rasterParams.skip_spans = rendered_spans;
-
3578 error = qt_ft_grays_raster.raster_render(*grayRaster.data(), &rasterParams);
executed (the execution status of this line is deduced): error = qt_ft_grays_raster.raster_render(*grayRaster.data(), &rasterParams);
-
3579 -
3580 // Out of memory, reallocate some more and try again... -
3581 if (error == -6) { // ErrRaster_OutOfMemory from qgrayraster.c
partially evaluated: error == -6
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16545
0-16545
3582 rasterPoolSize *= 2;
never executed (the execution status of this line is deduced): rasterPoolSize *= 2;
-
3583 if (rasterPoolSize > 1024 * 1024) {
never evaluated: rasterPoolSize > 1024 * 1024
0
3584 qWarning("QPainter: Rasterization of primitive failed");
never executed (the execution status of this line is deduced): QMessageLogger("painting/qpaintengine_raster.cpp", 3584, __PRETTY_FUNCTION__).warning("QPainter: Rasterization of primitive failed");
-
3585 break;
never executed: break;
0
3586 } -
3587 -
3588 rendered_spans += q_gray_rendered_spans(*grayRaster.data());
never executed (the execution status of this line is deduced): rendered_spans += q_gray_rendered_spans(*grayRaster.data());
-
3589 -
3590 free(rasterPoolOnHeap);
never executed (the execution status of this line is deduced): free(rasterPoolOnHeap);
-
3591 rasterPoolOnHeap = (uchar *)malloc(rasterPoolSize + 0xf);
never executed (the execution status of this line is deduced): rasterPoolOnHeap = (uchar *)malloc(rasterPoolSize + 0xf);
-
3592 -
3593 Q_CHECK_PTR(rasterPoolOnHeap); // note: we just freed the old rasterPoolBase. I hope it's not fatal.
never executed (the execution status of this line is deduced): qt_noop();
-
3594 -
3595 rasterPoolBase = alignAddress(rasterPoolOnHeap, 0xf);
never executed (the execution status of this line is deduced): rasterPoolBase = alignAddress(rasterPoolOnHeap, 0xf);
-
3596 -
3597 qt_ft_grays_raster.raster_done(*grayRaster.data());
never executed (the execution status of this line is deduced): qt_ft_grays_raster.raster_done(*grayRaster.data());
-
3598 qt_ft_grays_raster.raster_new(grayRaster.data());
never executed (the execution status of this line is deduced): qt_ft_grays_raster.raster_new(grayRaster.data());
-
3599 qt_ft_grays_raster.raster_reset(*grayRaster.data(), rasterPoolBase, rasterPoolSize);
never executed (the execution status of this line is deduced): qt_ft_grays_raster.raster_reset(*grayRaster.data(), rasterPoolBase, rasterPoolSize);
-
3600 } else {
never executed: }
0
3601 done = true;
executed (the execution status of this line is deduced): done = true;
-
3602 }
executed: }
Execution Count:16545
16545
3603 } -
3604 -
3605 free(rasterPoolOnHeap);
executed (the execution status of this line is deduced): free(rasterPoolOnHeap);
-
3606}
executed: }
Execution Count:16545
16545
3607 -
3608void QRasterPaintEnginePrivate::recalculateFastImages() -
3609{ -
3610 Q_Q(QRasterPaintEngine);
executed (the execution status of this line is deduced): QRasterPaintEngine * const q = q_func();
-
3611 QRasterPaintEngineState *s = q->state();
executed (the execution status of this line is deduced): QRasterPaintEngineState *s = q->state();
-
3612 -
3613 s->flags.fast_images = !(s->renderHints & QPainter::SmoothPixmapTransform)
evaluated: !(s->renderHints & QPainter::SmoothPixmapTransform)
TRUEFALSE
yes
Evaluation Count:70111
yes
Evaluation Count:72
72-70111
3614 && s->matrix.type() <= QTransform::TxShear;
partially evaluated: s->matrix.type() <= QTransform::TxShear
TRUEFALSE
yes
Evaluation Count:70111
no
Evaluation Count:0
0-70111
3615}
executed: }
Execution Count:70183
70183
3616 -
3617bool QRasterPaintEnginePrivate::canUseFastImageBlending(QPainter::CompositionMode mode, const QImage &image) const -
3618{ -
3619 Q_Q(const QRasterPaintEngine);
executed (the execution status of this line is deduced): const QRasterPaintEngine * const q = q_func();
-
3620 const QRasterPaintEngineState *s = q->state();
executed (the execution status of this line is deduced): const QRasterPaintEngineState *s = q->state();
-
3621 -
3622 return s->flags.fast_images
executed: return s->flags.fast_images && (mode == QPainter::CompositionMode_SourceOver || (mode == QPainter::CompositionMode_Source && !image.hasAlphaChannel()));
Execution Count:12944
12944
3623 && (mode == QPainter::CompositionMode_SourceOver
executed: return s->flags.fast_images && (mode == QPainter::CompositionMode_SourceOver || (mode == QPainter::CompositionMode_Source && !image.hasAlphaChannel()));
Execution Count:12944
12944
3624 || (mode == QPainter::CompositionMode_Source
executed: return s->flags.fast_images && (mode == QPainter::CompositionMode_SourceOver || (mode == QPainter::CompositionMode_Source && !image.hasAlphaChannel()));
Execution Count:12944
12944
3625 && !image.hasAlphaChannel()));
executed: return s->flags.fast_images && (mode == QPainter::CompositionMode_SourceOver || (mode == QPainter::CompositionMode_Source && !image.hasAlphaChannel()));
Execution Count:12944
12944
3626} -
3627 -
3628QImage QRasterBuffer::colorizeBitmap(const QImage &image, const QColor &color) -
3629{ -
3630 Q_ASSERT(image.depth() == 1);
executed (the execution status of this line is deduced): qt_noop();
-
3631 -
3632 QImage sourceImage = image.convertToFormat(QImage::Format_MonoLSB);
executed (the execution status of this line is deduced): QImage sourceImage = image.convertToFormat(QImage::Format_MonoLSB);
-
3633 QImage dest = QImage(sourceImage.size(), QImage::Format_ARGB32_Premultiplied);
executed (the execution status of this line is deduced): QImage dest = QImage(sourceImage.size(), QImage::Format_ARGB32_Premultiplied);
-
3634 -
3635 QRgb fg = PREMUL(color.rgba());
executed (the execution status of this line is deduced): QRgb fg = PREMUL(color.rgba());
-
3636 QRgb bg = 0;
executed (the execution status of this line is deduced): QRgb bg = 0;
-
3637 -
3638 int height = sourceImage.height();
executed (the execution status of this line is deduced): int height = sourceImage.height();
-
3639 int width = sourceImage.width();
executed (the execution status of this line is deduced): int width = sourceImage.width();
-
3640 for (int y=0; y<height; ++y) {
evaluated: y<height
TRUEFALSE
yes
Evaluation Count:76432
yes
Evaluation Count:9554
9554-76432
3641 uchar *source = sourceImage.scanLine(y);
executed (the execution status of this line is deduced): uchar *source = sourceImage.scanLine(y);
-
3642 QRgb *target = reinterpret_cast<QRgb *>(dest.scanLine(y));
executed (the execution status of this line is deduced): QRgb *target = reinterpret_cast<QRgb *>(dest.scanLine(y));
-
3643 if (!source || !target)
partially evaluated: !source
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:76432
partially evaluated: !target
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:76432
0-76432
3644 QT_THROW(std::bad_alloc()); // we must have run out of memory
never executed: qt_noop();
0
3645 for (int x=0; x < width; ++x)
evaluated: x < width
TRUEFALSE
yes
Evaluation Count:611456
yes
Evaluation Count:76432
76432-611456
3646 target[x] = (source[x>>3] >> (x&7)) & 1 ? fg : bg;
executed: target[x] = (source[x>>3] >> (x&7)) & 1 ? fg : bg;
Execution Count:611456
evaluated: (source[x>>3] >> (x&7)) & 1
TRUEFALSE
yes
Evaluation Count:305584
yes
Evaluation Count:305872
305584-611456
3647 }
executed: }
Execution Count:76432
76432
3648 return dest;
executed: return dest;
Execution Count:9554
9554
3649} -
3650 -
3651QRasterBuffer::~QRasterBuffer() -
3652{ -
3653} -
3654 -
3655void QRasterBuffer::init() -
3656{ -
3657 compositionMode = QPainter::CompositionMode_SourceOver;
executed (the execution status of this line is deduced): compositionMode = QPainter::CompositionMode_SourceOver;
-
3658 monoDestinationWithClut = false;
executed (the execution status of this line is deduced): monoDestinationWithClut = false;
-
3659 destColor0 = 0;
executed (the execution status of this line is deduced): destColor0 = 0;
-
3660 destColor1 = 0;
executed (the execution status of this line is deduced): destColor1 = 0;
-
3661}
executed: }
Execution Count:5615
5615
3662 -
3663QImage::Format QRasterBuffer::prepare(QImage *image) -
3664{ -
3665 m_buffer = (uchar *)image->bits();
executed (the execution status of this line is deduced): m_buffer = (uchar *)image->bits();
-
3666 m_width = qMin(QT_RASTER_COORD_LIMIT, image->width());
executed (the execution status of this line is deduced): m_width = qMin(QT_RASTER_COORD_LIMIT, image->width());
-
3667 m_height = qMin(QT_RASTER_COORD_LIMIT, image->height());
executed (the execution status of this line is deduced): m_height = qMin(QT_RASTER_COORD_LIMIT, image->height());
-
3668 bytes_per_pixel = image->depth()/8;
executed (the execution status of this line is deduced): bytes_per_pixel = image->depth()/8;
-
3669 bytes_per_line = image->bytesPerLine();
executed (the execution status of this line is deduced): bytes_per_line = image->bytesPerLine();
-
3670 -
3671 format = image->format();
executed (the execution status of this line is deduced): format = image->format();
-
3672 drawHelper = qDrawHelper + format;
executed (the execution status of this line is deduced): drawHelper = qDrawHelper + format;
-
3673 if (image->depth() == 1 && image->colorTable().size() == 2) {
evaluated: image->depth() == 1
TRUEFALSE
yes
Evaluation Count:143
yes
Evaluation Count:5472
partially evaluated: image->colorTable().size() == 2
TRUEFALSE
yes
Evaluation Count:143
no
Evaluation Count:0
0-5472
3674 monoDestinationWithClut = true;
executed (the execution status of this line is deduced): monoDestinationWithClut = true;
-
3675 destColor0 = PREMUL(image->colorTable()[0]);
executed (the execution status of this line is deduced): destColor0 = PREMUL(image->colorTable()[0]);
-
3676 destColor1 = PREMUL(image->colorTable()[1]);
executed (the execution status of this line is deduced): destColor1 = PREMUL(image->colorTable()[1]);
-
3677 }
executed: }
Execution Count:143
143
3678 -
3679 return format;
executed: return format;
Execution Count:5614
5614
3680} -
3681 -
3682void QRasterBuffer::resetBuffer(int val) -
3683{ -
3684 memset(m_buffer, val, m_height*bytes_per_line);
never executed (the execution status of this line is deduced): memset(m_buffer, val, m_height*bytes_per_line);
-
3685}
never executed: }
0
3686 -
3687QClipData::QClipData(int height) -
3688{ -
3689 clipSpanHeight = height;
executed (the execution status of this line is deduced): clipSpanHeight = height;
-
3690 m_clipLines = 0;
executed (the execution status of this line is deduced): m_clipLines = 0;
-
3691 -
3692 allocated = 0;
executed (the execution status of this line is deduced): allocated = 0;
-
3693 m_spans = 0;
executed (the execution status of this line is deduced): m_spans = 0;
-
3694 xmin = xmax = ymin = ymax = 0;
executed (the execution status of this line is deduced): xmin = xmax = ymin = ymax = 0;
-
3695 count = 0;
executed (the execution status of this line is deduced): count = 0;
-
3696 -
3697 enabled = true;
executed (the execution status of this line is deduced): enabled = true;
-
3698 hasRectClip = hasRegionClip = false;
executed (the execution status of this line is deduced): hasRectClip = hasRegionClip = false;
-
3699}
executed: }
Execution Count:28454
28454
3700 -
3701QClipData::~QClipData() -
3702{ -
3703 if (m_clipLines)
evaluated: m_clipLines
TRUEFALSE
yes
Evaluation Count:1964
yes
Evaluation Count:26479
1964-26479
3704 free(m_clipLines);
executed: free(m_clipLines);
Execution Count:1964
1964
3705 if (m_spans)
evaluated: m_spans
TRUEFALSE
yes
Evaluation Count:1445
yes
Evaluation Count:26998
1445-26998
3706 free(m_spans);
executed: free(m_spans);
Execution Count:1445
1445
3707}
executed: }
Execution Count:28443
28443
3708 -
3709void QClipData::initialize() -
3710{ -
3711 if (m_spans)
evaluated: m_spans
TRUEFALSE
yes
Evaluation Count:23341
yes
Evaluation Count:4167
4167-23341
3712 return;
executed: return;
Execution Count:23341
23341
3713 -
3714 if (!m_clipLines)
evaluated: !m_clipLines
TRUEFALSE
yes
Evaluation Count:1964
yes
Evaluation Count:2203
1964-2203
3715 m_clipLines = (ClipLine *)calloc(sizeof(ClipLine), clipSpanHeight);
executed: m_clipLines = (ClipLine *)calloc(sizeof(ClipLine), clipSpanHeight);
Execution Count:1964
1964
3716 -
3717 Q_CHECK_PTR(m_clipLines);
executed (the execution status of this line is deduced): qt_noop();
-
3718 QT_TRY {
partially evaluated: true
TRUEFALSE
yes
Evaluation Count:4167
no
Evaluation Count:0
0-4167
3719 m_spans = (QSpan *)malloc(clipSpanHeight*sizeof(QSpan));
executed (the execution status of this line is deduced): m_spans = (QSpan *)malloc(clipSpanHeight*sizeof(QSpan));
-
3720 allocated = clipSpanHeight;
executed (the execution status of this line is deduced): allocated = clipSpanHeight;
-
3721 Q_CHECK_PTR(m_spans);
executed (the execution status of this line is deduced): qt_noop();
-
3722 -
3723 QT_TRY {
partially evaluated: true
TRUEFALSE
yes
Evaluation Count:4167
no
Evaluation Count:0
0-4167
3724 if (hasRectClip) {
evaluated: hasRectClip
TRUEFALSE
yes
Evaluation Count:512
yes
Evaluation Count:3655
512-3655
3725 int y = 0;
executed (the execution status of this line is deduced): int y = 0;
-
3726 while (y < ymin) {
evaluated: y < ymin
TRUEFALSE
yes
Evaluation Count:31823
yes
Evaluation Count:512
512-31823
3727 m_clipLines[y].spans = 0;
executed (the execution status of this line is deduced): m_clipLines[y].spans = 0;
-
3728 m_clipLines[y].count = 0;
executed (the execution status of this line is deduced): m_clipLines[y].count = 0;
-
3729 ++y;
executed (the execution status of this line is deduced): ++y;
-
3730 }
executed: }
Execution Count:31823
31823
3731 -
3732 const int len = clipRect.width();
executed (the execution status of this line is deduced): const int len = clipRect.width();
-
3733 count = 0;
executed (the execution status of this line is deduced): count = 0;
-
3734 while (y < ymax) {
evaluated: y < ymax
TRUEFALSE
yes
Evaluation Count:19594
yes
Evaluation Count:512
512-19594
3735 QSpan *span = m_spans + count;
executed (the execution status of this line is deduced): QSpan *span = m_spans + count;
-
3736 span->x = xmin;
executed (the execution status of this line is deduced): span->x = xmin;
-
3737 span->len = len;
executed (the execution status of this line is deduced): span->len = len;
-
3738 span->y = y;
executed (the execution status of this line is deduced): span->y = y;
-
3739 span->coverage = 255;
executed (the execution status of this line is deduced): span->coverage = 255;
-
3740 ++count;
executed (the execution status of this line is deduced): ++count;
-
3741 -
3742 m_clipLines[y].spans = span;
executed (the execution status of this line is deduced): m_clipLines[y].spans = span;
-
3743 m_clipLines[y].count = 1;
executed (the execution status of this line is deduced): m_clipLines[y].count = 1;
-
3744 ++y;
executed (the execution status of this line is deduced): ++y;
-
3745 }
executed: }
Execution Count:19594
19594
3746 -
3747 while (y < clipSpanHeight) {
evaluated: y < clipSpanHeight
TRUEFALSE
yes
Evaluation Count:27750
yes
Evaluation Count:512
512-27750
3748 m_clipLines[y].spans = 0;
executed (the execution status of this line is deduced): m_clipLines[y].spans = 0;
-
3749 m_clipLines[y].count = 0;
executed (the execution status of this line is deduced): m_clipLines[y].count = 0;
-
3750 ++y;
executed (the execution status of this line is deduced): ++y;
-
3751 }
executed: }
Execution Count:27750
27750
3752 } else if (hasRegionClip) {
executed: }
Execution Count:512
evaluated: hasRegionClip
TRUEFALSE
yes
Evaluation Count:3069
yes
Evaluation Count:586
512-3069
3753 -
3754 const QVector<QRect> rects = clipRegion.rects();
executed (the execution status of this line is deduced): const QVector<QRect> rects = clipRegion.rects();
-
3755 const int numRects = rects.size();
executed (the execution status of this line is deduced): const int numRects = rects.size();
-
3756 -
3757 { // resize -
3758 const int maxSpans = (ymax - ymin) * numRects;
executed (the execution status of this line is deduced): const int maxSpans = (ymax - ymin) * numRects;
-
3759 if (maxSpans > allocated) {
evaluated: maxSpans > allocated
TRUEFALSE
yes
Evaluation Count:2839
yes
Evaluation Count:230
230-2839
3760 m_spans = q_check_ptr((QSpan *)realloc(m_spans, maxSpans * sizeof(QSpan)));
executed (the execution status of this line is deduced): m_spans = q_check_ptr((QSpan *)realloc(m_spans, maxSpans * sizeof(QSpan)));
-
3761 allocated = maxSpans;
executed (the execution status of this line is deduced): allocated = maxSpans;
-
3762 }
executed: }
Execution Count:2839
2839
3763 } -
3764 -
3765 int y = 0;
executed (the execution status of this line is deduced): int y = 0;
-
3766 int firstInBand = 0;
executed (the execution status of this line is deduced): int firstInBand = 0;
-
3767 count = 0;
executed (the execution status of this line is deduced): count = 0;
-
3768 while (firstInBand < numRects) {
evaluated: firstInBand < numRects
TRUEFALSE
yes
Evaluation Count:10491
yes
Evaluation Count:3069
3069-10491
3769 const int currMinY = rects.at(firstInBand).y();
executed (the execution status of this line is deduced): const int currMinY = rects.at(firstInBand).y();
-
3770 const int currMaxY = currMinY + rects.at(firstInBand).height();
executed (the execution status of this line is deduced): const int currMaxY = currMinY + rects.at(firstInBand).height();
-
3771 -
3772 while (y < currMinY) {
evaluated: y < currMinY
TRUEFALSE
yes
Evaluation Count:33412
yes
Evaluation Count:10491
10491-33412
3773 m_clipLines[y].spans = 0;
executed (the execution status of this line is deduced): m_clipLines[y].spans = 0;
-
3774 m_clipLines[y].count = 0;
executed (the execution status of this line is deduced): m_clipLines[y].count = 0;
-
3775 ++y;
executed (the execution status of this line is deduced): ++y;
-
3776 }
executed: }
Execution Count:33412
33412
3777 -
3778 int lastInBand = firstInBand;
executed (the execution status of this line is deduced): int lastInBand = firstInBand;
-
3779 while (lastInBand + 1 < numRects && rects.at(lastInBand+1).top() == y)
evaluated: lastInBand + 1 < numRects
TRUEFALSE
yes
Evaluation Count:10592
yes
Evaluation Count:2972
evaluated: rects.at(lastInBand+1).top() == y
TRUEFALSE
yes
Evaluation Count:3073
yes
Evaluation Count:7519
2972-10592
3780 ++lastInBand;
executed: ++lastInBand;
Execution Count:3073
3073
3781 -
3782 while (y < currMaxY) {
evaluated: y < currMaxY
TRUEFALSE
yes
Evaluation Count:520210
yes
Evaluation Count:10491
10491-520210
3783 -
3784 m_clipLines[y].spans = m_spans + count;
executed (the execution status of this line is deduced): m_clipLines[y].spans = m_spans + count;
-
3785 m_clipLines[y].count = lastInBand - firstInBand + 1;
executed (the execution status of this line is deduced): m_clipLines[y].count = lastInBand - firstInBand + 1;
-
3786 -
3787 for (int r = firstInBand; r <= lastInBand; ++r) {
evaluated: r <= lastInBand
TRUEFALSE
yes
Evaluation Count:898183
yes
Evaluation Count:520210
520210-898183
3788 const QRect &currRect = rects.at(r);
executed (the execution status of this line is deduced): const QRect &currRect = rects.at(r);
-
3789 QSpan *span = m_spans + count;
executed (the execution status of this line is deduced): QSpan *span = m_spans + count;
-
3790 span->x = currRect.x();
executed (the execution status of this line is deduced): span->x = currRect.x();
-
3791 span->len = currRect.width();
executed (the execution status of this line is deduced): span->len = currRect.width();
-
3792 span->y = y;
executed (the execution status of this line is deduced): span->y = y;
-
3793 span->coverage = 255;
executed (the execution status of this line is deduced): span->coverage = 255;
-
3794 ++count;
executed (the execution status of this line is deduced): ++count;
-
3795 }
executed: }
Execution Count:898183
898183
3796 ++y;
executed (the execution status of this line is deduced): ++y;
-
3797 }
executed: }
Execution Count:520210
520210
3798 -
3799 firstInBand = lastInBand + 1;
executed (the execution status of this line is deduced): firstInBand = lastInBand + 1;
-
3800 }
executed: }
Execution Count:10491
10491
3801 -
3802 Q_ASSERT(count <= allocated);
executed (the execution status of this line is deduced): qt_noop();
-
3803 -
3804 while (y < clipSpanHeight) {
evaluated: y < clipSpanHeight
TRUEFALSE
yes
Evaluation Count:67012
yes
Evaluation Count:3069
3069-67012
3805 m_clipLines[y].spans = 0;
executed (the execution status of this line is deduced): m_clipLines[y].spans = 0;
-
3806 m_clipLines[y].count = 0;
executed (the execution status of this line is deduced): m_clipLines[y].count = 0;
-
3807 ++y;
executed (the execution status of this line is deduced): ++y;
-
3808 }
executed: }
Execution Count:67012
67012
3809 -
3810 }
executed: }
Execution Count:3069
3069
3811 } QT_CATCH(...) { -
3812 free(m_spans); // have to free m_spans again or someone might think that we were successfully initialized.
never executed (the execution status of this line is deduced): free(m_spans);
-
3813 m_spans = 0;
never executed (the execution status of this line is deduced): m_spans = 0;
-
3814 QT_RETHROW;
never executed (the execution status of this line is deduced): qt_noop();
-
3815 }
never executed: }
0
3816 } QT_CATCH(...) { -
3817 free(m_clipLines); // same for clipLines
never executed (the execution status of this line is deduced): free(m_clipLines);
-
3818 m_clipLines = 0;
never executed (the execution status of this line is deduced): m_clipLines = 0;
-
3819 QT_RETHROW;
never executed (the execution status of this line is deduced): qt_noop();
-
3820 }
never executed: }
0
3821} -
3822 -
3823void QClipData::fixup() -
3824{ -
3825 Q_ASSERT(m_spans);
executed (the execution status of this line is deduced): qt_noop();
-
3826 -
3827 if (count == 0) {
evaluated: count == 0
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:574
12-574
3828 ymin = ymax = xmin = xmax = 0;
executed (the execution status of this line is deduced): ymin = ymax = xmin = xmax = 0;
-
3829 return;
executed: return;
Execution Count:12
12
3830 } -
3831 -
3832 int y = -1;
executed (the execution status of this line is deduced): int y = -1;
-
3833 ymin = m_spans[0].y;
executed (the execution status of this line is deduced): ymin = m_spans[0].y;
-
3834 ymax = m_spans[count-1].y + 1;
executed (the execution status of this line is deduced): ymax = m_spans[count-1].y + 1;
-
3835 xmin = INT_MAX;
executed (the execution status of this line is deduced): xmin = 2147483647;
-
3836 xmax = 0;
executed (the execution status of this line is deduced): xmax = 0;
-
3837 -
3838 const int firstLeft = m_spans[0].x;
executed (the execution status of this line is deduced): const int firstLeft = m_spans[0].x;
-
3839 const int firstRight = m_spans[0].x + m_spans[0].len;
executed (the execution status of this line is deduced): const int firstRight = m_spans[0].x + m_spans[0].len;
-
3840 bool isRect = true;
executed (the execution status of this line is deduced): bool isRect = true;
-
3841 -
3842 for (int i = 0; i < count; ++i) {
evaluated: i < count
TRUEFALSE
yes
Evaluation Count:111874
yes
Evaluation Count:574
574-111874
3843 QT_FT_Span_& span = m_spans[i];
executed (the execution status of this line is deduced): QT_FT_Span_& span = m_spans[i];
-
3844 -
3845 if (span.y != y) {
evaluated: span.y != y
TRUEFALSE
yes
Evaluation Count:87947
yes
Evaluation Count:23927
23927-87947
3846 if (span.y != y + 1 && y != -1)
evaluated: span.y != y + 1
TRUEFALSE
yes
Evaluation Count:556
yes
Evaluation Count:87391
evaluated: y != -1
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:548
8-87391
3847 isRect = false;
executed: isRect = false;
Execution Count:8
8
3848 y = span.y;
executed (the execution status of this line is deduced): y = span.y;
-
3849 m_clipLines[y].spans = &span;
executed (the execution status of this line is deduced): m_clipLines[y].spans = &span;
-
3850 m_clipLines[y].count = 1;
executed (the execution status of this line is deduced): m_clipLines[y].count = 1;
-
3851 } else
executed: }
Execution Count:87947
87947
3852 ++m_clipLines[y].count;
executed: ++m_clipLines[y].count;
Execution Count:23927
23927
3853 -
3854 const int spanLeft = span.x;
executed (the execution status of this line is deduced): const int spanLeft = span.x;
-
3855 const int spanRight = spanLeft + span.len;
executed (the execution status of this line is deduced): const int spanRight = spanLeft + span.len;
-
3856 -
3857 if (spanLeft < xmin)
evaluated: spanLeft < xmin
TRUEFALSE
yes
Evaluation Count:24015
yes
Evaluation Count:87859
24015-87859
3858 xmin = spanLeft;
executed: xmin = spanLeft;
Execution Count:24015
24015
3859 -
3860 if (spanRight > xmax)
evaluated: spanRight > xmax
TRUEFALSE
yes
Evaluation Count:24058
yes
Evaluation Count:87816
24058-87816
3861 xmax = spanRight;
executed: xmax = spanRight;
Execution Count:24058
24058
3862 -
3863 if (spanLeft != firstLeft || spanRight != firstRight)
evaluated: spanLeft != firstLeft
TRUEFALSE
yes
Evaluation Count:106131
yes
Evaluation Count:5743
evaluated: spanRight != firstRight
TRUEFALSE
yes
Evaluation Count:542
yes
Evaluation Count:5201
542-106131
3864 isRect = false;
executed: isRect = false;
Execution Count:106673
106673
3865 }
executed: }
Execution Count:111874
111874
3866 -
3867 if (isRect) {
evaluated: isRect
TRUEFALSE
yes
Evaluation Count:58
yes
Evaluation Count:516
58-516
3868 hasRectClip = true;
executed (the execution status of this line is deduced): hasRectClip = true;
-
3869 clipRect.setRect(xmin, ymin, xmax - xmin, ymax - ymin);
executed (the execution status of this line is deduced): clipRect.setRect(xmin, ymin, xmax - xmin, ymax - ymin);
-
3870 }
executed: }
Execution Count:58
58
3871}
executed: }
Execution Count:574
574
3872 -
3873/* -
3874 Convert \a rect to clip spans. -
3875 */ -
3876void QClipData::setClipRect(const QRect &rect) -
3877{ -
3878 if (hasRectClip && rect == clipRect)
evaluated: hasRectClip
TRUEFALSE
yes
Evaluation Count:22850
yes
Evaluation Count:28922
evaluated: rect == clipRect
TRUEFALSE
yes
Evaluation Count:8737
yes
Evaluation Count:14113
8737-28922
3879 return;
executed: return;
Execution Count:8737
8737
3880 -
3881// qDebug() << "setClipRect" << clipSpanHeight << count << allocated << rect; -
3882 hasRectClip = true;
executed (the execution status of this line is deduced): hasRectClip = true;
-
3883 hasRegionClip = false;
executed (the execution status of this line is deduced): hasRegionClip = false;
-
3884 clipRect = rect;
executed (the execution status of this line is deduced): clipRect = rect;
-
3885 -
3886 xmin = rect.x();
executed (the execution status of this line is deduced): xmin = rect.x();
-
3887 xmax = rect.x() + rect.width();
executed (the execution status of this line is deduced): xmax = rect.x() + rect.width();
-
3888 ymin = qMin(rect.y(), clipSpanHeight);
executed (the execution status of this line is deduced): ymin = qMin(rect.y(), clipSpanHeight);
-
3889 ymax = qMin(rect.y() + rect.height(), clipSpanHeight);
executed (the execution status of this line is deduced): ymax = qMin(rect.y() + rect.height(), clipSpanHeight);
-
3890 -
3891 if (m_spans) {
evaluated: m_spans
TRUEFALSE
yes
Evaluation Count:1940
yes
Evaluation Count:41095
1940-41095
3892 free(m_spans);
executed (the execution status of this line is deduced): free(m_spans);
-
3893 m_spans = 0;
executed (the execution status of this line is deduced): m_spans = 0;
-
3894 }
executed: }
Execution Count:1940
1940
3895 -
3896// qDebug() << xmin << xmax << ymin << ymax; -
3897}
executed: }
Execution Count:43035
43035
3898 -
3899/* -
3900 Convert \a region to clip spans. -
3901 */ -
3902void QClipData::setClipRegion(const QRegion &region) -
3903{ -
3904 if (region.rectCount() == 1) {
evaluated: region.rectCount() == 1
TRUEFALSE
yes
Evaluation Count:30776
yes
Evaluation Count:7109
7109-30776
3905 setClipRect(region.rects().at(0));
executed (the execution status of this line is deduced): setClipRect(region.rects().at(0));
-
3906 return;
executed: return;
Execution Count:30776
30776
3907 } -
3908 -
3909 hasRegionClip = true;
executed (the execution status of this line is deduced): hasRegionClip = true;
-
3910 hasRectClip = false;
executed (the execution status of this line is deduced): hasRectClip = false;
-
3911 clipRegion = region;
executed (the execution status of this line is deduced): clipRegion = region;
-
3912 -
3913 { // set bounding rect -
3914 const QRect rect = region.boundingRect();
executed (the execution status of this line is deduced): const QRect rect = region.boundingRect();
-
3915 xmin = rect.x();
executed (the execution status of this line is deduced): xmin = rect.x();
-
3916 xmax = rect.x() + rect.width();
executed (the execution status of this line is deduced): xmax = rect.x() + rect.width();
-
3917 ymin = rect.y();
executed (the execution status of this line is deduced): ymin = rect.y();
-
3918 ymax = rect.y() + rect.height();
executed (the execution status of this line is deduced): ymax = rect.y() + rect.height();
-
3919 } -
3920 -
3921 if (m_spans) {
evaluated: m_spans
TRUEFALSE
yes
Evaluation Count:782
yes
Evaluation Count:6327
782-6327
3922 free(m_spans);
executed (the execution status of this line is deduced): free(m_spans);
-
3923 m_spans = 0;
executed (the execution status of this line is deduced): m_spans = 0;
-
3924 }
executed: }
Execution Count:782
782
3925 -
3926}
executed: }
Execution Count:7109
7109
3927 -
3928/*! -
3929 \internal -
3930 spans must be sorted on y -
3931*/ -
3932static const QSpan *qt_intersect_spans(const QClipData *clip, int *currentClip, -
3933 const QSpan *spans, const QSpan *end, -
3934 QSpan **outSpans, int available) -
3935{ -
3936 const_cast<QClipData *>(clip)->initialize();
executed (the execution status of this line is deduced): const_cast<QClipData *>(clip)->initialize();
-
3937 -
3938 QSpan *out = *outSpans;
executed (the execution status of this line is deduced): QSpan *out = *outSpans;
-
3939 -
3940 const QSpan *clipSpans = clip->m_spans + *currentClip;
executed (the execution status of this line is deduced): const QSpan *clipSpans = clip->m_spans + *currentClip;
-
3941 const QSpan *clipEnd = clip->m_spans + clip->count;
executed (the execution status of this line is deduced): const QSpan *clipEnd = clip->m_spans + clip->count;
-
3942 -
3943 while (available && spans < end ) {
evaluated: available
TRUEFALSE
yes
Evaluation Count:5209064
yes
Evaluation Count:154
evaluated: spans < end
TRUEFALSE
yes
Evaluation Count:5187081
yes
Evaluation Count:21983
154-5209064
3944 if (clipSpans >= clipEnd) {
evaluated: clipSpans >= clipEnd
TRUEFALSE
yes
Evaluation Count:3404
yes
Evaluation Count:5183677
3404-5183677
3945 spans = end;
executed (the execution status of this line is deduced): spans = end;
-
3946 break;
executed: break;
Execution Count:3404
3404
3947 } -
3948 if (clipSpans->y > spans->y) {
evaluated: clipSpans->y > spans->y
TRUEFALSE
yes
Evaluation Count:429940
yes
Evaluation Count:4753737
429940-4753737
3949 ++spans;
executed (the execution status of this line is deduced): ++spans;
-
3950 continue;
executed: continue;
Execution Count:429940
429940
3951 } -
3952 if (spans->y != clipSpans->y) {
evaluated: spans->y != clipSpans->y
TRUEFALSE
yes
Evaluation Count:993951
yes
Evaluation Count:3759786
993951-3759786
3953 if (spans->y < clip->count && clip->m_clipLines[spans->y].spans)
evaluated: spans->y < clip->count
TRUEFALSE
yes
Evaluation Count:880968
yes
Evaluation Count:112983
evaluated: clip->m_clipLines[spans->y].spans
TRUEFALSE
yes
Evaluation Count:872718
yes
Evaluation Count:8250
8250-880968
3954 clipSpans = clip->m_clipLines[spans->y].spans;
executed: clipSpans = clip->m_clipLines[spans->y].spans;
Execution Count:872718
872718
3955 else -
3956 ++clipSpans;
executed: ++clipSpans;
Execution Count:121233
121233
3957 continue;
executed: continue;
Execution Count:993951
993951
3958 } -
3959 Q_ASSERT(spans->y == clipSpans->y);
executed (the execution status of this line is deduced): qt_noop();
-
3960 -
3961 int sx1 = spans->x;
executed (the execution status of this line is deduced): int sx1 = spans->x;
-
3962 int sx2 = sx1 + spans->len;
executed (the execution status of this line is deduced): int sx2 = sx1 + spans->len;
-
3963 int cx1 = clipSpans->x;
executed (the execution status of this line is deduced): int cx1 = clipSpans->x;
-
3964 int cx2 = cx1 + clipSpans->len;
executed (the execution status of this line is deduced): int cx2 = cx1 + clipSpans->len;
-
3965 -
3966 if (cx1 < sx1 && cx2 < sx1) {
evaluated: cx1 < sx1
TRUEFALSE
yes
Evaluation Count:2811224
yes
Evaluation Count:948562
evaluated: cx2 < sx1
TRUEFALSE
yes
Evaluation Count:551510
yes
Evaluation Count:2259714
551510-2811224
3967 ++clipSpans;
executed (the execution status of this line is deduced): ++clipSpans;
-
3968 continue;
executed: continue;
Execution Count:551510
551510
3969 } else if (sx1 < cx1 && sx2 < cx1) {
evaluated: sx1 < cx1
TRUEFALSE
yes
Evaluation Count:389716
yes
Evaluation Count:2818560
evaluated: sx2 < cx1
TRUEFALSE
yes
Evaluation Count:295779
yes
Evaluation Count:93937
93937-2818560
3970 ++spans;
executed (the execution status of this line is deduced): ++spans;
-
3971 continue;
executed: continue;
Execution Count:295779
295779
3972 } -
3973 int x = qMax(sx1, cx1);
executed (the execution status of this line is deduced): int x = qMax(sx1, cx1);
-
3974 int len = qMin(sx2, cx2) - x;
executed (the execution status of this line is deduced): int len = qMin(sx2, cx2) - x;
-
3975 if (len) {
evaluated: len
TRUEFALSE
yes
Evaluation Count:2904043
yes
Evaluation Count:8454
8454-2904043
3976 out->x = qMax(sx1, cx1);
executed (the execution status of this line is deduced): out->x = qMax(sx1, cx1);
-
3977 out->len = qMin(sx2, cx2) - out->x;
executed (the execution status of this line is deduced): out->len = qMin(sx2, cx2) - out->x;
-
3978 out->y = spans->y;
executed (the execution status of this line is deduced): out->y = spans->y;
-
3979 out->coverage = qt_div_255(spans->coverage * clipSpans->coverage);
executed (the execution status of this line is deduced): out->coverage = qt_div_255(spans->coverage * clipSpans->coverage);
-
3980 ++out;
executed (the execution status of this line is deduced): ++out;
-
3981 --available;
executed (the execution status of this line is deduced): --available;
-
3982 }
executed: }
Execution Count:2904043
2904043
3983 if (sx2 < cx2) {
evaluated: sx2 < cx2
TRUEFALSE
yes
Evaluation Count:2259020
yes
Evaluation Count:653477
653477-2259020
3984 ++spans;
executed (the execution status of this line is deduced): ++spans;
-
3985 } else {
executed: }
Execution Count:2259020
2259020
3986 ++clipSpans;
executed (the execution status of this line is deduced): ++clipSpans;
-
3987 }
executed: }
Execution Count:653477
653477
3988 } -
3989 -
3990 *outSpans = out;
executed (the execution status of this line is deduced): *outSpans = out;
-
3991 *currentClip = clipSpans - clip->m_spans;
executed (the execution status of this line is deduced): *currentClip = clipSpans - clip->m_spans;
-
3992 return spans;
executed: return spans;
Execution Count:25541
25541
3993} -
3994 -
3995static void qt_span_fill_clipped(int spanCount, const QSpan *spans, void *userData) -
3996{ -
3997// qDebug() << "qt_span_fill_clipped" << spanCount; -
3998 QSpanData *fillData = reinterpret_cast<QSpanData *>(userData);
executed (the execution status of this line is deduced): QSpanData *fillData = reinterpret_cast<QSpanData *>(userData);
-
3999 -
4000 Q_ASSERT(fillData->blend && fillData->unclipped_blend);
executed (the execution status of this line is deduced): qt_noop();
-
4001 -
4002 const int NSPANS = 256;
executed (the execution status of this line is deduced): const int NSPANS = 256;
-
4003 QSpan cspans[NSPANS];
executed (the execution status of this line is deduced): QSpan cspans[NSPANS];
-
4004 int currentClip = 0;
executed (the execution status of this line is deduced): int currentClip = 0;
-
4005 const QSpan *end = spans + spanCount;
executed (the execution status of this line is deduced): const QSpan *end = spans + spanCount;
-
4006 while (spans < end) {
evaluated: spans < end
TRUEFALSE
yes
Evaluation Count:24623
yes
Evaluation Count:25148
24623-25148
4007 QSpan *clipped = cspans;
executed (the execution status of this line is deduced): QSpan *clipped = cspans;
-
4008 spans = qt_intersect_spans(fillData->clip, &currentClip, spans, end, &clipped, NSPANS);
executed (the execution status of this line is deduced): spans = qt_intersect_spans(fillData->clip, &currentClip, spans, end, &clipped, NSPANS);
-
4009// qDebug() << "processed " << spanCount - (end - spans) << "clipped" << clipped-cspans -
4010// << "span:" << cspans->x << cspans->y << cspans->len << spans->coverage; -
4011 -
4012 if (clipped - cspans)
evaluated: clipped - cspans
TRUEFALSE
yes
Evaluation Count:21356
yes
Evaluation Count:3267
3267-21356
4013 fillData->unclipped_blend(clipped - cspans, cspans, fillData);
executed: fillData->unclipped_blend(clipped - cspans, cspans, fillData);
Execution Count:21356
21356
4014 }
executed: }
Execution Count:24623
24623
4015}
executed: }
Execution Count:25148
25148
4016 -
4017/* -
4018 \internal -
4019 Clip spans to \a{clip}-rectangle. -
4020 Returns number of unclipped spans -
4021*/ -
4022static int qt_intersect_spans(QT_FT_Span *spans, int numSpans, -
4023 const QRect &clip) -
4024{ -
4025 const short minx = clip.left();
executed (the execution status of this line is deduced): const short minx = clip.left();
-
4026 const short miny = clip.top();
executed (the execution status of this line is deduced): const short miny = clip.top();
-
4027 const short maxx = clip.right();
executed (the execution status of this line is deduced): const short maxx = clip.right();
-
4028 const short maxy = clip.bottom();
executed (the execution status of this line is deduced): const short maxy = clip.bottom();
-
4029 -
4030 int n = 0;
executed (the execution status of this line is deduced): int n = 0;
-
4031 for (int i = 0; i < numSpans; ++i) {
evaluated: i < numSpans
TRUEFALSE
yes
Evaluation Count:6601965
yes
Evaluation Count:307451
307451-6601965
4032 if (spans[i].y > maxy)
evaluated: spans[i].y > maxy
TRUEFALSE
yes
Evaluation Count:19151
yes
Evaluation Count:6582814
19151-6582814
4033 break;
executed: break;
Execution Count:19151
19151
4034 if (spans[i].y < miny
evaluated: spans[i].y < miny
TRUEFALSE
yes
Evaluation Count:36058
yes
Evaluation Count:6546756
36058-6546756
4035 || spans[i].x > maxx
evaluated: spans[i].x > maxx
TRUEFALSE
yes
Evaluation Count:24023
yes
Evaluation Count:6522733
24023-6522733
4036 || spans[i].x + spans[i].len <= minx) {
evaluated: spans[i].x + spans[i].len <= minx
TRUEFALSE
yes
Evaluation Count:17375
yes
Evaluation Count:6505358
17375-6505358
4037 continue;
executed: continue;
Execution Count:77456
77456
4038 } -
4039 if (spans[i].x < minx) {
evaluated: spans[i].x < minx
TRUEFALSE
yes
Evaluation Count:1340
yes
Evaluation Count:6504018
1340-6504018
4040 spans[n].len = qMin(spans[i].len - (minx - spans[i].x), maxx - minx + 1);
executed (the execution status of this line is deduced): spans[n].len = qMin(spans[i].len - (minx - spans[i].x), maxx - minx + 1);
-
4041 spans[n].x = minx;
executed (the execution status of this line is deduced): spans[n].x = minx;
-
4042 } else {
executed: }
Execution Count:1340
1340
4043 spans[n].x = spans[i].x;
executed (the execution status of this line is deduced): spans[n].x = spans[i].x;
-
4044 spans[n].len = qMin(spans[i].len, ushort(maxx - spans[n].x + 1));
executed (the execution status of this line is deduced): spans[n].len = qMin(spans[i].len, ushort(maxx - spans[n].x + 1));
-
4045 }
executed: }
Execution Count:6504018
6504018
4046 if (spans[n].len == 0)
partially evaluated: spans[n].len == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6505358
0-6505358
4047 continue;
never executed: continue;
0
4048 spans[n].y = spans[i].y;
executed (the execution status of this line is deduced): spans[n].y = spans[i].y;
-
4049 spans[n].coverage = spans[i].coverage;
executed (the execution status of this line is deduced): spans[n].coverage = spans[i].coverage;
-
4050 ++n;
executed (the execution status of this line is deduced): ++n;
-
4051 }
executed: }
Execution Count:6505358
6505358
4052 return n;
executed: return n;
Execution Count:326602
326602
4053} -
4054 -
4055 -
4056static void qt_span_fill_clipRect(int count, const QSpan *spans, -
4057 void *userData) -
4058{ -
4059 QSpanData *fillData = reinterpret_cast<QSpanData *>(userData);
executed (the execution status of this line is deduced): QSpanData *fillData = reinterpret_cast<QSpanData *>(userData);
-
4060 Q_ASSERT(fillData->blend && fillData->unclipped_blend);
executed (the execution status of this line is deduced): qt_noop();
-
4061 -
4062 Q_ASSERT(fillData->clip);
executed (the execution status of this line is deduced): qt_noop();
-
4063 Q_ASSERT(!fillData->clip->clipRect.isEmpty());
executed (the execution status of this line is deduced): qt_noop();
-
4064 -
4065 // hw: check if this const_cast<> is safe!!! -
4066 count = qt_intersect_spans(const_cast<QSpan*>(spans), count,
executed (the execution status of this line is deduced): count = qt_intersect_spans(const_cast<QSpan*>(spans), count,
-
4067 fillData->clip->clipRect);
executed (the execution status of this line is deduced): fillData->clip->clipRect);
-
4068 if (count > 0)
evaluated: count > 0
TRUEFALSE
yes
Evaluation Count:270144
yes
Evaluation Count:2328
2328-270144
4069 fillData->unclipped_blend(count, spans, fillData);
executed: fillData->unclipped_blend(count, spans, fillData);
Execution Count:270144
270144
4070}
executed: }
Execution Count:272472
272472
4071 -
4072static void qt_span_clip(int count, const QSpan *spans, void *userData) -
4073{ -
4074 ClipData *clipData = reinterpret_cast<ClipData *>(userData);
executed (the execution status of this line is deduced): ClipData *clipData = reinterpret_cast<ClipData *>(userData);
-
4075 -
4076// qDebug() << " qt_span_clip: " << count << clipData->operation; -
4077// for (int i = 0; i < qMin(count, 10); ++i) { -
4078// qDebug() << " " << spans[i].x << spans[i].y << spans[i].len << spans[i].coverage; -
4079// } -
4080 -
4081 switch (clipData->operation) { -
4082 -
4083 case Qt::IntersectClip: -
4084 { -
4085 QClipData *newClip = clipData->newClip;
executed (the execution status of this line is deduced): QClipData *newClip = clipData->newClip;
-
4086 newClip->initialize();
executed (the execution status of this line is deduced): newClip->initialize();
-
4087 -
4088 int currentClip = 0;
executed (the execution status of this line is deduced): int currentClip = 0;
-
4089 const QSpan *end = spans + count;
executed (the execution status of this line is deduced): const QSpan *end = spans + count;
-
4090 while (spans < end) {
evaluated: spans < end
TRUEFALSE
yes
Evaluation Count:918
yes
Evaluation Count:868
868-918
4091 QSpan *newspans = newClip->m_spans + newClip->count;
executed (the execution status of this line is deduced): QSpan *newspans = newClip->m_spans + newClip->count;
-
4092 spans = qt_intersect_spans(clipData->oldClip, &currentClip, spans, end,
executed (the execution status of this line is deduced): spans = qt_intersect_spans(clipData->oldClip, &currentClip, spans, end,
-
4093 &newspans, newClip->allocated - newClip->count);
executed (the execution status of this line is deduced): &newspans, newClip->allocated - newClip->count);
-
4094 newClip->count = newspans - newClip->m_spans;
executed (the execution status of this line is deduced): newClip->count = newspans - newClip->m_spans;
-
4095 if (spans < end) {
evaluated: spans < end
TRUEFALSE
yes
Evaluation Count:61
yes
Evaluation Count:857
61-857
4096 newClip->m_spans = q_check_ptr((QSpan *)realloc(newClip->m_spans, newClip->allocated*2*sizeof(QSpan)));
executed (the execution status of this line is deduced): newClip->m_spans = q_check_ptr((QSpan *)realloc(newClip->m_spans, newClip->allocated*2*sizeof(QSpan)));
-
4097 newClip->allocated *= 2;
executed (the execution status of this line is deduced): newClip->allocated *= 2;
-
4098 }
executed: }
Execution Count:61
61
4099 }
executed: }
Execution Count:918
918
4100 } -
4101 break;
executed: break;
Execution Count:868
868
4102 -
4103 case Qt::ReplaceClip: -
4104 clipData->newClip->appendSpans(spans, count);
never executed (the execution status of this line is deduced): clipData->newClip->appendSpans(spans, count);
-
4105 break;
never executed: break;
0
4106 case Qt::NoClip: -
4107 break;
never executed: break;
0
4108 } -
4109}
executed: }
Execution Count:868
868
4110 -
4111#ifndef QT_NO_DEBUG -
4112QImage QRasterBuffer::bufferImage() const -
4113{ -
4114 QImage image(m_width, m_height, QImage::Format_ARGB32_Premultiplied); -
4115 -
4116 for (int y = 0; y < m_height; ++y) { -
4117 uint *span = (uint *)const_cast<QRasterBuffer *>(this)->scanLine(y); -
4118 -
4119 for (int x=0; x<m_width; ++x) { -
4120 uint argb = span[x]; -
4121 image.setPixel(x, y, argb); -
4122 } -
4123 } -
4124 return image; -
4125} -
4126#endif -
4127 -
4128 -
4129void QRasterBuffer::flushToARGBImage(QImage *target) const -
4130{ -
4131 int w = qMin(m_width, target->width());
never executed (the execution status of this line is deduced): int w = qMin(m_width, target->width());
-
4132 int h = qMin(m_height, target->height());
never executed (the execution status of this line is deduced): int h = qMin(m_height, target->height());
-
4133 -
4134 for (int y=0; y<h; ++y) {
never evaluated: y<h
0
4135 uint *sourceLine = (uint *)const_cast<QRasterBuffer *>(this)->scanLine(y);
never executed (the execution status of this line is deduced): uint *sourceLine = (uint *)const_cast<QRasterBuffer *>(this)->scanLine(y);
-
4136 QRgb *dest = (QRgb *) target->scanLine(y);
never executed (the execution status of this line is deduced): QRgb *dest = (QRgb *) target->scanLine(y);
-
4137 for (int x=0; x<w; ++x) {
never evaluated: x<w
0
4138 QRgb pixel = sourceLine[x];
never executed (the execution status of this line is deduced): QRgb pixel = sourceLine[x];
-
4139 int alpha = qAlpha(pixel);
never executed (the execution status of this line is deduced): int alpha = qAlpha(pixel);
-
4140 if (!alpha) {
never evaluated: !alpha
0
4141 dest[x] = 0;
never executed (the execution status of this line is deduced): dest[x] = 0;
-
4142 } else {
never executed: }
0
4143 dest[x] = (alpha << 24)
never executed (the execution status of this line is deduced): dest[x] = (alpha << 24)
-
4144 | ((255*qRed(pixel)/alpha) << 16)
never executed (the execution status of this line is deduced): | ((255*qRed(pixel)/alpha) << 16)
-
4145 | ((255*qGreen(pixel)/alpha) << 8)
never executed (the execution status of this line is deduced): | ((255*qGreen(pixel)/alpha) << 8)
-
4146 | ((255*qBlue(pixel)/alpha) << 0);
never executed (the execution status of this line is deduced): | ((255*qBlue(pixel)/alpha) << 0);
-
4147 }
never executed: }
0
4148 } -
4149 }
never executed: }
0
4150}
never executed: }
0
4151 -
4152 -
4153class QGradientCache -
4154{ -
4155 struct CacheInfo -
4156 { -
4157 inline CacheInfo(QGradientStops s, int op, QGradient::InterpolationMode mode) : -
4158 stops(s), opacity(op), interpolationMode(mode) {}
executed: }
Execution Count:12353
12353
4159 uint buffer[GRADIENT_STOPTABLE_SIZE]; -
4160 QGradientStops stops; -
4161 int opacity; -
4162 QGradient::InterpolationMode interpolationMode; -
4163 }; -
4164 -
4165 typedef QMultiHash<quint64, CacheInfo> QGradientColorTableHash; -
4166 -
4167public: -
4168 inline const uint *getBuffer(const QGradient &gradient, int opacity) { -
4169 quint64 hash_val = 0;
executed (the execution status of this line is deduced): quint64 hash_val = 0;
-
4170 -
4171 QGradientStops stops = gradient.stops();
executed (the execution status of this line is deduced): QGradientStops stops = gradient.stops();
-
4172 for (int i = 0; i < stops.size() && i <= 2; i++)
evaluated: i < stops.size()
TRUEFALSE
yes
Evaluation Count:35219
yes
Evaluation Count:17064
evaluated: i <= 2
TRUEFALSE
yes
Evaluation Count:35073
yes
Evaluation Count:149
149-35219
4173 hash_val += stops[i].second.rgba();
executed: hash_val += stops[i].second.rgba();
Execution Count:35073
35073
4174 -
4175 QMutexLocker lock(&mutex);
executed (the execution status of this line is deduced): QMutexLocker lock(&mutex);
-
4176 QGradientColorTableHash::const_iterator it = cache.constFind(hash_val);
executed (the execution status of this line is deduced): QGradientColorTableHash::const_iterator it = cache.constFind(hash_val);
-
4177 -
4178 if (it == cache.constEnd())
evaluated: it == cache.constEnd()
TRUEFALSE
yes
Evaluation Count:12349
yes
Evaluation Count:4867
4867-12349
4179 return addCacheElement(hash_val, gradient, opacity);
executed: return addCacheElement(hash_val, gradient, opacity);
Execution Count:12349
12349
4180 else { -
4181 do { -
4182 const CacheInfo &cache_info = it.value();
executed (the execution status of this line is deduced): const CacheInfo &cache_info = it.value();
-
4183 if (cache_info.stops == stops && cache_info.opacity == opacity && cache_info.interpolationMode == gradient.interpolationMode())
evaluated: cache_info.stops == stops
TRUEFALSE
yes
Evaluation Count:4864
yes
Evaluation Count:6
partially evaluated: cache_info.opacity == opacity
TRUEFALSE
yes
Evaluation Count:4864
no
Evaluation Count:0
evaluated: cache_info.interpolationMode == gradient.interpolationMode()
TRUEFALSE
yes
Evaluation Count:4863
yes
Evaluation Count:1
0-4864
4184 return cache_info.buffer;
executed: return cache_info.buffer;
Execution Count:4863
4863
4185 ++it;
executed (the execution status of this line is deduced): ++it;
-
4186 } while (it != cache.constEnd() && it.key() == hash_val);
executed: }
Execution Count:7
partially evaluated: it != cache.constEnd()
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
evaluated: it.key() == hash_val
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:4
0-7
4187 // an exact match for these stops and opacity was not found, create new cache -
4188 return addCacheElement(hash_val, gradient, opacity);
executed: return addCacheElement(hash_val, gradient, opacity);
Execution Count:4
4
4189 } -
4190 } -
4191 -
4192 inline int paletteSize() const { return GRADIENT_STOPTABLE_SIZE; }
executed: return 1024;
Execution Count:12353
12353
4193protected: -
4194 inline int maxCacheSize() const { return 60; }
executed: return 60;
Execution Count:24622
24622
4195 inline void generateGradientColorTable(const QGradient& g, -
4196 uint *colorTable, -
4197 int size, int opacity) const; -
4198 uint *addCacheElement(quint64 hash_val, const QGradient &gradient, int opacity) { -
4199 if (cache.size() == maxCacheSize()) {
evaluated: cache.size() == maxCacheSize()
TRUEFALSE
yes
Evaluation Count:12269
yes
Evaluation Count:84
84-12269
4200 // may remove more than 1, but OK -
4201 cache.erase(cache.begin() + (qrand() % maxCacheSize()));
executed (the execution status of this line is deduced): cache.erase(cache.begin() + (qrand() % maxCacheSize()));
-
4202 }
executed: }
Execution Count:12269
12269
4203 CacheInfo cache_entry(gradient.stops(), opacity, gradient.interpolationMode());
executed (the execution status of this line is deduced): CacheInfo cache_entry(gradient.stops(), opacity, gradient.interpolationMode());
-
4204 generateGradientColorTable(gradient, cache_entry.buffer, paletteSize(), opacity);
executed (the execution status of this line is deduced): generateGradientColorTable(gradient, cache_entry.buffer, paletteSize(), opacity);
-
4205 return cache.insert(hash_val, cache_entry).value().buffer;
executed: return cache.insert(hash_val, cache_entry).value().buffer;
Execution Count:12353
12353
4206 } -
4207 -
4208 QGradientColorTableHash cache; -
4209 QMutex mutex; -
4210}; -
4211 -
4212void QGradientCache::generateGradientColorTable(const QGradient& gradient, uint *colorTable, int size, int opacity) const -
4213{ -
4214 QGradientStops stops = gradient.stops();
executed (the execution status of this line is deduced): QGradientStops stops = gradient.stops();
-
4215 int stopCount = stops.count();
executed (the execution status of this line is deduced): int stopCount = stops.count();
-
4216 Q_ASSERT(stopCount > 0);
executed (the execution status of this line is deduced): qt_noop();
-
4217 -
4218 bool colorInterpolation = (gradient.interpolationMode() == QGradient::ColorInterpolation);
executed (the execution status of this line is deduced): bool colorInterpolation = (gradient.interpolationMode() == QGradient::ColorInterpolation);
-
4219 -
4220 if (stopCount == 2) {
evaluated: stopCount == 2
TRUEFALSE
yes
Evaluation Count:12342
yes
Evaluation Count:11
11-12342
4221 uint first_color = ARGB_COMBINE_ALPHA(stops[0].second.rgba(), opacity);
executed (the execution status of this line is deduced): uint first_color = ((((stops[0].second.rgba() >> 24) * opacity) >> 8) << 24) | (stops[0].second.rgba() & 0x00ffffff);
-
4222 uint second_color = ARGB_COMBINE_ALPHA(stops[1].second.rgba(), opacity);
executed (the execution status of this line is deduced): uint second_color = ((((stops[1].second.rgba() >> 24) * opacity) >> 8) << 24) | (stops[1].second.rgba() & 0x00ffffff);
-
4223 -
4224 qreal first_stop = stops[0].first;
executed (the execution status of this line is deduced): qreal first_stop = stops[0].first;
-
4225 qreal second_stop = stops[1].first;
executed (the execution status of this line is deduced): qreal second_stop = stops[1].first;
-
4226 -
4227 if (second_stop < first_stop) {
partially evaluated: second_stop < first_stop
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12342
0-12342
4228 qSwap(first_color, second_color);
never executed (the execution status of this line is deduced): qSwap(first_color, second_color);
-
4229 qSwap(first_stop, second_stop);
never executed (the execution status of this line is deduced): qSwap(first_stop, second_stop);
-
4230 }
never executed: }
0
4231 -
4232 if (colorInterpolation) {
evaluated: colorInterpolation
TRUEFALSE
yes
Evaluation Count:12341
yes
Evaluation Count:1
1-12341
4233 first_color = PREMUL(first_color);
executed (the execution status of this line is deduced): first_color = PREMUL(first_color);
-
4234 second_color = PREMUL(second_color);
executed (the execution status of this line is deduced): second_color = PREMUL(second_color);
-
4235 }
executed: }
Execution Count:12341
12341
4236 -
4237 int first_index = qRound(first_stop * (GRADIENT_STOPTABLE_SIZE-1));
executed (the execution status of this line is deduced): int first_index = qRound(first_stop * (1024 -1));
-
4238 int second_index = qRound(second_stop * (GRADIENT_STOPTABLE_SIZE-1));
executed (the execution status of this line is deduced): int second_index = qRound(second_stop * (1024 -1));
-
4239 -
4240 uint red_first = qRed(first_color) << 16;
executed (the execution status of this line is deduced): uint red_first = qRed(first_color) << 16;
-
4241 uint green_first = qGreen(first_color) << 16;
executed (the execution status of this line is deduced): uint green_first = qGreen(first_color) << 16;
-
4242 uint blue_first = qBlue(first_color) << 16;
executed (the execution status of this line is deduced): uint blue_first = qBlue(first_color) << 16;
-
4243 uint alpha_first = qAlpha(first_color) << 16;
executed (the execution status of this line is deduced): uint alpha_first = qAlpha(first_color) << 16;
-
4244 -
4245 uint red_second = qRed(second_color) << 16;
executed (the execution status of this line is deduced): uint red_second = qRed(second_color) << 16;
-
4246 uint green_second = qGreen(second_color) << 16;
executed (the execution status of this line is deduced): uint green_second = qGreen(second_color) << 16;
-
4247 uint blue_second = qBlue(second_color) << 16;
executed (the execution status of this line is deduced): uint blue_second = qBlue(second_color) << 16;
-
4248 uint alpha_second = qAlpha(second_color) << 16;
executed (the execution status of this line is deduced): uint alpha_second = qAlpha(second_color) << 16;
-
4249 -
4250 int i = 0;
executed (the execution status of this line is deduced): int i = 0;
-
4251 for (; i <= qMin(GRADIENT_STOPTABLE_SIZE, first_index); ++i) {
evaluated: i <= qMin(1024, first_index)
TRUEFALSE
yes
Evaluation Count:13989
yes
Evaluation Count:12342
12342-13989
4252 if (colorInterpolation)
evaluated: colorInterpolation
TRUEFALSE
yes
Evaluation Count:13988
yes
Evaluation Count:1
1-13988
4253 colorTable[i] = first_color;
executed: colorTable[i] = first_color;
Execution Count:13988
13988
4254 else -
4255 colorTable[i] = PREMUL(first_color);
executed: colorTable[i] = PREMUL(first_color);
Execution Count:1
1
4256 } -
4257 -
4258 if (i < second_index) {
partially evaluated: i < second_index
TRUEFALSE
yes
Evaluation Count:12342
no
Evaluation Count:0
0-12342
4259 qreal reciprocal = qreal(1) / (second_index - first_index);
executed (the execution status of this line is deduced): qreal reciprocal = qreal(1) / (second_index - first_index);
-
4260 -
4261 int red_delta = qRound(int(red_second - red_first) * reciprocal);
executed (the execution status of this line is deduced): int red_delta = qRound(int(red_second - red_first) * reciprocal);
-
4262 int green_delta = qRound(int(green_second - green_first) * reciprocal);
executed (the execution status of this line is deduced): int green_delta = qRound(int(green_second - green_first) * reciprocal);
-
4263 int blue_delta = qRound(int(blue_second - blue_first) * reciprocal);
executed (the execution status of this line is deduced): int blue_delta = qRound(int(blue_second - blue_first) * reciprocal);
-
4264 int alpha_delta = qRound(int(alpha_second - alpha_first) * reciprocal);
executed (the execution status of this line is deduced): int alpha_delta = qRound(int(alpha_second - alpha_first) * reciprocal);
-
4265 -
4266 // rounding -
4267 red_first += 1 << 15;
executed (the execution status of this line is deduced): red_first += 1 << 15;
-
4268 green_first += 1 << 15;
executed (the execution status of this line is deduced): green_first += 1 << 15;
-
4269 blue_first += 1 << 15;
executed (the execution status of this line is deduced): blue_first += 1 << 15;
-
4270 alpha_first += 1 << 15;
executed (the execution status of this line is deduced): alpha_first += 1 << 15;
-
4271 -
4272 for (; i < qMin(GRADIENT_STOPTABLE_SIZE, second_index); ++i) {
evaluated: i < qMin(1024, second_index)
TRUEFALSE
yes
Evaluation Count:12611161
yes
Evaluation Count:12342
12342-12611161
4273 red_first += red_delta;
executed (the execution status of this line is deduced): red_first += red_delta;
-
4274 green_first += green_delta;
executed (the execution status of this line is deduced): green_first += green_delta;
-
4275 blue_first += blue_delta;
executed (the execution status of this line is deduced): blue_first += blue_delta;
-
4276 alpha_first += alpha_delta;
executed (the execution status of this line is deduced): alpha_first += alpha_delta;
-
4277 -
4278 const uint color = ((alpha_first << 8) & 0xff000000) | (red_first & 0xff0000)
executed (the execution status of this line is deduced): const uint color = ((alpha_first << 8) & 0xff000000) | (red_first & 0xff0000)
-
4279 | ((green_first >> 8) & 0xff00) | (blue_first >> 16);
executed (the execution status of this line is deduced): | ((green_first >> 8) & 0xff00) | (blue_first >> 16);
-
4280 -
4281 if (colorInterpolation)
evaluated: colorInterpolation
TRUEFALSE
yes
Evaluation Count:12610139
yes
Evaluation Count:1022
1022-12610139
4282 colorTable[i] = color;
executed: colorTable[i] = color;
Execution Count:12610139
12610139
4283 else -
4284 colorTable[i] = PREMUL(color);
executed: colorTable[i] = PREMUL(color);
Execution Count:1022
1022
4285 } -
4286 }
executed: }
Execution Count:12342
12342
4287 -
4288 for (; i < GRADIENT_STOPTABLE_SIZE; ++i) {
evaluated: i < 1024
TRUEFALSE
yes
Evaluation Count:13058
yes
Evaluation Count:12342
12342-13058
4289 if (colorInterpolation)
evaluated: colorInterpolation
TRUEFALSE
yes
Evaluation Count:13057
yes
Evaluation Count:1
1-13057
4290 colorTable[i] = second_color;
executed: colorTable[i] = second_color;
Execution Count:13057
13057
4291 else -
4292 colorTable[i] = PREMUL(second_color);
executed: colorTable[i] = PREMUL(second_color);
Execution Count:1
1
4293 } -
4294 -
4295 return;
executed: return;
Execution Count:12342
12342
4296 } -
4297 -
4298 uint current_color = ARGB_COMBINE_ALPHA(stops[0].second.rgba(), opacity);
executed (the execution status of this line is deduced): uint current_color = ((((stops[0].second.rgba() >> 24) * opacity) >> 8) << 24) | (stops[0].second.rgba() & 0x00ffffff);
-
4299 if (stopCount == 1) {
evaluated: stopCount == 1
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:10
1-10
4300 current_color = PREMUL(current_color);
executed (the execution status of this line is deduced): current_color = PREMUL(current_color);
-
4301 for (int i = 0; i < size; ++i)
evaluated: i < size
TRUEFALSE
yes
Evaluation Count:1024
yes
Evaluation Count:1
1-1024
4302 colorTable[i] = current_color;
executed: colorTable[i] = current_color;
Execution Count:1024
1024
4303 return;
executed: return;
Execution Count:1
1
4304 } -
4305 -
4306 // The position where the gradient begins and ends -
4307 qreal begin_pos = stops[0].first;
executed (the execution status of this line is deduced): qreal begin_pos = stops[0].first;
-
4308 qreal end_pos = stops[stopCount-1].first;
executed (the execution status of this line is deduced): qreal end_pos = stops[stopCount-1].first;
-
4309 -
4310 int pos = 0; // The position in the color table.
executed (the execution status of this line is deduced): int pos = 0;
-
4311 uint next_color;
executed (the execution status of this line is deduced): uint next_color;
-
4312 -
4313 qreal incr = 1 / qreal(size); // the double increment.
executed (the execution status of this line is deduced): qreal incr = 1 / qreal(size);
-
4314 qreal dpos = 1.5 * incr; // current position in gradient stop list (0 to 1)
executed (the execution status of this line is deduced): qreal dpos = 1.5 * incr;
-
4315 -
4316 // Up to first point -
4317 colorTable[pos++] = PREMUL(current_color);
executed (the execution status of this line is deduced): colorTable[pos++] = PREMUL(current_color);
-
4318 while (dpos <= begin_pos) {
partially evaluated: dpos <= begin_pos
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
4319 colorTable[pos] = colorTable[pos - 1];
never executed (the execution status of this line is deduced): colorTable[pos] = colorTable[pos - 1];
-
4320 ++pos;
never executed (the execution status of this line is deduced): ++pos;
-
4321 dpos += incr;
never executed (the execution status of this line is deduced): dpos += incr;
-
4322 }
never executed: }
0
4323 -
4324 int current_stop = 0; // We always interpolate between current and current + 1.
executed (the execution status of this line is deduced): int current_stop = 0;
-
4325 -
4326 qreal t; // position between current left and right stops
executed (the execution status of this line is deduced): qreal t;
-
4327 qreal t_delta; // the t increment per entry in the color table
executed (the execution status of this line is deduced): qreal t_delta;
-
4328 -
4329 if (dpos < end_pos) {
partially evaluated: dpos < end_pos
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
0-10
4330 // Gradient area -
4331 while (dpos > stops[current_stop+1].first)
partially evaluated: dpos > stops[current_stop+1].first
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
4332 ++current_stop;
never executed: ++current_stop;
0
4333 -
4334 if (current_stop != 0)
partially evaluated: current_stop != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
4335 current_color = ARGB_COMBINE_ALPHA(stops[current_stop].second.rgba(), opacity);
never executed: current_color = ((((stops[current_stop].second.rgba() >> 24) * opacity) >> 8) << 24) | (stops[current_stop].second.rgba() & 0x00ffffff);
0
4336 next_color = ARGB_COMBINE_ALPHA(stops[current_stop+1].second.rgba(), opacity);
executed (the execution status of this line is deduced): next_color = ((((stops[current_stop+1].second.rgba() >> 24) * opacity) >> 8) << 24) | (stops[current_stop+1].second.rgba() & 0x00ffffff);
-
4337 -
4338 if (colorInterpolation) {
partially evaluated: colorInterpolation
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
0-10
4339 current_color = PREMUL(current_color);
executed (the execution status of this line is deduced): current_color = PREMUL(current_color);
-
4340 next_color = PREMUL(next_color);
executed (the execution status of this line is deduced): next_color = PREMUL(next_color);
-
4341 }
executed: }
Execution Count:10
10
4342 -
4343 qreal diff = stops[current_stop+1].first - stops[current_stop].first;
executed (the execution status of this line is deduced): qreal diff = stops[current_stop+1].first - stops[current_stop].first;
-
4344 qreal c = (diff == 0) ? qreal(0) : 256 / diff;
partially evaluated: (diff == 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
4345 t = (dpos - stops[current_stop].first) * c;
executed (the execution status of this line is deduced): t = (dpos - stops[current_stop].first) * c;
-
4346 t_delta = incr * c;
executed (the execution status of this line is deduced): t_delta = incr * c;
-
4347 -
4348 while (true) {
partially evaluated: true
TRUEFALSE
yes
Evaluation Count:10230
no
Evaluation Count:0
0-10230
4349 Q_ASSERT(current_stop < stopCount);
executed (the execution status of this line is deduced): qt_noop();
-
4350 -
4351 int dist = qRound(t);
executed (the execution status of this line is deduced): int dist = qRound(t);
-
4352 int idist = 256 - dist;
executed (the execution status of this line is deduced): int idist = 256 - dist;
-
4353 -
4354 if (colorInterpolation)
partially evaluated: colorInterpolation
TRUEFALSE
yes
Evaluation Count:10230
no
Evaluation Count:0
0-10230
4355 colorTable[pos] = INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist);
executed: colorTable[pos] = INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist);
Execution Count:10230
10230
4356 else -
4357 colorTable[pos] = PREMUL(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist));
never executed: colorTable[pos] = PREMUL(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist));
0
4358 -
4359 ++pos;
executed (the execution status of this line is deduced): ++pos;
-
4360 dpos += incr;
executed (the execution status of this line is deduced): dpos += incr;
-
4361 -
4362 if (dpos >= end_pos)
evaluated: dpos >= end_pos
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:10220
10-10220
4363 break;
executed: break;
Execution Count:10
10
4364 -
4365 t += t_delta;
executed (the execution status of this line is deduced): t += t_delta;
-
4366 -
4367 int skip = 0;
executed (the execution status of this line is deduced): int skip = 0;
-
4368 while (dpos > stops[current_stop+skip+1].first)
evaluated: dpos > stops[current_stop+skip+1].first
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:10220
18-10220
4369 ++skip;
executed: ++skip;
Execution Count:18
18
4370 -
4371 if (skip != 0) {
evaluated: skip != 0
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:10202
18-10202
4372 current_stop += skip;
executed (the execution status of this line is deduced): current_stop += skip;
-
4373 if (skip == 1)
partially evaluated: skip == 1
TRUEFALSE
yes
Evaluation Count:18
no
Evaluation Count:0
0-18
4374 current_color = next_color;
executed: current_color = next_color;
Execution Count:18
18
4375 else -
4376 current_color = ARGB_COMBINE_ALPHA(stops[current_stop].second.rgba(), opacity);
never executed: current_color = ((((stops[current_stop].second.rgba() >> 24) * opacity) >> 8) << 24) | (stops[current_stop].second.rgba() & 0x00ffffff);
0
4377 next_color = ARGB_COMBINE_ALPHA(stops[current_stop+1].second.rgba(), opacity);
executed (the execution status of this line is deduced): next_color = ((((stops[current_stop+1].second.rgba() >> 24) * opacity) >> 8) << 24) | (stops[current_stop+1].second.rgba() & 0x00ffffff);
-
4378 -
4379 if (colorInterpolation) {
partially evaluated: colorInterpolation
TRUEFALSE
yes
Evaluation Count:18
no
Evaluation Count:0
0-18
4380 if (skip != 1)
partially evaluated: skip != 1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:18
0-18
4381 current_color = PREMUL(current_color);
never executed: current_color = PREMUL(current_color);
0
4382 next_color = PREMUL(next_color);
executed (the execution status of this line is deduced): next_color = PREMUL(next_color);
-
4383 }
executed: }
Execution Count:18
18
4384 -
4385 qreal diff = stops[current_stop+1].first - stops[current_stop].first;
executed (the execution status of this line is deduced): qreal diff = stops[current_stop+1].first - stops[current_stop].first;
-
4386 qreal c = (diff == 0) ? qreal(0) : 256 / diff;
partially evaluated: (diff == 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:18
0-18
4387 t = (dpos - stops[current_stop].first) * c;
executed (the execution status of this line is deduced): t = (dpos - stops[current_stop].first) * c;
-
4388 t_delta = incr * c;
executed (the execution status of this line is deduced): t_delta = incr * c;
-
4389 }
executed: }
Execution Count:18
18
4390 }
executed: }
Execution Count:10220
10220
4391 }
executed: }
Execution Count:10
10
4392 -
4393 // After last point -
4394 current_color = PREMUL(ARGB_COMBINE_ALPHA(stops[stopCount - 1].second.rgba(), opacity));
executed (the execution status of this line is deduced): current_color = PREMUL(((((stops[stopCount - 1].second.rgba() >> 24) * opacity) >> 8) << 24) | (stops[stopCount - 1].second.rgba() & 0x00ffffff));
-
4395 while (pos < size - 1) {
partially evaluated: pos < size - 1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
4396 colorTable[pos] = current_color;
never executed (the execution status of this line is deduced): colorTable[pos] = current_color;
-
4397 ++pos;
never executed (the execution status of this line is deduced): ++pos;
-
4398 }
never executed: }
0
4399 -
4400 // Make sure the last color stop is represented at the end of the table -
4401 colorTable[size - 1] = current_color;
executed (the execution status of this line is deduced): colorTable[size - 1] = current_color;
-
4402}
executed: }
Execution Count:10
10
4403 -
4404Q_GLOBAL_STATIC(QGradientCache, qt_gradient_cache)
never executed: delete x;
executed: return thisGlobalStatic.pointer.load();
Execution Count:17206
partially evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
evaluated: !thisGlobalStatic.pointer.load()
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:17200
partially evaluated: !thisGlobalStatic.destroyed
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-17206
4405 -
4406 -
4407void QSpanData::init(QRasterBuffer *rb, const QRasterPaintEngine *pe) -
4408{ -
4409 rasterBuffer = rb;
executed (the execution status of this line is deduced): rasterBuffer = rb;
-
4410 type = None;
executed (the execution status of this line is deduced): type = None;
-
4411 txop = 0;
executed (the execution status of this line is deduced): txop = 0;
-
4412 bilinear = false;
executed (the execution status of this line is deduced): bilinear = false;
-
4413 m11 = m22 = m33 = 1.;
executed (the execution status of this line is deduced): m11 = m22 = m33 = 1.;
-
4414 m12 = m13 = m21 = m23 = dx = dy = 0.0;
executed (the execution status of this line is deduced): m12 = m13 = m21 = m23 = dx = dy = 0.0;
-
4415 clip = pe ? pe->d_func()->clip() : 0;
partially evaluated: pe
TRUEFALSE
yes
Evaluation Count:74317
no
Evaluation Count:0
0-74317
4416}
executed: }
Execution Count:74317
74317
4417 -
4418Q_GUI_EXPORT extern QImage qt_imageForBrush(int brushStyle, bool invert); -
4419 -
4420void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode compositionMode) -
4421{ -
4422 Qt::BrushStyle brushStyle = qbrush_style(brush);
executed (the execution status of this line is deduced): Qt::BrushStyle brushStyle = qbrush_style(brush);
-
4423 switch (brushStyle) { -
4424 case Qt::SolidPattern: { -
4425 type = Solid;
executed (the execution status of this line is deduced): type = Solid;
-
4426 QColor c = qbrush_color(brush);
executed (the execution status of this line is deduced): QColor c = qbrush_color(brush);
-
4427 QRgb rgba = c.rgba();
executed (the execution status of this line is deduced): QRgb rgba = c.rgba();
-
4428 solid.color = PREMUL(ARGB_COMBINE_ALPHA(rgba, alpha));
executed (the execution status of this line is deduced): solid.color = PREMUL(((((rgba >> 24) * alpha) >> 8) << 24) | (rgba & 0x00ffffff));
-
4429 if ((solid.color & 0xff000000) == 0
evaluated: (solid.color & 0xff000000) == 0
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:289297
17-289297
4430 && compositionMode == QPainter::CompositionMode_SourceOver) {
partially evaluated: compositionMode == QPainter::CompositionMode_SourceOver
TRUEFALSE
yes
Evaluation Count:17
no
Evaluation Count:0
0-17
4431 type = None;
executed (the execution status of this line is deduced): type = None;
-
4432 }
executed: }
Execution Count:17
17
4433 break;
executed: break;
Execution Count:289314
289314
4434 } -
4435 -
4436 case Qt::LinearGradientPattern: -
4437 { -
4438 type = LinearGradient;
executed (the execution status of this line is deduced): type = LinearGradient;
-
4439 const QLinearGradient *g = static_cast<const QLinearGradient *>(brush.gradient());
executed (the execution status of this line is deduced): const QLinearGradient *g = static_cast<const QLinearGradient *>(brush.gradient());
-
4440 gradient.alphaColor = !brush.isOpaque() || alpha != 256;
evaluated: !brush.isOpaque()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:16702
partially evaluated: alpha != 256
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16702
0-16702
4441 gradient.colorTable = const_cast<uint*>(qt_gradient_cache()->getBuffer(*g, alpha));
executed (the execution status of this line is deduced): gradient.colorTable = const_cast<uint*>(qt_gradient_cache()->getBuffer(*g, alpha));
-
4442 gradient.spread = g->spread();
executed (the execution status of this line is deduced): gradient.spread = g->spread();
-
4443 -
4444 QLinearGradientData &linearData = gradient.linear;
executed (the execution status of this line is deduced): QLinearGradientData &linearData = gradient.linear;
-
4445 -
4446 linearData.origin.x = g->start().x();
executed (the execution status of this line is deduced): linearData.origin.x = g->start().x();
-
4447 linearData.origin.y = g->start().y();
executed (the execution status of this line is deduced): linearData.origin.y = g->start().y();
-
4448 linearData.end.x = g->finalStop().x();
executed (the execution status of this line is deduced): linearData.end.x = g->finalStop().x();
-
4449 linearData.end.y = g->finalStop().y();
executed (the execution status of this line is deduced): linearData.end.y = g->finalStop().y();
-
4450 break;
executed: break;
Execution Count:16707
16707
4451 } -
4452 -
4453 case Qt::RadialGradientPattern: -
4454 { -
4455 type = RadialGradient;
executed (the execution status of this line is deduced): type = RadialGradient;
-
4456 const QRadialGradient *g = static_cast<const QRadialGradient *>(brush.gradient());
executed (the execution status of this line is deduced): const QRadialGradient *g = static_cast<const QRadialGradient *>(brush.gradient());
-
4457 gradient.alphaColor = !brush.isOpaque() || alpha != 256;
evaluated: !brush.isOpaque()
TRUEFALSE
yes
Evaluation Count:502
yes
Evaluation Count:4
partially evaluated: alpha != 256
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-502
4458 gradient.colorTable = const_cast<uint*>(qt_gradient_cache()->getBuffer(*g, alpha));
executed (the execution status of this line is deduced): gradient.colorTable = const_cast<uint*>(qt_gradient_cache()->getBuffer(*g, alpha));
-
4459 gradient.spread = g->spread();
executed (the execution status of this line is deduced): gradient.spread = g->spread();
-
4460 -
4461 QRadialGradientData &radialData = gradient.radial;
executed (the execution status of this line is deduced): QRadialGradientData &radialData = gradient.radial;
-
4462 -
4463 QPointF center = g->center();
executed (the execution status of this line is deduced): QPointF center = g->center();
-
4464 radialData.center.x = center.x();
executed (the execution status of this line is deduced): radialData.center.x = center.x();
-
4465 radialData.center.y = center.y();
executed (the execution status of this line is deduced): radialData.center.y = center.y();
-
4466 radialData.center.radius = g->centerRadius();
executed (the execution status of this line is deduced): radialData.center.radius = g->centerRadius();
-
4467 QPointF focal = g->focalPoint();
executed (the execution status of this line is deduced): QPointF focal = g->focalPoint();
-
4468 radialData.focal.x = focal.x();
executed (the execution status of this line is deduced): radialData.focal.x = focal.x();
-
4469 radialData.focal.y = focal.y();
executed (the execution status of this line is deduced): radialData.focal.y = focal.y();
-
4470 radialData.focal.radius = g->focalRadius();
executed (the execution status of this line is deduced): radialData.focal.radius = g->focalRadius();
-
4471 } -
4472 break;
executed: break;
Execution Count:506
506
4473 -
4474 case Qt::ConicalGradientPattern: -
4475 { -
4476 type = ConicalGradient;
never executed (the execution status of this line is deduced): type = ConicalGradient;
-
4477 const QConicalGradient *g = static_cast<const QConicalGradient *>(brush.gradient());
never executed (the execution status of this line is deduced): const QConicalGradient *g = static_cast<const QConicalGradient *>(brush.gradient());
-
4478 gradient.alphaColor = !brush.isOpaque() || alpha != 256;
never evaluated: !brush.isOpaque()
never evaluated: alpha != 256
0
4479 gradient.colorTable = const_cast<uint*>(qt_gradient_cache()->getBuffer(*g, alpha));
never executed (the execution status of this line is deduced): gradient.colorTable = const_cast<uint*>(qt_gradient_cache()->getBuffer(*g, alpha));
-
4480 gradient.spread = QGradient::RepeatSpread;
never executed (the execution status of this line is deduced): gradient.spread = QGradient::RepeatSpread;
-
4481 -
4482 QConicalGradientData &conicalData = gradient.conical;
never executed (the execution status of this line is deduced): QConicalGradientData &conicalData = gradient.conical;
-
4483 -
4484 QPointF center = g->center();
never executed (the execution status of this line is deduced): QPointF center = g->center();
-
4485 conicalData.center.x = center.x();
never executed (the execution status of this line is deduced): conicalData.center.x = center.x();
-
4486 conicalData.center.y = center.y();
never executed (the execution status of this line is deduced): conicalData.center.y = center.y();
-
4487 conicalData.angle = g->angle() * 2 * Q_PI / 360.0;
never executed (the execution status of this line is deduced): conicalData.angle = g->angle() * 2 * Q_PI / 360.0;
-
4488 } -
4489 break;
never executed: break;
0
4490 -
4491 case Qt::Dense1Pattern: -
4492 case Qt::Dense2Pattern: -
4493 case Qt::Dense3Pattern: -
4494 case Qt::Dense4Pattern: -
4495 case Qt::Dense5Pattern: -
4496 case Qt::Dense6Pattern: -
4497 case Qt::Dense7Pattern: -
4498 case Qt::HorPattern: -
4499 case Qt::VerPattern: -
4500 case Qt::CrossPattern: -
4501 case Qt::BDiagPattern: -
4502 case Qt::FDiagPattern: -
4503 case Qt::DiagCrossPattern: -
4504 type = Texture;
executed (the execution status of this line is deduced): type = Texture;
-
4505 if (!tempImage)
evaluated: !tempImage
TRUEFALSE
yes
Evaluation Count:5138
yes
Evaluation Count:4416
4416-5138
4506 tempImage = new QImage();
executed: tempImage = new QImage();
Execution Count:5138
5138
4507 *tempImage = rasterBuffer->colorizeBitmap(qt_imageForBrush(brushStyle, true), brush.color());
executed (the execution status of this line is deduced): *tempImage = rasterBuffer->colorizeBitmap(qt_imageForBrush(brushStyle, true), brush.color());
-
4508 initTexture(tempImage, alpha, QTextureData::Tiled);
executed (the execution status of this line is deduced): initTexture(tempImage, alpha, QTextureData::Tiled);
-
4509 break;
executed: break;
Execution Count:9554
9554
4510 case Qt::TexturePattern: -
4511 type = Texture;
executed (the execution status of this line is deduced): type = Texture;
-
4512 if (!tempImage)
partially evaluated: !tempImage
TRUEFALSE
yes
Evaluation Count:195
no
Evaluation Count:0
0-195
4513 tempImage = new QImage();
executed: tempImage = new QImage();
Execution Count:195
195
4514 -
4515 if (qHasPixmapTexture(brush) && brush.texture().isQBitmap())
evaluated: qHasPixmapTexture(brush)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:194
partially evaluated: brush.texture().isQBitmap()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-194
4516 *tempImage = rasterBuffer->colorizeBitmap(brush.textureImage(), brush.color());
never executed: *tempImage = rasterBuffer->colorizeBitmap(brush.textureImage(), brush.color());
0
4517 else -
4518 *tempImage = brush.textureImage();
executed: *tempImage = brush.textureImage();
Execution Count:195
195
4519 initTexture(tempImage, alpha, QTextureData::Tiled, tempImage->rect());
executed (the execution status of this line is deduced): initTexture(tempImage, alpha, QTextureData::Tiled, tempImage->rect());
-
4520 break;
executed: break;
Execution Count:195
195
4521 -
4522 case Qt::NoBrush: -
4523 default: -
4524 type = None;
executed (the execution status of this line is deduced): type = None;
-
4525 break;
executed: break;
Execution Count:32025
32025
4526 } -
4527 adjustSpanMethods();
executed (the execution status of this line is deduced): adjustSpanMethods();
-
4528}
executed: }
Execution Count:348299
348299
4529 -
4530void QSpanData::adjustSpanMethods() -
4531{ -
4532 bitmapBlit = 0;
executed (the execution status of this line is deduced): bitmapBlit = 0;
-
4533 alphamapBlit = 0;
executed (the execution status of this line is deduced): alphamapBlit = 0;
-
4534 alphaRGBBlit = 0;
executed (the execution status of this line is deduced): alphaRGBBlit = 0;
-
4535 -
4536 fillRect = 0;
executed (the execution status of this line is deduced): fillRect = 0;
-
4537 -
4538 switch(type) { -
4539 case None: -
4540 unclipped_blend = 0;
executed (the execution status of this line is deduced): unclipped_blend = 0;
-
4541 break;
executed: break;
Execution Count:32042
32042
4542 case Solid: -
4543 unclipped_blend = rasterBuffer->drawHelper->blendColor;
executed (the execution status of this line is deduced): unclipped_blend = rasterBuffer->drawHelper->blendColor;
-
4544 bitmapBlit = rasterBuffer->drawHelper->bitmapBlit;
executed (the execution status of this line is deduced): bitmapBlit = rasterBuffer->drawHelper->bitmapBlit;
-
4545 alphamapBlit = rasterBuffer->drawHelper->alphamapBlit;
executed (the execution status of this line is deduced): alphamapBlit = rasterBuffer->drawHelper->alphamapBlit;
-
4546 alphaRGBBlit = rasterBuffer->drawHelper->alphaRGBBlit;
executed (the execution status of this line is deduced): alphaRGBBlit = rasterBuffer->drawHelper->alphaRGBBlit;
-
4547 fillRect = rasterBuffer->drawHelper->fillRect;
executed (the execution status of this line is deduced): fillRect = rasterBuffer->drawHelper->fillRect;
-
4548 break;
executed: break;
Execution Count:317373
317373
4549 case LinearGradient: -
4550 case RadialGradient: -
4551 case ConicalGradient: -
4552 unclipped_blend = rasterBuffer->drawHelper->blendGradient;
executed (the execution status of this line is deduced): unclipped_blend = rasterBuffer->drawHelper->blendGradient;
-
4553 break;
executed: break;
Execution Count:34406
34406
4554 case Texture: -
4555 unclipped_blend = qBlendTexture;
executed (the execution status of this line is deduced): unclipped_blend = qBlendTexture;
-
4556 if (!texture.imageData)
partially evaluated: !texture.imageData
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:30557
0-30557
4557 unclipped_blend = 0;
never executed: unclipped_blend = 0;
0
4558 -
4559 break;
executed: break;
Execution Count:30557
30557
4560 } -
4561 // setup clipping -
4562 if (!unclipped_blend) {
evaluated: !unclipped_blend
TRUEFALSE
yes
Evaluation Count:32042
yes
Evaluation Count:382338
32042-382338
4563 blend = 0;
executed (the execution status of this line is deduced): blend = 0;
-
4564 } else if (!clip) {
executed: }
Execution Count:32042
partially evaluated: !clip
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:382339
0-382339
4565 blend = unclipped_blend;
never executed (the execution status of this line is deduced): blend = unclipped_blend;
-
4566 } else if (clip->hasRectClip) {
never executed: }
evaluated: clip->hasRectClip
TRUEFALSE
yes
Evaluation Count:362063
yes
Evaluation Count:20277
0-362063
4567 blend = clip->clipRect.isEmpty() ? 0 : qt_span_fill_clipRect;
evaluated: clip->clipRect.isEmpty()
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:362055
9-362055
4568 } else {
executed: }
Execution Count:362053
362053
4569 blend = qt_span_fill_clipped;
executed (the execution status of this line is deduced): blend = qt_span_fill_clipped;
-
4570 }
executed: }
Execution Count:20277
20277
4571} -
4572 -
4573void QSpanData::setupMatrix(const QTransform &matrix, int bilin) -
4574{ -
4575 QTransform delta;
executed (the execution status of this line is deduced): QTransform delta;
-
4576 // make sure we round off correctly in qdrawhelper.cpp -
4577 delta.translate(1.0 / 65536, 1.0 / 65536);
executed (the execution status of this line is deduced): delta.translate(1.0 / 65536, 1.0 / 65536);
-
4578 -
4579 QTransform inv = (delta * matrix).inverted();
executed (the execution status of this line is deduced): QTransform inv = (delta * matrix).inverted();
-
4580 m11 = inv.m11();
executed (the execution status of this line is deduced): m11 = inv.m11();
-
4581 m12 = inv.m12();
executed (the execution status of this line is deduced): m12 = inv.m12();
-
4582 m13 = inv.m13();
executed (the execution status of this line is deduced): m13 = inv.m13();
-
4583 m21 = inv.m21();
executed (the execution status of this line is deduced): m21 = inv.m21();
-
4584 m22 = inv.m22();
executed (the execution status of this line is deduced): m22 = inv.m22();
-
4585 m23 = inv.m23();
executed (the execution status of this line is deduced): m23 = inv.m23();
-
4586 m33 = inv.m33();
executed (the execution status of this line is deduced): m33 = inv.m33();
-
4587 dx = inv.dx();
executed (the execution status of this line is deduced): dx = inv.dx();
-
4588 dy = inv.dy();
executed (the execution status of this line is deduced): dy = inv.dy();
-
4589 txop = inv.type();
executed (the execution status of this line is deduced): txop = inv.type();
-
4590 bilinear = bilin;
executed (the execution status of this line is deduced): bilinear = bilin;
-
4591 -
4592 const bool affine = inv.isAffine();
executed (the execution status of this line is deduced): const bool affine = inv.isAffine();
-
4593 fast_matrix = affine
evaluated: affine
TRUEFALSE
yes
Evaluation Count:27
yes
Evaluation Count:4
4-27
4594 && m11 * m11 + m21 * m21 < 1e4
evaluated: m11 * m11 + m21 * m21 < 1e4
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:2
2-25
4595 && m12 * m12 + m22 * m22 < 1e4
partially evaluated: m12 * m12 + m22 * m22 < 1e4
TRUEFALSE
yes
Evaluation Count:25
no
Evaluation Count:0
0-25
4596 && qAbs(dx) < 1e4
evaluated: qAbs(dx) < 1e4
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:2
2-23
4597 && qAbs(dy) < 1e4;
partially evaluated: qAbs(dy) < 1e4
TRUEFALSE
yes
Evaluation Count:23
no
Evaluation Count:0
0-23
4598 -
4599 adjustSpanMethods();
executed (the execution status of this line is deduced): adjustSpanMethods();
-
4600}
executed: }
Execution Count:31
31
4601 -
4602void QSpanData::initTexture(const QImage *image, int alpha, QTextureData::Type _type, const QRect &sourceRect) -
4603{ -
4604 const QImageData *d = const_cast<QImage *>(image)->data_ptr();
executed (the execution status of this line is deduced): const QImageData *d = const_cast<QImage *>(image)->data_ptr();
-
4605 if (!d || d->height == 0) {
partially evaluated: !d
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:11035
partially evaluated: d->height == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:11035
0-11035
4606 texture.imageData = 0;
never executed (the execution status of this line is deduced): texture.imageData = 0;
-
4607 texture.width = 0;
never executed (the execution status of this line is deduced): texture.width = 0;
-
4608 texture.height = 0;
never executed (the execution status of this line is deduced): texture.height = 0;
-
4609 texture.x1 = 0;
never executed (the execution status of this line is deduced): texture.x1 = 0;
-
4610 texture.y1 = 0;
never executed (the execution status of this line is deduced): texture.y1 = 0;
-
4611 texture.x2 = 0;
never executed (the execution status of this line is deduced): texture.x2 = 0;
-
4612 texture.y2 = 0;
never executed (the execution status of this line is deduced): texture.y2 = 0;
-
4613 texture.bytesPerLine = 0;
never executed (the execution status of this line is deduced): texture.bytesPerLine = 0;
-
4614 texture.format = QImage::Format_Invalid;
never executed (the execution status of this line is deduced): texture.format = QImage::Format_Invalid;
-
4615 texture.colorTable = 0;
never executed (the execution status of this line is deduced): texture.colorTable = 0;
-
4616 texture.hasAlpha = alpha != 256;
never executed (the execution status of this line is deduced): texture.hasAlpha = alpha != 256;
-
4617 } else {
never executed: }
0
4618 texture.imageData = d->data;
executed (the execution status of this line is deduced): texture.imageData = d->data;
-
4619 texture.width = d->width;
executed (the execution status of this line is deduced): texture.width = d->width;
-
4620 texture.height = d->height;
executed (the execution status of this line is deduced): texture.height = d->height;
-
4621 -
4622 if (sourceRect.isNull()) {
evaluated: sourceRect.isNull()
TRUEFALSE
yes
Evaluation Count:9563
yes
Evaluation Count:1472
1472-9563
4623 texture.x1 = 0;
executed (the execution status of this line is deduced): texture.x1 = 0;
-
4624 texture.y1 = 0;
executed (the execution status of this line is deduced): texture.y1 = 0;
-
4625 texture.x2 = texture.width;
executed (the execution status of this line is deduced): texture.x2 = texture.width;
-
4626 texture.y2 = texture.height;
executed (the execution status of this line is deduced): texture.y2 = texture.height;
-
4627 } else {
executed: }
Execution Count:9563
9563
4628 texture.x1 = sourceRect.x();
executed (the execution status of this line is deduced): texture.x1 = sourceRect.x();
-
4629 texture.y1 = sourceRect.y();
executed (the execution status of this line is deduced): texture.y1 = sourceRect.y();
-
4630 texture.x2 = qMin(texture.x1 + sourceRect.width(), d->width);
executed (the execution status of this line is deduced): texture.x2 = qMin(texture.x1 + sourceRect.width(), d->width);
-
4631 texture.y2 = qMin(texture.y1 + sourceRect.height(), d->height);
executed (the execution status of this line is deduced): texture.y2 = qMin(texture.y1 + sourceRect.height(), d->height);
-
4632 }
executed: }
Execution Count:1472
1472
4633 -
4634 texture.bytesPerLine = d->bytes_per_line;
executed (the execution status of this line is deduced): texture.bytesPerLine = d->bytes_per_line;
-
4635 -
4636 texture.format = d->format;
executed (the execution status of this line is deduced): texture.format = d->format;
-
4637 texture.colorTable = (d->format <= QImage::Format_Indexed8 && !d->colortable.isEmpty()) ? &d->colortable : 0;
evaluated: d->format <= QImage::Format_Indexed8
TRUEFALSE
yes
Evaluation Count:181
yes
Evaluation Count:10854
partially evaluated: !d->colortable.isEmpty()
TRUEFALSE
yes
Evaluation Count:181
no
Evaluation Count:0
0-10854
4638 texture.hasAlpha = image->hasAlphaChannel() || alpha != 256;
evaluated: image->hasAlphaChannel()
TRUEFALSE
yes
Evaluation Count:10242
yes
Evaluation Count:793
evaluated: alpha != 256
TRUEFALSE
yes
Evaluation Count:248
yes
Evaluation Count:545
248-10242
4639 }
executed: }
Execution Count:11035
11035
4640 texture.const_alpha = alpha;
executed (the execution status of this line is deduced): texture.const_alpha = alpha;
-
4641 texture.type = _type;
executed (the execution status of this line is deduced): texture.type = _type;
-
4642 -
4643 adjustSpanMethods();
executed (the execution status of this line is deduced): adjustSpanMethods();
-
4644}
executed: }
Execution Count:11035
11035
4645 -
4646/*! -
4647 \internal -
4648 \a x and \a y is relative to the midpoint of \a rect. -
4649*/ -
4650static inline void drawEllipsePoints(int x, int y, int length, -
4651 const QRect &rect, -
4652 const QRect &clip, -
4653 ProcessSpans pen_func, ProcessSpans brush_func, -
4654 QSpanData *pen_data, QSpanData *brush_data) -
4655{ -
4656 if (length == 0)
partially evaluated: length == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:44167
0-44167
4657 return;
never executed: return;
0
4658 -
4659 QT_FT_Span outline[4];
executed (the execution status of this line is deduced): QT_FT_Span outline[4];
-
4660 const int midx = rect.x() + (rect.width() + 1) / 2;
executed (the execution status of this line is deduced): const int midx = rect.x() + (rect.width() + 1) / 2;
-
4661 const int midy = rect.y() + (rect.height() + 1) / 2;
executed (the execution status of this line is deduced): const int midy = rect.y() + (rect.height() + 1) / 2;
-
4662 -
4663 x = x + midx;
executed (the execution status of this line is deduced): x = x + midx;
-
4664 y = midy - y;
executed (the execution status of this line is deduced): y = midy - y;
-
4665 -
4666 // topleft -
4667 outline[0].x = midx + (midx - x) - (length - 1) - (rect.width() & 0x1);
executed (the execution status of this line is deduced): outline[0].x = midx + (midx - x) - (length - 1) - (rect.width() & 0x1);
-
4668 outline[0].len = qMin(length, x - outline[0].x);
executed (the execution status of this line is deduced): outline[0].len = qMin(length, x - outline[0].x);
-
4669 outline[0].y = y;
executed (the execution status of this line is deduced): outline[0].y = y;
-
4670 outline[0].coverage = 255;
executed (the execution status of this line is deduced): outline[0].coverage = 255;
-
4671 -
4672 // topright -
4673 outline[1].x = x;
executed (the execution status of this line is deduced): outline[1].x = x;
-
4674 outline[1].len = length;
executed (the execution status of this line is deduced): outline[1].len = length;
-
4675 outline[1].y = y;
executed (the execution status of this line is deduced): outline[1].y = y;
-
4676 outline[1].coverage = 255;
executed (the execution status of this line is deduced): outline[1].coverage = 255;
-
4677 -
4678 // bottomleft -
4679 outline[2].x = outline[0].x;
executed (the execution status of this line is deduced): outline[2].x = outline[0].x;
-
4680 outline[2].len = outline[0].len;
executed (the execution status of this line is deduced): outline[2].len = outline[0].len;
-
4681 outline[2].y = midy + (midy - y) - (rect.height() & 0x1);
executed (the execution status of this line is deduced): outline[2].y = midy + (midy - y) - (rect.height() & 0x1);
-
4682 outline[2].coverage = 255;
executed (the execution status of this line is deduced): outline[2].coverage = 255;
-
4683 -
4684 // bottomright -
4685 outline[3].x = x;
executed (the execution status of this line is deduced): outline[3].x = x;
-
4686 outline[3].len = length;
executed (the execution status of this line is deduced): outline[3].len = length;
-
4687 outline[3].y = outline[2].y;
executed (the execution status of this line is deduced): outline[3].y = outline[2].y;
-
4688 outline[3].coverage = 255;
executed (the execution status of this line is deduced): outline[3].coverage = 255;
-
4689 -
4690 if (brush_func && outline[0].x + outline[0].len < outline[1].x) {
evaluated: brush_func
TRUEFALSE
yes
Evaluation Count:13803
yes
Evaluation Count:30364
evaluated: outline[0].x + outline[0].len < outline[1].x
TRUEFALSE
yes
Evaluation Count:13482
yes
Evaluation Count:321
321-30364
4691 QT_FT_Span fill[2];
executed (the execution status of this line is deduced): QT_FT_Span fill[2];
-
4692 -
4693 // top fill -
4694 fill[0].x = outline[0].x + outline[0].len - 1;
executed (the execution status of this line is deduced): fill[0].x = outline[0].x + outline[0].len - 1;
-
4695 fill[0].len = qMax(0, outline[1].x - fill[0].x);
executed (the execution status of this line is deduced): fill[0].len = qMax(0, outline[1].x - fill[0].x);
-
4696 fill[0].y = outline[1].y;
executed (the execution status of this line is deduced): fill[0].y = outline[1].y;
-
4697 fill[0].coverage = 255;
executed (the execution status of this line is deduced): fill[0].coverage = 255;
-
4698 -
4699 // bottom fill -
4700 fill[1].x = outline[2].x + outline[2].len - 1;
executed (the execution status of this line is deduced): fill[1].x = outline[2].x + outline[2].len - 1;
-
4701 fill[1].len = qMax(0, outline[3].x - fill[1].x);
executed (the execution status of this line is deduced): fill[1].len = qMax(0, outline[3].x - fill[1].x);
-
4702 fill[1].y = outline[3].y;
executed (the execution status of this line is deduced): fill[1].y = outline[3].y;
-
4703 fill[1].coverage = 255;
executed (the execution status of this line is deduced): fill[1].coverage = 255;
-
4704 -
4705 int n = (fill[0].y >= fill[1].y ? 1 : 2);
evaluated: fill[0].y >= fill[1].y
TRUEFALSE
yes
Evaluation Count:222
yes
Evaluation Count:13260
222-13260
4706 n = qt_intersect_spans(fill, n, clip);
executed (the execution status of this line is deduced): n = qt_intersect_spans(fill, n, clip);
-
4707 if (n > 0)
evaluated: n > 0
TRUEFALSE
yes
Evaluation Count:9232
yes
Evaluation Count:4250
4250-9232
4708 brush_func(n, fill, brush_data);
executed: brush_func(n, fill, brush_data);
Execution Count:9232
9232
4709 }
executed: }
Execution Count:13482
13482
4710 if (pen_func) {
evaluated: pen_func
TRUEFALSE
yes
Evaluation Count:40648
yes
Evaluation Count:3519
3519-40648
4711 int n = (outline[1].y >= outline[2].y ? 2 : 4);
evaluated: outline[1].y >= outline[2].y
TRUEFALSE
yes
Evaluation Count:624
yes
Evaluation Count:40024
624-40024
4712 n = qt_intersect_spans(outline, n, clip);
executed (the execution status of this line is deduced): n = qt_intersect_spans(outline, n, clip);
-
4713 if (n > 0)
evaluated: n > 0
TRUEFALSE
yes
Evaluation Count:35673
yes
Evaluation Count:4975
4975-35673
4714 pen_func(n, outline, pen_data);
executed: pen_func(n, outline, pen_data);
Execution Count:35673
35673
4715 }
executed: }
Execution Count:40648
40648
4716}
executed: }
Execution Count:44167
44167
4717 -
4718/*! -
4719 \internal -
4720 Draws an ellipse using the integer point midpoint algorithm. -
4721*/ -
4722static void drawEllipse_midpoint_i(const QRect &rect, const QRect &clip, -
4723 ProcessSpans pen_func, ProcessSpans brush_func, -
4724 QSpanData *pen_data, QSpanData *brush_data) -
4725{ -
4726 const qreal a = qreal(rect.width()) / 2;
executed (the execution status of this line is deduced): const qreal a = qreal(rect.width()) / 2;
-
4727 const qreal b = qreal(rect.height()) / 2;
executed (the execution status of this line is deduced): const qreal b = qreal(rect.height()) / 2;
-
4728 qreal d = b*b - (a*a*b) + 0.25*a*a;
executed (the execution status of this line is deduced): qreal d = b*b - (a*a*b) + 0.25*a*a;
-
4729 -
4730 int x = 0;
executed (the execution status of this line is deduced): int x = 0;
-
4731 int y = (rect.height() + 1) / 2;
executed (the execution status of this line is deduced): int y = (rect.height() + 1) / 2;
-
4732 int startx = x;
executed (the execution status of this line is deduced): int startx = x;
-
4733 -
4734 // region 1 -
4735 while (a*a*(2*y - 1) > 2*b*b*(x + 1)) {
evaluated: a*a*(2*y - 1) > 2*b*b*(x + 1)
TRUEFALSE
yes
Evaluation Count:32525
yes
Evaluation Count:1155
1155-32525
4736 if (d < 0) { // select E
evaluated: d < 0
TRUEFALSE
yes
Evaluation Count:20026
yes
Evaluation Count:12499
12499-20026
4737 d += b*b*(2*x + 3);
executed (the execution status of this line is deduced): d += b*b*(2*x + 3);
-
4738 ++x;
executed (the execution status of this line is deduced): ++x;
-
4739 } else { // select SE
executed: }
Execution Count:20026
20026
4740 d += b*b*(2*x + 3) + a*a*(-2*y + 2);
executed (the execution status of this line is deduced): d += b*b*(2*x + 3) + a*a*(-2*y + 2);
-
4741 drawEllipsePoints(startx, y, x - startx + 1, rect, clip,
executed (the execution status of this line is deduced): drawEllipsePoints(startx, y, x - startx + 1, rect, clip,
-
4742 pen_func, brush_func, pen_data, brush_data);
executed (the execution status of this line is deduced): pen_func, brush_func, pen_data, brush_data);
-
4743 startx = ++x;
executed (the execution status of this line is deduced): startx = ++x;
-
4744 --y;
executed (the execution status of this line is deduced): --y;
-
4745 }
executed: }
Execution Count:12499
12499
4746 } -
4747 drawEllipsePoints(startx, y, x - startx + 1, rect, clip,
executed (the execution status of this line is deduced): drawEllipsePoints(startx, y, x - startx + 1, rect, clip,
-
4748 pen_func, brush_func, pen_data, brush_data);
executed (the execution status of this line is deduced): pen_func, brush_func, pen_data, brush_data);
-
4749 -
4750 // region 2 -
4751 d = b*b*(x + 0.5)*(x + 0.5) + a*a*((y - 1)*(y - 1) - b*b);
executed (the execution status of this line is deduced): d = b*b*(x + 0.5)*(x + 0.5) + a*a*((y - 1)*(y - 1) - b*b);
-
4752 const int miny = rect.height() & 0x1;
executed (the execution status of this line is deduced): const int miny = rect.height() & 0x1;
-
4753 while (y > miny) {
evaluated: y > miny
TRUEFALSE
yes
Evaluation Count:30513
yes
Evaluation Count:1155
1155-30513
4754 if (d < 0) { // select SE
evaluated: d < 0
TRUEFALSE
yes
Evaluation Count:12095
yes
Evaluation Count:18418
12095-18418
4755 d += b*b*(2*x + 2) + a*a*(-2*y + 3);
executed (the execution status of this line is deduced): d += b*b*(2*x + 2) + a*a*(-2*y + 3);
-
4756 ++x;
executed (the execution status of this line is deduced): ++x;
-
4757 } else { // select S
executed: }
Execution Count:12095
12095
4758 d += a*a*(-2*y + 3);
executed (the execution status of this line is deduced): d += a*a*(-2*y + 3);
-
4759 }
executed: }
Execution Count:18418
18418
4760 --y;
executed (the execution status of this line is deduced): --y;
-
4761 drawEllipsePoints(x, y, 1, rect, clip,
executed (the execution status of this line is deduced): drawEllipsePoints(x, y, 1, rect, clip,
-
4762 pen_func, brush_func, pen_data, brush_data);
executed (the execution status of this line is deduced): pen_func, brush_func, pen_data, brush_data);
-
4763 }
executed: }
Execution Count:30513
30513
4764}
executed: }
Execution Count:1155
1155
4765 -
4766/*! -
4767 \fn void QRasterPaintEngine::drawPoints(const QPoint *points, int pointCount) -
4768 \overload -
4769 \reimp -
4770*/ -
4771 -
4772 -
4773#ifdef QT_DEBUG_DRAW -
4774void dumpClip(int width, int height, const QClipData *clip) -
4775{ -
4776 QImage clipImg(width, height, QImage::Format_ARGB32_Premultiplied); -
4777 clipImg.fill(0xffff0000); -
4778 -
4779 int x0 = width; -
4780 int x1 = 0; -
4781 int y0 = height; -
4782 int y1 = 0; -
4783 -
4784 ((QClipData *) clip)->spans(); // Force allocation of the spans structure... -
4785 -
4786 for (int i = 0; i < clip->count; ++i) { -
4787 const QSpan *span = ((QClipData *) clip)->spans() + i; -
4788 for (int j = 0; j < span->len; ++j) -
4789 clipImg.setPixel(span->x + j, span->y, 0xffffff00); -
4790 x0 = qMin(x0, int(span->x)); -
4791 x1 = qMax(x1, int(span->x + span->len - 1)); -
4792 -
4793 y0 = qMin(y0, int(span->y)); -
4794 y1 = qMax(y1, int(span->y)); -
4795 } -
4796 -
4797 static int counter = 0; -
4798 -
4799 Q_ASSERT(y0 >= 0); -
4800 Q_ASSERT(x0 >= 0); -
4801 Q_ASSERT(y1 >= 0); -
4802 Q_ASSERT(x1 >= 0); -
4803 -
4804 fprintf(stderr,"clip %d: %d %d - %d %d\n", counter, x0, y0, x1, y1); -
4805 clipImg.save(QString::fromLatin1("clip-%0.png").arg(counter++)); -
4806} -
4807#endif -
4808 -
4809 -
4810QT_END_NAMESPACE -
4811 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial