image/qpixmap_raster.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -
4** Contact: http://www.qt-project.org/legal -
5** -
6** This file is part of the QtGui module of the Qt Toolkit. -
7** -
8** $QT_BEGIN_LICENSE:LGPL$ -
9** Commercial License Usage -
10** Licensees holding valid commercial Qt licenses may use this file in -
11** accordance with the commercial license agreement provided with the -
12** Software or, alternatively, in accordance with the terms contained in -
13** a written agreement between you and Digia. For licensing terms and -
14** conditions see http://qt.digia.com/licensing. For further information -
15** use the contact form at http://qt.digia.com/contact-us. -
16** -
17** GNU Lesser General Public License Usage -
18** Alternatively, this file may be used under the terms of the GNU Lesser -
19** General Public License version 2.1 as published by the Free Software -
20** Foundation and appearing in the file LICENSE.LGPL included in the -
21** packaging of this file. Please review the following information to -
22** ensure the GNU Lesser General Public License version 2.1 requirements -
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -
24** -
25** In addition, as a special exception, Digia gives you certain additional -
26** rights. These rights are described in the Digia Qt LGPL Exception -
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -
28** -
29** GNU General Public License Usage -
30** Alternatively, this file may be used under the terms of the GNU -
31** General Public License version 3.0 as published by the Free Software -
32** Foundation and appearing in the file LICENSE.GPL included in the -
33** packaging of this file. Please review the following information to -
34** ensure the GNU General Public License version 3.0 requirements will be -
35** met: http://www.gnu.org/copyleft/gpl.html. -
36** -
37** -
38** $QT_END_LICENSE$ -
39** -
40****************************************************************************/ -
41 -
42#include "qpixmap.h" -
43 -
44#include <private/qfont_p.h> -
45 -
46#include "qpixmap_raster_p.h" -
47#include "qnativeimage_p.h" -
48#include "qimage_p.h" -
49#include "qpaintengine.h" -
50 -
51#include "qbitmap.h" -
52#include "qimage.h" -
53#include <QBuffer> -
54#include <QImageReader> -
55#include <private/qimage_p.h> -
56#include <private/qsimd_p.h> -
57#include <private/qdrawhelper_p.h> -
58 -
59QT_BEGIN_NAMESPACE -
60 -
61QPixmap qt_toRasterPixmap(const QImage &image) -
62{ -
63 QPlatformPixmap *data =
never executed (the execution status of this line is deduced): QPlatformPixmap *data =
-
64 new QRasterPlatformPixmap(image.depth() == 1
never executed (the execution status of this line is deduced): new QRasterPlatformPixmap(image.depth() == 1
-
65 ? QPlatformPixmap::BitmapType
never executed (the execution status of this line is deduced): ? QPlatformPixmap::BitmapType
-
66 : QPlatformPixmap::PixmapType);
never executed (the execution status of this line is deduced): : QPlatformPixmap::PixmapType);
-
67 -
68 data->fromImage(image, Qt::AutoColor);
never executed (the execution status of this line is deduced): data->fromImage(image, Qt::AutoColor);
-
69 -
70 return QPixmap(data);
never executed: return QPixmap(data);
0
71} -
72 -
73QPixmap qt_toRasterPixmap(const QPixmap &pixmap) -
74{ -
75 if (pixmap.isNull())
never evaluated: pixmap.isNull()
0
76 return QPixmap();
never executed: return QPixmap();
0
77 -
78 if (QPixmap(pixmap).data_ptr()->classId() == QPlatformPixmap::RasterClass)
never evaluated: QPixmap(pixmap).data_ptr()->classId() == QPlatformPixmap::RasterClass
0
79 return pixmap;
never executed: return pixmap;
0
80 -
81 return qt_toRasterPixmap(pixmap.toImage());
never executed: return qt_toRasterPixmap(pixmap.toImage());
0
82} -
83 -
84QRasterPlatformPixmap::QRasterPlatformPixmap(PixelType type) -
85 : QPlatformPixmap(type, RasterClass) -
86{ -
87}
executed: }
Execution Count:4936
4936
88 -
89QRasterPlatformPixmap::~QRasterPlatformPixmap() -
90{ -
91} -
92 -
93QPlatformPixmap *QRasterPlatformPixmap::createCompatiblePlatformPixmap() const -
94{ -
95 return new QRasterPlatformPixmap(pixelType());
executed: return new QRasterPlatformPixmap(pixelType());
Execution Count:19
19
96} -
97 -
98void QRasterPlatformPixmap::resize(int width, int height) -
99{ -
100 QImage::Format format;
executed (the execution status of this line is deduced): QImage::Format format;
-
101 if (pixelType() == BitmapType)
evaluated: pixelType() == BitmapType
TRUEFALSE
yes
Evaluation Count:130
yes
Evaluation Count:764
130-764
102 format = QImage::Format_MonoLSB;
executed: format = QImage::Format_MonoLSB;
Execution Count:130
130
103 else -
104 format = QNativeImage::systemFormat();
executed: format = QNativeImage::systemFormat();
Execution Count:764
764
105 -
106 image = QImage(width, height, format);
executed (the execution status of this line is deduced): image = QImage(width, height, format);
-
107 w = width;
executed (the execution status of this line is deduced): w = width;
-
108 h = height;
executed (the execution status of this line is deduced): h = height;
-
109 d = image.depth();
executed (the execution status of this line is deduced): d = image.depth();
-
110 is_null = (w <= 0 || h <= 0);
evaluated: w <= 0
TRUEFALSE
yes
Evaluation Count:237
yes
Evaluation Count:657
partially evaluated: h <= 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:657
0-657
111 -
112 if (pixelType() == BitmapType && !image.isNull()) {
evaluated: pixelType() == BitmapType
TRUEFALSE
yes
Evaluation Count:130
yes
Evaluation Count:764
evaluated: !image.isNull()
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:113
17-764
113 image.setColorCount(2);
executed (the execution status of this line is deduced): image.setColorCount(2);
-
114 image.setColor(0, QColor(Qt::color0).rgba());
executed (the execution status of this line is deduced): image.setColor(0, QColor(Qt::color0).rgba());
-
115 image.setColor(1, QColor(Qt::color1).rgba());
executed (the execution status of this line is deduced): image.setColor(1, QColor(Qt::color1).rgba());
-
116 }
executed: }
Execution Count:17
17
117 -
118 setSerialNumber(image.cacheKey() >> 32);
executed (the execution status of this line is deduced): setSerialNumber(image.cacheKey() >> 32);
-
119}
executed: }
Execution Count:894
894
120 -
121bool QRasterPlatformPixmap::fromData(const uchar *buffer, uint len, const char *format, -
122 Qt::ImageConversionFlags flags) -
123{ -
124 QByteArray a = QByteArray::fromRawData(reinterpret_cast<const char *>(buffer), len);
executed (the execution status of this line is deduced): QByteArray a = QByteArray::fromRawData(reinterpret_cast<const char *>(buffer), len);
-
125 QBuffer b(&a);
executed (the execution status of this line is deduced): QBuffer b(&a);
-
126 b.open(QIODevice::ReadOnly);
executed (the execution status of this line is deduced): b.open(QIODevice::ReadOnly);
-
127 QImage image = QImageReader(&b, format).read();
executed (the execution status of this line is deduced): QImage image = QImageReader(&b, format).read();
-
128 if (image.isNull())
partially evaluated: image.isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:18
0-18
129 return false;
never executed: return false;
0
130 -
131 createPixmapForImage(image, flags, /* inplace = */true);
executed (the execution status of this line is deduced): createPixmapForImage(image, flags, true);
-
132 return !isNull();
executed: return !isNull();
Execution Count:18
18
133} -
134 -
135void QRasterPlatformPixmap::fromImage(const QImage &sourceImage, -
136 Qt::ImageConversionFlags flags) -
137{ -
138 Q_UNUSED(flags);
executed (the execution status of this line is deduced): (void)flags;;
-
139 QImage image = sourceImage;
executed (the execution status of this line is deduced): QImage image = sourceImage;
-
140 createPixmapForImage(image, flags, /* inplace = */false);
executed (the execution status of this line is deduced): createPixmapForImage(image, flags, false);
-
141}
executed: }
Execution Count:4191
4191
142 -
143void QRasterPlatformPixmap::fromImageReader(QImageReader *imageReader, -
144 Qt::ImageConversionFlags flags) -
145{ -
146 Q_UNUSED(flags);
executed (the execution status of this line is deduced): (void)flags;;
-
147 QImage image = imageReader->read();
executed (the execution status of this line is deduced): QImage image = imageReader->read();
-
148 if (image.isNull())
partially evaluated: image.isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
149 return;
never executed: return;
0
150 -
151 createPixmapForImage(image, flags, /* inplace = */true);
executed (the execution status of this line is deduced): createPixmapForImage(image, flags, true);
-
152}
executed: }
Execution Count:15
15
153 -
154// from qbackingstore.cpp -
155extern void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset); -
156 -
157void QRasterPlatformPixmap::copy(const QPlatformPixmap *data, const QRect &rect) -
158{ -
159 fromImage(data->toImage(rect).copy(), Qt::NoOpaqueDetection);
executed (the execution status of this line is deduced): fromImage(data->toImage(rect).copy(), Qt::NoOpaqueDetection);
-
160}
executed: }
Execution Count:9
9
161 -
162bool QRasterPlatformPixmap::scroll(int dx, int dy, const QRect &rect) -
163{ -
164 if (!image.isNull())
partially evaluated: !image.isNull()
TRUEFALSE
yes
Evaluation Count:12
no
Evaluation Count:0
0-12
165 qt_scrollRectInImage(image, rect, QPoint(dx, dy));
executed: qt_scrollRectInImage(image, rect, QPoint(dx, dy));
Execution Count:12
12
166 return true;
executed: return true;
Execution Count:12
12
167} -
168 -
169void QRasterPlatformPixmap::fill(const QColor &color) -
170{ -
171 uint pixel;
executed (the execution status of this line is deduced): uint pixel;
-
172 -
173 if (image.depth() == 1) {
evaluated: image.depth() == 1
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:349
14-349
174 int gray = qGray(color.rgba());
executed (the execution status of this line is deduced): int gray = qGray(color.rgba());
-
175 // Pick the best approximate color in the image's colortable. -
176 if (qAbs(qGray(image.color(0)) - gray) < qAbs(qGray(image.color(1)) - gray))
evaluated: qAbs(qGray(image.color(0)) - gray) < qAbs(qGray(image.color(1)) - gray)
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:6
6-8
177 pixel = 0;
executed: pixel = 0;
Execution Count:8
8
178 else -
179 pixel = 1;
executed: pixel = 1;
Execution Count:6
6
180 } else if (image.depth() >= 15) {
partially evaluated: image.depth() >= 15
TRUEFALSE
yes
Evaluation Count:349
no
Evaluation Count:0
0-349
181 int alpha = color.alpha();
executed (the execution status of this line is deduced): int alpha = color.alpha();
-
182 if (alpha != 255) {
evaluated: alpha != 255
TRUEFALSE
yes
Evaluation Count:78
yes
Evaluation Count:271
78-271
183 if (!image.hasAlphaChannel()) {
partially evaluated: !image.hasAlphaChannel()
TRUEFALSE
yes
Evaluation Count:78
no
Evaluation Count:0
0-78
184 QImage::Format toFormat;
executed (the execution status of this line is deduced): QImage::Format toFormat;
-
185#if !(defined(QT_COMPILER_SUPPORTS_NEON) || defined(__SSE2__)) -
186 if (image.format() == QImage::Format_RGB16) -
187 toFormat = QImage::Format_ARGB8565_Premultiplied; -
188 else if (image.format() == QImage::Format_RGB666) -
189 toFormat = QImage::Format_ARGB6666_Premultiplied; -
190 else if (image.format() == QImage::Format_RGB555) -
191 toFormat = QImage::Format_ARGB8555_Premultiplied; -
192 else if (image.format() == QImage::Format_RGB444) -
193 toFormat = QImage::Format_ARGB4444_Premultiplied; -
194 else -
195#endif -
196 toFormat = QImage::Format_ARGB32_Premultiplied;
executed (the execution status of this line is deduced): toFormat = QImage::Format_ARGB32_Premultiplied;
-
197 -
198 if (!image.isNull() && qt_depthForFormat(image.format()) == qt_depthForFormat(toFormat)) {
partially evaluated: !image.isNull()
TRUEFALSE
yes
Evaluation Count:78
no
Evaluation Count:0
partially evaluated: qt_depthForFormat(image.format()) == qt_depthForFormat(toFormat)
TRUEFALSE
yes
Evaluation Count:78
no
Evaluation Count:0
0-78
199 image.detach();
executed (the execution status of this line is deduced): image.detach();
-
200 image.d->format = toFormat;
executed (the execution status of this line is deduced): image.d->format = toFormat;
-
201 } else {
executed: }
Execution Count:78
78
202 image = QImage(image.width(), image.height(), toFormat);
never executed (the execution status of this line is deduced): image = QImage(image.width(), image.height(), toFormat);
-
203 }
never executed: }
0
204 } -
205 }
executed: }
Execution Count:78
78
206 pixel = PREMUL(color.rgba());
executed (the execution status of this line is deduced): pixel = PREMUL(color.rgba());
-
207 const QPixelLayout *layout = &qPixelLayouts[image.format()];
executed (the execution status of this line is deduced): const QPixelLayout *layout = &qPixelLayouts[image.format()];
-
208 layout->convertFromARGB32PM(&pixel, &pixel, 1, layout, 0);
executed (the execution status of this line is deduced): layout->convertFromARGB32PM(&pixel, &pixel, 1, layout, 0);
-
209 } else {
executed: }
Execution Count:349
349
210 pixel = 0;
never executed (the execution status of this line is deduced): pixel = 0;
-
211 // ### what about 8 bits -
212 }
never executed: }
0
213 -
214 image.fill(pixel);
executed (the execution status of this line is deduced): image.fill(pixel);
-
215}
executed: }
Execution Count:363
363
216 -
217bool QRasterPlatformPixmap::hasAlphaChannel() const -
218{ -
219 return image.hasAlphaChannel();
executed: return image.hasAlphaChannel();
Execution Count:89
89
220} -
221 -
222QImage QRasterPlatformPixmap::toImage() const -
223{ -
224 if (!image.isNull()) {
partially evaluated: !image.isNull()
TRUEFALSE
yes
Evaluation Count:2025
no
Evaluation Count:0
0-2025
225 QImageData *data = const_cast<QImage &>(image).data_ptr();
executed (the execution status of this line is deduced): QImageData *data = const_cast<QImage &>(image).data_ptr();
-
226 if (data->paintEngine && data->paintEngine->isActive()
evaluated: data->paintEngine
TRUEFALSE
yes
Evaluation Count:253
yes
Evaluation Count:1772
evaluated: data->paintEngine->isActive()
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:246
7-1772
227 && data->paintEngine->paintDevice() == &image)
partially evaluated: data->paintEngine->paintDevice() == &image
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-7
228 { -
229 return image.copy();
executed: return image.copy();
Execution Count:7
7
230 } -
231 }
executed: }
Execution Count:2018
2018
232 -
233 return image;
executed: return image;
Execution Count:2018
2018
234} -
235 -
236QImage QRasterPlatformPixmap::toImage(const QRect &rect) const -
237{ -
238 if (rect.isNull())
partially evaluated: rect.isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9
0-9
239 return image;
never executed: return image;
0
240 -
241 QRect clipped = rect.intersected(QRect(0, 0, w, h));
executed (the execution status of this line is deduced): QRect clipped = rect.intersected(QRect(0, 0, w, h));
-
242 if (d % 8 == 0)
evaluated: d % 8 == 0
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:1
1-8
243 return QImage(image.scanLine(clipped.y()) + clipped.x() * (d / 8),
executed: return QImage(image.scanLine(clipped.y()) + clipped.x() * (d / 8), clipped.width(), clipped.height(), image.bytesPerLine(), image.format());
Execution Count:8
8
244 clipped.width(), clipped.height(),
executed: return QImage(image.scanLine(clipped.y()) + clipped.x() * (d / 8), clipped.width(), clipped.height(), image.bytesPerLine(), image.format());
Execution Count:8
8
245 image.bytesPerLine(), image.format());
executed: return QImage(image.scanLine(clipped.y()) + clipped.x() * (d / 8), clipped.width(), clipped.height(), image.bytesPerLine(), image.format());
Execution Count:8
8
246 else -
247 return image.copy(clipped);
executed: return image.copy(clipped);
Execution Count:1
1
248} -
249 -
250QPaintEngine* QRasterPlatformPixmap::paintEngine() const -
251{ -
252 return image.paintEngine();
executed: return image.paintEngine();
Execution Count:1899
1899
253} -
254 -
255int QRasterPlatformPixmap::metric(QPaintDevice::PaintDeviceMetric metric) const -
256{ -
257 QImageData *d = image.d;
executed (the execution status of this line is deduced): QImageData *d = image.d;
-
258 if (!d)
partially evaluated: !d
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1916
0-1916
259 return 0;
never executed: return 0;
0
260 -
261 // override the image dpi with the screen dpi when rendering to a pixmap -
262 switch (metric) { -
263 case QPaintDevice::PdmWidth: -
264 return w;
executed: return w;
Execution Count:469
469
265 case QPaintDevice::PdmHeight: -
266 return h;
executed: return h;
Execution Count:469
469
267 case QPaintDevice::PdmWidthMM: -
268 return qRound(d->width * 25.4 / qt_defaultDpiX());
never executed: return qRound(d->width * 25.4 / qt_defaultDpiX());
0
269 case QPaintDevice::PdmHeightMM: -
270 return qRound(d->height * 25.4 / qt_defaultDpiY());
never executed: return qRound(d->height * 25.4 / qt_defaultDpiY());
0
271 case QPaintDevice::PdmNumColors: -
272 return d->colortable.size();
never executed: return d->colortable.size();
0
273 case QPaintDevice::PdmDepth: -
274 return this->d;
never executed: return this->d;
0
275 case QPaintDevice::PdmDpiX: -
276 return qt_defaultDpiX();
executed: return qt_defaultDpiX();
Execution Count:6
6
277 case QPaintDevice::PdmPhysicalDpiX: -
278 return qt_defaultDpiX() * image.devicePixelRatio();
never executed: return qt_defaultDpiX() * image.devicePixelRatio();
0
279 case QPaintDevice::PdmDpiY: -
280 return qt_defaultDpiX();
executed: return qt_defaultDpiX();
Execution Count:972
972
281 case QPaintDevice::PdmPhysicalDpiY: -
282 return qt_defaultDpiY() * image.devicePixelRatio();
never executed: return qt_defaultDpiY() * image.devicePixelRatio();
0
283 default: -
284 qWarning("QRasterPlatformPixmap::metric(): Unhandled metric type %d", metric);
never executed (the execution status of this line is deduced): QMessageLogger("image/qpixmap_raster.cpp", 284, __PRETTY_FUNCTION__).warning("QRasterPlatformPixmap::metric(): Unhandled metric type %d", metric);
-
285 break;
never executed: break;
0
286 } -
287 -
288 return 0;
never executed: return 0;
0
289} -
290 -
291void QRasterPlatformPixmap::createPixmapForImage(QImage &sourceImage, Qt::ImageConversionFlags flags, bool inPlace) -
292{ -
293 QImage::Format format;
executed (the execution status of this line is deduced): QImage::Format format;
-
294 if (flags & Qt::NoFormatConversion)
partially evaluated: flags & Qt::NoFormatConversion
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4224
0-4224
295 format = sourceImage.format();
never executed: format = sourceImage.format();
0
296 else -
297 if (pixelType() == BitmapType) {
evaluated: pixelType() == BitmapType
TRUEFALSE
yes
Evaluation Count:212
yes
Evaluation Count:4012
212-4012
298 format = QImage::Format_MonoLSB;
executed (the execution status of this line is deduced): format = QImage::Format_MonoLSB;
-
299 } else {
executed: }
Execution Count:212
212
300 if (sourceImage.depth() == 1) {
evaluated: sourceImage.depth() == 1
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:4008
4-4008
301 format = sourceImage.hasAlphaChannel()
partially evaluated: sourceImage.hasAlphaChannel()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
302 ? QImage::Format_ARGB32_Premultiplied
executed (the execution status of this line is deduced): ? QImage::Format_ARGB32_Premultiplied
-
303 : QImage::Format_RGB32;
executed (the execution status of this line is deduced): : QImage::Format_RGB32;
-
304 } else {
executed: }
Execution Count:4
4
305 QImage::Format opaqueFormat = QNativeImage::systemFormat();
executed (the execution status of this line is deduced): QImage::Format opaqueFormat = QNativeImage::systemFormat();
-
306 QImage::Format alphaFormat = QImage::Format_ARGB32_Premultiplied;
executed (the execution status of this line is deduced): QImage::Format alphaFormat = QImage::Format_ARGB32_Premultiplied;
-
307 -
308#if !defined(QT_COMPILER_SUPPORTS_NEON) && !defined(__SSE2__) -
309 switch (opaqueFormat) { -
310 case QImage::Format_RGB16: -
311 alphaFormat = QImage::Format_ARGB8565_Premultiplied; -
312 break; -
313 default: // We don't care about the others... -
314 break; -
315 } -
316#endif -
317 -
318 if (!sourceImage.hasAlphaChannel()) {
evaluated: !sourceImage.hasAlphaChannel()
TRUEFALSE
yes
Evaluation Count:137
yes
Evaluation Count:3871
137-3871
319 format = opaqueFormat;
executed (the execution status of this line is deduced): format = opaqueFormat;
-
320 } else if ((flags & Qt::NoOpaqueDetection) == 0
executed: }
Execution Count:137
partially evaluated: (flags & Qt::NoOpaqueDetection) == 0
TRUEFALSE
yes
Evaluation Count:3871
no
Evaluation Count:0
0-3871
321 && !const_cast<QImage &>(sourceImage).data_ptr()->checkForAlphaPixels())
evaluated: !const_cast<QImage &>(sourceImage).data_ptr()->checkForAlphaPixels()
TRUEFALSE
yes
Evaluation Count:1104
yes
Evaluation Count:2767
1104-2767
322 { -
323 format = opaqueFormat;
executed (the execution status of this line is deduced): format = opaqueFormat;
-
324 } else {
executed: }
Execution Count:1104
1104
325 format = alphaFormat;
executed (the execution status of this line is deduced): format = alphaFormat;
-
326 }
executed: }
Execution Count:2767
2767
327 } -
328 } -
329 -
330 // image has alpha format but is really opaque, so try to do a -
331 // more efficient conversion -
332 if (format == QImage::Format_RGB32 && (sourceImage.format() == QImage::Format_ARGB32
evaluated: format == QImage::Format_RGB32
TRUEFALSE
yes
Evaluation Count:1245
yes
Evaluation Count:2979
evaluated: sourceImage.format() == QImage::Format_ARGB32
TRUEFALSE
yes
Evaluation Count:121
yes
Evaluation Count:1124
121-2979
333 || sourceImage.format() == QImage::Format_ARGB32_Premultiplied))
evaluated: sourceImage.format() == QImage::Format_ARGB32_Premultiplied
TRUEFALSE
yes
Evaluation Count:983
yes
Evaluation Count:141
141-983
334 { -
335 image = sourceImage;
executed (the execution status of this line is deduced): image = sourceImage;
-
336 if (!inPlace)
evaluated: !inPlace
TRUEFALSE
yes
Evaluation Count:1101
yes
Evaluation Count:3
3-1101
337 image.detach();
executed: image.detach();
Execution Count:1101
1101
338 if (image.d)
partially evaluated: image.d
TRUEFALSE
yes
Evaluation Count:1104
no
Evaluation Count:0
0-1104
339 image.d->format = QImage::Format_RGB32;
executed: image.d->format = QImage::Format_RGB32;
Execution Count:1104
1104
340 } else if (inPlace && sourceImage.d->convertInPlace(format, flags)) {
executed: }
Execution Count:1104
evaluated: inPlace
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:3090
evaluated: sourceImage.d->convertInPlace(format, flags)
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:5
5-3090
341 image = sourceImage;
executed (the execution status of this line is deduced): image = sourceImage;
-
342 } else {
executed: }
Execution Count:25
25
343 image = sourceImage.convertToFormat(format);
executed (the execution status of this line is deduced): image = sourceImage.convertToFormat(format);
-
344 }
executed: }
Execution Count:3095
3095
345 -
346 if (image.d) {
partially evaluated: image.d
TRUEFALSE
yes
Evaluation Count:4224
no
Evaluation Count:0
0-4224
347 w = image.d->width;
executed (the execution status of this line is deduced): w = image.d->width;
-
348 h = image.d->height;
executed (the execution status of this line is deduced): h = image.d->height;
-
349 d = image.d->depth;
executed (the execution status of this line is deduced): d = image.d->depth;
-
350 } else {
executed: }
Execution Count:4224
4224
351 w = h = d = 0;
never executed (the execution status of this line is deduced): w = h = d = 0;
-
352 }
never executed: }
0
353 is_null = (w <= 0 || h <= 0);
partially evaluated: w <= 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4224
partially evaluated: h <= 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4224
0-4224
354 -
355 image.d->devicePixelRatio = sourceImage.devicePixelRatio();
executed (the execution status of this line is deduced): image.d->devicePixelRatio = sourceImage.devicePixelRatio();
-
356 setSerialNumber(image.cacheKey() >> 32);
executed (the execution status of this line is deduced): setSerialNumber(image.cacheKey() >> 32);
-
357}
executed: }
Execution Count:4224
4224
358 -
359QImage* QRasterPlatformPixmap::buffer() -
360{ -
361 return &image;
executed: return &image;
Execution Count:799
799
362} -
363 -
364qreal QRasterPlatformPixmap::devicePixelRatio() const -
365{ -
366 return image.devicePixelRatio();
executed: return image.devicePixelRatio();
Execution Count:4370
4370
367} -
368 -
369void QRasterPlatformPixmap::setDevicePixelRatio(qreal scaleFactor) -
370{ -
371 image.setDevicePixelRatio(scaleFactor);
executed (the execution status of this line is deduced): image.setDevicePixelRatio(scaleFactor);
-
372}
executed: }
Execution Count:8
8
373 -
374QT_END_NAMESPACE -
375 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial