painting/qpaintbuffer.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -
4** Contact: http://www.qt-project.org/legal -
5** -
6** This file is part of the QtGui module of the Qt Toolkit. -
7** -
8** $QT_BEGIN_LICENSE:LGPL$ -
9** Commercial License Usage -
10** Licensees holding valid commercial Qt licenses may use this file in -
11** accordance with the commercial license agreement provided with the -
12** Software or, alternatively, in accordance with the terms contained in -
13** a written agreement between you and Digia. For licensing terms and -
14** conditions see http://qt.digia.com/licensing. For further information -
15** use the contact form at http://qt.digia.com/contact-us. -
16** -
17** GNU Lesser General Public License Usage -
18** Alternatively, this file may be used under the terms of the GNU Lesser -
19** General Public License version 2.1 as published by the Free Software -
20** Foundation and appearing in the file LICENSE.LGPL included in the -
21** packaging of this file. Please review the following information to -
22** ensure the GNU Lesser General Public License version 2.1 requirements -
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -
24** -
25** In addition, as a special exception, Digia gives you certain additional -
26** rights. These rights are described in the Digia Qt LGPL Exception -
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -
28** -
29** GNU General Public License Usage -
30** Alternatively, this file may be used under the terms of the GNU -
31** General Public License version 3.0 as published by the Free Software -
32** Foundation and appearing in the file LICENSE.GPL included in the -
33** packaging of this file. Please review the following information to -
34** ensure the GNU General Public License version 3.0 requirements will be -
35** met: http://www.gnu.org/copyleft/gpl.html. -
36** -
37** -
38** $QT_END_LICENSE$ -
39** -
40****************************************************************************/ -
41#include <qmath.h> -
42#include <private/qpainterpath_p.h> -
43#include <private/qpaintbuffer_p.h> -
44//#include <private/qtextengine_p.h> -
45#include <private/qfontengine_p.h> -
46#include <private/qemulationpaintengine_p.h> -
47#include <private/qimage_p.h> -
48#include <qstatictext.h> -
49#include <private/qstatictext_p.h> -
50#include <private/qrawfont_p.h> -
51 -
52#include <QDebug> -
53 -
54// #define QPAINTBUFFER_DEBUG_DRAW -
55 -
56QT_BEGIN_NAMESPACE -
57 -
58extern void qt_format_text(const QFont &font, -
59 const QRectF &_r, int tf, const QTextOption *option, const QString& str, QRectF *brect, -
60 int tabstops, int* tabarray, int tabarraylen, -
61 QPainter *painter); -
62 -
63QTextItemIntCopy::QTextItemIntCopy(const QTextItem &item) -
64 : m_item(static_cast<const QTextItemInt &>(item)) -
65{ -
66 QChar *chars = new QChar[m_item.num_chars];
never executed (the execution status of this line is deduced): QChar *chars = new QChar[m_item.num_chars];
-
67 unsigned short *logClusters = new unsigned short[m_item.num_chars];
never executed (the execution status of this line is deduced): unsigned short *logClusters = new unsigned short[m_item.num_chars];
-
68 memcpy(chars, m_item.chars, m_item.num_chars * sizeof(QChar));
never executed (the execution status of this line is deduced): memcpy(chars, m_item.chars, m_item.num_chars * sizeof(QChar));
-
69 memcpy(logClusters, m_item.logClusters, m_item.num_chars * sizeof(unsigned short));
never executed (the execution status of this line is deduced): memcpy(logClusters, m_item.logClusters, m_item.num_chars * sizeof(unsigned short));
-
70 m_item.chars = chars;
never executed (the execution status of this line is deduced): m_item.chars = chars;
-
71 m_item.logClusters = logClusters;
never executed (the execution status of this line is deduced): m_item.logClusters = logClusters;
-
72 -
73 const int size = QGlyphLayout::spaceNeededForGlyphLayout(m_item.glyphs.numGlyphs);
never executed (the execution status of this line is deduced): const int size = QGlyphLayout::spaceNeededForGlyphLayout(m_item.glyphs.numGlyphs);
-
74 char *glyphLayoutData = new char[size];
never executed (the execution status of this line is deduced): char *glyphLayoutData = new char[size];
-
75 QGlyphLayout glyphs(glyphLayoutData, m_item.glyphs.numGlyphs);
never executed (the execution status of this line is deduced): QGlyphLayout glyphs(glyphLayoutData, m_item.glyphs.numGlyphs);
-
76 memcpy(glyphs.offsets, m_item.glyphs.offsets, m_item.glyphs.numGlyphs * sizeof(QFixedPoint));
never executed (the execution status of this line is deduced): memcpy(glyphs.offsets, m_item.glyphs.offsets, m_item.glyphs.numGlyphs * sizeof(QFixedPoint));
-
77 memcpy(glyphs.glyphs, m_item.glyphs.glyphs, m_item.glyphs.numGlyphs * sizeof(HB_Glyph));
never executed (the execution status of this line is deduced): memcpy(glyphs.glyphs, m_item.glyphs.glyphs, m_item.glyphs.numGlyphs * sizeof(HB_Glyph));
-
78 memcpy(glyphs.advances_x, m_item.glyphs.advances_x, m_item.glyphs.numGlyphs * sizeof(QFixed));
never executed (the execution status of this line is deduced): memcpy(glyphs.advances_x, m_item.glyphs.advances_x, m_item.glyphs.numGlyphs * sizeof(QFixed));
-
79 memcpy(glyphs.advances_y, m_item.glyphs.advances_y, m_item.glyphs.numGlyphs * sizeof(QFixed));
never executed (the execution status of this line is deduced): memcpy(glyphs.advances_y, m_item.glyphs.advances_y, m_item.glyphs.numGlyphs * sizeof(QFixed));
-
80 memcpy(glyphs.justifications, m_item.glyphs.justifications, m_item.glyphs.numGlyphs * sizeof(QGlyphJustification));
never executed (the execution status of this line is deduced): memcpy(glyphs.justifications, m_item.glyphs.justifications, m_item.glyphs.numGlyphs * sizeof(QGlyphJustification));
-
81 memcpy(glyphs.attributes, m_item.glyphs.attributes, m_item.glyphs.numGlyphs * sizeof(HB_GlyphAttributes));
never executed (the execution status of this line is deduced): memcpy(glyphs.attributes, m_item.glyphs.attributes, m_item.glyphs.numGlyphs * sizeof(HB_GlyphAttributes));
-
82 m_item.glyphs = glyphs;
never executed (the execution status of this line is deduced): m_item.glyphs = glyphs;
-
83 -
84 m_font = *m_item.f;
never executed (the execution status of this line is deduced): m_font = *m_item.f;
-
85 m_item.f = &m_font;
never executed (the execution status of this line is deduced): m_item.f = &m_font;
-
86 -
87 m_item.fontEngine->ref.ref(); // Increment reference count.
never executed (the execution status of this line is deduced): m_item.fontEngine->ref.ref();
-
88}
never executed: }
0
89 -
90QTextItemIntCopy::~QTextItemIntCopy() -
91{ -
92 delete m_item.chars;
never executed (the execution status of this line is deduced): delete m_item.chars;
-
93 delete m_item.logClusters;
never executed (the execution status of this line is deduced): delete m_item.logClusters;
-
94 delete m_item.glyphs.data();
never executed (the execution status of this line is deduced): delete m_item.glyphs.data();
-
95 if (!m_item.fontEngine->ref.deref())
never evaluated: !m_item.fontEngine->ref.deref()
0
96 delete m_item.fontEngine;
never executed: delete m_item.fontEngine;
0
97}
never executed: }
0
98 -
99/************************************************************************ -
100 * -
101 * QPaintBufferPrivate -
102 * -
103 ************************************************************************/ -
104 -
105QPaintBufferPrivate::QPaintBufferPrivate() -
106 : ref(1), engine(0), penWidthAdjustment(0) -
107 , calculateBoundingRect(true) -
108 , cache(0) -
109{ -
110}
never executed: }
0
111 -
112QPaintBufferPrivate::~QPaintBufferPrivate() -
113{ -
114 for (int i = 0; i < commands.size(); ++i) {
never evaluated: i < commands.size()
0
115 const QPaintBufferCommand &cmd = commands.at(i);
never executed (the execution status of this line is deduced): const QPaintBufferCommand &cmd = commands.at(i);
-
116 if (cmd.id == QPaintBufferPrivate::Cmd_DrawTextItem)
never evaluated: cmd.id == QPaintBufferPrivate::Cmd_DrawTextItem
0
117 delete reinterpret_cast<QTextItemIntCopy *>(qvariant_cast<void *>(variants.at(cmd.offset)));
never executed: delete reinterpret_cast<QTextItemIntCopy *>(qvariant_cast<void *>(variants.at(cmd.offset)));
0
118 }
never executed: }
0
119}
never executed: }
0
120 -
121 -
122inline void QPaintBufferPrivate::updateBoundingRect(const QRectF &br) -
123{ -
124 // transform to device coords and adjust for pen width -
125 Q_ASSERT(engine && engine->painter());
never executed (the execution status of this line is deduced): qt_noop();
-
126 QPainter *painter = engine->painter();
never executed (the execution status of this line is deduced): QPainter *painter = engine->painter();
-
127 const QTransform transform = painter->transform();
never executed (the execution status of this line is deduced): const QTransform transform = painter->transform();
-
128 QRectF devRect = transform.mapRect(br);
never executed (the execution status of this line is deduced): QRectF devRect = transform.mapRect(br);
-
129 if (penWidthAdjustment > 0) {
never evaluated: penWidthAdjustment > 0
0
130 devRect = devRect.adjusted(-penWidthAdjustment, -penWidthAdjustment,
never executed (the execution status of this line is deduced): devRect = devRect.adjusted(-penWidthAdjustment, -penWidthAdjustment,
-
131 penWidthAdjustment, penWidthAdjustment);
never executed (the execution status of this line is deduced): penWidthAdjustment, penWidthAdjustment);
-
132 }
never executed: }
0
133 -
134 if (boundingRect.isEmpty()) {
never evaluated: boundingRect.isEmpty()
0
135 boundingRect = devRect;
never executed (the execution status of this line is deduced): boundingRect = devRect;
-
136 } else {
never executed: }
0
137 qreal min_x = qMin(devRect.left(), boundingRect.left());
never executed (the execution status of this line is deduced): qreal min_x = qMin(devRect.left(), boundingRect.left());
-
138 qreal min_y = qMin(devRect.top(), boundingRect.top());
never executed (the execution status of this line is deduced): qreal min_y = qMin(devRect.top(), boundingRect.top());
-
139 qreal max_x = qMax(devRect.right(), boundingRect.right());
never executed (the execution status of this line is deduced): qreal max_x = qMax(devRect.right(), boundingRect.right());
-
140 qreal max_y = qMax(devRect.bottom(), boundingRect.bottom());
never executed (the execution status of this line is deduced): qreal max_y = qMax(devRect.bottom(), boundingRect.bottom());
-
141 boundingRect = QRectF(min_x, min_y, max_x - min_x, max_y - min_y);
never executed (the execution status of this line is deduced): boundingRect = QRectF(min_x, min_y, max_x - min_x, max_y - min_y);
-
142 }
never executed: }
0
143 if (painter->hasClipping())
never evaluated: painter->hasClipping()
0
144 boundingRect &= transform.mapRect(painter->clipRegion().boundingRect());
never executed: boundingRect &= transform.mapRect(painter->clipRegion().boundingRect());
0
145}
never executed: }
0
146 -
147 -
148/************************************************************************ -
149 * -
150 * QPaintBuffer -
151 * -
152 ************************************************************************/ -
153 -
154 -
155 -
156QPaintBuffer::QPaintBuffer() -
157 : d_ptr(new QPaintBufferPrivate) -
158{ -
159}
never executed: }
0
160 -
161QPaintBuffer::~QPaintBuffer() -
162{ -
163 if (!d_ptr->ref.deref())
never evaluated: !d_ptr->ref.deref()
0
164 delete d_ptr;
never executed: delete d_ptr;
0
165}
never executed: }
0
166 -
167QPaintBuffer::QPaintBuffer(const QPaintBuffer &other) -
168 : QPaintDevice(), d_ptr(other.d_ptr) -
169{ -
170 d_ptr->ref.ref();
never executed (the execution status of this line is deduced): d_ptr->ref.ref();
-
171}
never executed: }
0
172 -
173QPaintEngine *QPaintBuffer::paintEngine() const -
174{ -
175 QPaintBufferPrivate *d = const_cast<QPaintBuffer *>(this)->d_ptr;
never executed (the execution status of this line is deduced): QPaintBufferPrivate *d = const_cast<QPaintBuffer *>(this)->d_ptr;
-
176 if (!d->engine)
never evaluated: !d->engine
0
177 d->engine = new QPaintBufferEngine(d);
never executed: d->engine = new QPaintBufferEngine(d);
0
178 return d->engine;
never executed: return d->engine;
0
179} -
180 -
181 -
182int QPaintBuffer::metric(PaintDeviceMetric metric) const -
183{ -
184 int val = 0;
never executed (the execution status of this line is deduced): int val = 0;
-
185 switch (metric) { -
186 case PdmWidth: -
187 val = qCeil(d_ptr->boundingRect.width());
never executed (the execution status of this line is deduced): val = qCeil(d_ptr->boundingRect.width());
-
188 break;
never executed: break;
0
189 case PdmHeight: -
190 val = qCeil(d_ptr->boundingRect.height());
never executed (the execution status of this line is deduced): val = qCeil(d_ptr->boundingRect.height());
-
191 break;
never executed: break;
0
192 case PdmDpiX: -
193 case PdmPhysicalDpiX: -
194 val = qt_defaultDpiX();
never executed (the execution status of this line is deduced): val = qt_defaultDpiX();
-
195 break;
never executed: break;
0
196 case PdmDpiY: -
197 case PdmPhysicalDpiY: -
198 val = qt_defaultDpiY();
never executed (the execution status of this line is deduced): val = qt_defaultDpiY();
-
199 break;
never executed: break;
0
200 default: -
201 val = QPaintDevice::metric(metric);
never executed (the execution status of this line is deduced): val = QPaintDevice::metric(metric);
-
202 }
never executed: }
0
203 -
204 return val;
never executed: return val;
0
205} -
206 -
207int QPaintBuffer::devType() const -
208{ -
209 return QInternal::PaintBuffer;
never executed: return QInternal::PaintBuffer;
0
210} -
211 -
212QPaintBuffer &QPaintBuffer::operator=(const QPaintBuffer &other) -
213{ -
214 if (other.d_ptr != d_ptr) {
never evaluated: other.d_ptr != d_ptr
0
215 QPaintBufferPrivate *data = other.d_ptr;
never executed (the execution status of this line is deduced): QPaintBufferPrivate *data = other.d_ptr;
-
216 data->ref.ref();
never executed (the execution status of this line is deduced): data->ref.ref();
-
217 if (d_ptr->ref.deref())
never evaluated: d_ptr->ref.deref()
0
218 delete d_ptr;
never executed: delete d_ptr;
0
219 d_ptr = data;
never executed (the execution status of this line is deduced): d_ptr = data;
-
220 }
never executed: }
0
221 return *this;
never executed: return *this;
0
222} -
223 -
224bool QPaintBuffer::isEmpty() const -
225{ -
226 return d_ptr->commands.isEmpty();
never executed: return d_ptr->commands.isEmpty();
0
227} -
228 -
229 -
230 -
231void QPaintBuffer::draw(QPainter *painter, int frame) const -
232{ -
233#ifdef QPAINTBUFFER_DEBUG_DRAW -
234 qDebug() << "QPaintBuffer::draw() --------------------------------"; -
235 -
236 Q_D(const QPaintBuffer); -
237 printf("Float buffer:"); -
238 for (int i=0; i<d->floats.size(); i++) { -
239 if ((i % 10) == 0) { -
240 printf("\n%4d-%4d: ", i, i+9); -
241 } -
242 printf("%4.2f ", d->floats[i]); -
243 } -
244 printf("\n"); -
245 -
246 printf("Int Buffer:"); -
247 for (int i=0; i<d->ints.size(); i++) { -
248 if ((i % 10) == 0) { -
249 printf("\n%4d-%4d: ", i, i+10); -
250 } -
251 printf("%5d", d->ints[i]); -
252 } -
253 printf("\n"); -
254#endif -
255 -
256 processCommands(painter, frameStartIndex(frame), frameEndIndex(frame));
never executed (the execution status of this line is deduced): processCommands(painter, frameStartIndex(frame), frameEndIndex(frame));
-
257 -
258#ifdef QPAINTBUFFER_DEBUG_DRAW -
259 qDebug() << "QPaintBuffer::draw() -------------------------------- DONE!"; -
260#endif -
261}
never executed: }
0
262 -
263int QPaintBuffer::frameStartIndex(int frame) const -
264{ -
265 return (frame == 0) ? 0 : d_ptr->frames.at(frame - 1);
never executed: return (frame == 0) ? 0 : d_ptr->frames.at(frame - 1);
0
266} -
267 -
268int QPaintBuffer::frameEndIndex(int frame) const -
269{ -
270 return (frame == d_ptr->frames.size()) ? d_ptr->commands.size() : d_ptr->frames.at(frame);
never executed: return (frame == d_ptr->frames.size()) ? d_ptr->commands.size() : d_ptr->frames.at(frame);
0
271} -
272 -
273int QPaintBuffer::processCommands(QPainter *painter, int begin, int end) const -
274{ -
275 if (!painter || !painter->isActive())
never evaluated: !painter
never evaluated: !painter->isActive()
0
276 return 0;
never executed: return 0;
0
277 -
278 QPaintEngineEx *xengine = painter->paintEngine()->isExtended()
never evaluated: painter->paintEngine()->isExtended()
0
279 ? (QPaintEngineEx *) painter->paintEngine() : 0;
never executed (the execution status of this line is deduced): ? (QPaintEngineEx *) painter->paintEngine() : 0;
-
280 if (xengine) {
never evaluated: xengine
0
281 QPaintEngineExReplayer player;
never executed (the execution status of this line is deduced): QPaintEngineExReplayer player;
-
282 player.processCommands(*this, painter, begin, end);
never executed (the execution status of this line is deduced): player.processCommands(*this, painter, begin, end);
-
283 } else {
never executed: }
0
284 QPainterReplayer player;
never executed (the execution status of this line is deduced): QPainterReplayer player;
-
285 player.processCommands(*this, painter, begin, end);
never executed (the execution status of this line is deduced): player.processCommands(*this, painter, begin, end);
-
286 }
never executed: }
0
287 -
288 int depth = 0;
never executed (the execution status of this line is deduced): int depth = 0;
-
289 for (int i = begin; i < end; ++i) {
never evaluated: i < end
0
290 const QPaintBufferCommand &cmd = d_ptr->commands.at(i);
never executed (the execution status of this line is deduced): const QPaintBufferCommand &cmd = d_ptr->commands.at(i);
-
291 if (cmd.id == QPaintBufferPrivate::Cmd_Save)
never evaluated: cmd.id == QPaintBufferPrivate::Cmd_Save
0
292 ++depth;
never executed: ++depth;
0
293 else if (cmd.id == QPaintBufferPrivate::Cmd_Restore)
never evaluated: cmd.id == QPaintBufferPrivate::Cmd_Restore
0
294 --depth;
never executed: --depth;
0
295 } -
296 return depth;
never executed: return depth;
0
297} -
298 -
299#ifndef QT_NO_DEBUG_STREAM -
300QString QPaintBuffer::commandDescription(int command) const -
301{ -
302 QString desc;
never executed (the execution status of this line is deduced): QString desc;
-
303 QDebug debug(&desc);
never executed (the execution status of this line is deduced): QDebug debug(&desc);
-
304 -
305 const QPaintBufferCommand &cmd = d_ptr->commands.at(command);
never executed (the execution status of this line is deduced): const QPaintBufferCommand &cmd = d_ptr->commands.at(command);
-
306 -
307 switch (cmd.id) { -
308 case QPaintBufferPrivate::Cmd_Save: { -
309 debug << "Cmd_Save";
never executed (the execution status of this line is deduced): debug << "Cmd_Save";
-
310 break; }
never executed: break;
0
311 -
312 case QPaintBufferPrivate::Cmd_Restore: { -
313 debug << "Cmd_Restore";
never executed (the execution status of this line is deduced): debug << "Cmd_Restore";
-
314 break; }
never executed: break;
0
315 -
316 case QPaintBufferPrivate::Cmd_SetBrush: { -
317 QBrush brush = qvariant_cast<QBrush>(d_ptr->variants.at(cmd.offset));
never executed (the execution status of this line is deduced): QBrush brush = qvariant_cast<QBrush>(d_ptr->variants.at(cmd.offset));
-
318 debug << "Cmd_SetBrush: " << brush;
never executed (the execution status of this line is deduced): debug << "Cmd_SetBrush: " << brush;
-
319 break; }
never executed: break;
0
320 -
321 case QPaintBufferPrivate::Cmd_SetBrushOrigin: { -
322 debug << "Cmd_SetBrushOrigin: " << d_ptr->variants.at(cmd.offset).toPointF();
never executed (the execution status of this line is deduced): debug << "Cmd_SetBrushOrigin: " << d_ptr->variants.at(cmd.offset).toPointF();
-
323 break; }
never executed: break;
0
324 -
325 case QPaintBufferPrivate::Cmd_SetCompositionMode: { -
326 QPainter::CompositionMode mode = (QPainter::CompositionMode) cmd.extra;
never executed (the execution status of this line is deduced): QPainter::CompositionMode mode = (QPainter::CompositionMode) cmd.extra;
-
327 debug << "ExCmd_SetCompositionMode, mode: " << mode;
never executed (the execution status of this line is deduced): debug << "ExCmd_SetCompositionMode, mode: " << mode;
-
328 break; }
never executed: break;
0
329 -
330 case QPaintBufferPrivate::Cmd_SetOpacity: { -
331 debug << "ExCmd_SetOpacity: " << d_ptr->variants.at(cmd.offset).toDouble();
never executed (the execution status of this line is deduced): debug << "ExCmd_SetOpacity: " << d_ptr->variants.at(cmd.offset).toDouble();
-
332 break; }
never executed: break;
0
333 -
334 case QPaintBufferPrivate::Cmd_DrawVectorPath: { -
335 debug << "ExCmd_DrawVectorPath: size: " << cmd.size
never executed (the execution status of this line is deduced): debug << "ExCmd_DrawVectorPath: size: " << cmd.size
-
336// << ", hints:" << d->ints[cmd.offset2+cmd.size]
never executed (the execution status of this line is deduced):
-
337 << "pts/elms:" << cmd.offset << cmd.offset2;
never executed (the execution status of this line is deduced): << "pts/elms:" << cmd.offset << cmd.offset2;
-
338 break; }
never executed: break;
0
339 -
340 case QPaintBufferPrivate::Cmd_StrokeVectorPath: { -
341 QPen pen = qvariant_cast<QPen>(d_ptr->variants.at(cmd.extra));
never executed (the execution status of this line is deduced): QPen pen = qvariant_cast<QPen>(d_ptr->variants.at(cmd.extra));
-
342 debug << "ExCmd_StrokeVectorPath: size: " << cmd.size
never executed (the execution status of this line is deduced): debug << "ExCmd_StrokeVectorPath: size: " << cmd.size
-
343// << ", hints:" << d->ints[cmd.offset2+cmd.size]
never executed (the execution status of this line is deduced):
-
344 << "pts/elms:" << cmd.offset << cmd.offset2 << pen;
never executed (the execution status of this line is deduced): << "pts/elms:" << cmd.offset << cmd.offset2 << pen;
-
345 break; }
never executed: break;
0
346 -
347 case QPaintBufferPrivate::Cmd_FillVectorPath: { -
348 QBrush brush = qvariant_cast<QBrush>(d_ptr->variants.at(cmd.extra));
never executed (the execution status of this line is deduced): QBrush brush = qvariant_cast<QBrush>(d_ptr->variants.at(cmd.extra));
-
349 debug << "ExCmd_FillVectorPath: size: " << cmd.size
never executed (the execution status of this line is deduced): debug << "ExCmd_FillVectorPath: size: " << cmd.size
-
350// << ", hints:" << d->ints[cmd.offset2+cmd.size]
never executed (the execution status of this line is deduced):
-
351 << "pts/elms:" << cmd.offset << cmd.offset2 << brush;
never executed (the execution status of this line is deduced): << "pts/elms:" << cmd.offset << cmd.offset2 << brush;
-
352 break; }
never executed: break;
0
353 -
354 case QPaintBufferPrivate::Cmd_FillRectBrush: { -
355 QBrush brush = qvariant_cast<QBrush>(d_ptr->variants.at(cmd.extra));
never executed (the execution status of this line is deduced): QBrush brush = qvariant_cast<QBrush>(d_ptr->variants.at(cmd.extra));
-
356 QRectF *rect = (QRectF *)(d_ptr->floats.constData() + cmd.offset);
never executed (the execution status of this line is deduced): QRectF *rect = (QRectF *)(d_ptr->floats.constData() + cmd.offset);
-
357 debug << "ExCmd_FillRectBrush, offset: " << cmd.offset << " rect: " << *rect << " brush: " << brush;
never executed (the execution status of this line is deduced): debug << "ExCmd_FillRectBrush, offset: " << cmd.offset << " rect: " << *rect << " brush: " << brush;
-
358 break; }
never executed: break;
0
359 -
360 case QPaintBufferPrivate::Cmd_FillRectColor: { -
361 QColor color = qvariant_cast<QColor>(d_ptr->variants.at(cmd.extra));
never executed (the execution status of this line is deduced): QColor color = qvariant_cast<QColor>(d_ptr->variants.at(cmd.extra));
-
362 QRectF *rect = (QRectF *)(d_ptr->floats.constData() + cmd.offset);
never executed (the execution status of this line is deduced): QRectF *rect = (QRectF *)(d_ptr->floats.constData() + cmd.offset);
-
363 debug << "ExCmd_FillRectBrush, offset: " << cmd.offset << " rect: " << *rect << " color: " << color;
never executed (the execution status of this line is deduced): debug << "ExCmd_FillRectBrush, offset: " << cmd.offset << " rect: " << *rect << " color: " << color;
-
364 break; }
never executed: break;
0
365 -
366 case QPaintBufferPrivate::Cmd_DrawPolygonF: { -
367 debug << "ExCmd_DrawPolygonF, offset: " << cmd.offset << " size: " << cmd.size
never executed (the execution status of this line is deduced): debug << "ExCmd_DrawPolygonF, offset: " << cmd.offset << " size: " << cmd.size
-
368 << " mode: " << cmd.extra
never executed (the execution status of this line is deduced): << " mode: " << cmd.extra
-
369 << d_ptr->floats.at(cmd.offset)
never executed (the execution status of this line is deduced): << d_ptr->floats.at(cmd.offset)
-
370 << d_ptr->floats.at(cmd.offset+1);
never executed (the execution status of this line is deduced): << d_ptr->floats.at(cmd.offset+1);
-
371 break; }
never executed: break;
0
372 -
373 case QPaintBufferPrivate::Cmd_DrawPolygonI: { -
374 debug << "ExCmd_DrawPolygonI, offset: " << cmd.offset << " size: " << cmd.size
never executed (the execution status of this line is deduced): debug << "ExCmd_DrawPolygonI, offset: " << cmd.offset << " size: " << cmd.size
-
375 << " mode: " << cmd.extra
never executed (the execution status of this line is deduced): << " mode: " << cmd.extra
-
376 << d_ptr->ints.at(cmd.offset)
never executed (the execution status of this line is deduced): << d_ptr->ints.at(cmd.offset)
-
377 << d_ptr->ints.at(cmd.offset+1);
never executed (the execution status of this line is deduced): << d_ptr->ints.at(cmd.offset+1);
-
378 break; }
never executed: break;
0
379 -
380 case QPaintBufferPrivate::Cmd_DrawEllipseF: { -
381 debug << "ExCmd_DrawEllipseF, offset: " << cmd.offset;
never executed (the execution status of this line is deduced): debug << "ExCmd_DrawEllipseF, offset: " << cmd.offset;
-
382 break; }
never executed: break;
0
383 -
384 case QPaintBufferPrivate::Cmd_DrawLineF: { -
385 debug << "ExCmd_DrawLineF, offset: " << cmd.offset << " size: " << cmd.size;
never executed (the execution status of this line is deduced): debug << "ExCmd_DrawLineF, offset: " << cmd.offset << " size: " << cmd.size;
-
386 break; }
never executed: break;
0
387 -
388 case QPaintBufferPrivate::Cmd_DrawLineI: { -
389 debug << "ExCmd_DrawLineI, offset: " << cmd.offset << " size: " << cmd.size;
never executed (the execution status of this line is deduced): debug << "ExCmd_DrawLineI, offset: " << cmd.offset << " size: " << cmd.size;
-
390 break; }
never executed: break;
0
391 -
392 case QPaintBufferPrivate::Cmd_DrawPointsF: { -
393 debug << "ExCmd_DrawPointsF, offset: " << cmd.offset << " size: " << cmd.size;
never executed (the execution status of this line is deduced): debug << "ExCmd_DrawPointsF, offset: " << cmd.offset << " size: " << cmd.size;
-
394 break; }
never executed: break;
0
395 -
396 case QPaintBufferPrivate::Cmd_DrawPointsI: { -
397 debug << "ExCmd_DrawPointsI, offset: " << cmd.offset << " size: " << cmd.size;
never executed (the execution status of this line is deduced): debug << "ExCmd_DrawPointsI, offset: " << cmd.offset << " size: " << cmd.size;
-
398 break; }
never executed: break;
0
399 -
400 case QPaintBufferPrivate::Cmd_DrawPolylineF: { -
401 debug << "ExCmd_DrawPolylineF, offset: " << cmd.offset << " size: " << cmd.size;
never executed (the execution status of this line is deduced): debug << "ExCmd_DrawPolylineF, offset: " << cmd.offset << " size: " << cmd.size;
-
402 break; }
never executed: break;
0
403 -
404 case QPaintBufferPrivate::Cmd_DrawPolylineI: { -
405 debug << "ExCmd_DrawPolylineI, offset: " << cmd.offset << " size: " << cmd.size;
never executed (the execution status of this line is deduced): debug << "ExCmd_DrawPolylineI, offset: " << cmd.offset << " size: " << cmd.size;
-
406 break; }
never executed: break;
0
407 -
408 case QPaintBufferPrivate::Cmd_DrawRectF: { -
409 debug << "ExCmd_DrawRectF, offset: " << cmd.offset << " size: " << cmd.size;
never executed (the execution status of this line is deduced): debug << "ExCmd_DrawRectF, offset: " << cmd.offset << " size: " << cmd.size;
-
410 break; }
never executed: break;
0
411 -
412 case QPaintBufferPrivate::Cmd_DrawRectI: { -
413 debug << "ExCmd_DrawRectI, offset: " << cmd.offset << " size: " << cmd.size;
never executed (the execution status of this line is deduced): debug << "ExCmd_DrawRectI, offset: " << cmd.offset << " size: " << cmd.size;
-
414 break; }
never executed: break;
0
415 -
416 case QPaintBufferPrivate::Cmd_SetClipEnabled: { -
417 bool clipEnabled = d_ptr->variants.at(cmd.offset).toBool();
never executed (the execution status of this line is deduced): bool clipEnabled = d_ptr->variants.at(cmd.offset).toBool();
-
418 debug << "ExCmd_SetClipEnabled:" << clipEnabled;
never executed (the execution status of this line is deduced): debug << "ExCmd_SetClipEnabled:" << clipEnabled;
-
419 break; }
never executed: break;
0
420 -
421 case QPaintBufferPrivate::Cmd_ClipVectorPath: { -
422 QVectorPathCmd path(d_ptr, cmd);
never executed (the execution status of this line is deduced): QVectorPathCmd path(d_ptr, cmd);
-
423 debug << "ExCmd_ClipVectorPath:" << path().elementCount();
never executed (the execution status of this line is deduced): debug << "ExCmd_ClipVectorPath:" << path().elementCount();
-
424 break; }
never executed: break;
0
425 -
426 case QPaintBufferPrivate::Cmd_ClipRect: { -
427 QRect rect(QPoint(d_ptr->ints.at(cmd.offset), d_ptr->ints.at(cmd.offset + 1)),
never executed (the execution status of this line is deduced): QRect rect(QPoint(d_ptr->ints.at(cmd.offset), d_ptr->ints.at(cmd.offset + 1)),
-
428 QPoint(d_ptr->ints.at(cmd.offset + 2), d_ptr->ints.at(cmd.offset + 3)));
never executed (the execution status of this line is deduced): QPoint(d_ptr->ints.at(cmd.offset + 2), d_ptr->ints.at(cmd.offset + 3)));
-
429 debug << "ExCmd_ClipRect:" << rect << cmd.extra;
never executed (the execution status of this line is deduced): debug << "ExCmd_ClipRect:" << rect << cmd.extra;
-
430 break; }
never executed: break;
0
431 -
432 case QPaintBufferPrivate::Cmd_ClipRegion: { -
433 QRegion region(d_ptr->variants.at(cmd.offset).value<QRegion>());
never executed (the execution status of this line is deduced): QRegion region(d_ptr->variants.at(cmd.offset).value<QRegion>());
-
434 debug << "ExCmd_ClipRegion:" << region.boundingRect() << cmd.extra;
never executed (the execution status of this line is deduced): debug << "ExCmd_ClipRegion:" << region.boundingRect() << cmd.extra;
-
435 break; }
never executed: break;
0
436 -
437 case QPaintBufferPrivate::Cmd_SetPen: { -
438 QPen pen = qvariant_cast<QPen>(d_ptr->variants.at(cmd.offset));
never executed (the execution status of this line is deduced): QPen pen = qvariant_cast<QPen>(d_ptr->variants.at(cmd.offset));
-
439 debug << "Cmd_SetPen: " << pen;
never executed (the execution status of this line is deduced): debug << "Cmd_SetPen: " << pen;
-
440 break; }
never executed: break;
0
441 -
442 case QPaintBufferPrivate::Cmd_SetTransform: { -
443 QTransform xform = qvariant_cast<QTransform>(d_ptr->variants.at(cmd.offset));
never executed (the execution status of this line is deduced): QTransform xform = qvariant_cast<QTransform>(d_ptr->variants.at(cmd.offset));
-
444 debug << "Cmd_SetTransform, offset: " << cmd.offset << xform;
never executed (the execution status of this line is deduced): debug << "Cmd_SetTransform, offset: " << cmd.offset << xform;
-
445 break; }
never executed: break;
0
446 -
447 case QPaintBufferPrivate::Cmd_SetRenderHints: { -
448 debug << "Cmd_SetRenderHints, hints: " << cmd.extra;
never executed (the execution status of this line is deduced): debug << "Cmd_SetRenderHints, hints: " << cmd.extra;
-
449 break; }
never executed: break;
0
450 -
451 case QPaintBufferPrivate::Cmd_SetBackgroundMode: { -
452 debug << "Cmd_SetBackgroundMode: " << cmd.extra;
never executed (the execution status of this line is deduced): debug << "Cmd_SetBackgroundMode: " << cmd.extra;
-
453 break; }
never executed: break;
0
454 -
455 case QPaintBufferPrivate::Cmd_DrawConvexPolygonF: { -
456 debug << "Cmd_DrawConvexPolygonF, offset: " << cmd.offset << " size: " << cmd.size;
never executed (the execution status of this line is deduced): debug << "Cmd_DrawConvexPolygonF, offset: " << cmd.offset << " size: " << cmd.size;
-
457 break; }
never executed: break;
0
458 -
459 case QPaintBufferPrivate::Cmd_DrawConvexPolygonI: { -
460 debug << "Cmd_DrawConvexPolygonI, offset: " << cmd.offset << " size: " << cmd.size;
never executed (the execution status of this line is deduced): debug << "Cmd_DrawConvexPolygonI, offset: " << cmd.offset << " size: " << cmd.size;
-
461 break; }
never executed: break;
0
462 -
463 case QPaintBufferPrivate::Cmd_DrawEllipseI: { -
464 debug << "Cmd_DrawEllipseI, offset: " << cmd.offset;
never executed (the execution status of this line is deduced): debug << "Cmd_DrawEllipseI, offset: " << cmd.offset;
-
465 break; }
never executed: break;
0
466 -
467 case QPaintBufferPrivate::Cmd_DrawPixmapRect: { -
468 QPixmap pm(d_ptr->variants.at(cmd.offset).value<QPixmap>());
never executed (the execution status of this line is deduced): QPixmap pm(d_ptr->variants.at(cmd.offset).value<QPixmap>());
-
469 QRectF r(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1),
never executed (the execution status of this line is deduced): QRectF r(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1),
-
470 d_ptr->floats.at(cmd.extra+2), d_ptr->floats.at(cmd.extra+3));
never executed (the execution status of this line is deduced): d_ptr->floats.at(cmd.extra+2), d_ptr->floats.at(cmd.extra+3));
-
471 -
472 QRectF sr(d_ptr->floats.at(cmd.extra+4), d_ptr->floats.at(cmd.extra+5),
never executed (the execution status of this line is deduced): QRectF sr(d_ptr->floats.at(cmd.extra+4), d_ptr->floats.at(cmd.extra+5),
-
473 d_ptr->floats.at(cmd.extra+6), d_ptr->floats.at(cmd.extra+7));
never executed (the execution status of this line is deduced): d_ptr->floats.at(cmd.extra+6), d_ptr->floats.at(cmd.extra+7));
-
474 debug << "Cmd_DrawPixmapRect:" << r << sr << pm.size();
never executed (the execution status of this line is deduced): debug << "Cmd_DrawPixmapRect:" << r << sr << pm.size();
-
475 break; }
never executed: break;
0
476 -
477 case QPaintBufferPrivate::Cmd_DrawPixmapPos: { -
478 QPixmap pm(d_ptr->variants.at(cmd.offset).value<QPixmap>());
never executed (the execution status of this line is deduced): QPixmap pm(d_ptr->variants.at(cmd.offset).value<QPixmap>());
-
479 QPointF pos(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1));
never executed (the execution status of this line is deduced): QPointF pos(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1));
-
480 debug << "Cmd_DrawPixmapPos:" << pos << pm.size();
never executed (the execution status of this line is deduced): debug << "Cmd_DrawPixmapPos:" << pos << pm.size();
-
481 break; }
never executed: break;
0
482 -
483 case QPaintBufferPrivate::Cmd_DrawTiledPixmap: { -
484 QPixmap pm(d_ptr->variants.at(cmd.offset).value<QPixmap>());
never executed (the execution status of this line is deduced): QPixmap pm(d_ptr->variants.at(cmd.offset).value<QPixmap>());
-
485 QRectF r(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1),
never executed (the execution status of this line is deduced): QRectF r(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1),
-
486 d_ptr->floats.at(cmd.extra+2), d_ptr->floats.at(cmd.extra+3));
never executed (the execution status of this line is deduced): d_ptr->floats.at(cmd.extra+2), d_ptr->floats.at(cmd.extra+3));
-
487 -
488 QPointF offset(d_ptr->floats.at(cmd.extra+4), d_ptr->floats.at(cmd.extra+5));
never executed (the execution status of this line is deduced): QPointF offset(d_ptr->floats.at(cmd.extra+4), d_ptr->floats.at(cmd.extra+5));
-
489 debug << "Cmd_DrawTiledPixmap:" << r << offset << pm.size();
never executed (the execution status of this line is deduced): debug << "Cmd_DrawTiledPixmap:" << r << offset << pm.size();
-
490 break; }
never executed: break;
0
491 -
492 case QPaintBufferPrivate::Cmd_DrawImageRect: { -
493 QImage image(d_ptr->variants.at(cmd.offset).value<QImage>());
never executed (the execution status of this line is deduced): QImage image(d_ptr->variants.at(cmd.offset).value<QImage>());
-
494 QRectF r(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1),
never executed (the execution status of this line is deduced): QRectF r(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1),
-
495 d_ptr->floats.at(cmd.extra+2), d_ptr->floats.at(cmd.extra+3));
never executed (the execution status of this line is deduced): d_ptr->floats.at(cmd.extra+2), d_ptr->floats.at(cmd.extra+3));
-
496 QRectF sr(d_ptr->floats.at(cmd.extra+4), d_ptr->floats.at(cmd.extra+5),
never executed (the execution status of this line is deduced): QRectF sr(d_ptr->floats.at(cmd.extra+4), d_ptr->floats.at(cmd.extra+5),
-
497 d_ptr->floats.at(cmd.extra+6), d_ptr->floats.at(cmd.extra+7));
never executed (the execution status of this line is deduced): d_ptr->floats.at(cmd.extra+6), d_ptr->floats.at(cmd.extra+7));
-
498 debug << "Cmd_DrawImageRect:" << r << sr << image.size();
never executed (the execution status of this line is deduced): debug << "Cmd_DrawImageRect:" << r << sr << image.size();
-
499 break; }
never executed: break;
0
500 -
501 case QPaintBufferPrivate::Cmd_DrawImagePos: { -
502 QImage image(d_ptr->variants.at(cmd.offset).value<QImage>());
never executed (the execution status of this line is deduced): QImage image(d_ptr->variants.at(cmd.offset).value<QImage>());
-
503 QPointF pos(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1));
never executed (the execution status of this line is deduced): QPointF pos(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1));
-
504 debug << "Cmd_DrawImagePos:" << pos << image.size();
never executed (the execution status of this line is deduced): debug << "Cmd_DrawImagePos:" << pos << image.size();
-
505 break; }
never executed: break;
0
506 -
507 case QPaintBufferPrivate::Cmd_DrawText: { -
508 QPointF pos(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1));
never executed (the execution status of this line is deduced): QPointF pos(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1));
-
509 QList<QVariant> variants(d_ptr->variants.at(cmd.offset).value<QList<QVariant> >());
never executed (the execution status of this line is deduced): QList<QVariant> variants(d_ptr->variants.at(cmd.offset).value<QList<QVariant> >());
-
510 -
511 QFont font(variants.at(0).value<QFont>());
never executed (the execution status of this line is deduced): QFont font(variants.at(0).value<QFont>());
-
512 QString text(variants.at(1).value<QString>());
never executed (the execution status of this line is deduced): QString text(variants.at(1).value<QString>());
-
513 -
514 debug << "Cmd_DrawText:" << pos << text << font.family();
never executed (the execution status of this line is deduced): debug << "Cmd_DrawText:" << pos << text << font.family();
-
515 break; }
never executed: break;
0
516 -
517 case QPaintBufferPrivate::Cmd_DrawTextItem: { -
518 QPointF pos(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1));
never executed (the execution status of this line is deduced): QPointF pos(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1));
-
519 QTextItemIntCopy *tiCopy = reinterpret_cast<QTextItemIntCopy *>(qvariant_cast<void *>(d_ptr->variants.at(cmd.offset)));
never executed (the execution status of this line is deduced): QTextItemIntCopy *tiCopy = reinterpret_cast<QTextItemIntCopy *>(qvariant_cast<void *>(d_ptr->variants.at(cmd.offset)));
-
520 QTextItemInt &ti = (*tiCopy)();
never executed (the execution status of this line is deduced): QTextItemInt &ti = (*tiCopy)();
-
521 QString text(ti.text());
never executed (the execution status of this line is deduced): QString text(ti.text());
-
522 -
523 debug << "Cmd_DrawTextItem:" << pos << " " << text;
never executed (the execution status of this line is deduced): debug << "Cmd_DrawTextItem:" << pos << " " << text;
-
524 break; }
never executed: break;
0
525 case QPaintBufferPrivate::Cmd_SystemStateChanged: { -
526 QRegion systemClip(d_ptr->variants.at(cmd.offset).value<QRegion>());
never executed (the execution status of this line is deduced): QRegion systemClip(d_ptr->variants.at(cmd.offset).value<QRegion>());
-
527 -
528 debug << "Cmd_SystemStateChanged:" << systemClip;
never executed (the execution status of this line is deduced): debug << "Cmd_SystemStateChanged:" << systemClip;
-
529 break; }
never executed: break;
0
530 case QPaintBufferPrivate::Cmd_Translate: { -
531 QPointF delta(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1));
never executed (the execution status of this line is deduced): QPointF delta(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1));
-
532 debug << "Cmd_Translate:" << delta;
never executed (the execution status of this line is deduced): debug << "Cmd_Translate:" << delta;
-
533 break; }
never executed: break;
0
534 case QPaintBufferPrivate::Cmd_DrawStaticText: { -
535 debug << "Cmd_DrawStaticText";
never executed (the execution status of this line is deduced): debug << "Cmd_DrawStaticText";
-
536 break; }
never executed: break;
0
537 } -
538 -
539 return desc;
never executed: return desc;
0
540} -
541#endif -
542 -
543QRectF QPaintBuffer::boundingRect() const -
544{ -
545 return d_ptr->boundingRect;
never executed: return d_ptr->boundingRect;
0
546} -
547 -
548void QPaintBuffer::setBoundingRect(const QRectF &rect) -
549{ -
550 d_ptr->boundingRect = rect;
never executed (the execution status of this line is deduced): d_ptr->boundingRect = rect;
-
551 d_ptr->calculateBoundingRect = false;
never executed (the execution status of this line is deduced): d_ptr->calculateBoundingRect = false;
-
552}
never executed: }
0
553 -
554 -
555class QPaintBufferEnginePrivate : public QPaintEngineExPrivate -
556{ -
557 Q_DECLARE_PUBLIC(QPaintBufferEngine) -
558public: -
559 void systemStateChanged() { -
560 Q_Q(QPaintBufferEngine);
never executed (the execution status of this line is deduced): QPaintBufferEngine * const q = q_func();
-
561 q->buffer->addCommand(QPaintBufferPrivate::Cmd_SystemStateChanged, QVariant(systemClip));
never executed (the execution status of this line is deduced): q->buffer->addCommand(QPaintBufferPrivate::Cmd_SystemStateChanged, QVariant(systemClip));
-
562 }
never executed: }
0
563 -
564 QTransform last; -
565}; -
566 -
567 -
568/************************************************************************ -
569 * -
570 * QPaintBufferEngine -
571 * -
572 ************************************************************************/ -
573 -
574QPaintBufferEngine::QPaintBufferEngine(QPaintBufferPrivate *b) -
575 : QPaintEngineEx(*(new QPaintBufferEnginePrivate)) -
576 , buffer(b) -
577 , m_begin_detected(false) -
578 , m_save_detected(false) -
579 , m_stream_raw_text_items(false) -
580{ -
581}
never executed: }
0
582 -
583bool QPaintBufferEngine::begin(QPaintDevice *) -
584{ -
585 Q_D(QPaintBufferEngine);
never executed (the execution status of this line is deduced): QPaintBufferEnginePrivate * const d = d_func();
-
586 painter()->save();
never executed (the execution status of this line is deduced): painter()->save();
-
587 d->systemStateChanged();
never executed (the execution status of this line is deduced): d->systemStateChanged();
-
588 return true;
never executed: return true;
0
589} -
590 -
591bool QPaintBufferEngine::end() -
592{ -
593 painter()->restore();
never executed (the execution status of this line is deduced): painter()->restore();
-
594 m_created_state = 0;
never executed (the execution status of this line is deduced): m_created_state = 0;
-
595 return true;
never executed: return true;
0
596} -
597 -
598QPainterState *QPaintBufferEngine::createState(QPainterState *orig) const -
599{ -
600#ifdef QPAINTBUFFER_DEBUG_DRAW -
601 qDebug() << "QPaintBufferEngine: createState, orig=" << orig << ", current=" << state(); -
602#endif -
603 -
604 Q_ASSERT(!m_begin_detected);
never executed (the execution status of this line is deduced): qt_noop();
-
605 Q_ASSERT(!m_save_detected);
never executed (the execution status of this line is deduced): qt_noop();
-
606 -
607 if (orig == 0) {
never evaluated: orig == 0
0
608 m_begin_detected = true;
never executed (the execution status of this line is deduced): m_begin_detected = true;
-
609 return new QPainterState();
never executed: return new QPainterState();
0
610 } else { -
611 m_save_detected = true;
never executed (the execution status of this line is deduced): m_save_detected = true;
-
612 return new QPainterState(orig);
never executed: return new QPainterState(orig);
0
613 } -
614} -
615 -
616void QPaintBufferEngine::clip(const QVectorPath &path, Qt::ClipOperation op) -
617{ -
618#ifdef QPAINTBUFFER_DEBUG_DRAW -
619 qDebug() << "QPaintBufferEngine: clip vpath:" << path.elementCount() << "op:" << op; -
620#endif -
621 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
622 buffer->addCommand(QPaintBufferPrivate::Cmd_ClipVectorPath, path);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_ClipVectorPath, path);
-
623 cmd->extra = op;
never executed (the execution status of this line is deduced): cmd->extra = op;
-
624}
never executed: }
0
625 -
626void QPaintBufferEngine::clip(const QRect &rect, Qt::ClipOperation op) -
627{ -
628#ifdef QPAINTBUFFER_DEBUG_DRAW -
629 qDebug() << "QPaintBufferEngine: clip rect:" << rect << "op:" << op; -
630#endif -
631 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
632 buffer->addCommand(QPaintBufferPrivate::Cmd_ClipRect, (int *) &rect, 4, 1);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_ClipRect, (int *) &rect, 4, 1);
-
633 cmd->extra = op;
never executed (the execution status of this line is deduced): cmd->extra = op;
-
634}
never executed: }
0
635 -
636void QPaintBufferEngine::clip(const QRegion &region, Qt::ClipOperation op) -
637{ -
638#ifdef QPAINTBUFFER_DEBUG_DRAW -
639 qDebug() << "QPaintBufferEngine: clip region br:" << region.boundingRect() << "op:" << op; -
640#endif -
641 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
642 buffer->addCommand(QPaintBufferPrivate::Cmd_ClipRegion, QVariant(region));
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_ClipRegion, QVariant(region));
-
643 cmd->extra = op;
never executed (the execution status of this line is deduced): cmd->extra = op;
-
644}
never executed: }
0
645 -
646void QPaintBufferEngine::clip(const QPainterPath &path, Qt::ClipOperation op) -
647{ -
648 // ### TODO -
649// QPaintBufferCommand *cmd = -
650// buffer->addCommand(QPaintBufferPrivate::Cmd_ClipPath, QVariant(path)); -
651// cmd->extra = op; -
652 QPaintEngineEx::clip(path, op);
never executed (the execution status of this line is deduced): QPaintEngineEx::clip(path, op);
-
653}
never executed: }
0
654 -
655void QPaintBufferEngine::clipEnabledChanged() -
656{ -
657#ifdef QPAINTBUFFER_DEBUG_DRAW -
658 qDebug() << "QPaintBufferEngine: clip enable change" << state()->clipEnabled; -
659#endif -
660 -
661 buffer->addCommand(QPaintBufferPrivate::Cmd_SetClipEnabled, state()->clipEnabled);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_SetClipEnabled, state()->clipEnabled);
-
662}
never executed: }
0
663 -
664void QPaintBufferEngine::penChanged() -
665{ -
666 const QPen &pen = state()->pen;
never executed (the execution status of this line is deduced): const QPen &pen = state()->pen;
-
667 -
668 if (!buffer->commands.isEmpty()
never evaluated: !buffer->commands.isEmpty()
0
669 && buffer->commands.last().id == QPaintBufferPrivate::Cmd_SetPen) {
never evaluated: buffer->commands.last().id == QPaintBufferPrivate::Cmd_SetPen
0
670#ifdef QPAINTBUFFER_DEBUG_DRAW -
671 qDebug() << "QPaintBufferEngine: penChanged (compressed)" << state()->pen; -
672#endif -
673 buffer->variants[buffer->commands.last().offset] = pen;
never executed (the execution status of this line is deduced): buffer->variants[buffer->commands.last().offset] = pen;
-
674 return;
never executed: return;
0
675 } -
676 -
677 if (buffer->calculateBoundingRect) {
never evaluated: buffer->calculateBoundingRect
0
678 if (pen.style() == Qt::NoPen) {
never evaluated: pen.style() == Qt::NoPen
0
679 buffer->penWidthAdjustment = 0;
never executed (the execution status of this line is deduced): buffer->penWidthAdjustment = 0;
-
680 } else {
never executed: }
0
681 qreal penWidth = (pen.widthF() == 0) ? 1 : pen.widthF();
never evaluated: (pen.widthF() == 0)
0
682 QPointF transformedWidth(penWidth, penWidth);
never executed (the execution status of this line is deduced): QPointF transformedWidth(penWidth, penWidth);
-
683 if (!qt_pen_is_cosmetic(pen, state()->renderHints))
never evaluated: !qt_pen_is_cosmetic(pen, state()->renderHints)
0
684 transformedWidth = painter()->transform().map(transformedWidth);
never executed: transformedWidth = painter()->transform().map(transformedWidth);
0
685 buffer->penWidthAdjustment = transformedWidth.x() / 2.0;
never executed (the execution status of this line is deduced): buffer->penWidthAdjustment = transformedWidth.x() / 2.0;
-
686 }
never executed: }
0
687 } -
688#ifdef QPAINTBUFFER_DEBUG_DRAW -
689 qDebug() << "QPaintBufferEngine: penChanged" << state()->pen; -
690#endif -
691 buffer->addCommand(QPaintBufferPrivate::Cmd_SetPen, pen);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_SetPen, pen);
-
692}
never executed: }
0
693 -
694void QPaintBufferEngine::brushChanged() -
695{ -
696 const QBrush &brush = state()->brush;
never executed (the execution status of this line is deduced): const QBrush &brush = state()->brush;
-
697 -
698 if (!buffer->commands.isEmpty()
never evaluated: !buffer->commands.isEmpty()
0
699 && buffer->commands.last().id == QPaintBufferPrivate::Cmd_SetBrush) {
never evaluated: buffer->commands.last().id == QPaintBufferPrivate::Cmd_SetBrush
0
700#ifdef QPAINTBUFFER_DEBUG_DRAW -
701 qDebug() << "QPaintBufferEngine: brushChanged (compressed)" << state()->brush; -
702#endif -
703 buffer->variants[buffer->commands.last().offset] = brush;
never executed (the execution status of this line is deduced): buffer->variants[buffer->commands.last().offset] = brush;
-
704 return;
never executed: return;
0
705 } -
706 -
707#ifdef QPAINTBUFFER_DEBUG_DRAW -
708 qDebug() << "QPaintBufferEngine: brushChanged" << state()->brush; -
709#endif -
710 buffer->addCommand(QPaintBufferPrivate::Cmd_SetBrush, brush);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_SetBrush, brush);
-
711}
never executed: }
0
712 -
713void QPaintBufferEngine::brushOriginChanged() -
714{ -
715#ifdef QPAINTBUFFER_DEBUG_DRAW -
716 qDebug() << "QPaintBufferEngine: brush origin changed" << state()->brushOrigin; -
717#endif -
718 buffer->addCommand(QPaintBufferPrivate::Cmd_SetBrushOrigin, state()->brushOrigin);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_SetBrushOrigin, state()->brushOrigin);
-
719}
never executed: }
0
720 -
721void QPaintBufferEngine::opacityChanged() -
722{ -
723#ifdef QPAINTBUFFER_DEBUG_DRAW -
724 qDebug() << "QPaintBufferEngine: opacity changed" << state()->opacity; -
725#endif -
726 buffer->addCommand(QPaintBufferPrivate::Cmd_SetOpacity, state()->opacity);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_SetOpacity, state()->opacity);
-
727}
never executed: }
0
728 -
729void QPaintBufferEngine::compositionModeChanged() -
730{ -
731#ifdef QPAINTBUFFER_DEBUG_DRAW -
732 qDebug() << "QPaintBufferEngine: composition mode" << state()->composition_mode; -
733#endif -
734 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
735 buffer->addCommand(QPaintBufferPrivate::Cmd_SetCompositionMode);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_SetCompositionMode);
-
736 cmd->extra = state()->composition_mode;
never executed (the execution status of this line is deduced): cmd->extra = state()->composition_mode;
-
737}
never executed: }
0
738 -
739void QPaintBufferEngine::renderHintsChanged() -
740{ -
741#ifdef QPAINTBUFFER_DEBUG_DRAW -
742 qDebug() << "QPaintBufferEngine: render hints changed" << state()->renderHints; -
743#endif -
744 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
745 buffer->addCommand(QPaintBufferPrivate::Cmd_SetRenderHints);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_SetRenderHints);
-
746 cmd->extra = state()->renderHints;
never executed (the execution status of this line is deduced): cmd->extra = state()->renderHints;
-
747}
never executed: }
0
748 -
749void QPaintBufferEngine::transformChanged() -
750{ -
751 Q_D(QPaintBufferEngine);
never executed (the execution status of this line is deduced): QPaintBufferEnginePrivate * const d = d_func();
-
752 const QTransform &transform = state()->matrix;
never executed (the execution status of this line is deduced): const QTransform &transform = state()->matrix;
-
753 -
754 QTransform delta;
never executed (the execution status of this line is deduced): QTransform delta;
-
755 -
756 bool invertible = false;
never executed (the execution status of this line is deduced): bool invertible = false;
-
757 if (transform.type() <= QTransform::TxScale && transform.type() == d->last.type())
never evaluated: transform.type() <= QTransform::TxScale
never evaluated: transform.type() == d->last.type()
0
758 delta = transform * d->last.inverted(&invertible);
never executed: delta = transform * d->last.inverted(&invertible);
0
759 -
760 d->last = transform;
never executed (the execution status of this line is deduced): d->last = transform;
-
761 -
762 if (invertible && delta.type() == QTransform::TxNone)
never evaluated: invertible
never evaluated: delta.type() == QTransform::TxNone
0
763 return;
never executed: return;
0
764 -
765 if (invertible && delta.type() == QTransform::TxTranslate) {
never evaluated: invertible
never evaluated: delta.type() == QTransform::TxTranslate
0
766#ifdef QPAINTBUFFER_DEBUG_DRAW -
767 qDebug() << "QPaintBufferEngine: transformChanged (translate only) " << state()->matrix; -
768#endif -
769 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
770 buffer->addCommand(QPaintBufferPrivate::Cmd_Translate);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_Translate);
-
771 -
772 qreal data[] = { delta.dx(), delta.dy() };
never executed (the execution status of this line is deduced): qreal data[] = { delta.dx(), delta.dy() };
-
773 cmd->extra = buffer->addData((qreal *) data, 2);
never executed (the execution status of this line is deduced): cmd->extra = buffer->addData((qreal *) data, 2);
-
774 return;
never executed: return;
0
775 } -
776 -
777 // ### accumulate, like in QBrush case... -
778 if (!buffer->commands.isEmpty()
never evaluated: !buffer->commands.isEmpty()
0
779 && buffer->commands.last().id == QPaintBufferPrivate::Cmd_SetTransform) {
never evaluated: buffer->commands.last().id == QPaintBufferPrivate::Cmd_SetTransform
0
780#ifdef QPAINTBUFFER_DEBUG_DRAW -
781 qDebug() << "QPaintBufferEngine: transformChanged (compressing) " << state()->matrix; -
782#endif -
783 buffer->variants[buffer->commands.last().offset] = state()->matrix;
never executed (the execution status of this line is deduced): buffer->variants[buffer->commands.last().offset] = state()->matrix;
-
784 return;
never executed: return;
0
785 } -
786 -
787#ifdef QPAINTBUFFER_DEBUG_DRAW -
788 qDebug() << "QPaintBufferEngine: transformChanged:" << state()->matrix; -
789#endif -
790 buffer->addCommand(QPaintBufferPrivate::Cmd_SetTransform, state()->matrix);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_SetTransform, state()->matrix);
-
791}
never executed: }
0
792 -
793void QPaintBufferEngine::backgroundModeChanged() -
794{ -
795#ifdef QPAINTBUFFER_DEBUG_DRAW -
796 qDebug() << "QPaintEngineBuffer: background mode changed" << state()->bgMode; -
797#endif -
798 QPaintBufferCommand *cmd = buffer->addCommand(QPaintBufferPrivate::Cmd_SetBackgroundMode);
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd = buffer->addCommand(QPaintBufferPrivate::Cmd_SetBackgroundMode);
-
799 cmd->extra = state()->bgMode;
never executed (the execution status of this line is deduced): cmd->extra = state()->bgMode;
-
800}
never executed: }
0
801 -
802void QPaintBufferEngine::draw(const QVectorPath &path) -
803{ -
804#ifdef QPAINTBUFFER_DEBUG_DRAW -
805 qDebug() << "QPaintBufferEngine: draw vpath:" << path.elementCount(); -
806#endif -
807 -
808 bool hasBrush = qbrush_style(state()->brush) != Qt::NoBrush;
never executed (the execution status of this line is deduced): bool hasBrush = qbrush_style(state()->brush) != Qt::NoBrush;
-
809 bool hasPen = qpen_style(state()->pen) != Qt::NoPen
never evaluated: qpen_style(state()->pen) != Qt::NoPen
0
810 && qbrush_style(qpen_brush(state()->pen)) != Qt::NoBrush;
never evaluated: qbrush_style(qpen_brush(state()->pen)) != Qt::NoBrush
0
811 -
812 if (hasPen || hasBrush)
never evaluated: hasPen
never evaluated: hasBrush
0
813 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawVectorPath, path);
never executed: buffer->addCommand(QPaintBufferPrivate::Cmd_DrawVectorPath, path);
0
814#ifdef QPAINTBUFFER_DEBUG_DRAW -
815 else -
816 qDebug() << " - no pen or brush active, discarded...\n"; -
817#endif -
818 -
819// if (buffer->calculateBoundingRect) { -
820// QRealRect r = path.controlPointRect(); -
821// buffer->updateBoundingRect(QRectF(r.x1, r.y1, r.x2 - r.x1, r.y2 - r.y1)); -
822// } -
823}
never executed: }
0
824 -
825void QPaintBufferEngine::fill(const QVectorPath &path, const QBrush &brush) -
826{ -
827#ifdef QPAINTBUFFER_DEBUG_DRAW -
828 qDebug() << "QPaintBufferEngine: fill vpath:" << path.elementCount() << brush; -
829#endif -
830 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
831 buffer->addCommand(QPaintBufferPrivate::Cmd_FillVectorPath, path);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_FillVectorPath, path);
-
832 cmd->extra = buffer->addData(QVariant(brush));
never executed (the execution status of this line is deduced): cmd->extra = buffer->addData(QVariant(brush));
-
833// if (buffer->calculateBoundingRect) { -
834// QRealRect r = path.controlPointRect(); -
835// buffer->updateBoundingRect(QRectF(r.x1, r.y1, r.x2 - r.x1, r.y2 - r.y1)); -
836// } -
837}
never executed: }
0
838 -
839void QPaintBufferEngine::stroke(const QVectorPath &path, const QPen &pen) -
840{ -
841#ifdef QPAINTBUFFER_DEBUG_DRAW -
842 qDebug() << "QPaintBufferEngine: stroke vpath:" << path.elementCount() << pen; -
843#endif -
844 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
845 buffer->addCommand(QPaintBufferPrivate::Cmd_StrokeVectorPath, path);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_StrokeVectorPath, path);
-
846 cmd->extra = buffer->addData(QVariant(pen));
never executed (the execution status of this line is deduced): cmd->extra = buffer->addData(QVariant(pen));
-
847// if (buffer->calculateBoundingRect) { -
848// QRealRect r = path.controlPointRect(); -
849// buffer->updateBoundingRect(QRectF(r.x1, r.y1, r.x2 - r.x1, r.y2 - r.y1)); -
850// } -
851}
never executed: }
0
852 -
853void QPaintBufferEngine::fillRect(const QRectF &rect, const QBrush &brush) -
854{ -
855#ifdef QPAINTBUFFER_DEBUG_DRAW -
856 qDebug() << "QPaintBufferEngine: fillRect brush:" << rect << brush; -
857#endif -
858 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
859 buffer->addCommand(QPaintBufferPrivate::Cmd_FillRectBrush, (qreal *) &rect, 4, 1);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_FillRectBrush, (qreal *) &rect, 4, 1);
-
860 cmd->extra = buffer->addData(brush);
never executed (the execution status of this line is deduced): cmd->extra = buffer->addData(brush);
-
861 if (buffer->calculateBoundingRect)
never evaluated: buffer->calculateBoundingRect
0
862 buffer->updateBoundingRect(rect);
never executed: buffer->updateBoundingRect(rect);
0
863}
never executed: }
0
864 -
865void QPaintBufferEngine::fillRect(const QRectF &rect, const QColor &color) -
866{ -
867#ifdef QPAINTBUFFER_DEBUG_DRAW -
868 qDebug() << "QPaintBufferEngine: fillRect color:" << rect << color; -
869#endif -
870 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
871 buffer->addCommand(QPaintBufferPrivate::Cmd_FillRectColor, (qreal *) &rect, 4, 1);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_FillRectColor, (qreal *) &rect, 4, 1);
-
872 cmd->extra = buffer->addData(color);
never executed (the execution status of this line is deduced): cmd->extra = buffer->addData(color);
-
873 if (buffer->calculateBoundingRect)
never evaluated: buffer->calculateBoundingRect
0
874 buffer->updateBoundingRect(rect);
never executed: buffer->updateBoundingRect(rect);
0
875}
never executed: }
0
876 -
877void QPaintBufferEngine::drawRects(const QRect *rects, int rectCount) -
878{ -
879#ifdef QPAINTBUFFER_DEBUG_DRAW -
880 qDebug() << "QPaintBufferEngine: drawRectsI:" << rectCount; -
881#endif -
882 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
883 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawRectI, (int *) rects, 4 * rectCount, rectCount);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawRectI, (int *) rects, 4 * rectCount, rectCount);
-
884 cmd->extra = rectCount;
never executed (the execution status of this line is deduced): cmd->extra = rectCount;
-
885 -
886 if (buffer->calculateBoundingRect) {
never evaluated: buffer->calculateBoundingRect
0
887 if (rectCount == 1) {
never evaluated: rectCount == 1
0
888 buffer->updateBoundingRect(rects[0]);
never executed (the execution status of this line is deduced): buffer->updateBoundingRect(rects[0]);
-
889 } else {
never executed: }
0
890 int min_x = rects[0].left();
never executed (the execution status of this line is deduced): int min_x = rects[0].left();
-
891 int min_y = rects[0].top();
never executed (the execution status of this line is deduced): int min_y = rects[0].top();
-
892 int max_x = rects[0].left() + rects[0].width();
never executed (the execution status of this line is deduced): int max_x = rects[0].left() + rects[0].width();
-
893 int max_y = rects[0].top() + rects[0].height();
never executed (the execution status of this line is deduced): int max_y = rects[0].top() + rects[0].height();
-
894 for (int i=1; i< rectCount; ++i) {
never evaluated: i< rectCount
0
895 if (rects[i].left() < min_x)
never evaluated: rects[i].left() < min_x
0
896 min_x = rects[i].left();
never executed: min_x = rects[i].left();
0
897 if (rects[i].top() < min_y)
never evaluated: rects[i].top() < min_y
0
898 min_y = rects[i].top();
never executed: min_y = rects[i].top();
0
899 if (rects[i].right() > max_x)
never evaluated: rects[i].right() > max_x
0
900 max_x = rects[i].left() + rects[i].width();
never executed: max_x = rects[i].left() + rects[i].width();
0
901 if (rects[i].bottom() > max_y)
never evaluated: rects[i].bottom() > max_y
0
902 max_y = rects[i].top() + rects[i].height();
never executed: max_y = rects[i].top() + rects[i].height();
0
903 -
904 }
never executed: }
0
905 buffer->updateBoundingRect(QRectF(min_x, min_y, max_x - min_x, max_y - min_y));
never executed (the execution status of this line is deduced): buffer->updateBoundingRect(QRectF(min_x, min_y, max_x - min_x, max_y - min_y));
-
906 }
never executed: }
0
907 } -
908}
never executed: }
0
909 -
910void QPaintBufferEngine::drawRects(const QRectF *rects, int rectCount) -
911{ -
912#ifdef QPAINTBUFFER_DEBUG_DRAW -
913 qDebug() << "QPaintBufferEngine: drawRectsF:" << rectCount; -
914#endif -
915 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
916 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawRectF, (qreal *) rects, 4 * rectCount, rectCount);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawRectF, (qreal *) rects, 4 * rectCount, rectCount);
-
917 cmd->extra = rectCount;
never executed (the execution status of this line is deduced): cmd->extra = rectCount;
-
918 -
919 if (buffer->calculateBoundingRect) {
never evaluated: buffer->calculateBoundingRect
0
920 if (rectCount == 1) {
never evaluated: rectCount == 1
0
921 buffer->updateBoundingRect(rects[0]);
never executed (the execution status of this line is deduced): buffer->updateBoundingRect(rects[0]);
-
922 } else {
never executed: }
0
923 qreal min_x = rects[0].left();
never executed (the execution status of this line is deduced): qreal min_x = rects[0].left();
-
924 qreal min_y = rects[0].top();
never executed (the execution status of this line is deduced): qreal min_y = rects[0].top();
-
925 qreal max_x = rects[0].right();
never executed (the execution status of this line is deduced): qreal max_x = rects[0].right();
-
926 qreal max_y = rects[0].bottom();
never executed (the execution status of this line is deduced): qreal max_y = rects[0].bottom();
-
927 for (int i=1; i< rectCount; ++i) {
never evaluated: i< rectCount
0
928 if (rects[i].left() < min_x)
never evaluated: rects[i].left() < min_x
0
929 min_x = rects[i].left();
never executed: min_x = rects[i].left();
0
930 if (rects[i].top() < min_y)
never evaluated: rects[i].top() < min_y
0
931 min_y = rects[i].top();
never executed: min_y = rects[i].top();
0
932 if (rects[i].right() > max_x)
never evaluated: rects[i].right() > max_x
0
933 max_x = rects[i].right();
never executed: max_x = rects[i].right();
0
934 if (rects[i].bottom() > max_y)
never evaluated: rects[i].bottom() > max_y
0
935 max_y = rects[i].bottom();
never executed: max_y = rects[i].bottom();
0
936 -
937 }
never executed: }
0
938 buffer->updateBoundingRect(QRectF(min_x, min_y, max_x - min_x, max_y - min_y));
never executed (the execution status of this line is deduced): buffer->updateBoundingRect(QRectF(min_x, min_y, max_x - min_x, max_y - min_y));
-
939 }
never executed: }
0
940 } -
941}
never executed: }
0
942 -
943void QPaintBufferEngine::drawLines(const QLine *lines, int lineCount) -
944{ -
945#ifdef QPAINTBUFFER_DEBUG_DRAW -
946 qDebug() << "QPaintBufferEngine: drawLinesI:" << lineCount; -
947#endif -
948 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
949 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawLineI, (int *) lines, 4 * lineCount, lineCount);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawLineI, (int *) lines, 4 * lineCount, lineCount);
-
950 cmd->extra = lineCount;
never executed (the execution status of this line is deduced): cmd->extra = lineCount;
-
951 -
952 if (buffer->calculateBoundingRect) {
never evaluated: buffer->calculateBoundingRect
0
953 int min_x = lines[0].p1().x();
never executed (the execution status of this line is deduced): int min_x = lines[0].p1().x();
-
954 int min_y = lines[0].p1().y();
never executed (the execution status of this line is deduced): int min_y = lines[0].p1().y();
-
955 int max_x = lines[0].p2().x();
never executed (the execution status of this line is deduced): int max_x = lines[0].p2().x();
-
956 int max_y = lines[0].p2().y();
never executed (the execution status of this line is deduced): int max_y = lines[0].p2().y();
-
957 if (min_x > max_x)
never evaluated: min_x > max_x
0
958 qSwap(min_x, max_x);
never executed: qSwap(min_x, max_x);
0
959 if (min_y > max_y)
never evaluated: min_y > max_y
0
960 qSwap(min_y, max_y);
never executed: qSwap(min_y, max_y);
0
961 for (int i=1; i < lineCount; ++i) {
never evaluated: i < lineCount
0
962 int p1_x = lines[i].p1().x();
never executed (the execution status of this line is deduced): int p1_x = lines[i].p1().x();
-
963 int p1_y = lines[i].p1().y();
never executed (the execution status of this line is deduced): int p1_y = lines[i].p1().y();
-
964 int p2_x = lines[i].p2().x();
never executed (the execution status of this line is deduced): int p2_x = lines[i].p2().x();
-
965 int p2_y = lines[i].p2().y();
never executed (the execution status of this line is deduced): int p2_y = lines[i].p2().y();
-
966 if (p1_x > p2_x) {
never evaluated: p1_x > p2_x
0
967 min_x = qMin(p2_x, min_x);
never executed (the execution status of this line is deduced): min_x = qMin(p2_x, min_x);
-
968 max_x = qMax(p1_x, max_x);
never executed (the execution status of this line is deduced): max_x = qMax(p1_x, max_x);
-
969 } else {
never executed: }
0
970 min_x = qMin(p1_x, min_x);
never executed (the execution status of this line is deduced): min_x = qMin(p1_x, min_x);
-
971 max_x = qMax(p2_x, max_x);
never executed (the execution status of this line is deduced): max_x = qMax(p2_x, max_x);
-
972 }
never executed: }
0
973 if (p1_y > p2_y) {
never evaluated: p1_y > p2_y
0
974 min_y = qMin(p2_y, min_y);
never executed (the execution status of this line is deduced): min_y = qMin(p2_y, min_y);
-
975 max_y = qMax(p1_y, max_y);
never executed (the execution status of this line is deduced): max_y = qMax(p1_y, max_y);
-
976 } else {
never executed: }
0
977 min_y = qMin(p1_y, min_y);
never executed (the execution status of this line is deduced): min_y = qMin(p1_y, min_y);
-
978 max_y = qMax(p2_y, max_y);
never executed (the execution status of this line is deduced): max_y = qMax(p2_y, max_y);
-
979 }
never executed: }
0
980 } -
981 buffer->updateBoundingRect(QRectF(min_x, min_y, max_x - min_x, max_y - min_y));
never executed (the execution status of this line is deduced): buffer->updateBoundingRect(QRectF(min_x, min_y, max_x - min_x, max_y - min_y));
-
982 }
never executed: }
0
983}
never executed: }
0
984 -
985void QPaintBufferEngine::drawLines(const QLineF *lines, int lineCount) -
986{ -
987#ifdef QPAINTBUFFER_DEBUG_DRAW -
988 qDebug() << "QPaintBufferEngine: drawLinesF:" << lineCount; -
989#endif -
990 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
991 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawLineF, (qreal *) lines, 4 * lineCount, lineCount);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawLineF, (qreal *) lines, 4 * lineCount, lineCount);
-
992 cmd->extra = lineCount;
never executed (the execution status of this line is deduced): cmd->extra = lineCount;
-
993 -
994 if (buffer->calculateBoundingRect) {
never evaluated: buffer->calculateBoundingRect
0
995 qreal min_x = lines[0].p1().x();
never executed (the execution status of this line is deduced): qreal min_x = lines[0].p1().x();
-
996 qreal min_y = lines[0].p1().y();
never executed (the execution status of this line is deduced): qreal min_y = lines[0].p1().y();
-
997 qreal max_x = lines[0].p2().x();
never executed (the execution status of this line is deduced): qreal max_x = lines[0].p2().x();
-
998 qreal max_y = lines[0].p2().y();
never executed (the execution status of this line is deduced): qreal max_y = lines[0].p2().y();
-
999 if (min_x > max_x)
never evaluated: min_x > max_x
0
1000 qSwap(min_x, max_x);
never executed: qSwap(min_x, max_x);
0
1001 if (min_y > max_y)
never evaluated: min_y > max_y
0
1002 qSwap(min_y, max_y);
never executed: qSwap(min_y, max_y);
0
1003 for (int i=1; i < lineCount; ++i) {
never evaluated: i < lineCount
0
1004 qreal p1_x = lines[i].p1().x();
never executed (the execution status of this line is deduced): qreal p1_x = lines[i].p1().x();
-
1005 qreal p1_y = lines[i].p1().y();
never executed (the execution status of this line is deduced): qreal p1_y = lines[i].p1().y();
-
1006 qreal p2_x = lines[i].p2().x();
never executed (the execution status of this line is deduced): qreal p2_x = lines[i].p2().x();
-
1007 qreal p2_y = lines[i].p2().y();
never executed (the execution status of this line is deduced): qreal p2_y = lines[i].p2().y();
-
1008 if (p1_x > p2_x) {
never evaluated: p1_x > p2_x
0
1009 min_x = qMin(p2_x, min_x);
never executed (the execution status of this line is deduced): min_x = qMin(p2_x, min_x);
-
1010 max_x = qMax(p1_x, max_x);
never executed (the execution status of this line is deduced): max_x = qMax(p1_x, max_x);
-
1011 } else {
never executed: }
0
1012 min_x = qMin(p1_x, min_x);
never executed (the execution status of this line is deduced): min_x = qMin(p1_x, min_x);
-
1013 max_x = qMax(p2_x, max_x);
never executed (the execution status of this line is deduced): max_x = qMax(p2_x, max_x);
-
1014 }
never executed: }
0
1015 if (p1_y > p2_y) {
never evaluated: p1_y > p2_y
0
1016 min_y = qMin(p2_y, min_y);
never executed (the execution status of this line is deduced): min_y = qMin(p2_y, min_y);
-
1017 max_y = qMax(p1_y, max_y);
never executed (the execution status of this line is deduced): max_y = qMax(p1_y, max_y);
-
1018 } else {
never executed: }
0
1019 min_y = qMin(p1_y, min_y);
never executed (the execution status of this line is deduced): min_y = qMin(p1_y, min_y);
-
1020 max_y = qMax(p2_y, max_y);
never executed (the execution status of this line is deduced): max_y = qMax(p2_y, max_y);
-
1021 }
never executed: }
0
1022 } -
1023 buffer->updateBoundingRect(QRectF(min_x, min_y, max_x - min_x, max_y - min_y));
never executed (the execution status of this line is deduced): buffer->updateBoundingRect(QRectF(min_x, min_y, max_x - min_x, max_y - min_y));
-
1024 }
never executed: }
0
1025}
never executed: }
0
1026 -
1027void QPaintBufferEngine::drawEllipse(const QRectF &r) -
1028{ -
1029#ifdef QPAINTBUFFER_DEBUG_DRAW -
1030 qDebug() << "QPaintBufferEngine: drawEllipseF:" << r; -
1031#endif -
1032 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawEllipseF, (qreal *) &r, 4, 1);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawEllipseF, (qreal *) &r, 4, 1);
-
1033 if (buffer->calculateBoundingRect)
never evaluated: buffer->calculateBoundingRect
0
1034 buffer->updateBoundingRect(r);
never executed: buffer->updateBoundingRect(r);
0
1035}
never executed: }
0
1036 -
1037void QPaintBufferEngine::drawEllipse(const QRect &r) -
1038{ -
1039#ifdef QPAINTBUFFER_DEBUG_DRAW -
1040 qDebug() << "QPaintBufferEngine: drawEllipseI:" << r; -
1041#endif -
1042 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawEllipseI, (int *) &r, 4, 1);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawEllipseI, (int *) &r, 4, 1);
-
1043 if (buffer->calculateBoundingRect)
never evaluated: buffer->calculateBoundingRect
0
1044 buffer->updateBoundingRect(r);
never executed: buffer->updateBoundingRect(r);
0
1045}
never executed: }
0
1046 -
1047void QPaintBufferEngine::drawPath(const QPainterPath &path) -
1048{ -
1049// #ifdef QPAINTBUFFER_DEBUG_DRAW -
1050// qDebug() << "QPaintBufferEngine: drawPath: element count:" << path.elementCount(); -
1051// #endif -
1052// // ### Path -> QVariant -
1053// // buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPath, QVariant(path)); -
1054 QPaintEngineEx::drawPath(path);
never executed (the execution status of this line is deduced): QPaintEngineEx::drawPath(path);
-
1055 -
1056// if (buffer->calculateBoundingRect) -
1057// buffer->updateBoundingRect(path.boundingRect()); -
1058}
never executed: }
0
1059 -
1060void QPaintBufferEngine::drawPoints(const QPoint *points, int pointCount) -
1061{ -
1062#ifdef QPAINTBUFFER_DEBUG_DRAW -
1063 qDebug() << "QPaintBufferEngine: drawPointsI: " << pointCount; -
1064#endif -
1065 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPointsI, (int *) points, 2 * pointCount, pointCount);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPointsI, (int *) points, 2 * pointCount, pointCount);
-
1066 -
1067 if (buffer->calculateBoundingRect) {
never evaluated: buffer->calculateBoundingRect
0
1068 int min_x = points[0].x();
never executed (the execution status of this line is deduced): int min_x = points[0].x();
-
1069 int min_y = points[0].y();
never executed (the execution status of this line is deduced): int min_y = points[0].y();
-
1070 int max_x = points[0].x()+1;
never executed (the execution status of this line is deduced): int max_x = points[0].x()+1;
-
1071 int max_y = points[0].y()+1;
never executed (the execution status of this line is deduced): int max_y = points[0].y()+1;
-
1072 for (int i=1; i<pointCount; ++i) {
never evaluated: i<pointCount
0
1073 int x = points[i].x();
never executed (the execution status of this line is deduced): int x = points[i].x();
-
1074 int y = points[i].y();
never executed (the execution status of this line is deduced): int y = points[i].y();
-
1075 min_x = qMin(min_x, x);
never executed (the execution status of this line is deduced): min_x = qMin(min_x, x);
-
1076 min_y = qMin(min_y, y);
never executed (the execution status of this line is deduced): min_y = qMin(min_y, y);
-
1077 max_x = qMax(max_x, x+1);
never executed (the execution status of this line is deduced): max_x = qMax(max_x, x+1);
-
1078 max_y = qMax(max_y, y+1);
never executed (the execution status of this line is deduced): max_y = qMax(max_y, y+1);
-
1079 }
never executed: }
0
1080 buffer->updateBoundingRect(QRectF(min_x, min_y, max_x - min_x, max_y - min_y));
never executed (the execution status of this line is deduced): buffer->updateBoundingRect(QRectF(min_x, min_y, max_x - min_x, max_y - min_y));
-
1081 }
never executed: }
0
1082}
never executed: }
0
1083 -
1084void QPaintBufferEngine::drawPoints(const QPointF *points, int pointCount) -
1085{ -
1086#ifdef QPAINTBUFFER_DEBUG_DRAW -
1087 qDebug() << "QPaintBufferEngine: drawPointsF: " << pointCount; -
1088#endif -
1089 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPointsF, (qreal *) points, 2 * pointCount, pointCount);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPointsF, (qreal *) points, 2 * pointCount, pointCount);
-
1090 -
1091 if (buffer->calculateBoundingRect) {
never evaluated: buffer->calculateBoundingRect
0
1092 qreal min_x = points[0].x();
never executed (the execution status of this line is deduced): qreal min_x = points[0].x();
-
1093 qreal min_y = points[0].y();
never executed (the execution status of this line is deduced): qreal min_y = points[0].y();
-
1094 qreal max_x = points[0].x()+1;
never executed (the execution status of this line is deduced): qreal max_x = points[0].x()+1;
-
1095 qreal max_y = points[0].y()+1;
never executed (the execution status of this line is deduced): qreal max_y = points[0].y()+1;
-
1096 for (int i=1; i<pointCount; ++i) {
never evaluated: i<pointCount
0
1097 qreal x = points[i].x();
never executed (the execution status of this line is deduced): qreal x = points[i].x();
-
1098 qreal y = points[i].y();
never executed (the execution status of this line is deduced): qreal y = points[i].y();
-
1099 min_x = qMin(min_x, x);
never executed (the execution status of this line is deduced): min_x = qMin(min_x, x);
-
1100 min_y = qMin(min_y, y);
never executed (the execution status of this line is deduced): min_y = qMin(min_y, y);
-
1101 max_x = qMax(max_x, x+1);
never executed (the execution status of this line is deduced): max_x = qMax(max_x, x+1);
-
1102 max_y = qMax(max_y, y+1);
never executed (the execution status of this line is deduced): max_y = qMax(max_y, y+1);
-
1103 }
never executed: }
0
1104 buffer->updateBoundingRect(QRectF(min_x, min_y, max_x - min_x, max_y - min_y));
never executed (the execution status of this line is deduced): buffer->updateBoundingRect(QRectF(min_x, min_y, max_x - min_x, max_y - min_y));
-
1105 }
never executed: }
0
1106}
never executed: }
0
1107 -
1108void QPaintBufferEngine::drawPolygon(const QPoint *pts, int count, PolygonDrawMode mode) -
1109{ -
1110#ifdef QPAINTBUFFER_DEBUG_DRAW -
1111 qDebug() << "QPaintBufferEngine: drawPolygonI: size:" << count << ", mode:" << mode; -
1112#endif -
1113 if (mode == QPaintEngine::OddEvenMode || mode == QPaintEngine::WindingMode) {
never evaluated: mode == QPaintEngine::OddEvenMode
never evaluated: mode == QPaintEngine::WindingMode
0
1114 QPaintBufferCommand *cmd = buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPolygonI,
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd = buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPolygonI,
-
1115 (int *) pts, 2 * count, count);
never executed (the execution status of this line is deduced): (int *) pts, 2 * count, count);
-
1116 cmd->extra = mode;
never executed (the execution status of this line is deduced): cmd->extra = mode;
-
1117 } else if (mode == QPaintEngine::PolylineMode) {
never executed: }
never evaluated: mode == QPaintEngine::PolylineMode
0
1118 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPolylineI, (int *) pts, 2 * count, count);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPolylineI, (int *) pts, 2 * count, count);
-
1119 } else {
never executed: }
0
1120 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawConvexPolygonI, (int *) pts, 2 * count, count);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawConvexPolygonI, (int *) pts, 2 * count, count);
-
1121 }
never executed: }
0
1122 -
1123 if (buffer->calculateBoundingRect) {
never evaluated: buffer->calculateBoundingRect
0
1124 int min_x = pts[0].x();
never executed (the execution status of this line is deduced): int min_x = pts[0].x();
-
1125 int min_y = pts[0].y();
never executed (the execution status of this line is deduced): int min_y = pts[0].y();
-
1126 int max_x = pts[0].x();
never executed (the execution status of this line is deduced): int max_x = pts[0].x();
-
1127 int max_y = pts[0].y();
never executed (the execution status of this line is deduced): int max_y = pts[0].y();
-
1128 for (int i=1; i<count; ++i) {
never evaluated: i<count
0
1129 int x = pts[i].x();
never executed (the execution status of this line is deduced): int x = pts[i].x();
-
1130 int y = pts[i].y();
never executed (the execution status of this line is deduced): int y = pts[i].y();
-
1131 min_x = qMin(min_x, x);
never executed (the execution status of this line is deduced): min_x = qMin(min_x, x);
-
1132 min_y = qMin(min_y, y);
never executed (the execution status of this line is deduced): min_y = qMin(min_y, y);
-
1133 max_x = qMax(max_x, x);
never executed (the execution status of this line is deduced): max_x = qMax(max_x, x);
-
1134 max_y = qMax(max_y, y);
never executed (the execution status of this line is deduced): max_y = qMax(max_y, y);
-
1135 }
never executed: }
0
1136 buffer->updateBoundingRect(QRectF(min_x, min_y, max_x - min_x, max_y - min_y));
never executed (the execution status of this line is deduced): buffer->updateBoundingRect(QRectF(min_x, min_y, max_x - min_x, max_y - min_y));
-
1137 }
never executed: }
0
1138}
never executed: }
0
1139 -
1140void QPaintBufferEngine::drawPolygon(const QPointF *pts, int count, PolygonDrawMode mode) -
1141{ -
1142#ifdef QPAINTBUFFER_DEBUG_DRAW -
1143 qDebug() << "QPaintBufferEngine: drawPolygonF: size:" << count << ", mode:" << mode; -
1144#endif -
1145 if (mode == QPaintEngine::OddEvenMode || mode == QPaintEngine::WindingMode) {
never evaluated: mode == QPaintEngine::OddEvenMode
never evaluated: mode == QPaintEngine::WindingMode
0
1146 QPaintBufferCommand *cmd = buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPolygonF,
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd = buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPolygonF,
-
1147 (qreal *) pts, 2 * count, count);
never executed (the execution status of this line is deduced): (qreal *) pts, 2 * count, count);
-
1148 cmd->extra = mode;
never executed (the execution status of this line is deduced): cmd->extra = mode;
-
1149 } else if (mode == QPaintEngine::PolylineMode) {
never executed: }
never evaluated: mode == QPaintEngine::PolylineMode
0
1150 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPolylineF, (qreal *) pts, 2 * count, count);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPolylineF, (qreal *) pts, 2 * count, count);
-
1151 } else {
never executed: }
0
1152 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawConvexPolygonF, (qreal *) pts, 2 * count, count);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawConvexPolygonF, (qreal *) pts, 2 * count, count);
-
1153 }
never executed: }
0
1154 -
1155 if (buffer->calculateBoundingRect) {
never evaluated: buffer->calculateBoundingRect
0
1156 qreal min_x = pts[0].x();
never executed (the execution status of this line is deduced): qreal min_x = pts[0].x();
-
1157 qreal min_y = pts[0].y();
never executed (the execution status of this line is deduced): qreal min_y = pts[0].y();
-
1158 qreal max_x = pts[0].x();
never executed (the execution status of this line is deduced): qreal max_x = pts[0].x();
-
1159 qreal max_y = pts[0].y();
never executed (the execution status of this line is deduced): qreal max_y = pts[0].y();
-
1160 for (int i=1; i<count; ++i) {
never evaluated: i<count
0
1161 qreal x = pts[i].x();
never executed (the execution status of this line is deduced): qreal x = pts[i].x();
-
1162 qreal y = pts[i].y();
never executed (the execution status of this line is deduced): qreal y = pts[i].y();
-
1163 min_x = qMin(min_x, x);
never executed (the execution status of this line is deduced): min_x = qMin(min_x, x);
-
1164 min_y = qMin(min_y, y);
never executed (the execution status of this line is deduced): min_y = qMin(min_y, y);
-
1165 max_x = qMax(max_x, x);
never executed (the execution status of this line is deduced): max_x = qMax(max_x, x);
-
1166 max_y = qMax(max_y, y);
never executed (the execution status of this line is deduced): max_y = qMax(max_y, y);
-
1167 }
never executed: }
0
1168 buffer->updateBoundingRect(QRectF(min_x, min_y, max_x - min_x, max_y - min_y));
never executed (the execution status of this line is deduced): buffer->updateBoundingRect(QRectF(min_x, min_y, max_x - min_x, max_y - min_y));
-
1169 }
never executed: }
0
1170}
never executed: }
0
1171 -
1172void QPaintBufferEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) -
1173{ -
1174#ifdef QPAINTBUFFER_DEBUG_DRAW -
1175 qDebug() << "QPaintBufferEngine: drawPixmap: src/dest rects " << r << sr; -
1176#endif -
1177 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
1178 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPixmapRect, QVariant(pm));
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPixmapRect, QVariant(pm));
-
1179 cmd->extra = buffer->addData((qreal *) &r, 4);
never executed (the execution status of this line is deduced): cmd->extra = buffer->addData((qreal *) &r, 4);
-
1180 buffer->addData((qreal *) &sr, 4);
never executed (the execution status of this line is deduced): buffer->addData((qreal *) &sr, 4);
-
1181 if (buffer->calculateBoundingRect)
never evaluated: buffer->calculateBoundingRect
0
1182 buffer->updateBoundingRect(r);
never executed: buffer->updateBoundingRect(r);
0
1183}
never executed: }
0
1184 -
1185void QPaintBufferEngine::drawPixmap(const QPointF &pos, const QPixmap &pm) -
1186{ -
1187#ifdef QPAINTBUFFER_DEBUG_DRAW -
1188 qDebug() << "QPaintBufferEngine: drawPixmap: pos:" << pos; -
1189#endif -
1190 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
1191 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPixmapPos, QVariant(pm));
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPixmapPos, QVariant(pm));
-
1192 cmd->extra = buffer->addData((qreal *) &pos, 2);
never executed (the execution status of this line is deduced): cmd->extra = buffer->addData((qreal *) &pos, 2);
-
1193 if (buffer->calculateBoundingRect)
never evaluated: buffer->calculateBoundingRect
0
1194 buffer->updateBoundingRect(QRectF(pos, pm.size()));
never executed: buffer->updateBoundingRect(QRectF(pos, pm.size()));
0
1195}
never executed: }
0
1196 -
1197static inline QImage qpaintbuffer_storable_image(const QImage &src) -
1198{ -
1199 QImageData *d = const_cast<QImage &>(src).data_ptr();
never executed (the execution status of this line is deduced): QImageData *d = const_cast<QImage &>(src).data_ptr();
-
1200 return d->own_data ? src : src.copy();
never executed: return d->own_data ? src : src.copy();
0
1201} -
1202 -
1203void QPaintBufferEngine::drawImage(const QRectF &r, const QImage &image, const QRectF &sr, -
1204 Qt::ImageConversionFlags /*flags */) -
1205{ -
1206#ifdef QPAINTBUFFER_DEBUG_DRAW -
1207 qDebug() << "QPaintBufferEngine: drawImage: src/dest rects " << r << sr; -
1208#endif -
1209 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
1210 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawImageRect,
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawImageRect,
-
1211 QVariant(qpaintbuffer_storable_image(image)));
never executed (the execution status of this line is deduced): QVariant(qpaintbuffer_storable_image(image)));
-
1212 cmd->extra = buffer->addData((qreal *) &r, 4);
never executed (the execution status of this line is deduced): cmd->extra = buffer->addData((qreal *) &r, 4);
-
1213 buffer->addData((qreal *) &sr, 4);
never executed (the execution status of this line is deduced): buffer->addData((qreal *) &sr, 4);
-
1214 // ### flags... -
1215 if (buffer->calculateBoundingRect)
never evaluated: buffer->calculateBoundingRect
0
1216 buffer->updateBoundingRect(r);
never executed: buffer->updateBoundingRect(r);
0
1217}
never executed: }
0
1218 -
1219void QPaintBufferEngine::drawImage(const QPointF &pos, const QImage &image) -
1220{ -
1221#ifdef QPAINTBUFFER_DEBUG_DRAW -
1222 qDebug() << "QPaintBufferEngine: drawImage: pos:" << pos; -
1223#endif -
1224 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
1225 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawImagePos,
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawImagePos,
-
1226 QVariant(qpaintbuffer_storable_image(image)));
never executed (the execution status of this line is deduced): QVariant(qpaintbuffer_storable_image(image)));
-
1227 cmd->extra = buffer->addData((qreal *) &pos, 2);
never executed (the execution status of this line is deduced): cmd->extra = buffer->addData((qreal *) &pos, 2);
-
1228 if (buffer->calculateBoundingRect)
never evaluated: buffer->calculateBoundingRect
0
1229 buffer->updateBoundingRect(QRectF(pos, image.size()));
never executed: buffer->updateBoundingRect(QRectF(pos, image.size()));
0
1230}
never executed: }
0
1231 -
1232void QPaintBufferEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &s) -
1233{ -
1234#ifdef QPAINTBUFFER_DEBUG_DRAW -
1235 qDebug() << "QPaintBufferEngine: drawTiledPixmap: src rect/offset:" << r << s; -
1236#endif -
1237 QPaintBufferCommand *cmd =
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd =
-
1238 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawTiledPixmap, QVariant(pm));
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawTiledPixmap, QVariant(pm));
-
1239 cmd->extra = buffer->addData((qreal *) &r, 4);
never executed (the execution status of this line is deduced): cmd->extra = buffer->addData((qreal *) &r, 4);
-
1240 buffer->addData((qreal *) &s, 2);
never executed (the execution status of this line is deduced): buffer->addData((qreal *) &s, 2);
-
1241 if (buffer->calculateBoundingRect)
never evaluated: buffer->calculateBoundingRect
0
1242 buffer->updateBoundingRect(r);
never executed: buffer->updateBoundingRect(r);
0
1243}
never executed: }
0
1244 -
1245void QPaintBufferEngine::drawStaticTextItem(QStaticTextItem *staticTextItem) -
1246{ -
1247 QVariantList variants;
never executed (the execution status of this line is deduced): QVariantList variants;
-
1248 -
1249 variants << QVariant(staticTextItem->font);
never executed (the execution status of this line is deduced): variants << QVariant(staticTextItem->font);
-
1250 for (int i=0; i<staticTextItem->numGlyphs; ++i) {
never evaluated: i<staticTextItem->numGlyphs
0
1251 variants.append(staticTextItem->glyphs[i]);
never executed (the execution status of this line is deduced): variants.append(staticTextItem->glyphs[i]);
-
1252 variants.append(staticTextItem->glyphPositions[i].toPointF());
never executed (the execution status of this line is deduced): variants.append(staticTextItem->glyphPositions[i].toPointF());
-
1253 }
never executed: }
0
1254 -
1255 buffer->addCommand(QPaintBufferPrivate::Cmd_DrawStaticText, QVariant(variants));
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_DrawStaticText, QVariant(variants));
-
1256}
never executed: }
0
1257 -
1258void QPaintBufferEngine::drawTextItem(const QPointF &pos, const QTextItem &ti) -
1259{ -
1260#ifdef QPAINTBUFFER_DEBUG_DRAW -
1261 qDebug() << "QPaintBufferEngine: drawTextItem: pos:" << pos << ti.text(); -
1262#endif -
1263 if (m_stream_raw_text_items) {
never evaluated: m_stream_raw_text_items
0
1264 QPaintBufferCommand *cmd = buffer->addCommand(QPaintBufferPrivate::Cmd_DrawTextItem, QVariant::fromValue<void *>(new QTextItemIntCopy(ti)));
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd = buffer->addCommand(QPaintBufferPrivate::Cmd_DrawTextItem, QVariant::fromValue<void *>(new QTextItemIntCopy(ti)));
-
1265 -
1266 QFont font(ti.font());
never executed (the execution status of this line is deduced): QFont font(ti.font());
-
1267 font.setUnderline(false);
never executed (the execution status of this line is deduced): font.setUnderline(false);
-
1268 font.setStrikeOut(false);
never executed (the execution status of this line is deduced): font.setStrikeOut(false);
-
1269 font.setOverline(false);
never executed (the execution status of this line is deduced): font.setOverline(false);
-
1270 -
1271 const QTextItemInt &si = static_cast<const QTextItemInt &>(ti);
never executed (the execution status of this line is deduced): const QTextItemInt &si = static_cast<const QTextItemInt &>(ti);
-
1272 qreal justificationWidth = 0;
never executed (the execution status of this line is deduced): qreal justificationWidth = 0;
-
1273 if (si.justified)
never evaluated: si.justified
0
1274 justificationWidth = si.width.toReal();
never executed: justificationWidth = si.width.toReal();
0
1275 int renderFlags = ti.renderFlags();
never executed (the execution status of this line is deduced): int renderFlags = ti.renderFlags();
-
1276 qreal scaleFactor = font.d->dpi/qreal(qt_defaultDpiY());
never executed (the execution status of this line is deduced): qreal scaleFactor = font.d->dpi/qreal(qt_defaultDpiY());
-
1277 -
1278 buffer->addData(QVariant(font));
never executed (the execution status of this line is deduced): buffer->addData(QVariant(font));
-
1279 cmd->extra = buffer->addData((qreal *) &pos, 2);
never executed (the execution status of this line is deduced): cmd->extra = buffer->addData((qreal *) &pos, 2);
-
1280 buffer->addData((qreal *) &justificationWidth, 1);
never executed (the execution status of this line is deduced): buffer->addData((qreal *) &justificationWidth, 1);
-
1281 buffer->addData((qreal *) &scaleFactor, 1);
never executed (the execution status of this line is deduced): buffer->addData((qreal *) &scaleFactor, 1);
-
1282 cmd->offset2 = buffer->addData((int *) &renderFlags, 1);
never executed (the execution status of this line is deduced): cmd->offset2 = buffer->addData((int *) &renderFlags, 1);
-
1283 } else {
never executed: }
0
1284 QList<QVariant> variants;
never executed (the execution status of this line is deduced): QList<QVariant> variants;
-
1285 variants << QVariant(ti.font()) << QVariant(ti.text());
never executed (the execution status of this line is deduced): variants << QVariant(ti.font()) << QVariant(ti.text());
-
1286 QPaintBufferCommand *cmd = buffer->addCommand(QPaintBufferPrivate::Cmd_DrawText, QVariant(variants));
never executed (the execution status of this line is deduced): QPaintBufferCommand *cmd = buffer->addCommand(QPaintBufferPrivate::Cmd_DrawText, QVariant(variants));
-
1287 cmd->extra = buffer->addData((qreal *) &pos, 2);
never executed (the execution status of this line is deduced): cmd->extra = buffer->addData((qreal *) &pos, 2);
-
1288 }
never executed: }
0
1289 -
1290 if (buffer->calculateBoundingRect)
never evaluated: buffer->calculateBoundingRect
0
1291 buffer->updateBoundingRect(QRectF(pos, QSize(ti.width(), ti.ascent() + ti.descent() + 1)));
never executed: buffer->updateBoundingRect(QRectF(pos, QSize(ti.width(), ti.ascent() + ti.descent() + 1)));
0
1292}
never executed: }
0
1293 -
1294 -
1295void QPaintBufferEngine::setState(QPainterState *s) -
1296{ -
1297 Q_D(QPaintBufferEngine);
never executed (the execution status of this line is deduced): QPaintBufferEnginePrivate * const d = d_func();
-
1298 if (m_begin_detected) {
never evaluated: m_begin_detected
0
1299#ifdef QPAINTBUFFER_DEBUG_DRAW -
1300 qDebug() << "QPaintBufferEngine: setState: begin, ignoring."; -
1301#endif -
1302 m_begin_detected = false;
never executed (the execution status of this line is deduced): m_begin_detected = false;
-
1303 } else if (m_save_detected) {
never executed: }
never evaluated: m_save_detected
0
1304#ifdef QPAINTBUFFER_DEBUG_DRAW -
1305 qDebug() << "QPaintBufferEngine: setState: save."; -
1306#endif -
1307 m_save_detected = false;
never executed (the execution status of this line is deduced): m_save_detected = false;
-
1308 buffer->addCommand(QPaintBufferPrivate::Cmd_Save);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_Save);
-
1309 } else {
never executed: }
0
1310#ifdef QPAINTBUFFER_DEBUG_DRAW -
1311 qDebug() << "QPaintBufferEngine: setState: restore."; -
1312#endif -
1313 buffer->addCommand(QPaintBufferPrivate::Cmd_Restore);
never executed (the execution status of this line is deduced): buffer->addCommand(QPaintBufferPrivate::Cmd_Restore);
-
1314 }
never executed: }
0
1315 -
1316 d->last = s->matrix;
never executed (the execution status of this line is deduced): d->last = s->matrix;
-
1317 -
1318 QPaintEngineEx::setState(s);
never executed (the execution status of this line is deduced): QPaintEngineEx::setState(s);
-
1319}
never executed: }
0
1320 -
1321 -
1322/*********************************************************************** -
1323 * -
1324 * class QPaintBufferPlayback_Painter -
1325 * -
1326 */ -
1327 -
1328// QFakeDevice is used to create fonts with a custom DPI -
1329// -
1330class QFakeDevice : public QPaintDevice -
1331{ -
1332public: -
1333 QFakeDevice() { dpi_x = qt_defaultDpiX(); dpi_y = qt_defaultDpiY(); }
never executed: }
0
1334 void setDpiX(int dpi) { dpi_x = dpi; }
never executed: }
0
1335 void setDpiY(int dpi) { dpi_y = dpi; }
never executed: }
0
1336 QPaintEngine *paintEngine() const { return 0; }
never executed: return 0;
0
1337 int metric(PaintDeviceMetric m) const -
1338 { -
1339 switch(m) { -
1340 case PdmPhysicalDpiX: -
1341 case PdmDpiX: -
1342 return dpi_x;
never executed: return dpi_x;
0
1343 case PdmPhysicalDpiY: -
1344 case PdmDpiY: -
1345 return dpi_y;
never executed: return dpi_y;
0
1346 default: -
1347 return QPaintDevice::metric(m);
never executed: return QPaintDevice::metric(m);
0
1348 } -
1349 }
never executed: }
0
1350 -
1351private: -
1352 int dpi_x; -
1353 int dpi_y; -
1354}; -
1355 -
1356 -
1357void QPainterReplayer::setupTransform(QPainter *_painter) -
1358{ -
1359 painter = _painter;
never executed (the execution status of this line is deduced): painter = _painter;
-
1360 m_world_matrix = painter->transform();
never executed (the execution status of this line is deduced): m_world_matrix = painter->transform();
-
1361 m_world_matrix.scale(qreal(painter->device()->logicalDpiX()) / qreal(qt_defaultDpiX()),
never executed (the execution status of this line is deduced): m_world_matrix.scale(qreal(painter->device()->logicalDpiX()) / qreal(qt_defaultDpiX()),
-
1362 qreal(painter->device()->logicalDpiY()) / qreal(qt_defaultDpiY()));
never executed (the execution status of this line is deduced): qreal(painter->device()->logicalDpiY()) / qreal(qt_defaultDpiY()));
-
1363 painter->setTransform(m_world_matrix);
never executed (the execution status of this line is deduced): painter->setTransform(m_world_matrix);
-
1364}
never executed: }
0
1365 -
1366void QPainterReplayer::processCommands(const QPaintBuffer &buffer, QPainter *p, int begin, int end) -
1367{ -
1368 d = buffer.d_ptr;
never executed (the execution status of this line is deduced): d = buffer.d_ptr;
-
1369 painter = p;
never executed (the execution status of this line is deduced): painter = p;
-
1370 -
1371 for (int cmdIndex = begin; cmdIndex < end; ++cmdIndex) {
never evaluated: cmdIndex < end
0
1372 const QPaintBufferCommand &cmd = d->commands.at(cmdIndex);
never executed (the execution status of this line is deduced): const QPaintBufferCommand &cmd = d->commands.at(cmdIndex);
-
1373 process(cmd);
never executed (the execution status of this line is deduced): process(cmd);
-
1374 }
never executed: }
0
1375}
never executed: }
0
1376 -
1377void QPaintBuffer::beginNewFrame() -
1378{ -
1379 if (!d_ptr->commands.isEmpty())
never evaluated: !d_ptr->commands.isEmpty()
0
1380 d_ptr->frames << d_ptr->commands.size();
never executed: d_ptr->frames << d_ptr->commands.size();
0
1381}
never executed: }
0
1382 -
1383int QPaintBuffer::numFrames() const -
1384{ -
1385 return d_ptr->frames.size() + 1;
never executed: return d_ptr->frames.size() + 1;
0
1386} -
1387 -
1388void QPainterReplayer::process(const QPaintBufferCommand &cmd) -
1389{ -
1390 switch (cmd.id) { -
1391 case QPaintBufferPrivate::Cmd_Save: { -
1392#ifdef QPAINTBUFFER_DEBUG_DRAW -
1393 qDebug() << " -> Cmd_Save"; -
1394#endif -
1395 painter->save();
never executed (the execution status of this line is deduced): painter->save();
-
1396 break; }
never executed: break;
0
1397 -
1398 case QPaintBufferPrivate::Cmd_Restore: { -
1399#ifdef QPAINTBUFFER_DEBUG_DRAW -
1400 qDebug() << " -> Cmd_Restore"; -
1401#endif -
1402 painter->restore();
never executed (the execution status of this line is deduced): painter->restore();
-
1403 break; }
never executed: break;
0
1404 -
1405 case QPaintBufferPrivate::Cmd_SetPen: { -
1406 QPen pen = qvariant_cast<QPen>(d->variants.at(cmd.offset));
never executed (the execution status of this line is deduced): QPen pen = qvariant_cast<QPen>(d->variants.at(cmd.offset));
-
1407#ifdef QPAINTBUFFER_DEBUG_DRAW -
1408 qDebug() << " -> Cmd_SetPen: " << pen; -
1409#endif -
1410 painter->setPen(pen);
never executed (the execution status of this line is deduced): painter->setPen(pen);
-
1411 break; }
never executed: break;
0
1412 -
1413 case QPaintBufferPrivate::Cmd_SetBrush: { -
1414 QBrush brush = qvariant_cast<QBrush>(d->variants.at(cmd.offset));
never executed (the execution status of this line is deduced): QBrush brush = qvariant_cast<QBrush>(d->variants.at(cmd.offset));
-
1415#ifdef QPAINTBUFFER_DEBUG_DRAW -
1416 qDebug() << " -> Cmd_SetBrush: " << brush; -
1417#endif -
1418 painter->setBrush(brush);
never executed (the execution status of this line is deduced): painter->setBrush(brush);
-
1419 break; }
never executed: break;
0
1420 -
1421 case QPaintBufferPrivate::Cmd_SetBrushOrigin: { -
1422#ifdef QPAINTBUFFER_DEBUG_DRAW -
1423 qDebug() << " -> Cmd_SetBrushOrigin: " << d->variants.at(cmd.offset).toPointF(); -
1424#endif -
1425 painter->setBrushOrigin(d->variants.at(cmd.offset).toPointF());
never executed (the execution status of this line is deduced): painter->setBrushOrigin(d->variants.at(cmd.offset).toPointF());
-
1426 break; }
never executed: break;
0
1427 -
1428 case QPaintBufferPrivate::Cmd_SetTransform: { -
1429 QTransform xform = qvariant_cast<QTransform>(d->variants.at(cmd.offset));
never executed (the execution status of this line is deduced): QTransform xform = qvariant_cast<QTransform>(d->variants.at(cmd.offset));
-
1430#ifdef QPAINTBUFFER_DEBUG_DRAW -
1431 qDebug() << " -> Cmd_SetTransform, offset: " << cmd.offset << xform; -
1432#endif -
1433 painter->setTransform(xform * m_world_matrix);
never executed (the execution status of this line is deduced): painter->setTransform(xform * m_world_matrix);
-
1434 break; }
never executed: break;
0
1435 -
1436 case QPaintBufferPrivate::Cmd_Translate: { -
1437 QPointF delta(d->floats.at(cmd.extra), d->floats.at(cmd.extra+1));
never executed (the execution status of this line is deduced): QPointF delta(d->floats.at(cmd.extra), d->floats.at(cmd.extra+1));
-
1438#ifdef QPAINTBUFFER_DEBUG_DRAW -
1439 qDebug() << " -> Cmd_Translate, offset: " << cmd.offset << delta; -
1440#endif -
1441 painter->translate(delta.x(), delta.y());
never executed (the execution status of this line is deduced): painter->translate(delta.x(), delta.y());
-
1442 return;
never executed: return;
0
1443 } -
1444 -
1445 case QPaintBufferPrivate::Cmd_SetCompositionMode: { -
1446 QPainter::CompositionMode mode = (QPainter::CompositionMode) cmd.extra;
never executed (the execution status of this line is deduced): QPainter::CompositionMode mode = (QPainter::CompositionMode) cmd.extra;
-
1447#ifdef QPAINTBUFFER_DEBUG_DRAW -
1448 qDebug() << " -> Cmd_SetCompositionMode, mode: " << mode; -
1449#endif -
1450 painter->setCompositionMode(mode);
never executed (the execution status of this line is deduced): painter->setCompositionMode(mode);
-
1451 break; }
never executed: break;
0
1452 -
1453 case QPaintBufferPrivate::Cmd_SetRenderHints: { -
1454#ifdef QPAINTBUFFER_DEBUG_DRAW -
1455 qDebug() << " -> Cmd_SetRenderHints, hints: " << cmd.extra; -
1456#endif -
1457 QPainter::RenderHints ph = painter->renderHints();
never executed (the execution status of this line is deduced): QPainter::RenderHints ph = painter->renderHints();
-
1458 QPainter::RenderHints nh = (QPainter::RenderHints) cmd.extra;
never executed (the execution status of this line is deduced): QPainter::RenderHints nh = (QPainter::RenderHints) cmd.extra;
-
1459 QPainter::RenderHints xored = ph ^ nh;
never executed (the execution status of this line is deduced): QPainter::RenderHints xored = ph ^ nh;
-
1460 if (xored & QPainter::Antialiasing)
never evaluated: xored & QPainter::Antialiasing
0
1461 painter->setRenderHint(QPainter::Antialiasing, nh & QPainter::Antialiasing);
never executed: painter->setRenderHint(QPainter::Antialiasing, nh & QPainter::Antialiasing);
0
1462 if (xored & QPainter::HighQualityAntialiasing)
never evaluated: xored & QPainter::HighQualityAntialiasing
0
1463 painter->setRenderHint(QPainter::HighQualityAntialiasing, nh & QPainter::HighQualityAntialiasing);
never executed: painter->setRenderHint(QPainter::HighQualityAntialiasing, nh & QPainter::HighQualityAntialiasing);
0
1464 if (xored & QPainter::TextAntialiasing)
never evaluated: xored & QPainter::TextAntialiasing
0
1465 painter->setRenderHint(QPainter::TextAntialiasing, nh & QPainter::TextAntialiasing);
never executed: painter->setRenderHint(QPainter::TextAntialiasing, nh & QPainter::TextAntialiasing);
0
1466 if (xored & QPainter::SmoothPixmapTransform)
never evaluated: xored & QPainter::SmoothPixmapTransform
0
1467 painter->setRenderHint(QPainter::SmoothPixmapTransform, nh & QPainter::SmoothPixmapTransform);
never executed: painter->setRenderHint(QPainter::SmoothPixmapTransform, nh & QPainter::SmoothPixmapTransform);
0
1468 if (xored & QPainter::NonCosmeticDefaultPen)
never evaluated: xored & QPainter::NonCosmeticDefaultPen
0
1469 painter->setRenderHint(QPainter::NonCosmeticDefaultPen, nh & QPainter::NonCosmeticDefaultPen);
never executed: painter->setRenderHint(QPainter::NonCosmeticDefaultPen, nh & QPainter::NonCosmeticDefaultPen);
0
1470 if (xored & QPainter::Qt4CompatiblePainting)
never evaluated: xored & QPainter::Qt4CompatiblePainting
0
1471 painter->setRenderHint(QPainter::Qt4CompatiblePainting, nh & QPainter::Qt4CompatiblePainting);
never executed: painter->setRenderHint(QPainter::Qt4CompatiblePainting, nh & QPainter::Qt4CompatiblePainting);
0
1472 break; }
never executed: break;
0
1473 -
1474 case QPaintBufferPrivate::Cmd_SetOpacity: { -
1475#ifdef QPAINTBUFFER_DEBUG_DRAW -
1476 qDebug() << " -> Cmd_SetOpacity: " << d->variants.at(cmd.offset).toDouble(); -
1477#endif -
1478 painter->setOpacity(d->variants.at(cmd.offset).toDouble());
never executed (the execution status of this line is deduced): painter->setOpacity(d->variants.at(cmd.offset).toDouble());
-
1479 break; }
never executed: break;
0
1480 -
1481 case QPaintBufferPrivate::Cmd_SetBackgroundMode: { -
1482#ifdef QPAINTBUFFER_DEBUG_DRAW -
1483 qDebug() << " -> Cmd_SetBackgroundMode: " << cmd.extra; -
1484#endif -
1485 painter->setBackgroundMode((Qt::BGMode)cmd.extra);
never executed (the execution status of this line is deduced): painter->setBackgroundMode((Qt::BGMode)cmd.extra);
-
1486 break; }
never executed: break;
0
1487 -
1488 case QPaintBufferPrivate::Cmd_DrawVectorPath: { -
1489#ifdef QPAINTBUFFER_DEBUG_DRAW -
1490 qDebug() << " -> Cmd_DrawVectorPath: size: " << cmd.size -
1491// << ", hints:" << d->ints[cmd.offset2+cmd.size] -
1492 << "pts/elms:" << cmd.offset << cmd.offset2; -
1493#endif -
1494 QVectorPathCmd path(d, cmd);
never executed (the execution status of this line is deduced): QVectorPathCmd path(d, cmd);
-
1495 painter->drawPath(path().convertToPainterPath());
never executed (the execution status of this line is deduced): painter->drawPath(path().convertToPainterPath());
-
1496 break; }
never executed: break;
0
1497 -
1498 case QPaintBufferPrivate::Cmd_StrokeVectorPath: { -
1499 QPen pen = qvariant_cast<QPen>(d->variants.at(cmd.extra));
never executed (the execution status of this line is deduced): QPen pen = qvariant_cast<QPen>(d->variants.at(cmd.extra));
-
1500#ifdef QPAINTBUFFER_DEBUG_DRAW -
1501 qDebug() << " -> Cmd_StrokeVectorPath: size: " << cmd.size -
1502// << ", hints:" << d->ints[cmd.offset2+cmd.size] -
1503 << "pts/elms:" << cmd.offset << cmd.offset2; -
1504#endif -
1505 QVectorPathCmd path(d, cmd);
never executed (the execution status of this line is deduced): QVectorPathCmd path(d, cmd);
-
1506 painter->strokePath(path().convertToPainterPath(), pen);
never executed (the execution status of this line is deduced): painter->strokePath(path().convertToPainterPath(), pen);
-
1507 break; }
never executed: break;
0
1508 -
1509 case QPaintBufferPrivate::Cmd_FillVectorPath: { -
1510 QBrush brush = qvariant_cast<QBrush>(d->variants.at(cmd.extra));
never executed (the execution status of this line is deduced): QBrush brush = qvariant_cast<QBrush>(d->variants.at(cmd.extra));
-
1511#ifdef QPAINTBUFFER_DEBUG_DRAW -
1512 qDebug() << " -> Cmd_FillVectorPath: size: " << cmd.size -
1513// << ", hints:" << d->ints[cmd.offset2+cmd.size] -
1514 << "pts/elms:" << cmd.offset << cmd.offset2 << brush; -
1515#endif -
1516 QVectorPathCmd path(d, cmd);
never executed (the execution status of this line is deduced): QVectorPathCmd path(d, cmd);
-
1517 painter->fillPath(path().convertToPainterPath(), brush);
never executed (the execution status of this line is deduced): painter->fillPath(path().convertToPainterPath(), brush);
-
1518 break; }
never executed: break;
0
1519 -
1520 case QPaintBufferPrivate::Cmd_DrawPolygonF: { -
1521#ifdef QPAINTBUFFER_DEBUG_DRAW -
1522 qDebug() << " -> Cmd_DrawPolygonF, offset: " << cmd.offset << " size: " << cmd.size -
1523 << " mode: " << cmd.extra -
1524 << d->floats.at(cmd.offset) -
1525 << d->floats.at(cmd.offset+1); -
1526#endif -
1527 Qt::FillRule fill = (QPaintEngine::PolygonDrawMode) cmd.extra == QPaintEngine::OddEvenMode
never evaluated: (QPaintEngine::PolygonDrawMode) cmd.extra == QPaintEngine::OddEvenMode
0
1528 ? Qt::OddEvenFill : Qt::WindingFill;
never executed (the execution status of this line is deduced): ? Qt::OddEvenFill : Qt::WindingFill;
-
1529 painter->drawPolygon((QPointF *) (d->floats.constData() + cmd.offset), cmd.size, fill);
never executed (the execution status of this line is deduced): painter->drawPolygon((QPointF *) (d->floats.constData() + cmd.offset), cmd.size, fill);
-
1530 break; }
never executed: break;
0
1531 -
1532 case QPaintBufferPrivate::Cmd_DrawPolygonI: { -
1533#ifdef QPAINTBUFFER_DEBUG_DRAW -
1534 qDebug() << " -> Cmd_DrawPolygonI, offset: " << cmd.offset << " size: " << cmd.size -
1535 << " mode: " << cmd.extra -
1536 << d->ints.at(cmd.offset) -
1537 << d->ints.at(cmd.offset+1); -
1538#endif -
1539 Qt::FillRule fill = (QPaintEngine::PolygonDrawMode) cmd.extra == QPaintEngine::OddEvenMode
never evaluated: (QPaintEngine::PolygonDrawMode) cmd.extra == QPaintEngine::OddEvenMode
0
1540 ? Qt::OddEvenFill : Qt::WindingFill;
never executed (the execution status of this line is deduced): ? Qt::OddEvenFill : Qt::WindingFill;
-
1541 painter->drawPolygon((QPoint *) (d->ints.constData() + cmd.offset), cmd.size, fill);
never executed (the execution status of this line is deduced): painter->drawPolygon((QPoint *) (d->ints.constData() + cmd.offset), cmd.size, fill);
-
1542 break; }
never executed: break;
0
1543 -
1544 case QPaintBufferPrivate::Cmd_DrawPolylineF: { -
1545#ifdef QPAINTBUFFER_DEBUG_DRAW -
1546 qDebug() << " -> Cmd_DrawPolylineF, offset: " << cmd.offset << " size: " << cmd.size; -
1547#endif -
1548 painter->drawPolyline((QPointF *) (d->floats.constData() + cmd.offset), cmd.size);
never executed (the execution status of this line is deduced): painter->drawPolyline((QPointF *) (d->floats.constData() + cmd.offset), cmd.size);
-
1549 break; }
never executed: break;
0
1550 -
1551 case QPaintBufferPrivate::Cmd_DrawPolylineI: { -
1552#ifdef QPAINTBUFFER_DEBUG_DRAW -
1553 qDebug() << " -> Cmd_DrawPolylineI, offset: " << cmd.offset << " size: " << cmd.size; -
1554#endif -
1555 painter->drawPolyline((QPoint *) (d->ints.constData() + cmd.offset), cmd.size);
never executed (the execution status of this line is deduced): painter->drawPolyline((QPoint *) (d->ints.constData() + cmd.offset), cmd.size);
-
1556 break; }
never executed: break;
0
1557 -
1558 case QPaintBufferPrivate::Cmd_DrawConvexPolygonF: { -
1559#ifdef QPAINTBUFFER_DEBUG_DRAW -
1560 qDebug() << " -> Cmd_DrawConvexPolygonF, offset: " << cmd.offset << " size: " << cmd.size; -
1561#endif -
1562 painter->drawConvexPolygon((QPointF *) (d->floats.constData() + cmd.offset), cmd.size);
never executed (the execution status of this line is deduced): painter->drawConvexPolygon((QPointF *) (d->floats.constData() + cmd.offset), cmd.size);
-
1563 break; }
never executed: break;
0
1564 -
1565 case QPaintBufferPrivate::Cmd_DrawConvexPolygonI: { -
1566#ifdef QPAINTBUFFER_DEBUG_DRAW -
1567 qDebug() << " -> Cmd_DrawConvexPolygonI, offset: " << cmd.offset << " size: " << cmd.size; -
1568#endif -
1569 painter->drawConvexPolygon((QPoint *) (d->ints.constData() + cmd.offset), cmd.size);
never executed (the execution status of this line is deduced): painter->drawConvexPolygon((QPoint *) (d->ints.constData() + cmd.offset), cmd.size);
-
1570 break; }
never executed: break;
0
1571 -
1572 case QPaintBufferPrivate::Cmd_DrawEllipseF: { -
1573#ifdef QPAINTBUFFER_DEBUG_DRAW -
1574 qDebug() << " -> Cmd_DrawEllipseF, offset: " << cmd.offset; -
1575#endif -
1576 painter->drawEllipse(*(QRectF *)(d->floats.constData() + cmd.offset));
never executed (the execution status of this line is deduced): painter->drawEllipse(*(QRectF *)(d->floats.constData() + cmd.offset));
-
1577 break; }
never executed: break;
0
1578 -
1579 case QPaintBufferPrivate::Cmd_DrawEllipseI: { -
1580#ifdef QPAINTBUFFER_DEBUG_DRAW -
1581 qDebug() << " -> Cmd_DrawEllipseI, offset: " << cmd.offset; -
1582#endif -
1583 painter->drawEllipse(*(QRect *)(d->ints.constData() + cmd.offset));
never executed (the execution status of this line is deduced): painter->drawEllipse(*(QRect *)(d->ints.constData() + cmd.offset));
-
1584 break; }
never executed: break;
0
1585 -
1586 case QPaintBufferPrivate::Cmd_DrawLineF: { -
1587#ifdef QPAINTBUFFER_DEBUG_DRAW -
1588 qDebug() << " -> Cmd_DrawLineF, offset: " << cmd.offset << " size: " << cmd.size; -
1589#endif -
1590 painter->drawLines((QLineF *)(d->floats.constData() + cmd.offset), cmd.size);
never executed (the execution status of this line is deduced): painter->drawLines((QLineF *)(d->floats.constData() + cmd.offset), cmd.size);
-
1591 break; }
never executed: break;
0
1592 -
1593 case QPaintBufferPrivate::Cmd_DrawLineI: { -
1594#ifdef QPAINTBUFFER_DEBUG_DRAW -
1595 qDebug() << " -> Cmd_DrawLineI, offset: " << cmd.offset << " size: " << cmd.size; -
1596#endif -
1597 painter->drawLines((QLine *)(d->ints.constData() + cmd.offset), cmd.size);
never executed (the execution status of this line is deduced): painter->drawLines((QLine *)(d->ints.constData() + cmd.offset), cmd.size);
-
1598 break; }
never executed: break;
0
1599 -
1600 case QPaintBufferPrivate::Cmd_DrawPointsF: { -
1601#ifdef QPAINTBUFFER_DEBUG_DRAW -
1602 qDebug() << " -> Cmd_DrawPointsF, offset: " << cmd.offset << " size: " << cmd.size; -
1603#endif -
1604 painter->drawPoints((QPointF *)(d->floats.constData() + cmd.offset), cmd.size);
never executed (the execution status of this line is deduced): painter->drawPoints((QPointF *)(d->floats.constData() + cmd.offset), cmd.size);
-
1605 break; }
never executed: break;
0
1606 -
1607 case QPaintBufferPrivate::Cmd_DrawPointsI: { -
1608#ifdef QPAINTBUFFER_DEBUG_DRAW -
1609 qDebug() << " -> Cmd_DrawPointsI, offset: " << cmd.offset << " size: " << cmd.size; -
1610#endif -
1611 painter->drawPoints((QPoint *)(d->ints.constData() + cmd.offset), cmd.size);
never executed (the execution status of this line is deduced): painter->drawPoints((QPoint *)(d->ints.constData() + cmd.offset), cmd.size);
-
1612 break; }
never executed: break;
0
1613 -
1614 case QPaintBufferPrivate::Cmd_DrawPixmapRect: { -
1615 QPixmap pm(d->variants.at(cmd.offset).value<QPixmap>());
never executed (the execution status of this line is deduced): QPixmap pm(d->variants.at(cmd.offset).value<QPixmap>());
-
1616 QRectF r(d->floats.at(cmd.extra), d->floats.at(cmd.extra+1),
never executed (the execution status of this line is deduced): QRectF r(d->floats.at(cmd.extra), d->floats.at(cmd.extra+1),
-
1617 d->floats.at(cmd.extra+2), d->floats.at(cmd.extra+3));
never executed (the execution status of this line is deduced): d->floats.at(cmd.extra+2), d->floats.at(cmd.extra+3));
-
1618 -
1619 QRectF sr(d->floats.at(cmd.extra+4), d->floats.at(cmd.extra+5),
never executed (the execution status of this line is deduced): QRectF sr(d->floats.at(cmd.extra+4), d->floats.at(cmd.extra+5),
-
1620 d->floats.at(cmd.extra+6), d->floats.at(cmd.extra+7));
never executed (the execution status of this line is deduced): d->floats.at(cmd.extra+6), d->floats.at(cmd.extra+7));
-
1621#ifdef QPAINTBUFFER_DEBUG_DRAW -
1622 qDebug() << " -> Cmd_DrawPixmapRect:" << r << sr; -
1623#endif -
1624 painter->drawPixmap(r, pm, sr);
never executed (the execution status of this line is deduced): painter->drawPixmap(r, pm, sr);
-
1625 break; }
never executed: break;
0
1626 -
1627 case QPaintBufferPrivate::Cmd_DrawPixmapPos: { -
1628 QPixmap pm(d->variants.at(cmd.offset).value<QPixmap>());
never executed (the execution status of this line is deduced): QPixmap pm(d->variants.at(cmd.offset).value<QPixmap>());
-
1629 QPointF pos(d->floats.at(cmd.extra), d->floats.at(cmd.extra+1));
never executed (the execution status of this line is deduced): QPointF pos(d->floats.at(cmd.extra), d->floats.at(cmd.extra+1));
-
1630#ifdef QPAINTBUFFER_DEBUG_DRAW -
1631 qDebug() << " -> Cmd_DrawPixmapPos:" << pos; -
1632#endif -
1633 painter->drawPixmap(pos, pm);
never executed (the execution status of this line is deduced): painter->drawPixmap(pos, pm);
-
1634 break; }
never executed: break;
0
1635 -
1636 case QPaintBufferPrivate::Cmd_DrawTiledPixmap: { -
1637 QPixmap pm(d->variants.at(cmd.offset).value<QPixmap>());
never executed (the execution status of this line is deduced): QPixmap pm(d->variants.at(cmd.offset).value<QPixmap>());
-
1638 QRectF r(d->floats.at(cmd.extra), d->floats.at(cmd.extra+1),
never executed (the execution status of this line is deduced): QRectF r(d->floats.at(cmd.extra), d->floats.at(cmd.extra+1),
-
1639 d->floats.at(cmd.extra+2), d->floats.at(cmd.extra+3));
never executed (the execution status of this line is deduced): d->floats.at(cmd.extra+2), d->floats.at(cmd.extra+3));
-
1640 -
1641 QPointF offset(d->floats.at(cmd.extra+4), d->floats.at(cmd.extra+5));
never executed (the execution status of this line is deduced): QPointF offset(d->floats.at(cmd.extra+4), d->floats.at(cmd.extra+5));
-
1642#ifdef QPAINTBUFFER_DEBUG_DRAW -
1643 qDebug() << " -> Cmd_DrawTiledPixmap:" << r << offset; -
1644#endif -
1645 painter->drawTiledPixmap(r, pm, offset);
never executed (the execution status of this line is deduced): painter->drawTiledPixmap(r, pm, offset);
-
1646 break; }
never executed: break;
0
1647 -
1648 case QPaintBufferPrivate::Cmd_DrawImageRect: { -
1649 QImage image(d->variants.at(cmd.offset).value<QImage>());
never executed (the execution status of this line is deduced): QImage image(d->variants.at(cmd.offset).value<QImage>());
-
1650 QRectF r(d->floats.at(cmd.extra), d->floats.at(cmd.extra+1),
never executed (the execution status of this line is deduced): QRectF r(d->floats.at(cmd.extra), d->floats.at(cmd.extra+1),
-
1651 d->floats.at(cmd.extra+2), d->floats.at(cmd.extra+3));
never executed (the execution status of this line is deduced): d->floats.at(cmd.extra+2), d->floats.at(cmd.extra+3));
-
1652 QRectF sr(d->floats.at(cmd.extra+4), d->floats.at(cmd.extra+5),
never executed (the execution status of this line is deduced): QRectF sr(d->floats.at(cmd.extra+4), d->floats.at(cmd.extra+5),
-
1653 d->floats.at(cmd.extra+6), d->floats.at(cmd.extra+7));
never executed (the execution status of this line is deduced): d->floats.at(cmd.extra+6), d->floats.at(cmd.extra+7));
-
1654#ifdef QPAINTBUFFER_DEBUG_DRAW -
1655 qDebug() << " -> Cmd_DrawImageRect:" << r << sr; -
1656#endif -
1657 painter->drawImage(r, image, sr);
never executed (the execution status of this line is deduced): painter->drawImage(r, image, sr);
-
1658 break; }
never executed: break;
0
1659 -
1660 case QPaintBufferPrivate::Cmd_DrawImagePos: { -
1661 QImage image(d->variants.at(cmd.offset).value<QImage>());
never executed (the execution status of this line is deduced): QImage image(d->variants.at(cmd.offset).value<QImage>());
-
1662 QPointF pos(d->floats.at(cmd.extra), d->floats.at(cmd.extra+1));
never executed (the execution status of this line is deduced): QPointF pos(d->floats.at(cmd.extra), d->floats.at(cmd.extra+1));
-
1663#ifdef QPAINTBUFFER_DEBUG_DRAW -
1664 qDebug() << " -> Cmd_DrawImagePos:" << pos; -
1665#endif -
1666 painter->drawImage(pos, image);
never executed (the execution status of this line is deduced): painter->drawImage(pos, image);
-
1667 break; }
never executed: break;
0
1668 -
1669 case QPaintBufferPrivate::Cmd_DrawRectF: { -
1670#ifdef QPAINTBUFFER_DEBUG_DRAW -
1671 qDebug() << " -> Cmd_DrawRectF, offset: " << cmd.offset; -
1672#endif -
1673 painter->drawRects((QRectF *)(d->floats.constData() + cmd.offset), cmd.size);
never executed (the execution status of this line is deduced): painter->drawRects((QRectF *)(d->floats.constData() + cmd.offset), cmd.size);
-
1674 break; }
never executed: break;
0
1675 -
1676 case QPaintBufferPrivate::Cmd_DrawRectI: { -
1677#ifdef QPAINTBUFFER_DEBUG_DRAW -
1678 qDebug() << " -> Cmd_DrawRectI, offset: " << cmd.offset; -
1679#endif -
1680 painter->drawRects((QRect *)(d->ints.constData() + cmd.offset), cmd.size);
never executed (the execution status of this line is deduced): painter->drawRects((QRect *)(d->ints.constData() + cmd.offset), cmd.size);
-
1681 break; }
never executed: break;
0
1682 -
1683 case QPaintBufferPrivate::Cmd_FillRectBrush: { -
1684 QBrush brush = qvariant_cast<QBrush>(d->variants.at(cmd.extra));
never executed (the execution status of this line is deduced): QBrush brush = qvariant_cast<QBrush>(d->variants.at(cmd.extra));
-
1685 QRectF *rect = (QRectF *)(d->floats.constData() + cmd.offset);
never executed (the execution status of this line is deduced): QRectF *rect = (QRectF *)(d->floats.constData() + cmd.offset);
-
1686#ifdef QPAINTBUFFER_DEBUG_DRAW -
1687 qDebug() << " -> Cmd_FillRectBrush, offset: " << cmd.offset << " rect: " << *rect << " brush: " << brush; -
1688#endif -
1689 painter->fillRect(*rect, brush);
never executed (the execution status of this line is deduced): painter->fillRect(*rect, brush);
-
1690 break; }
never executed: break;
0
1691 -
1692 case QPaintBufferPrivate::Cmd_FillRectColor: { -
1693 QColor color = qvariant_cast<QColor>(d->variants.at(cmd.extra));
never executed (the execution status of this line is deduced): QColor color = qvariant_cast<QColor>(d->variants.at(cmd.extra));
-
1694 QRectF *rect = (QRectF *)(d->floats.constData() + cmd.offset);
never executed (the execution status of this line is deduced): QRectF *rect = (QRectF *)(d->floats.constData() + cmd.offset);
-
1695#ifdef QPAINTBUFFER_DEBUG_DRAW -
1696 qDebug() << " -> Cmd_FillRectBrush, offset: " << cmd.offset << " rect: " << *rect << " color: " << color; -
1697#endif -
1698 painter->fillRect(*rect, color);
never executed (the execution status of this line is deduced): painter->fillRect(*rect, color);
-
1699 break; }
never executed: break;
0
1700 -
1701 case QPaintBufferPrivate::Cmd_SetClipEnabled: { -
1702 bool clipEnabled = d->variants.at(cmd.offset).toBool();
never executed (the execution status of this line is deduced): bool clipEnabled = d->variants.at(cmd.offset).toBool();
-
1703#ifdef QPAINTBUFFER_DEBUG_DRAW -
1704 qDebug() << " -> Cmd_SetClipEnabled:" << clipEnabled; -
1705#endif -
1706 painter->setClipping(clipEnabled);
never executed (the execution status of this line is deduced): painter->setClipping(clipEnabled);
-
1707 break; }
never executed: break;
0
1708 -
1709 case QPaintBufferPrivate::Cmd_ClipVectorPath: { -
1710 QVectorPathCmd path(d, cmd);
never executed (the execution status of this line is deduced): QVectorPathCmd path(d, cmd);
-
1711#ifdef QPAINTBUFFER_DEBUG_DRAW -
1712 qDebug() << " -> Cmd_ClipVectorPath:" << path().elementCount(); -
1713#endif -
1714 painter->setClipPath(path().convertToPainterPath(), Qt::ClipOperation(cmd.extra));
never executed (the execution status of this line is deduced): painter->setClipPath(path().convertToPainterPath(), Qt::ClipOperation(cmd.extra));
-
1715 break; }
never executed: break;
0
1716 -
1717 -
1718 case QPaintBufferPrivate::Cmd_ClipRect: { -
1719 QRect rect(QPoint(d->ints.at(cmd.offset), d->ints.at(cmd.offset + 1)),
never executed (the execution status of this line is deduced): QRect rect(QPoint(d->ints.at(cmd.offset), d->ints.at(cmd.offset + 1)),
-
1720 QPoint(d->ints.at(cmd.offset + 2), d->ints.at(cmd.offset + 3)));
never executed (the execution status of this line is deduced): QPoint(d->ints.at(cmd.offset + 2), d->ints.at(cmd.offset + 3)));
-
1721#ifdef QPAINTBUFFER_DEBUG_DRAW -
1722 qDebug() << " -> Cmd_ClipRect:" << rect << cmd.extra; -
1723#endif -
1724 painter->setClipRect(rect, Qt::ClipOperation(cmd.extra));
never executed (the execution status of this line is deduced): painter->setClipRect(rect, Qt::ClipOperation(cmd.extra));
-
1725 break; }
never executed: break;
0
1726 -
1727 case QPaintBufferPrivate::Cmd_ClipRegion: { -
1728 QRegion region(d->variants.at(cmd.offset).value<QRegion>());
never executed (the execution status of this line is deduced): QRegion region(d->variants.at(cmd.offset).value<QRegion>());
-
1729#ifdef QPAINTBUFFER_DEBUG_DRAW -
1730 qDebug() << " -> Cmd_ClipRegion:" << region.boundingRect() << cmd.extra; -
1731#endif -
1732 painter->setClipRegion(region, Qt::ClipOperation(cmd.extra));
never executed (the execution status of this line is deduced): painter->setClipRegion(region, Qt::ClipOperation(cmd.extra));
-
1733 break; }
never executed: break;
0
1734 -
1735#if !defined(QT_NO_RAWFONT) -
1736 case QPaintBufferPrivate::Cmd_DrawStaticText: { -
1737 -
1738 QVariantList variants(d->variants.at(cmd.offset).value<QVariantList>());
never executed (the execution status of this line is deduced): QVariantList variants(d->variants.at(cmd.offset).value<QVariantList>());
-
1739 -
1740 QFont font = variants.at(0).value<QFont>();
never executed (the execution status of this line is deduced): QFont font = variants.at(0).value<QFont>();
-
1741 -
1742 QVector<quint32> glyphIndexes;
never executed (the execution status of this line is deduced): QVector<quint32> glyphIndexes;
-
1743 QVector<QPointF> positions;
never executed (the execution status of this line is deduced): QVector<QPointF> positions;
-
1744 -
1745 for (int i=0; i<(variants.size() - 1) / 2; ++i) {
never evaluated: i<(variants.size() - 1) / 2
0
1746 glyphIndexes.append(variants.at(i*2 + 1).toUInt());
never executed (the execution status of this line is deduced): glyphIndexes.append(variants.at(i*2 + 1).toUInt());
-
1747 positions.append(variants.at(i*2 + 2).toPointF());
never executed (the execution status of this line is deduced): positions.append(variants.at(i*2 + 2).toPointF());
-
1748 }
never executed: }
0
1749 -
1750 painter->setFont(font);
never executed (the execution status of this line is deduced): painter->setFont(font);
-
1751 -
1752 QRawFont rawFont;
never executed (the execution status of this line is deduced): QRawFont rawFont;
-
1753 QRawFontPrivate *rawFontD = QRawFontPrivate::get(rawFont);
never executed (the execution status of this line is deduced): QRawFontPrivate *rawFontD = QRawFontPrivate::get(rawFont);
-
1754 QFontPrivate *fontD = QFontPrivate::get(font);
never executed (the execution status of this line is deduced): QFontPrivate *fontD = QFontPrivate::get(font);
-
1755 rawFontD->fontEngine = fontD->engineForScript(QUnicodeTables::Common);
never executed (the execution status of this line is deduced): rawFontD->fontEngine = fontD->engineForScript(QUnicodeTables::Common);
-
1756 rawFontD->fontEngine->ref.ref();
never executed (the execution status of this line is deduced): rawFontD->fontEngine->ref.ref();
-
1757 -
1758 QGlyphRun glyphs;
never executed (the execution status of this line is deduced): QGlyphRun glyphs;
-
1759 glyphs.setRawFont(rawFont);
never executed (the execution status of this line is deduced): glyphs.setRawFont(rawFont);
-
1760 glyphs.setGlyphIndexes(glyphIndexes);
never executed (the execution status of this line is deduced): glyphs.setGlyphIndexes(glyphIndexes);
-
1761 glyphs.setPositions(positions);
never executed (the execution status of this line is deduced): glyphs.setPositions(positions);
-
1762 -
1763 painter->drawGlyphRun(QPointF(), glyphs);
never executed (the execution status of this line is deduced): painter->drawGlyphRun(QPointF(), glyphs);
-
1764 break;
never executed: break;
0
1765 } -
1766#endif -
1767 -
1768 case QPaintBufferPrivate::Cmd_DrawText: { -
1769 QPointF pos(d->floats.at(cmd.extra), d->floats.at(cmd.extra+1));
never executed (the execution status of this line is deduced): QPointF pos(d->floats.at(cmd.extra), d->floats.at(cmd.extra+1));
-
1770 QList<QVariant> variants(d->variants.at(cmd.offset).value<QList<QVariant> >());
never executed (the execution status of this line is deduced): QList<QVariant> variants(d->variants.at(cmd.offset).value<QList<QVariant> >());
-
1771 -
1772 QFont font(variants.at(0).value<QFont>());
never executed (the execution status of this line is deduced): QFont font(variants.at(0).value<QFont>());
-
1773 QString text(variants.at(1).value<QString>());
never executed (the execution status of this line is deduced): QString text(variants.at(1).value<QString>());
-
1774 -
1775 painter->setFont(font);
never executed (the execution status of this line is deduced): painter->setFont(font);
-
1776 painter->drawText(pos, text);
never executed (the execution status of this line is deduced): painter->drawText(pos, text);
-
1777 break; }
never executed: break;
0
1778 -
1779 case QPaintBufferPrivate::Cmd_DrawTextItem: { -
1780 QPointF pos(d->floats.at(cmd.extra), d->floats.at(cmd.extra+1));
never executed (the execution status of this line is deduced): QPointF pos(d->floats.at(cmd.extra), d->floats.at(cmd.extra+1));
-
1781 QTextItemIntCopy *tiCopy = reinterpret_cast<QTextItemIntCopy *>(qvariant_cast<void *>(d->variants.at(cmd.offset)));
never executed (the execution status of this line is deduced): QTextItemIntCopy *tiCopy = reinterpret_cast<QTextItemIntCopy *>(qvariant_cast<void *>(d->variants.at(cmd.offset)));
-
1782 QTextItemInt &ti = (*tiCopy)();
never executed (the execution status of this line is deduced): QTextItemInt &ti = (*tiCopy)();
-
1783 QString text(ti.text());
never executed (the execution status of this line is deduced): QString text(ti.text());
-
1784 -
1785 QFont font(ti.font());
never executed (the execution status of this line is deduced): QFont font(ti.font());
-
1786 font.setUnderline(false);
never executed (the execution status of this line is deduced): font.setUnderline(false);
-
1787 font.setStrikeOut(false);
never executed (the execution status of this line is deduced): font.setStrikeOut(false);
-
1788 font.setOverline(false);
never executed (the execution status of this line is deduced): font.setOverline(false);
-
1789 -
1790 const QTextItemInt &si = static_cast<const QTextItemInt &>(ti);
never executed (the execution status of this line is deduced): const QTextItemInt &si = static_cast<const QTextItemInt &>(ti);
-
1791 qreal justificationWidth = 0;
never executed (the execution status of this line is deduced): qreal justificationWidth = 0;
-
1792 if (si.justified)
never evaluated: si.justified
0
1793 justificationWidth = si.width.toReal();
never executed: justificationWidth = si.width.toReal();
0
1794 qreal scaleFactor = font.d->dpi/qreal(qt_defaultDpiY());
never executed (the execution status of this line is deduced): qreal scaleFactor = font.d->dpi/qreal(qt_defaultDpiY());
-
1795 -
1796#ifdef QPAINTBUFFER_DEBUG_DRAW -
1797 qDebug() << " -> Cmd_DrawTextItem:" << pos << " " << text << " " << scaleFactor; -
1798#endif -
1799 -
1800 if (scaleFactor != 1.0) {
never evaluated: scaleFactor != 1.0
0
1801 QFont fnt(font);
never executed (the execution status of this line is deduced): QFont fnt(font);
-
1802 QFakeDevice fake;
never executed (the execution status of this line is deduced): QFakeDevice fake;
-
1803 fake.setDpiX(qRound(scaleFactor*qt_defaultDpiX()));
never executed (the execution status of this line is deduced): fake.setDpiX(qRound(scaleFactor*qt_defaultDpiX()));
-
1804 fake.setDpiY(qRound(scaleFactor*qt_defaultDpiY()));
never executed (the execution status of this line is deduced): fake.setDpiY(qRound(scaleFactor*qt_defaultDpiY()));
-
1805 font = QFont(fnt, &fake);
never executed (the execution status of this line is deduced): font = QFont(fnt, &fake);
-
1806 }
never executed: }
0
1807 -
1808 int flags = Qt::TextSingleLine | Qt::TextDontClip | Qt::TextForceLeftToRight;
never executed (the execution status of this line is deduced): int flags = Qt::TextSingleLine | Qt::TextDontClip | Qt::TextForceLeftToRight;
-
1809 QSizeF size(1, 1);
never executed (the execution status of this line is deduced): QSizeF size(1, 1);
-
1810 if (justificationWidth > 0) {
never evaluated: justificationWidth > 0
0
1811 size.setWidth(justificationWidth);
never executed (the execution status of this line is deduced): size.setWidth(justificationWidth);
-
1812 flags |= Qt::TextJustificationForced;
never executed (the execution status of this line is deduced): flags |= Qt::TextJustificationForced;
-
1813 flags |= Qt::AlignJustify;
never executed (the execution status of this line is deduced): flags |= Qt::AlignJustify;
-
1814 }
never executed: }
0
1815 -
1816 QFontMetrics fm(font);
never executed (the execution status of this line is deduced): QFontMetrics fm(font);
-
1817 QPointF pt(pos.x(), pos.y() - fm.ascent());
never executed (the execution status of this line is deduced): QPointF pt(pos.x(), pos.y() - fm.ascent());
-
1818 qt_format_text(font, QRectF(pt, size), flags, /*opt*/0,
never executed (the execution status of this line is deduced): qt_format_text(font, QRectF(pt, size), flags, 0,
-
1819 text, /*brect=*/0, /*tabstops=*/0, /*...*/0, /*tabarraylen=*/0, painter);
never executed (the execution status of this line is deduced): text, 0, 0, 0, 0, painter);
-
1820 break; }
never executed: break;
0
1821 case QPaintBufferPrivate::Cmd_SystemStateChanged: { -
1822 QRegion systemClip(d->variants.at(cmd.offset).value<QRegion>());
never executed (the execution status of this line is deduced): QRegion systemClip(d->variants.at(cmd.offset).value<QRegion>());
-
1823 -
1824#ifdef QPAINTBUFFER_DEBUG_DRAW -
1825 qDebug() << " -> Cmd_SystemStateChanged:" << systemClip; -
1826#endif -
1827 -
1828 painter->paintEngine()->setSystemClip(systemClip);
never executed (the execution status of this line is deduced): painter->paintEngine()->setSystemClip(systemClip);
-
1829 painter->paintEngine()->d_ptr->systemStateChanged();
never executed (the execution status of this line is deduced): painter->paintEngine()->d_ptr->systemStateChanged();
-
1830 break; }
never executed: break;
0
1831 } -
1832}
never executed: }
0
1833 -
1834void QPaintEngineExReplayer::process(const QPaintBufferCommand &cmd) -
1835{ -
1836 Q_ASSERT(painter->paintEngine()->isExtended());
never executed (the execution status of this line is deduced): qt_noop();
-
1837 QPaintEngineEx *xengine = static_cast<QPaintEngineEx *>(painter->paintEngine());
never executed (the execution status of this line is deduced): QPaintEngineEx *xengine = static_cast<QPaintEngineEx *>(painter->paintEngine());
-
1838 -
1839 switch (cmd.id) { -
1840 case QPaintBufferPrivate::Cmd_SetBrushOrigin: { -
1841#ifdef QPAINTBUFFER_DEBUG_DRAW -
1842 qDebug() << " -> ExCmd_SetBrushOrigin: " << d->variants.at(cmd.offset).toPointF(); -
1843#endif -
1844 xengine->state()->brushOrigin = d->variants.at(cmd.offset).toPointF();
never executed (the execution status of this line is deduced): xengine->state()->brushOrigin = d->variants.at(cmd.offset).toPointF();
-
1845 xengine->brushOriginChanged();
never executed (the execution status of this line is deduced): xengine->brushOriginChanged();
-
1846 break; }
never executed: break;
0
1847 -
1848 case QPaintBufferPrivate::Cmd_SetCompositionMode: { -
1849 QPainter::CompositionMode mode = (QPainter::CompositionMode) cmd.extra;
never executed (the execution status of this line is deduced): QPainter::CompositionMode mode = (QPainter::CompositionMode) cmd.extra;
-
1850#ifdef QPAINTBUFFER_DEBUG_DRAW -
1851 qDebug() << " -> ExCmd_SetCompositionMode, mode: " << mode; -
1852#endif -
1853 xengine->state()->composition_mode = mode;
never executed (the execution status of this line is deduced): xengine->state()->composition_mode = mode;
-
1854 xengine->compositionModeChanged();
never executed (the execution status of this line is deduced): xengine->compositionModeChanged();
-
1855 break; }
never executed: break;
0
1856 -
1857 case QPaintBufferPrivate::Cmd_SetOpacity: { -
1858#ifdef QPAINTBUFFER_DEBUG_DRAW -
1859 qDebug() << " -> ExCmd_SetOpacity: " << d->variants.at(cmd.offset).toDouble(); -
1860#endif -
1861 xengine->state()->opacity = d->variants.at(cmd.offset).toDouble();
never executed (the execution status of this line is deduced): xengine->state()->opacity = d->variants.at(cmd.offset).toDouble();
-
1862 xengine->opacityChanged();
never executed (the execution status of this line is deduced): xengine->opacityChanged();
-
1863 break; }
never executed: break;
0
1864 -
1865 case QPaintBufferPrivate::Cmd_DrawVectorPath: { -
1866#ifdef QPAINTBUFFER_DEBUG_DRAW -
1867 qDebug() << " -> ExCmd_DrawVectorPath: size: " << cmd.size -
1868// << ", hints:" << d->ints[cmd.offset2+cmd.size] -
1869 << "pts/elms:" << cmd.offset << cmd.offset2; -
1870#endif -
1871 QVectorPathCmd path(d, cmd);
never executed (the execution status of this line is deduced): QVectorPathCmd path(d, cmd);
-
1872 xengine->draw(path());
never executed (the execution status of this line is deduced): xengine->draw(path());
-
1873 break; }
never executed: break;
0
1874 -
1875 case QPaintBufferPrivate::Cmd_StrokeVectorPath: { -
1876 QPen pen = qvariant_cast<QPen>(d->variants.at(cmd.extra));
never executed (the execution status of this line is deduced): QPen pen = qvariant_cast<QPen>(d->variants.at(cmd.extra));
-
1877#ifdef QPAINTBUFFER_DEBUG_DRAW -
1878 qDebug() << " -> ExCmd_StrokeVectorPath: size: " << cmd.size -
1879// << ", hints:" << d->ints[cmd.offset2+cmd.size] -
1880 << "pts/elms:" << cmd.offset << cmd.offset2; -
1881#endif -
1882 QVectorPathCmd path(d, cmd);
never executed (the execution status of this line is deduced): QVectorPathCmd path(d, cmd);
-
1883 xengine->stroke(path(), pen);
never executed (the execution status of this line is deduced): xengine->stroke(path(), pen);
-
1884 break; }
never executed: break;
0
1885 -
1886 case QPaintBufferPrivate::Cmd_FillVectorPath: { -
1887 QBrush brush = qvariant_cast<QBrush>(d->variants.at(cmd.extra));
never executed (the execution status of this line is deduced): QBrush brush = qvariant_cast<QBrush>(d->variants.at(cmd.extra));
-
1888#ifdef QPAINTBUFFER_DEBUG_DRAW -
1889 qDebug() << " -> ExCmd_FillVectorPath: size: " << cmd.size -
1890// << ", hints:" << d->ints[cmd.offset2+cmd.size] -
1891 << "pts/elms:" << cmd.offset << cmd.offset2 << brush; -
1892#endif -
1893 QVectorPathCmd path(d, cmd);
never executed (the execution status of this line is deduced): QVectorPathCmd path(d, cmd);
-
1894 xengine->fill(path(), brush);
never executed (the execution status of this line is deduced): xengine->fill(path(), brush);
-
1895 break; }
never executed: break;
0
1896 -
1897 case QPaintBufferPrivate::Cmd_FillRectBrush: { -
1898 QBrush brush = qvariant_cast<QBrush>(d->variants.at(cmd.extra));
never executed (the execution status of this line is deduced): QBrush brush = qvariant_cast<QBrush>(d->variants.at(cmd.extra));
-
1899 QRectF *rect = (QRectF *)(d->floats.constData() + cmd.offset);
never executed (the execution status of this line is deduced): QRectF *rect = (QRectF *)(d->floats.constData() + cmd.offset);
-
1900#ifdef QPAINTBUFFER_DEBUG_DRAW -
1901 qDebug() << " -> ExCmd_FillRectBrush, offset: " << cmd.offset << " rect: " << *rect << " brush: " << brush; -
1902#endif -
1903 xengine->fillRect(*rect, brush);
never executed (the execution status of this line is deduced): xengine->fillRect(*rect, brush);
-
1904 break; }
never executed: break;
0
1905 -
1906 case QPaintBufferPrivate::Cmd_FillRectColor: { -
1907 QColor color = qvariant_cast<QColor>(d->variants.at(cmd.extra));
never executed (the execution status of this line is deduced): QColor color = qvariant_cast<QColor>(d->variants.at(cmd.extra));
-
1908 QRectF *rect = (QRectF *)(d->floats.constData() + cmd.offset);
never executed (the execution status of this line is deduced): QRectF *rect = (QRectF *)(d->floats.constData() + cmd.offset);
-
1909#ifdef QPAINTBUFFER_DEBUG_DRAW -
1910 qDebug() << " -> ExCmd_FillRectBrush, offset: " << cmd.offset << " rect: " << *rect << " color: " << color; -
1911#endif -
1912 xengine->fillRect(*rect, color);
never executed (the execution status of this line is deduced): xengine->fillRect(*rect, color);
-
1913 break; }
never executed: break;
0
1914 -
1915 case QPaintBufferPrivate::Cmd_DrawPolygonF: { -
1916#ifdef QPAINTBUFFER_DEBUG_DRAW -
1917 qDebug() << " -> ExCmd_DrawPolygonF, offset: " << cmd.offset << " size: " << cmd.size -
1918 << " mode: " << cmd.extra -
1919 << d->floats.at(cmd.offset) -
1920 << d->floats.at(cmd.offset+1); -
1921#endif -
1922 xengine->drawPolygon((QPointF *) (d->floats.constData() + cmd.offset), cmd.size,
never executed (the execution status of this line is deduced): xengine->drawPolygon((QPointF *) (d->floats.constData() + cmd.offset), cmd.size,
-
1923 (QPaintEngine::PolygonDrawMode) cmd.extra);
never executed (the execution status of this line is deduced): (QPaintEngine::PolygonDrawMode) cmd.extra);
-
1924 break; }
never executed: break;
0
1925 -
1926 case QPaintBufferPrivate::Cmd_DrawPolygonI: { -
1927#ifdef QPAINTBUFFER_DEBUG_DRAW -
1928 qDebug() << " -> ExCmd_DrawPolygonI, offset: " << cmd.offset << " size: " << cmd.size -
1929 << " mode: " << cmd.extra -
1930 << d->ints.at(cmd.offset) -
1931 << d->ints.at(cmd.offset+1); -
1932#endif -
1933 xengine->drawPolygon((QPoint *) (d->ints.constData() + cmd.offset), cmd.size,
never executed (the execution status of this line is deduced): xengine->drawPolygon((QPoint *) (d->ints.constData() + cmd.offset), cmd.size,
-
1934 (QPaintEngine::PolygonDrawMode) cmd.extra);
never executed (the execution status of this line is deduced): (QPaintEngine::PolygonDrawMode) cmd.extra);
-
1935 break; }
never executed: break;
0
1936 -
1937 case QPaintBufferPrivate::Cmd_DrawEllipseF: { -
1938#ifdef QPAINTBUFFER_DEBUG_DRAW -
1939 qDebug() << " -> ExCmd_DrawEllipseF, offset: " << cmd.offset; -
1940#endif -
1941 xengine->drawEllipse(*(QRectF *)(d->floats.constData() + cmd.offset));
never executed (the execution status of this line is deduced): xengine->drawEllipse(*(QRectF *)(d->floats.constData() + cmd.offset));
-
1942 break; }
never executed: break;
0
1943 -
1944 case QPaintBufferPrivate::Cmd_DrawEllipseI: { -
1945#ifdef QPAINTBUFFER_DEBUG_DRAW -
1946 qDebug() << " -> ExCmd_DrawEllipseI, offset: " << cmd.offset; -
1947#endif -
1948 xengine->drawEllipse(*(QRect *)(d->ints.constData() + cmd.offset));
never executed (the execution status of this line is deduced): xengine->drawEllipse(*(QRect *)(d->ints.constData() + cmd.offset));
-
1949 break; }
never executed: break;
0
1950 -
1951 case QPaintBufferPrivate::Cmd_DrawLineF: { -
1952#ifdef QPAINTBUFFER_DEBUG_DRAW -
1953 qDebug() << " -> ExCmd_DrawLineF, offset: " << cmd.offset << " size: " << cmd.size; -
1954#endif -
1955 xengine->drawLines((QLineF *)(d->floats.constData() + cmd.offset), cmd.size);
never executed (the execution status of this line is deduced): xengine->drawLines((QLineF *)(d->floats.constData() + cmd.offset), cmd.size);
-
1956 break; }
never executed: break;
0
1957 -
1958 case QPaintBufferPrivate::Cmd_DrawLineI: { -
1959#ifdef QPAINTBUFFER_DEBUG_DRAW -
1960 qDebug() << " -> ExCmd_DrawLineI, offset: " << cmd.offset << " size: " << cmd.size; -
1961#endif -
1962 xengine->drawLines((QLine *)(d->ints.constData() + cmd.offset), cmd.size);
never executed (the execution status of this line is deduced): xengine->drawLines((QLine *)(d->ints.constData() + cmd.offset), cmd.size);
-
1963 break; }
never executed: break;
0
1964 -
1965 case QPaintBufferPrivate::Cmd_DrawPointsF: { -
1966#ifdef QPAINTBUFFER_DEBUG_DRAW -
1967 qDebug() << " -> ExCmd_DrawPointsF, offset: " << cmd.offset << " size: " << cmd.size; -
1968#endif -
1969 xengine->drawPoints((QPointF *)(d->floats.constData() + cmd.offset), cmd.size);
never executed (the execution status of this line is deduced): xengine->drawPoints((QPointF *)(d->floats.constData() + cmd.offset), cmd.size);
-
1970 break; }
never executed: break;
0
1971 -
1972 case QPaintBufferPrivate::Cmd_DrawPointsI: { -
1973#ifdef QPAINTBUFFER_DEBUG_DRAW -
1974 qDebug() << " -> ExCmd_DrawPointsI, offset: " << cmd.offset << " size: " << cmd.size; -
1975#endif -
1976 xengine->drawPoints((QPoint *)(d->ints.constData() + cmd.offset), cmd.size);
never executed (the execution status of this line is deduced): xengine->drawPoints((QPoint *)(d->ints.constData() + cmd.offset), cmd.size);
-
1977 break; }
never executed: break;
0
1978 -
1979 case QPaintBufferPrivate::Cmd_DrawPolylineF: { -
1980#ifdef QPAINTBUFFER_DEBUG_DRAW -
1981 qDebug() << " -> ExCmd_DrawPolylineF, offset: " << cmd.offset << " size: " << cmd.size; -
1982#endif -
1983 xengine->drawPolygon((QPointF *) (d->floats.constData() + cmd.offset), cmd.size, QPaintEngine::PolylineMode);
never executed (the execution status of this line is deduced): xengine->drawPolygon((QPointF *) (d->floats.constData() + cmd.offset), cmd.size, QPaintEngine::PolylineMode);
-
1984 break; }
never executed: break;
0
1985 -
1986 case QPaintBufferPrivate::Cmd_DrawPolylineI: { -
1987#ifdef QPAINTBUFFER_DEBUG_DRAW -
1988 qDebug() << " -> ExCmd_DrawPolylineI, offset: " << cmd.offset << " size: " << cmd.size; -
1989#endif -
1990 xengine->drawPolygon((QPoint *) (d->ints.constData() + cmd.offset), cmd.size, QPaintEngine::PolylineMode);
never executed (the execution status of this line is deduced): xengine->drawPolygon((QPoint *) (d->ints.constData() + cmd.offset), cmd.size, QPaintEngine::PolylineMode);
-
1991 break; }
never executed: break;
0
1992 -
1993 case QPaintBufferPrivate::Cmd_DrawRectF: { -
1994#ifdef QPAINTBUFFER_DEBUG_DRAW -
1995 qDebug() << " -> ExCmd_DrawRectF, offset: " << cmd.offset << " size: " << cmd.size; -
1996#endif -
1997 xengine->drawRects((QRectF *) (d->floats.constData() + cmd.offset), cmd.size);
never executed (the execution status of this line is deduced): xengine->drawRects((QRectF *) (d->floats.constData() + cmd.offset), cmd.size);
-
1998 break; }
never executed: break;
0
1999 -
2000 case QPaintBufferPrivate::Cmd_DrawRectI: { -
2001#ifdef QPAINTBUFFER_DEBUG_DRAW -
2002 qDebug() << " -> ExCmd_DrawRectI, offset: " << cmd.offset << " size: " << cmd.size; -
2003#endif -
2004 xengine->drawRects((QRect *) (d->ints.constData() + cmd.offset), cmd.size);
never executed (the execution status of this line is deduced): xengine->drawRects((QRect *) (d->ints.constData() + cmd.offset), cmd.size);
-
2005 break; }
never executed: break;
0
2006 -
2007 case QPaintBufferPrivate::Cmd_SetClipEnabled: { -
2008 bool clipEnabled = d->variants.at(cmd.offset).toBool();
never executed (the execution status of this line is deduced): bool clipEnabled = d->variants.at(cmd.offset).toBool();
-
2009#ifdef QPAINTBUFFER_DEBUG_DRAW -
2010 qDebug() << " -> ExCmd_SetClipEnabled:" << clipEnabled; -
2011#endif -
2012 xengine->state()->clipEnabled = clipEnabled;
never executed (the execution status of this line is deduced): xengine->state()->clipEnabled = clipEnabled;
-
2013 xengine->clipEnabledChanged();
never executed (the execution status of this line is deduced): xengine->clipEnabledChanged();
-
2014 break; }
never executed: break;
0
2015 -
2016 case QPaintBufferPrivate::Cmd_ClipVectorPath: { -
2017 QVectorPathCmd path(d, cmd);
never executed (the execution status of this line is deduced): QVectorPathCmd path(d, cmd);
-
2018#ifdef QPAINTBUFFER_DEBUG_DRAW -
2019 qDebug() << " -> ExCmd_ClipVectorPath:" << path().elementCount(); -
2020#endif -
2021 xengine->clip(path(), Qt::ClipOperation(cmd.extra));
never executed (the execution status of this line is deduced): xengine->clip(path(), Qt::ClipOperation(cmd.extra));
-
2022 break; }
never executed: break;
0
2023 -
2024 -
2025 case QPaintBufferPrivate::Cmd_ClipRect: { -
2026 QRect rect(QPoint(d->ints.at(cmd.offset), d->ints.at(cmd.offset + 1)),
never executed (the execution status of this line is deduced): QRect rect(QPoint(d->ints.at(cmd.offset), d->ints.at(cmd.offset + 1)),
-
2027 QPoint(d->ints.at(cmd.offset + 2), d->ints.at(cmd.offset + 3)));
never executed (the execution status of this line is deduced): QPoint(d->ints.at(cmd.offset + 2), d->ints.at(cmd.offset + 3)));
-
2028#ifdef QPAINTBUFFER_DEBUG_DRAW -
2029 qDebug() << " -> ExCmd_ClipRect:" << rect << cmd.extra; -
2030#endif -
2031 xengine->clip(rect, Qt::ClipOperation(cmd.extra));
never executed (the execution status of this line is deduced): xengine->clip(rect, Qt::ClipOperation(cmd.extra));
-
2032 break; }
never executed: break;
0
2033 -
2034 case QPaintBufferPrivate::Cmd_ClipRegion: { -
2035 QRegion region(d->variants.at(cmd.offset).value<QRegion>());
never executed (the execution status of this line is deduced): QRegion region(d->variants.at(cmd.offset).value<QRegion>());
-
2036#ifdef QPAINTBUFFER_DEBUG_DRAW -
2037 qDebug() << " -> ExCmd_ClipRegion:" << region.boundingRect() << cmd.extra; -
2038#endif -
2039 xengine->clip(region, Qt::ClipOperation(cmd.extra));
never executed (the execution status of this line is deduced): xengine->clip(region, Qt::ClipOperation(cmd.extra));
-
2040 break; }
never executed: break;
0
2041 -
2042 default: -
2043 QPainterReplayer::process(cmd);
never executed (the execution status of this line is deduced): QPainterReplayer::process(cmd);
-
2044 break;
never executed: break;
0
2045 } -
2046}
never executed: }
0
2047 -
2048QDataStream &operator<<(QDataStream &stream, const QPaintBufferCommand &command) -
2049{ -
2050 quint32 id = command.id;
never executed (the execution status of this line is deduced): quint32 id = command.id;
-
2051 quint32 size = command.size;
never executed (the execution status of this line is deduced): quint32 size = command.size;
-
2052 stream << id << size;
never executed (the execution status of this line is deduced): stream << id << size;
-
2053 stream << command.offset << command.offset2 << command.extra;
never executed (the execution status of this line is deduced): stream << command.offset << command.offset2 << command.extra;
-
2054 return stream;
never executed: return stream;
0
2055} -
2056 -
2057QDataStream &operator>>(QDataStream &stream, QPaintBufferCommand &command) -
2058{ -
2059 quint32 id;
never executed (the execution status of this line is deduced): quint32 id;
-
2060 quint32 size;
never executed (the execution status of this line is deduced): quint32 size;
-
2061 stream >> id >> size;
never executed (the execution status of this line is deduced): stream >> id >> size;
-
2062 stream >> command.offset >> command.offset2 >> command.extra;
never executed (the execution status of this line is deduced): stream >> command.offset >> command.offset2 >> command.extra;
-
2063 command.id = id;
never executed (the execution status of this line is deduced): command.id = id;
-
2064 command.size = size;
never executed (the execution status of this line is deduced): command.size = size;
-
2065 return stream;
never executed: return stream;
0
2066} -
2067 -
2068struct QPaintBufferCacheEntry -
2069{ -
2070 QVariant::Type type; -
2071 quint64 cacheKey; -
2072}; -
2073 -
2074struct QPaintBufferCacheEntryV2 -
2075{ -
2076 enum Type { -
2077 ImageKey, -
2078 PixmapKey -
2079 }; -
2080 -
2081 struct Flags { -
2082 uint type : 8; -
2083 uint key : 24; -
2084 }; -
2085 -
2086 union { -
2087 Flags flags; -
2088 uint bits; -
2089 }; -
2090}; -
2091 -
2092QT_END_NAMESPACE -
2093Q_DECLARE_METATYPE(QPaintBufferCacheEntry) -
2094Q_DECLARE_METATYPE(QPaintBufferCacheEntryV2) -
2095QT_BEGIN_NAMESPACE -
2096 -
2097QDataStream &operator<<(QDataStream &stream, const QPaintBufferCacheEntry &entry) -
2098{ -
2099 return stream << entry.type << entry.cacheKey;
never executed: return stream << entry.type << entry.cacheKey;
0
2100} -
2101 -
2102QDataStream &operator>>(QDataStream &stream, QPaintBufferCacheEntry &entry) -
2103{ -
2104 return stream >> entry.type >> entry.cacheKey;
never executed: return stream >> entry.type >> entry.cacheKey;
0
2105} -
2106 -
2107QDataStream &operator<<(QDataStream &stream, const QPaintBufferCacheEntryV2 &entry) -
2108{ -
2109 return stream << entry.bits;
never executed: return stream << entry.bits;
0
2110} -
2111 -
2112QDataStream &operator>>(QDataStream &stream, QPaintBufferCacheEntryV2 &entry) -
2113{ -
2114 return stream >> entry.bits;
never executed: return stream >> entry.bits;
0
2115} -
2116 -
2117static void qRegisterPaintBufferMetaTypes() -
2118{ -
2119 qRegisterMetaTypeStreamOperators<QPaintBufferCacheEntry>();
executed (the execution status of this line is deduced): qRegisterMetaTypeStreamOperators<QPaintBufferCacheEntry>();
-
2120 qRegisterMetaTypeStreamOperators<QPaintBufferCacheEntryV2>();
executed (the execution status of this line is deduced): qRegisterMetaTypeStreamOperators<QPaintBufferCacheEntryV2>();
-
2121}
executed: }
Execution Count:200
200
2122 -
2123Q_CONSTRUCTOR_FUNCTION(qRegisterPaintBufferMetaTypes)
executed: }
Execution Count:200
200
2124 -
2125QDataStream &operator<<(QDataStream &stream, const QPaintBuffer &buffer) -
2126{ -
2127 QHash<qint64, uint> pixmapKeys;
never executed (the execution status of this line is deduced): QHash<qint64, uint> pixmapKeys;
-
2128 QHash<qint64, uint> imageKeys;
never executed (the execution status of this line is deduced): QHash<qint64, uint> imageKeys;
-
2129 -
2130 QHash<qint64, QPixmap> pixmaps;
never executed (the execution status of this line is deduced): QHash<qint64, QPixmap> pixmaps;
-
2131 QHash<qint64, QImage> images;
never executed (the execution status of this line is deduced): QHash<qint64, QImage> images;
-
2132 -
2133 QVector<QVariant> variants = buffer.d_ptr->variants;
never executed (the execution status of this line is deduced): QVector<QVariant> variants = buffer.d_ptr->variants;
-
2134 for (int i = 0; i < variants.size(); ++i) {
never evaluated: i < variants.size()
0
2135 const QVariant &v = variants.at(i);
never executed (the execution status of this line is deduced): const QVariant &v = variants.at(i);
-
2136 if (v.type() == QVariant::Image) {
never evaluated: v.type() == QVariant::Image
0
2137 const QImage image(v.value<QImage>());
never executed (the execution status of this line is deduced): const QImage image(v.value<QImage>());
-
2138 -
2139 QPaintBufferCacheEntryV2 entry;
never executed (the execution status of this line is deduced): QPaintBufferCacheEntryV2 entry;
-
2140 entry.flags.type = QPaintBufferCacheEntryV2::ImageKey;
never executed (the execution status of this line is deduced): entry.flags.type = QPaintBufferCacheEntryV2::ImageKey;
-
2141 -
2142 QHash<qint64, uint>::iterator it = imageKeys.find(image.cacheKey());
never executed (the execution status of this line is deduced): QHash<qint64, uint>::iterator it = imageKeys.find(image.cacheKey());
-
2143 if (it != imageKeys.end()) {
never evaluated: it != imageKeys.end()
0
2144 entry.flags.key = *it;
never executed (the execution status of this line is deduced): entry.flags.key = *it;
-
2145 } else {
never executed: }
0
2146 imageKeys[image.cacheKey()] = entry.flags.key = images.size();
never executed (the execution status of this line is deduced): imageKeys[image.cacheKey()] = entry.flags.key = images.size();
-
2147 images[images.size()] = image;
never executed (the execution status of this line is deduced): images[images.size()] = image;
-
2148 }
never executed: }
0
2149 -
2150 variants[i] = QVariant::fromValue(entry);
never executed (the execution status of this line is deduced): variants[i] = QVariant::fromValue(entry);
-
2151 } else if (v.type() == QVariant::Pixmap) {
never executed: }
never evaluated: v.type() == QVariant::Pixmap
0
2152 const QPixmap pixmap(v.value<QPixmap>());
never executed (the execution status of this line is deduced): const QPixmap pixmap(v.value<QPixmap>());
-
2153 -
2154 QPaintBufferCacheEntryV2 entry;
never executed (the execution status of this line is deduced): QPaintBufferCacheEntryV2 entry;
-
2155 entry.flags.type = QPaintBufferCacheEntryV2::PixmapKey;
never executed (the execution status of this line is deduced): entry.flags.type = QPaintBufferCacheEntryV2::PixmapKey;
-
2156 -
2157 QHash<qint64, uint>::iterator it = pixmapKeys.find(pixmap.cacheKey());
never executed (the execution status of this line is deduced): QHash<qint64, uint>::iterator it = pixmapKeys.find(pixmap.cacheKey());
-
2158 if (it != pixmapKeys.end()) {
never evaluated: it != pixmapKeys.end()
0
2159 entry.flags.key = *it;
never executed (the execution status of this line is deduced): entry.flags.key = *it;
-
2160 } else {
never executed: }
0
2161 pixmapKeys[pixmap.cacheKey()] = entry.flags.key = pixmaps.size();
never executed (the execution status of this line is deduced): pixmapKeys[pixmap.cacheKey()] = entry.flags.key = pixmaps.size();
-
2162 pixmaps[pixmaps.size()] = pixmap;
never executed (the execution status of this line is deduced): pixmaps[pixmaps.size()] = pixmap;
-
2163 }
never executed: }
0
2164 -
2165 variants[i] = QVariant::fromValue(entry);
never executed (the execution status of this line is deduced): variants[i] = QVariant::fromValue(entry);
-
2166 }
never executed: }
0
2167 } -
2168 -
2169 stream << pixmaps;
never executed (the execution status of this line is deduced): stream << pixmaps;
-
2170 stream << images;
never executed (the execution status of this line is deduced): stream << images;
-
2171 -
2172 stream << buffer.d_ptr->ints;
never executed (the execution status of this line is deduced): stream << buffer.d_ptr->ints;
-
2173 stream << buffer.d_ptr->floats;
never executed (the execution status of this line is deduced): stream << buffer.d_ptr->floats;
-
2174 stream << variants;
never executed (the execution status of this line is deduced): stream << variants;
-
2175 stream << buffer.d_ptr->commands;
never executed (the execution status of this line is deduced): stream << buffer.d_ptr->commands;
-
2176 stream << buffer.d_ptr->boundingRect;
never executed (the execution status of this line is deduced): stream << buffer.d_ptr->boundingRect;
-
2177 stream << buffer.d_ptr->frames;
never executed (the execution status of this line is deduced): stream << buffer.d_ptr->frames;
-
2178 -
2179 return stream;
never executed: return stream;
0
2180} -
2181 -
2182QDataStream &operator>>(QDataStream &stream, QPaintBuffer &buffer) -
2183{ -
2184 QHash<qint64, QPixmap> pixmaps;
never executed (the execution status of this line is deduced): QHash<qint64, QPixmap> pixmaps;
-
2185 QHash<qint64, QImage> images;
never executed (the execution status of this line is deduced): QHash<qint64, QImage> images;
-
2186 -
2187 stream >> pixmaps;
never executed (the execution status of this line is deduced): stream >> pixmaps;
-
2188 stream >> images;
never executed (the execution status of this line is deduced): stream >> images;
-
2189 -
2190 stream >> buffer.d_ptr->ints;
never executed (the execution status of this line is deduced): stream >> buffer.d_ptr->ints;
-
2191 stream >> buffer.d_ptr->floats;
never executed (the execution status of this line is deduced): stream >> buffer.d_ptr->floats;
-
2192 stream >> buffer.d_ptr->variants;
never executed (the execution status of this line is deduced): stream >> buffer.d_ptr->variants;
-
2193 stream >> buffer.d_ptr->commands;
never executed (the execution status of this line is deduced): stream >> buffer.d_ptr->commands;
-
2194 stream >> buffer.d_ptr->boundingRect;
never executed (the execution status of this line is deduced): stream >> buffer.d_ptr->boundingRect;
-
2195 stream >> buffer.d_ptr->frames;
never executed (the execution status of this line is deduced): stream >> buffer.d_ptr->frames;
-
2196 -
2197 QVector<QVariant> &variants = buffer.d_ptr->variants;
never executed (the execution status of this line is deduced): QVector<QVariant> &variants = buffer.d_ptr->variants;
-
2198 for (int i = 0; i < variants.size(); ++i) {
never evaluated: i < variants.size()
0
2199 const QVariant &v = variants.at(i);
never executed (the execution status of this line is deduced): const QVariant &v = variants.at(i);
-
2200 if (v.canConvert<QPaintBufferCacheEntry>()) {
never evaluated: v.canConvert<QPaintBufferCacheEntry>()
0
2201 QPaintBufferCacheEntry entry = v.value<QPaintBufferCacheEntry>();
never executed (the execution status of this line is deduced): QPaintBufferCacheEntry entry = v.value<QPaintBufferCacheEntry>();
-
2202 if (entry.type == QVariant::Image)
never evaluated: entry.type == QVariant::Image
0
2203 variants[i] = QVariant(images.value(entry.cacheKey));
never executed: variants[i] = QVariant(images.value(entry.cacheKey));
0
2204 else -
2205 variants[i] = QVariant(pixmaps.value(entry.cacheKey));
never executed: variants[i] = QVariant(pixmaps.value(entry.cacheKey));
0
2206 } else if (v.canConvert<QPaintBufferCacheEntryV2>()) {
never evaluated: v.canConvert<QPaintBufferCacheEntryV2>()
0
2207 QPaintBufferCacheEntryV2 entry = v.value<QPaintBufferCacheEntryV2>();
never executed (the execution status of this line is deduced): QPaintBufferCacheEntryV2 entry = v.value<QPaintBufferCacheEntryV2>();
-
2208 -
2209 if (entry.flags.type == QPaintBufferCacheEntryV2::ImageKey)
never evaluated: entry.flags.type == QPaintBufferCacheEntryV2::ImageKey
0
2210 variants[i] = QVariant(images.value(entry.flags.key));
never executed: variants[i] = QVariant(images.value(entry.flags.key));
0
2211 else if (entry.flags.type == QPaintBufferCacheEntryV2::PixmapKey)
never evaluated: entry.flags.type == QPaintBufferCacheEntryV2::PixmapKey
0
2212 variants[i] = QVariant(pixmaps.value(entry.flags.key));
never executed: variants[i] = QVariant(pixmaps.value(entry.flags.key));
0
2213 else -
2214 qWarning() << "operator<<(QDataStream &stream, QPaintBuffer &buffer): unrecognized cache entry type:" << entry.flags.type;
never executed: QMessageLogger("painting/qpaintbuffer.cpp", 2214, __PRETTY_FUNCTION__).warning() << "operator<<(QDataStream &stream, QPaintBuffer &buffer): unrecognized cache entry type:" << entry.flags.type;
0
2215 } -
2216 } -
2217 -
2218 return stream;
never executed: return stream;
0
2219} -
2220 -
2221QT_END_NAMESPACE -
2222 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial