Line | Source Code | Coverage |
---|
1 | /**************************************************************************** | - |
2 | ** | - |
3 | ** Copyright (C) 2012 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 | | - |
85 | QT_BEGIN_NAMESPACE | - |
86 | | - |
87 | class QRectVectorPath : public QVectorPath { | - |
88 | public: | - |
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:1528 | 1528 |
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:127 | 127 |
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 | } | 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 | } | 0 |
128 | inline QRectVectorPath() | - |
129 | : QVectorPath(pts, 4, 0, QVectorPath::RectangleHint | QVectorPath::ImplicitClose) | - |
130 | { } executed: } Execution Count:1655 | 1655 |
131 | | - |
132 | qreal pts[8]; | - |
133 | }; | - |
134 | | - |
135 | Q_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 | - |
143 | void 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 | | - |
154 | static const qreal aliasedCoordinateDelta = 0.5 - 0.015625; | - |
155 | | - |
156 | #ifdef Q_OS_WIN | - |
157 | | - |
158 | static 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 | */ | - |
172 | bool 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 | */ | - |
185 | static void qt_span_fill_clipRect(int count, const QSpan *spans, void *userData); | - |
186 | static void qt_span_fill_clipped(int count, const QSpan *spans, void *userData); | - |
187 | static void qt_span_clip(int count, const QSpan *spans, void *userData); | - |
188 | | - |
189 | struct ClipData | - |
190 | { | - |
191 | QClipData *oldClip; | - |
192 | QClipData *newClip; | - |
193 | Qt::ClipOperation operation; | - |
194 | }; | - |
195 | | - |
196 | enum LineDrawMode { | - |
197 | LineDrawClipped, | - |
198 | LineDrawNormal, | - |
199 | LineDrawIncludeLastPixel | - |
200 | }; | - |
201 | | - |
202 | static 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 | | - |
206 | struct QRasterFloatPoint { | - |
207 | qreal x; | - |
208 | qreal y; | - |
209 | }; | - |
210 | | - |
211 | #ifdef QT_DEBUG_DRAW | - |
212 | static 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 | | - |
233 | template <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:1533 | 1533 |
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:1533 | 1533 |
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:1533 | 1533 |
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:1533 | 1533 |
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:1533 | 1533 |
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:1533 | 1533 |
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:1533 | 1533 |
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:1533 | 1533 |
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:1533 | 1533 |
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:1533 | 1533 |
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:1533 | 1533 |
245 | } | - |
246 | | - |
247 | | - |
248 | static 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 | } | 0 |
252 | | - |
253 | static 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 | } | 0 |
257 | | - |
258 | static 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 | } | 0 |
267 | | - |
268 | | - |
269 | #if !defined(QT_NO_DEBUG) && 0 | - |
270 | static 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 | | - |
288 | QRasterPaintEnginePrivate::QRasterPaintEnginePrivate() : | - |
289 | QPaintEngineExPrivate(), | - |
290 | cachedLines(0) | - |
291 | { | - |
292 | } executed: } Execution Count:4685 | 4685 |
293 | | - |
294 | | - |
295 | /*! | - |
296 | \class QRasterPaintEngine | - |
297 | \preliminary | - |
298 | \ingroup qws | - |
299 | \since 4.2 | - |
300 | | - |
301 | \brief The QRasterPaintEngine class enables hardware acceleration | - |
302 | of painting operations in Qt for Embedded Linux. | - |
303 | | - |
304 | Note that this functionality is only available in | - |
305 | \l{Qt for Embedded Linux}. | - |
306 | | - |
307 | In \l{Qt for Embedded Linux}, painting is a pure software | - |
308 | implementation. But starting with Qt 4.2, it is | - |
309 | possible to add an accelerated graphics driver to take advantage | - |
310 | of available hardware resources. | - |
311 | | - |
312 | Hardware acceleration is accomplished by creating a custom screen | - |
313 | driver, accelerating the copying from memory to the screen, and | - |
314 | implementing a custom paint engine accelerating the various | - |
315 | painting operations. Then a custom paint device (derived from the | - |
316 | QCustomRasterPaintDevice class) and a custom window surface | - |
317 | (derived from QWSWindowSurface) must be implemented to make | - |
318 | \l{Qt for Embedded Linux} aware of the accelerated driver. | - |
319 | | - |
320 | \note The QRasterPaintEngine class does not support 8-bit images. | - |
321 | Instead, they need to be converted to a supported format, such as | - |
322 | QImage::Format_ARGB32_Premultiplied. | - |
323 | | - |
324 | See the \l {Adding an Accelerated Graphics Driver to Qt for Embedded Linux} | - |
325 | documentation for details. | - |
326 | | - |
327 | \sa QCustomRasterPaintDevice, QPaintEngine | - |
328 | */ | - |
329 | | - |
330 | /*! | - |
331 | \fn Type QRasterPaintEngine::type() const | - |
332 | \reimp | - |
333 | */ | - |
334 | | - |
335 | /*! | - |
336 | \typedef QSpan | - |
337 | \relates QRasterPaintEngine | - |
338 | | - |
339 | A struct equivalent to QT_FT_Span, containing a position (x, | - |
340 | y), the span's length in pixels and its color/coverage (a value | - |
341 | ranging from 0 to 255). | - |
342 | */ | - |
343 | | - |
344 | /*! | - |
345 | \since 4.5 | - |
346 | | - |
347 | Creates a raster based paint engine for operating on the given | - |
348 | \a device, with the complete set of \l | - |
349 | {QPaintEngine::PaintEngineFeature}{paint engine features and | - |
350 | capabilities}. | - |
351 | */ | - |
352 | QRasterPaintEngine::QRasterPaintEngine(QPaintDevice *device) | - |
353 | : QPaintEngineEx(*(new QRasterPaintEnginePrivate)) | - |
354 | { | - |
355 | d_func()->device = device; executed (the execution status of this line is deduced): d_func()->device = device; | - |
356 | init(); executed (the execution status of this line is deduced): init(); | - |
357 | } executed: } Execution Count:4685 | 4685 |
358 | | - |
359 | /*! | - |
360 | \internal | - |
361 | */ | - |
362 | QRasterPaintEngine::QRasterPaintEngine(QRasterPaintEnginePrivate &dd, QPaintDevice *device) | - |
363 | : QPaintEngineEx(dd) | - |
364 | { | - |
365 | d_func()->device = device; never executed (the execution status of this line is deduced): d_func()->device = device; | - |
366 | init(); never executed (the execution status of this line is deduced): init(); | - |
367 | } | 0 |
368 | | - |
369 | void QRasterPaintEngine::init() | - |
370 | { | - |
371 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
372 | | - |
373 | | - |
374 | #ifdef Q_OS_WIN | - |
375 | d->hdc = 0; | - |
376 | #endif | - |
377 | | - |
378 | // The antialiasing raster. | - |
379 | d->grayRaster.reset(new QT_FT_Raster); executed (the execution status of this line is deduced): d->grayRaster.reset(new QT_FT_Raster); | - |
380 | Q_CHECK_PTR(d->grayRaster.data()); executed (the execution status of this line is deduced): qt_noop(); | - |
381 | if (qt_ft_grays_raster.raster_new(d->grayRaster.data())) partially evaluated: qt_ft_grays_raster.raster_new(d->grayRaster.data()) no Evaluation Count:0 | yes Evaluation Count:4685 |
| 0-4685 |
382 | QT_THROW(std::bad_alloc()); // an error creating the raster is caused by a bad malloc never executed: qt_noop(); | 0 |
383 | | - |
384 | | - |
385 | d->rasterizer.reset(new QRasterizer); executed (the execution status of this line is deduced): d->rasterizer.reset(new QRasterizer); | - |
386 | d->rasterBuffer.reset(new QRasterBuffer()); executed (the execution status of this line is deduced): d->rasterBuffer.reset(new QRasterBuffer()); | - |
387 | d->outlineMapper.reset(new QOutlineMapper); executed (the execution status of this line is deduced): d->outlineMapper.reset(new QOutlineMapper); | - |
388 | d->outlinemapper_xform_dirty = true; executed (the execution status of this line is deduced): d->outlinemapper_xform_dirty = true; | - |
389 | | - |
390 | 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); | - |
391 | 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); | - |
392 | 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); | - |
393 | | - |
394 | 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())); | - |
395 | 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())); | - |
396 | | - |
397 | 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); | - |
398 | d->image_filler.type = QSpanData::Texture; executed (the execution status of this line is deduced): d->image_filler.type = QSpanData::Texture; | - |
399 | | - |
400 | 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); | - |
401 | d->image_filler_xform.type = QSpanData::Texture; executed (the execution status of this line is deduced): d->image_filler_xform.type = QSpanData::Texture; | - |
402 | | - |
403 | 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); | - |
404 | d->solid_color_filler.type = QSpanData::Solid; executed (the execution status of this line is deduced): d->solid_color_filler.type = QSpanData::Solid; | - |
405 | | - |
406 | d->deviceDepth = d->device->depth(); executed (the execution status of this line is deduced): d->deviceDepth = d->device->depth(); | - |
407 | | - |
408 | d->mono_surface = false; executed (the execution status of this line is deduced): d->mono_surface = false; | - |
409 | gccaps &= ~PorterDuff; executed (the execution status of this line is deduced): gccaps &= ~PorterDuff; | - |
410 | | - |
411 | QImage::Format format = QImage::Format_Invalid; executed (the execution status of this line is deduced): QImage::Format format = QImage::Format_Invalid; | - |
412 | | - |
413 | switch (d->device->devType()) { | - |
414 | case QInternal::Pixmap: | - |
415 | qWarning("QRasterPaintEngine: unsupported for pixmaps..."); never executed (the execution status of this line is deduced): QMessageLogger("painting/qpaintengine_raster.cpp", 415, __PRETTY_FUNCTION__).warning("QRasterPaintEngine: unsupported for pixmaps..."); | - |
416 | break; | 0 |
417 | case QInternal::Image: | - |
418 | 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)); | - |
419 | break; executed: break; Execution Count:4685 | 4685 |
420 | default: | - |
421 | 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", 421, __PRETTY_FUNCTION__).warning("QRasterPaintEngine: unsupported target device %d\n", d->device->devType()); | - |
422 | d->device = 0; never executed (the execution status of this line is deduced): d->device = 0; | - |
423 | return; | 0 |
424 | } | - |
425 | | - |
426 | switch (format) { | - |
427 | case QImage::Format_MonoLSB: | - |
428 | case QImage::Format_Mono: | - |
429 | d->mono_surface = true; executed (the execution status of this line is deduced): d->mono_surface = true; | - |
430 | break; executed: break; Execution Count:143 | 143 |
431 | case QImage::Format_ARGB8565_Premultiplied: | - |
432 | case QImage::Format_ARGB8555_Premultiplied: | - |
433 | case QImage::Format_ARGB6666_Premultiplied: | - |
434 | case QImage::Format_ARGB4444_Premultiplied: | - |
435 | case QImage::Format_ARGB32_Premultiplied: | - |
436 | case QImage::Format_ARGB32: | - |
437 | gccaps |= PorterDuff; executed (the execution status of this line is deduced): gccaps |= PorterDuff; | - |
438 | break; executed: break; Execution Count:2514 | 2514 |
439 | case QImage::Format_RGB32: | - |
440 | case QImage::Format_RGB444: | - |
441 | case QImage::Format_RGB555: | - |
442 | case QImage::Format_RGB666: | - |
443 | case QImage::Format_RGB888: | - |
444 | case QImage::Format_RGB16: | - |
445 | break; executed: break; Execution Count:2027 | 2027 |
446 | default: | - |
447 | break; executed: break; Execution Count:1 | 1 |
448 | } | - |
449 | } executed: } Execution Count:4685 | 4685 |
450 | | - |
451 | | - |
452 | | - |
453 | | - |
454 | /*! | - |
455 | Destroys this paint engine. | - |
456 | */ | - |
457 | QRasterPaintEngine::~QRasterPaintEngine() | - |
458 | { | - |
459 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
460 | | - |
461 | 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()); | - |
462 | } executed: } Execution Count:4648 | 4648 |
463 | | - |
464 | /*! | - |
465 | \reimp | - |
466 | */ | - |
467 | bool QRasterPaintEngine::begin(QPaintDevice *device) | - |
468 | { | - |
469 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
470 | | - |
471 | if (device->devType() == QInternal::Pixmap) { evaluated: device->devType() == QInternal::Pixmap yes Evaluation Count:799 | yes Evaluation Count:16163 |
| 799-16163 |
472 | QPixmap *pixmap = static_cast<QPixmap *>(device); executed (the execution status of this line is deduced): QPixmap *pixmap = static_cast<QPixmap *>(device); | - |
473 | QPlatformPixmap *pd = pixmap->handle(); executed (the execution status of this line is deduced): QPlatformPixmap *pd = pixmap->handle(); | - |
474 | if (pd->classId() == QPlatformPixmap::RasterClass || pd->classId() == QPlatformPixmap::BlitterClass) partially evaluated: pd->classId() == QPlatformPixmap::RasterClass yes Evaluation Count:799 | no Evaluation Count:0 |
never evaluated: pd->classId() == QPlatformPixmap::BlitterClass | 0-799 |
475 | d->device = pd->buffer(); executed: d->device = pd->buffer(); Execution Count:799 | 799 |
476 | } else { executed: } Execution Count:799 | 799 |
477 | d->device = device; executed (the execution status of this line is deduced): d->device = device; | - |
478 | } executed: } Execution Count:16163 | 16163 |
479 | | - |
480 | // Make sure QPaintEngine::paintDevice() returns the proper device. | - |
481 | d->pdev = d->device; executed (the execution status of this line is deduced): d->pdev = d->device; | - |
482 | | - |
483 | Q_ASSERT(d->device->devType() == QInternal::Image executed (the execution status of this line is deduced): qt_noop(); | - |
484 | || d->device->devType() == QInternal::CustomRaster); | - |
485 | | - |
486 | d->systemStateChanged(); executed (the execution status of this line is deduced): d->systemStateChanged(); | - |
487 | | - |
488 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
489 | ensureOutlineMapper(); executed (the execution status of this line is deduced): ensureOutlineMapper(); | - |
490 | d->outlineMapper->m_clip_rect = d->deviceRect; executed (the execution status of this line is deduced): d->outlineMapper->m_clip_rect = d->deviceRect; | - |
491 | | - |
492 | if (d->outlineMapper->m_clip_rect.width() > QT_RASTER_COORD_LIMIT) partially evaluated: d->outlineMapper->m_clip_rect.width() > QT_RASTER_COORD_LIMIT no Evaluation Count:0 | yes Evaluation Count:16962 |
| 0-16962 |
493 | d->outlineMapper->m_clip_rect.setWidth(QT_RASTER_COORD_LIMIT); never executed: d->outlineMapper->m_clip_rect.setWidth(QT_RASTER_COORD_LIMIT); | 0 |
494 | if (d->outlineMapper->m_clip_rect.height() > QT_RASTER_COORD_LIMIT) partially evaluated: d->outlineMapper->m_clip_rect.height() > QT_RASTER_COORD_LIMIT no Evaluation Count:0 | yes Evaluation Count:16962 |
| 0-16962 |
495 | d->outlineMapper->m_clip_rect.setHeight(QT_RASTER_COORD_LIMIT); never executed: d->outlineMapper->m_clip_rect.setHeight(QT_RASTER_COORD_LIMIT); | 0 |
496 | | - |
497 | d->rasterizer->setClipRect(d->deviceRect); executed (the execution status of this line is deduced): d->rasterizer->setClipRect(d->deviceRect); | - |
498 | | - |
499 | s->penData.init(d->rasterBuffer.data(), this); executed (the execution status of this line is deduced): s->penData.init(d->rasterBuffer.data(), this); | - |
500 | 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); | - |
501 | s->stroker = &d->basicStroker; executed (the execution status of this line is deduced): s->stroker = &d->basicStroker; | - |
502 | d->basicStroker.setClipRect(d->deviceRect); executed (the execution status of this line is deduced): d->basicStroker.setClipRect(d->deviceRect); | - |
503 | | - |
504 | s->brushData.init(d->rasterBuffer.data(), this); executed (the execution status of this line is deduced): s->brushData.init(d->rasterBuffer.data(), this); | - |
505 | 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); | - |
506 | | - |
507 | d->rasterBuffer->compositionMode = QPainter::CompositionMode_SourceOver; executed (the execution status of this line is deduced): d->rasterBuffer->compositionMode = QPainter::CompositionMode_SourceOver; | - |
508 | | - |
509 | setDirty(DirtyBrushOrigin); executed (the execution status of this line is deduced): setDirty(DirtyBrushOrigin); | - |
510 | | - |
511 | #ifdef QT_DEBUG_DRAW | - |
512 | qDebug() << "QRasterPaintEngine::begin(" << (void *) device | - |
513 | << ") devType:" << device->devType() | - |
514 | << "devRect:" << d->deviceRect; | - |
515 | if (d->baseClip) { | - |
516 | dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), &*d->baseClip); | - |
517 | } | - |
518 | #endif | - |
519 | | - |
520 | if (d->mono_surface) evaluated: d->mono_surface yes Evaluation Count:167 | yes Evaluation Count:16795 |
| 167-16795 |
521 | d->glyphCacheType = QFontEngineGlyphCache::Raster_Mono; executed: d->glyphCacheType = QFontEngineGlyphCache::Raster_Mono; Execution Count:167 | 167 |
522 | #if defined(Q_OS_WIN) | - |
523 | else if (clearTypeFontsEnabled()) | - |
524 | #else | - |
525 | else if (false) partially evaluated: false no Evaluation Count:0 | yes Evaluation Count:16795 |
| 0-16795 |
526 | #endif | - |
527 | { | - |
528 | 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(); | - |
529 | if (format == QImage::Format_ARGB32_Premultiplied || format == QImage::Format_RGB32) never evaluated: format == QImage::Format_ARGB32_Premultiplied never evaluated: format == QImage::Format_RGB32 | 0 |
530 | d->glyphCacheType = QFontEngineGlyphCache::Raster_RGBMask; never executed: d->glyphCacheType = QFontEngineGlyphCache::Raster_RGBMask; | 0 |
531 | else | - |
532 | d->glyphCacheType = QFontEngineGlyphCache::Raster_A8; never executed: d->glyphCacheType = QFontEngineGlyphCache::Raster_A8; | 0 |
533 | } else | - |
534 | d->glyphCacheType = QFontEngineGlyphCache::Raster_A8; executed: d->glyphCacheType = QFontEngineGlyphCache::Raster_A8; Execution Count:16795 | 16795 |
535 | | - |
536 | setActive(true); executed (the execution status of this line is deduced): setActive(true); | - |
537 | return true; executed: return true; Execution Count:16962 | 16962 |
538 | } | - |
539 | | - |
540 | /*! | - |
541 | \reimp | - |
542 | */ | - |
543 | bool QRasterPaintEngine::end() | - |
544 | { | - |
545 | #ifdef QT_DEBUG_DRAW | - |
546 | Q_D(QRasterPaintEngine); | - |
547 | qDebug() << "QRasterPaintEngine::end devRect:" << d->deviceRect; | - |
548 | if (d->baseClip) { | - |
549 | dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), &*d->baseClip); | - |
550 | } | - |
551 | #endif | - |
552 | | - |
553 | return true; executed: return true; Execution Count:16962 | 16962 |
554 | } | - |
555 | | - |
556 | /*! | - |
557 | \internal | - |
558 | */ | - |
559 | void QRasterPaintEngine::releaseBuffer() | - |
560 | { | - |
561 | Q_D(QRasterPaintEngine); never executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
562 | d->rasterBuffer.reset(new QRasterBuffer); never executed (the execution status of this line is deduced): d->rasterBuffer.reset(new QRasterBuffer); | - |
563 | } | 0 |
564 | | - |
565 | /*! | - |
566 | \internal | - |
567 | */ | - |
568 | QSize QRasterPaintEngine::size() const | - |
569 | { | - |
570 | Q_D(const QRasterPaintEngine); never executed (the execution status of this line is deduced): const QRasterPaintEnginePrivate * const d = d_func(); | - |
571 | return QSize(d->rasterBuffer->width(), d->rasterBuffer->height()); never executed: return QSize(d->rasterBuffer->width(), d->rasterBuffer->height()); | 0 |
572 | } | - |
573 | | - |
574 | /*! | - |
575 | \internal | - |
576 | */ | - |
577 | #ifndef QT_NO_DEBUG | - |
578 | void QRasterPaintEngine::saveBuffer(const QString &s) const | - |
579 | { | - |
580 | Q_D(const QRasterPaintEngine); | - |
581 | d->rasterBuffer->bufferImage().save(s, "PNG"); | - |
582 | } | - |
583 | #endif | - |
584 | | - |
585 | /*! | - |
586 | \internal | - |
587 | */ | - |
588 | void QRasterPaintEngine::updateMatrix(const QTransform &matrix) | - |
589 | { | - |
590 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
591 | // FALCON: get rid of this line, see drawImage call below. | - |
592 | s->matrix = matrix; executed (the execution status of this line is deduced): s->matrix = matrix; | - |
593 | QTransform::TransformationType txop = s->matrix.type(); executed (the execution status of this line is deduced): QTransform::TransformationType txop = s->matrix.type(); | - |
594 | | - |
595 | switch (txop) { | - |
596 | | - |
597 | case QTransform::TxNone: | - |
598 | s->flags.int_xform = true; executed (the execution status of this line is deduced): s->flags.int_xform = true; | - |
599 | break; executed: break; Execution Count:13 | 13 |
600 | | - |
601 | case QTransform::TxTranslate: | - |
602 | s->flags.int_xform = qreal(int(s->matrix.dx())) == s->matrix.dx() evaluated: qreal(int(s->matrix.dx())) == s->matrix.dx() yes Evaluation Count:16695 | yes Evaluation Count:45 |
| 45-16695 |
603 | && qreal(int(s->matrix.dy())) == s->matrix.dy(); partially evaluated: qreal(int(s->matrix.dy())) == s->matrix.dy() yes Evaluation Count:16695 | no Evaluation Count:0 |
| 0-16695 |
604 | break; executed: break; Execution Count:16740 | 16740 |
605 | | - |
606 | case QTransform::TxScale: | - |
607 | s->flags.int_xform = qreal(int(s->matrix.dx())) == s->matrix.dx() evaluated: qreal(int(s->matrix.dx())) == s->matrix.dx() yes Evaluation Count:8 | yes Evaluation Count:2 |
| 2-8 |
608 | && qreal(int(s->matrix.dy())) == s->matrix.dy() partially evaluated: qreal(int(s->matrix.dy())) == s->matrix.dy() yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-8 |
609 | && qreal(int(s->matrix.m11())) == s->matrix.m11() evaluated: qreal(int(s->matrix.m11())) == s->matrix.m11() yes Evaluation Count:2 | yes Evaluation Count:6 |
| 2-6 |
610 | && qreal(int(s->matrix.m22())) == s->matrix.m22(); partially evaluated: qreal(int(s->matrix.m22())) == s->matrix.m22() yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
611 | break; executed: break; Execution Count:10 | 10 |
612 | | - |
613 | default: // shear / perspective... | - |
614 | s->flags.int_xform = false; executed (the execution status of this line is deduced): s->flags.int_xform = false; | - |
615 | break; executed: break; Execution Count:37 | 37 |
616 | } | - |
617 | | - |
618 | 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); | - |
619 | | - |
620 | ensureOutlineMapper(); executed (the execution status of this line is deduced): ensureOutlineMapper(); | - |
621 | } executed: } Execution Count:16800 | 16800 |
622 | | - |
623 | | - |
624 | | - |
625 | QRasterPaintEngineState::~QRasterPaintEngineState() | - |
626 | { | - |
627 | if (flags.has_clip_ownership) evaluated: flags.has_clip_ownership yes Evaluation Count:17544 | yes Evaluation Count:19769 |
| 17544-19769 |
628 | delete clip; executed: delete clip; Execution Count:17544 | 17544 |
629 | } executed: } Execution Count:37313 | 37313 |
630 | | - |
631 | | - |
632 | QRasterPaintEngineState::QRasterPaintEngineState() | - |
633 | { | - |
634 | stroker = 0; executed (the execution status of this line is deduced): stroker = 0; | - |
635 | | - |
636 | fillFlags = 0; executed (the execution status of this line is deduced): fillFlags = 0; | - |
637 | strokeFlags = 0; executed (the execution status of this line is deduced): strokeFlags = 0; | - |
638 | pixmapFlags = 0; executed (the execution status of this line is deduced): pixmapFlags = 0; | - |
639 | | - |
640 | intOpacity = 256; executed (the execution status of this line is deduced): intOpacity = 256; | - |
641 | | - |
642 | txscale = 1.; executed (the execution status of this line is deduced): txscale = 1.; | - |
643 | | - |
644 | flags.fast_pen = true; executed (the execution status of this line is deduced): flags.fast_pen = true; | - |
645 | flags.antialiased = false; executed (the execution status of this line is deduced): flags.antialiased = false; | - |
646 | flags.bilinear = false; executed (the execution status of this line is deduced): flags.bilinear = false; | - |
647 | flags.legacy_rounding = false; executed (the execution status of this line is deduced): flags.legacy_rounding = false; | - |
648 | flags.fast_text = true; executed (the execution status of this line is deduced): flags.fast_text = true; | - |
649 | flags.int_xform = true; executed (the execution status of this line is deduced): flags.int_xform = true; | - |
650 | flags.tx_noshear = true; executed (the execution status of this line is deduced): flags.tx_noshear = true; | - |
651 | flags.fast_images = true; executed (the execution status of this line is deduced): flags.fast_images = true; | - |
652 | | - |
653 | clip = 0; executed (the execution status of this line is deduced): clip = 0; | - |
654 | flags.has_clip_ownership = false; executed (the execution status of this line is deduced): flags.has_clip_ownership = false; | - |
655 | | - |
656 | dirty = 0; executed (the execution status of this line is deduced): dirty = 0; | - |
657 | } executed: } Execution Count:16963 | 16963 |
658 | | - |
659 | QRasterPaintEngineState::QRasterPaintEngineState(QRasterPaintEngineState &s) | - |
660 | : QPainterState(s) | - |
661 | , lastPen(s.lastPen) | - |
662 | , penData(s.penData) | - |
663 | , stroker(s.stroker) | - |
664 | , strokeFlags(s.strokeFlags) | - |
665 | , lastBrush(s.lastBrush) | - |
666 | , brushData(s.brushData) | - |
667 | , fillFlags(s.fillFlags) | - |
668 | , pixmapFlags(s.pixmapFlags) | - |
669 | , intOpacity(s.intOpacity) | - |
670 | , txscale(s.txscale) | - |
671 | , clip(s.clip) | - |
672 | , dirty(s.dirty) | - |
673 | , flag_bits(s.flag_bits) | - |
674 | { | - |
675 | brushData.tempImage = 0; executed (the execution status of this line is deduced): brushData.tempImage = 0; | - |
676 | penData.tempImage = 0; executed (the execution status of this line is deduced): penData.tempImage = 0; | - |
677 | flags.has_clip_ownership = false; executed (the execution status of this line is deduced): flags.has_clip_ownership = false; | - |
678 | } executed: } Execution Count:20350 | 20350 |
679 | | - |
680 | /*! | - |
681 | \internal | - |
682 | */ | - |
683 | QPainterState *QRasterPaintEngine::createState(QPainterState *orig) const | - |
684 | { | - |
685 | QRasterPaintEngineState *s; executed (the execution status of this line is deduced): QRasterPaintEngineState *s; | - |
686 | if (!orig) evaluated: !orig yes Evaluation Count:16963 | yes Evaluation Count:20350 |
| 16963-20350 |
687 | s = new QRasterPaintEngineState(); executed: s = new QRasterPaintEngineState(); Execution Count:16963 | 16963 |
688 | else | - |
689 | s = new QRasterPaintEngineState(*static_cast<QRasterPaintEngineState *>(orig)); executed: s = new QRasterPaintEngineState(*static_cast<QRasterPaintEngineState *>(orig)); Execution Count:20350 | 20350 |
690 | | - |
691 | return s; executed: return s; Execution Count:37313 | 37313 |
692 | } | - |
693 | | - |
694 | /*! | - |
695 | \internal | - |
696 | */ | - |
697 | void QRasterPaintEngine::setState(QPainterState *s) | - |
698 | { | - |
699 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
700 | QPaintEngineEx::setState(s); executed (the execution status of this line is deduced): QPaintEngineEx::setState(s); | - |
701 | d->rasterBuffer->compositionMode = s->composition_mode; executed (the execution status of this line is deduced): d->rasterBuffer->compositionMode = s->composition_mode; | - |
702 | } executed: } Execution Count:58312 | 58312 |
703 | | - |
704 | /*! | - |
705 | \fn QRasterPaintEngineState *QRasterPaintEngine::state() | - |
706 | \internal | - |
707 | */ | - |
708 | | - |
709 | /*! | - |
710 | \fn const QRasterPaintEngineState *QRasterPaintEngine::state() const | - |
711 | \internal | - |
712 | */ | - |
713 | | - |
714 | /*! | - |
715 | \internal | - |
716 | */ | - |
717 | void QRasterPaintEngine::penChanged() | - |
718 | { | - |
719 | #ifdef QT_DEBUG_DRAW | - |
720 | qDebug() << "QRasterPaintEngine::penChanged():" << state()->pen; | - |
721 | #endif | - |
722 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
723 | s->strokeFlags |= DirtyPen; executed (the execution status of this line is deduced): s->strokeFlags |= DirtyPen; | - |
724 | s->dirty |= DirtyPen; executed (the execution status of this line is deduced): s->dirty |= DirtyPen; | - |
725 | } executed: } Execution Count:67914 | 67914 |
726 | | - |
727 | /*! | - |
728 | \internal | - |
729 | */ | - |
730 | void QRasterPaintEngine::updatePen(const QPen &pen) | - |
731 | { | - |
732 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
733 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
734 | #ifdef QT_DEBUG_DRAW | - |
735 | qDebug() << "QRasterPaintEngine::updatePen():" << s->pen; | - |
736 | #endif | - |
737 | | - |
738 | Qt::PenStyle pen_style = qpen_style(pen); executed (the execution status of this line is deduced): Qt::PenStyle pen_style = qpen_style(pen); | - |
739 | | - |
740 | s->lastPen = pen; executed (the execution status of this line is deduced): s->lastPen = pen; | - |
741 | s->strokeFlags = 0; executed (the execution status of this line is deduced): s->strokeFlags = 0; | - |
742 | | - |
743 | s->penData.clip = d->clip(); executed (the execution status of this line is deduced): s->penData.clip = d->clip(); | - |
744 | 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); | - |
745 | | - |
746 | if (s->strokeFlags & QRasterPaintEngine::DirtyTransform partially evaluated: s->strokeFlags & QRasterPaintEngine::DirtyTransform no Evaluation Count:0 | yes Evaluation Count:51339 |
| 0-51339 |
747 | || pen.brush().transform().type() >= QTransform::TxNone) { partially evaluated: pen.brush().transform().type() >= QTransform::TxNone yes Evaluation Count:51339 | no Evaluation Count:0 |
| 0-51339 |
748 | 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); | - |
749 | } executed: } Execution Count:51339 | 51339 |
750 | | - |
751 | // Slightly ugly handling of an uncommon case... We need to change | - |
752 | // the pen because it is reused in draw_midpoint to decide dashed | - |
753 | // or non-dashed. | - |
754 | if (pen_style == Qt::CustomDashLine && pen.dashPattern().size() == 0) { evaluated: pen_style == Qt::CustomDashLine yes Evaluation Count:1 | yes Evaluation Count:51338 |
partially evaluated: pen.dashPattern().size() == 0 no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-51338 |
755 | pen_style = Qt::SolidLine; never executed (the execution status of this line is deduced): pen_style = Qt::SolidLine; | - |
756 | s->lastPen.setStyle(Qt::SolidLine); never executed (the execution status of this line is deduced): s->lastPen.setStyle(Qt::SolidLine); | - |
757 | } | 0 |
758 | | - |
759 | d->basicStroker.setJoinStyle(qpen_joinStyle(pen)); executed (the execution status of this line is deduced): d->basicStroker.setJoinStyle(qpen_joinStyle(pen)); | - |
760 | d->basicStroker.setCapStyle(qpen_capStyle(pen)); executed (the execution status of this line is deduced): d->basicStroker.setCapStyle(qpen_capStyle(pen)); | - |
761 | d->basicStroker.setMiterLimit(pen.miterLimit()); executed (the execution status of this line is deduced): d->basicStroker.setMiterLimit(pen.miterLimit()); | - |
762 | | - |
763 | qreal penWidth = qpen_widthf(pen); executed (the execution status of this line is deduced): qreal penWidth = qpen_widthf(pen); | - |
764 | if (penWidth == 0) evaluated: penWidth == 0 yes Evaluation Count:363 | yes Evaluation Count:50976 |
| 363-50976 |
765 | d->basicStroker.setStrokeWidth(1); executed: d->basicStroker.setStrokeWidth(1); Execution Count:363 | 363 |
766 | else | - |
767 | d->basicStroker.setStrokeWidth(penWidth); executed: d->basicStroker.setStrokeWidth(penWidth); Execution Count:50976 | 50976 |
768 | | - |
769 | if(pen_style == Qt::SolidLine) { evaluated: pen_style == Qt::SolidLine yes Evaluation Count:49933 | yes Evaluation Count:1406 |
| 1406-49933 |
770 | s->stroker = &d->basicStroker; executed (the execution status of this line is deduced): s->stroker = &d->basicStroker; | - |
771 | } else if (pen_style != Qt::NoPen) { executed: } Execution Count:49933 evaluated: pen_style != Qt::NoPen yes Evaluation Count:12 | yes Evaluation Count:1394 |
| 12-49933 |
772 | if (!d->dashStroker) evaluated: !d->dashStroker yes Evaluation Count:7 | yes Evaluation Count:5 |
| 5-7 |
773 | d->dashStroker.reset(new QDashStroker(&d->basicStroker)); executed: d->dashStroker.reset(new QDashStroker(&d->basicStroker)); Execution Count:7 | 7 |
774 | if (qt_pen_is_cosmetic(pen, s->renderHints)) { partially evaluated: qt_pen_is_cosmetic(pen, s->renderHints) no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
775 | d->dashStroker->setClipRect(d->deviceRect); never executed (the execution status of this line is deduced): d->dashStroker->setClipRect(d->deviceRect); | - |
776 | } else { | 0 |
777 | // ### I've seen this inverted devrect multiple places now... | - |
778 | 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)); | - |
779 | d->dashStroker->setClipRect(clipRect); executed (the execution status of this line is deduced): d->dashStroker->setClipRect(clipRect); | - |
780 | } executed: } Execution Count:12 | 12 |
781 | d->dashStroker->setDashPattern(pen.dashPattern()); executed (the execution status of this line is deduced): d->dashStroker->setDashPattern(pen.dashPattern()); | - |
782 | d->dashStroker->setDashOffset(pen.dashOffset()); executed (the execution status of this line is deduced): d->dashStroker->setDashOffset(pen.dashOffset()); | - |
783 | s->stroker = d->dashStroker.data(); executed (the execution status of this line is deduced): s->stroker = d->dashStroker.data(); | - |
784 | } else { executed: } Execution Count:12 | 12 |
785 | s->stroker = 0; executed (the execution status of this line is deduced): s->stroker = 0; | - |
786 | } executed: } Execution Count:1394 | 1394 |
787 | | - |
788 | ensureRasterState(); // needed because of tx_noshear... executed (the execution status of this line is deduced): ensureRasterState(); | - |
789 | 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); | - |
790 | s->flags.fast_pen = pen_style > Qt::NoPen evaluated: pen_style > Qt::NoPen yes Evaluation Count:49945 | yes Evaluation Count:1394 |
| 1394-49945 |
791 | && s->penData.blend evaluated: s->penData.blend yes Evaluation Count:49932 | yes Evaluation Count:13 |
| 13-49932 |
792 | && ((cosmetic && penWidth <= 1) evaluated: cosmetic yes Evaluation Count:1223 | yes Evaluation Count:48709 |
partially evaluated: penWidth <= 1 yes Evaluation Count:1223 | no Evaluation Count:0 |
| 0-48709 |
793 | || (!cosmetic && s->flags.tx_noshear && penWidth * s->txscale <= 1)); partially evaluated: !cosmetic yes Evaluation Count:48709 | no Evaluation Count:0 |
partially evaluated: s->flags.tx_noshear yes Evaluation Count:48709 | no Evaluation Count:0 |
evaluated: penWidth * s->txscale <= 1 yes Evaluation Count:48611 | yes Evaluation Count:98 |
| 0-48709 |
794 | | - |
795 | s->flags.non_complex_pen = qpen_capStyle(s->lastPen) <= Qt::SquareCap && s->flags.tx_noshear; evaluated: qpen_capStyle(s->lastPen) <= Qt::SquareCap yes Evaluation Count:51338 | yes Evaluation Count:1 |
partially evaluated: s->flags.tx_noshear yes Evaluation Count:51338 | no Evaluation Count:0 |
| 0-51338 |
796 | | - |
797 | s->strokeFlags = 0; executed (the execution status of this line is deduced): s->strokeFlags = 0; | - |
798 | } executed: } Execution Count:51339 | 51339 |
799 | | - |
800 | | - |
801 | | - |
802 | /*! | - |
803 | \internal | - |
804 | */ | - |
805 | void QRasterPaintEngine::brushOriginChanged() | - |
806 | { | - |
807 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
808 | #ifdef QT_DEBUG_DRAW | - |
809 | qDebug() << "QRasterPaintEngine::brushOriginChanged()" << s->brushOrigin; | - |
810 | #endif | - |
811 | | - |
812 | s->fillFlags |= DirtyBrushOrigin; executed (the execution status of this line is deduced): s->fillFlags |= DirtyBrushOrigin; | - |
813 | } executed: } Execution Count:13040 | 13040 |
814 | | - |
815 | | - |
816 | /*! | - |
817 | \internal | - |
818 | */ | - |
819 | void QRasterPaintEngine::brushChanged() | - |
820 | { | - |
821 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
822 | #ifdef QT_DEBUG_DRAW | - |
823 | qDebug() << "QRasterPaintEngine::brushChanged():" << s->brush; | - |
824 | #endif | - |
825 | s->fillFlags |= DirtyBrush; executed (the execution status of this line is deduced): s->fillFlags |= DirtyBrush; | - |
826 | } executed: } Execution Count:4367 | 4367 |
827 | | - |
828 | | - |
829 | | - |
830 | | - |
831 | /*! | - |
832 | \internal | - |
833 | */ | - |
834 | void QRasterPaintEngine::updateBrush(const QBrush &brush) | - |
835 | { | - |
836 | #ifdef QT_DEBUG_DRAW | - |
837 | qDebug() << "QRasterPaintEngine::updateBrush()" << brush; | - |
838 | #endif | - |
839 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
840 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
841 | // must set clip prior to setup, as setup uses it... | - |
842 | s->brushData.clip = d->clip(); executed (the execution status of this line is deduced): s->brushData.clip = d->clip(); | - |
843 | 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); | - |
844 | if (s->fillFlags & DirtyTransform evaluated: s->fillFlags & DirtyTransform yes Evaluation Count:43150 | yes Evaluation Count:127367 |
| 43150-127367 |
845 | || brush.transform().type() >= QTransform::TxNone) partially evaluated: brush.transform().type() >= QTransform::TxNone yes Evaluation Count:127373 | no Evaluation Count:0 |
| 0-127373 |
846 | d_func()->updateMatrixData(&s->brushData, brush, d->brushMatrix()); executed: d_func()->updateMatrixData(&s->brushData, brush, d->brushMatrix()); Execution Count:170523 | 170523 |
847 | s->lastBrush = brush; executed (the execution status of this line is deduced): s->lastBrush = brush; | - |
848 | s->fillFlags = 0; executed (the execution status of this line is deduced): s->fillFlags = 0; | - |
849 | } executed: } Execution Count:170524 | 170524 |
850 | | - |
851 | void QRasterPaintEngine::updateOutlineMapper() | - |
852 | { | - |
853 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
854 | d->outlineMapper->setMatrix(state()->matrix); executed (the execution status of this line is deduced): d->outlineMapper->setMatrix(state()->matrix); | - |
855 | } executed: } Execution Count:168911 | 168911 |
856 | | - |
857 | void QRasterPaintEngine::updateRasterState() | - |
858 | { | - |
859 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
860 | | - |
861 | if (s->dirty & DirtyTransform) evaluated: s->dirty & DirtyTransform yes Evaluation Count:16800 | yes Evaluation Count:33304 |
| 16800-33304 |
862 | updateMatrix(s->matrix); executed: updateMatrix(s->matrix); Execution Count:16800 | 16800 |
863 | | - |
864 | if (s->dirty & (DirtyPen|DirtyCompositionMode|DirtyOpacity)) { evaluated: s->dirty & (DirtyPen|DirtyCompositionMode|DirtyOpacity) yes Evaluation Count:49872 | yes Evaluation Count:232 |
| 232-49872 |
865 | const QPainter::CompositionMode mode = s->composition_mode; executed (the execution status of this line is deduced): const QPainter::CompositionMode mode = s->composition_mode; | - |
866 | s->flags.fast_text = (s->penData.type == QSpanData::Solid) evaluated: (s->penData.type == QSpanData::Solid) yes Evaluation Count:49691 | yes Evaluation Count:181 |
| 181-49691 |
867 | && s->intOpacity == 256 evaluated: s->intOpacity == 256 yes Evaluation Count:49681 | yes Evaluation Count:10 |
| 10-49681 |
868 | && (mode == QPainter::CompositionMode_Source partially evaluated: mode == QPainter::CompositionMode_Source no Evaluation Count:0 | yes Evaluation Count:49681 |
| 0-49681 |
869 | || (mode == QPainter::CompositionMode_SourceOver partially evaluated: mode == QPainter::CompositionMode_SourceOver yes Evaluation Count:49681 | no Evaluation Count:0 |
| 0-49681 |
870 | && qAlpha(s->penData.solid.color) == 255)); evaluated: qAlpha(s->penData.solid.color) == 255 yes Evaluation Count:49535 | yes Evaluation Count:146 |
| 146-49535 |
871 | } executed: } Execution Count:49872 | 49872 |
872 | | - |
873 | s->dirty = 0; executed (the execution status of this line is deduced): s->dirty = 0; | - |
874 | } executed: } Execution Count:50104 | 50104 |
875 | | - |
876 | | - |
877 | /*! | - |
878 | \internal | - |
879 | */ | - |
880 | void QRasterPaintEngine::opacityChanged() | - |
881 | { | - |
882 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
883 | | - |
884 | #ifdef QT_DEBUG_DRAW | - |
885 | qDebug() << "QRasterPaintEngine::opacityChanged()" << s->opacity; | - |
886 | #endif | - |
887 | | - |
888 | s->fillFlags |= DirtyOpacity; executed (the execution status of this line is deduced): s->fillFlags |= DirtyOpacity; | - |
889 | s->strokeFlags |= DirtyOpacity; executed (the execution status of this line is deduced): s->strokeFlags |= DirtyOpacity; | - |
890 | s->pixmapFlags |= DirtyOpacity; executed (the execution status of this line is deduced): s->pixmapFlags |= DirtyOpacity; | - |
891 | s->dirty |= DirtyOpacity; executed (the execution status of this line is deduced): s->dirty |= DirtyOpacity; | - |
892 | s->intOpacity = (int) (s->opacity * 256); executed (the execution status of this line is deduced): s->intOpacity = (int) (s->opacity * 256); | - |
893 | } executed: } Execution Count:400 | 400 |
894 | | - |
895 | /*! | - |
896 | \internal | - |
897 | */ | - |
898 | void QRasterPaintEngine::compositionModeChanged() | - |
899 | { | - |
900 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
901 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
902 | | - |
903 | #ifdef QT_DEBUG_DRAW | - |
904 | qDebug() << "QRasterPaintEngine::compositionModeChanged()" << s->composition_mode; | - |
905 | #endif | - |
906 | | - |
907 | s->fillFlags |= DirtyCompositionMode; executed (the execution status of this line is deduced): s->fillFlags |= DirtyCompositionMode; | - |
908 | s->dirty |= DirtyCompositionMode; executed (the execution status of this line is deduced): s->dirty |= DirtyCompositionMode; | - |
909 | | - |
910 | s->strokeFlags |= DirtyCompositionMode; executed (the execution status of this line is deduced): s->strokeFlags |= DirtyCompositionMode; | - |
911 | d->rasterBuffer->compositionMode = s->composition_mode; executed (the execution status of this line is deduced): d->rasterBuffer->compositionMode = s->composition_mode; | - |
912 | | - |
913 | d->recalculateFastImages(); executed (the execution status of this line is deduced): d->recalculateFastImages(); | - |
914 | } executed: } Execution Count:4253 | 4253 |
915 | | - |
916 | /*! | - |
917 | \internal | - |
918 | */ | - |
919 | void QRasterPaintEngine::renderHintsChanged() | - |
920 | { | - |
921 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
922 | | - |
923 | #ifdef QT_DEBUG_DRAW | - |
924 | qDebug() << "QRasterPaintEngine::renderHintsChanged()" << hex << s->renderHints; | - |
925 | #endif | - |
926 | | - |
927 | bool was_aa = s->flags.antialiased; executed (the execution status of this line is deduced): bool was_aa = s->flags.antialiased; | - |
928 | bool was_bilinear = s->flags.bilinear; executed (the execution status of this line is deduced): bool was_bilinear = s->flags.bilinear; | - |
929 | | - |
930 | 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); | - |
931 | 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); | - |
932 | s->flags.legacy_rounding = !bool(s->renderHints & QPainter::Antialiasing) && bool(s->renderHints & QPainter::Qt4CompatiblePainting); evaluated: !bool(s->renderHints & QPainter::Antialiasing) yes Evaluation Count:1132 | yes Evaluation Count:286 |
evaluated: bool(s->renderHints & QPainter::Qt4CompatiblePainting) yes Evaluation Count:815 | yes Evaluation Count:317 |
| 286-1132 |
933 | | - |
934 | if (was_aa != s->flags.antialiased) evaluated: was_aa != s->flags.antialiased yes Evaluation Count:292 | yes Evaluation Count:1126 |
| 292-1126 |
935 | s->strokeFlags |= DirtyHints; executed: s->strokeFlags |= DirtyHints; Execution Count:292 | 292 |
936 | | - |
937 | if (was_bilinear != s->flags.bilinear) { evaluated: was_bilinear != s->flags.bilinear yes Evaluation Count:27 | yes Evaluation Count:1391 |
| 27-1391 |
938 | s->strokeFlags |= DirtyPen; executed (the execution status of this line is deduced): s->strokeFlags |= DirtyPen; | - |
939 | s->fillFlags |= DirtyBrush; executed (the execution status of this line is deduced): s->fillFlags |= DirtyBrush; | - |
940 | } executed: } Execution Count:27 | 27 |
941 | | - |
942 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
943 | d->recalculateFastImages(); executed (the execution status of this line is deduced): d->recalculateFastImages(); | - |
944 | } executed: } Execution Count:1418 | 1418 |
945 | | - |
946 | /*! | - |
947 | \internal | - |
948 | */ | - |
949 | void QRasterPaintEngine::transformChanged() | - |
950 | { | - |
951 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
952 | | - |
953 | #ifdef QT_DEBUG_DRAW | - |
954 | qDebug() << "QRasterPaintEngine::transformChanged()" << s->matrix; | - |
955 | #endif | - |
956 | | - |
957 | s->fillFlags |= DirtyTransform; executed (the execution status of this line is deduced): s->fillFlags |= DirtyTransform; | - |
958 | s->strokeFlags |= DirtyTransform; executed (the execution status of this line is deduced): s->strokeFlags |= DirtyTransform; | - |
959 | | - |
960 | s->dirty |= DirtyTransform; executed (the execution status of this line is deduced): s->dirty |= DirtyTransform; | - |
961 | | - |
962 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
963 | d->recalculateFastImages(); executed (the execution status of this line is deduced): d->recalculateFastImages(); | - |
964 | } executed: } Execution Count:43037 | 43037 |
965 | | - |
966 | /*! | - |
967 | \internal | - |
968 | */ | - |
969 | void QRasterPaintEngine::clipEnabledChanged() | - |
970 | { | - |
971 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
972 | | - |
973 | #ifdef QT_DEBUG_DRAW | - |
974 | qDebug() << "QRasterPaintEngine::clipEnabledChanged()" << s->clipEnabled; | - |
975 | #endif | - |
976 | | - |
977 | if (s->clip) { partially evaluated: s->clip yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-4 |
978 | s->clip->enabled = s->clipEnabled; executed (the execution status of this line is deduced): s->clip->enabled = s->clipEnabled; | - |
979 | s->fillFlags |= DirtyClipEnabled; executed (the execution status of this line is deduced): s->fillFlags |= DirtyClipEnabled; | - |
980 | s->strokeFlags |= DirtyClipEnabled; executed (the execution status of this line is deduced): s->strokeFlags |= DirtyClipEnabled; | - |
981 | s->pixmapFlags |= DirtyClipEnabled; executed (the execution status of this line is deduced): s->pixmapFlags |= DirtyClipEnabled; | - |
982 | } executed: } Execution Count:4 | 4 |
983 | } executed: } Execution Count:4 | 4 |
984 | | - |
985 | void QRasterPaintEnginePrivate::drawImage(const QPointF &pt, | - |
986 | const QImage &img, | - |
987 | SrcOverBlendFunc func, | - |
988 | const QRect &clip, | - |
989 | int alpha, | - |
990 | const QRect &sr) | - |
991 | { | - |
992 | if (alpha == 0 || !clip.isValid()) evaluated: alpha == 0 yes Evaluation Count:5 | yes Evaluation Count:4652 |
partially evaluated: !clip.isValid() no Evaluation Count:0 | yes Evaluation Count:4652 |
| 0-4652 |
993 | return; executed: return; Execution Count:5 | 5 |
994 | | - |
995 | Q_ASSERT(img.depth() >= 8); executed (the execution status of this line is deduced): qt_noop(); | - |
996 | | - |
997 | int srcBPL = img.bytesPerLine(); executed (the execution status of this line is deduced): int srcBPL = img.bytesPerLine(); | - |
998 | const uchar *srcBits = img.bits(); executed (the execution status of this line is deduced): const uchar *srcBits = img.bits(); | - |
999 | 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; | - |
1000 | int iw = img.width(); executed (the execution status of this line is deduced): int iw = img.width(); | - |
1001 | int ih = img.height(); executed (the execution status of this line is deduced): int ih = img.height(); | - |
1002 | | - |
1003 | if (!sr.isEmpty()) { evaluated: !sr.isEmpty() yes Evaluation Count:3078 | yes Evaluation Count:1574 |
| 1574-3078 |
1004 | iw = sr.width(); executed (the execution status of this line is deduced): iw = sr.width(); | - |
1005 | ih = sr.height(); executed (the execution status of this line is deduced): ih = sr.height(); | - |
1006 | // Adjust the image according to the source offset... | - |
1007 | srcBits += ((sr.y() * srcBPL) + sr.x() * srcSize); executed (the execution status of this line is deduced): srcBits += ((sr.y() * srcBPL) + sr.x() * srcSize); | - |
1008 | } executed: } Execution Count:3078 | 3078 |
1009 | | - |
1010 | // adapt the x parameters | - |
1011 | int x = qRound(pt.x()); executed (the execution status of this line is deduced): int x = qRound(pt.x()); | - |
1012 | int cx1 = clip.x(); executed (the execution status of this line is deduced): int cx1 = clip.x(); | - |
1013 | int cx2 = clip.x() + clip.width(); executed (the execution status of this line is deduced): int cx2 = clip.x() + clip.width(); | - |
1014 | if (x < cx1) { evaluated: x < cx1 yes Evaluation Count:15 | yes Evaluation Count:4637 |
| 15-4637 |
1015 | int d = cx1 - x; executed (the execution status of this line is deduced): int d = cx1 - x; | - |
1016 | srcBits += srcSize * d; executed (the execution status of this line is deduced): srcBits += srcSize * d; | - |
1017 | iw -= d; executed (the execution status of this line is deduced): iw -= d; | - |
1018 | x = cx1; executed (the execution status of this line is deduced): x = cx1; | - |
1019 | } executed: } Execution Count:15 | 15 |
1020 | if (x + iw > cx2) { evaluated: x + iw > cx2 yes Evaluation Count:195 | yes Evaluation Count:4457 |
| 195-4457 |
1021 | int d = x + iw - cx2; executed (the execution status of this line is deduced): int d = x + iw - cx2; | - |
1022 | iw -= d; executed (the execution status of this line is deduced): iw -= d; | - |
1023 | } executed: } Execution Count:195 | 195 |
1024 | if (iw <= 0) evaluated: iw <= 0 yes Evaluation Count:20 | yes Evaluation Count:4632 |
| 20-4632 |
1025 | return; executed: return; Execution Count:20 | 20 |
1026 | | - |
1027 | // adapt the y paremeters... | - |
1028 | int cy1 = clip.y(); executed (the execution status of this line is deduced): int cy1 = clip.y(); | - |
1029 | int cy2 = clip.y() + clip.height(); executed (the execution status of this line is deduced): int cy2 = clip.y() + clip.height(); | - |
1030 | int y = qRound(pt.y()); executed (the execution status of this line is deduced): int y = qRound(pt.y()); | - |
1031 | if (y < cy1) { evaluated: y < cy1 yes Evaluation Count:56 | yes Evaluation Count:4576 |
| 56-4576 |
1032 | int d = cy1 - y; executed (the execution status of this line is deduced): int d = cy1 - y; | - |
1033 | srcBits += srcBPL * d; executed (the execution status of this line is deduced): srcBits += srcBPL * d; | - |
1034 | ih -= d; executed (the execution status of this line is deduced): ih -= d; | - |
1035 | y = cy1; executed (the execution status of this line is deduced): y = cy1; | - |
1036 | } executed: } Execution Count:56 | 56 |
1037 | if (y + ih > cy2) { evaluated: y + ih > cy2 yes Evaluation Count:117 | yes Evaluation Count:4515 |
| 117-4515 |
1038 | int d = y + ih - cy2; executed (the execution status of this line is deduced): int d = y + ih - cy2; | - |
1039 | ih -= d; executed (the execution status of this line is deduced): ih -= d; | - |
1040 | } executed: } Execution Count:117 | 117 |
1041 | if (ih <= 0) evaluated: ih <= 0 yes Evaluation Count:112 | yes Evaluation Count:4520 |
| 112-4520 |
1042 | return; executed: return; Execution Count:112 | 112 |
1043 | | - |
1044 | // call the blend function... | - |
1045 | int dstSize = rasterBuffer->bytesPerPixel(); executed (the execution status of this line is deduced): int dstSize = rasterBuffer->bytesPerPixel(); | - |
1046 | int dstBPL = rasterBuffer->bytesPerLine(); executed (the execution status of this line is deduced): int dstBPL = rasterBuffer->bytesPerLine(); | - |
1047 | 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, | - |
1048 | srcBits, srcBPL, executed (the execution status of this line is deduced): srcBits, srcBPL, | - |
1049 | iw, ih, executed (the execution status of this line is deduced): iw, ih, | - |
1050 | alpha); executed (the execution status of this line is deduced): alpha); | - |
1051 | } executed: } Execution Count:4520 | 4520 |
1052 | | - |
1053 | | - |
1054 | void QRasterPaintEnginePrivate::systemStateChanged() | - |
1055 | { | - |
1056 | QRect clipRect(0, 0, executed (the execution status of this line is deduced): QRect clipRect(0, 0, | - |
1057 | qMin(QT_RASTER_COORD_LIMIT, device->width()), executed (the execution status of this line is deduced): qMin(QT_RASTER_COORD_LIMIT, device->width()), | - |
1058 | qMin(QT_RASTER_COORD_LIMIT, device->height())); executed (the execution status of this line is deduced): qMin(QT_RASTER_COORD_LIMIT, device->height())); | - |
1059 | | - |
1060 | if (!systemClip.isEmpty()) { evaluated: !systemClip.isEmpty() yes Evaluation Count:7290 | yes Evaluation Count:9675 |
| 7290-9675 |
1061 | QRegion clippedDeviceRgn = systemClip & clipRect; executed (the execution status of this line is deduced): QRegion clippedDeviceRgn = systemClip & clipRect; | - |
1062 | deviceRect = clippedDeviceRgn.boundingRect(); executed (the execution status of this line is deduced): deviceRect = clippedDeviceRgn.boundingRect(); | - |
1063 | baseClip->setClipRegion(clippedDeviceRgn); executed (the execution status of this line is deduced): baseClip->setClipRegion(clippedDeviceRgn); | - |
1064 | } else { executed: } Execution Count:7290 | 7290 |
1065 | deviceRect = clipRect; executed (the execution status of this line is deduced): deviceRect = clipRect; | - |
1066 | baseClip->setClipRect(deviceRect); executed (the execution status of this line is deduced): baseClip->setClipRect(deviceRect); | - |
1067 | } executed: } Execution Count:9675 | 9675 |
1068 | #ifdef QT_DEBUG_DRAW | - |
1069 | qDebug() << "systemStateChanged" << this << "deviceRect" << deviceRect << clipRect << systemClip; | - |
1070 | #endif | - |
1071 | | - |
1072 | exDeviceRect = deviceRect; executed (the execution status of this line is deduced): exDeviceRect = deviceRect; | - |
1073 | | - |
1074 | Q_Q(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEngine * const q = q_func(); | - |
1075 | if (q->state()) { partially evaluated: q->state() yes Evaluation Count:16965 | no Evaluation Count:0 |
| 0-16965 |
1076 | q->state()->strokeFlags |= QPaintEngine::DirtyClipRegion; executed (the execution status of this line is deduced): q->state()->strokeFlags |= QPaintEngine::DirtyClipRegion; | - |
1077 | q->state()->fillFlags |= QPaintEngine::DirtyClipRegion; executed (the execution status of this line is deduced): q->state()->fillFlags |= QPaintEngine::DirtyClipRegion; | - |
1078 | q->state()->pixmapFlags |= QPaintEngine::DirtyClipRegion; executed (the execution status of this line is deduced): q->state()->pixmapFlags |= QPaintEngine::DirtyClipRegion; | - |
1079 | } executed: } Execution Count:16965 | 16965 |
1080 | } executed: } Execution Count:16965 | 16965 |
1081 | | - |
1082 | void QRasterPaintEnginePrivate::updateMatrixData(QSpanData *spanData, const QBrush &b, const QTransform &m) | - |
1083 | { | - |
1084 | if (b.d->style == Qt::NoBrush || b.d->style == Qt::SolidPattern) evaluated: b.d->style == Qt::NoBrush yes Evaluation Count:770 | yes Evaluation Count:221081 |
evaluated: b.d->style == Qt::SolidPattern yes Evaluation Count:200247 | yes Evaluation Count:20840 |
| 770-221081 |
1085 | return; executed: return; Execution Count:201017 | 201017 |
1086 | | - |
1087 | Q_Q(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEngine * const q = q_func(); | - |
1088 | bool bilinear = q->state()->flags.bilinear; executed (the execution status of this line is deduced): bool bilinear = q->state()->flags.bilinear; | - |
1089 | | - |
1090 | if (b.d->transform.type() > QTransform::TxNone) { // FALCON: optimize evaluated: b.d->transform.type() > QTransform::TxNone yes Evaluation Count:3 | yes Evaluation Count:20835 |
| 3-20835 |
1091 | spanData->setupMatrix(b.transform() * m, bilinear); executed (the execution status of this line is deduced): spanData->setupMatrix(b.transform() * m, bilinear); | - |
1092 | } else { executed: } Execution Count:3 | 3 |
1093 | if (m.type() <= QTransform::TxTranslate) { evaluated: m.type() <= QTransform::TxTranslate yes Evaluation Count:20806 | yes Evaluation Count:4 |
| 4-20806 |
1094 | // specialize setupMatrix for translation matrices | - |
1095 | // to avoid needless matrix inversion | - |
1096 | spanData->m11 = 1; executed (the execution status of this line is deduced): spanData->m11 = 1; | - |
1097 | spanData->m12 = 0; executed (the execution status of this line is deduced): spanData->m12 = 0; | - |
1098 | spanData->m13 = 0; executed (the execution status of this line is deduced): spanData->m13 = 0; | - |
1099 | spanData->m21 = 0; executed (the execution status of this line is deduced): spanData->m21 = 0; | - |
1100 | spanData->m22 = 1; executed (the execution status of this line is deduced): spanData->m22 = 1; | - |
1101 | spanData->m23 = 0; executed (the execution status of this line is deduced): spanData->m23 = 0; | - |
1102 | spanData->m33 = 1; executed (the execution status of this line is deduced): spanData->m33 = 1; | - |
1103 | spanData->dx = -m.dx(); executed (the execution status of this line is deduced): spanData->dx = -m.dx(); | - |
1104 | spanData->dy = -m.dy(); executed (the execution status of this line is deduced): spanData->dy = -m.dy(); | - |
1105 | spanData->txop = m.type(); executed (the execution status of this line is deduced): spanData->txop = m.type(); | - |
1106 | spanData->bilinear = bilinear; executed (the execution status of this line is deduced): spanData->bilinear = bilinear; | - |
1107 | spanData->fast_matrix = qAbs(m.dx()) < 1e4 && qAbs(m.dy()) < 1e4; partially evaluated: qAbs(m.dx()) < 1e4 yes Evaluation Count:20806 | no Evaluation Count:0 |
partially evaluated: qAbs(m.dy()) < 1e4 yes Evaluation Count:20812 | no Evaluation Count:0 |
| 0-20812 |
1108 | spanData->adjustSpanMethods(); executed (the execution status of this line is deduced): spanData->adjustSpanMethods(); | - |
1109 | } else { executed: } Execution Count:20806 | 20806 |
1110 | spanData->setupMatrix(m, bilinear); executed (the execution status of this line is deduced): spanData->setupMatrix(m, bilinear); | - |
1111 | } executed: } Execution Count:4 | 4 |
1112 | } | - |
1113 | } | - |
1114 | | - |
1115 | // #define QT_CLIPPING_RATIOS | - |
1116 | | - |
1117 | #ifdef QT_CLIPPING_RATIOS | - |
1118 | int rectClips; | - |
1119 | int regionClips; | - |
1120 | int totalClips; | - |
1121 | | - |
1122 | static void checkClipRatios(QRasterPaintEnginePrivate *d) | - |
1123 | { | - |
1124 | if (d->clip()->hasRectClip) | - |
1125 | rectClips++; | - |
1126 | if (d->clip()->hasRegionClip) | - |
1127 | regionClips++; | - |
1128 | totalClips++; | - |
1129 | | - |
1130 | if ((totalClips % 5000) == 0) { | - |
1131 | printf("Clipping ratio: rectangular=%f%%, region=%f%%, complex=%f%%\n", | - |
1132 | rectClips * 100.0 / (qreal) totalClips, | - |
1133 | regionClips * 100.0 / (qreal) totalClips, | - |
1134 | (totalClips - rectClips - regionClips) * 100.0 / (qreal) totalClips); | - |
1135 | totalClips = 0; | - |
1136 | rectClips = 0; | - |
1137 | regionClips = 0; | - |
1138 | } | - |
1139 | | - |
1140 | } | - |
1141 | #endif | - |
1142 | | - |
1143 | static void qrasterpaintengine_state_setNoClip(QRasterPaintEngineState *s) | - |
1144 | { | - |
1145 | if (s->flags.has_clip_ownership) never evaluated: s->flags.has_clip_ownership | 0 |
1146 | delete s->clip; never executed: delete s->clip; | 0 |
1147 | s->clip = 0; never executed (the execution status of this line is deduced): s->clip = 0; | - |
1148 | s->flags.has_clip_ownership = false; never executed (the execution status of this line is deduced): s->flags.has_clip_ownership = false; | - |
1149 | } | 0 |
1150 | | - |
1151 | static void qrasterpaintengine_dirty_clip(QRasterPaintEnginePrivate *d, QRasterPaintEngineState *s) | - |
1152 | { | - |
1153 | s->fillFlags |= QPaintEngine::DirtyClipPath; executed (the execution status of this line is deduced): s->fillFlags |= QPaintEngine::DirtyClipPath; | - |
1154 | s->strokeFlags |= QPaintEngine::DirtyClipPath; executed (the execution status of this line is deduced): s->strokeFlags |= QPaintEngine::DirtyClipPath; | - |
1155 | s->pixmapFlags |= QPaintEngine::DirtyClipPath; executed (the execution status of this line is deduced): s->pixmapFlags |= QPaintEngine::DirtyClipPath; | - |
1156 | | - |
1157 | d->solid_color_filler.clip = d->clip(); executed (the execution status of this line is deduced): d->solid_color_filler.clip = d->clip(); | - |
1158 | d->solid_color_filler.adjustSpanMethods(); executed (the execution status of this line is deduced): d->solid_color_filler.adjustSpanMethods(); | - |
1159 | | - |
1160 | #ifdef QT_DEBUG_DRAW | - |
1161 | dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), &*d->clip()); | - |
1162 | #endif | - |
1163 | | - |
1164 | } executed: } Execution Count:19154 | 19154 |
1165 | | - |
1166 | | - |
1167 | /*! | - |
1168 | \internal | - |
1169 | */ | - |
1170 | void QRasterPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) | - |
1171 | { | - |
1172 | #ifdef QT_DEBUG_DRAW | - |
1173 | qDebug() << "QRasterPaintEngine::clip(): " << path << op; | - |
1174 | | - |
1175 | if (path.elements()) { | - |
1176 | for (int i=0; i<path.elementCount(); ++i) { | - |
1177 | qDebug() << " - " << path.elements()[i] | - |
1178 | << '(' << path.points()[i*2] << ", " << path.points()[i*2+1] << ')'; | - |
1179 | } | - |
1180 | } else { | - |
1181 | for (int i=0; i<path.elementCount(); ++i) { | - |
1182 | qDebug() << " ---- " | - |
1183 | << '(' << path.points()[i*2] << ", " << path.points()[i*2+1] << ')'; | - |
1184 | } | - |
1185 | } | - |
1186 | #endif | - |
1187 | | - |
1188 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
1189 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
1190 | | - |
1191 | const qreal *points = path.points(); executed (the execution status of this line is deduced): const qreal *points = path.points(); | - |
1192 | const QPainterPath::ElementType *types = path.elements(); executed (the execution status of this line is deduced): const QPainterPath::ElementType *types = path.elements(); | - |
1193 | | - |
1194 | // There are some cases that are not supported by clip(QRect) | - |
1195 | if (op != Qt::IntersectClip || !s->clip || s->clip->hasRectClip || s->clip->hasRegionClip) { evaluated: op != Qt::IntersectClip yes Evaluation Count:243 | yes Evaluation Count:533 |
evaluated: !s->clip yes Evaluation Count:70 | yes Evaluation Count:463 |
evaluated: s->clip->hasRectClip yes Evaluation Count:80 | yes Evaluation Count:383 |
evaluated: s->clip->hasRegionClip yes Evaluation Count:8 | yes Evaluation Count:375 |
| 8-533 |
1196 | if (s->matrix.type() <= QTransform::TxScale evaluated: s->matrix.type() <= QTransform::TxScale yes Evaluation Count:382 | yes Evaluation Count:19 |
| 19-382 |
1197 | && ((path.shape() == QVectorPath::RectangleHint) evaluated: (path.shape() == QVectorPath::RectangleHint) yes Evaluation Count:100 | yes Evaluation Count:282 |
| 100-282 |
1198 | || (isRect(points, path.elementCount()) evaluated: isRect(points, path.elementCount()) yes Evaluation Count:210 | yes Evaluation Count:72 |
| 72-210 |
1199 | && (!types || (types[0] == QPainterPath::MoveToElement partially evaluated: !types no Evaluation Count:0 | yes Evaluation Count:210 |
partially evaluated: types[0] == QPainterPath::MoveToElement yes Evaluation Count:210 | no Evaluation Count:0 |
| 0-210 |
1200 | && types[1] == QPainterPath::LineToElement partially evaluated: types[1] == QPainterPath::LineToElement yes Evaluation Count:210 | no Evaluation Count:0 |
| 0-210 |
1201 | && types[2] == QPainterPath::LineToElement partially evaluated: types[2] == QPainterPath::LineToElement yes Evaluation Count:210 | no Evaluation Count:0 |
| 0-210 |
1202 | && types[3] == QPainterPath::LineToElement))))) { partially evaluated: types[3] == QPainterPath::LineToElement yes Evaluation Count:210 | no Evaluation Count:0 |
| 0-210 |
1203 | #ifdef QT_DEBUG_DRAW | - |
1204 | qDebug() << " --- optimizing vector clip to rect clip..."; | - |
1205 | #endif | - |
1206 | | - |
1207 | 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]); | - |
1208 | if (setClipRectInDeviceCoords(s->matrix.mapRect(r).toRect(), op)) partially evaluated: setClipRectInDeviceCoords(s->matrix.mapRect(r).toRect(), op) yes Evaluation Count:310 | no Evaluation Count:0 |
| 0-310 |
1209 | return; executed: return; Execution Count:310 | 310 |
1210 | } | 0 |
1211 | } executed: } Execution Count:91 | 91 |
1212 | | - |
1213 | if (op == Qt::NoClip) { partially evaluated: op == Qt::NoClip no Evaluation Count:0 | yes Evaluation Count:466 |
| 0-466 |
1214 | qrasterpaintengine_state_setNoClip(s); never executed (the execution status of this line is deduced): qrasterpaintengine_state_setNoClip(s); | - |
1215 | | - |
1216 | } else { | 0 |
1217 | QClipData *base = d->baseClip.data(); executed (the execution status of this line is deduced): QClipData *base = d->baseClip.data(); | - |
1218 | | - |
1219 | // Intersect with current clip when available... | - |
1220 | if (op == Qt::IntersectClip && s->clip) evaluated: op == Qt::IntersectClip yes Evaluation Count:423 | yes Evaluation Count:43 |
evaluated: s->clip yes Evaluation Count:421 | yes Evaluation Count:2 |
| 2-423 |
1221 | base = s->clip; executed: base = s->clip; Execution Count:421 | 421 |
1222 | | - |
1223 | // We always intersect, except when there is nothing to | - |
1224 | // intersect with, in which case we simplify the operation to | - |
1225 | // a replace... | - |
1226 | Qt::ClipOperation isectOp = Qt::IntersectClip; executed (the execution status of this line is deduced): Qt::ClipOperation isectOp = Qt::IntersectClip; | - |
1227 | if (base == 0) partially evaluated: base == 0 no Evaluation Count:0 | yes Evaluation Count:466 |
| 0-466 |
1228 | isectOp = Qt::ReplaceClip; never executed: isectOp = Qt::ReplaceClip; | 0 |
1229 | | - |
1230 | QClipData *newClip = new QClipData(d->rasterBuffer->height()); executed (the execution status of this line is deduced): QClipData *newClip = new QClipData(d->rasterBuffer->height()); | - |
1231 | newClip->initialize(); executed (the execution status of this line is deduced): newClip->initialize(); | - |
1232 | ClipData clipData = { base, newClip, isectOp }; executed (the execution status of this line is deduced): ClipData clipData = { base, newClip, isectOp }; | - |
1233 | ensureOutlineMapper(); executed (the execution status of this line is deduced): ensureOutlineMapper(); | - |
1234 | 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); | - |
1235 | | - |
1236 | newClip->fixup(); executed (the execution status of this line is deduced): newClip->fixup(); | - |
1237 | | - |
1238 | if (s->flags.has_clip_ownership) evaluated: s->flags.has_clip_ownership yes Evaluation Count:384 | yes Evaluation Count:82 |
| 82-384 |
1239 | delete s->clip; executed: delete s->clip; Execution Count:384 | 384 |
1240 | | - |
1241 | s->clip = newClip; executed (the execution status of this line is deduced): s->clip = newClip; | - |
1242 | s->flags.has_clip_ownership = true; executed (the execution status of this line is deduced): s->flags.has_clip_ownership = true; | - |
1243 | } executed: } Execution Count:466 | 466 |
1244 | qrasterpaintengine_dirty_clip(d, s); executed (the execution status of this line is deduced): qrasterpaintengine_dirty_clip(d, s); | - |
1245 | } executed: } Execution Count:466 | 466 |
1246 | | - |
1247 | | - |
1248 | | - |
1249 | /*! | - |
1250 | \internal | - |
1251 | */ | - |
1252 | void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) | - |
1253 | { | - |
1254 | #ifdef QT_DEBUG_DRAW | - |
1255 | qDebug() << "QRasterPaintEngine::clip(): " << rect << op; | - |
1256 | #endif | - |
1257 | | - |
1258 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
1259 | | - |
1260 | if (op == Qt::NoClip) { partially evaluated: op == Qt::NoClip no Evaluation Count:0 | yes Evaluation Count:17512 |
| 0-17512 |
1261 | qrasterpaintengine_state_setNoClip(s); never executed (the execution status of this line is deduced): qrasterpaintengine_state_setNoClip(s); | - |
1262 | | - |
1263 | } else if (s->matrix.type() > QTransform::TxScale) { never executed: } evaluated: s->matrix.type() > QTransform::TxScale yes Evaluation Count:359 | yes Evaluation Count:17153 |
| 0-17153 |
1264 | QPaintEngineEx::clip(rect, op); executed (the execution status of this line is deduced): QPaintEngineEx::clip(rect, op); | - |
1265 | return; executed: return; Execution Count:359 | 359 |
1266 | | - |
1267 | } else if (!setClipRectInDeviceCoords(s->matrix.mapRect(rect), op)) { evaluated: !setClipRectInDeviceCoords(s->matrix.mapRect(rect), op) yes Evaluation Count:2 | yes Evaluation Count:17151 |
| 2-17151 |
1268 | QPaintEngineEx::clip(rect, op); executed (the execution status of this line is deduced): QPaintEngineEx::clip(rect, op); | - |
1269 | return; executed: return; Execution Count:2 | 2 |
1270 | } | - |
1271 | } | - |
1272 | | - |
1273 | | - |
1274 | bool QRasterPaintEngine::setClipRectInDeviceCoords(const QRect &r, Qt::ClipOperation op) | - |
1275 | { | - |
1276 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
1277 | QRect clipRect = r & d->deviceRect; executed (the execution status of this line is deduced): QRect clipRect = r & d->deviceRect; | - |
1278 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
1279 | | - |
1280 | if (op == Qt::ReplaceClip || s->clip == 0) { evaluated: op == Qt::ReplaceClip yes Evaluation Count:17346 | yes Evaluation Count:117 |
evaluated: s->clip == 0 yes Evaluation Count:68 | yes Evaluation Count:49 |
| 49-17346 |
1281 | | - |
1282 | // No current clip, hence we intersect with sysclip and be | - |
1283 | // done with it... | - |
1284 | QRegion clipRegion = systemClip(); executed (the execution status of this line is deduced): QRegion clipRegion = systemClip(); | - |
1285 | QClipData *clip = new QClipData(d->rasterBuffer->height()); executed (the execution status of this line is deduced): QClipData *clip = new QClipData(d->rasterBuffer->height()); | - |
1286 | | - |
1287 | if (clipRegion.isEmpty()) evaluated: clipRegion.isEmpty() yes Evaluation Count:1320 | yes Evaluation Count:16094 |
| 1320-16094 |
1288 | clip->setClipRect(clipRect); executed: clip->setClipRect(clipRect); Execution Count:1320 | 1320 |
1289 | else | - |
1290 | clip->setClipRegion(clipRegion & clipRect); executed: clip->setClipRegion(clipRegion & clipRect); Execution Count:16094 | 16094 |
1291 | | - |
1292 | if (s->flags.has_clip_ownership) evaluated: s->flags.has_clip_ownership yes Evaluation Count:55 | yes Evaluation Count:17359 |
| 55-17359 |
1293 | delete s->clip; executed: delete s->clip; Execution Count:55 | 55 |
1294 | | - |
1295 | s->clip = clip; executed (the execution status of this line is deduced): s->clip = clip; | - |
1296 | s->clip->enabled = true; executed (the execution status of this line is deduced): s->clip->enabled = true; | - |
1297 | s->flags.has_clip_ownership = true; executed (the execution status of this line is deduced): s->flags.has_clip_ownership = true; | - |
1298 | | - |
1299 | } else if (op == Qt::IntersectClip){ // intersect clip with current clip executed: } Execution Count:17414 partially evaluated: op == Qt::IntersectClip yes Evaluation Count:49 | no Evaluation Count:0 |
| 0-17414 |
1300 | QClipData *base = s->clip; executed (the execution status of this line is deduced): QClipData *base = s->clip; | - |
1301 | | - |
1302 | Q_ASSERT(base); executed (the execution status of this line is deduced): qt_noop(); | - |
1303 | if (base->hasRectClip || base->hasRegionClip) { evaluated: base->hasRectClip yes Evaluation Count:47 | yes Evaluation Count:2 |
partially evaluated: base->hasRegionClip no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-47 |
1304 | if (!s->flags.has_clip_ownership) { evaluated: !s->flags.has_clip_ownership yes Evaluation Count:38 | yes Evaluation Count:9 |
| 9-38 |
1305 | s->clip = new QClipData(d->rasterBuffer->height()); executed (the execution status of this line is deduced): s->clip = new QClipData(d->rasterBuffer->height()); | - |
1306 | s->flags.has_clip_ownership = true; executed (the execution status of this line is deduced): s->flags.has_clip_ownership = true; | - |
1307 | } executed: } Execution Count:38 | 38 |
1308 | if (base->hasRectClip) partially evaluated: base->hasRectClip yes Evaluation Count:47 | no Evaluation Count:0 |
| 0-47 |
1309 | s->clip->setClipRect(base->clipRect & clipRect); executed: s->clip->setClipRect(base->clipRect & clipRect); Execution Count:47 | 47 |
1310 | else | - |
1311 | s->clip->setClipRegion(base->clipRegion & clipRect); never executed: s->clip->setClipRegion(base->clipRegion & clipRect); | 0 |
1312 | s->clip->enabled = true; executed (the execution status of this line is deduced): s->clip->enabled = true; | - |
1313 | } else { executed: } Execution Count:47 | 47 |
1314 | return false; executed: return false; Execution Count:2 | 2 |
1315 | } | - |
1316 | } else { | - |
1317 | return false; never executed: return false; | 0 |
1318 | } | - |
1319 | | - |
1320 | qrasterpaintengine_dirty_clip(d, s); executed (the execution status of this line is deduced): qrasterpaintengine_dirty_clip(d, s); | - |
1321 | return true; executed: return true; Execution Count:17461 | 17461 |
1322 | } | - |
1323 | | - |
1324 | | - |
1325 | /*! | - |
1326 | \internal | - |
1327 | */ | - |
1328 | void QRasterPaintEngine::clip(const QRegion ®ion, Qt::ClipOperation op) | - |
1329 | { | - |
1330 | #ifdef QT_DEBUG_DRAW | - |
1331 | qDebug() << "QRasterPaintEngine::clip(): " << region << op; | - |
1332 | #endif | - |
1333 | | - |
1334 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
1335 | | - |
1336 | if (region.rectCount() == 1) { evaluated: region.rectCount() == 1 yes Evaluation Count:94 | yes Evaluation Count:1243 |
| 94-1243 |
1337 | clip(region.boundingRect(), op); executed (the execution status of this line is deduced): clip(region.boundingRect(), op); | - |
1338 | return; executed: return; Execution Count:94 | 94 |
1339 | } | - |
1340 | | - |
1341 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
1342 | const QClipData *clip = d->clip(); executed (the execution status of this line is deduced): const QClipData *clip = d->clip(); | - |
1343 | const QClipData *baseClip = d->baseClip.data(); executed (the execution status of this line is deduced): const QClipData *baseClip = d->baseClip.data(); | - |
1344 | | - |
1345 | if (op == Qt::NoClip) { partially evaluated: op == Qt::NoClip no Evaluation Count:0 | yes Evaluation Count:1243 |
| 0-1243 |
1346 | qrasterpaintengine_state_setNoClip(s); never executed (the execution status of this line is deduced): qrasterpaintengine_state_setNoClip(s); | - |
1347 | } else if (s->matrix.type() > QTransform::TxScale never executed: } evaluated: s->matrix.type() > QTransform::TxScale yes Evaluation Count:8 | yes Evaluation Count:1235 |
| 0-1235 |
1348 | || (op == Qt::IntersectClip && !clip->hasRectClip && !clip->hasRegionClip) evaluated: op == Qt::IntersectClip yes Evaluation Count:16 | yes Evaluation Count:1219 |
partially evaluated: !clip->hasRectClip yes Evaluation Count:16 | no Evaluation Count:0 |
evaluated: !clip->hasRegionClip yes Evaluation Count:8 | yes Evaluation Count:8 |
| 0-1219 |
1349 | || (op == Qt::ReplaceClip && !baseClip->hasRectClip && !baseClip->hasRegionClip)) { evaluated: op == Qt::ReplaceClip yes Evaluation Count:1219 | yes Evaluation Count:8 |
evaluated: !baseClip->hasRectClip yes Evaluation Count:10 | yes Evaluation Count:1209 |
partially evaluated: !baseClip->hasRegionClip no Evaluation Count:0 | yes Evaluation Count:10 |
| 0-1219 |
1350 | QPaintEngineEx::clip(region, op); executed (the execution status of this line is deduced): QPaintEngineEx::clip(region, op); | - |
1351 | } else { executed: } Execution Count:16 | 16 |
1352 | const QClipData *curClip; executed (the execution status of this line is deduced): const QClipData *curClip; | - |
1353 | QClipData *newClip; executed (the execution status of this line is deduced): QClipData *newClip; | - |
1354 | | - |
1355 | if (op == Qt::IntersectClip) evaluated: op == Qt::IntersectClip yes Evaluation Count:8 | yes Evaluation Count:1219 |
| 8-1219 |
1356 | curClip = clip; executed: curClip = clip; Execution Count:8 | 8 |
1357 | else | - |
1358 | curClip = baseClip; executed: curClip = baseClip; Execution Count:1219 | 1219 |
1359 | | - |
1360 | if (s->flags.has_clip_ownership) { evaluated: s->flags.has_clip_ownership yes Evaluation Count:1162 | yes Evaluation Count:65 |
| 65-1162 |
1361 | newClip = s->clip; executed (the execution status of this line is deduced): newClip = s->clip; | - |
1362 | Q_ASSERT(newClip); executed (the execution status of this line is deduced): qt_noop(); | - |
1363 | } else { executed: } Execution Count:1162 | 1162 |
1364 | newClip = new QClipData(d->rasterBuffer->height()); executed (the execution status of this line is deduced): newClip = new QClipData(d->rasterBuffer->height()); | - |
1365 | s->clip = newClip; executed (the execution status of this line is deduced): s->clip = newClip; | - |
1366 | s->flags.has_clip_ownership = true; executed (the execution status of this line is deduced): s->flags.has_clip_ownership = true; | - |
1367 | } executed: } Execution Count:65 | 65 |
1368 | | - |
1369 | QRegion r = s->matrix.map(region); executed (the execution status of this line is deduced): QRegion r = s->matrix.map(region); | - |
1370 | if (curClip->hasRectClip) evaluated: curClip->hasRectClip yes Evaluation Count:1209 | yes Evaluation Count:18 |
| 18-1209 |
1371 | newClip->setClipRegion(r & curClip->clipRect); executed: newClip->setClipRegion(r & curClip->clipRect); Execution Count:1209 | 1209 |
1372 | else if (curClip->hasRegionClip) partially evaluated: curClip->hasRegionClip yes Evaluation Count:18 | no Evaluation Count:0 |
| 0-18 |
1373 | newClip->setClipRegion(r & curClip->clipRegion); executed: newClip->setClipRegion(r & curClip->clipRegion); Execution Count:18 | 18 |
1374 | | - |
1375 | qrasterpaintengine_dirty_clip(d, s); executed (the execution status of this line is deduced): qrasterpaintengine_dirty_clip(d, s); | - |
1376 | } executed: } Execution Count:1227 | 1227 |
1377 | } | - |
1378 | | - |
1379 | /*! | - |
1380 | \fn const QClipData *QRasterPaintEngine::clipData() const | - |
1381 | | - |
1382 | \internal | - |
1383 | */ | - |
1384 | | - |
1385 | | - |
1386 | /*! | - |
1387 | \internal | - |
1388 | */ | - |
1389 | void QRasterPaintEngine::fillPath(const QPainterPath &path, QSpanData *fillData) | - |
1390 | { | - |
1391 | #ifdef QT_DEBUG_DRAW | - |
1392 | qDebug() << " --- fillPath, bounds=" << path.boundingRect(); | - |
1393 | #endif | - |
1394 | | - |
1395 | if (!fillData->blend) partially evaluated: !fillData->blend no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
1396 | return; | 0 |
1397 | | - |
1398 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
1399 | | - |
1400 | const QRectF controlPointRect = path.controlPointRect(); executed (the execution status of this line is deduced): const QRectF controlPointRect = path.controlPointRect(); | - |
1401 | | - |
1402 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
1403 | 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(); | - |
1404 | ProcessSpans blend = d->getBrushFunc(deviceRect, fillData); executed (the execution status of this line is deduced): ProcessSpans blend = d->getBrushFunc(deviceRect, fillData); | - |
1405 | const bool do_clip = (deviceRect.left() < -QT_RASTER_COORD_LIMIT partially evaluated: deviceRect.left() < -QT_RASTER_COORD_LIMIT no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
1406 | || deviceRect.right() > QT_RASTER_COORD_LIMIT partially evaluated: deviceRect.right() > QT_RASTER_COORD_LIMIT no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
1407 | || deviceRect.top() < -QT_RASTER_COORD_LIMIT partially evaluated: deviceRect.top() < -QT_RASTER_COORD_LIMIT no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
1408 | || deviceRect.bottom() > QT_RASTER_COORD_LIMIT); partially evaluated: deviceRect.bottom() > QT_RASTER_COORD_LIMIT no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
1409 | | - |
1410 | if (!s->flags.antialiased && !do_clip) { partially evaluated: !s->flags.antialiased no Evaluation Count:0 | yes Evaluation Count:4 |
never evaluated: !do_clip | 0-4 |
1411 | d->initializeRasterizer(fillData); never executed (the execution status of this line is deduced): d->initializeRasterizer(fillData); | - |
1412 | d->rasterizer->rasterize(path * s->matrix, path.fillRule()); never executed (the execution status of this line is deduced): d->rasterizer->rasterize(path * s->matrix, path.fillRule()); | - |
1413 | return; | 0 |
1414 | } | - |
1415 | | - |
1416 | ensureOutlineMapper(); executed (the execution status of this line is deduced): ensureOutlineMapper(); | - |
1417 | 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()); | - |
1418 | } executed: } Execution Count:4 | 4 |
1419 | | - |
1420 | static void fillRect_normalized(const QRect &r, QSpanData *data, | - |
1421 | QRasterPaintEnginePrivate *pe) | - |
1422 | { | - |
1423 | int x1, x2, y1, y2; never executed (the execution status of this line is deduced): int x1, x2, y1, y2; | - |
1424 | | - |
1425 | bool rectClipped = true; never executed (the execution status of this line is deduced): bool rectClipped = true; | - |
1426 | | - |
1427 | if (data->clip) { partially evaluated: data->clip yes Evaluation Count:51301 | no Evaluation Count:0 |
| 0-51301 |
1428 | x1 = qMax(r.x(), data->clip->xmin); executed (the execution status of this line is deduced): x1 = qMax(r.x(), data->clip->xmin); | - |
1429 | 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); | - |
1430 | y1 = qMax(r.y(), data->clip->ymin); executed (the execution status of this line is deduced): y1 = qMax(r.y(), data->clip->ymin); | - |
1431 | 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); | - |
1432 | rectClipped = data->clip->hasRectClip; executed (the execution status of this line is deduced): rectClipped = data->clip->hasRectClip; | - |
1433 | | - |
1434 | } else if (pe) { executed: } Execution Count:51300 never evaluated: pe | 0-51300 |
1435 | x1 = qMax(r.x(), pe->deviceRect.x()); never executed (the execution status of this line is deduced): x1 = qMax(r.x(), pe->deviceRect.x()); | - |
1436 | 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()); | - |
1437 | y1 = qMax(r.y(), pe->deviceRect.y()); never executed (the execution status of this line is deduced): y1 = qMax(r.y(), pe->deviceRect.y()); | - |
1438 | 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()); | - |
1439 | } else { | 0 |
1440 | x1 = qMax(r.x(), 0); never executed (the execution status of this line is deduced): x1 = qMax(r.x(), 0); | - |
1441 | 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()); | - |
1442 | y1 = qMax(r.y(), 0); never executed (the execution status of this line is deduced): y1 = qMax(r.y(), 0); | - |
1443 | 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()); | - |
1444 | } | 0 |
1445 | | - |
1446 | if (x2 <= x1 || y2 <= y1) evaluated: x2 <= x1 yes Evaluation Count:358 | yes Evaluation Count:50941 |
evaluated: y2 <= y1 yes Evaluation Count:343 | yes Evaluation Count:50597 |
| 343-50941 |
1447 | return; executed: return; Execution Count:701 | 701 |
1448 | | - |
1449 | const int width = x2 - x1; executed (the execution status of this line is deduced): const int width = x2 - x1; | - |
1450 | const int height = y2 - y1; executed (the execution status of this line is deduced): const int height = y2 - y1; | - |
1451 | | - |
1452 | bool isUnclipped = rectClipped evaluated: rectClipped yes Evaluation Count:49671 | yes Evaluation Count:935 |
| 935-49671 |
1453 | || (pe && pe->isUnclipped_normalized(QRect(x1, y1, width, height))); partially evaluated: pe yes Evaluation Count:935 | no Evaluation Count:0 |
evaluated: pe->isUnclipped_normalized(QRect(x1, y1, width, height)) yes Evaluation Count:367 | yes Evaluation Count:568 |
| 0-935 |
1454 | | - |
1455 | if (pe && isUnclipped) { partially evaluated: pe yes Evaluation Count:50611 | no Evaluation Count:0 |
evaluated: isUnclipped yes Evaluation Count:50047 | yes Evaluation Count:568 |
| 0-50611 |
1456 | const QPainter::CompositionMode mode = pe->rasterBuffer->compositionMode; executed (the execution status of this line is deduced): const QPainter::CompositionMode mode = pe->rasterBuffer->compositionMode; | - |
1457 | | - |
1458 | if (data->fillRect && (mode == QPainter::CompositionMode_Source evaluated: data->fillRect yes Evaluation Count:19627 | yes Evaluation Count:30422 |
evaluated: mode == QPainter::CompositionMode_Source yes Evaluation Count:4603 | yes Evaluation Count:15024 |
| 4603-30422 |
1459 | || (mode == QPainter::CompositionMode_SourceOver evaluated: mode == QPainter::CompositionMode_SourceOver yes Evaluation Count:14919 | yes Evaluation Count:105 |
| 105-14919 |
1460 | && qAlpha(data->solid.color) == 255))) evaluated: qAlpha(data->solid.color) == 255 yes Evaluation Count:14896 | yes Evaluation Count:23 |
| 23-14896 |
1461 | { | - |
1462 | 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, | - |
1463 | data->solid.color); executed (the execution status of this line is deduced): data->solid.color); | - |
1464 | return; executed: return; Execution Count:19499 | 19499 |
1465 | } | - |
1466 | } executed: } Execution Count:30542 | 30542 |
1467 | | - |
1468 | ProcessSpans blend = isUnclipped ? data->unclipped_blend : data->blend; evaluated: isUnclipped yes Evaluation Count:30542 | yes Evaluation Count:568 |
| 568-30542 |
1469 | | - |
1470 | const int nspans = 256; executed (the execution status of this line is deduced): const int nspans = 256; | - |
1471 | QT_FT_Span spans[nspans]; executed (the execution status of this line is deduced): QT_FT_Span spans[nspans]; | - |
1472 | | - |
1473 | Q_ASSERT(data->blend); executed (the execution status of this line is deduced): qt_noop(); | - |
1474 | int y = y1; executed (the execution status of this line is deduced): int y = y1; | - |
1475 | while (y < y2) { evaluated: y < y2 yes Evaluation Count:31145 | yes Evaluation Count:31037 |
| 31037-31145 |
1476 | int n = qMin(nspans, y2 - y); executed (the execution status of this line is deduced): int n = qMin(nspans, y2 - y); | - |
1477 | int i = 0; executed (the execution status of this line is deduced): int i = 0; | - |
1478 | while (i < n) { evaluated: i < n yes Evaluation Count:380262 | yes Evaluation Count:31152 |
| 31152-380262 |
1479 | spans[i].x = x1; executed (the execution status of this line is deduced): spans[i].x = x1; | - |
1480 | spans[i].len = width; executed (the execution status of this line is deduced): spans[i].len = width; | - |
1481 | spans[i].y = y + i; executed (the execution status of this line is deduced): spans[i].y = y + i; | - |
1482 | spans[i].coverage = 255; executed (the execution status of this line is deduced): spans[i].coverage = 255; | - |
1483 | ++i; executed (the execution status of this line is deduced): ++i; | - |
1484 | } executed: } Execution Count:380257 | 380257 |
1485 | | - |
1486 | blend(n, spans, data); executed (the execution status of this line is deduced): blend(n, spans, data); | - |
1487 | y += n; executed (the execution status of this line is deduced): y += n; | - |
1488 | } executed: } Execution Count:31072 | 31072 |
1489 | } executed: } Execution Count:31049 | 31049 |
1490 | | - |
1491 | /*! | - |
1492 | \reimp | - |
1493 | */ | - |
1494 | void QRasterPaintEngine::drawRects(const QRect *rects, int rectCount) | - |
1495 | { | - |
1496 | #ifdef QT_DEBUG_DRAW | - |
1497 | qDebug(" - QRasterPaintEngine::drawRect(), rectCount=%d", rectCount); | - |
1498 | #endif | - |
1499 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
1500 | ensureRasterState(); executed (the execution status of this line is deduced): ensureRasterState(); | - |
1501 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
1502 | | - |
1503 | // Fill | - |
1504 | ensureBrush(); executed (the execution status of this line is deduced): ensureBrush(); | - |
1505 | if (s->brushData.blend) { evaluated: s->brushData.blend yes Evaluation Count:4698 | yes Evaluation Count:1440 |
| 1440-4698 |
1506 | if (!s->flags.antialiased && s->matrix.type() <= QTransform::TxTranslate) { evaluated: !s->flags.antialiased yes Evaluation Count:4692 | yes Evaluation Count:6 |
evaluated: s->matrix.type() <= QTransform::TxTranslate yes Evaluation Count:4689 | yes Evaluation Count:3 |
| 3-4692 |
1507 | const QRect *r = rects; executed (the execution status of this line is deduced): const QRect *r = rects; | - |
1508 | const QRect *lastRect = rects + rectCount; executed (the execution status of this line is deduced): const QRect *lastRect = rects + rectCount; | - |
1509 | | - |
1510 | int offset_x = int(s->matrix.dx()); executed (the execution status of this line is deduced): int offset_x = int(s->matrix.dx()); | - |
1511 | int offset_y = int(s->matrix.dy()); executed (the execution status of this line is deduced): int offset_y = int(s->matrix.dy()); | - |
1512 | while (r < lastRect) { evaluated: r < lastRect yes Evaluation Count:4689 | yes Evaluation Count:4689 |
| 4689 |
1513 | QRect rect = r->normalized(); executed (the execution status of this line is deduced): QRect rect = r->normalized(); | - |
1514 | 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); | - |
1515 | fillRect_normalized(rr, &s->brushData, d); executed (the execution status of this line is deduced): fillRect_normalized(rr, &s->brushData, d); | - |
1516 | ++r; executed (the execution status of this line is deduced): ++r; | - |
1517 | } executed: } Execution Count:4689 | 4689 |
1518 | } else { executed: } Execution Count:4689 | 4689 |
1519 | QRectVectorPath path; executed (the execution status of this line is deduced): QRectVectorPath path; | - |
1520 | for (int i=0; i<rectCount; ++i) { evaluated: i<rectCount yes Evaluation Count:9 | yes Evaluation Count:9 |
| 9 |
1521 | path.set(rects[i]); executed (the execution status of this line is deduced): path.set(rects[i]); | - |
1522 | fill(path, s->brush); executed (the execution status of this line is deduced): fill(path, s->brush); | - |
1523 | } executed: } Execution Count:9 | 9 |
1524 | } executed: } Execution Count:9 | 9 |
1525 | } | - |
1526 | | - |
1527 | ensurePen(); executed (the execution status of this line is deduced): ensurePen(); | - |
1528 | if (s->penData.blend) { evaluated: s->penData.blend yes Evaluation Count:1519 | yes Evaluation Count:4619 |
| 1519-4619 |
1529 | QRectVectorPath path; executed (the execution status of this line is deduced): QRectVectorPath path; | - |
1530 | if (s->flags.fast_pen) { evaluated: s->flags.fast_pen yes Evaluation Count:1513 | yes Evaluation Count:6 |
| 6-1513 |
1531 | QCosmeticStroker stroker(s, d->deviceRect); executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect); | - |
1532 | stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); | - |
1533 | for (int i = 0; i < rectCount; ++i) { evaluated: i < rectCount yes Evaluation Count:1513 | yes Evaluation Count:1513 |
| 1513 |
1534 | path.set(rects[i]); executed (the execution status of this line is deduced): path.set(rects[i]); | - |
1535 | stroker.drawPath(path); executed (the execution status of this line is deduced): stroker.drawPath(path); | - |
1536 | } executed: } Execution Count:1513 | 1513 |
1537 | } else { executed: } Execution Count:1513 | 1513 |
1538 | for (int i = 0; i < rectCount; ++i) { evaluated: i < rectCount yes Evaluation Count:6 | yes Evaluation Count:6 |
| 6 |
1539 | path.set(rects[i]); executed (the execution status of this line is deduced): path.set(rects[i]); | - |
1540 | stroke(path, s->pen); executed (the execution status of this line is deduced): stroke(path, s->pen); | - |
1541 | } executed: } Execution Count:6 | 6 |
1542 | } executed: } Execution Count:6 | 6 |
1543 | } | - |
1544 | } executed: } Execution Count:6138 | 6138 |
1545 | | - |
1546 | /*! | - |
1547 | \reimp | - |
1548 | */ | - |
1549 | void QRasterPaintEngine::drawRects(const QRectF *rects, int rectCount) | - |
1550 | { | - |
1551 | #ifdef QT_DEBUG_DRAW | - |
1552 | qDebug(" - QRasterPaintEngine::drawRect(QRectF*), rectCount=%d", rectCount); | - |
1553 | #endif | - |
1554 | #ifdef QT_FAST_SPANS | - |
1555 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
1556 | ensureRasterState(); executed (the execution status of this line is deduced): ensureRasterState(); | - |
1557 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
1558 | | - |
1559 | | - |
1560 | if (s->flags.tx_noshear) { partially evaluated: s->flags.tx_noshear yes Evaluation Count:167 | no Evaluation Count:0 |
| 0-167 |
1561 | ensureBrush(); executed (the execution status of this line is deduced): ensureBrush(); | - |
1562 | if (s->brushData.blend) { evaluated: s->brushData.blend yes Evaluation Count:50 | yes Evaluation Count:117 |
| 50-117 |
1563 | d->initializeRasterizer(&s->brushData); executed (the execution status of this line is deduced): d->initializeRasterizer(&s->brushData); | - |
1564 | for (int i = 0; i < rectCount; ++i) { evaluated: i < rectCount yes Evaluation Count:50 | yes Evaluation Count:50 |
| 50 |
1565 | const QRectF &rect = rects[i].normalized(); executed (the execution status of this line is deduced): const QRectF &rect = rects[i].normalized(); | - |
1566 | if (rect.isEmpty()) evaluated: rect.isEmpty() yes Evaluation Count:2 | yes Evaluation Count:48 |
| 2-48 |
1567 | continue; executed: continue; Execution Count:2 | 2 |
1568 | 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); | - |
1569 | 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); | - |
1570 | 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()); | - |
1571 | } executed: } Execution Count:48 | 48 |
1572 | } executed: } Execution Count:50 | 50 |
1573 | | - |
1574 | ensurePen(); executed (the execution status of this line is deduced): ensurePen(); | - |
1575 | if (s->penData.blend) { evaluated: s->penData.blend yes Evaluation Count:127 | yes Evaluation Count:40 |
| 40-127 |
1576 | QRectVectorPath path; executed (the execution status of this line is deduced): QRectVectorPath path; | - |
1577 | if (s->flags.fast_pen) { evaluated: s->flags.fast_pen yes Evaluation Count:123 | yes Evaluation Count:4 |
| 4-123 |
1578 | QCosmeticStroker stroker(s, d->deviceRect); executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect); | - |
1579 | stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); | - |
1580 | for (int i = 0; i < rectCount; ++i) { evaluated: i < rectCount yes Evaluation Count:123 | yes Evaluation Count:123 |
| 123 |
1581 | path.set(rects[i]); executed (the execution status of this line is deduced): path.set(rects[i]); | - |
1582 | stroker.drawPath(path); executed (the execution status of this line is deduced): stroker.drawPath(path); | - |
1583 | } executed: } Execution Count:123 | 123 |
1584 | } else { executed: } Execution Count:123 | 123 |
1585 | for (int i = 0; i < rectCount; ++i) { evaluated: i < rectCount yes Evaluation Count:4 | yes Evaluation Count:4 |
| 4 |
1586 | path.set(rects[i]); executed (the execution status of this line is deduced): path.set(rects[i]); | - |
1587 | QPaintEngineEx::stroke(path, s->lastPen); executed (the execution status of this line is deduced): QPaintEngineEx::stroke(path, s->lastPen); | - |
1588 | } executed: } Execution Count:4 | 4 |
1589 | } executed: } Execution Count:4 | 4 |
1590 | } | - |
1591 | | - |
1592 | return; executed: return; Execution Count:167 | 167 |
1593 | } | - |
1594 | #endif // QT_FAST_SPANS | - |
1595 | QPaintEngineEx::drawRects(rects, rectCount); never executed (the execution status of this line is deduced): QPaintEngineEx::drawRects(rects, rectCount); | - |
1596 | } | 0 |
1597 | | - |
1598 | | - |
1599 | /*! | - |
1600 | \internal | - |
1601 | */ | - |
1602 | void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen) | - |
1603 | { | - |
1604 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
1605 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
1606 | | - |
1607 | ensurePen(pen); executed (the execution status of this line is deduced): ensurePen(pen); | - |
1608 | if (!s->penData.blend) evaluated: !s->penData.blend yes Evaluation Count:13 | yes Evaluation Count:3056 |
| 13-3056 |
1609 | return; executed: return; Execution Count:13 | 13 |
1610 | | - |
1611 | if (s->flags.fast_pen) { evaluated: s->flags.fast_pen yes Evaluation Count:2923 | yes Evaluation Count:133 |
| 133-2923 |
1612 | QCosmeticStroker stroker(s, d->deviceRect); executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect); | - |
1613 | stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); | - |
1614 | stroker.drawPath(path); executed (the execution status of this line is deduced): stroker.drawPath(path); | - |
1615 | } else if (s->flags.non_complex_pen && path.shape() == QVectorPath::LinesHint) { executed: } Execution Count:2923 partially evaluated: s->flags.non_complex_pen yes Evaluation Count:133 | no Evaluation Count:0 |
evaluated: path.shape() == QVectorPath::LinesHint yes Evaluation Count:111 | yes Evaluation Count:22 |
| 0-2923 |
1616 | qreal width = qt_pen_is_cosmetic(s->lastPen, s->renderHints) partially evaluated: qt_pen_is_cosmetic(s->lastPen, s->renderHints) no Evaluation Count:0 | yes Evaluation Count:111 |
| 0-111 |
1617 | ? (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)) | - |
1618 | : qpen_widthf(s->lastPen) * s->txscale; executed (the execution status of this line is deduced): : qpen_widthf(s->lastPen) * s->txscale; | - |
1619 | int dashIndex = 0; executed (the execution status of this line is deduced): int dashIndex = 0; | - |
1620 | qreal dashOffset = s->lastPen.dashOffset(); executed (the execution status of this line is deduced): qreal dashOffset = s->lastPen.dashOffset(); | - |
1621 | bool inDash = true; executed (the execution status of this line is deduced): bool inDash = true; | - |
1622 | qreal patternLength = 0; executed (the execution status of this line is deduced): qreal patternLength = 0; | - |
1623 | const QVector<qreal> pattern = s->lastPen.dashPattern(); executed (the execution status of this line is deduced): const QVector<qreal> pattern = s->lastPen.dashPattern(); | - |
1624 | for (int i = 0; i < pattern.size(); ++i) evaluated: i < pattern.size() yes Evaluation Count:6 | yes Evaluation Count:111 |
| 6-111 |
1625 | patternLength += pattern.at(i); executed: patternLength += pattern.at(i); Execution Count:6 | 6 |
1626 | | - |
1627 | if (patternLength > 0) { evaluated: patternLength > 0 yes Evaluation Count:1 | yes Evaluation Count:110 |
| 1-110 |
1628 | int n = qFloor(dashOffset / patternLength); executed (the execution status of this line is deduced): int n = qFloor(dashOffset / patternLength); | - |
1629 | dashOffset -= n * patternLength; executed (the execution status of this line is deduced): dashOffset -= n * patternLength; | - |
1630 | while (dashOffset >= pattern.at(dashIndex)) { partially evaluated: dashOffset >= pattern.at(dashIndex) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1631 | dashOffset -= pattern.at(dashIndex); never executed (the execution status of this line is deduced): dashOffset -= pattern.at(dashIndex); | - |
1632 | if (++dashIndex >= pattern.size()) never evaluated: ++dashIndex >= pattern.size() | 0 |
1633 | dashIndex = 0; never executed: dashIndex = 0; | 0 |
1634 | inDash = !inDash; never executed (the execution status of this line is deduced): inDash = !inDash; | - |
1635 | } | 0 |
1636 | } executed: } Execution Count:1 | 1 |
1637 | | - |
1638 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
1639 | d->initializeRasterizer(&s->penData); executed (the execution status of this line is deduced): d->initializeRasterizer(&s->penData); | - |
1640 | int lineCount = path.elementCount() / 2; executed (the execution status of this line is deduced): int lineCount = path.elementCount() / 2; | - |
1641 | 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()); | - |
1642 | | - |
1643 | for (int i = 0; i < lineCount; ++i) { evaluated: i < lineCount yes Evaluation Count:112 | yes Evaluation Count:111 |
| 111-112 |
1644 | if (lines[i].p1() == lines[i].p2()) { evaluated: lines[i].p1() == lines[i].p2() yes Evaluation Count:1 | yes Evaluation Count:111 |
| 1-111 |
1645 | if (s->lastPen.capStyle() != Qt::FlatCap) { partially evaluated: s->lastPen.capStyle() != Qt::FlatCap yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
1646 | QPointF p = lines[i].p1(); executed (the execution status of this line is deduced): QPointF p = lines[i].p1(); | - |
1647 | 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()), | - |
1648 | 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()))); | - |
1649 | 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); | - |
1650 | } executed: } Execution Count:1 | 1 |
1651 | continue; executed: continue; Execution Count:1 | 1 |
1652 | } | - |
1653 | | - |
1654 | 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]); | - |
1655 | if (qpen_style(s->lastPen) == Qt::SolidLine) { evaluated: qpen_style(s->lastPen) == Qt::SolidLine yes Evaluation Count:108 | yes Evaluation Count:3 |
| 3-108 |
1656 | d->rasterizer->rasterizeLine(line.p1(), line.p2(), executed (the execution status of this line is deduced): d->rasterizer->rasterizeLine(line.p1(), line.p2(), | - |
1657 | width / line.length(), executed (the execution status of this line is deduced): width / line.length(), | - |
1658 | s->lastPen.capStyle() == Qt::SquareCap); executed (the execution status of this line is deduced): s->lastPen.capStyle() == Qt::SquareCap); | - |
1659 | } else { executed: } Execution Count:108 | 108 |
1660 | d->rasterizeLine_dashed(line, width, executed (the execution status of this line is deduced): d->rasterizeLine_dashed(line, width, | - |
1661 | &dashIndex, &dashOffset, &inDash); executed (the execution status of this line is deduced): &dashIndex, &dashOffset, &inDash); | - |
1662 | } executed: } Execution Count:3 | 3 |
1663 | } | - |
1664 | } executed: } Execution Count:111 | 111 |
1665 | else | - |
1666 | QPaintEngineEx::stroke(path, pen); executed: QPaintEngineEx::stroke(path, pen); Execution Count:22 | 22 |
1667 | } | - |
1668 | | - |
1669 | QRect QRasterPaintEngine::toNormalizedFillRect(const QRectF &rect) | - |
1670 | { | - |
1671 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
1672 | | - |
1673 | qreal delta = s->flags.legacy_rounding ? aliasedCoordinateDelta : qreal(0); evaluated: s->flags.legacy_rounding yes Evaluation Count:1 | yes Evaluation Count:45367 |
| 1-45367 |
1674 | | - |
1675 | int x1 = qRound(rect.x() + delta); executed (the execution status of this line is deduced): int x1 = qRound(rect.x() + delta); | - |
1676 | int y1 = qRound(rect.y() + delta); executed (the execution status of this line is deduced): int y1 = qRound(rect.y() + delta); | - |
1677 | int x2 = qRound(rect.right() + delta); executed (the execution status of this line is deduced): int x2 = qRound(rect.right() + delta); | - |
1678 | int y2 = qRound(rect.bottom() + delta); executed (the execution status of this line is deduced): int y2 = qRound(rect.bottom() + delta); | - |
1679 | | - |
1680 | if (x2 < x1) partially evaluated: x2 < x1 no Evaluation Count:0 | yes Evaluation Count:45373 |
| 0-45373 |
1681 | qSwap(x1, x2); never executed: qSwap(x1, x2); | 0 |
1682 | if (y2 < y1) partially evaluated: y2 < y1 no Evaluation Count:0 | yes Evaluation Count:45382 |
| 0-45382 |
1683 | qSwap(y1, y2); never executed: qSwap(y1, y2); | 0 |
1684 | | - |
1685 | return QRect(x1, y1, x2 - x1, y2 - y1); executed: return QRect(x1, y1, x2 - x1, y2 - y1); Execution Count:45370 | 45370 |
1686 | } | - |
1687 | | - |
1688 | /*! | - |
1689 | \internal | - |
1690 | */ | - |
1691 | void QRasterPaintEngine::fill(const QVectorPath &path, const QBrush &brush) | - |
1692 | { | - |
1693 | if (path.isEmpty()) partially evaluated: path.isEmpty() no Evaluation Count:0 | yes Evaluation Count:135955 |
| 0-135955 |
1694 | return; | 0 |
1695 | #ifdef QT_DEBUG_DRAW | - |
1696 | QRectF rf = path.controlPointRect(); | - |
1697 | qDebug() << "QRasterPaintEngine::fill(): " | - |
1698 | << "size=" << path.elementCount() | - |
1699 | << ", hints=" << hex << path.hints() | - |
1700 | << rf << brush; | - |
1701 | #endif | - |
1702 | | - |
1703 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
1704 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
1705 | | - |
1706 | ensureBrush(brush); executed (the execution status of this line is deduced): ensureBrush(brush); | - |
1707 | if (!s->brushData.blend) evaluated: !s->brushData.blend yes Evaluation Count:1 | yes Evaluation Count:135954 |
| 1-135954 |
1708 | return; executed: return; Execution Count:1 | 1 |
1709 | | - |
1710 | if (path.shape() == QVectorPath::RectangleHint) { evaluated: path.shape() == QVectorPath::RectangleHint yes Evaluation Count:2414 | yes Evaluation Count:133540 |
| 2414-133540 |
1711 | if (!s->flags.antialiased && s->matrix.type() <= QTransform::TxScale) { evaluated: !s->flags.antialiased yes Evaluation Count:2408 | yes Evaluation Count:6 |
partially evaluated: s->matrix.type() <= QTransform::TxScale yes Evaluation Count:2408 | no Evaluation Count:0 |
| 0-2408 |
1712 | const qreal *p = path.points(); executed (the execution status of this line is deduced): const qreal *p = path.points(); | - |
1713 | 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; | - |
1714 | 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; | - |
1715 | 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); | - |
1716 | return; executed: return; Execution Count:2408 | 2408 |
1717 | } | - |
1718 | ensureRasterState(); executed (the execution status of this line is deduced): ensureRasterState(); | - |
1719 | if (s->flags.tx_noshear) { partially evaluated: s->flags.tx_noshear yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
1720 | d->initializeRasterizer(&s->brushData); executed (the execution status of this line is deduced): d->initializeRasterizer(&s->brushData); | - |
1721 | // ### Is normalizing really necessary here? | - |
1722 | const qreal *p = path.points(); executed (the execution status of this line is deduced): const qreal *p = path.points(); | - |
1723 | 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(); | - |
1724 | if (!r.isEmpty()) { partially evaluated: !r.isEmpty() yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
1725 | 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); | - |
1726 | 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); | - |
1727 | 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()); | - |
1728 | } executed: } Execution Count:6 | 6 |
1729 | return; executed: return; Execution Count:6 | 6 |
1730 | } | - |
1731 | } | 0 |
1732 | | - |
1733 | // ### Optimize for non transformed ellipses and rectangles... | - |
1734 | QRectF cpRect = path.controlPointRect(); executed (the execution status of this line is deduced): QRectF cpRect = path.controlPointRect(); | - |
1735 | 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(); | - |
1736 | ProcessSpans blend = d->getBrushFunc(deviceRect, &s->brushData); executed (the execution status of this line is deduced): ProcessSpans blend = d->getBrushFunc(deviceRect, &s->brushData); | - |
1737 | | - |
1738 | // ### Falcon | - |
1739 | // const bool do_clip = (deviceRect.left() < -QT_RASTER_COORD_LIMIT | - |
1740 | // || deviceRect.right() > QT_RASTER_COORD_LIMIT | - |
1741 | // || deviceRect.top() < -QT_RASTER_COORD_LIMIT | - |
1742 | // || deviceRect.bottom() > QT_RASTER_COORD_LIMIT); | - |
1743 | | - |
1744 | // ### Falonc: implement.... | - |
1745 | // if (!s->flags.antialiased && !do_clip) { | - |
1746 | // d->initializeRasterizer(&s->brushData); | - |
1747 | // d->rasterizer->rasterize(path * d->matrix, path.fillRule()); | - |
1748 | // return; | - |
1749 | // } | - |
1750 | | - |
1751 | ensureOutlineMapper(); executed (the execution status of this line is deduced): ensureOutlineMapper(); | - |
1752 | 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()); | - |
1753 | } executed: } Execution Count:133540 | 133540 |
1754 | | - |
1755 | void QRasterPaintEngine::fillRect(const QRectF &r, QSpanData *data) | - |
1756 | { | - |
1757 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
1758 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
1759 | | - |
1760 | if (!s->flags.antialiased) { evaluated: !s->flags.antialiased yes Evaluation Count:42989 | yes Evaluation Count:29 |
| 29-42989 |
1761 | uint txop = s->matrix.type(); executed (the execution status of this line is deduced): uint txop = s->matrix.type(); | - |
1762 | if (txop == QTransform::TxNone) { evaluated: txop == QTransform::TxNone yes Evaluation Count:25809 | yes Evaluation Count:17179 |
| 17179-25809 |
1763 | fillRect_normalized(toNormalizedFillRect(r), data, d); executed (the execution status of this line is deduced): fillRect_normalized(toNormalizedFillRect(r), data, d); | - |
1764 | return; executed: return; Execution Count:25766 | 25766 |
1765 | } else if (txop == QTransform::TxTranslate) { evaluated: txop == QTransform::TxTranslate yes Evaluation Count:17126 | yes Evaluation Count:53 |
| 53-17126 |
1766 | 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())); | - |
1767 | fillRect_normalized(rr, data, d); executed (the execution status of this line is deduced): fillRect_normalized(rr, data, d); | - |
1768 | return; executed: return; Execution Count:17126 | 17126 |
1769 | } else if (txop == QTransform::TxScale) { evaluated: txop == QTransform::TxScale yes Evaluation Count:33 | yes Evaluation Count:20 |
| 20-33 |
1770 | 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)); | - |
1771 | fillRect_normalized(rr, data, d); executed (the execution status of this line is deduced): fillRect_normalized(rr, data, d); | - |
1772 | return; executed: return; Execution Count:33 | 33 |
1773 | } | - |
1774 | } | - |
1775 | ensureRasterState(); executed (the execution status of this line is deduced): ensureRasterState(); | - |
1776 | if (s->flags.tx_noshear) { partially evaluated: s->flags.tx_noshear yes Evaluation Count:49 | no Evaluation Count:0 |
| 0-49 |
1777 | d->initializeRasterizer(data); executed (the execution status of this line is deduced): d->initializeRasterizer(data); | - |
1778 | QRectF nr = r.normalized(); executed (the execution status of this line is deduced): QRectF nr = r.normalized(); | - |
1779 | if (!nr.isEmpty()) { evaluated: !nr.isEmpty() yes Evaluation Count:45 | yes Evaluation Count:4 |
| 4-45 |
1780 | 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); | - |
1781 | 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); | - |
1782 | 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()); | - |
1783 | } executed: } Execution Count:45 | 45 |
1784 | return; executed: return; Execution Count:49 | 49 |
1785 | } | - |
1786 | | - |
1787 | QPainterPath path; never executed (the execution status of this line is deduced): QPainterPath path; | - |
1788 | path.addRect(r); never executed (the execution status of this line is deduced): path.addRect(r); | - |
1789 | ensureOutlineMapper(); never executed (the execution status of this line is deduced): ensureOutlineMapper(); | - |
1790 | fillPath(path, data); never executed (the execution status of this line is deduced): fillPath(path, data); | - |
1791 | } | 0 |
1792 | | - |
1793 | /*! | - |
1794 | \reimp | - |
1795 | */ | - |
1796 | void QRasterPaintEngine::fillRect(const QRectF &r, const QBrush &brush) | - |
1797 | { | - |
1798 | #ifdef QT_DEBUG_DRAW | - |
1799 | qDebug() << "QRasterPaintEngine::fillRecct(): " << r << brush; | - |
1800 | #endif | - |
1801 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
1802 | | - |
1803 | ensureBrush(brush); executed (the execution status of this line is deduced): ensureBrush(brush); | - |
1804 | if (!s->brushData.blend) evaluated: !s->brushData.blend yes Evaluation Count:4 | yes Evaluation Count:40048 |
| 4-40048 |
1805 | return; executed: return; Execution Count:4 | 4 |
1806 | | - |
1807 | fillRect(r, &s->brushData); executed (the execution status of this line is deduced): fillRect(r, &s->brushData); | - |
1808 | } executed: } Execution Count:39973 | 39973 |
1809 | | - |
1810 | /*! | - |
1811 | \reimp | - |
1812 | */ | - |
1813 | void QRasterPaintEngine::fillRect(const QRectF &r, const QColor &color) | - |
1814 | { | - |
1815 | #ifdef QT_DEBUG_DRAW | - |
1816 | qDebug() << "QRasterPaintEngine::fillRect(): " << r << color; | - |
1817 | #endif | - |
1818 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
1819 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
1820 | | - |
1821 | 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)); | - |
1822 | if ((d->solid_color_filler.solid.color & 0xff000000) == 0 evaluated: (d->solid_color_filler.solid.color & 0xff000000) == 0 yes Evaluation Count:3 | yes Evaluation Count:2978 |
| 3-2978 |
1823 | && s->composition_mode == QPainter::CompositionMode_SourceOver) { partially evaluated: s->composition_mode == QPainter::CompositionMode_SourceOver no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
1824 | return; | 0 |
1825 | } | - |
1826 | d->solid_color_filler.clip = d->clip(); executed (the execution status of this line is deduced): d->solid_color_filler.clip = d->clip(); | - |
1827 | d->solid_color_filler.adjustSpanMethods(); executed (the execution status of this line is deduced): d->solid_color_filler.adjustSpanMethods(); | - |
1828 | fillRect(r, &d->solid_color_filler); executed (the execution status of this line is deduced): fillRect(r, &d->solid_color_filler); | - |
1829 | } executed: } Execution Count:2981 | 2981 |
1830 | | - |
1831 | static inline bool isAbove(const QPointF *a, const QPointF *b) | - |
1832 | { | - |
1833 | return a->y() < b->y(); never executed: return a->y() < b->y(); | 0 |
1834 | } | - |
1835 | | - |
1836 | static bool splitPolygon(const QPointF *points, int pointCount, QVector<QPointF> *upper, QVector<QPointF> *lower) | - |
1837 | { | - |
1838 | Q_ASSERT(upper); never executed (the execution status of this line is deduced): qt_noop(); | - |
1839 | Q_ASSERT(lower); never executed (the execution status of this line is deduced): qt_noop(); | - |
1840 | | - |
1841 | Q_ASSERT(pointCount >= 2); never executed (the execution status of this line is deduced): qt_noop(); | - |
1842 | | - |
1843 | QVector<const QPointF *> sorted; never executed (the execution status of this line is deduced): QVector<const QPointF *> sorted; | - |
1844 | sorted.reserve(pointCount); never executed (the execution status of this line is deduced): sorted.reserve(pointCount); | - |
1845 | | - |
1846 | upper->reserve(pointCount * 3 / 4); never executed (the execution status of this line is deduced): upper->reserve(pointCount * 3 / 4); | - |
1847 | lower->reserve(pointCount * 3 / 4); never executed (the execution status of this line is deduced): lower->reserve(pointCount * 3 / 4); | - |
1848 | | - |
1849 | for (int i = 0; i < pointCount; ++i) never evaluated: i < pointCount | 0 |
1850 | sorted << points + i; never executed: sorted << points + i; | 0 |
1851 | | - |
1852 | qSort(sorted.begin(), sorted.end(), isAbove); never executed (the execution status of this line is deduced): qSort(sorted.begin(), sorted.end(), isAbove); | - |
1853 | | - |
1854 | 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(); | - |
1855 | | - |
1856 | const QPointF *end = points + pointCount; never executed (the execution status of this line is deduced): const QPointF *end = points + pointCount; | - |
1857 | const QPointF *last = end - 1; never executed (the execution status of this line is deduced): const QPointF *last = end - 1; | - |
1858 | | - |
1859 | QVector<QPointF> *bin[2] = { upper, lower }; never executed (the execution status of this line is deduced): QVector<QPointF> *bin[2] = { upper, lower }; | - |
1860 | | - |
1861 | for (const QPointF *p = points; p < end; ++p) { | 0 |
1862 | int side = p->y() < splitY; never executed (the execution status of this line is deduced): int side = p->y() < splitY; | - |
1863 | int lastSide = last->y() < splitY; never executed (the execution status of this line is deduced): int lastSide = last->y() < splitY; | - |
1864 | | - |
1865 | if (side != lastSide) { never evaluated: side != lastSide | 0 |
1866 | if (qFuzzyCompare(p->y(), splitY)) { never evaluated: qFuzzyCompare(p->y(), splitY) | 0 |
1867 | bin[!side]->append(*p); never executed (the execution status of this line is deduced): bin[!side]->append(*p); | - |
1868 | } else if (qFuzzyCompare(last->y(), splitY)) { never executed: } never evaluated: qFuzzyCompare(last->y(), splitY) | 0 |
1869 | bin[side]->append(*last); never executed (the execution status of this line is deduced): bin[side]->append(*last); | - |
1870 | } else { | 0 |
1871 | QPointF delta = *p - *last; never executed (the execution status of this line is deduced): QPointF delta = *p - *last; | - |
1872 | 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); | - |
1873 | | - |
1874 | bin[0]->append(intersection); never executed (the execution status of this line is deduced): bin[0]->append(intersection); | - |
1875 | bin[1]->append(intersection); never executed (the execution status of this line is deduced): bin[1]->append(intersection); | - |
1876 | } | 0 |
1877 | } | - |
1878 | | - |
1879 | bin[side]->append(*p); never executed (the execution status of this line is deduced): bin[side]->append(*p); | - |
1880 | | - |
1881 | last = p; never executed (the execution status of this line is deduced): last = p; | - |
1882 | } | 0 |
1883 | | - |
1884 | // give up if we couldn't reduce the point count | - |
1885 | return upper->size() < pointCount && lower->size() < pointCount; never executed: return upper->size() < pointCount && lower->size() < pointCount; | 0 |
1886 | } | - |
1887 | | - |
1888 | /*! | - |
1889 | \internal | - |
1890 | */ | - |
1891 | void QRasterPaintEngine::fillPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) | - |
1892 | { | - |
1893 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
1894 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
1895 | | - |
1896 | const int maxPoints = 0xffff; executed (the execution status of this line is deduced): const int maxPoints = 0xffff; | - |
1897 | | - |
1898 | // max amount of points that raster engine can reliably handle | - |
1899 | if (pointCount > maxPoints) { partially evaluated: pointCount > maxPoints no Evaluation Count:0 | yes Evaluation Count:388 |
| 0-388 |
1900 | QVector<QPointF> upper, lower; never executed (the execution status of this line is deduced): QVector<QPointF> upper, lower; | - |
1901 | | - |
1902 | if (splitPolygon(points, pointCount, &upper, &lower)) { never evaluated: splitPolygon(points, pointCount, &upper, &lower) | 0 |
1903 | fillPolygon(upper.constData(), upper.size(), mode); never executed (the execution status of this line is deduced): fillPolygon(upper.constData(), upper.size(), mode); | - |
1904 | fillPolygon(lower.constData(), lower.size(), mode); never executed (the execution status of this line is deduced): fillPolygon(lower.constData(), lower.size(), mode); | - |
1905 | } else | 0 |
1906 | qWarning("Polygon too complex for filling."); never executed: QMessageLogger("painting/qpaintengine_raster.cpp", 1906, __PRETTY_FUNCTION__).warning("Polygon too complex for filling."); | 0 |
1907 | | - |
1908 | return; | 0 |
1909 | } | - |
1910 | | - |
1911 | // Compose polygon fill.., | - |
1912 | 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)); | - |
1913 | ensureOutlineMapper(); executed (the execution status of this line is deduced): ensureOutlineMapper(); | - |
1914 | 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); | - |
1915 | | - |
1916 | // scanconvert. | - |
1917 | ProcessSpans brushBlend = d->getBrushFunc(d->outlineMapper->controlPointRect, executed (the execution status of this line is deduced): ProcessSpans brushBlend = d->getBrushFunc(d->outlineMapper->controlPointRect, | - |
1918 | &s->brushData); executed (the execution status of this line is deduced): &s->brushData); | - |
1919 | 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()); | - |
1920 | } executed: } Execution Count:388 | 388 |
1921 | | - |
1922 | /*! | - |
1923 | \reimp | - |
1924 | */ | - |
1925 | void QRasterPaintEngine::drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) | - |
1926 | { | - |
1927 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
1928 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
1929 | | - |
1930 | #ifdef QT_DEBUG_DRAW | - |
1931 | qDebug(" - QRasterPaintEngine::drawPolygon(F), pointCount=%d", pointCount); | - |
1932 | for (int i=0; i<pointCount; ++i) | - |
1933 | qDebug() << " - " << points[i]; | - |
1934 | #endif | - |
1935 | Q_ASSERT(pointCount >= 2); executed (the execution status of this line is deduced): qt_noop(); | - |
1936 | | - |
1937 | if (mode != PolylineMode && isRect((qreal *) points, pointCount)) { partially evaluated: mode != PolylineMode yes Evaluation Count:444 | no Evaluation Count:0 |
evaluated: isRect((qreal *) points, pointCount) yes Evaluation Count:20 | yes Evaluation Count:424 |
| 0-444 |
1938 | QRectF r(points[0], points[2]); executed (the execution status of this line is deduced): QRectF r(points[0], points[2]); | - |
1939 | drawRects(&r, 1); executed (the execution status of this line is deduced): drawRects(&r, 1); | - |
1940 | return; executed: return; Execution Count:20 | 20 |
1941 | } | - |
1942 | | - |
1943 | ensurePen(); executed (the execution status of this line is deduced): ensurePen(); | - |
1944 | if (mode != PolylineMode) { partially evaluated: mode != PolylineMode yes Evaluation Count:424 | no Evaluation Count:0 |
| 0-424 |
1945 | // Do the fill... | - |
1946 | ensureBrush(); executed (the execution status of this line is deduced): ensureBrush(); | - |
1947 | if (s->brushData.blend) evaluated: s->brushData.blend yes Evaluation Count:388 | yes Evaluation Count:36 |
| 36-388 |
1948 | fillPolygon(points, pointCount, mode); executed: fillPolygon(points, pointCount, mode); Execution Count:388 | 388 |
1949 | } executed: } Execution Count:424 | 424 |
1950 | | - |
1951 | // Do the outline... | - |
1952 | if (s->penData.blend) { evaluated: s->penData.blend yes Evaluation Count:408 | yes Evaluation Count:16 |
| 16-408 |
1953 | 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)); | - |
1954 | if (s->flags.fast_pen) { evaluated: s->flags.fast_pen yes Evaluation Count:396 | yes Evaluation Count:12 |
| 12-396 |
1955 | QCosmeticStroker stroker(s, d->deviceRect); executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect); | - |
1956 | stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); | - |
1957 | stroker.drawPath(vp); executed (the execution status of this line is deduced): stroker.drawPath(vp); | - |
1958 | } else { executed: } Execution Count:396 | 396 |
1959 | QPaintEngineEx::stroke(vp, s->lastPen); executed (the execution status of this line is deduced): QPaintEngineEx::stroke(vp, s->lastPen); | - |
1960 | } executed: } Execution Count:12 | 12 |
1961 | } | - |
1962 | } executed: } Execution Count:424 | 424 |
1963 | | - |
1964 | /*! | - |
1965 | \reimp | - |
1966 | */ | - |
1967 | void QRasterPaintEngine::drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) | - |
1968 | { | - |
1969 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
1970 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
1971 | | - |
1972 | #ifdef QT_DEBUG_DRAW | - |
1973 | qDebug(" - QRasterPaintEngine::drawPolygon(I), pointCount=%d", pointCount); | - |
1974 | for (int i=0; i<pointCount; ++i) | - |
1975 | qDebug() << " - " << points[i]; | - |
1976 | #endif | - |
1977 | Q_ASSERT(pointCount >= 2); executed (the execution status of this line is deduced): qt_noop(); | - |
1978 | if (mode != PolylineMode && isRect((int *) points, pointCount)) { evaluated: mode != PolylineMode yes Evaluation Count:807 | yes Evaluation Count:22847 |
evaluated: isRect((int *) points, pointCount) yes Evaluation Count:20 | yes Evaluation Count:787 |
| 20-22847 |
1979 | QRect r(points[0].x(), executed (the execution status of this line is deduced): QRect r(points[0].x(), | - |
1980 | points[0].y(), executed (the execution status of this line is deduced): points[0].y(), | - |
1981 | points[2].x() - points[0].x(), executed (the execution status of this line is deduced): points[2].x() - points[0].x(), | - |
1982 | points[2].y() - points[0].y()); executed (the execution status of this line is deduced): points[2].y() - points[0].y()); | - |
1983 | drawRects(&r, 1); executed (the execution status of this line is deduced): drawRects(&r, 1); | - |
1984 | return; executed: return; Execution Count:20 | 20 |
1985 | } | - |
1986 | | - |
1987 | ensurePen(); executed (the execution status of this line is deduced): ensurePen(); | - |
1988 | | - |
1989 | // Do the fill | - |
1990 | if (mode != PolylineMode) { evaluated: mode != PolylineMode yes Evaluation Count:787 | yes Evaluation Count:22847 |
| 787-22847 |
1991 | ensureBrush(); executed (the execution status of this line is deduced): ensureBrush(); | - |
1992 | if (s->brushData.blend) { evaluated: s->brushData.blend yes Evaluation Count:751 | yes Evaluation Count:36 |
| 36-751 |
1993 | // Compose polygon fill.., | - |
1994 | ensureOutlineMapper(); executed (the execution status of this line is deduced): ensureOutlineMapper(); | - |
1995 | 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); | - |
1996 | d->outlineMapper->moveTo(*points); executed (the execution status of this line is deduced): d->outlineMapper->moveTo(*points); | - |
1997 | const QPoint *p = points; executed (the execution status of this line is deduced): const QPoint *p = points; | - |
1998 | const QPoint *ep = points + pointCount - 1; executed (the execution status of this line is deduced): const QPoint *ep = points + pointCount - 1; | - |
1999 | do { | - |
2000 | d->outlineMapper->lineTo(*(++p)); executed (the execution status of this line is deduced): d->outlineMapper->lineTo(*(++p)); | - |
2001 | } while (p < ep); executed: } Execution Count:2102 evaluated: p < ep yes Evaluation Count:1351 | yes Evaluation Count:751 |
| 751-2102 |
2002 | d->outlineMapper->endOutline(); executed (the execution status of this line is deduced): d->outlineMapper->endOutline(); | - |
2003 | | - |
2004 | // scanconvert. | - |
2005 | ProcessSpans brushBlend = d->getBrushFunc(d->outlineMapper->controlPointRect, executed (the execution status of this line is deduced): ProcessSpans brushBlend = d->getBrushFunc(d->outlineMapper->controlPointRect, | - |
2006 | &s->brushData); executed (the execution status of this line is deduced): &s->brushData); | - |
2007 | 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()); | - |
2008 | } executed: } Execution Count:751 | 751 |
2009 | } executed: } Execution Count:787 | 787 |
2010 | | - |
2011 | // Do the outline... | - |
2012 | if (s->penData.blend) { evaluated: s->penData.blend yes Evaluation Count:23622 | yes Evaluation Count:12 |
| 12-23622 |
2013 | int count = pointCount * 2; executed (the execution status of this line is deduced): int count = pointCount * 2; | - |
2014 | QVarLengthArray<qreal> fpoints(count); executed (the execution status of this line is deduced): QVarLengthArray<qreal> fpoints(count); | - |
2015 | for (int i=0; i<count; ++i) evaluated: i<count yes Evaluation Count:145476 | yes Evaluation Count:23622 |
| 23622-145476 |
2016 | fpoints[i] = ((int *) points)[i]; executed: fpoints[i] = ((int *) points)[i]; Execution Count:145476 | 145476 |
2017 | 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)); | - |
2018 | | - |
2019 | if (s->flags.fast_pen) { evaluated: s->flags.fast_pen yes Evaluation Count:23610 | yes Evaluation Count:12 |
| 12-23610 |
2020 | QCosmeticStroker stroker(s, d->deviceRect); executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect); | - |
2021 | stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); | - |
2022 | stroker.drawPath(vp); executed (the execution status of this line is deduced): stroker.drawPath(vp); | - |
2023 | } else { executed: } Execution Count:23610 | 23610 |
2024 | QPaintEngineEx::stroke(vp, s->lastPen); executed (the execution status of this line is deduced): QPaintEngineEx::stroke(vp, s->lastPen); | - |
2025 | } executed: } Execution Count:12 | 12 |
2026 | } | - |
2027 | } executed: } Execution Count:23634 | 23634 |
2028 | | - |
2029 | /*! | - |
2030 | \internal | - |
2031 | */ | - |
2032 | void QRasterPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pixmap) | - |
2033 | { | - |
2034 | #ifdef QT_DEBUG_DRAW | - |
2035 | qDebug() << " - QRasterPaintEngine::drawPixmap(), pos=" << pos << " pixmap=" << pixmap.size() << "depth=" << pixmap.depth(); | - |
2036 | #endif | - |
2037 | | - |
2038 | QPlatformPixmap *pd = pixmap.handle(); executed (the execution status of this line is deduced): QPlatformPixmap *pd = pixmap.handle(); | - |
2039 | if (pd->classId() == QPlatformPixmap::RasterClass) { partially evaluated: pd->classId() == QPlatformPixmap::RasterClass yes Evaluation Count:1543 | no Evaluation Count:0 |
| 0-1543 |
2040 | 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; | - |
2041 | if (image.depth() == 1) { partially evaluated: image.depth() == 1 no Evaluation Count:0 | yes Evaluation Count:1543 |
| 0-1543 |
2042 | Q_D(QRasterPaintEngine); never executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
2043 | QRasterPaintEngineState *s = state(); never executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
2044 | if (s->matrix.type() <= QTransform::TxTranslate) { never evaluated: s->matrix.type() <= QTransform::TxTranslate | 0 |
2045 | ensurePen(); never executed (the execution status of this line is deduced): ensurePen(); | - |
2046 | 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); | - |
2047 | } else { | 0 |
2048 | 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())); | - |
2049 | } | 0 |
2050 | } else { | - |
2051 | QRasterPaintEngine::drawImage(pos, image); executed (the execution status of this line is deduced): QRasterPaintEngine::drawImage(pos, image); | - |
2052 | } executed: } Execution Count:1543 | 1543 |
2053 | } else { | - |
2054 | const QImage image = pixmap.toImage(); never executed (the execution status of this line is deduced): const QImage image = pixmap.toImage(); | - |
2055 | if (pixmap.depth() == 1) { never evaluated: pixmap.depth() == 1 | 0 |
2056 | Q_D(QRasterPaintEngine); never executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
2057 | QRasterPaintEngineState *s = state(); never executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
2058 | if (s->matrix.type() <= QTransform::TxTranslate) { never evaluated: s->matrix.type() <= QTransform::TxTranslate | 0 |
2059 | ensurePen(); never executed (the execution status of this line is deduced): ensurePen(); | - |
2060 | 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); | - |
2061 | } else { | 0 |
2062 | 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())); | - |
2063 | } | 0 |
2064 | } else { | - |
2065 | QRasterPaintEngine::drawImage(pos, image); never executed (the execution status of this line is deduced): QRasterPaintEngine::drawImage(pos, image); | - |
2066 | } | 0 |
2067 | } | - |
2068 | } | - |
2069 | | - |
2070 | /*! | - |
2071 | \reimp | - |
2072 | */ | - |
2073 | void QRasterPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap, const QRectF &sr) | - |
2074 | { | - |
2075 | #ifdef QT_DEBUG_DRAW | - |
2076 | qDebug() << " - QRasterPaintEngine::drawPixmap(), r=" << r << " sr=" << sr << " pixmap=" << pixmap.size() << "depth=" << pixmap.depth(); | - |
2077 | #endif | - |
2078 | | - |
2079 | QPlatformPixmap* pd = pixmap.handle(); executed (the execution status of this line is deduced): QPlatformPixmap* pd = pixmap.handle(); | - |
2080 | if (pd->classId() == QPlatformPixmap::RasterClass) { partially evaluated: pd->classId() == QPlatformPixmap::RasterClass yes Evaluation Count:3194 | no Evaluation Count:0 |
| 0-3194 |
2081 | 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; | - |
2082 | if (image.depth() == 1) { evaluated: image.depth() == 1 yes Evaluation Count:1 | yes Evaluation Count:3193 |
| 1-3193 |
2083 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
2084 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
2085 | if (s->matrix.type() <= QTransform::TxTranslate partially evaluated: s->matrix.type() <= QTransform::TxTranslate yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2086 | && r.size() == sr.size() partially evaluated: r.size() == sr.size() yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2087 | && r.size() == pixmap.size()) { partially evaluated: r.size() == pixmap.size() yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2088 | ensurePen(); executed (the execution status of this line is deduced): ensurePen(); | - |
2089 | 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); | - |
2090 | return; executed: return; Execution Count:1 | 1 |
2091 | } else { | - |
2092 | 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); | - |
2093 | } | 0 |
2094 | } else { | - |
2095 | drawImage(r, image, sr); executed (the execution status of this line is deduced): drawImage(r, image, sr); | - |
2096 | } executed: } Execution Count:3193 | 3193 |
2097 | } else { | - |
2098 | QRect clippedSource = sr.toAlignedRect().intersected(pixmap.rect()); never executed (the execution status of this line is deduced): QRect clippedSource = sr.toAlignedRect().intersected(pixmap.rect()); | - |
2099 | const QImage image = pd->toImage(clippedSource); never executed (the execution status of this line is deduced): const QImage image = pd->toImage(clippedSource); | - |
2100 | QRectF translatedSource = sr.translated(-clippedSource.topLeft()); never executed (the execution status of this line is deduced): QRectF translatedSource = sr.translated(-clippedSource.topLeft()); | - |
2101 | if (image.depth() == 1) { never evaluated: image.depth() == 1 | 0 |
2102 | Q_D(QRasterPaintEngine); never executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
2103 | QRasterPaintEngineState *s = state(); never executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
2104 | if (s->matrix.type() <= QTransform::TxTranslate never evaluated: s->matrix.type() <= QTransform::TxTranslate | 0 |
2105 | && r.size() == sr.size() never evaluated: r.size() == sr.size() | 0 |
2106 | && r.size() == pixmap.size()) { never evaluated: r.size() == pixmap.size() | 0 |
2107 | ensurePen(); never executed (the execution status of this line is deduced): ensurePen(); | - |
2108 | 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); | - |
2109 | return; | 0 |
2110 | } else { | - |
2111 | 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); | - |
2112 | } | 0 |
2113 | } else { | - |
2114 | drawImage(r, image, translatedSource); never executed (the execution status of this line is deduced): drawImage(r, image, translatedSource); | - |
2115 | } | 0 |
2116 | } | - |
2117 | } | - |
2118 | | - |
2119 | static inline int fast_ceil_positive(const qreal &v) | - |
2120 | { | - |
2121 | const int iv = int(v); executed (the execution status of this line is deduced): const int iv = int(v); | - |
2122 | if (v - iv == 0) partially evaluated: v - iv == 0 yes Evaluation Count:670 | no Evaluation Count:0 |
| 0-670 |
2123 | return iv; executed: return iv; Execution Count:670 | 670 |
2124 | else | - |
2125 | return iv + 1; never executed: return iv + 1; | 0 |
2126 | } | - |
2127 | | - |
2128 | static inline const QRect toAlignedRect_positive(const QRectF &rect) | - |
2129 | { | - |
2130 | const int xmin = int(rect.x()); executed (the execution status of this line is deduced): const int xmin = int(rect.x()); | - |
2131 | 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())); | - |
2132 | const int ymin = int(rect.y()); executed (the execution status of this line is deduced): const int ymin = int(rect.y()); | - |
2133 | 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())); | - |
2134 | return QRect(xmin, ymin, xmax - xmin, ymax - ymin); executed: return QRect(xmin, ymin, xmax - xmin, ymax - ymin); Execution Count:335 | 335 |
2135 | } | - |
2136 | | - |
2137 | /*! | - |
2138 | \internal | - |
2139 | */ | - |
2140 | void QRasterPaintEngine::drawImage(const QPointF &p, const QImage &img) | - |
2141 | { | - |
2142 | #ifdef QT_DEBUG_DRAW | - |
2143 | qDebug() << " - QRasterPaintEngine::drawImage(), p=" << p << " image=" << img.size() << "depth=" << img.depth(); | - |
2144 | #endif | - |
2145 | | - |
2146 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
2147 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
2148 | qreal scale = img.devicePixelRatio(); executed (the execution status of this line is deduced): qreal scale = img.devicePixelRatio(); | - |
2149 | | - |
2150 | if (scale > 1.0 || s->matrix.type() > QTransform::TxTranslate) { partially evaluated: scale > 1.0 no Evaluation Count:0 | yes Evaluation Count:3862 |
evaluated: s->matrix.type() > QTransform::TxTranslate yes Evaluation Count:1367 | yes Evaluation Count:2495 |
| 0-3862 |
2151 | 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), | - |
2152 | img, executed (the execution status of this line is deduced): img, | - |
2153 | QRectF(0, 0, img.width(), img.height())); executed (the execution status of this line is deduced): QRectF(0, 0, img.width(), img.height())); | - |
2154 | } else { executed: } Execution Count:1367 | 1367 |
2155 | | - |
2156 | const QClipData *clip = d->clip(); executed (the execution status of this line is deduced): const QClipData *clip = d->clip(); | - |
2157 | 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()); | - |
2158 | | - |
2159 | if (d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img)) { evaluated: d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img) yes Evaluation Count:2479 | yes Evaluation Count:16 |
| 16-2479 |
2160 | 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()]; | - |
2161 | if (func) { evaluated: func yes Evaluation Count:1575 | yes Evaluation Count:904 |
| 904-1575 |
2162 | if (!clip) { partially evaluated: !clip no Evaluation Count:0 | yes Evaluation Count:1575 |
| 0-1575 |
2163 | 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); | - |
2164 | return; | 0 |
2165 | } else if (clip->hasRectClip) { partially evaluated: clip->hasRectClip yes Evaluation Count:1575 | no Evaluation Count:0 |
| 0-1575 |
2166 | 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); | - |
2167 | return; executed: return; Execution Count:1575 | 1575 |
2168 | } | - |
2169 | } | - |
2170 | } executed: } Execution Count:904 | 904 |
2171 | | - |
2172 | | - |
2173 | | - |
2174 | d->image_filler.clip = clip; executed (the execution status of this line is deduced): d->image_filler.clip = clip; | - |
2175 | 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()); | - |
2176 | if (!d->image_filler.blend) evaluated: !d->image_filler.blend yes Evaluation Count:1 | yes Evaluation Count:919 |
| 1-919 |
2177 | return; executed: return; Execution Count:1 | 1 |
2178 | d->image_filler.dx = -pt.x(); executed (the execution status of this line is deduced): d->image_filler.dx = -pt.x(); | - |
2179 | d->image_filler.dy = -pt.y(); executed (the execution status of this line is deduced): d->image_filler.dy = -pt.y(); | - |
2180 | 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())); | - |
2181 | | - |
2182 | fillRect_normalized(rr, &d->image_filler, d); executed (the execution status of this line is deduced): fillRect_normalized(rr, &d->image_filler, d); | - |
2183 | } executed: } Execution Count:919 | 919 |
2184 | | - |
2185 | } | - |
2186 | | - |
2187 | QRectF qt_mapRect_non_normalizing(const QRectF &r, const QTransform &t) | - |
2188 | { | - |
2189 | return QRectF(r.topLeft() * t, r.bottomRight() * t); executed: return QRectF(r.topLeft() * t, r.bottomRight() * t); Execution Count:1364 | 1364 |
2190 | } | - |
2191 | | - |
2192 | namespace { | - |
2193 | enum RotationType { | - |
2194 | Rotation90, | - |
2195 | Rotation180, | - |
2196 | Rotation270, | - |
2197 | NoRotation | - |
2198 | }; | - |
2199 | | - |
2200 | inline RotationType qRotationType(const QTransform &transform) | - |
2201 | { | - |
2202 | QTransform::TransformationType type = transform.type(); executed (the execution status of this line is deduced): QTransform::TransformationType type = transform.type(); | - |
2203 | | - |
2204 | if (type > QTransform::TxRotate) partially evaluated: type > QTransform::TxRotate no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
2205 | return NoRotation; never executed: return NoRotation; | 0 |
2206 | | - |
2207 | if (type == QTransform::TxRotate && qFuzzyIsNull(transform.m11()) && qFuzzyCompare(transform.m12(), qreal(-1)) evaluated: type == QTransform::TxRotate yes Evaluation Count:2 | yes Evaluation Count:6 |
partially evaluated: qFuzzyIsNull(transform.m11()) yes Evaluation Count:2 | no Evaluation Count:0 |
evaluated: qFuzzyCompare(transform.m12(), qreal(-1)) yes Evaluation Count:1 | yes Evaluation Count:1 |
| 0-6 |
2208 | && qFuzzyCompare(transform.m21(), qreal(1)) && qFuzzyIsNull(transform.m22())) partially evaluated: qFuzzyCompare(transform.m21(), qreal(1)) yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: qFuzzyIsNull(transform.m22()) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2209 | return Rotation90; executed: return Rotation90; Execution Count:1 | 1 |
2210 | | - |
2211 | if (type == QTransform::TxScale && qFuzzyCompare(transform.m11(), qreal(-1)) && qFuzzyIsNull(transform.m12()) evaluated: type == QTransform::TxScale yes Evaluation Count:6 | yes Evaluation Count:1 |
evaluated: qFuzzyCompare(transform.m11(), qreal(-1)) yes Evaluation Count:2 | yes Evaluation Count:4 |
partially evaluated: qFuzzyIsNull(transform.m12()) yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-6 |
2212 | && qFuzzyIsNull(transform.m21()) && qFuzzyCompare(transform.m22(), qreal(-1))) partially evaluated: qFuzzyIsNull(transform.m21()) yes Evaluation Count:2 | no Evaluation Count:0 |
partially evaluated: qFuzzyCompare(transform.m22(), qreal(-1)) yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
2213 | return Rotation180; executed: return Rotation180; Execution Count:2 | 2 |
2214 | | - |
2215 | if (type == QTransform::TxRotate && qFuzzyIsNull(transform.m11()) && qFuzzyCompare(transform.m12(), qreal(1)) evaluated: type == QTransform::TxRotate yes Evaluation Count:1 | yes Evaluation Count:4 |
partially evaluated: qFuzzyIsNull(transform.m11()) yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: qFuzzyCompare(transform.m12(), qreal(1)) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-4 |
2216 | && qFuzzyCompare(transform.m21(), qreal(-1)) && qFuzzyIsNull(transform.m22())) partially evaluated: qFuzzyCompare(transform.m21(), qreal(-1)) yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: qFuzzyIsNull(transform.m22()) yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2217 | return Rotation270; executed: return Rotation270; Execution Count:1 | 1 |
2218 | | - |
2219 | return NoRotation; executed: return NoRotation; Execution Count:4 | 4 |
2220 | } | - |
2221 | | - |
2222 | inline bool isPixelAligned(const QRectF &rect) { | - |
2223 | return QRectF(rect.toRect()) == rect; never executed: return QRectF(rect.toRect()) == rect; | 0 |
2224 | } | - |
2225 | } | - |
2226 | | - |
2227 | /*! | - |
2228 | \reimp | - |
2229 | */ | - |
2230 | void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRectF &sr, | - |
2231 | Qt::ImageConversionFlags) | - |
2232 | { | - |
2233 | #ifdef QT_DEBUG_DRAW | - |
2234 | qDebug() << " - QRasterPaintEngine::drawImage(), r=" << r << " sr=" << sr << " image=" << img.size() << "depth=" << img.depth(); | - |
2235 | #endif | - |
2236 | | - |
2237 | if (r.isEmpty()) partially evaluated: r.isEmpty() no Evaluation Count:0 | yes Evaluation Count:4787 |
| 0-4787 |
2238 | return; | 0 |
2239 | | - |
2240 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
2241 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
2242 | int sr_l = qFloor(sr.left()); executed (the execution status of this line is deduced): int sr_l = qFloor(sr.left()); | - |
2243 | int sr_r = qCeil(sr.right()) - 1; executed (the execution status of this line is deduced): int sr_r = qCeil(sr.right()) - 1; | - |
2244 | int sr_t = qFloor(sr.top()); executed (the execution status of this line is deduced): int sr_t = qFloor(sr.top()); | - |
2245 | int sr_b = qCeil(sr.bottom()) - 1; executed (the execution status of this line is deduced): int sr_b = qCeil(sr.bottom()) - 1; | - |
2246 | | - |
2247 | if (s->matrix.type() <= QTransform::TxScale && !s->flags.antialiased && sr_l == sr_r && sr_t == sr_b) { evaluated: s->matrix.type() <= QTransform::TxScale yes Evaluation Count:4775 | yes Evaluation Count:12 |
evaluated: !s->flags.antialiased yes Evaluation Count:4773 | yes Evaluation Count:2 |
evaluated: sr_l == sr_r yes Evaluation Count:1 | yes Evaluation Count:4772 |
partially evaluated: sr_t == sr_b yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-4775 |
2248 | // as fillRect will apply the aliased coordinate delta we need to | - |
2249 | // subtract it here as we don't use it for image drawing | - |
2250 | QTransform old = s->matrix; executed (the execution status of this line is deduced): QTransform old = s->matrix; | - |
2251 | | - |
2252 | if (s->flags.legacy_rounding) partially evaluated: s->flags.legacy_rounding no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2253 | s->matrix = s->matrix * QTransform::fromTranslate(-aliasedCoordinateDelta, -aliasedCoordinateDelta); never executed: s->matrix = s->matrix * QTransform::fromTranslate(-aliasedCoordinateDelta, -aliasedCoordinateDelta); | 0 |
2254 | | - |
2255 | // Do whatever fillRect() does, but without premultiplying the color if it's already premultiplied. | - |
2256 | 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); | - |
2257 | switch (img.format()) { | - |
2258 | case QImage::Format_ARGB32_Premultiplied: | - |
2259 | case QImage::Format_ARGB8565_Premultiplied: | - |
2260 | case QImage::Format_ARGB6666_Premultiplied: | - |
2261 | case QImage::Format_ARGB8555_Premultiplied: | - |
2262 | case QImage::Format_ARGB4444_Premultiplied: | - |
2263 | // Combine premultiplied color with the opacity set on the painter. | - |
2264 | d->solid_color_filler.solid.color = executed (the execution status of this line is deduced): d->solid_color_filler.solid.color = | - |
2265 | ((((color & 0x00ff00ff) * s->intOpacity) >> 8) & 0x00ff00ff) executed (the execution status of this line is deduced): ((((color & 0x00ff00ff) * s->intOpacity) >> 8) & 0x00ff00ff) | - |
2266 | | ((((color & 0xff00ff00) >> 8) * s->intOpacity) & 0xff00ff00); executed (the execution status of this line is deduced): | ((((color & 0xff00ff00) >> 8) * s->intOpacity) & 0xff00ff00); | - |
2267 | break; executed: break; Execution Count:1 | 1 |
2268 | default: | - |
2269 | 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)); | - |
2270 | break; | 0 |
2271 | } | - |
2272 | | - |
2273 | if ((d->solid_color_filler.solid.color & 0xff000000) == 0 partially evaluated: (d->solid_color_filler.solid.color & 0xff000000) == 0 no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2274 | && s->composition_mode == QPainter::CompositionMode_SourceOver) { never evaluated: s->composition_mode == QPainter::CompositionMode_SourceOver | 0 |
2275 | return; | 0 |
2276 | } | - |
2277 | | - |
2278 | d->solid_color_filler.clip = d->clip(); executed (the execution status of this line is deduced): d->solid_color_filler.clip = d->clip(); | - |
2279 | d->solid_color_filler.adjustSpanMethods(); executed (the execution status of this line is deduced): d->solid_color_filler.adjustSpanMethods(); | - |
2280 | fillRect(r, &d->solid_color_filler); executed (the execution status of this line is deduced): fillRect(r, &d->solid_color_filler); | - |
2281 | | - |
2282 | s->matrix = old; executed (the execution status of this line is deduced): s->matrix = old; | - |
2283 | return; executed: return; Execution Count:1 | 1 |
2284 | } | - |
2285 | | - |
2286 | bool stretch_sr = r.width() != sr.width() || r.height() != sr.height(); evaluated: r.width() != sr.width() yes Evaluation Count:17 | yes Evaluation Count:4769 |
evaluated: r.height() != sr.height() yes Evaluation Count:4 | yes Evaluation Count:4765 |
| 4-4769 |
2287 | | - |
2288 | const QClipData *clip = d->clip(); executed (the execution status of this line is deduced): const QClipData *clip = d->clip(); | - |
2289 | | - |
2290 | if (s->matrix.type() > QTransform::TxTranslate evaluated: s->matrix.type() > QTransform::TxTranslate yes Evaluation Count:1374 | yes Evaluation Count:3412 |
| 1374-3412 |
2291 | && !stretch_sr evaluated: !stretch_sr yes Evaluation Count:1372 | yes Evaluation Count:2 |
| 2-1372 |
2292 | && (!clip || clip->hasRectClip) partially evaluated: !clip no Evaluation Count:0 | yes Evaluation Count:1372 |
partially evaluated: clip->hasRectClip yes Evaluation Count:1372 | no Evaluation Count:0 |
| 0-1372 |
2293 | && s->intOpacity == 256 partially evaluated: s->intOpacity == 256 yes Evaluation Count:1372 | no Evaluation Count:0 |
| 0-1372 |
2294 | && (d->rasterBuffer->compositionMode == QPainter::CompositionMode_SourceOver evaluated: d->rasterBuffer->compositionMode == QPainter::CompositionMode_SourceOver yes Evaluation Count:1371 | yes Evaluation Count:1 |
| 1-1371 |
2295 | || d->rasterBuffer->compositionMode == QPainter::CompositionMode_Source) partially evaluated: d->rasterBuffer->compositionMode == QPainter::CompositionMode_Source yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2296 | && d->rasterBuffer->format == img.format() evaluated: d->rasterBuffer->format == img.format() yes Evaluation Count:1362 | yes Evaluation Count:10 |
| 10-1362 |
2297 | && (d->rasterBuffer->format == QImage::Format_RGB16 partially evaluated: d->rasterBuffer->format == QImage::Format_RGB16 no Evaluation Count:0 | yes Evaluation Count:1362 |
| 0-1362 |
2298 | || d->rasterBuffer->format == QImage::Format_RGB32 evaluated: d->rasterBuffer->format == QImage::Format_RGB32 yes Evaluation Count:8 | yes Evaluation Count:1354 |
| 8-1354 |
2299 | || (d->rasterBuffer->format == QImage::Format_ARGB32_Premultiplied partially evaluated: d->rasterBuffer->format == QImage::Format_ARGB32_Premultiplied yes Evaluation Count:1354 | no Evaluation Count:0 |
| 0-1354 |
2300 | && d->rasterBuffer->compositionMode == QPainter::CompositionMode_Source))) partially evaluated: d->rasterBuffer->compositionMode == QPainter::CompositionMode_Source no Evaluation Count:0 | yes Evaluation Count:1354 |
| 0-1354 |
2301 | { | - |
2302 | RotationType rotationType = qRotationType(s->matrix); executed (the execution status of this line is deduced): RotationType rotationType = qRotationType(s->matrix); | - |
2303 | | - |
2304 | if (rotationType != NoRotation && qMemRotateFunctions[d->rasterBuffer->format][rotationType] && img.rect().contains(sr.toAlignedRect())) { evaluated: rotationType != NoRotation yes Evaluation Count:4 | yes Evaluation Count:4 |
partially evaluated: qMemRotateFunctions[d->rasterBuffer->format][rotationType] yes Evaluation Count:4 | no Evaluation Count:0 |
partially evaluated: img.rect().contains(sr.toAlignedRect()) yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-4 |
2305 | QRectF transformedTargetRect = s->matrix.mapRect(r); executed (the execution status of this line is deduced): QRectF transformedTargetRect = s->matrix.mapRect(r); | - |
2306 | | - |
2307 | if ((!(s->renderHints & QPainter::SmoothPixmapTransform) && !(s->renderHints & QPainter::Antialiasing)) partially evaluated: !(s->renderHints & QPainter::SmoothPixmapTransform) yes Evaluation Count:4 | no Evaluation Count:0 |
partially evaluated: !(s->renderHints & QPainter::Antialiasing) yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-4 |
2308 | || (isPixelAligned(transformedTargetRect) && isPixelAligned(sr))) never evaluated: isPixelAligned(transformedTargetRect) never evaluated: isPixelAligned(sr) | 0 |
2309 | { | - |
2310 | 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); | - |
2311 | if (clippedTransformedTargetRect.isNull()) partially evaluated: clippedTransformedTargetRect.isNull() no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
2312 | return; | 0 |
2313 | | - |
2314 | 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)); | - |
2315 | | - |
2316 | QRect clippedSourceRect executed (the execution status of this line is deduced): QRect clippedSourceRect | - |
2317 | = 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(), | - |
2318 | clippedTargetRect.width(), clippedTargetRect.height()).toRect(); executed (the execution status of this line is deduced): clippedTargetRect.width(), clippedTargetRect.height()).toRect(); | - |
2319 | | - |
2320 | uint dbpl = d->rasterBuffer->bytesPerLine(); executed (the execution status of this line is deduced): uint dbpl = d->rasterBuffer->bytesPerLine(); | - |
2321 | uint sbpl = img.bytesPerLine(); executed (the execution status of this line is deduced): uint sbpl = img.bytesPerLine(); | - |
2322 | | - |
2323 | uchar *dst = d->rasterBuffer->buffer(); executed (the execution status of this line is deduced): uchar *dst = d->rasterBuffer->buffer(); | - |
2324 | uint bpp = img.depth() >> 3; executed (the execution status of this line is deduced): uint bpp = img.depth() >> 3; | - |
2325 | | - |
2326 | 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; | - |
2327 | 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; | - |
2328 | | - |
2329 | uint cw = clippedSourceRect.width(); executed (the execution status of this line is deduced): uint cw = clippedSourceRect.width(); | - |
2330 | uint ch = clippedSourceRect.height(); executed (the execution status of this line is deduced): uint ch = clippedSourceRect.height(); | - |
2331 | | - |
2332 | 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); | - |
2333 | | - |
2334 | return; executed: return; Execution Count:4 | 4 |
2335 | } | - |
2336 | } | 0 |
2337 | } executed: } Execution Count:4 | 4 |
2338 | | - |
2339 | if (s->matrix.type() > QTransform::TxTranslate || stretch_sr) { evaluated: s->matrix.type() > QTransform::TxTranslate yes Evaluation Count:1370 | yes Evaluation Count:3412 |
evaluated: stretch_sr yes Evaluation Count:19 | yes Evaluation Count:3393 |
| 19-3412 |
2340 | | - |
2341 | QRectF targetBounds = s->matrix.mapRect(r); executed (the execution status of this line is deduced): QRectF targetBounds = s->matrix.mapRect(r); | - |
2342 | bool exceedsPrecision = targetBounds.width() > 0xffff partially evaluated: targetBounds.width() > 0xffff no Evaluation Count:0 | yes Evaluation Count:1389 |
| 0-1389 |
2343 | || targetBounds.height() > 0xffff; partially evaluated: targetBounds.height() > 0xffff no Evaluation Count:0 | yes Evaluation Count:1389 |
| 0-1389 |
2344 | | - |
2345 | if (!exceedsPrecision && d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img)) { partially evaluated: !exceedsPrecision yes Evaluation Count:1389 | no Evaluation Count:0 |
evaluated: d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img) yes Evaluation Count:1368 | yes Evaluation Count:21 |
| 0-1389 |
2346 | if (s->matrix.type() > QTransform::TxScale) { evaluated: s->matrix.type() > QTransform::TxScale yes Evaluation Count:2 | yes Evaluation Count:1366 |
| 2-1366 |
2347 | 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()]; | - |
2348 | if (func && (!clip || clip->hasRectClip)) { evaluated: func yes Evaluation Count:1 | yes Evaluation Count:1 |
partially evaluated: !clip no Evaluation Count:0 | yes Evaluation Count:1 |
partially evaluated: clip->hasRectClip yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2349 | 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(), | - |
2350 | 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, | - |
2351 | s->matrix, s->intOpacity); executed (the execution status of this line is deduced): s->matrix, s->intOpacity); | - |
2352 | return; executed: return; Execution Count:1 | 1 |
2353 | } | - |
2354 | } else { executed: } Execution Count:1 | 1 |
2355 | // Test for optimized high-dpi case: 2x source on 2x target. (Could be generalized to nX.) | - |
2356 | bool sourceRect2x = r.width() * 2 == sr.width() && r.height() * 2 == sr.height(); evaluated: r.width() * 2 == sr.width() yes Evaluation Count:8 | yes Evaluation Count:1358 |
partially evaluated: r.height() * 2 == sr.height() yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-1358 |
2357 | bool scale2x = (s->matrix.m11() == qreal(2)) && (s->matrix.m22() == qreal(2)); evaluated: (s->matrix.m11() == qreal(2)) yes Evaluation Count:3 | yes Evaluation Count:1363 |
partially evaluated: (s->matrix.m22() == qreal(2)) yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-1363 |
2358 | if (s->matrix.type() == QTransform::TxScale && sourceRect2x && scale2x) { evaluated: s->matrix.type() == QTransform::TxScale yes Evaluation Count:1356 | yes Evaluation Count:10 |
partially evaluated: sourceRect2x no Evaluation Count:0 | yes Evaluation Count:1356 |
never evaluated: scale2x | 0-1356 |
2359 | 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()]; | - |
2360 | if (func) { | 0 |
2361 | 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()); | - |
2362 | if (!clip) { | 0 |
2363 | 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()); | - |
2364 | return; | 0 |
2365 | } else if (clip->hasRectClip) { never evaluated: clip->hasRectClip | 0 |
2366 | 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()); | - |
2367 | return; | 0 |
2368 | } | - |
2369 | } | - |
2370 | } | 0 |
2371 | 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()]; | - |
2372 | if (func && (!clip || clip->hasRectClip)) { evaluated: func yes Evaluation Count:1364 | yes Evaluation Count:2 |
partially evaluated: !clip no Evaluation Count:0 | yes Evaluation Count:1364 |
partially evaluated: clip->hasRectClip yes Evaluation Count:1364 | no Evaluation Count:0 |
| 0-1364 |
2373 | func(d->rasterBuffer->buffer(), d->rasterBuffer->bytesPerLine(), executed (the execution status of this line is deduced): func(d->rasterBuffer->buffer(), d->rasterBuffer->bytesPerLine(), | - |
2374 | img.bits(), img.bytesPerLine(), executed (the execution status of this line is deduced): img.bits(), img.bytesPerLine(), | - |
2375 | 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, | - |
2376 | !clip ? d->deviceRect : clip->clipRect, executed (the execution status of this line is deduced): !clip ? d->deviceRect : clip->clipRect, | - |
2377 | s->intOpacity); executed (the execution status of this line is deduced): s->intOpacity); | - |
2378 | return; executed: return; Execution Count:1364 | 1364 |
2379 | } | - |
2380 | } executed: } Execution Count:2 | 2 |
2381 | } | - |
2382 | | - |
2383 | QTransform copy = s->matrix; executed (the execution status of this line is deduced): QTransform copy = s->matrix; | - |
2384 | copy.translate(r.x(), r.y()); executed (the execution status of this line is deduced): copy.translate(r.x(), r.y()); | - |
2385 | if (stretch_sr) evaluated: stretch_sr yes Evaluation Count:11 | yes Evaluation Count:13 |
| 11-13 |
2386 | 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 |
2387 | copy.translate(-sr.x(), -sr.y()); executed (the execution status of this line is deduced): copy.translate(-sr.x(), -sr.y()); | - |
2388 | | - |
2389 | d->image_filler_xform.clip = clip; executed (the execution status of this line is deduced): d->image_filler_xform.clip = clip; | - |
2390 | 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)); | - |
2391 | if (!d->image_filler_xform.blend) partially evaluated: !d->image_filler_xform.blend no Evaluation Count:0 | yes Evaluation Count:24 |
| 0-24 |
2392 | return; | 0 |
2393 | 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); | - |
2394 | | - |
2395 | if (!s->flags.antialiased && s->matrix.type() == QTransform::TxScale) { evaluated: !s->flags.antialiased yes Evaluation Count:14 | yes Evaluation Count:10 |
evaluated: s->matrix.type() == QTransform::TxScale yes Evaluation Count:2 | yes Evaluation Count:12 |
| 2-14 |
2396 | QRectF rr = s->matrix.mapRect(r); executed (the execution status of this line is deduced): QRectF rr = s->matrix.mapRect(r); | - |
2397 | | - |
2398 | const int x1 = qRound(rr.x()); executed (the execution status of this line is deduced): const int x1 = qRound(rr.x()); | - |
2399 | const int y1 = qRound(rr.y()); executed (the execution status of this line is deduced): const int y1 = qRound(rr.y()); | - |
2400 | const int x2 = qRound(rr.right()); executed (the execution status of this line is deduced): const int x2 = qRound(rr.right()); | - |
2401 | const int y2 = qRound(rr.bottom()); executed (the execution status of this line is deduced): const int y2 = qRound(rr.bottom()); | - |
2402 | | - |
2403 | 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); | - |
2404 | return; executed: return; Execution Count:2 | 2 |
2405 | } | - |
2406 | | - |
2407 | #ifdef QT_FAST_SPANS | - |
2408 | ensureRasterState(); executed (the execution status of this line is deduced): ensureRasterState(); | - |
2409 | if (s->flags.tx_noshear || s->matrix.type() == QTransform::TxScale) { evaluated: s->flags.tx_noshear yes Evaluation Count:18 | yes Evaluation Count:4 |
partially evaluated: s->matrix.type() == QTransform::TxScale no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-18 |
2410 | d->initializeRasterizer(&d->image_filler_xform); executed (the execution status of this line is deduced): d->initializeRasterizer(&d->image_filler_xform); | - |
2411 | d->rasterizer->setAntialiased(s->flags.antialiased); executed (the execution status of this line is deduced): d->rasterizer->setAntialiased(s->flags.antialiased); | - |
2412 | d->rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding); executed (the execution status of this line is deduced): d->rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding); | - |
2413 | | - |
2414 | const QPointF offs = s->flags.legacy_rounding ? QPointF(aliasedCoordinateDelta, aliasedCoordinateDelta) : QPointF(); partially evaluated: s->flags.legacy_rounding no Evaluation Count:0 | yes Evaluation Count:18 |
| 0-18 |
2415 | | - |
2416 | const QRectF &rect = r.normalized(); executed (the execution status of this line is deduced): const QRectF &rect = r.normalized(); | - |
2417 | 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; | - |
2418 | 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; | - |
2419 | | - |
2420 | if (s->flags.tx_noshear) partially evaluated: s->flags.tx_noshear yes Evaluation Count:18 | no Evaluation Count:0 |
| 0-18 |
2421 | d->rasterizer->rasterizeLine(a, b, rect.height() / rect.width()); executed: d->rasterizer->rasterizeLine(a, b, rect.height() / rect.width()); Execution Count:18 | 18 |
2422 | else | - |
2423 | 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 |
2424 | return; executed: return; Execution Count:18 | 18 |
2425 | } | - |
2426 | #endif | - |
2427 | const qreal offs = s->flags.legacy_rounding ? aliasedCoordinateDelta : qreal(0); partially evaluated: s->flags.legacy_rounding no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
2428 | QPainterPath path; executed (the execution status of this line is deduced): QPainterPath path; | - |
2429 | path.addRect(r); executed (the execution status of this line is deduced): path.addRect(r); | - |
2430 | QTransform m = s->matrix; executed (the execution status of this line is deduced): QTransform m = s->matrix; | - |
2431 | 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(), | - |
2432 | m.m21(), m.m22(), m.m23(), executed (the execution status of this line is deduced): m.m21(), m.m22(), m.m23(), | - |
2433 | 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()); | - |
2434 | fillPath(path, &d->image_filler_xform); executed (the execution status of this line is deduced): fillPath(path, &d->image_filler_xform); | - |
2435 | s->matrix = m; executed (the execution status of this line is deduced): s->matrix = m; | - |
2436 | } else { executed: } Execution Count:4 | 4 |
2437 | if (d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img)) { evaluated: d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img) yes Evaluation Count:3382 | yes Evaluation Count:11 |
| 11-3382 |
2438 | 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()]; | - |
2439 | if (func) { evaluated: func yes Evaluation Count:3202 | yes Evaluation Count:180 |
| 180-3202 |
2440 | 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()); | - |
2441 | if (!clip) { partially evaluated: !clip no Evaluation Count:0 | yes Evaluation Count:3202 |
| 0-3202 |
2442 | 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()); | - |
2443 | return; | 0 |
2444 | } else if (clip->hasRectClip) { evaluated: clip->hasRectClip yes Evaluation Count:3082 | yes Evaluation Count:120 |
| 120-3082 |
2445 | 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()); | - |
2446 | return; executed: return; Execution Count:3082 | 3082 |
2447 | } | - |
2448 | } | - |
2449 | } executed: } Execution Count:300 | 300 |
2450 | | - |
2451 | d->image_filler.clip = clip; executed (the execution status of this line is deduced): d->image_filler.clip = clip; | - |
2452 | 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)); | - |
2453 | if (!d->image_filler.blend) partially evaluated: !d->image_filler.blend no Evaluation Count:0 | yes Evaluation Count:311 |
| 0-311 |
2454 | return; | 0 |
2455 | 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(); | - |
2456 | 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(); | - |
2457 | | - |
2458 | QRectF rr = r; executed (the execution status of this line is deduced): QRectF rr = r; | - |
2459 | 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()); | - |
2460 | | - |
2461 | const int x1 = qRound(rr.x()); executed (the execution status of this line is deduced): const int x1 = qRound(rr.x()); | - |
2462 | const int y1 = qRound(rr.y()); executed (the execution status of this line is deduced): const int y1 = qRound(rr.y()); | - |
2463 | const int x2 = qRound(rr.right()); executed (the execution status of this line is deduced): const int x2 = qRound(rr.right()); | - |
2464 | const int y2 = qRound(rr.bottom()); executed (the execution status of this line is deduced): const int y2 = qRound(rr.bottom()); | - |
2465 | | - |
2466 | 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); | - |
2467 | } executed: } Execution Count:311 | 311 |
2468 | } | - |
2469 | | - |
2470 | /*! | - |
2471 | \reimp | - |
2472 | */ | - |
2473 | void QRasterPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &sr) | - |
2474 | { | - |
2475 | #ifdef QT_DEBUG_DRAW | - |
2476 | qDebug() << " - QRasterPaintEngine::drawTiledPixmap(), r=" << r << "pixmap=" << pixmap.size(); | - |
2477 | #endif | - |
2478 | Q_D(QRasterPaintEngine); never executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
2479 | QRasterPaintEngineState *s = state(); never executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
2480 | | - |
2481 | QImage image; never executed (the execution status of this line is deduced): QImage image; | - |
2482 | | - |
2483 | QPlatformPixmap *pd = pixmap.handle(); never executed (the execution status of this line is deduced): QPlatformPixmap *pd = pixmap.handle(); | - |
2484 | if (pd->classId() == QPlatformPixmap::RasterClass) { never evaluated: pd->classId() == QPlatformPixmap::RasterClass | 0 |
2485 | image = static_cast<QRasterPlatformPixmap *>(pd)->image; never executed (the execution status of this line is deduced): image = static_cast<QRasterPlatformPixmap *>(pd)->image; | - |
2486 | } else { | 0 |
2487 | image = pixmap.toImage(); never executed (the execution status of this line is deduced): image = pixmap.toImage(); | - |
2488 | } | 0 |
2489 | | - |
2490 | if (image.depth() == 1) never evaluated: image.depth() == 1 | 0 |
2491 | image = d->rasterBuffer->colorizeBitmap(image, s->pen.color()); never executed: image = d->rasterBuffer->colorizeBitmap(image, s->pen.color()); | 0 |
2492 | | - |
2493 | if (s->matrix.type() > QTransform::TxTranslate) { never evaluated: s->matrix.type() > QTransform::TxTranslate | 0 |
2494 | QTransform copy = s->matrix; never executed (the execution status of this line is deduced): QTransform copy = s->matrix; | - |
2495 | copy.translate(r.x(), r.y()); never executed (the execution status of this line is deduced): copy.translate(r.x(), r.y()); | - |
2496 | copy.translate(-sr.x(), -sr.y()); never executed (the execution status of this line is deduced): copy.translate(-sr.x(), -sr.y()); | - |
2497 | d->image_filler_xform.clip = d->clip(); never executed (the execution status of this line is deduced): d->image_filler_xform.clip = d->clip(); | - |
2498 | 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); | - |
2499 | if (!d->image_filler_xform.blend) never evaluated: !d->image_filler_xform.blend | 0 |
2500 | return; | 0 |
2501 | 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); | - |
2502 | | - |
2503 | #ifdef QT_FAST_SPANS | - |
2504 | ensureRasterState(); never executed (the execution status of this line is deduced): ensureRasterState(); | - |
2505 | if (s->flags.tx_noshear || s->matrix.type() == QTransform::TxScale) { never evaluated: s->flags.tx_noshear never evaluated: s->matrix.type() == QTransform::TxScale | 0 |
2506 | d->initializeRasterizer(&d->image_filler_xform); never executed (the execution status of this line is deduced): d->initializeRasterizer(&d->image_filler_xform); | - |
2507 | d->rasterizer->setAntialiased(s->flags.antialiased); never executed (the execution status of this line is deduced): d->rasterizer->setAntialiased(s->flags.antialiased); | - |
2508 | d->rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding); never executed (the execution status of this line is deduced): d->rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding); | - |
2509 | | - |
2510 | const QRectF &rect = r.normalized(); never executed (the execution status of this line is deduced): const QRectF &rect = r.normalized(); | - |
2511 | 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); | - |
2512 | 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); | - |
2513 | if (s->flags.tx_noshear) never evaluated: s->flags.tx_noshear | 0 |
2514 | d->rasterizer->rasterizeLine(a, b, rect.height() / rect.width()); never executed: d->rasterizer->rasterizeLine(a, b, rect.height() / rect.width()); | 0 |
2515 | else | - |
2516 | 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 |
2517 | return; | 0 |
2518 | } | - |
2519 | #endif | - |
2520 | QPainterPath path; never executed (the execution status of this line is deduced): QPainterPath path; | - |
2521 | path.addRect(r); never executed (the execution status of this line is deduced): path.addRect(r); | - |
2522 | fillPath(path, &d->image_filler_xform); never executed (the execution status of this line is deduced): fillPath(path, &d->image_filler_xform); | - |
2523 | } else { | 0 |
2524 | d->image_filler.clip = d->clip(); never executed (the execution status of this line is deduced): d->image_filler.clip = d->clip(); | - |
2525 | | - |
2526 | d->image_filler.initTexture(&image, s->intOpacity, QTextureData::Tiled); never executed (the execution status of this line is deduced): d->image_filler.initTexture(&image, s->intOpacity, QTextureData::Tiled); | - |
2527 | if (!d->image_filler.blend) never evaluated: !d->image_filler.blend | 0 |
2528 | return; | 0 |
2529 | d->image_filler.dx = -(r.x() + s->matrix.dx()) + sr.x(); never executed (the execution status of this line is deduced): d->image_filler.dx = -(r.x() + s->matrix.dx()) + sr.x(); | - |
2530 | d->image_filler.dy = -(r.y() + s->matrix.dy()) + sr.y(); never executed (the execution status of this line is deduced): d->image_filler.dy = -(r.y() + s->matrix.dy()) + sr.y(); | - |
2531 | | - |
2532 | QRectF rr = r; never executed (the execution status of this line is deduced): QRectF rr = r; | - |
2533 | rr.translate(s->matrix.dx(), s->matrix.dy()); never executed (the execution status of this line is deduced): rr.translate(s->matrix.dx(), s->matrix.dy()); | - |
2534 | fillRect_normalized(rr.toRect().normalized(), &d->image_filler, d); never executed (the execution status of this line is deduced): fillRect_normalized(rr.toRect().normalized(), &d->image_filler, d); | - |
2535 | } | 0 |
2536 | } | - |
2537 | | - |
2538 | | - |
2539 | //QWS hack | - |
2540 | static inline bool monoVal(const uchar* s, int x) | - |
2541 | { | - |
2542 | return (s[x>>3] << (x&7)) & 0x80; executed: return (s[x>>3] << (x&7)) & 0x80; Execution Count:392 | 392 |
2543 | } | - |
2544 | | - |
2545 | /*! | - |
2546 | \internal | - |
2547 | */ | - |
2548 | QRasterBuffer *QRasterPaintEngine::rasterBuffer() | - |
2549 | { | - |
2550 | Q_D(QRasterPaintEngine); never executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
2551 | return d->rasterBuffer.data(); never executed: return d->rasterBuffer.data(); | 0 |
2552 | } | - |
2553 | | - |
2554 | /*! | - |
2555 | \internal | - |
2556 | */ | - |
2557 | void QRasterPaintEngine::alphaPenBlt(const void* src, int bpl, int depth, int rx,int ry,int w,int h) | - |
2558 | { | - |
2559 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
2560 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
2561 | | - |
2562 | if (!s->penData.blend) partially evaluated: !s->penData.blend no Evaluation Count:0 | yes Evaluation Count:110976 |
| 0-110976 |
2563 | return; | 0 |
2564 | | - |
2565 | QRasterBuffer *rb = d->rasterBuffer.data(); executed (the execution status of this line is deduced): QRasterBuffer *rb = d->rasterBuffer.data(); | - |
2566 | | - |
2567 | const QRect rect(rx, ry, w, h); executed (the execution status of this line is deduced): const QRect rect(rx, ry, w, h); | - |
2568 | const QClipData *clip = d->clip(); executed (the execution status of this line is deduced): const QClipData *clip = d->clip(); | - |
2569 | bool unclipped = false; executed (the execution status of this line is deduced): bool unclipped = false; | - |
2570 | if (clip) { partially evaluated: clip yes Evaluation Count:110976 | no Evaluation Count:0 |
| 0-110976 |
2571 | // inlined QRect::intersects | - |
2572 | 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()) yes Evaluation Count:98574 | yes Evaluation Count:12402 |
| 12402-98574 |
2573 | && qMax(clip->ymin, rect.top()) <= qMin(clip->ymax - 1, rect.bottom()); evaluated: qMax(clip->ymin, rect.top()) <= qMin(clip->ymax - 1, rect.bottom()) yes Evaluation Count:90405 | yes Evaluation Count:8169 |
| 8169-90405 |
2574 | | - |
2575 | if (clip->hasRectClip) { evaluated: clip->hasRectClip yes Evaluation Count:108343 | yes Evaluation Count:2633 |
| 2633-108343 |
2576 | unclipped = rx > clip->xmin evaluated: rx > clip->xmin yes Evaluation Count:107265 | yes Evaluation Count:1078 |
| 1078-107265 |
2577 | && rx + w < clip->xmax evaluated: rx + w < clip->xmax yes Evaluation Count:96925 | yes Evaluation Count:10340 |
| 10340-96925 |
2578 | && ry > clip->ymin evaluated: ry > clip->ymin yes Evaluation Count:96692 | yes Evaluation Count:233 |
| 233-96692 |
2579 | && ry + h < clip->ymax; evaluated: ry + h < clip->ymax yes Evaluation Count:85786 | yes Evaluation Count:10906 |
| 10906-85786 |
2580 | } executed: } Execution Count:108343 | 108343 |
2581 | | - |
2582 | if (!intersects) evaluated: !intersects yes Evaluation Count:20571 | yes Evaluation Count:90405 |
| 20571-90405 |
2583 | return; executed: return; Execution Count:20571 | 20571 |
2584 | } else { executed: } Execution Count:90405 | 90405 |
2585 | // inlined QRect::intersects | - |
2586 | 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 |
2587 | && qMax(0, rect.top()) <= qMin(rb->height() - 1, rect.bottom()); never evaluated: qMax(0, rect.top()) <= qMin(rb->height() - 1, rect.bottom()) | 0 |
2588 | if (!intersects) never evaluated: !intersects | 0 |
2589 | return; | 0 |
2590 | | - |
2591 | // inlined QRect::contains | - |
2592 | const bool contains = rect.left() >= 0 && rect.right() < rb->width() never evaluated: rect.left() >= 0 never evaluated: rect.right() < rb->width() | 0 |
2593 | && rect.top() >= 0 && rect.bottom() < rb->height(); never evaluated: rect.top() >= 0 never evaluated: rect.bottom() < rb->height() | 0 |
2594 | | - |
2595 | unclipped = contains && d->isUnclipped_normalized(rect); never evaluated: contains never evaluated: d->isUnclipped_normalized(rect) | 0 |
2596 | } | 0 |
2597 | | - |
2598 | ProcessSpans blend = unclipped ? s->penData.unclipped_blend : s->penData.blend; evaluated: unclipped yes Evaluation Count:85786 | yes Evaluation Count:4619 |
| 4619-85786 |
2599 | 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); | - |
2600 | | - |
2601 | if (s->flags.fast_text) { evaluated: s->flags.fast_text yes Evaluation Count:90400 | yes Evaluation Count:5 |
| 5-90400 |
2602 | if (unclipped) { evaluated: unclipped yes Evaluation Count:85783 | yes Evaluation Count:4617 |
| 4617-85783 |
2603 | if (depth == 1) { evaluated: depth == 1 yes Evaluation Count:370 | yes Evaluation Count:85413 |
| 370-85413 |
2604 | if (s->penData.bitmapBlit) { partially evaluated: s->penData.bitmapBlit yes Evaluation Count:370 | no Evaluation Count:0 |
| 0-370 |
2605 | 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, | - |
2606 | scanline, w, h, bpl); executed (the execution status of this line is deduced): scanline, w, h, bpl); | - |
2607 | return; executed: return; Execution Count:370 | 370 |
2608 | } | - |
2609 | } else if (depth == 8) { never executed: } partially evaluated: depth == 8 yes Evaluation Count:85413 | no Evaluation Count:0 |
| 0-85413 |
2610 | if (s->penData.alphamapBlit) { partially evaluated: s->penData.alphamapBlit yes Evaluation Count:85413 | no Evaluation Count:0 |
| 0-85413 |
2611 | 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, | - |
2612 | scanline, w, h, bpl, 0); executed (the execution status of this line is deduced): scanline, w, h, bpl, 0); | - |
2613 | return; executed: return; Execution Count:85413 | 85413 |
2614 | } | - |
2615 | } else if (depth == 32) { never executed: } never evaluated: depth == 32 | 0 |
2616 | // (A)RGB Alpha mask where the alpha component is not used. | - |
2617 | if (s->penData.alphaRGBBlit) { never evaluated: s->penData.alphaRGBBlit | 0 |
2618 | 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, | - |
2619 | (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); | - |
2620 | return; | 0 |
2621 | } | - |
2622 | } | 0 |
2623 | } else if (d->deviceDepth == 32 && (depth == 8 || depth == 32)) { evaluated: d->deviceDepth == 32 yes Evaluation Count:517 | yes Evaluation Count:4100 |
evaluated: depth == 8 yes Evaluation Count:513 | yes Evaluation Count:4 |
partially evaluated: depth == 32 no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4100 |
2624 | // (A)RGB Alpha mask where the alpha component is not used. | - |
2625 | if (!clip) { partially evaluated: !clip no Evaluation Count:0 | yes Evaluation Count:513 |
| 0-513 |
2626 | int nx = qMax(0, rx); never executed (the execution status of this line is deduced): int nx = qMax(0, rx); | - |
2627 | int ny = qMax(0, ry); never executed (the execution status of this line is deduced): int ny = qMax(0, ry); | - |
2628 | | - |
2629 | // Move scanline pointer to compensate for moved x and y | - |
2630 | int xdiff = nx - rx; never executed (the execution status of this line is deduced): int xdiff = nx - rx; | - |
2631 | int ydiff = ny - ry; never executed (the execution status of this line is deduced): int ydiff = ny - ry; | - |
2632 | scanline += ydiff * bpl; never executed (the execution status of this line is deduced): scanline += ydiff * bpl; | - |
2633 | scanline += xdiff * (depth == 32 ? 4 : 1); never executed (the execution status of this line is deduced): scanline += xdiff * (depth == 32 ? 4 : 1); | - |
2634 | | - |
2635 | w -= xdiff; never executed (the execution status of this line is deduced): w -= xdiff; | - |
2636 | h -= ydiff; never executed (the execution status of this line is deduced): h -= ydiff; | - |
2637 | | - |
2638 | if (nx + w > d->rasterBuffer->width()) never evaluated: nx + w > d->rasterBuffer->width() | 0 |
2639 | w = d->rasterBuffer->width() - nx; never executed: w = d->rasterBuffer->width() - nx; | 0 |
2640 | if (ny + h > d->rasterBuffer->height()) never evaluated: ny + h > d->rasterBuffer->height() | 0 |
2641 | h = d->rasterBuffer->height() - ny; never executed: h = d->rasterBuffer->height() - ny; | 0 |
2642 | | - |
2643 | rx = nx; never executed (the execution status of this line is deduced): rx = nx; | - |
2644 | ry = ny; never executed (the execution status of this line is deduced): ry = ny; | - |
2645 | } | 0 |
2646 | if (depth == 8 && s->penData.alphamapBlit) { partially evaluated: depth == 8 yes Evaluation Count:513 | no Evaluation Count:0 |
partially evaluated: s->penData.alphamapBlit yes Evaluation Count:513 | no Evaluation Count:0 |
| 0-513 |
2647 | 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, | - |
2648 | scanline, w, h, bpl, clip); executed (the execution status of this line is deduced): scanline, w, h, bpl, clip); | - |
2649 | } else if (depth == 32 && s->penData.alphaRGBBlit) { executed: } Execution Count:513 never evaluated: depth == 32 never evaluated: s->penData.alphaRGBBlit | 0-513 |
2650 | 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, | - |
2651 | (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); | - |
2652 | } | 0 |
2653 | return; executed: return; Execution Count:513 | 513 |
2654 | } | - |
2655 | } | - |
2656 | | - |
2657 | int x0 = 0; executed (the execution status of this line is deduced): int x0 = 0; | - |
2658 | if (rx < 0) { evaluated: rx < 0 yes Evaluation Count:4 | yes Evaluation Count:4105 |
| 4-4105 |
2659 | x0 = -rx; executed (the execution status of this line is deduced): x0 = -rx; | - |
2660 | w -= x0; executed (the execution status of this line is deduced): w -= x0; | - |
2661 | } executed: } Execution Count:4 | 4 |
2662 | | - |
2663 | int y0 = 0; executed (the execution status of this line is deduced): int y0 = 0; | - |
2664 | if (ry < 0) { partially evaluated: ry < 0 no Evaluation Count:0 | yes Evaluation Count:4109 |
| 0-4109 |
2665 | y0 = -ry; never executed (the execution status of this line is deduced): y0 = -ry; | - |
2666 | scanline += bpl * y0; never executed (the execution status of this line is deduced): scanline += bpl * y0; | - |
2667 | h -= y0; never executed (the execution status of this line is deduced): h -= y0; | - |
2668 | } | 0 |
2669 | | - |
2670 | 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)); | - |
2671 | 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)); | - |
2672 | | - |
2673 | if (w <= 0 || h <= 0) partially evaluated: w <= 0 no Evaluation Count:0 | yes Evaluation Count:4109 |
partially evaluated: h <= 0 no Evaluation Count:0 | yes Evaluation Count:4109 |
| 0-4109 |
2674 | return; | 0 |
2675 | | - |
2676 | const int NSPANS = 256; executed (the execution status of this line is deduced): const int NSPANS = 256; | - |
2677 | QSpan spans[NSPANS]; executed (the execution status of this line is deduced): QSpan spans[NSPANS]; | - |
2678 | int current = 0; executed (the execution status of this line is deduced): int current = 0; | - |
2679 | | - |
2680 | const int x1 = x0 + w; executed (the execution status of this line is deduced): const int x1 = x0 + w; | - |
2681 | const int y1 = y0 + h; executed (the execution status of this line is deduced): const int y1 = y0 + h; | - |
2682 | | - |
2683 | if (depth == 1) { evaluated: depth == 1 yes Evaluation Count:4 | yes Evaluation Count:4105 |
| 4-4105 |
2684 | for (int y = y0; y < y1; ++y) { evaluated: y < y1 yes Evaluation Count:44 | yes Evaluation Count:4 |
| 4-44 |
2685 | for (int x = x0; x < x1; ) { evaluated: x < x1 yes Evaluation Count:316 | yes Evaluation Count:44 |
| 44-316 |
2686 | if (!monoVal(scanline, x)) { evaluated: !monoVal(scanline, x) yes Evaluation Count:264 | yes Evaluation Count:52 |
| 52-264 |
2687 | ++x; executed (the execution status of this line is deduced): ++x; | - |
2688 | continue; executed: continue; Execution Count:264 | 264 |
2689 | } | - |
2690 | | - |
2691 | if (current == NSPANS) { partially evaluated: current == NSPANS no Evaluation Count:0 | yes Evaluation Count:52 |
| 0-52 |
2692 | blend(current, spans, &s->penData); never executed (the execution status of this line is deduced): blend(current, spans, &s->penData); | - |
2693 | current = 0; never executed (the execution status of this line is deduced): current = 0; | - |
2694 | } | 0 |
2695 | spans[current].x = x + rx; executed (the execution status of this line is deduced): spans[current].x = x + rx; | - |
2696 | spans[current].y = y + ry; executed (the execution status of this line is deduced): spans[current].y = y + ry; | - |
2697 | spans[current].coverage = 255; executed (the execution status of this line is deduced): spans[current].coverage = 255; | - |
2698 | int len = 1; executed (the execution status of this line is deduced): int len = 1; | - |
2699 | ++x; executed (the execution status of this line is deduced): ++x; | - |
2700 | // extend span until we find a different one. | - |
2701 | while (x < x1 && monoVal(scanline, x)) { evaluated: x < x1 yes Evaluation Count:76 | yes Evaluation Count:12 |
evaluated: monoVal(scanline, x) yes Evaluation Count:36 | yes Evaluation Count:40 |
| 12-76 |
2702 | ++x; executed (the execution status of this line is deduced): ++x; | - |
2703 | ++len; executed (the execution status of this line is deduced): ++len; | - |
2704 | } executed: } Execution Count:36 | 36 |
2705 | spans[current].len = len; executed (the execution status of this line is deduced): spans[current].len = len; | - |
2706 | ++current; executed (the execution status of this line is deduced): ++current; | - |
2707 | } executed: } Execution Count:52 | 52 |
2708 | scanline += bpl; executed (the execution status of this line is deduced): scanline += bpl; | - |
2709 | } executed: } Execution Count:44 | 44 |
2710 | } else if (depth == 8) { executed: } Execution Count:4 partially evaluated: depth == 8 yes Evaluation Count:4105 | no Evaluation Count:0 |
| 0-4105 |
2711 | for (int y = y0; y < y1; ++y) { evaluated: y < y1 yes Evaluation Count:21862 | yes Evaluation Count:4105 |
| 4105-21862 |
2712 | for (int x = x0; x < x1; ) { evaluated: x < x1 yes Evaluation Count:124365 | yes Evaluation Count:21862 |
| 21862-124365 |
2713 | // Skip those with 0 coverage | - |
2714 | if (scanline[x] == 0) { evaluated: scanline[x] == 0 yes Evaluation Count:43950 | yes Evaluation Count:80415 |
| 43950-80415 |
2715 | ++x; executed (the execution status of this line is deduced): ++x; | - |
2716 | continue; executed: continue; Execution Count:43950 | 43950 |
2717 | } | - |
2718 | | - |
2719 | if (current == NSPANS) { partially evaluated: current == NSPANS no Evaluation Count:0 | yes Evaluation Count:80415 |
| 0-80415 |
2720 | blend(current, spans, &s->penData); never executed (the execution status of this line is deduced): blend(current, spans, &s->penData); | - |
2721 | current = 0; never executed (the execution status of this line is deduced): current = 0; | - |
2722 | } | 0 |
2723 | int coverage = scanline[x]; executed (the execution status of this line is deduced): int coverage = scanline[x]; | - |
2724 | spans[current].x = x + rx; executed (the execution status of this line is deduced): spans[current].x = x + rx; | - |
2725 | spans[current].y = y + ry; executed (the execution status of this line is deduced): spans[current].y = y + ry; | - |
2726 | spans[current].coverage = coverage; executed (the execution status of this line is deduced): spans[current].coverage = coverage; | - |
2727 | int len = 1; executed (the execution status of this line is deduced): int len = 1; | - |
2728 | ++x; executed (the execution status of this line is deduced): ++x; | - |
2729 | | - |
2730 | // extend span until we find a different one. | - |
2731 | while (x < x1 && scanline[x] == coverage) { evaluated: x < x1 yes Evaluation Count:82748 | yes Evaluation Count:13968 |
evaluated: scanline[x] == coverage yes Evaluation Count:16301 | yes Evaluation Count:66447 |
| 13968-82748 |
2732 | ++x; executed (the execution status of this line is deduced): ++x; | - |
2733 | ++len; executed (the execution status of this line is deduced): ++len; | - |
2734 | } executed: } Execution Count:16301 | 16301 |
2735 | spans[current].len = len; executed (the execution status of this line is deduced): spans[current].len = len; | - |
2736 | ++current; executed (the execution status of this line is deduced): ++current; | - |
2737 | } executed: } Execution Count:80415 | 80415 |
2738 | scanline += bpl; executed (the execution status of this line is deduced): scanline += bpl; | - |
2739 | } executed: } Execution Count:21862 | 21862 |
2740 | } else { // 32-bit alpha... executed: } Execution Count:4105 | 4105 |
2741 | uint *sl = (uint *) src; never executed (the execution status of this line is deduced): uint *sl = (uint *) src; | - |
2742 | for (int y = y0; y < y1; ++y) { | 0 |
2743 | for (int x = x0; x < x1; ) { | 0 |
2744 | // Skip those with 0 coverage | - |
2745 | if ((sl[x] & 0x00ffffff) == 0) { never evaluated: (sl[x] & 0x00ffffff) == 0 | 0 |
2746 | ++x; never executed (the execution status of this line is deduced): ++x; | - |
2747 | continue; never executed: continue; | 0 |
2748 | } | - |
2749 | | - |
2750 | if (current == NSPANS) { never evaluated: current == NSPANS | 0 |
2751 | blend(current, spans, &s->penData); never executed (the execution status of this line is deduced): blend(current, spans, &s->penData); | - |
2752 | current = 0; never executed (the execution status of this line is deduced): current = 0; | - |
2753 | } | 0 |
2754 | uint rgbCoverage = sl[x]; never executed (the execution status of this line is deduced): uint rgbCoverage = sl[x]; | - |
2755 | int coverage = qGreen(rgbCoverage); never executed (the execution status of this line is deduced): int coverage = qGreen(rgbCoverage); | - |
2756 | spans[current].x = x + rx; never executed (the execution status of this line is deduced): spans[current].x = x + rx; | - |
2757 | spans[current].y = y + ry; never executed (the execution status of this line is deduced): spans[current].y = y + ry; | - |
2758 | spans[current].coverage = coverage; never executed (the execution status of this line is deduced): spans[current].coverage = coverage; | - |
2759 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
2760 | ++x; never executed (the execution status of this line is deduced): ++x; | - |
2761 | | - |
2762 | // extend span until we find a different one. | - |
2763 | while (x < x1 && sl[x] == rgbCoverage) { never evaluated: x < x1 never evaluated: sl[x] == rgbCoverage | 0 |
2764 | ++x; never executed (the execution status of this line is deduced): ++x; | - |
2765 | ++len; never executed (the execution status of this line is deduced): ++len; | - |
2766 | } | 0 |
2767 | spans[current].len = len; never executed (the execution status of this line is deduced): spans[current].len = len; | - |
2768 | ++current; never executed (the execution status of this line is deduced): ++current; | - |
2769 | } | 0 |
2770 | sl += bpl / sizeof(uint); never executed (the execution status of this line is deduced): sl += bpl / sizeof(uint); | - |
2771 | } | 0 |
2772 | } | 0 |
2773 | // qDebug() << "alphaPenBlt: num spans=" << current | - |
2774 | // << "span:" << spans->x << spans->y << spans->len << spans->coverage; | - |
2775 | // Call span func for current set of spans. | - |
2776 | if (current != 0) partially evaluated: current != 0 yes Evaluation Count:4109 | no Evaluation Count:0 |
| 0-4109 |
2777 | blend(current, spans, &s->penData); executed: blend(current, spans, &s->penData); Execution Count:4109 | 4109 |
2778 | } executed: } Execution Count:4109 | 4109 |
2779 | | - |
2780 | /*! | - |
2781 | \internal | - |
2782 | */ | - |
2783 | bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, | - |
2784 | const QFixedPoint *positions, QFontEngine *fontEngine) | - |
2785 | { | - |
2786 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
2787 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
2788 | | - |
2789 | if (fontEngine->hasInternalCaching()) { evaluated: fontEngine->hasInternalCaching() yes Evaluation Count:18902 | yes Evaluation Count:8 |
| 8-18902 |
2790 | QFontEngine::GlyphFormat neededFormat = executed (the execution status of this line is deduced): QFontEngine::GlyphFormat neededFormat = | - |
2791 | painter()->device()->devType() == QInternal::Widget evaluated: painter()->device()->devType() == QInternal::Widget yes Evaluation Count:17954 | yes Evaluation Count:948 |
| 948-17954 |
2792 | ? QFontEngine::Format_None executed (the execution status of this line is deduced): ? QFontEngine::Format_None | - |
2793 | : QFontEngine::Format_A8; executed (the execution status of this line is deduced): : QFontEngine::Format_A8; | - |
2794 | | - |
2795 | if (d_func()->mono_surface) // alphaPenBlt can handle mono, too evaluated: d_func()->mono_surface yes Evaluation Count:1 | yes Evaluation Count:18901 |
| 1-18901 |
2796 | neededFormat = QFontEngine::Format_Mono; executed: neededFormat = QFontEngine::Format_Mono; Execution Count:1 | 1 |
2797 | | - |
2798 | for (int i = 0; i < numGlyphs; i++) { evaluated: i < numGlyphs yes Evaluation Count:121757 | yes Evaluation Count:18902 |
| 18902-121757 |
2799 | QFixed spp = fontEngine->subPixelPositionForX(positions[i].x); executed (the execution status of this line is deduced): QFixed spp = fontEngine->subPixelPositionForX(positions[i].x); | - |
2800 | | - |
2801 | QPoint offset; executed (the execution status of this line is deduced): QPoint offset; | - |
2802 | 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, | - |
2803 | &offset); executed (the execution status of this line is deduced): &offset); | - |
2804 | if (alphaMap == 0 || alphaMap->isNull()) evaluated: alphaMap == 0 yes Evaluation Count:10804 | yes Evaluation Count:110953 |
evaluated: alphaMap->isNull() yes Evaluation Count:1 | yes Evaluation Count:110952 |
| 1-110953 |
2805 | continue; executed: continue; Execution Count:10805 | 10805 |
2806 | | - |
2807 | alphaPenBlt(alphaMap->bits(), alphaMap->bytesPerLine(), alphaMap->depth(), executed (the execution status of this line is deduced): alphaPenBlt(alphaMap->bits(), alphaMap->bytesPerLine(), alphaMap->depth(), | - |
2808 | qFloor(positions[i].x) + offset.x(), executed (the execution status of this line is deduced): qFloor(positions[i].x) + offset.x(), | - |
2809 | qRound(positions[i].y) + offset.y(), executed (the execution status of this line is deduced): qRound(positions[i].y) + offset.y(), | - |
2810 | alphaMap->width(), alphaMap->height()); executed (the execution status of this line is deduced): alphaMap->width(), alphaMap->height()); | - |
2811 | | - |
2812 | fontEngine->unlockAlphaMapForGlyph(); executed (the execution status of this line is deduced): fontEngine->unlockAlphaMapForGlyph(); | - |
2813 | } executed: } Execution Count:110952 | 110952 |
2814 | | - |
2815 | } else { executed: } Execution Count:18902 | 18902 |
2816 | QFontEngineGlyphCache::Type glyphType = fontEngine->glyphFormat >= 0 ? QFontEngineGlyphCache::Type(fontEngine->glyphFormat) : d->glyphCacheType; partially evaluated: fontEngine->glyphFormat >= 0 no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
2817 | | - |
2818 | QImageTextureGlyphCache *cache = executed (the execution status of this line is deduced): QImageTextureGlyphCache *cache = | - |
2819 | 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)); | - |
2820 | if (!cache) { evaluated: !cache yes Evaluation Count:1 | yes Evaluation Count:7 |
| 1-7 |
2821 | cache = new QImageTextureGlyphCache(glyphType, s->matrix); executed (the execution status of this line is deduced): cache = new QImageTextureGlyphCache(glyphType, s->matrix); | - |
2822 | fontEngine->setGlyphCache(0, cache); executed (the execution status of this line is deduced): fontEngine->setGlyphCache(0, cache); | - |
2823 | } executed: } Execution Count:1 | 1 |
2824 | | - |
2825 | cache->populate(fontEngine, numGlyphs, glyphs, positions); executed (the execution status of this line is deduced): cache->populate(fontEngine, numGlyphs, glyphs, positions); | - |
2826 | cache->fillInPendingGlyphs(); executed (the execution status of this line is deduced): cache->fillInPendingGlyphs(); | - |
2827 | | - |
2828 | const QImage &image = cache->image(); executed (the execution status of this line is deduced): const QImage &image = cache->image(); | - |
2829 | int bpl = image.bytesPerLine(); executed (the execution status of this line is deduced): int bpl = image.bytesPerLine(); | - |
2830 | | - |
2831 | int depth = image.depth(); executed (the execution status of this line is deduced): int depth = image.depth(); | - |
2832 | int rightShift = 0; executed (the execution status of this line is deduced): int rightShift = 0; | - |
2833 | int leftShift = 0; executed (the execution status of this line is deduced): int leftShift = 0; | - |
2834 | if (depth == 32) partially evaluated: depth == 32 no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
2835 | leftShift = 2; // multiply by 4 never executed: leftShift = 2; | 0 |
2836 | else if (depth == 1) partially evaluated: depth == 1 no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
2837 | rightShift = 3; // divide by 8 never executed: rightShift = 3; | 0 |
2838 | | - |
2839 | int margin = fontEngine->glyphMargin(glyphType); executed (the execution status of this line is deduced): int margin = fontEngine->glyphMargin(glyphType); | - |
2840 | const uchar *bits = image.bits(); executed (the execution status of this line is deduced): const uchar *bits = image.bits(); | - |
2841 | for (int i=0; i<numGlyphs; ++i) { evaluated: i<numGlyphs yes Evaluation Count:24 | yes Evaluation Count:8 |
| 8-24 |
2842 | | - |
2843 | QFixed subPixelPosition = fontEngine->subPixelPositionForX(positions[i].x); executed (the execution status of this line is deduced): QFixed subPixelPosition = fontEngine->subPixelPositionForX(positions[i].x); | - |
2844 | QTextureGlyphCache::GlyphAndSubPixelPosition glyph(glyphs[i], subPixelPosition); executed (the execution status of this line is deduced): QTextureGlyphCache::GlyphAndSubPixelPosition glyph(glyphs[i], subPixelPosition); | - |
2845 | const QTextureGlyphCache::Coord &c = cache->coords[glyph]; executed (the execution status of this line is deduced): const QTextureGlyphCache::Coord &c = cache->coords[glyph]; | - |
2846 | if (c.isNull()) partially evaluated: c.isNull() no Evaluation Count:0 | yes Evaluation Count:24 |
| 0-24 |
2847 | continue; never executed: continue; | 0 |
2848 | | - |
2849 | 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; | - |
2850 | 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; | - |
2851 | | - |
2852 | // printf("drawing [%d %d %d %d] baseline [%d %d], glyph: %d, to: %d %d, pos: %d %d\n", | - |
2853 | // c.x, c.y, | - |
2854 | // c.w, c.h, | - |
2855 | // c.baseLineX, c.baseLineY, | - |
2856 | // glyphs[i], | - |
2857 | // x, y, | - |
2858 | // positions[i].x.toInt(), positions[i].y.toInt()); | - |
2859 | | - |
2860 | 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); | - |
2861 | } executed: } Execution Count:24 | 24 |
2862 | } executed: } Execution Count:8 | 8 |
2863 | return true; executed: return true; Execution Count:18910 | 18910 |
2864 | } | - |
2865 | | - |
2866 | | - |
2867 | /*! | - |
2868 | * Returns true if the rectangle is completely within the current clip | - |
2869 | * state of the paint engine. | - |
2870 | */ | - |
2871 | bool QRasterPaintEnginePrivate::isUnclipped_normalized(const QRect &r) const | - |
2872 | { | - |
2873 | const QClipData *cl = clip(); executed (the execution status of this line is deduced): const QClipData *cl = clip(); | - |
2874 | if (!cl) { partially evaluated: !cl no Evaluation Count:0 | yes Evaluation Count:935 |
| 0-935 |
2875 | // inline contains() for performance (we know the rects are normalized) | - |
2876 | const QRect &r1 = deviceRect; never executed (the execution status of this line is deduced): const QRect &r1 = deviceRect; | - |
2877 | 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 |
2878 | && 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 |
2879 | } | - |
2880 | | - |
2881 | | - |
2882 | if (cl->hasRectClip) { partially evaluated: cl->hasRectClip no Evaluation Count:0 | yes Evaluation Count:935 |
| 0-935 |
2883 | // currently all painting functions clips to deviceRect internally | - |
2884 | if (cl->clipRect == deviceRect) never evaluated: cl->clipRect == deviceRect | 0 |
2885 | return true; never executed: return true; | 0 |
2886 | | - |
2887 | // inline contains() for performance (we know the rects are normalized) | - |
2888 | const QRect &r1 = cl->clipRect; never executed (the execution status of this line is deduced): const QRect &r1 = cl->clipRect; | - |
2889 | 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 |
2890 | && 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 |
2891 | } else { | - |
2892 | return qt_region_strictContains(cl->clipRegion, r); executed: return qt_region_strictContains(cl->clipRegion, r); Execution Count:935 | 935 |
2893 | } | - |
2894 | } | - |
2895 | | - |
2896 | bool QRasterPaintEnginePrivate::isUnclipped(const QRect &rect, | - |
2897 | int penWidth) const | - |
2898 | { | - |
2899 | Q_Q(const QRasterPaintEngine); executed (the execution status of this line is deduced): const QRasterPaintEngine * const q = q_func(); | - |
2900 | const QRasterPaintEngineState *s = q->state(); executed (the execution status of this line is deduced): const QRasterPaintEngineState *s = q->state(); | - |
2901 | const QClipData *cl = clip(); executed (the execution status of this line is deduced): const QClipData *cl = clip(); | - |
2902 | if (!cl) { partially evaluated: !cl no Evaluation Count:0 | yes Evaluation Count:136639 |
| 0-136639 |
2903 | QRect r = rect.normalized(); never executed (the execution status of this line is deduced): QRect r = rect.normalized(); | - |
2904 | // inline contains() for performance (we know the rects are normalized) | - |
2905 | const QRect &r1 = deviceRect; never executed (the execution status of this line is deduced): const QRect &r1 = deviceRect; | - |
2906 | 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 |
2907 | && 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 |
2908 | } | - |
2909 | | - |
2910 | | - |
2911 | // currently all painting functions that call this function clip to deviceRect internally | - |
2912 | if (cl->hasRectClip && cl->clipRect == deviceRect) partially evaluated: cl->hasRectClip yes Evaluation Count:136639 | no Evaluation Count:0 |
evaluated: cl->clipRect == deviceRect yes Evaluation Count:136488 | yes Evaluation Count:151 |
| 0-136639 |
2913 | return true; executed: return true; Execution Count:136488 | 136488 |
2914 | | - |
2915 | if (s->flags.antialiased) evaluated: s->flags.antialiased yes Evaluation Count:78 | yes Evaluation Count:73 |
| 73-78 |
2916 | ++penWidth; executed: ++penWidth; Execution Count:78 | 78 |
2917 | | - |
2918 | QRect r = rect.normalized(); executed (the execution status of this line is deduced): QRect r = rect.normalized(); | - |
2919 | if (penWidth > 0) { evaluated: penWidth > 0 yes Evaluation Count:78 | yes Evaluation Count:73 |
| 73-78 |
2920 | r.setX(r.x() - penWidth); executed (the execution status of this line is deduced): r.setX(r.x() - penWidth); | - |
2921 | r.setY(r.y() - penWidth); executed (the execution status of this line is deduced): r.setY(r.y() - penWidth); | - |
2922 | r.setWidth(r.width() + 2 * penWidth); executed (the execution status of this line is deduced): r.setWidth(r.width() + 2 * penWidth); | - |
2923 | r.setHeight(r.height() + 2 * penWidth); executed (the execution status of this line is deduced): r.setHeight(r.height() + 2 * penWidth); | - |
2924 | } executed: } Execution Count:78 | 78 |
2925 | | - |
2926 | if (cl->hasRectClip) { partially evaluated: cl->hasRectClip yes Evaluation Count:151 | no Evaluation Count:0 |
| 0-151 |
2927 | // inline contains() for performance (we know the rects are normalized) | - |
2928 | const QRect &r1 = cl->clipRect; executed (the execution status of this line is deduced): const QRect &r1 = cl->clipRect; | - |
2929 | 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:151 | 151 |
2930 | && 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:151 | 151 |
2931 | } else { | - |
2932 | return qt_region_strictContains(cl->clipRegion, r); never executed: return qt_region_strictContains(cl->clipRegion, r); | 0 |
2933 | } | - |
2934 | } | - |
2935 | | - |
2936 | inline bool QRasterPaintEnginePrivate::isUnclipped(const QRectF &rect, | - |
2937 | int penWidth) const | - |
2938 | { | - |
2939 | return isUnclipped(rect.normalized().toAlignedRect(), penWidth); executed: return isUnclipped(rect.normalized().toAlignedRect(), penWidth); Execution Count:3095 | 3095 |
2940 | } | - |
2941 | | - |
2942 | inline ProcessSpans | - |
2943 | QRasterPaintEnginePrivate::getBrushFunc(const QRect &rect, | - |
2944 | const QSpanData *data) const | - |
2945 | { | - |
2946 | return isUnclipped(rect, 0) ? data->unclipped_blend : data->blend; executed: return isUnclipped(rect, 0) ? data->unclipped_blend : data->blend; Execution Count:133544 | 133544 |
2947 | } | - |
2948 | | - |
2949 | inline ProcessSpans | - |
2950 | QRasterPaintEnginePrivate::getBrushFunc(const QRectF &rect, | - |
2951 | const QSpanData *data) const | - |
2952 | { | - |
2953 | return isUnclipped(rect, 0) ? data->unclipped_blend : data->blend; executed: return isUnclipped(rect, 0) ? data->unclipped_blend : data->blend; Execution Count:2117 | 2117 |
2954 | } | - |
2955 | | - |
2956 | inline ProcessSpans | - |
2957 | QRasterPaintEnginePrivate::getPenFunc(const QRectF &rect, | - |
2958 | const QSpanData *data) const | - |
2959 | { | - |
2960 | Q_Q(const QRasterPaintEngine); executed (the execution status of this line is deduced): const QRasterPaintEngine * const q = q_func(); | - |
2961 | const QRasterPaintEngineState *s = q->state(); executed (the execution status of this line is deduced): const QRasterPaintEngineState *s = q->state(); | - |
2962 | | - |
2963 | if (!s->flags.fast_pen && s->matrix.type() > QTransform::TxTranslate) evaluated: !s->flags.fast_pen yes Evaluation Count:97 | yes Evaluation Count:881 |
partially evaluated: s->matrix.type() > QTransform::TxTranslate no Evaluation Count:0 | yes Evaluation Count:97 |
| 0-881 |
2964 | return data->blend; never executed: return data->blend; | 0 |
2965 | const int penWidth = s->flags.fast_pen ? 1 : qCeil(s->lastPen.widthF()); evaluated: s->flags.fast_pen yes Evaluation Count:881 | yes Evaluation Count:97 |
| 97-881 |
2966 | return isUnclipped(rect, penWidth) ? data->unclipped_blend : data->blend; executed: return isUnclipped(rect, penWidth) ? data->unclipped_blend : data->blend; Execution Count:978 | 978 |
2967 | } | - |
2968 | | - |
2969 | static QPair<int, int> visibleGlyphRange(const QRectF &clip, QFontEngine *fontEngine, | - |
2970 | glyph_t *glyphs, QFixedPoint *positions, int numGlyphs) | - |
2971 | { | - |
2972 | QFixed clipLeft = QFixed::fromReal(clip.left()); executed (the execution status of this line is deduced): QFixed clipLeft = QFixed::fromReal(clip.left()); | - |
2973 | QFixed clipRight = QFixed::fromReal(clip.right()); executed (the execution status of this line is deduced): QFixed clipRight = QFixed::fromReal(clip.right()); | - |
2974 | QFixed clipTop = QFixed::fromReal(clip.top()); executed (the execution status of this line is deduced): QFixed clipTop = QFixed::fromReal(clip.top()); | - |
2975 | QFixed clipBottom = QFixed::fromReal(clip.bottom()); executed (the execution status of this line is deduced): QFixed clipBottom = QFixed::fromReal(clip.bottom()); | - |
2976 | | - |
2977 | int first = 0; executed (the execution status of this line is deduced): int first = 0; | - |
2978 | while (first < numGlyphs) { partially evaluated: first < numGlyphs yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
2979 | 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]); | - |
2980 | QFixed left = metrics.x + positions[first].x; executed (the execution status of this line is deduced): QFixed left = metrics.x + positions[first].x; | - |
2981 | QFixed top = metrics.y + positions[first].y; executed (the execution status of this line is deduced): QFixed top = metrics.y + positions[first].y; | - |
2982 | QFixed right = left + metrics.width; executed (the execution status of this line is deduced): QFixed right = left + metrics.width; | - |
2983 | QFixed bottom = top + metrics.height; executed (the execution status of this line is deduced): QFixed bottom = top + metrics.height; | - |
2984 | if (left < clipRight && right > clipLeft && top < clipBottom && bottom > clipTop) partially evaluated: left < clipRight yes Evaluation Count:3 | no Evaluation Count:0 |
partially evaluated: right > clipLeft yes Evaluation Count:3 | no Evaluation Count:0 |
partially evaluated: top < clipBottom yes Evaluation Count:3 | no Evaluation Count:0 |
partially evaluated: bottom > clipTop yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
2985 | break; executed: break; Execution Count:3 | 3 |
2986 | ++first; never executed (the execution status of this line is deduced): ++first; | - |
2987 | } | 0 |
2988 | int last = numGlyphs - 1; executed (the execution status of this line is deduced): int last = numGlyphs - 1; | - |
2989 | while (last > first) { partially evaluated: last > first yes Evaluation Count:12 | no Evaluation Count:0 |
| 0-12 |
2990 | 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]); | - |
2991 | QFixed left = metrics.x + positions[last].x; executed (the execution status of this line is deduced): QFixed left = metrics.x + positions[last].x; | - |
2992 | QFixed top = metrics.y + positions[last].y; executed (the execution status of this line is deduced): QFixed top = metrics.y + positions[last].y; | - |
2993 | QFixed right = left + metrics.width; executed (the execution status of this line is deduced): QFixed right = left + metrics.width; | - |
2994 | QFixed bottom = top + metrics.height; executed (the execution status of this line is deduced): QFixed bottom = top + metrics.height; | - |
2995 | if (left < clipRight && right > clipLeft && top < clipBottom && bottom > clipTop) evaluated: left < clipRight yes Evaluation Count:3 | yes Evaluation Count:9 |
partially evaluated: right > clipLeft yes Evaluation Count:3 | no Evaluation Count:0 |
partially evaluated: top < clipBottom yes Evaluation Count:3 | no Evaluation Count:0 |
partially evaluated: bottom > clipTop yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-9 |
2996 | break; executed: break; Execution Count:3 | 3 |
2997 | --last; executed (the execution status of this line is deduced): --last; | - |
2998 | } executed: } Execution Count:9 | 9 |
2999 | return QPair<int, int>(first, last + 1); executed: return QPair<int, int>(first, last + 1); Execution Count:3 | 3 |
3000 | } | - |
3001 | | - |
3002 | /*! | - |
3003 | \reimp | - |
3004 | */ | - |
3005 | void QRasterPaintEngine::drawStaticTextItem(QStaticTextItem *textItem) | - |
3006 | { | - |
3007 | if (textItem->numGlyphs == 0) partially evaluated: textItem->numGlyphs == 0 no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
3008 | return; | 0 |
3009 | | - |
3010 | ensurePen(); never executed (the execution status of this line is deduced): ensurePen(); | - |
3011 | ensureRasterState(); never executed (the execution status of this line is deduced): ensureRasterState(); | - |
3012 | | - |
3013 | QFontEngine *fontEngine = textItem->fontEngine(); never executed (the execution status of this line is deduced): QFontEngine *fontEngine = textItem->fontEngine(); | - |
3014 | if (!supportsTransformations(fontEngine)) { partially evaluated: !supportsTransformations(fontEngine) yes Evaluation Count:12 | no Evaluation Count:0 |
| 0-12 |
3015 | drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->glyphPositions, executed (the execution status of this line is deduced): drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->glyphPositions, | - |
3016 | fontEngine); executed (the execution status of this line is deduced): fontEngine); | - |
3017 | } else if (state()->matrix.type() < QTransform::TxProject) { executed: } Execution Count:12 never evaluated: state()->matrix.type() < QTransform::TxProject | 0-12 |
3018 | bool invertible; never executed (the execution status of this line is deduced): bool invertible; | - |
3019 | QTransform invMat = state()->matrix.inverted(&invertible); never executed (the execution status of this line is deduced): QTransform invMat = state()->matrix.inverted(&invertible); | - |
3020 | if (!invertible) never evaluated: !invertible | 0 |
3021 | return; | 0 |
3022 | | - |
3023 | 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()), | - |
3024 | textItem->fontEngine(), textItem->glyphs, never executed (the execution status of this line is deduced): textItem->fontEngine(), textItem->glyphs, | - |
3025 | textItem->glyphPositions, textItem->numGlyphs); never executed (the execution status of this line is deduced): textItem->glyphPositions, textItem->numGlyphs); | - |
3026 | QStaticTextItem copy = *textItem; never executed (the execution status of this line is deduced): QStaticTextItem copy = *textItem; | - |
3027 | copy.glyphs += range.first; never executed (the execution status of this line is deduced): copy.glyphs += range.first; | - |
3028 | copy.glyphPositions += range.first; never executed (the execution status of this line is deduced): copy.glyphPositions += range.first; | - |
3029 | copy.numGlyphs = range.second - range.first; never executed (the execution status of this line is deduced): copy.numGlyphs = range.second - range.first; | - |
3030 | QPaintEngineEx::drawStaticTextItem(©); never executed (the execution status of this line is deduced): QPaintEngineEx::drawStaticTextItem(©); | - |
3031 | } else { | 0 |
3032 | QPaintEngineEx::drawStaticTextItem(textItem); never executed (the execution status of this line is deduced): QPaintEngineEx::drawStaticTextItem(textItem); | - |
3033 | } | 0 |
3034 | } | - |
3035 | | - |
3036 | /*! | - |
3037 | \reimp | - |
3038 | */ | - |
3039 | void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem) | - |
3040 | { | - |
3041 | 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); | - |
3042 | | - |
3043 | #ifdef QT_DEBUG_DRAW | - |
3044 | Q_D(QRasterPaintEngine); | - |
3045 | fprintf(stderr," - QRasterPaintEngine::drawTextItem(), (%.2f,%.2f), string=%s ct=%d\n", | - |
3046 | p.x(), p.y(), QString::fromRawData(ti.chars, ti.num_chars).toLatin1().data(), | - |
3047 | d->glyphCacheType); | - |
3048 | #endif | - |
3049 | | - |
3050 | if (ti.glyphs.numGlyphs == 0) partially evaluated: ti.glyphs.numGlyphs == 0 no Evaluation Count:0 | yes Evaluation Count:18901 |
| 0-18901 |
3051 | return; | 0 |
3052 | ensurePen(); executed (the execution status of this line is deduced): ensurePen(); | - |
3053 | ensureRasterState(); executed (the execution status of this line is deduced): ensureRasterState(); | - |
3054 | | - |
3055 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
3056 | QTransform matrix = s->matrix; executed (the execution status of this line is deduced): QTransform matrix = s->matrix; | - |
3057 | | - |
3058 | if (!supportsTransformations(ti.fontEngine)) { evaluated: !supportsTransformations(ti.fontEngine) yes Evaluation Count:18898 | yes Evaluation Count:3 |
| 3-18898 |
3059 | QVarLengthArray<QFixedPoint> positions; executed (the execution status of this line is deduced): QVarLengthArray<QFixedPoint> positions; | - |
3060 | QVarLengthArray<glyph_t> glyphs; executed (the execution status of this line is deduced): QVarLengthArray<glyph_t> glyphs; | - |
3061 | | - |
3062 | matrix.translate(p.x(), p.y()); executed (the execution status of this line is deduced): matrix.translate(p.x(), p.y()); | - |
3063 | 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); | - |
3064 | | - |
3065 | 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); | - |
3066 | } else if (matrix.type() < QTransform::TxProject) { executed: } Execution Count:18898 partially evaluated: matrix.type() < QTransform::TxProject yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-18898 |
3067 | bool invertible; executed (the execution status of this line is deduced): bool invertible; | - |
3068 | QTransform invMat = matrix.inverted(&invertible); executed (the execution status of this line is deduced): QTransform invMat = matrix.inverted(&invertible); | - |
3069 | if (!invertible) partially evaluated: !invertible no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
3070 | return; | 0 |
3071 | | - |
3072 | QVarLengthArray<QFixedPoint> positions; executed (the execution status of this line is deduced): QVarLengthArray<QFixedPoint> positions; | - |
3073 | QVarLengthArray<glyph_t> glyphs; executed (the execution status of this line is deduced): QVarLengthArray<glyph_t> glyphs; | - |
3074 | | - |
3075 | 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()), | - |
3076 | ti.flags, glyphs, positions); executed (the execution status of this line is deduced): ti.flags, glyphs, positions); | - |
3077 | 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()), | - |
3078 | ti.fontEngine, glyphs.data(), positions.data(), executed (the execution status of this line is deduced): ti.fontEngine, glyphs.data(), positions.data(), | - |
3079 | glyphs.size()); executed (the execution status of this line is deduced): glyphs.size()); | - |
3080 | | - |
3081 | if (range.first >= range.second) partially evaluated: range.first >= range.second no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
3082 | return; | 0 |
3083 | | - |
3084 | QStaticTextItem staticTextItem; executed (the execution status of this line is deduced): QStaticTextItem staticTextItem; | - |
3085 | staticTextItem.color = s->pen.color(); executed (the execution status of this line is deduced): staticTextItem.color = s->pen.color(); | - |
3086 | staticTextItem.font = s->font; executed (the execution status of this line is deduced): staticTextItem.font = s->font; | - |
3087 | staticTextItem.setFontEngine(ti.fontEngine); executed (the execution status of this line is deduced): staticTextItem.setFontEngine(ti.fontEngine); | - |
3088 | staticTextItem.numGlyphs = range.second - range.first; executed (the execution status of this line is deduced): staticTextItem.numGlyphs = range.second - range.first; | - |
3089 | staticTextItem.glyphs = glyphs.data() + range.first; executed (the execution status of this line is deduced): staticTextItem.glyphs = glyphs.data() + range.first; | - |
3090 | staticTextItem.glyphPositions = positions.data() + range.first; executed (the execution status of this line is deduced): staticTextItem.glyphPositions = positions.data() + range.first; | - |
3091 | QPaintEngineEx::drawStaticTextItem(&staticTextItem); executed (the execution status of this line is deduced): QPaintEngineEx::drawStaticTextItem(&staticTextItem); | - |
3092 | } else { executed: } Execution Count:3 | 3 |
3093 | QPaintEngineEx::drawTextItem(p, ti); never executed (the execution status of this line is deduced): QPaintEngineEx::drawTextItem(p, ti); | - |
3094 | } | 0 |
3095 | } | - |
3096 | | - |
3097 | /*! | - |
3098 | \reimp | - |
3099 | */ | - |
3100 | void QRasterPaintEngine::drawPoints(const QPointF *points, int pointCount) | - |
3101 | { | - |
3102 | Q_D(QRasterPaintEngine); never executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
3103 | QRasterPaintEngineState *s = state(); never executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
3104 | | - |
3105 | ensurePen(); never executed (the execution status of this line is deduced): ensurePen(); | - |
3106 | if (!s->penData.blend) never evaluated: !s->penData.blend | 0 |
3107 | return; | 0 |
3108 | | - |
3109 | if (!s->flags.fast_pen) { never evaluated: !s->flags.fast_pen | 0 |
3110 | QPaintEngineEx::drawPoints(points, pointCount); never executed (the execution status of this line is deduced): QPaintEngineEx::drawPoints(points, pointCount); | - |
3111 | return; | 0 |
3112 | } | - |
3113 | | - |
3114 | QCosmeticStroker stroker(s, d->deviceRect); never executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect); | - |
3115 | stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); never executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); | - |
3116 | stroker.drawPoints(points, pointCount); never executed (the execution status of this line is deduced): stroker.drawPoints(points, pointCount); | - |
3117 | } | 0 |
3118 | | - |
3119 | | - |
3120 | void QRasterPaintEngine::drawPoints(const QPoint *points, int pointCount) | - |
3121 | { | - |
3122 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
3123 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
3124 | | - |
3125 | ensurePen(); executed (the execution status of this line is deduced): ensurePen(); | - |
3126 | if (!s->penData.blend) partially evaluated: !s->penData.blend no Evaluation Count:0 | yes Evaluation Count:147 |
| 0-147 |
3127 | return; | 0 |
3128 | | - |
3129 | if (!s->flags.fast_pen) { evaluated: !s->flags.fast_pen yes Evaluation Count:1 | yes Evaluation Count:146 |
| 1-146 |
3130 | QPaintEngineEx::drawPoints(points, pointCount); executed (the execution status of this line is deduced): QPaintEngineEx::drawPoints(points, pointCount); | - |
3131 | return; executed: return; Execution Count:1 | 1 |
3132 | } | - |
3133 | | - |
3134 | QCosmeticStroker stroker(s, d->deviceRect); executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect); | - |
3135 | stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); | - |
3136 | stroker.drawPoints(points, pointCount); executed (the execution status of this line is deduced): stroker.drawPoints(points, pointCount); | - |
3137 | } executed: } Execution Count:146 | 146 |
3138 | | - |
3139 | /*! | - |
3140 | \reimp | - |
3141 | */ | - |
3142 | void QRasterPaintEngine::drawLines(const QLine *lines, int lineCount) | - |
3143 | { | - |
3144 | #ifdef QT_DEBUG_DRAW | - |
3145 | qDebug() << " - QRasterPaintEngine::drawLines(QLine*)" << lineCount; | - |
3146 | #endif | - |
3147 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
3148 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
3149 | | - |
3150 | ensurePen(); executed (the execution status of this line is deduced): ensurePen(); | - |
3151 | if (!s->penData.blend) evaluated: !s->penData.blend yes Evaluation Count:48 | yes Evaluation Count:3526 |
| 48-3526 |
3152 | return; executed: return; Execution Count:48 | 48 |
3153 | | - |
3154 | if (s->flags.fast_pen) { evaluated: s->flags.fast_pen yes Evaluation Count:3471 | yes Evaluation Count:55 |
| 55-3471 |
3155 | QCosmeticStroker stroker(s, d->deviceRect); executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect); | - |
3156 | stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); | - |
3157 | for (int i=0; i<lineCount; ++i) { evaluated: i<lineCount yes Evaluation Count:3471 | yes Evaluation Count:3471 |
| 3471 |
3158 | const QLine &l = lines[i]; executed (the execution status of this line is deduced): const QLine &l = lines[i]; | - |
3159 | stroker.drawLine(l.p1(), l.p2()); executed (the execution status of this line is deduced): stroker.drawLine(l.p1(), l.p2()); | - |
3160 | } executed: } Execution Count:3471 | 3471 |
3161 | } else { executed: } Execution Count:3471 | 3471 |
3162 | QPaintEngineEx::drawLines(lines, lineCount); executed (the execution status of this line is deduced): QPaintEngineEx::drawLines(lines, lineCount); | - |
3163 | } executed: } Execution Count:55 | 55 |
3164 | } | - |
3165 | | - |
3166 | void QRasterPaintEnginePrivate::rasterizeLine_dashed(QLineF line, | - |
3167 | qreal width, | - |
3168 | int *dashIndex, | - |
3169 | qreal *dashOffset, | - |
3170 | bool *inDash) | - |
3171 | { | - |
3172 | Q_Q(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEngine * const q = q_func(); | - |
3173 | QRasterPaintEngineState *s = q->state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = q->state(); | - |
3174 | | - |
3175 | const QPen &pen = s->lastPen; executed (the execution status of this line is deduced): const QPen &pen = s->lastPen; | - |
3176 | const bool squareCap = (pen.capStyle() == Qt::SquareCap); executed (the execution status of this line is deduced): const bool squareCap = (pen.capStyle() == Qt::SquareCap); | - |
3177 | const QVector<qreal> pattern = pen.dashPattern(); executed (the execution status of this line is deduced): const QVector<qreal> pattern = pen.dashPattern(); | - |
3178 | | - |
3179 | qreal patternLength = 0; executed (the execution status of this line is deduced): qreal patternLength = 0; | - |
3180 | for (int i = 0; i < pattern.size(); ++i) evaluated: i < pattern.size() yes Evaluation Count:10 | yes Evaluation Count:3 |
| 3-10 |
3181 | patternLength += pattern.at(i); executed: patternLength += pattern.at(i); Execution Count:10 | 10 |
3182 | | - |
3183 | if (patternLength <= 0) evaluated: patternLength <= 0 yes Evaluation Count:1 | yes Evaluation Count:2 |
| 1-2 |
3184 | return; executed: return; Execution Count:1 | 1 |
3185 | | - |
3186 | qreal length = line.length(); executed (the execution status of this line is deduced): qreal length = line.length(); | - |
3187 | Q_ASSERT(length > 0); executed (the execution status of this line is deduced): qt_noop(); | - |
3188 | while (length > 0) { evaluated: length > 0 yes Evaluation Count:130 | yes Evaluation Count:2 |
| 2-130 |
3189 | const bool rasterize = *inDash; executed (the execution status of this line is deduced): const bool rasterize = *inDash; | - |
3190 | qreal dash = (pattern.at(*dashIndex) - *dashOffset) * width; executed (the execution status of this line is deduced): qreal dash = (pattern.at(*dashIndex) - *dashOffset) * width; | - |
3191 | QLineF l = line; executed (the execution status of this line is deduced): QLineF l = line; | - |
3192 | | - |
3193 | if (dash >= length) { evaluated: dash >= length yes Evaluation Count:2 | yes Evaluation Count:128 |
| 2-128 |
3194 | dash = length; executed (the execution status of this line is deduced): dash = length; | - |
3195 | *dashOffset += dash / width; executed (the execution status of this line is deduced): *dashOffset += dash / width; | - |
3196 | length = 0; executed (the execution status of this line is deduced): length = 0; | - |
3197 | } else { executed: } Execution Count:2 | 2 |
3198 | *dashOffset = 0; executed (the execution status of this line is deduced): *dashOffset = 0; | - |
3199 | *inDash = !(*inDash); executed (the execution status of this line is deduced): *inDash = !(*inDash); | - |
3200 | if (++*dashIndex >= pattern.size()) evaluated: ++*dashIndex >= pattern.size() yes Evaluation Count:32 | yes Evaluation Count:96 |
| 32-96 |
3201 | *dashIndex = 0; executed: *dashIndex = 0; Execution Count:32 | 32 |
3202 | length -= dash; executed (the execution status of this line is deduced): length -= dash; | - |
3203 | l.setLength(dash); executed (the execution status of this line is deduced): l.setLength(dash); | - |
3204 | line.setP1(l.p2()); executed (the execution status of this line is deduced): line.setP1(l.p2()); | - |
3205 | } executed: } Execution Count:128 | 128 |
3206 | | - |
3207 | if (rasterize && dash > 0) evaluated: rasterize yes Evaluation Count:66 | yes Evaluation Count:64 |
partially evaluated: dash > 0 yes Evaluation Count:66 | no Evaluation Count:0 |
| 0-66 |
3208 | rasterizer->rasterizeLine(l.p1(), l.p2(), width / dash, squareCap); executed: rasterizer->rasterizeLine(l.p1(), l.p2(), width / dash, squareCap); Execution Count:66 | 66 |
3209 | } executed: } Execution Count:130 | 130 |
3210 | } executed: } Execution Count:2 | 2 |
3211 | | - |
3212 | /*! | - |
3213 | \reimp | - |
3214 | */ | - |
3215 | void QRasterPaintEngine::drawLines(const QLineF *lines, int lineCount) | - |
3216 | { | - |
3217 | #ifdef QT_DEBUG_DRAW | - |
3218 | qDebug() << " - QRasterPaintEngine::drawLines(QLineF *)" << lineCount; | - |
3219 | #endif | - |
3220 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
3221 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
3222 | | - |
3223 | ensurePen(); executed (the execution status of this line is deduced): ensurePen(); | - |
3224 | if (!s->penData.blend) evaluated: !s->penData.blend yes Evaluation Count:48 | yes Evaluation Count:1026 |
| 48-1026 |
3225 | return; executed: return; Execution Count:48 | 48 |
3226 | if (s->flags.fast_pen) { evaluated: s->flags.fast_pen yes Evaluation Count:971 | yes Evaluation Count:55 |
| 55-971 |
3227 | QCosmeticStroker stroker(s, d->deviceRect); executed (the execution status of this line is deduced): QCosmeticStroker stroker(s, d->deviceRect); | - |
3228 | stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); executed (the execution status of this line is deduced): stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding); | - |
3229 | for (int i=0; i<lineCount; ++i) { evaluated: i<lineCount yes Evaluation Count:1402 | yes Evaluation Count:971 |
| 971-1402 |
3230 | QLineF line = lines[i]; executed (the execution status of this line is deduced): QLineF line = lines[i]; | - |
3231 | stroker.drawLine(line.p1(), line.p2()); executed (the execution status of this line is deduced): stroker.drawLine(line.p1(), line.p2()); | - |
3232 | } executed: } Execution Count:1402 | 1402 |
3233 | } else { executed: } Execution Count:971 | 971 |
3234 | QPaintEngineEx::drawLines(lines, lineCount); executed (the execution status of this line is deduced): QPaintEngineEx::drawLines(lines, lineCount); | - |
3235 | } executed: } Execution Count:55 | 55 |
3236 | } | - |
3237 | | - |
3238 | | - |
3239 | /*! | - |
3240 | \reimp | - |
3241 | */ | - |
3242 | void QRasterPaintEngine::drawEllipse(const QRectF &rect) | - |
3243 | { | - |
3244 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
3245 | QRasterPaintEngineState *s = state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = state(); | - |
3246 | | - |
3247 | ensurePen(); executed (the execution status of this line is deduced): ensurePen(); | - |
3248 | if (((qpen_style(s->lastPen) == Qt::SolidLine && s->flags.fast_pen) evaluated: qpen_style(s->lastPen) == Qt::SolidLine yes Evaluation Count:885 | yes Evaluation Count:99 |
partially evaluated: s->flags.fast_pen yes Evaluation Count:885 | no Evaluation Count:0 |
| 0-885 |
3249 | || (qpen_style(s->lastPen) == Qt::NoPen)) partially evaluated: (qpen_style(s->lastPen) == Qt::NoPen) yes Evaluation Count:99 | no Evaluation Count:0 |
| 0-99 |
3250 | && !s->flags.antialiased evaluated: !s->flags.antialiased yes Evaluation Count:978 | yes Evaluation Count:6 |
| 6-978 |
3251 | && qMax(rect.width(), rect.height()) < QT_RASTER_COORD_LIMIT partially evaluated: qMax(rect.width(), rect.height()) < QT_RASTER_COORD_LIMIT yes Evaluation Count:978 | no Evaluation Count:0 |
| 0-978 |
3252 | && !rect.isEmpty() partially evaluated: !rect.isEmpty() yes Evaluation Count:978 | no Evaluation Count:0 |
| 0-978 |
3253 | && s->matrix.type() <= QTransform::TxScale) // no shear partially evaluated: s->matrix.type() <= QTransform::TxScale yes Evaluation Count:978 | no Evaluation Count:0 |
| 0-978 |
3254 | { | - |
3255 | ensureBrush(); executed (the execution status of this line is deduced): ensureBrush(); | - |
3256 | const QRectF r = s->matrix.mapRect(rect); executed (the execution status of this line is deduced): const QRectF r = s->matrix.mapRect(rect); | - |
3257 | ProcessSpans penBlend = d->getPenFunc(r, &s->penData); executed (the execution status of this line is deduced): ProcessSpans penBlend = d->getPenFunc(r, &s->penData); | - |
3258 | ProcessSpans brushBlend = d->getBrushFunc(r, &s->brushData); executed (the execution status of this line is deduced): ProcessSpans brushBlend = d->getBrushFunc(r, &s->brushData); | - |
3259 | 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()), | - |
3260 | int_dim(r.x(), r.width()), executed (the execution status of this line is deduced): (int(r.x()+r.width()) - int(r.x())), | - |
3261 | int_dim(r.y(), r.height())); executed (the execution status of this line is deduced): (int(r.y()+r.height()) - int(r.y()))); | - |
3262 | if (brect == r) { partially evaluated: brect == r yes Evaluation Count:978 | no Evaluation Count:0 |
| 0-978 |
3263 | 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, | - |
3264 | &s->penData, &s->brushData); executed (the execution status of this line is deduced): &s->penData, &s->brushData); | - |
3265 | return; executed: return; Execution Count:978 | 978 |
3266 | } | - |
3267 | } | 0 |
3268 | QPaintEngineEx::drawEllipse(rect); executed (the execution status of this line is deduced): QPaintEngineEx::drawEllipse(rect); | - |
3269 | } executed: } Execution Count:6 | 6 |
3270 | | - |
3271 | | - |
3272 | #ifdef Q_OS_WIN | - |
3273 | /*! | - |
3274 | \internal | - |
3275 | */ | - |
3276 | void QRasterPaintEngine::setDC(HDC hdc) { | - |
3277 | Q_D(QRasterPaintEngine); | - |
3278 | d->hdc = hdc; | - |
3279 | } | - |
3280 | | - |
3281 | /*! | - |
3282 | \internal | - |
3283 | */ | - |
3284 | HDC QRasterPaintEngine::getDC() const | - |
3285 | { | - |
3286 | Q_D(const QRasterPaintEngine); | - |
3287 | return d->hdc; | - |
3288 | } | - |
3289 | | - |
3290 | /*! | - |
3291 | \internal | - |
3292 | */ | - |
3293 | void QRasterPaintEngine::releaseDC(HDC) const | - |
3294 | { | - |
3295 | } | - |
3296 | | - |
3297 | #endif | - |
3298 | | - |
3299 | /*! | - |
3300 | \internal | - |
3301 | */ | - |
3302 | bool QRasterPaintEngine::supportsTransformations(QFontEngine *fontEngine) const | - |
3303 | { | - |
3304 | const QTransform &m = state()->matrix; executed (the execution status of this line is deduced): const QTransform &m = state()->matrix; | - |
3305 | return supportsTransformations(fontEngine, m); executed: return supportsTransformations(fontEngine, m); Execution Count:18913 | 18913 |
3306 | } | - |
3307 | | - |
3308 | /*! | - |
3309 | \internal | - |
3310 | */ | - |
3311 | bool QRasterPaintEngine::supportsTransformations(QFontEngine *fontEngine, const QTransform &m) const | - |
3312 | { | - |
3313 | if (fontEngine->supportsTransformations(m)) partially evaluated: fontEngine->supportsTransformations(m) no Evaluation Count:0 | yes Evaluation Count:18925 |
| 0-18925 |
3314 | return true; never executed: return true; | 0 |
3315 | | - |
3316 | return !shouldDrawCachedGlyphs(fontEngine, m); executed: return !shouldDrawCachedGlyphs(fontEngine, m); Execution Count:18925 | 18925 |
3317 | } | - |
3318 | | - |
3319 | /*! | - |
3320 | \internal | - |
3321 | */ | - |
3322 | QPoint QRasterPaintEngine::coordinateOffset() const | - |
3323 | { | - |
3324 | return QPoint(0, 0); executed: return QPoint(0, 0); Execution Count:16964 | 16964 |
3325 | } | - |
3326 | | - |
3327 | void QRasterPaintEngine::drawBitmap(const QPointF &pos, const QImage &image, QSpanData *fg) | - |
3328 | { | - |
3329 | Q_ASSERT(fg); executed (the execution status of this line is deduced): qt_noop(); | - |
3330 | if (!fg->blend) partially evaluated: !fg->blend no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3331 | return; | 0 |
3332 | Q_D(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEnginePrivate * const d = d_func(); | - |
3333 | | - |
3334 | Q_ASSERT(image.depth() == 1); executed (the execution status of this line is deduced): qt_noop(); | - |
3335 | | - |
3336 | const int spanCount = 256; executed (the execution status of this line is deduced): const int spanCount = 256; | - |
3337 | QT_FT_Span spans[spanCount]; executed (the execution status of this line is deduced): QT_FT_Span spans[spanCount]; | - |
3338 | int n = 0; executed (the execution status of this line is deduced): int n = 0; | - |
3339 | | - |
3340 | // Boundaries | - |
3341 | int w = image.width(); executed (the execution status of this line is deduced): int w = image.width(); | - |
3342 | int h = image.height(); executed (the execution status of this line is deduced): int h = image.height(); | - |
3343 | 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()); | - |
3344 | int ymin = qMax(qRound(pos.y()), 0); executed (the execution status of this line is deduced): int ymin = qMax(qRound(pos.y()), 0); | - |
3345 | 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()); | - |
3346 | int xmin = qMax(qRound(pos.x()), 0); executed (the execution status of this line is deduced): int xmin = qMax(qRound(pos.x()), 0); | - |
3347 | | - |
3348 | int x_offset = xmin - qRound(pos.x()); executed (the execution status of this line is deduced): int x_offset = xmin - qRound(pos.x()); | - |
3349 | | - |
3350 | QImage::Format format = image.format(); executed (the execution status of this line is deduced): QImage::Format format = image.format(); | - |
3351 | for (int y = ymin; y < ymax; ++y) { evaluated: y < ymax yes Evaluation Count:10 | yes Evaluation Count:1 |
| 1-10 |
3352 | 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())); | - |
3353 | if (format == QImage::Format_MonoLSB) { partially evaluated: format == QImage::Format_MonoLSB yes Evaluation Count:10 | no Evaluation Count:0 |
| 0-10 |
3354 | for (int x = 0; x < xmax - xmin; ++x) { evaluated: x < xmax - xmin yes Evaluation Count:10 | yes Evaluation Count:10 |
| 10 |
3355 | int src_x = x + x_offset; executed (the execution status of this line is deduced): int src_x = x + x_offset; | - |
3356 | uchar pixel = src[src_x >> 3]; executed (the execution status of this line is deduced): uchar pixel = src[src_x >> 3]; | - |
3357 | if (!pixel) { partially evaluated: !pixel no Evaluation Count:0 | yes Evaluation Count:10 |
| 0-10 |
3358 | x += 7 - (src_x%8); never executed (the execution status of this line is deduced): x += 7 - (src_x%8); | - |
3359 | continue; never executed: continue; | 0 |
3360 | } | - |
3361 | if (pixel & (0x1 << (src_x & 7))) { partially evaluated: pixel & (0x1 << (src_x & 7)) yes Evaluation Count:10 | no Evaluation Count:0 |
| 0-10 |
3362 | spans[n].x = xmin + x; executed (the execution status of this line is deduced): spans[n].x = xmin + x; | - |
3363 | spans[n].y = y; executed (the execution status of this line is deduced): spans[n].y = y; | - |
3364 | spans[n].coverage = 255; executed (the execution status of this line is deduced): spans[n].coverage = 255; | - |
3365 | int len = 1; executed (the execution status of this line is deduced): int len = 1; | - |
3366 | while (src_x+1 < w && src[(src_x+1) >> 3] & (0x1 << ((src_x+1) & 7))) { evaluated: src_x+1 < w yes Evaluation Count:90 | yes Evaluation Count:10 |
partially evaluated: src[(src_x+1) >> 3] & (0x1 << ((src_x+1) & 7)) yes Evaluation Count:90 | no Evaluation Count:0 |
| 0-90 |
3367 | ++src_x; executed (the execution status of this line is deduced): ++src_x; | - |
3368 | ++len; executed (the execution status of this line is deduced): ++len; | - |
3369 | } executed: } Execution Count:90 | 90 |
3370 | spans[n].len = ((len + spans[n].x) > xmax) ? (xmax - spans[n].x) : len; partially evaluated: ((len + spans[n].x) > xmax) no Evaluation Count:0 | yes Evaluation Count:10 |
| 0-10 |
3371 | x += len; executed (the execution status of this line is deduced): x += len; | - |
3372 | ++n; executed (the execution status of this line is deduced): ++n; | - |
3373 | if (n == spanCount) { partially evaluated: n == spanCount no Evaluation Count:0 | yes Evaluation Count:10 |
| 0-10 |
3374 | fg->blend(n, spans, fg); never executed (the execution status of this line is deduced): fg->blend(n, spans, fg); | - |
3375 | n = 0; never executed (the execution status of this line is deduced): n = 0; | - |
3376 | } | 0 |
3377 | } executed: } Execution Count:10 | 10 |
3378 | } executed: } Execution Count:10 | 10 |
3379 | } else { executed: } Execution Count:10 | 10 |
3380 | for (int x = 0; x < xmax - xmin; ++x) { never evaluated: x < xmax - xmin | 0 |
3381 | int src_x = x + x_offset; never executed (the execution status of this line is deduced): int src_x = x + x_offset; | - |
3382 | uchar pixel = src[src_x >> 3]; never executed (the execution status of this line is deduced): uchar pixel = src[src_x >> 3]; | - |
3383 | if (!pixel) { | 0 |
3384 | x += 7 - (src_x%8); never executed (the execution status of this line is deduced): x += 7 - (src_x%8); | - |
3385 | continue; never executed: continue; | 0 |
3386 | } | - |
3387 | if (pixel & (0x80 >> (x & 7))) { never evaluated: pixel & (0x80 >> (x & 7)) | 0 |
3388 | spans[n].x = xmin + x; never executed (the execution status of this line is deduced): spans[n].x = xmin + x; | - |
3389 | spans[n].y = y; never executed (the execution status of this line is deduced): spans[n].y = y; | - |
3390 | spans[n].coverage = 255; never executed (the execution status of this line is deduced): spans[n].coverage = 255; | - |
3391 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
3392 | 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 |
3393 | ++src_x; never executed (the execution status of this line is deduced): ++src_x; | - |
3394 | ++len; never executed (the execution status of this line is deduced): ++len; | - |
3395 | } | 0 |
3396 | spans[n].len = ((len + spans[n].x) > xmax) ? (xmax - spans[n].x) : len; never evaluated: ((len + spans[n].x) > xmax) | 0 |
3397 | x += len; never executed (the execution status of this line is deduced): x += len; | - |
3398 | ++n; never executed (the execution status of this line is deduced): ++n; | - |
3399 | if (n == spanCount) { never evaluated: n == spanCount | 0 |
3400 | fg->blend(n, spans, fg); never executed (the execution status of this line is deduced): fg->blend(n, spans, fg); | - |
3401 | n = 0; never executed (the execution status of this line is deduced): n = 0; | - |
3402 | } | 0 |
3403 | } | 0 |
3404 | } | 0 |
3405 | } | 0 |
3406 | } | - |
3407 | if (n) { partially evaluated: n yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
3408 | fg->blend(n, spans, fg); executed (the execution status of this line is deduced): fg->blend(n, spans, fg); | - |
3409 | n = 0; executed (the execution status of this line is deduced): n = 0; | - |
3410 | } executed: } Execution Count:1 | 1 |
3411 | } executed: } Execution Count:1 | 1 |
3412 | | - |
3413 | /*! | - |
3414 | \enum QRasterPaintEngine::ClipType | - |
3415 | \internal | - |
3416 | | - |
3417 | \value RectClip Indicates that the currently set clip is a single rectangle. | - |
3418 | \value ComplexClip Indicates that the currently set clip is a combination of several shapes. | - |
3419 | */ | - |
3420 | | - |
3421 | /*! | - |
3422 | \internal | - |
3423 | Returns the type of the clip currently set. | - |
3424 | */ | - |
3425 | QRasterPaintEngine::ClipType QRasterPaintEngine::clipType() const | - |
3426 | { | - |
3427 | Q_D(const QRasterPaintEngine); executed (the execution status of this line is deduced): const QRasterPaintEnginePrivate * const d = d_func(); | - |
3428 | | - |
3429 | const QClipData *clip = d->clip(); executed (the execution status of this line is deduced): const QClipData *clip = d->clip(); | - |
3430 | if (!clip || clip->hasRectClip) partially evaluated: !clip no Evaluation Count:0 | yes Evaluation Count:2 |
partially evaluated: clip->hasRectClip yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
3431 | return RectClip; executed: return RectClip; Execution Count:2 | 2 |
3432 | else | - |
3433 | return ComplexClip; never executed: return ComplexClip; | 0 |
3434 | } | - |
3435 | | - |
3436 | /*! | - |
3437 | \internal | - |
3438 | Returns the bounding rect of the currently set clip. | - |
3439 | */ | - |
3440 | QRect QRasterPaintEngine::clipBoundingRect() const | - |
3441 | { | - |
3442 | Q_D(const QRasterPaintEngine); executed (the execution status of this line is deduced): const QRasterPaintEnginePrivate * const d = d_func(); | - |
3443 | | - |
3444 | const QClipData *clip = d->clip(); executed (the execution status of this line is deduced): const QClipData *clip = d->clip(); | - |
3445 | | - |
3446 | if (!clip) partially evaluated: !clip no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
3447 | return d->deviceRect; never executed: return d->deviceRect; | 0 |
3448 | | - |
3449 | if (clip->hasRectClip) partially evaluated: clip->hasRectClip yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
3450 | return clip->clipRect; executed: return clip->clipRect; Execution Count:5 | 5 |
3451 | | - |
3452 | 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 |
3453 | } | - |
3454 | | - |
3455 | void QRasterPaintEnginePrivate::initializeRasterizer(QSpanData *data) | - |
3456 | { | - |
3457 | Q_Q(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEngine * const q = q_func(); | - |
3458 | QRasterPaintEngineState *s = q->state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = q->state(); | - |
3459 | | - |
3460 | rasterizer->setAntialiased(s->flags.antialiased); executed (the execution status of this line is deduced): rasterizer->setAntialiased(s->flags.antialiased); | - |
3461 | rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding); executed (the execution status of this line is deduced): rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding); | - |
3462 | | - |
3463 | QRect clipRect(deviceRect); executed (the execution status of this line is deduced): QRect clipRect(deviceRect); | - |
3464 | ProcessSpans blend; executed (the execution status of this line is deduced): ProcessSpans blend; | - |
3465 | // ### get from optimized rectbased QClipData | - |
3466 | | - |
3467 | const QClipData *c = clip(); executed (the execution status of this line is deduced): const QClipData *c = clip(); | - |
3468 | if (c) { partially evaluated: c yes Evaluation Count:118410 | no Evaluation Count:0 |
| 0-118410 |
3469 | 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), | - |
3470 | 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)); | - |
3471 | clipRect = clipRect.intersected(r); executed (the execution status of this line is deduced): clipRect = clipRect.intersected(r); | - |
3472 | blend = data->blend; executed (the execution status of this line is deduced): blend = data->blend; | - |
3473 | } else { executed: } Execution Count:118410 | 118410 |
3474 | blend = data->unclipped_blend; never executed (the execution status of this line is deduced): blend = data->unclipped_blend; | - |
3475 | } | 0 |
3476 | | - |
3477 | rasterizer->setClipRect(clipRect); executed (the execution status of this line is deduced): rasterizer->setClipRect(clipRect); | - |
3478 | rasterizer->initialize(blend, data); executed (the execution status of this line is deduced): rasterizer->initialize(blend, data); | - |
3479 | } executed: } Execution Count:118410 | 118410 |
3480 | | - |
3481 | void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline, | - |
3482 | ProcessSpans callback, | - |
3483 | QSpanData *spanData, QRasterBuffer *rasterBuffer) | - |
3484 | { | - |
3485 | if (!callback || !outline) partially evaluated: !callback no Evaluation Count:0 | yes Evaluation Count:134683 |
partially evaluated: !outline no Evaluation Count:0 | yes Evaluation Count:134683 |
| 0-134683 |
3486 | return; | 0 |
3487 | | - |
3488 | Q_Q(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEngine * const q = q_func(); | - |
3489 | QRasterPaintEngineState *s = q->state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = q->state(); | - |
3490 | | - |
3491 | if (!s->flags.antialiased) { evaluated: !s->flags.antialiased yes Evaluation Count:118176 | yes Evaluation Count:16507 |
| 16507-118176 |
3492 | initializeRasterizer(spanData); executed (the execution status of this line is deduced): initializeRasterizer(spanData); | - |
3493 | | - |
3494 | const Qt::FillRule fillRule = outline->flags == QT_FT_OUTLINE_NONE evaluated: outline->flags == 0x0 yes Evaluation Count:65 | yes Evaluation Count:118111 |
| 65-118111 |
3495 | ? Qt::WindingFill executed (the execution status of this line is deduced): ? Qt::WindingFill | - |
3496 | : Qt::OddEvenFill; executed (the execution status of this line is deduced): : Qt::OddEvenFill; | - |
3497 | | - |
3498 | rasterizer->rasterize(outline, fillRule); executed (the execution status of this line is deduced): rasterizer->rasterize(outline, fillRule); | - |
3499 | return; executed: return; Execution Count:118176 | 118176 |
3500 | } | - |
3501 | | - |
3502 | rasterize(outline, callback, (void *)spanData, rasterBuffer); executed (the execution status of this line is deduced): rasterize(outline, callback, (void *)spanData, rasterBuffer); | - |
3503 | } executed: } Execution Count:16507 | 16507 |
3504 | | - |
3505 | extern "C" { | - |
3506 | int q_gray_rendered_spans(QT_FT_Raster raster); | - |
3507 | } | - |
3508 | | - |
3509 | static inline uchar *alignAddress(uchar *address, quintptr alignmentMask) | - |
3510 | { | - |
3511 | return (uchar *)(((quintptr)address + alignmentMask) & ~alignmentMask); executed: return (uchar *)(((quintptr)address + alignmentMask) & ~alignmentMask); Execution Count:16507 | 16507 |
3512 | } | - |
3513 | | - |
3514 | void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline, | - |
3515 | ProcessSpans callback, | - |
3516 | void *userData, QRasterBuffer *) | - |
3517 | { | - |
3518 | if (!callback || !outline) partially evaluated: !callback no Evaluation Count:0 | yes Evaluation Count:16973 |
partially evaluated: !outline no Evaluation Count:0 | yes Evaluation Count:16973 |
| 0-16973 |
3519 | return; | 0 |
3520 | | - |
3521 | Q_Q(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEngine * const q = q_func(); | - |
3522 | QRasterPaintEngineState *s = q->state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = q->state(); | - |
3523 | | - |
3524 | if (!s->flags.antialiased) { evaluated: !s->flags.antialiased yes Evaluation Count:466 | yes Evaluation Count:16507 |
| 466-16507 |
3525 | rasterizer->setAntialiased(s->flags.antialiased); executed (the execution status of this line is deduced): rasterizer->setAntialiased(s->flags.antialiased); | - |
3526 | rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding); executed (the execution status of this line is deduced): rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding); | - |
3527 | rasterizer->setClipRect(deviceRect); executed (the execution status of this line is deduced): rasterizer->setClipRect(deviceRect); | - |
3528 | rasterizer->initialize(callback, userData); executed (the execution status of this line is deduced): rasterizer->initialize(callback, userData); | - |
3529 | | - |
3530 | const Qt::FillRule fillRule = outline->flags == QT_FT_OUTLINE_NONE evaluated: outline->flags == 0x0 yes Evaluation Count:12 | yes Evaluation Count:454 |
| 12-454 |
3531 | ? Qt::WindingFill executed (the execution status of this line is deduced): ? Qt::WindingFill | - |
3532 | : Qt::OddEvenFill; executed (the execution status of this line is deduced): : Qt::OddEvenFill; | - |
3533 | | - |
3534 | rasterizer->rasterize(outline, fillRule); executed (the execution status of this line is deduced): rasterizer->rasterize(outline, fillRule); | - |
3535 | return; executed: return; Execution Count:466 | 466 |
3536 | } | - |
3537 | | - |
3538 | // Initial size for raster pool is MINIMUM_POOL_SIZE so as to | - |
3539 | // minimize memory reallocations. However if initial size for | - |
3540 | // raster pool is changed for lower value, reallocations will | - |
3541 | // occur normally. | - |
3542 | int rasterPoolSize = MINIMUM_POOL_SIZE; executed (the execution status of this line is deduced): int rasterPoolSize = 8192; | - |
3543 | uchar rasterPoolOnStack[MINIMUM_POOL_SIZE + 0xf]; executed (the execution status of this line is deduced): uchar rasterPoolOnStack[8192 + 0xf]; | - |
3544 | uchar *rasterPoolBase = alignAddress(rasterPoolOnStack, 0xf); executed (the execution status of this line is deduced): uchar *rasterPoolBase = alignAddress(rasterPoolOnStack, 0xf); | - |
3545 | uchar *rasterPoolOnHeap = 0; executed (the execution status of this line is deduced): uchar *rasterPoolOnHeap = 0; | - |
3546 | | - |
3547 | 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); | - |
3548 | | - |
3549 | void *data = userData; executed (the execution status of this line is deduced): void *data = userData; | - |
3550 | | - |
3551 | QT_FT_BBox clip_box = { deviceRect.x(), executed (the execution status of this line is deduced): QT_FT_BBox clip_box = { deviceRect.x(), | - |
3552 | deviceRect.y(), executed (the execution status of this line is deduced): deviceRect.y(), | - |
3553 | deviceRect.x() + deviceRect.width(), executed (the execution status of this line is deduced): deviceRect.x() + deviceRect.width(), | - |
3554 | deviceRect.y() + deviceRect.height() }; executed (the execution status of this line is deduced): deviceRect.y() + deviceRect.height() }; | - |
3555 | | - |
3556 | QT_FT_Raster_Params rasterParams; executed (the execution status of this line is deduced): QT_FT_Raster_Params rasterParams; | - |
3557 | rasterParams.target = 0; executed (the execution status of this line is deduced): rasterParams.target = 0; | - |
3558 | rasterParams.source = outline; executed (the execution status of this line is deduced): rasterParams.source = outline; | - |
3559 | rasterParams.flags = QT_FT_RASTER_FLAG_CLIP; executed (the execution status of this line is deduced): rasterParams.flags = 0x4; | - |
3560 | rasterParams.gray_spans = 0; executed (the execution status of this line is deduced): rasterParams.gray_spans = 0; | - |
3561 | rasterParams.black_spans = 0; executed (the execution status of this line is deduced): rasterParams.black_spans = 0; | - |
3562 | rasterParams.bit_test = 0; executed (the execution status of this line is deduced): rasterParams.bit_test = 0; | - |
3563 | rasterParams.bit_set = 0; executed (the execution status of this line is deduced): rasterParams.bit_set = 0; | - |
3564 | rasterParams.user = data; executed (the execution status of this line is deduced): rasterParams.user = data; | - |
3565 | rasterParams.clip_box = clip_box; executed (the execution status of this line is deduced): rasterParams.clip_box = clip_box; | - |
3566 | | - |
3567 | bool done = false; executed (the execution status of this line is deduced): bool done = false; | - |
3568 | int error; executed (the execution status of this line is deduced): int error; | - |
3569 | | - |
3570 | int rendered_spans = 0; executed (the execution status of this line is deduced): int rendered_spans = 0; | - |
3571 | | - |
3572 | while (!done) { evaluated: !done yes Evaluation Count:16507 | yes Evaluation Count:16507 |
| 16507 |
3573 | | - |
3574 | 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); | - |
3575 | rasterParams.gray_spans = callback; executed (the execution status of this line is deduced): rasterParams.gray_spans = callback; | - |
3576 | rasterParams.skip_spans = rendered_spans; executed (the execution status of this line is deduced): rasterParams.skip_spans = rendered_spans; | - |
3577 | 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); | - |
3578 | | - |
3579 | // Out of memory, reallocate some more and try again... | - |
3580 | if (error == -6) { // ErrRaster_OutOfMemory from qgrayraster.c partially evaluated: error == -6 no Evaluation Count:0 | yes Evaluation Count:16507 |
| 0-16507 |
3581 | rasterPoolSize *= 2; never executed (the execution status of this line is deduced): rasterPoolSize *= 2; | - |
3582 | if (rasterPoolSize > 1024 * 1024) { never evaluated: rasterPoolSize > 1024 * 1024 | 0 |
3583 | qWarning("QPainter: Rasterization of primitive failed"); never executed (the execution status of this line is deduced): QMessageLogger("painting/qpaintengine_raster.cpp", 3583, __PRETTY_FUNCTION__).warning("QPainter: Rasterization of primitive failed"); | - |
3584 | break; | 0 |
3585 | } | - |
3586 | | - |
3587 | 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()); | - |
3588 | | - |
3589 | free(rasterPoolOnHeap); never executed (the execution status of this line is deduced): free(rasterPoolOnHeap); | - |
3590 | rasterPoolOnHeap = (uchar *)malloc(rasterPoolSize + 0xf); never executed (the execution status of this line is deduced): rasterPoolOnHeap = (uchar *)malloc(rasterPoolSize + 0xf); | - |
3591 | | - |
3592 | 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(); | - |
3593 | | - |
3594 | rasterPoolBase = alignAddress(rasterPoolOnHeap, 0xf); never executed (the execution status of this line is deduced): rasterPoolBase = alignAddress(rasterPoolOnHeap, 0xf); | - |
3595 | | - |
3596 | 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()); | - |
3597 | 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()); | - |
3598 | 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); | - |
3599 | } else { | 0 |
3600 | done = true; executed (the execution status of this line is deduced): done = true; | - |
3601 | } executed: } Execution Count:16507 | 16507 |
3602 | } | - |
3603 | | - |
3604 | free(rasterPoolOnHeap); executed (the execution status of this line is deduced): free(rasterPoolOnHeap); | - |
3605 | } executed: } Execution Count:16507 | 16507 |
3606 | | - |
3607 | void QRasterPaintEnginePrivate::recalculateFastImages() | - |
3608 | { | - |
3609 | Q_Q(QRasterPaintEngine); executed (the execution status of this line is deduced): QRasterPaintEngine * const q = q_func(); | - |
3610 | QRasterPaintEngineState *s = q->state(); executed (the execution status of this line is deduced): QRasterPaintEngineState *s = q->state(); | - |
3611 | | - |
3612 | s->flags.fast_images = !(s->renderHints & QPainter::SmoothPixmapTransform) evaluated: !(s->renderHints & QPainter::SmoothPixmapTransform) yes Evaluation Count:48640 | yes Evaluation Count:68 |
| 68-48640 |
3613 | && s->matrix.type() <= QTransform::TxShear; partially evaluated: s->matrix.type() <= QTransform::TxShear yes Evaluation Count:48640 | no Evaluation Count:0 |
| 0-48640 |
3614 | } executed: } Execution Count:48708 | 48708 |
3615 | | - |
3616 | bool QRasterPaintEnginePrivate::canUseFastImageBlending(QPainter::CompositionMode mode, const QImage &image) const | - |
3617 | { | - |
3618 | Q_Q(const QRasterPaintEngine); executed (the execution status of this line is deduced): const QRasterPaintEngine * const q = q_func(); | - |
3619 | const QRasterPaintEngineState *s = q->state(); executed (the execution status of this line is deduced): const QRasterPaintEngineState *s = q->state(); | - |
3620 | | - |
3621 | return s->flags.fast_images executed: return s->flags.fast_images && (mode == QPainter::CompositionMode_SourceOver || (mode == QPainter::CompositionMode_Source && !image.hasAlphaChannel())); Execution Count:7277 | 7277 |
3622 | && (mode == QPainter::CompositionMode_SourceOver executed: return s->flags.fast_images && (mode == QPainter::CompositionMode_SourceOver || (mode == QPainter::CompositionMode_Source && !image.hasAlphaChannel())); Execution Count:7277 | 7277 |
3623 | || (mode == QPainter::CompositionMode_Source executed: return s->flags.fast_images && (mode == QPainter::CompositionMode_SourceOver || (mode == QPainter::CompositionMode_Source && !image.hasAlphaChannel())); Execution Count:7277 | 7277 |
3624 | && !image.hasAlphaChannel())); executed: return s->flags.fast_images && (mode == QPainter::CompositionMode_SourceOver || (mode == QPainter::CompositionMode_Source && !image.hasAlphaChannel())); Execution Count:7277 | 7277 |
3625 | } | - |
3626 | | - |
3627 | QImage QRasterBuffer::colorizeBitmap(const QImage &image, const QColor &color) | - |
3628 | { | - |
3629 | Q_ASSERT(image.depth() == 1); executed (the execution status of this line is deduced): qt_noop(); | - |
3630 | | - |
3631 | QImage sourceImage = image.convertToFormat(QImage::Format_MonoLSB); executed (the execution status of this line is deduced): QImage sourceImage = image.convertToFormat(QImage::Format_MonoLSB); | - |
3632 | 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); | - |
3633 | | - |
3634 | QRgb fg = PREMUL(color.rgba()); executed (the execution status of this line is deduced): QRgb fg = PREMUL(color.rgba()); | - |
3635 | QRgb bg = 0; executed (the execution status of this line is deduced): QRgb bg = 0; | - |
3636 | | - |
3637 | int height = sourceImage.height(); executed (the execution status of this line is deduced): int height = sourceImage.height(); | - |
3638 | int width = sourceImage.width(); executed (the execution status of this line is deduced): int width = sourceImage.width(); | - |
3639 | for (int y=0; y<height; ++y) { evaluated: y<height yes Evaluation Count:36280 | yes Evaluation Count:4535 |
| 4535-36280 |
3640 | uchar *source = sourceImage.scanLine(y); executed (the execution status of this line is deduced): uchar *source = sourceImage.scanLine(y); | - |
3641 | 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)); | - |
3642 | if (!source || !target) partially evaluated: !source no Evaluation Count:0 | yes Evaluation Count:36280 |
partially evaluated: !target no Evaluation Count:0 | yes Evaluation Count:36280 |
| 0-36280 |
3643 | QT_THROW(std::bad_alloc()); // we must have run out of memory never executed: qt_noop(); | 0 |
3644 | for (int x=0; x < width; ++x) evaluated: x < width yes Evaluation Count:290240 | yes Evaluation Count:36280 |
| 36280-290240 |
3645 | target[x] = (source[x>>3] >> (x&7)) & 1 ? fg : bg; executed: target[x] = (source[x>>3] >> (x&7)) & 1 ? fg : bg; Execution Count:290240 evaluated: (source[x>>3] >> (x&7)) & 1 yes Evaluation Count:145024 | yes Evaluation Count:145216 |
| 145024-290240 |
3646 | } executed: } Execution Count:36280 | 36280 |
3647 | return dest; executed: return dest; Execution Count:4535 | 4535 |
3648 | } | - |
3649 | | - |
3650 | QRasterBuffer::~QRasterBuffer() | - |
3651 | { | - |
3652 | } | - |
3653 | | - |
3654 | void QRasterBuffer::init() | - |
3655 | { | - |
3656 | compositionMode = QPainter::CompositionMode_SourceOver; executed (the execution status of this line is deduced): compositionMode = QPainter::CompositionMode_SourceOver; | - |
3657 | monoDestinationWithClut = false; executed (the execution status of this line is deduced): monoDestinationWithClut = false; | - |
3658 | destColor0 = 0; executed (the execution status of this line is deduced): destColor0 = 0; | - |
3659 | destColor1 = 0; executed (the execution status of this line is deduced): destColor1 = 0; | - |
3660 | } executed: } Execution Count:4685 | 4685 |
3661 | | - |
3662 | QImage::Format QRasterBuffer::prepare(QImage *image) | - |
3663 | { | - |
3664 | m_buffer = (uchar *)image->bits(); executed (the execution status of this line is deduced): m_buffer = (uchar *)image->bits(); | - |
3665 | 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()); | - |
3666 | 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()); | - |
3667 | bytes_per_pixel = image->depth()/8; executed (the execution status of this line is deduced): bytes_per_pixel = image->depth()/8; | - |
3668 | bytes_per_line = image->bytesPerLine(); executed (the execution status of this line is deduced): bytes_per_line = image->bytesPerLine(); | - |
3669 | | - |
3670 | format = image->format(); executed (the execution status of this line is deduced): format = image->format(); | - |
3671 | drawHelper = qDrawHelper + format; executed (the execution status of this line is deduced): drawHelper = qDrawHelper + format; | - |
3672 | if (image->depth() == 1 && image->colorTable().size() == 2) { evaluated: image->depth() == 1 yes Evaluation Count:143 | yes Evaluation Count:4542 |
partially evaluated: image->colorTable().size() == 2 yes Evaluation Count:143 | no Evaluation Count:0 |
| 0-4542 |
3673 | monoDestinationWithClut = true; executed (the execution status of this line is deduced): monoDestinationWithClut = true; | - |
3674 | destColor0 = PREMUL(image->colorTable()[0]); executed (the execution status of this line is deduced): destColor0 = PREMUL(image->colorTable()[0]); | - |
3675 | destColor1 = PREMUL(image->colorTable()[1]); executed (the execution status of this line is deduced): destColor1 = PREMUL(image->colorTable()[1]); | - |
3676 | } executed: } Execution Count:143 | 143 |
3677 | | - |
3678 | return format; executed: return format; Execution Count:4685 | 4685 |
3679 | } | - |
3680 | | - |
3681 | void QRasterBuffer::resetBuffer(int val) | - |
3682 | { | - |
3683 | 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); | - |
3684 | } | 0 |
3685 | | - |
3686 | QClipData::QClipData(int height) | - |
3687 | { | - |
3688 | clipSpanHeight = height; executed (the execution status of this line is deduced): clipSpanHeight = height; | - |
3689 | m_clipLines = 0; executed (the execution status of this line is deduced): m_clipLines = 0; | - |
3690 | | - |
3691 | allocated = 0; executed (the execution status of this line is deduced): allocated = 0; | - |
3692 | m_spans = 0; executed (the execution status of this line is deduced): m_spans = 0; | - |
3693 | xmin = xmax = ymin = ymax = 0; executed (the execution status of this line is deduced): xmin = xmax = ymin = ymax = 0; | - |
3694 | count = 0; executed (the execution status of this line is deduced): count = 0; | - |
3695 | | - |
3696 | enabled = true; executed (the execution status of this line is deduced): enabled = true; | - |
3697 | hasRectClip = hasRegionClip = false; executed (the execution status of this line is deduced): hasRectClip = hasRegionClip = false; | - |
3698 | } executed: } Execution Count:22668 | 22668 |
3699 | | - |
3700 | QClipData::~QClipData() | - |
3701 | { | - |
3702 | if (m_clipLines) evaluated: m_clipLines yes Evaluation Count:1248 | yes Evaluation Count:21383 |
| 1248-21383 |
3703 | free(m_clipLines); executed: free(m_clipLines); Execution Count:1248 | 1248 |
3704 | if (m_spans) evaluated: m_spans yes Evaluation Count:1031 | yes Evaluation Count:21600 |
| 1031-21600 |
3705 | free(m_spans); executed: free(m_spans); Execution Count:1031 | 1031 |
3706 | } executed: } Execution Count:22631 | 22631 |
3707 | | - |
3708 | void QClipData::initialize() | - |
3709 | { | - |
3710 | if (m_spans) evaluated: m_spans yes Evaluation Count:9570 | yes Evaluation Count:2099 |
| 2099-9570 |
3711 | return; executed: return; Execution Count:9570 | 9570 |
3712 | | - |
3713 | if (!m_clipLines) evaluated: !m_clipLines yes Evaluation Count:1266 | yes Evaluation Count:833 |
| 833-1266 |
3714 | m_clipLines = (ClipLine *)calloc(sizeof(ClipLine), clipSpanHeight); executed: m_clipLines = (ClipLine *)calloc(sizeof(ClipLine), clipSpanHeight); Execution Count:1266 | 1266 |
3715 | | - |
3716 | Q_CHECK_PTR(m_clipLines); executed (the execution status of this line is deduced): qt_noop(); | - |
3717 | QT_TRY { partially evaluated: true yes Evaluation Count:2099 | no Evaluation Count:0 |
| 0-2099 |
3718 | m_spans = (QSpan *)malloc(clipSpanHeight*sizeof(QSpan)); executed (the execution status of this line is deduced): m_spans = (QSpan *)malloc(clipSpanHeight*sizeof(QSpan)); | - |
3719 | allocated = clipSpanHeight; executed (the execution status of this line is deduced): allocated = clipSpanHeight; | - |
3720 | Q_CHECK_PTR(m_spans); executed (the execution status of this line is deduced): qt_noop(); | - |
3721 | | - |
3722 | QT_TRY { partially evaluated: true yes Evaluation Count:2099 | no Evaluation Count:0 |
| 0-2099 |
3723 | if (hasRectClip) { evaluated: hasRectClip yes Evaluation Count:396 | yes Evaluation Count:1703 |
| 396-1703 |
3724 | int y = 0; executed (the execution status of this line is deduced): int y = 0; | - |
3725 | while (y < ymin) { evaluated: y < ymin yes Evaluation Count:30341 | yes Evaluation Count:396 |
| 396-30341 |
3726 | m_clipLines[y].spans = 0; executed (the execution status of this line is deduced): m_clipLines[y].spans = 0; | - |
3727 | m_clipLines[y].count = 0; executed (the execution status of this line is deduced): m_clipLines[y].count = 0; | - |
3728 | ++y; executed (the execution status of this line is deduced): ++y; | - |
3729 | } executed: } Execution Count:30341 | 30341 |
3730 | | - |
3731 | const int len = clipRect.width(); executed (the execution status of this line is deduced): const int len = clipRect.width(); | - |
3732 | count = 0; executed (the execution status of this line is deduced): count = 0; | - |
3733 | while (y < ymax) { evaluated: y < ymax yes Evaluation Count:8887 | yes Evaluation Count:396 |
| 396-8887 |
3734 | QSpan *span = m_spans + count; executed (the execution status of this line is deduced): QSpan *span = m_spans + count; | - |
3735 | span->x = xmin; executed (the execution status of this line is deduced): span->x = xmin; | - |
3736 | span->len = len; executed (the execution status of this line is deduced): span->len = len; | - |
3737 | span->y = y; executed (the execution status of this line is deduced): span->y = y; | - |
3738 | span->coverage = 255; executed (the execution status of this line is deduced): span->coverage = 255; | - |
3739 | ++count; executed (the execution status of this line is deduced): ++count; | - |
3740 | | - |
3741 | m_clipLines[y].spans = span; executed (the execution status of this line is deduced): m_clipLines[y].spans = span; | - |
3742 | m_clipLines[y].count = 1; executed (the execution status of this line is deduced): m_clipLines[y].count = 1; | - |
3743 | ++y; executed (the execution status of this line is deduced): ++y; | - |
3744 | } executed: } Execution Count:8887 | 8887 |
3745 | | - |
3746 | while (y < clipSpanHeight) { evaluated: y < clipSpanHeight yes Evaluation Count:26503 | yes Evaluation Count:396 |
| 396-26503 |
3747 | m_clipLines[y].spans = 0; executed (the execution status of this line is deduced): m_clipLines[y].spans = 0; | - |
3748 | m_clipLines[y].count = 0; executed (the execution status of this line is deduced): m_clipLines[y].count = 0; | - |
3749 | ++y; executed (the execution status of this line is deduced): ++y; | - |
3750 | } executed: } Execution Count:26503 | 26503 |
3751 | } else if (hasRegionClip) { executed: } Execution Count:396 evaluated: hasRegionClip yes Evaluation Count:1237 | yes Evaluation Count:466 |
| 396-1237 |
3752 | | - |
3753 | const QVector<QRect> rects = clipRegion.rects(); executed (the execution status of this line is deduced): const QVector<QRect> rects = clipRegion.rects(); | - |
3754 | const int numRects = rects.size(); executed (the execution status of this line is deduced): const int numRects = rects.size(); | - |
3755 | | - |
3756 | { // resize | - |
3757 | const int maxSpans = (ymax - ymin) * numRects; executed (the execution status of this line is deduced): const int maxSpans = (ymax - ymin) * numRects; | - |
3758 | if (maxSpans > allocated) { evaluated: maxSpans > allocated yes Evaluation Count:1143 | yes Evaluation Count:94 |
| 94-1143 |
3759 | 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))); | - |
3760 | allocated = maxSpans; executed (the execution status of this line is deduced): allocated = maxSpans; | - |
3761 | } executed: } Execution Count:1143 | 1143 |
3762 | } | - |
3763 | | - |
3764 | int y = 0; executed (the execution status of this line is deduced): int y = 0; | - |
3765 | int firstInBand = 0; executed (the execution status of this line is deduced): int firstInBand = 0; | - |
3766 | count = 0; executed (the execution status of this line is deduced): count = 0; | - |
3767 | while (firstInBand < numRects) { evaluated: firstInBand < numRects yes Evaluation Count:5024 | yes Evaluation Count:1237 |
| 1237-5024 |
3768 | const int currMinY = rects.at(firstInBand).y(); executed (the execution status of this line is deduced): const int currMinY = rects.at(firstInBand).y(); | - |
3769 | 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(); | - |
3770 | | - |
3771 | while (y < currMinY) { evaluated: y < currMinY yes Evaluation Count:23854 | yes Evaluation Count:5024 |
| 5024-23854 |
3772 | m_clipLines[y].spans = 0; executed (the execution status of this line is deduced): m_clipLines[y].spans = 0; | - |
3773 | m_clipLines[y].count = 0; executed (the execution status of this line is deduced): m_clipLines[y].count = 0; | - |
3774 | ++y; executed (the execution status of this line is deduced): ++y; | - |
3775 | } executed: } Execution Count:23854 | 23854 |
3776 | | - |
3777 | int lastInBand = firstInBand; executed (the execution status of this line is deduced): int lastInBand = firstInBand; | - |
3778 | while (lastInBand + 1 < numRects && rects.at(lastInBand+1).top() == y) evaluated: lastInBand + 1 < numRects yes Evaluation Count:5140 | yes Evaluation Count:1235 |
evaluated: rects.at(lastInBand+1).top() == y yes Evaluation Count:1351 | yes Evaluation Count:3789 |
| 1235-5140 |
3779 | ++lastInBand; executed: ++lastInBand; Execution Count:1351 | 1351 |
3780 | | - |
3781 | while (y < currMaxY) { evaluated: y < currMaxY yes Evaluation Count:228445 | yes Evaluation Count:5024 |
| 5024-228445 |
3782 | | - |
3783 | m_clipLines[y].spans = m_spans + count; executed (the execution status of this line is deduced): m_clipLines[y].spans = m_spans + count; | - |
3784 | m_clipLines[y].count = lastInBand - firstInBand + 1; executed (the execution status of this line is deduced): m_clipLines[y].count = lastInBand - firstInBand + 1; | - |
3785 | | - |
3786 | for (int r = firstInBand; r <= lastInBand; ++r) { evaluated: r <= lastInBand yes Evaluation Count:413991 | yes Evaluation Count:228445 |
| 228445-413991 |
3787 | const QRect &currRect = rects.at(r); executed (the execution status of this line is deduced): const QRect &currRect = rects.at(r); | - |
3788 | QSpan *span = m_spans + count; executed (the execution status of this line is deduced): QSpan *span = m_spans + count; | - |
3789 | span->x = currRect.x(); executed (the execution status of this line is deduced): span->x = currRect.x(); | - |
3790 | span->len = currRect.width(); executed (the execution status of this line is deduced): span->len = currRect.width(); | - |
3791 | span->y = y; executed (the execution status of this line is deduced): span->y = y; | - |
3792 | span->coverage = 255; executed (the execution status of this line is deduced): span->coverage = 255; | - |
3793 | ++count; executed (the execution status of this line is deduced): ++count; | - |
3794 | } executed: } Execution Count:413991 | 413991 |
3795 | ++y; executed (the execution status of this line is deduced): ++y; | - |
3796 | } executed: } Execution Count:228445 | 228445 |
3797 | | - |
3798 | firstInBand = lastInBand + 1; executed (the execution status of this line is deduced): firstInBand = lastInBand + 1; | - |
3799 | } executed: } Execution Count:5024 | 5024 |
3800 | | - |
3801 | Q_ASSERT(count <= allocated); executed (the execution status of this line is deduced): qt_noop(); | - |
3802 | | - |
3803 | while (y < clipSpanHeight) { evaluated: y < clipSpanHeight yes Evaluation Count:23421 | yes Evaluation Count:1237 |
| 1237-23421 |
3804 | m_clipLines[y].spans = 0; executed (the execution status of this line is deduced): m_clipLines[y].spans = 0; | - |
3805 | m_clipLines[y].count = 0; executed (the execution status of this line is deduced): m_clipLines[y].count = 0; | - |
3806 | ++y; executed (the execution status of this line is deduced): ++y; | - |
3807 | } executed: } Execution Count:23421 | 23421 |
3808 | | - |
3809 | } executed: } Execution Count:1237 | 1237 |
3810 | } QT_CATCH(...) { | - |
3811 | 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); | - |
3812 | m_spans = 0; never executed (the execution status of this line is deduced): m_spans = 0; | - |
3813 | QT_RETHROW; never executed (the execution status of this line is deduced): qt_noop(); | - |
3814 | } | 0 |
3815 | } QT_CATCH(...) { | - |
3816 | free(m_clipLines); // same for clipLines never executed (the execution status of this line is deduced): free(m_clipLines); | - |
3817 | m_clipLines = 0; never executed (the execution status of this line is deduced): m_clipLines = 0; | - |
3818 | QT_RETHROW; never executed (the execution status of this line is deduced): qt_noop(); | - |
3819 | } | 0 |
3820 | } | - |
3821 | | - |
3822 | void QClipData::fixup() | - |
3823 | { | - |
3824 | Q_ASSERT(m_spans); executed (the execution status of this line is deduced): qt_noop(); | - |
3825 | | - |
3826 | if (count == 0) { evaluated: count == 0 yes Evaluation Count:10 | yes Evaluation Count:456 |
| 10-456 |
3827 | ymin = ymax = xmin = xmax = 0; executed (the execution status of this line is deduced): ymin = ymax = xmin = xmax = 0; | - |
3828 | return; executed: return; Execution Count:10 | 10 |
3829 | } | - |
3830 | | - |
3831 | int y = -1; executed (the execution status of this line is deduced): int y = -1; | - |
3832 | ymin = m_spans[0].y; executed (the execution status of this line is deduced): ymin = m_spans[0].y; | - |
3833 | ymax = m_spans[count-1].y + 1; executed (the execution status of this line is deduced): ymax = m_spans[count-1].y + 1; | - |
3834 | xmin = INT_MAX; executed (the execution status of this line is deduced): xmin = 2147483647; | - |
3835 | xmax = 0; executed (the execution status of this line is deduced): xmax = 0; | - |
3836 | | - |
3837 | const int firstLeft = m_spans[0].x; executed (the execution status of this line is deduced): const int firstLeft = m_spans[0].x; | - |
3838 | 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; | - |
3839 | bool isRect = true; executed (the execution status of this line is deduced): bool isRect = true; | - |
3840 | | - |
3841 | for (int i = 0; i < count; ++i) { evaluated: i < count yes Evaluation Count:100748 | yes Evaluation Count:456 |
| 456-100748 |
3842 | QT_FT_Span_& span = m_spans[i]; executed (the execution status of this line is deduced): QT_FT_Span_& span = m_spans[i]; | - |
3843 | | - |
3844 | if (span.y != y) { evaluated: span.y != y yes Evaluation Count:78114 | yes Evaluation Count:22634 |
| 22634-78114 |
3845 | if (span.y != y + 1 && y != -1) evaluated: span.y != y + 1 yes Evaluation Count:440 | yes Evaluation Count:77674 |
evaluated: y != -1 yes Evaluation Count:8 | yes Evaluation Count:432 |
| 8-77674 |
3846 | isRect = false; executed: isRect = false; Execution Count:8 | 8 |
3847 | y = span.y; executed (the execution status of this line is deduced): y = span.y; | - |
3848 | m_clipLines[y].spans = &span; executed (the execution status of this line is deduced): m_clipLines[y].spans = &span; | - |
3849 | m_clipLines[y].count = 1; executed (the execution status of this line is deduced): m_clipLines[y].count = 1; | - |
3850 | } else executed: } Execution Count:78114 | 78114 |
3851 | ++m_clipLines[y].count; executed: ++m_clipLines[y].count; Execution Count:22634 | 22634 |
3852 | | - |
3853 | const int spanLeft = span.x; executed (the execution status of this line is deduced): const int spanLeft = span.x; | - |
3854 | const int spanRight = spanLeft + span.len; executed (the execution status of this line is deduced): const int spanRight = spanLeft + span.len; | - |
3855 | | - |
3856 | if (spanLeft < xmin) evaluated: spanLeft < xmin yes Evaluation Count:21029 | yes Evaluation Count:79719 |
| 21029-79719 |
3857 | xmin = spanLeft; executed: xmin = spanLeft; Execution Count:21029 | 21029 |
3858 | | - |
3859 | if (spanRight > xmax) evaluated: spanRight > xmax yes Evaluation Count:21272 | yes Evaluation Count:79476 |
| 21272-79476 |
3860 | xmax = spanRight; executed: xmax = spanRight; Execution Count:21272 | 21272 |
3861 | | - |
3862 | if (spanLeft != firstLeft || spanRight != firstRight) evaluated: spanLeft != firstLeft yes Evaluation Count:97078 | yes Evaluation Count:3670 |
evaluated: spanRight != firstRight yes Evaluation Count:519 | yes Evaluation Count:3151 |
| 519-97078 |
3863 | isRect = false; executed: isRect = false; Execution Count:97597 | 97597 |
3864 | } executed: } Execution Count:100748 | 100748 |
3865 | | - |
3866 | if (isRect) { evaluated: isRect yes Evaluation Count:36 | yes Evaluation Count:420 |
| 36-420 |
3867 | hasRectClip = true; executed (the execution status of this line is deduced): hasRectClip = true; | - |
3868 | 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); | - |
3869 | } executed: } Execution Count:36 | 36 |
3870 | } executed: } Execution Count:456 | 456 |
3871 | | - |
3872 | /* | - |
3873 | Convert \a rect to clip spans. | - |
3874 | */ | - |
3875 | void QClipData::setClipRect(const QRect &rect) | - |
3876 | { | - |
3877 | if (hasRectClip && rect == clipRect) evaluated: hasRectClip yes Evaluation Count:14284 | yes Evaluation Count:22378 |
evaluated: rect == clipRect yes Evaluation Count:7177 | yes Evaluation Count:7107 |
| 7107-22378 |
3878 | return; executed: return; Execution Count:7177 | 7177 |
3879 | | - |
3880 | // qDebug() << "setClipRect" << clipSpanHeight << count << allocated << rect; | - |
3881 | hasRectClip = true; executed (the execution status of this line is deduced): hasRectClip = true; | - |
3882 | hasRegionClip = false; executed (the execution status of this line is deduced): hasRegionClip = false; | - |
3883 | clipRect = rect; executed (the execution status of this line is deduced): clipRect = rect; | - |
3884 | | - |
3885 | xmin = rect.x(); executed (the execution status of this line is deduced): xmin = rect.x(); | - |
3886 | xmax = rect.x() + rect.width(); executed (the execution status of this line is deduced): xmax = rect.x() + rect.width(); | - |
3887 | ymin = qMin(rect.y(), clipSpanHeight); executed (the execution status of this line is deduced): ymin = qMin(rect.y(), clipSpanHeight); | - |
3888 | ymax = qMin(rect.y() + rect.height(), clipSpanHeight); executed (the execution status of this line is deduced): ymax = qMin(rect.y() + rect.height(), clipSpanHeight); | - |
3889 | | - |
3890 | if (m_spans) { evaluated: m_spans yes Evaluation Count:730 | yes Evaluation Count:28755 |
| 730-28755 |
3891 | free(m_spans); executed (the execution status of this line is deduced): free(m_spans); | - |
3892 | m_spans = 0; executed (the execution status of this line is deduced): m_spans = 0; | - |
3893 | } executed: } Execution Count:730 | 730 |
3894 | | - |
3895 | // qDebug() << xmin << xmax << ymin << ymax; | - |
3896 | } executed: } Execution Count:29485 | 29485 |
3897 | | - |
3898 | /* | - |
3899 | Convert \a region to clip spans. | - |
3900 | */ | - |
3901 | void QClipData::setClipRegion(const QRegion ®ion) | - |
3902 | { | - |
3903 | if (region.rectCount() == 1) { evaluated: region.rectCount() == 1 yes Evaluation Count:20935 | yes Evaluation Count:3676 |
| 3676-20935 |
3904 | setClipRect(region.rects().at(0)); executed (the execution status of this line is deduced): setClipRect(region.rects().at(0)); | - |
3905 | return; executed: return; Execution Count:20935 | 20935 |
3906 | } | - |
3907 | | - |
3908 | hasRegionClip = true; executed (the execution status of this line is deduced): hasRegionClip = true; | - |
3909 | hasRectClip = false; executed (the execution status of this line is deduced): hasRectClip = false; | - |
3910 | clipRegion = region; executed (the execution status of this line is deduced): clipRegion = region; | - |
3911 | | - |
3912 | { // set bounding rect | - |
3913 | const QRect rect = region.boundingRect(); executed (the execution status of this line is deduced): const QRect rect = region.boundingRect(); | - |
3914 | xmin = rect.x(); executed (the execution status of this line is deduced): xmin = rect.x(); | - |
3915 | xmax = rect.x() + rect.width(); executed (the execution status of this line is deduced): xmax = rect.x() + rect.width(); | - |
3916 | ymin = rect.y(); executed (the execution status of this line is deduced): ymin = rect.y(); | - |
3917 | ymax = rect.y() + rect.height(); executed (the execution status of this line is deduced): ymax = rect.y() + rect.height(); | - |
3918 | } | - |
3919 | | - |
3920 | if (m_spans) { evaluated: m_spans yes Evaluation Count:327 | yes Evaluation Count:3349 |
| 327-3349 |
3921 | free(m_spans); executed (the execution status of this line is deduced): free(m_spans); | - |
3922 | m_spans = 0; executed (the execution status of this line is deduced): m_spans = 0; | - |
3923 | } executed: } Execution Count:327 | 327 |
3924 | | - |
3925 | } executed: } Execution Count:3676 | 3676 |
3926 | | - |
3927 | /*! | - |
3928 | \internal | - |
3929 | spans must be sorted on y | - |
3930 | */ | - |
3931 | static const QSpan *qt_intersect_spans(const QClipData *clip, int *currentClip, | - |
3932 | const QSpan *spans, const QSpan *end, | - |
3933 | QSpan **outSpans, int available) | - |
3934 | { | - |
3935 | const_cast<QClipData *>(clip)->initialize(); executed (the execution status of this line is deduced): const_cast<QClipData *>(clip)->initialize(); | - |
3936 | | - |
3937 | QSpan *out = *outSpans; executed (the execution status of this line is deduced): QSpan *out = *outSpans; | - |
3938 | | - |
3939 | const QSpan *clipSpans = clip->m_spans + *currentClip; executed (the execution status of this line is deduced): const QSpan *clipSpans = clip->m_spans + *currentClip; | - |
3940 | 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; | - |
3941 | | - |
3942 | while (available && spans < end ) { evaluated: available yes Evaluation Count:2626799 | yes Evaluation Count:146 |
evaluated: spans < end yes Evaluation Count:2618470 | yes Evaluation Count:8329 |
| 146-2626799 |
3943 | if (clipSpans >= clipEnd) { evaluated: clipSpans >= clipEnd yes Evaluation Count:1473 | yes Evaluation Count:2616997 |
| 1473-2616997 |
3944 | spans = end; executed (the execution status of this line is deduced): spans = end; | - |
3945 | break; executed: break; Execution Count:1473 | 1473 |
3946 | } | - |
3947 | if (clipSpans->y > spans->y) { evaluated: clipSpans->y > spans->y yes Evaluation Count:233386 | yes Evaluation Count:2383611 |
| 233386-2383611 |
3948 | ++spans; executed (the execution status of this line is deduced): ++spans; | - |
3949 | continue; executed: continue; Execution Count:233386 | 233386 |
3950 | } | - |
3951 | if (spans->y != clipSpans->y) { evaluated: spans->y != clipSpans->y yes Evaluation Count:508449 | yes Evaluation Count:1875162 |
| 508449-1875162 |
3952 | if (spans->y < clip->count && clip->m_clipLines[spans->y].spans) evaluated: spans->y < clip->count yes Evaluation Count:418259 | yes Evaluation Count:90190 |
evaluated: clip->m_clipLines[spans->y].spans yes Evaluation Count:416646 | yes Evaluation Count:1613 |
| 1613-418259 |
3953 | clipSpans = clip->m_clipLines[spans->y].spans; executed: clipSpans = clip->m_clipLines[spans->y].spans; Execution Count:416646 | 416646 |
3954 | else | - |
3955 | ++clipSpans; executed: ++clipSpans; Execution Count:91803 | 91803 |
3956 | continue; executed: continue; Execution Count:508449 | 508449 |
3957 | } | - |
3958 | Q_ASSERT(spans->y == clipSpans->y); executed (the execution status of this line is deduced): qt_noop(); | - |
3959 | | - |
3960 | int sx1 = spans->x; executed (the execution status of this line is deduced): int sx1 = spans->x; | - |
3961 | int sx2 = sx1 + spans->len; executed (the execution status of this line is deduced): int sx2 = sx1 + spans->len; | - |
3962 | int cx1 = clipSpans->x; executed (the execution status of this line is deduced): int cx1 = clipSpans->x; | - |
3963 | int cx2 = cx1 + clipSpans->len; executed (the execution status of this line is deduced): int cx2 = cx1 + clipSpans->len; | - |
3964 | | - |
3965 | if (cx1 < sx1 && cx2 < sx1) { evaluated: cx1 < sx1 yes Evaluation Count:1380532 | yes Evaluation Count:494630 |
evaluated: cx2 < sx1 yes Evaluation Count:263721 | yes Evaluation Count:1116811 |
| 263721-1380532 |
3966 | ++clipSpans; executed (the execution status of this line is deduced): ++clipSpans; | - |
3967 | continue; executed: continue; Execution Count:263721 | 263721 |
3968 | } else if (sx1 < cx1 && sx2 < cx1) { evaluated: sx1 < cx1 yes Evaluation Count:218331 | yes Evaluation Count:1393110 |
evaluated: sx2 < cx1 yes Evaluation Count:131760 | yes Evaluation Count:86571 |
| 86571-1393110 |
3969 | ++spans; executed (the execution status of this line is deduced): ++spans; | - |
3970 | continue; executed: continue; Execution Count:131760 | 131760 |
3971 | } | - |
3972 | int x = qMax(sx1, cx1); executed (the execution status of this line is deduced): int x = qMax(sx1, cx1); | - |
3973 | int len = qMin(sx2, cx2) - x; executed (the execution status of this line is deduced): int len = qMin(sx2, cx2) - x; | - |
3974 | if (len) { evaluated: len yes Evaluation Count:1477203 | yes Evaluation Count:2478 |
| 2478-1477203 |
3975 | out->x = qMax(sx1, cx1); executed (the execution status of this line is deduced): out->x = qMax(sx1, cx1); | - |
3976 | out->len = qMin(sx2, cx2) - out->x; executed (the execution status of this line is deduced): out->len = qMin(sx2, cx2) - out->x; | - |
3977 | out->y = spans->y; executed (the execution status of this line is deduced): out->y = spans->y; | - |
3978 | 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); | - |
3979 | ++out; executed (the execution status of this line is deduced): ++out; | - |
3980 | --available; executed (the execution status of this line is deduced): --available; | - |
3981 | } executed: } Execution Count:1477203 | 1477203 |
3982 | if (sx2 < cx2) { evaluated: sx2 < cx2 yes Evaluation Count:1116940 | yes Evaluation Count:362741 |
| 362741-1116940 |
3983 | ++spans; executed (the execution status of this line is deduced): ++spans; | - |
3984 | } else { executed: } Execution Count:1116940 | 1116940 |
3985 | ++clipSpans; executed (the execution status of this line is deduced): ++clipSpans; | - |
3986 | } executed: } Execution Count:362741 | 362741 |
3987 | } | - |
3988 | | - |
3989 | *outSpans = out; executed (the execution status of this line is deduced): *outSpans = out; | - |
3990 | *currentClip = clipSpans - clip->m_spans; executed (the execution status of this line is deduced): *currentClip = clipSpans - clip->m_spans; | - |
3991 | return spans; executed: return spans; Execution Count:9948 | 9948 |
3992 | } | - |
3993 | | - |
3994 | static void qt_span_fill_clipped(int spanCount, const QSpan *spans, void *userData) | - |
3995 | { | - |
3996 | // qDebug() << "qt_span_fill_clipped" << spanCount; | - |
3997 | QSpanData *fillData = reinterpret_cast<QSpanData *>(userData); executed (the execution status of this line is deduced): QSpanData *fillData = reinterpret_cast<QSpanData *>(userData); | - |
3998 | | - |
3999 | Q_ASSERT(fillData->blend && fillData->unclipped_blend); executed (the execution status of this line is deduced): qt_noop(); | - |
4000 | | - |
4001 | const int NSPANS = 256; executed (the execution status of this line is deduced): const int NSPANS = 256; | - |
4002 | QSpan cspans[NSPANS]; executed (the execution status of this line is deduced): QSpan cspans[NSPANS]; | - |
4003 | int currentClip = 0; executed (the execution status of this line is deduced): int currentClip = 0; | - |
4004 | const QSpan *end = spans + spanCount; executed (the execution status of this line is deduced): const QSpan *end = spans + spanCount; | - |
4005 | while (spans < end) { evaluated: spans < end yes Evaluation Count:9158 | yes Evaluation Count:9338 |
| 9158-9338 |
4006 | QSpan *clipped = cspans; executed (the execution status of this line is deduced): QSpan *clipped = cspans; | - |
4007 | spans = qt_intersect_spans(fillData->clip, ¤tClip, spans, end, &clipped, NSPANS); executed (the execution status of this line is deduced): spans = qt_intersect_spans(fillData->clip, ¤tClip, spans, end, &clipped, NSPANS); | - |
4008 | // qDebug() << "processed " << spanCount - (end - spans) << "clipped" << clipped-cspans | - |
4009 | // << "span:" << cspans->x << cspans->y << cspans->len << spans->coverage; | - |
4010 | | - |
4011 | if (clipped - cspans) evaluated: clipped - cspans yes Evaluation Count:8917 | yes Evaluation Count:241 |
| 241-8917 |
4012 | fillData->unclipped_blend(clipped - cspans, cspans, fillData); executed: fillData->unclipped_blend(clipped - cspans, cspans, fillData); Execution Count:8917 | 8917 |
4013 | } executed: } Execution Count:9158 | 9158 |
4014 | } executed: } Execution Count:9338 | 9338 |
4015 | | - |
4016 | /* | - |
4017 | \internal | - |
4018 | Clip spans to \a{clip}-rectangle. | - |
4019 | Returns number of unclipped spans | - |
4020 | */ | - |
4021 | static int qt_intersect_spans(QT_FT_Span *spans, int numSpans, | - |
4022 | const QRect &clip) | - |
4023 | { | - |
4024 | const short minx = clip.left(); executed (the execution status of this line is deduced): const short minx = clip.left(); | - |
4025 | const short miny = clip.top(); executed (the execution status of this line is deduced): const short miny = clip.top(); | - |
4026 | const short maxx = clip.right(); executed (the execution status of this line is deduced): const short maxx = clip.right(); | - |
4027 | const short maxy = clip.bottom(); executed (the execution status of this line is deduced): const short maxy = clip.bottom(); | - |
4028 | | - |
4029 | int n = 0; executed (the execution status of this line is deduced): int n = 0; | - |
4030 | for (int i = 0; i < numSpans; ++i) { evaluated: i < numSpans yes Evaluation Count:5106424 | yes Evaluation Count:232785 |
| 232785-5106424 |
4031 | if (spans[i].y > maxy) evaluated: spans[i].y > maxy yes Evaluation Count:17877 | yes Evaluation Count:5088547 |
| 17877-5088547 |
4032 | break; executed: break; Execution Count:17877 | 17877 |
4033 | if (spans[i].y < miny evaluated: spans[i].y < miny yes Evaluation Count:34286 | yes Evaluation Count:5054261 |
| 34286-5054261 |
4034 | || spans[i].x > maxx evaluated: spans[i].x > maxx yes Evaluation Count:19464 | yes Evaluation Count:5034797 |
| 19464-5034797 |
4035 | || spans[i].x + spans[i].len <= minx) { evaluated: spans[i].x + spans[i].len <= minx yes Evaluation Count:14962 | yes Evaluation Count:5019835 |
| 14962-5019835 |
4036 | continue; executed: continue; Execution Count:68712 | 68712 |
4037 | } | - |
4038 | if (spans[i].x < minx) { evaluated: spans[i].x < minx yes Evaluation Count:820 | yes Evaluation Count:5019015 |
| 820-5019015 |
4039 | 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); | - |
4040 | spans[n].x = minx; executed (the execution status of this line is deduced): spans[n].x = minx; | - |
4041 | } else { executed: } Execution Count:820 | 820 |
4042 | spans[n].x = spans[i].x; executed (the execution status of this line is deduced): spans[n].x = spans[i].x; | - |
4043 | 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)); | - |
4044 | } executed: } Execution Count:5019015 | 5019015 |
4045 | if (spans[n].len == 0) partially evaluated: spans[n].len == 0 no Evaluation Count:0 | yes Evaluation Count:5019835 |
| 0-5019835 |
4046 | continue; never executed: continue; | 0 |
4047 | spans[n].y = spans[i].y; executed (the execution status of this line is deduced): spans[n].y = spans[i].y; | - |
4048 | spans[n].coverage = spans[i].coverage; executed (the execution status of this line is deduced): spans[n].coverage = spans[i].coverage; | - |
4049 | ++n; executed (the execution status of this line is deduced): ++n; | - |
4050 | } executed: } Execution Count:5019835 | 5019835 |
4051 | return n; executed: return n; Execution Count:250662 | 250662 |
4052 | } | - |
4053 | | - |
4054 | | - |
4055 | static void qt_span_fill_clipRect(int count, const QSpan *spans, | - |
4056 | void *userData) | - |
4057 | { | - |
4058 | QSpanData *fillData = reinterpret_cast<QSpanData *>(userData); executed (the execution status of this line is deduced): QSpanData *fillData = reinterpret_cast<QSpanData *>(userData); | - |
4059 | Q_ASSERT(fillData->blend && fillData->unclipped_blend); executed (the execution status of this line is deduced): qt_noop(); | - |
4060 | | - |
4061 | Q_ASSERT(fillData->clip); executed (the execution status of this line is deduced): qt_noop(); | - |
4062 | Q_ASSERT(!fillData->clip->clipRect.isEmpty()); executed (the execution status of this line is deduced): qt_noop(); | - |
4063 | | - |
4064 | // hw: check if this const_cast<> is safe!!! | - |
4065 | 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, | - |
4066 | fillData->clip->clipRect); executed (the execution status of this line is deduced): fillData->clip->clipRect); | - |
4067 | if (count > 0) evaluated: count > 0 yes Evaluation Count:201177 | yes Evaluation Count:1942 |
| 1942-201177 |
4068 | fillData->unclipped_blend(count, spans, fillData); executed: fillData->unclipped_blend(count, spans, fillData); Execution Count:201177 | 201177 |
4069 | } executed: } Execution Count:203119 | 203119 |
4070 | | - |
4071 | static void qt_span_clip(int count, const QSpan *spans, void *userData) | - |
4072 | { | - |
4073 | ClipData *clipData = reinterpret_cast<ClipData *>(userData); executed (the execution status of this line is deduced): ClipData *clipData = reinterpret_cast<ClipData *>(userData); | - |
4074 | | - |
4075 | // qDebug() << " qt_span_clip: " << count << clipData->operation; | - |
4076 | // for (int i = 0; i < qMin(count, 10); ++i) { | - |
4077 | // qDebug() << " " << spans[i].x << spans[i].y << spans[i].len << spans[i].coverage; | - |
4078 | // } | - |
4079 | | - |
4080 | switch (clipData->operation) { | - |
4081 | | - |
4082 | case Qt::IntersectClip: | - |
4083 | { | - |
4084 | QClipData *newClip = clipData->newClip; executed (the execution status of this line is deduced): QClipData *newClip = clipData->newClip; | - |
4085 | newClip->initialize(); executed (the execution status of this line is deduced): newClip->initialize(); | - |
4086 | | - |
4087 | int currentClip = 0; executed (the execution status of this line is deduced): int currentClip = 0; | - |
4088 | const QSpan *end = spans + count; executed (the execution status of this line is deduced): const QSpan *end = spans + count; | - |
4089 | while (spans < end) { evaluated: spans < end yes Evaluation Count:790 | yes Evaluation Count:742 |
| 742-790 |
4090 | QSpan *newspans = newClip->m_spans + newClip->count; executed (the execution status of this line is deduced): QSpan *newspans = newClip->m_spans + newClip->count; | - |
4091 | spans = qt_intersect_spans(clipData->oldClip, ¤tClip, spans, end, executed (the execution status of this line is deduced): spans = qt_intersect_spans(clipData->oldClip, ¤tClip, spans, end, | - |
4092 | &newspans, newClip->allocated - newClip->count); executed (the execution status of this line is deduced): &newspans, newClip->allocated - newClip->count); | - |
4093 | newClip->count = newspans - newClip->m_spans; executed (the execution status of this line is deduced): newClip->count = newspans - newClip->m_spans; | - |
4094 | if (spans < end) { evaluated: spans < end yes Evaluation Count:56 | yes Evaluation Count:734 |
| 56-734 |
4095 | 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))); | - |
4096 | newClip->allocated *= 2; executed (the execution status of this line is deduced): newClip->allocated *= 2; | - |
4097 | } executed: } Execution Count:56 | 56 |
4098 | } executed: } Execution Count:790 | 790 |
4099 | } | - |
4100 | break; executed: break; Execution Count:742 | 742 |
4101 | | - |
4102 | case Qt::ReplaceClip: | - |
4103 | clipData->newClip->appendSpans(spans, count); never executed (the execution status of this line is deduced): clipData->newClip->appendSpans(spans, count); | - |
4104 | break; | 0 |
4105 | case Qt::NoClip: | - |
4106 | break; | 0 |
4107 | } | - |
4108 | } executed: } Execution Count:742 | 742 |
4109 | | - |
4110 | #ifndef QT_NO_DEBUG | - |
4111 | QImage QRasterBuffer::bufferImage() const | - |
4112 | { | - |
4113 | QImage image(m_width, m_height, QImage::Format_ARGB32_Premultiplied); | - |
4114 | | - |
4115 | for (int y = 0; y < m_height; ++y) { | - |
4116 | uint *span = (uint *)const_cast<QRasterBuffer *>(this)->scanLine(y); | - |
4117 | | - |
4118 | for (int x=0; x<m_width; ++x) { | - |
4119 | uint argb = span[x]; | - |
4120 | image.setPixel(x, y, argb); | - |
4121 | } | - |
4122 | } | - |
4123 | return image; | - |
4124 | } | - |
4125 | #endif | - |
4126 | | - |
4127 | | - |
4128 | void QRasterBuffer::flushToARGBImage(QImage *target) const | - |
4129 | { | - |
4130 | int w = qMin(m_width, target->width()); never executed (the execution status of this line is deduced): int w = qMin(m_width, target->width()); | - |
4131 | int h = qMin(m_height, target->height()); never executed (the execution status of this line is deduced): int h = qMin(m_height, target->height()); | - |
4132 | | - |
4133 | for (int y=0; y<h; ++y) { | 0 |
4134 | 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); | - |
4135 | QRgb *dest = (QRgb *) target->scanLine(y); never executed (the execution status of this line is deduced): QRgb *dest = (QRgb *) target->scanLine(y); | - |
4136 | for (int x=0; x<w; ++x) { | 0 |
4137 | QRgb pixel = sourceLine[x]; never executed (the execution status of this line is deduced): QRgb pixel = sourceLine[x]; | - |
4138 | int alpha = qAlpha(pixel); never executed (the execution status of this line is deduced): int alpha = qAlpha(pixel); | - |
4139 | if (!alpha) { | 0 |
4140 | dest[x] = 0; never executed (the execution status of this line is deduced): dest[x] = 0; | - |
4141 | } else { | 0 |
4142 | dest[x] = (alpha << 24) never executed (the execution status of this line is deduced): dest[x] = (alpha << 24) | - |
4143 | | ((255*qRed(pixel)/alpha) << 16) never executed (the execution status of this line is deduced): | ((255*qRed(pixel)/alpha) << 16) | - |
4144 | | ((255*qGreen(pixel)/alpha) << 8) never executed (the execution status of this line is deduced): | ((255*qGreen(pixel)/alpha) << 8) | - |
4145 | | ((255*qBlue(pixel)/alpha) << 0); never executed (the execution status of this line is deduced): | ((255*qBlue(pixel)/alpha) << 0); | - |
4146 | } | 0 |
4147 | } | - |
4148 | } | 0 |
4149 | } | 0 |
4150 | | - |
4151 | | - |
4152 | class QGradientCache | - |
4153 | { | - |
4154 | struct CacheInfo | - |
4155 | { | - |
4156 | inline CacheInfo(QGradientStops s, int op, QGradient::InterpolationMode mode) : | - |
4157 | stops(s), opacity(op), interpolationMode(mode) {} executed: } Execution Count:9518 | 9518 |
4158 | uint buffer[GRADIENT_STOPTABLE_SIZE]; | - |
4159 | QGradientStops stops; | - |
4160 | int opacity; | - |
4161 | QGradient::InterpolationMode interpolationMode; | - |
4162 | }; | - |
4163 | | - |
4164 | typedef QMultiHash<quint64, CacheInfo> QGradientColorTableHash; | - |
4165 | | - |
4166 | public: | - |
4167 | inline const uint *getBuffer(const QGradient &gradient, int opacity) { | - |
4168 | quint64 hash_val = 0; executed (the execution status of this line is deduced): quint64 hash_val = 0; | - |
4169 | | - |
4170 | QGradientStops stops = gradient.stops(); executed (the execution status of this line is deduced): QGradientStops stops = gradient.stops(); | - |
4171 | for (int i = 0; i < stops.size() && i <= 2; i++) evaluated: i < stops.size() yes Evaluation Count:32185 | yes Evaluation Count:16114 |
evaluated: i <= 2 yes Evaluation Count:32214 | yes Evaluation Count:5 |
| 5-32214 |
4172 | hash_val += stops[i].second.rgba(); executed: hash_val += stops[i].second.rgba(); Execution Count:32196 | 32196 |
4173 | | - |
4174 | QMutexLocker lock(&mutex); executed (the execution status of this line is deduced): QMutexLocker lock(&mutex); | - |
4175 | 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); | - |
4176 | | - |
4177 | if (it == cache.constEnd()) evaluated: it == cache.constEnd() yes Evaluation Count:9514 | yes Evaluation Count:6625 |
| 6625-9514 |
4178 | return addCacheElement(hash_val, gradient, opacity); executed: return addCacheElement(hash_val, gradient, opacity); Execution Count:9514 | 9514 |
4179 | else { | - |
4180 | do { | - |
4181 | const CacheInfo &cache_info = it.value(); executed (the execution status of this line is deduced): const CacheInfo &cache_info = it.value(); | - |
4182 | if (cache_info.stops == stops && cache_info.opacity == opacity && cache_info.interpolationMode == gradient.interpolationMode()) evaluated: cache_info.stops == stops yes Evaluation Count:6622 | yes Evaluation Count:6 |
partially evaluated: cache_info.opacity == opacity yes Evaluation Count:6622 | no Evaluation Count:0 |
evaluated: cache_info.interpolationMode == gradient.interpolationMode() yes Evaluation Count:6621 | yes Evaluation Count:1 |
| 0-6622 |
4183 | return cache_info.buffer; executed: return cache_info.buffer; Execution Count:6621 | 6621 |
4184 | ++it; executed (the execution status of this line is deduced): ++it; | - |
4185 | } while (it != cache.constEnd() && it.key() == hash_val); executed: } Execution Count:7 partially evaluated: it != cache.constEnd() yes Evaluation Count:7 | no Evaluation Count:0 |
evaluated: it.key() == hash_val yes Evaluation Count:3 | yes Evaluation Count:4 |
| 0-7 |
4186 | // an exact match for these stops and opacity was not found, create new cache | - |
4187 | return addCacheElement(hash_val, gradient, opacity); executed: return addCacheElement(hash_val, gradient, opacity); Execution Count:4 | 4 |
4188 | } | - |
4189 | } | - |
4190 | | - |
4191 | inline int paletteSize() const { return GRADIENT_STOPTABLE_SIZE; } executed: return 1024; Execution Count:9518 | 9518 |
4192 | protected: | - |
4193 | inline int maxCacheSize() const { return 60; } executed: return 60; Execution Count:18956 | 18956 |
4194 | inline void generateGradientColorTable(const QGradient& g, | - |
4195 | uint *colorTable, | - |
4196 | int size, int opacity) const; | - |
4197 | uint *addCacheElement(quint64 hash_val, const QGradient &gradient, int opacity) { | - |
4198 | if (cache.size() == maxCacheSize()) { evaluated: cache.size() == maxCacheSize() yes Evaluation Count:9438 | yes Evaluation Count:80 |
| 80-9438 |
4199 | // may remove more than 1, but OK | - |
4200 | cache.erase(cache.begin() + (qrand() % maxCacheSize())); executed (the execution status of this line is deduced): cache.erase(cache.begin() + (qrand() % maxCacheSize())); | - |
4201 | } executed: } Execution Count:9438 | 9438 |
4202 | 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()); | - |
4203 | generateGradientColorTable(gradient, cache_entry.buffer, paletteSize(), opacity); executed (the execution status of this line is deduced): generateGradientColorTable(gradient, cache_entry.buffer, paletteSize(), opacity); | - |
4204 | return cache.insert(hash_val, cache_entry).value().buffer; executed: return cache.insert(hash_val, cache_entry).value().buffer; Execution Count:9518 | 9518 |
4205 | } | - |
4206 | | - |
4207 | QGradientColorTableHash cache; | - |
4208 | QMutex mutex; | - |
4209 | }; | - |
4210 | | - |
4211 | void QGradientCache::generateGradientColorTable(const QGradient& gradient, uint *colorTable, int size, int opacity) const | - |
4212 | { | - |
4213 | QGradientStops stops = gradient.stops(); executed (the execution status of this line is deduced): QGradientStops stops = gradient.stops(); | - |
4214 | int stopCount = stops.count(); executed (the execution status of this line is deduced): int stopCount = stops.count(); | - |
4215 | Q_ASSERT(stopCount > 0); executed (the execution status of this line is deduced): qt_noop(); | - |
4216 | | - |
4217 | bool colorInterpolation = (gradient.interpolationMode() == QGradient::ColorInterpolation); executed (the execution status of this line is deduced): bool colorInterpolation = (gradient.interpolationMode() == QGradient::ColorInterpolation); | - |
4218 | | - |
4219 | if (stopCount == 2) { evaluated: stopCount == 2 yes Evaluation Count:9509 | yes Evaluation Count:9 |
| 9-9509 |
4220 | 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); | - |
4221 | 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); | - |
4222 | | - |
4223 | qreal first_stop = stops[0].first; executed (the execution status of this line is deduced): qreal first_stop = stops[0].first; | - |
4224 | qreal second_stop = stops[1].first; executed (the execution status of this line is deduced): qreal second_stop = stops[1].first; | - |
4225 | | - |
4226 | if (second_stop < first_stop) { partially evaluated: second_stop < first_stop no Evaluation Count:0 | yes Evaluation Count:9509 |
| 0-9509 |
4227 | qSwap(first_color, second_color); never executed (the execution status of this line is deduced): qSwap(first_color, second_color); | - |
4228 | qSwap(first_stop, second_stop); never executed (the execution status of this line is deduced): qSwap(first_stop, second_stop); | - |
4229 | } | 0 |
4230 | | - |
4231 | if (colorInterpolation) { evaluated: colorInterpolation yes Evaluation Count:9508 | yes Evaluation Count:1 |
| 1-9508 |
4232 | first_color = PREMUL(first_color); executed (the execution status of this line is deduced): first_color = PREMUL(first_color); | - |
4233 | second_color = PREMUL(second_color); executed (the execution status of this line is deduced): second_color = PREMUL(second_color); | - |
4234 | } executed: } Execution Count:9508 | 9508 |
4235 | | - |
4236 | 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)); | - |
4237 | 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)); | - |
4238 | | - |
4239 | uint red_first = qRed(first_color) << 16; executed (the execution status of this line is deduced): uint red_first = qRed(first_color) << 16; | - |
4240 | uint green_first = qGreen(first_color) << 16; executed (the execution status of this line is deduced): uint green_first = qGreen(first_color) << 16; | - |
4241 | uint blue_first = qBlue(first_color) << 16; executed (the execution status of this line is deduced): uint blue_first = qBlue(first_color) << 16; | - |
4242 | uint alpha_first = qAlpha(first_color) << 16; executed (the execution status of this line is deduced): uint alpha_first = qAlpha(first_color) << 16; | - |
4243 | | - |
4244 | uint red_second = qRed(second_color) << 16; executed (the execution status of this line is deduced): uint red_second = qRed(second_color) << 16; | - |
4245 | uint green_second = qGreen(second_color) << 16; executed (the execution status of this line is deduced): uint green_second = qGreen(second_color) << 16; | - |
4246 | uint blue_second = qBlue(second_color) << 16; executed (the execution status of this line is deduced): uint blue_second = qBlue(second_color) << 16; | - |
4247 | uint alpha_second = qAlpha(second_color) << 16; executed (the execution status of this line is deduced): uint alpha_second = qAlpha(second_color) << 16; | - |
4248 | | - |
4249 | int i = 0; executed (the execution status of this line is deduced): int i = 0; | - |
4250 | for (; i <= qMin(GRADIENT_STOPTABLE_SIZE, first_index); ++i) { evaluated: i <= qMin(1024, first_index) yes Evaluation Count:11156 | yes Evaluation Count:9509 |
| 9509-11156 |
4251 | if (colorInterpolation) evaluated: colorInterpolation yes Evaluation Count:11155 | yes Evaluation Count:1 |
| 1-11155 |
4252 | colorTable[i] = first_color; executed: colorTable[i] = first_color; Execution Count:11155 | 11155 |
4253 | else | - |
4254 | colorTable[i] = PREMUL(first_color); executed: colorTable[i] = PREMUL(first_color); Execution Count:1 | 1 |
4255 | } | - |
4256 | | - |
4257 | if (i < second_index) { partially evaluated: i < second_index yes Evaluation Count:9509 | no Evaluation Count:0 |
| 0-9509 |
4258 | 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); | - |
4259 | | - |
4260 | 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); | - |
4261 | 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); | - |
4262 | 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); | - |
4263 | 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); | - |
4264 | | - |
4265 | // rounding | - |
4266 | red_first += 1 << 15; executed (the execution status of this line is deduced): red_first += 1 << 15; | - |
4267 | green_first += 1 << 15; executed (the execution status of this line is deduced): green_first += 1 << 15; | - |
4268 | blue_first += 1 << 15; executed (the execution status of this line is deduced): blue_first += 1 << 15; | - |
4269 | alpha_first += 1 << 15; executed (the execution status of this line is deduced): alpha_first += 1 << 15; | - |
4270 | | - |
4271 | for (; i < qMin(GRADIENT_STOPTABLE_SIZE, second_index); ++i) { evaluated: i < qMin(1024, second_index) yes Evaluation Count:9715835 | yes Evaluation Count:9509 |
| 9509-9715835 |
4272 | red_first += red_delta; executed (the execution status of this line is deduced): red_first += red_delta; | - |
4273 | green_first += green_delta; executed (the execution status of this line is deduced): green_first += green_delta; | - |
4274 | blue_first += blue_delta; executed (the execution status of this line is deduced): blue_first += blue_delta; | - |
4275 | alpha_first += alpha_delta; executed (the execution status of this line is deduced): alpha_first += alpha_delta; | - |
4276 | | - |
4277 | 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) | - |
4278 | | ((green_first >> 8) & 0xff00) | (blue_first >> 16); executed (the execution status of this line is deduced): | ((green_first >> 8) & 0xff00) | (blue_first >> 16); | - |
4279 | | - |
4280 | if (colorInterpolation) evaluated: colorInterpolation yes Evaluation Count:9714813 | yes Evaluation Count:1022 |
| 1022-9714813 |
4281 | colorTable[i] = color; executed: colorTable[i] = color; Execution Count:9714813 | 9714813 |
4282 | else | - |
4283 | colorTable[i] = PREMUL(color); executed: colorTable[i] = PREMUL(color); Execution Count:1022 | 1022 |
4284 | } | - |
4285 | } executed: } Execution Count:9509 | 9509 |
4286 | | - |
4287 | for (; i < GRADIENT_STOPTABLE_SIZE; ++i) { evaluated: i < 1024 yes Evaluation Count:10225 | yes Evaluation Count:9509 |
| 9509-10225 |
4288 | if (colorInterpolation) evaluated: colorInterpolation yes Evaluation Count:10224 | yes Evaluation Count:1 |
| 1-10224 |
4289 | colorTable[i] = second_color; executed: colorTable[i] = second_color; Execution Count:10224 | 10224 |
4290 | else | - |
4291 | colorTable[i] = PREMUL(second_color); executed: colorTable[i] = PREMUL(second_color); Execution Count:1 | 1 |
4292 | } | - |
4293 | | - |
4294 | return; executed: return; Execution Count:9509 | 9509 |
4295 | } | - |
4296 | | - |
4297 | 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); | - |
4298 | if (stopCount == 1) { evaluated: stopCount == 1 yes Evaluation Count:1 | yes Evaluation Count:8 |
| 1-8 |
4299 | current_color = PREMUL(current_color); executed (the execution status of this line is deduced): current_color = PREMUL(current_color); | - |
4300 | for (int i = 0; i < size; ++i) evaluated: i < size yes Evaluation Count:1024 | yes Evaluation Count:1 |
| 1-1024 |
4301 | colorTable[i] = current_color; executed: colorTable[i] = current_color; Execution Count:1024 | 1024 |
4302 | return; executed: return; Execution Count:1 | 1 |
4303 | } | - |
4304 | | - |
4305 | // The position where the gradient begins and ends | - |
4306 | qreal begin_pos = stops[0].first; executed (the execution status of this line is deduced): qreal begin_pos = stops[0].first; | - |
4307 | qreal end_pos = stops[stopCount-1].first; executed (the execution status of this line is deduced): qreal end_pos = stops[stopCount-1].first; | - |
4308 | | - |
4309 | int pos = 0; // The position in the color table. executed (the execution status of this line is deduced): int pos = 0; | - |
4310 | uint next_color; executed (the execution status of this line is deduced): uint next_color; | - |
4311 | | - |
4312 | qreal incr = 1 / qreal(size); // the double increment. executed (the execution status of this line is deduced): qreal incr = 1 / qreal(size); | - |
4313 | 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; | - |
4314 | | - |
4315 | // Up to first point | - |
4316 | colorTable[pos++] = PREMUL(current_color); executed (the execution status of this line is deduced): colorTable[pos++] = PREMUL(current_color); | - |
4317 | while (dpos <= begin_pos) { partially evaluated: dpos <= begin_pos no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
4318 | colorTable[pos] = colorTable[pos - 1]; never executed (the execution status of this line is deduced): colorTable[pos] = colorTable[pos - 1]; | - |
4319 | ++pos; never executed (the execution status of this line is deduced): ++pos; | - |
4320 | dpos += incr; never executed (the execution status of this line is deduced): dpos += incr; | - |
4321 | } | 0 |
4322 | | - |
4323 | 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; | - |
4324 | | - |
4325 | qreal t; // position between current left and right stops executed (the execution status of this line is deduced): qreal t; | - |
4326 | qreal t_delta; // the t increment per entry in the color table executed (the execution status of this line is deduced): qreal t_delta; | - |
4327 | | - |
4328 | if (dpos < end_pos) { partially evaluated: dpos < end_pos yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-8 |
4329 | // Gradient area | - |
4330 | while (dpos > stops[current_stop+1].first) partially evaluated: dpos > stops[current_stop+1].first no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
4331 | ++current_stop; never executed: ++current_stop; | 0 |
4332 | | - |
4333 | if (current_stop != 0) partially evaluated: current_stop != 0 no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
4334 | 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 |
4335 | 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); | - |
4336 | | - |
4337 | if (colorInterpolation) { partially evaluated: colorInterpolation yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-8 |
4338 | current_color = PREMUL(current_color); executed (the execution status of this line is deduced): current_color = PREMUL(current_color); | - |
4339 | next_color = PREMUL(next_color); executed (the execution status of this line is deduced): next_color = PREMUL(next_color); | - |
4340 | } executed: } Execution Count:8 | 8 |
4341 | | - |
4342 | 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; | - |
4343 | qreal c = (diff == 0) ? qreal(0) : 256 / diff; partially evaluated: (diff == 0) no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
4344 | t = (dpos - stops[current_stop].first) * c; executed (the execution status of this line is deduced): t = (dpos - stops[current_stop].first) * c; | - |
4345 | t_delta = incr * c; executed (the execution status of this line is deduced): t_delta = incr * c; | - |
4346 | | - |
4347 | while (true) { partially evaluated: true yes Evaluation Count:8184 | no Evaluation Count:0 |
| 0-8184 |
4348 | Q_ASSERT(current_stop < stopCount); executed (the execution status of this line is deduced): qt_noop(); | - |
4349 | | - |
4350 | int dist = qRound(t); executed (the execution status of this line is deduced): int dist = qRound(t); | - |
4351 | int idist = 256 - dist; executed (the execution status of this line is deduced): int idist = 256 - dist; | - |
4352 | | - |
4353 | if (colorInterpolation) partially evaluated: colorInterpolation yes Evaluation Count:8184 | no Evaluation Count:0 |
| 0-8184 |
4354 | 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:8184 | 8184 |
4355 | else | - |
4356 | 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 |
4357 | | - |
4358 | ++pos; executed (the execution status of this line is deduced): ++pos; | - |
4359 | dpos += incr; executed (the execution status of this line is deduced): dpos += incr; | - |
4360 | | - |
4361 | if (dpos >= end_pos) evaluated: dpos >= end_pos yes Evaluation Count:8 | yes Evaluation Count:8176 |
| 8-8176 |
4362 | break; executed: break; Execution Count:8 | 8 |
4363 | | - |
4364 | t += t_delta; executed (the execution status of this line is deduced): t += t_delta; | - |
4365 | | - |
4366 | int skip = 0; executed (the execution status of this line is deduced): int skip = 0; | - |
4367 | while (dpos > stops[current_stop+skip+1].first) evaluated: dpos > stops[current_stop+skip+1].first yes Evaluation Count:15 | yes Evaluation Count:8176 |
| 15-8176 |
4368 | ++skip; executed: ++skip; Execution Count:15 | 15 |
4369 | | - |
4370 | if (skip != 0) { evaluated: skip != 0 yes Evaluation Count:15 | yes Evaluation Count:8161 |
| 15-8161 |
4371 | current_stop += skip; executed (the execution status of this line is deduced): current_stop += skip; | - |
4372 | if (skip == 1) partially evaluated: skip == 1 yes Evaluation Count:15 | no Evaluation Count:0 |
| 0-15 |
4373 | current_color = next_color; executed: current_color = next_color; Execution Count:15 | 15 |
4374 | else | - |
4375 | 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 |
4376 | 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); | - |
4377 | | - |
4378 | if (colorInterpolation) { partially evaluated: colorInterpolation yes Evaluation Count:15 | no Evaluation Count:0 |
| 0-15 |
4379 | if (skip != 1) partially evaluated: skip != 1 no Evaluation Count:0 | yes Evaluation Count:15 |
| 0-15 |
4380 | current_color = PREMUL(current_color); never executed: current_color = PREMUL(current_color); | 0 |
4381 | next_color = PREMUL(next_color); executed (the execution status of this line is deduced): next_color = PREMUL(next_color); | - |
4382 | } executed: } Execution Count:15 | 15 |
4383 | | - |
4384 | 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; | - |
4385 | qreal c = (diff == 0) ? qreal(0) : 256 / diff; partially evaluated: (diff == 0) no Evaluation Count:0 | yes Evaluation Count:15 |
| 0-15 |
4386 | t = (dpos - stops[current_stop].first) * c; executed (the execution status of this line is deduced): t = (dpos - stops[current_stop].first) * c; | - |
4387 | t_delta = incr * c; executed (the execution status of this line is deduced): t_delta = incr * c; | - |
4388 | } executed: } Execution Count:15 | 15 |
4389 | } executed: } Execution Count:8176 | 8176 |
4390 | } executed: } Execution Count:8 | 8 |
4391 | | - |
4392 | // After last point | - |
4393 | 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)); | - |
4394 | while (pos < size - 1) { partially evaluated: pos < size - 1 no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
4395 | colorTable[pos] = current_color; never executed (the execution status of this line is deduced): colorTable[pos] = current_color; | - |
4396 | ++pos; never executed (the execution status of this line is deduced): ++pos; | - |
4397 | } | 0 |
4398 | | - |
4399 | // Make sure the last color stop is represented at the end of the table | - |
4400 | colorTable[size - 1] = current_color; executed (the execution status of this line is deduced): colorTable[size - 1] = current_color; | - |
4401 | } executed: } Execution Count:8 | 8 |
4402 | | - |
4403 | Q_GLOBAL_STATIC(QGradientCache, qt_gradient_cache) never executed: delete x; executed: return thisGlobalStatic.pointer.load(); Execution Count:16087 partially evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x) no Evaluation Count:0 | yes Evaluation Count:6 |
evaluated: !thisGlobalStatic.pointer.load() yes Evaluation Count:6 | yes Evaluation Count:16077 |
partially evaluated: !thisGlobalStatic.destroyed yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-16087 |
4404 | | - |
4405 | | - |
4406 | void QSpanData::init(QRasterBuffer *rb, const QRasterPaintEngine *pe) | - |
4407 | { | - |
4408 | rasterBuffer = rb; executed (the execution status of this line is deduced): rasterBuffer = rb; | - |
4409 | type = None; executed (the execution status of this line is deduced): type = None; | - |
4410 | txop = 0; executed (the execution status of this line is deduced): txop = 0; | - |
4411 | bilinear = false; executed (the execution status of this line is deduced): bilinear = false; | - |
4412 | m11 = m22 = m33 = 1.; executed (the execution status of this line is deduced): m11 = m22 = m33 = 1.; | - |
4413 | 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; | - |
4414 | clip = pe ? pe->d_func()->clip() : 0; partially evaluated: pe yes Evaluation Count:47979 | no Evaluation Count:0 |
| 0-47979 |
4415 | } executed: } Execution Count:47979 | 47979 |
4416 | | - |
4417 | Q_GUI_EXPORT extern QImage qt_imageForBrush(int brushStyle, bool invert); | - |
4418 | | - |
4419 | void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode compositionMode) | - |
4420 | { | - |
4421 | Qt::BrushStyle brushStyle = qbrush_style(brush); executed (the execution status of this line is deduced): Qt::BrushStyle brushStyle = qbrush_style(brush); | - |
4422 | switch (brushStyle) { | - |
4423 | case Qt::SolidPattern: { | - |
4424 | type = Solid; executed (the execution status of this line is deduced): type = Solid; | - |
4425 | QColor c = qbrush_color(brush); executed (the execution status of this line is deduced): QColor c = qbrush_color(brush); | - |
4426 | QRgb rgba = c.rgba(); executed (the execution status of this line is deduced): QRgb rgba = c.rgba(); | - |
4427 | 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)); | - |
4428 | if ((solid.color & 0xff000000) == 0 evaluated: (solid.color & 0xff000000) == 0 yes Evaluation Count:17 | yes Evaluation Count:215965 |
| 17-215965 |
4429 | && compositionMode == QPainter::CompositionMode_SourceOver) { partially evaluated: compositionMode == QPainter::CompositionMode_SourceOver yes Evaluation Count:17 | no Evaluation Count:0 |
| 0-17 |
4430 | type = None; executed (the execution status of this line is deduced): type = None; | - |
4431 | } executed: } Execution Count:17 | 17 |
4432 | break; executed: break; Execution Count:215982 | 215982 |
4433 | } | - |
4434 | | - |
4435 | case Qt::LinearGradientPattern: | - |
4436 | { | - |
4437 | type = LinearGradient; executed (the execution status of this line is deduced): type = LinearGradient; | - |
4438 | 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()); | - |
4439 | gradient.alphaColor = !brush.isOpaque() || alpha != 256; evaluated: !brush.isOpaque() yes Evaluation Count:4 | yes Evaluation Count:16097 |
partially evaluated: alpha != 256 no Evaluation Count:0 | yes Evaluation Count:16109 |
| 0-16109 |
4440 | 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)); | - |
4441 | gradient.spread = g->spread(); executed (the execution status of this line is deduced): gradient.spread = g->spread(); | - |
4442 | | - |
4443 | QLinearGradientData &linearData = gradient.linear; executed (the execution status of this line is deduced): QLinearGradientData &linearData = gradient.linear; | - |
4444 | | - |
4445 | linearData.origin.x = g->start().x(); executed (the execution status of this line is deduced): linearData.origin.x = g->start().x(); | - |
4446 | linearData.origin.y = g->start().y(); executed (the execution status of this line is deduced): linearData.origin.y = g->start().y(); | - |
4447 | linearData.end.x = g->finalStop().x(); executed (the execution status of this line is deduced): linearData.end.x = g->finalStop().x(); | - |
4448 | linearData.end.y = g->finalStop().y(); executed (the execution status of this line is deduced): linearData.end.y = g->finalStop().y(); | - |
4449 | break; executed: break; Execution Count:16105 | 16105 |
4450 | } | - |
4451 | | - |
4452 | case Qt::RadialGradientPattern: | - |
4453 | { | - |
4454 | type = RadialGradient; executed (the execution status of this line is deduced): type = RadialGradient; | - |
4455 | 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()); | - |
4456 | gradient.alphaColor = !brush.isOpaque() || alpha != 256; evaluated: !brush.isOpaque() yes Evaluation Count:2 | yes Evaluation Count:2 |
partially evaluated: alpha != 256 no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
4457 | 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)); | - |
4458 | gradient.spread = g->spread(); executed (the execution status of this line is deduced): gradient.spread = g->spread(); | - |
4459 | | - |
4460 | QRadialGradientData &radialData = gradient.radial; executed (the execution status of this line is deduced): QRadialGradientData &radialData = gradient.radial; | - |
4461 | | - |
4462 | QPointF center = g->center(); executed (the execution status of this line is deduced): QPointF center = g->center(); | - |
4463 | radialData.center.x = center.x(); executed (the execution status of this line is deduced): radialData.center.x = center.x(); | - |
4464 | radialData.center.y = center.y(); executed (the execution status of this line is deduced): radialData.center.y = center.y(); | - |
4465 | radialData.center.radius = g->centerRadius(); executed (the execution status of this line is deduced): radialData.center.radius = g->centerRadius(); | - |
4466 | QPointF focal = g->focalPoint(); executed (the execution status of this line is deduced): QPointF focal = g->focalPoint(); | - |
4467 | radialData.focal.x = focal.x(); executed (the execution status of this line is deduced): radialData.focal.x = focal.x(); | - |
4468 | radialData.focal.y = focal.y(); executed (the execution status of this line is deduced): radialData.focal.y = focal.y(); | - |
4469 | radialData.focal.radius = g->focalRadius(); executed (the execution status of this line is deduced): radialData.focal.radius = g->focalRadius(); | - |
4470 | } | - |
4471 | break; executed: break; Execution Count:4 | 4 |
4472 | | - |
4473 | case Qt::ConicalGradientPattern: | - |
4474 | { | - |
4475 | type = ConicalGradient; never executed (the execution status of this line is deduced): type = ConicalGradient; | - |
4476 | 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()); | - |
4477 | gradient.alphaColor = !brush.isOpaque() || alpha != 256; never evaluated: !brush.isOpaque() never evaluated: alpha != 256 | 0 |
4478 | 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)); | - |
4479 | gradient.spread = QGradient::RepeatSpread; never executed (the execution status of this line is deduced): gradient.spread = QGradient::RepeatSpread; | - |
4480 | | - |
4481 | QConicalGradientData &conicalData = gradient.conical; never executed (the execution status of this line is deduced): QConicalGradientData &conicalData = gradient.conical; | - |
4482 | | - |
4483 | QPointF center = g->center(); never executed (the execution status of this line is deduced): QPointF center = g->center(); | - |
4484 | conicalData.center.x = center.x(); never executed (the execution status of this line is deduced): conicalData.center.x = center.x(); | - |
4485 | conicalData.center.y = center.y(); never executed (the execution status of this line is deduced): conicalData.center.y = center.y(); | - |
4486 | 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; | - |
4487 | } | - |
4488 | break; | 0 |
4489 | | - |
4490 | case Qt::Dense1Pattern: | - |
4491 | case Qt::Dense2Pattern: | - |
4492 | case Qt::Dense3Pattern: | - |
4493 | case Qt::Dense4Pattern: | - |
4494 | case Qt::Dense5Pattern: | - |
4495 | case Qt::Dense6Pattern: | - |
4496 | case Qt::Dense7Pattern: | - |
4497 | case Qt::HorPattern: | - |
4498 | case Qt::VerPattern: | - |
4499 | case Qt::CrossPattern: | - |
4500 | case Qt::BDiagPattern: | - |
4501 | case Qt::FDiagPattern: | - |
4502 | case Qt::DiagCrossPattern: | - |
4503 | type = Texture; executed (the execution status of this line is deduced): type = Texture; | - |
4504 | if (!tempImage) evaluated: !tempImage yes Evaluation Count:2166 | yes Evaluation Count:2369 |
| 2166-2369 |
4505 | tempImage = new QImage(); executed: tempImage = new QImage(); Execution Count:2166 | 2166 |
4506 | *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()); | - |
4507 | initTexture(tempImage, alpha, QTextureData::Tiled); executed (the execution status of this line is deduced): initTexture(tempImage, alpha, QTextureData::Tiled); | - |
4508 | break; executed: break; Execution Count:4535 | 4535 |
4509 | case Qt::TexturePattern: | - |
4510 | type = Texture; executed (the execution status of this line is deduced): type = Texture; | - |
4511 | if (!tempImage) partially evaluated: !tempImage yes Evaluation Count:195 | no Evaluation Count:0 |
| 0-195 |
4512 | tempImage = new QImage(); executed: tempImage = new QImage(); Execution Count:195 | 195 |
4513 | | - |
4514 | if (qHasPixmapTexture(brush) && brush.texture().isQBitmap()) evaluated: qHasPixmapTexture(brush) yes Evaluation Count:1 | yes Evaluation Count:194 |
partially evaluated: brush.texture().isQBitmap() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-194 |
4515 | *tempImage = rasterBuffer->colorizeBitmap(brush.textureImage(), brush.color()); never executed: *tempImage = rasterBuffer->colorizeBitmap(brush.textureImage(), brush.color()); | 0 |
4516 | else | - |
4517 | *tempImage = brush.textureImage(); executed: *tempImage = brush.textureImage(); Execution Count:195 | 195 |
4518 | initTexture(tempImage, alpha, QTextureData::Tiled, tempImage->rect()); executed (the execution status of this line is deduced): initTexture(tempImage, alpha, QTextureData::Tiled, tempImage->rect()); | - |
4519 | break; executed: break; Execution Count:195 | 195 |
4520 | | - |
4521 | case Qt::NoBrush: | - |
4522 | default: | - |
4523 | type = None; executed (the execution status of this line is deduced): type = None; | - |
4524 | break; executed: break; Execution Count:18959 | 18959 |
4525 | } | - |
4526 | adjustSpanMethods(); executed (the execution status of this line is deduced): adjustSpanMethods(); | - |
4527 | } executed: } Execution Count:255783 | 255783 |
4528 | | - |
4529 | void QSpanData::adjustSpanMethods() | - |
4530 | { | - |
4531 | bitmapBlit = 0; executed (the execution status of this line is deduced): bitmapBlit = 0; | - |
4532 | alphamapBlit = 0; executed (the execution status of this line is deduced): alphamapBlit = 0; | - |
4533 | alphaRGBBlit = 0; executed (the execution status of this line is deduced): alphaRGBBlit = 0; | - |
4534 | | - |
4535 | fillRect = 0; executed (the execution status of this line is deduced): fillRect = 0; | - |
4536 | | - |
4537 | switch(type) { | - |
4538 | case None: | - |
4539 | unclipped_blend = 0; executed (the execution status of this line is deduced): unclipped_blend = 0; | - |
4540 | break; executed: break; Execution Count:18976 | 18976 |
4541 | case Solid: | - |
4542 | unclipped_blend = rasterBuffer->drawHelper->blendColor; executed (the execution status of this line is deduced): unclipped_blend = rasterBuffer->drawHelper->blendColor; | - |
4543 | bitmapBlit = rasterBuffer->drawHelper->bitmapBlit; executed (the execution status of this line is deduced): bitmapBlit = rasterBuffer->drawHelper->bitmapBlit; | - |
4544 | alphamapBlit = rasterBuffer->drawHelper->alphamapBlit; executed (the execution status of this line is deduced): alphamapBlit = rasterBuffer->drawHelper->alphamapBlit; | - |
4545 | alphaRGBBlit = rasterBuffer->drawHelper->alphaRGBBlit; executed (the execution status of this line is deduced): alphaRGBBlit = rasterBuffer->drawHelper->alphaRGBBlit; | - |
4546 | fillRect = rasterBuffer->drawHelper->fillRect; executed (the execution status of this line is deduced): fillRect = rasterBuffer->drawHelper->fillRect; | - |
4547 | break; executed: break; Execution Count:238101 | 238101 |
4548 | case LinearGradient: | - |
4549 | case RadialGradient: | - |
4550 | case ConicalGradient: | - |
4551 | unclipped_blend = rasterBuffer->drawHelper->blendGradient; executed (the execution status of this line is deduced): unclipped_blend = rasterBuffer->drawHelper->blendGradient; | - |
4552 | break; executed: break; Execution Count:32160 | 32160 |
4553 | case Texture: | - |
4554 | unclipped_blend = qBlendTexture; executed (the execution status of this line is deduced): unclipped_blend = qBlendTexture; | - |
4555 | if (!texture.imageData) partially evaluated: !texture.imageData no Evaluation Count:0 | yes Evaluation Count:15469 |
| 0-15469 |
4556 | unclipped_blend = 0; never executed: unclipped_blend = 0; | 0 |
4557 | | - |
4558 | break; executed: break; Execution Count:15469 | 15469 |
4559 | } | - |
4560 | // setup clipping | - |
4561 | if (!unclipped_blend) { evaluated: !unclipped_blend yes Evaluation Count:18976 | yes Evaluation Count:285732 |
| 18976-285732 |
4562 | blend = 0; executed (the execution status of this line is deduced): blend = 0; | - |
4563 | } else if (!clip) { executed: } Execution Count:18976 partially evaluated: !clip no Evaluation Count:0 | yes Evaluation Count:285723 |
| 0-285723 |
4564 | blend = unclipped_blend; never executed (the execution status of this line is deduced): blend = unclipped_blend; | - |
4565 | } else if (clip->hasRectClip) { never executed: } evaluated: clip->hasRectClip yes Evaluation Count:276176 | yes Evaluation Count:9557 |
| 0-276176 |
4566 | blend = clip->clipRect.isEmpty() ? 0 : qt_span_fill_clipRect; evaluated: clip->clipRect.isEmpty() yes Evaluation Count:9 | yes Evaluation Count:276166 |
| 9-276166 |
4567 | } else { executed: } Execution Count:276173 | 276173 |
4568 | blend = qt_span_fill_clipped; executed (the execution status of this line is deduced): blend = qt_span_fill_clipped; | - |
4569 | } executed: } Execution Count:9557 | 9557 |
4570 | } | - |
4571 | | - |
4572 | void QSpanData::setupMatrix(const QTransform &matrix, int bilin) | - |
4573 | { | - |
4574 | QTransform delta; executed (the execution status of this line is deduced): QTransform delta; | - |
4575 | // make sure we round off correctly in qdrawhelper.cpp | - |
4576 | 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); | - |
4577 | | - |
4578 | QTransform inv = (delta * matrix).inverted(); executed (the execution status of this line is deduced): QTransform inv = (delta * matrix).inverted(); | - |
4579 | m11 = inv.m11(); executed (the execution status of this line is deduced): m11 = inv.m11(); | - |
4580 | m12 = inv.m12(); executed (the execution status of this line is deduced): m12 = inv.m12(); | - |
4581 | m13 = inv.m13(); executed (the execution status of this line is deduced): m13 = inv.m13(); | - |
4582 | m21 = inv.m21(); executed (the execution status of this line is deduced): m21 = inv.m21(); | - |
4583 | m22 = inv.m22(); executed (the execution status of this line is deduced): m22 = inv.m22(); | - |
4584 | m23 = inv.m23(); executed (the execution status of this line is deduced): m23 = inv.m23(); | - |
4585 | m33 = inv.m33(); executed (the execution status of this line is deduced): m33 = inv.m33(); | - |
4586 | dx = inv.dx(); executed (the execution status of this line is deduced): dx = inv.dx(); | - |
4587 | dy = inv.dy(); executed (the execution status of this line is deduced): dy = inv.dy(); | - |
4588 | txop = inv.type(); executed (the execution status of this line is deduced): txop = inv.type(); | - |
4589 | bilinear = bilin; executed (the execution status of this line is deduced): bilinear = bilin; | - |
4590 | | - |
4591 | const bool affine = inv.isAffine(); executed (the execution status of this line is deduced): const bool affine = inv.isAffine(); | - |
4592 | fast_matrix = affine evaluated: affine yes Evaluation Count:27 | yes Evaluation Count:4 |
| 4-27 |
4593 | && m11 * m11 + m21 * m21 < 1e4 evaluated: m11 * m11 + m21 * m21 < 1e4 yes Evaluation Count:25 | yes Evaluation Count:2 |
| 2-25 |
4594 | && m12 * m12 + m22 * m22 < 1e4 partially evaluated: m12 * m12 + m22 * m22 < 1e4 yes Evaluation Count:25 | no Evaluation Count:0 |
| 0-25 |
4595 | && qAbs(dx) < 1e4 evaluated: qAbs(dx) < 1e4 yes Evaluation Count:23 | yes Evaluation Count:2 |
| 2-23 |
4596 | && qAbs(dy) < 1e4; partially evaluated: qAbs(dy) < 1e4 yes Evaluation Count:23 | no Evaluation Count:0 |
| 0-23 |
4597 | | - |
4598 | adjustSpanMethods(); executed (the execution status of this line is deduced): adjustSpanMethods(); | - |
4599 | } executed: } Execution Count:31 | 31 |
4600 | | - |
4601 | void QSpanData::initTexture(const QImage *image, int alpha, QTextureData::Type _type, const QRect &sourceRect) | - |
4602 | { | - |
4603 | 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(); | - |
4604 | if (!d || d->height == 0) { partially evaluated: !d no Evaluation Count:0 | yes Evaluation Count:5985 |
partially evaluated: d->height == 0 no Evaluation Count:0 | yes Evaluation Count:5985 |
| 0-5985 |
4605 | texture.imageData = 0; never executed (the execution status of this line is deduced): texture.imageData = 0; | - |
4606 | texture.width = 0; never executed (the execution status of this line is deduced): texture.width = 0; | - |
4607 | texture.height = 0; never executed (the execution status of this line is deduced): texture.height = 0; | - |
4608 | texture.x1 = 0; never executed (the execution status of this line is deduced): texture.x1 = 0; | - |
4609 | texture.y1 = 0; never executed (the execution status of this line is deduced): texture.y1 = 0; | - |
4610 | texture.x2 = 0; never executed (the execution status of this line is deduced): texture.x2 = 0; | - |
4611 | texture.y2 = 0; never executed (the execution status of this line is deduced): texture.y2 = 0; | - |
4612 | texture.bytesPerLine = 0; never executed (the execution status of this line is deduced): texture.bytesPerLine = 0; | - |
4613 | texture.format = QImage::Format_Invalid; never executed (the execution status of this line is deduced): texture.format = QImage::Format_Invalid; | - |
4614 | texture.colorTable = 0; never executed (the execution status of this line is deduced): texture.colorTable = 0; | - |
4615 | texture.hasAlpha = alpha != 256; never executed (the execution status of this line is deduced): texture.hasAlpha = alpha != 256; | - |
4616 | } else { | 0 |
4617 | texture.imageData = d->data; executed (the execution status of this line is deduced): texture.imageData = d->data; | - |
4618 | texture.width = d->width; executed (the execution status of this line is deduced): texture.width = d->width; | - |
4619 | texture.height = d->height; executed (the execution status of this line is deduced): texture.height = d->height; | - |
4620 | | - |
4621 | if (sourceRect.isNull()) { evaluated: sourceRect.isNull() yes Evaluation Count:4535 | yes Evaluation Count:1450 |
| 1450-4535 |
4622 | texture.x1 = 0; executed (the execution status of this line is deduced): texture.x1 = 0; | - |
4623 | texture.y1 = 0; executed (the execution status of this line is deduced): texture.y1 = 0; | - |
4624 | texture.x2 = texture.width; executed (the execution status of this line is deduced): texture.x2 = texture.width; | - |
4625 | texture.y2 = texture.height; executed (the execution status of this line is deduced): texture.y2 = texture.height; | - |
4626 | } else { executed: } Execution Count:4535 | 4535 |
4627 | texture.x1 = sourceRect.x(); executed (the execution status of this line is deduced): texture.x1 = sourceRect.x(); | - |
4628 | texture.y1 = sourceRect.y(); executed (the execution status of this line is deduced): texture.y1 = sourceRect.y(); | - |
4629 | 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); | - |
4630 | 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); | - |
4631 | } executed: } Execution Count:1450 | 1450 |
4632 | | - |
4633 | texture.bytesPerLine = d->bytes_per_line; executed (the execution status of this line is deduced): texture.bytesPerLine = d->bytes_per_line; | - |
4634 | | - |
4635 | texture.format = d->format; executed (the execution status of this line is deduced): texture.format = d->format; | - |
4636 | texture.colorTable = (d->format <= QImage::Format_Indexed8 && !d->colortable.isEmpty()) ? &d->colortable : 0; evaluated: d->format <= QImage::Format_Indexed8 yes Evaluation Count:181 | yes Evaluation Count:5804 |
partially evaluated: !d->colortable.isEmpty() yes Evaluation Count:181 | no Evaluation Count:0 |
| 0-5804 |
4637 | texture.hasAlpha = image->hasAlphaChannel() || alpha != 256; evaluated: image->hasAlphaChannel() yes Evaluation Count:5200 | yes Evaluation Count:785 |
evaluated: alpha != 256 yes Evaluation Count:246 | yes Evaluation Count:539 |
| 246-5200 |
4638 | } executed: } Execution Count:5985 | 5985 |
4639 | texture.const_alpha = alpha; executed (the execution status of this line is deduced): texture.const_alpha = alpha; | - |
4640 | texture.type = _type; executed (the execution status of this line is deduced): texture.type = _type; | - |
4641 | | - |
4642 | adjustSpanMethods(); executed (the execution status of this line is deduced): adjustSpanMethods(); | - |
4643 | } executed: } Execution Count:5985 | 5985 |
4644 | | - |
4645 | /*! | - |
4646 | \internal | - |
4647 | \a x and \a y is relative to the midpoint of \a rect. | - |
4648 | */ | - |
4649 | static inline void drawEllipsePoints(int x, int y, int length, | - |
4650 | const QRect &rect, | - |
4651 | const QRect &clip, | - |
4652 | ProcessSpans pen_func, ProcessSpans brush_func, | - |
4653 | QSpanData *pen_data, QSpanData *brush_data) | - |
4654 | { | - |
4655 | if (length == 0) partially evaluated: length == 0 no Evaluation Count:0 | yes Evaluation Count:40060 |
| 0-40060 |
4656 | return; | 0 |
4657 | | - |
4658 | QT_FT_Span outline[4]; executed (the execution status of this line is deduced): QT_FT_Span outline[4]; | - |
4659 | 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; | - |
4660 | 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; | - |
4661 | | - |
4662 | x = x + midx; executed (the execution status of this line is deduced): x = x + midx; | - |
4663 | y = midy - y; executed (the execution status of this line is deduced): y = midy - y; | - |
4664 | | - |
4665 | // topleft | - |
4666 | 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); | - |
4667 | 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); | - |
4668 | outline[0].y = y; executed (the execution status of this line is deduced): outline[0].y = y; | - |
4669 | outline[0].coverage = 255; executed (the execution status of this line is deduced): outline[0].coverage = 255; | - |
4670 | | - |
4671 | // topright | - |
4672 | outline[1].x = x; executed (the execution status of this line is deduced): outline[1].x = x; | - |
4673 | outline[1].len = length; executed (the execution status of this line is deduced): outline[1].len = length; | - |
4674 | outline[1].y = y; executed (the execution status of this line is deduced): outline[1].y = y; | - |
4675 | outline[1].coverage = 255; executed (the execution status of this line is deduced): outline[1].coverage = 255; | - |
4676 | | - |
4677 | // bottomleft | - |
4678 | outline[2].x = outline[0].x; executed (the execution status of this line is deduced): outline[2].x = outline[0].x; | - |
4679 | outline[2].len = outline[0].len; executed (the execution status of this line is deduced): outline[2].len = outline[0].len; | - |
4680 | 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); | - |
4681 | outline[2].coverage = 255; executed (the execution status of this line is deduced): outline[2].coverage = 255; | - |
4682 | | - |
4683 | // bottomright | - |
4684 | outline[3].x = x; executed (the execution status of this line is deduced): outline[3].x = x; | - |
4685 | outline[3].len = length; executed (the execution status of this line is deduced): outline[3].len = length; | - |
4686 | outline[3].y = outline[2].y; executed (the execution status of this line is deduced): outline[3].y = outline[2].y; | - |
4687 | outline[3].coverage = 255; executed (the execution status of this line is deduced): outline[3].coverage = 255; | - |
4688 | | - |
4689 | if (brush_func && outline[0].x + outline[0].len < outline[1].x) { evaluated: brush_func yes Evaluation Count:11204 | yes Evaluation Count:28856 |
evaluated: outline[0].x + outline[0].len < outline[1].x yes Evaluation Count:11002 | yes Evaluation Count:202 |
| 202-28856 |
4690 | QT_FT_Span fill[2]; executed (the execution status of this line is deduced): QT_FT_Span fill[2]; | - |
4691 | | - |
4692 | // top fill | - |
4693 | 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; | - |
4694 | 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); | - |
4695 | fill[0].y = outline[1].y; executed (the execution status of this line is deduced): fill[0].y = outline[1].y; | - |
4696 | fill[0].coverage = 255; executed (the execution status of this line is deduced): fill[0].coverage = 255; | - |
4697 | | - |
4698 | // bottom fill | - |
4699 | 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; | - |
4700 | 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); | - |
4701 | fill[1].y = outline[3].y; executed (the execution status of this line is deduced): fill[1].y = outline[3].y; | - |
4702 | fill[1].coverage = 255; executed (the execution status of this line is deduced): fill[1].coverage = 255; | - |
4703 | | - |
4704 | int n = (fill[0].y >= fill[1].y ? 1 : 2); evaluated: fill[0].y >= fill[1].y yes Evaluation Count:103 | yes Evaluation Count:10899 |
| 103-10899 |
4705 | n = qt_intersect_spans(fill, n, clip); executed (the execution status of this line is deduced): n = qt_intersect_spans(fill, n, clip); | - |
4706 | if (n > 0) evaluated: n > 0 yes Evaluation Count:6898 | yes Evaluation Count:4104 |
| 4104-6898 |
4707 | brush_func(n, fill, brush_data); executed: brush_func(n, fill, brush_data); Execution Count:6898 | 6898 |
4708 | } executed: } Execution Count:11002 | 11002 |
4709 | if (pen_func) { evaluated: pen_func yes Evaluation Count:36541 | yes Evaluation Count:3519 |
| 3519-36541 |
4710 | int n = (outline[1].y >= outline[2].y ? 2 : 4); evaluated: outline[1].y >= outline[2].y yes Evaluation Count:447 | yes Evaluation Count:36094 |
| 447-36094 |
4711 | n = qt_intersect_spans(outline, n, clip); executed (the execution status of this line is deduced): n = qt_intersect_spans(outline, n, clip); | - |
4712 | if (n > 0) evaluated: n > 0 yes Evaluation Count:32425 | yes Evaluation Count:4116 |
| 4116-32425 |
4713 | pen_func(n, outline, pen_data); executed: pen_func(n, outline, pen_data); Execution Count:32425 | 32425 |
4714 | } executed: } Execution Count:36541 | 36541 |
4715 | } executed: } Execution Count:40060 | 40060 |
4716 | | - |
4717 | /*! | - |
4718 | \internal | - |
4719 | Draws an ellipse using the integer point midpoint algorithm. | - |
4720 | */ | - |
4721 | static void drawEllipse_midpoint_i(const QRect &rect, const QRect &clip, | - |
4722 | ProcessSpans pen_func, ProcessSpans brush_func, | - |
4723 | QSpanData *pen_data, QSpanData *brush_data) | - |
4724 | { | - |
4725 | const qreal a = qreal(rect.width()) / 2; executed (the execution status of this line is deduced): const qreal a = qreal(rect.width()) / 2; | - |
4726 | const qreal b = qreal(rect.height()) / 2; executed (the execution status of this line is deduced): const qreal b = qreal(rect.height()) / 2; | - |
4727 | 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; | - |
4728 | | - |
4729 | int x = 0; executed (the execution status of this line is deduced): int x = 0; | - |
4730 | int y = (rect.height() + 1) / 2; executed (the execution status of this line is deduced): int y = (rect.height() + 1) / 2; | - |
4731 | int startx = x; executed (the execution status of this line is deduced): int startx = x; | - |
4732 | | - |
4733 | // region 1 | - |
4734 | while (a*a*(2*y - 1) > 2*b*b*(x + 1)) { evaluated: a*a*(2*y - 1) > 2*b*b*(x + 1) yes Evaluation Count:29846 | yes Evaluation Count:978 |
| 978-29846 |
4735 | if (d < 0) { // select E evaluated: d < 0 yes Evaluation Count:18454 | yes Evaluation Count:11392 |
| 11392-18454 |
4736 | d += b*b*(2*x + 3); executed (the execution status of this line is deduced): d += b*b*(2*x + 3); | - |
4737 | ++x; executed (the execution status of this line is deduced): ++x; | - |
4738 | } else { // select SE executed: } Execution Count:18454 | 18454 |
4739 | 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); | - |
4740 | 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, | - |
4741 | 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); | - |
4742 | startx = ++x; executed (the execution status of this line is deduced): startx = ++x; | - |
4743 | --y; executed (the execution status of this line is deduced): --y; | - |
4744 | } executed: } Execution Count:11392 | 11392 |
4745 | } | - |
4746 | 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, | - |
4747 | 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); | - |
4748 | | - |
4749 | // region 2 | - |
4750 | 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); | - |
4751 | const int miny = rect.height() & 0x1; executed (the execution status of this line is deduced): const int miny = rect.height() & 0x1; | - |
4752 | while (y > miny) { evaluated: y > miny yes Evaluation Count:27690 | yes Evaluation Count:978 |
| 978-27690 |
4753 | if (d < 0) { // select SE evaluated: d < 0 yes Evaluation Count:10844 | yes Evaluation Count:16846 |
| 10844-16846 |
4754 | 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); | - |
4755 | ++x; executed (the execution status of this line is deduced): ++x; | - |
4756 | } else { // select S executed: } Execution Count:10844 | 10844 |
4757 | d += a*a*(-2*y + 3); executed (the execution status of this line is deduced): d += a*a*(-2*y + 3); | - |
4758 | } executed: } Execution Count:16846 | 16846 |
4759 | --y; executed (the execution status of this line is deduced): --y; | - |
4760 | drawEllipsePoints(x, y, 1, rect, clip, executed (the execution status of this line is deduced): drawEllipsePoints(x, y, 1, rect, clip, | - |
4761 | 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); | - |
4762 | } executed: } Execution Count:27690 | 27690 |
4763 | } executed: } Execution Count:978 | 978 |
4764 | | - |
4765 | /*! | - |
4766 | \fn void QRasterPaintEngine::drawPoints(const QPoint *points, int pointCount) | - |
4767 | \overload | - |
4768 | \reimp | - |
4769 | */ | - |
4770 | | - |
4771 | | - |
4772 | #ifdef QT_DEBUG_DRAW | - |
4773 | void dumpClip(int width, int height, const QClipData *clip) | - |
4774 | { | - |
4775 | QImage clipImg(width, height, QImage::Format_ARGB32_Premultiplied); | - |
4776 | clipImg.fill(0xffff0000); | - |
4777 | | - |
4778 | int x0 = width; | - |
4779 | int x1 = 0; | - |
4780 | int y0 = height; | - |
4781 | int y1 = 0; | - |
4782 | | - |
4783 | ((QClipData *) clip)->spans(); // Force allocation of the spans structure... | - |
4784 | | - |
4785 | for (int i = 0; i < clip->count; ++i) { | - |
4786 | const QSpan *span = ((QClipData *) clip)->spans() + i; | - |
4787 | for (int j = 0; j < span->len; ++j) | - |
4788 | clipImg.setPixel(span->x + j, span->y, 0xffffff00); | - |
4789 | x0 = qMin(x0, int(span->x)); | - |
4790 | x1 = qMax(x1, int(span->x + span->len - 1)); | - |
4791 | | - |
4792 | y0 = qMin(y0, int(span->y)); | - |
4793 | y1 = qMax(y1, int(span->y)); | - |
4794 | } | - |
4795 | | - |
4796 | static int counter = 0; | - |
4797 | | - |
4798 | Q_ASSERT(y0 >= 0); | - |
4799 | Q_ASSERT(x0 >= 0); | - |
4800 | Q_ASSERT(y1 >= 0); | - |
4801 | Q_ASSERT(x1 >= 0); | - |
4802 | | - |
4803 | fprintf(stderr,"clip %d: %d %d - %d %d\n", counter, x0, y0, x1, y1); | - |
4804 | clipImg.save(QString::fromLatin1("clip-%0.png").arg(counter++)); | - |
4805 | } | - |
4806 | #endif | - |
4807 | | - |
4808 | | - |
4809 | QT_END_NAMESPACE | - |
4810 | | - |
| | |