image/qpixmap_raster.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -
4** Contact: http://www.qt-project.org/legal -
5** -
6** This file is part of the QtGui module of the Qt Toolkit. -
7** -
8** $QT_BEGIN_LICENSE:LGPL$ -
9** Commercial License Usage -
10** Licensees holding valid commercial Qt licenses may use this file in -
11** accordance with the commercial license agreement provided with the -
12** Software or, alternatively, in accordance with the terms contained in -
13** a written agreement between you and Digia. For licensing terms and -
14** conditions see http://qt.digia.com/licensing. For further information -
15** use the contact form at http://qt.digia.com/contact-us. -
16** -
17** GNU Lesser General Public License Usage -
18** Alternatively, this file may be used under the terms of the GNU Lesser -
19** General Public License version 2.1 as published by the Free Software -
20** Foundation and appearing in the file LICENSE.LGPL included in the -
21** packaging of this file. Please review the following information to -
22** ensure the GNU Lesser General Public License version 2.1 requirements -
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -
24** -
25** In addition, as a special exception, Digia gives you certain additional -
26** rights. These rights are described in the Digia Qt LGPL Exception -
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -
28** -
29** GNU General Public License Usage -
30** Alternatively, this file may be used under the terms of the GNU -
31** General Public License version 3.0 as published by the Free Software -
32** Foundation and appearing in the file LICENSE.GPL included in the -
33** packaging of this file. Please review the following information to -
34** ensure the GNU General Public License version 3.0 requirements will be -
35** met: http://www.gnu.org/copyleft/gpl.html. -
36** -
37** -
38** $QT_END_LICENSE$ -
39** -
40****************************************************************************/ -
41 -
42#include "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:5017
5017
88 -
89QRasterPlatformPixmap::~QRasterPlatformPixmap() -
90{ -
91} -
92 -
93QPlatformPixmap *QRasterPlatformPixmap::createCompatiblePlatformPixmap() const -
94{ -
95 return new QRasterPlatformPixmap(pixelType());
executed: return new QRasterPlatformPixmap(pixelType());
Execution Count:65
65
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:818
130-818
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:818
818
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:256
yes
Evaluation Count:692
partially evaluated: h <= 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:692
0-692
111 -
112 if (pixelType() == BitmapType && !image.isNull()) {
evaluated: pixelType() == BitmapType
TRUEFALSE
yes
Evaluation Count:130
yes
Evaluation Count:818
evaluated: !image.isNull()
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:113
17-818
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:948
948
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:4238
4238
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:55
55
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:409
14-409
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:409
no
Evaluation Count:0
0-409
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:83
yes
Evaluation Count:326
83-326
183 if (!image.hasAlphaChannel()) {
partially evaluated: !image.hasAlphaChannel()
TRUEFALSE
yes
Evaluation Count:83
no
Evaluation Count:0
0-83
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:83
no
Evaluation Count:0
partially evaluated: qt_depthForFormat(image.format()) == qt_depthForFormat(toFormat)
TRUEFALSE
yes
Evaluation Count:83
no
Evaluation Count:0
0-83
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:83
83
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:83
83
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:409
409
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:423
423
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:2189
no
Evaluation Count:0
0-2189
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:276
yes
Evaluation Count:1913
evaluated: data->paintEngine->isActive()
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:269
7-1913
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:2182
2182
232 -
233 return image;
executed: return image;
Execution Count:2182
2182
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:55
0-55
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 const uint du = uint(d);
executed (the execution status of this line is deduced): const uint du = uint(d);
-
243 if ((du % 8 == 0) && (((uint(clipped.x()) * du)) % 32 == 0))
evaluated: (du % 8 == 0)
TRUEFALSE
yes
Evaluation Count:54
yes
Evaluation Count:1
evaluated: (((uint(clipped.x()) * du)) % 32 == 0)
TRUEFALSE
yes
Evaluation Count:53
yes
Evaluation Count:1
1-54
244 return QImage(image.scanLine(clipped.y()) + clipped.x() * (du / 8),
executed: return QImage(image.scanLine(clipped.y()) + clipped.x() * (du / 8), clipped.width(), clipped.height(), image.bytesPerLine(), image.format());
Execution Count:53
53
245 clipped.width(), clipped.height(),
executed: return QImage(image.scanLine(clipped.y()) + clipped.x() * (du / 8), clipped.width(), clipped.height(), image.bytesPerLine(), image.format());
Execution Count:53
53
246 image.bytesPerLine(), image.format());
executed: return QImage(image.scanLine(clipped.y()) + clipped.x() * (du / 8), clipped.width(), clipped.height(), image.bytesPerLine(), image.format());
Execution Count:53
53
247 else -
248 return image.copy(clipped);
executed: return image.copy(clipped);
Execution Count:2
2
249} -
250 -
251QPaintEngine* QRasterPlatformPixmap::paintEngine() const -
252{ -
253 return image.paintEngine();
executed: return image.paintEngine();
Execution Count:2155
2155
254} -
255 -
256int QRasterPlatformPixmap::metric(QPaintDevice::PaintDeviceMetric metric) const -
257{ -
258 QImageData *d = image.d;
executed (the execution status of this line is deduced): QImageData *d = image.d;
-
259 if (!d)
partially evaluated: !d
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1963
0-1963
260 return 0;
never executed: return 0;
0
261 -
262 // override the image dpi with the screen dpi when rendering to a pixmap -
263 switch (metric) { -
264 case QPaintDevice::PdmWidth: -
265 return w;
executed: return w;
Execution Count:485
485
266 case QPaintDevice::PdmHeight: -
267 return h;
executed: return h;
Execution Count:485
485
268 case QPaintDevice::PdmWidthMM: -
269 return qRound(d->width * 25.4 / qt_defaultDpiX());
never executed: return qRound(d->width * 25.4 / qt_defaultDpiX());
0
270 case QPaintDevice::PdmHeightMM: -
271 return qRound(d->height * 25.4 / qt_defaultDpiY());
never executed: return qRound(d->height * 25.4 / qt_defaultDpiY());
0
272 case QPaintDevice::PdmNumColors: -
273 return d->colortable.size();
never executed: return d->colortable.size();
0
274 case QPaintDevice::PdmDepth: -
275 return this->d;
never executed: return this->d;
0
276 case QPaintDevice::PdmDpiX: -
277 return qt_defaultDpiX();
executed: return qt_defaultDpiX();
Execution Count:6
6
278 case QPaintDevice::PdmPhysicalDpiX: -
279 return qt_defaultDpiX() * image.devicePixelRatio();
never executed: return qt_defaultDpiX() * image.devicePixelRatio();
0
280 case QPaintDevice::PdmDpiY: -
281 return qt_defaultDpiX();
executed: return qt_defaultDpiX();
Execution Count:987
987
282 case QPaintDevice::PdmPhysicalDpiY: -
283 return qt_defaultDpiY() * image.devicePixelRatio();
never executed: return qt_defaultDpiY() * image.devicePixelRatio();
0
284 default: -
285 qWarning("QRasterPlatformPixmap::metric(): Unhandled metric type %d", metric);
never executed (the execution status of this line is deduced): QMessageLogger("image/qpixmap_raster.cpp", 285, __PRETTY_FUNCTION__).warning("QRasterPlatformPixmap::metric(): Unhandled metric type %d", metric);
-
286 break;
never executed: break;
0
287 } -
288 -
289 return 0;
never executed: return 0;
0
290} -
291 -
292void QRasterPlatformPixmap::createPixmapForImage(QImage &sourceImage, Qt::ImageConversionFlags flags, bool inPlace) -
293{ -
294 QImage::Format format;
executed (the execution status of this line is deduced): QImage::Format format;
-
295 if (flags & Qt::NoFormatConversion)
evaluated: flags & Qt::NoFormatConversion
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:4270
1-4270
296 format = sourceImage.format();
executed: format = sourceImage.format();
Execution Count:1
1
297 else -
298 if (pixelType() == BitmapType) {
evaluated: pixelType() == BitmapType
TRUEFALSE
yes
Evaluation Count:212
yes
Evaluation Count:4058
212-4058
299 format = QImage::Format_MonoLSB;
executed (the execution status of this line is deduced): format = QImage::Format_MonoLSB;
-
300 } else {
executed: }
Execution Count:212
212
301 if (sourceImage.depth() == 1) {
evaluated: sourceImage.depth() == 1
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:4053
5-4053
302 format = sourceImage.hasAlphaChannel()
partially evaluated: sourceImage.hasAlphaChannel()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
303 ? QImage::Format_ARGB32_Premultiplied
executed (the execution status of this line is deduced): ? QImage::Format_ARGB32_Premultiplied
-
304 : QImage::Format_RGB32;
executed (the execution status of this line is deduced): : QImage::Format_RGB32;
-
305 } else {
executed: }
Execution Count:5
5
306 QImage::Format opaqueFormat = QNativeImage::systemFormat();
executed (the execution status of this line is deduced): QImage::Format opaqueFormat = QNativeImage::systemFormat();
-
307 QImage::Format alphaFormat = QImage::Format_ARGB32_Premultiplied;
executed (the execution status of this line is deduced): QImage::Format alphaFormat = QImage::Format_ARGB32_Premultiplied;
-
308 -
309#if !defined(QT_COMPILER_SUPPORTS_NEON) && !defined(__SSE2__) -
310 switch (opaqueFormat) { -
311 case QImage::Format_RGB16: -
312 alphaFormat = QImage::Format_ARGB8565_Premultiplied; -
313 break; -
314 default: // We don't care about the others... -
315 break; -
316 } -
317#endif -
318 -
319 if (!sourceImage.hasAlphaChannel()) {
evaluated: !sourceImage.hasAlphaChannel()
TRUEFALSE
yes
Evaluation Count:230
yes
Evaluation Count:3823
230-3823
320 format = opaqueFormat;
executed (the execution status of this line is deduced): format = opaqueFormat;
-
321 } else if ((flags & Qt::NoOpaqueDetection) == 0
executed: }
Execution Count:230
evaluated: (flags & Qt::NoOpaqueDetection) == 0
TRUEFALSE
yes
Evaluation Count:3822
yes
Evaluation Count:1
1-3822
322 && !const_cast<QImage &>(sourceImage).data_ptr()->checkForAlphaPixels())
evaluated: !const_cast<QImage &>(sourceImage).data_ptr()->checkForAlphaPixels()
TRUEFALSE
yes
Evaluation Count:1108
yes
Evaluation Count:2714
1108-2714
323 { -
324 format = opaqueFormat;
executed (the execution status of this line is deduced): format = opaqueFormat;
-
325 } else {
executed: }
Execution Count:1108
1108
326 format = alphaFormat;
executed (the execution status of this line is deduced): format = alphaFormat;
-
327 }
executed: }
Execution Count:2715
2715
328 } -
329 } -
330 -
331 // image has alpha format but is really opaque, so try to do a -
332 // more efficient conversion -
333 if (format == QImage::Format_RGB32 && (sourceImage.format() == QImage::Format_ARGB32
evaluated: format == QImage::Format_RGB32
TRUEFALSE
yes
Evaluation Count:1343
yes
Evaluation Count:2928
evaluated: sourceImage.format() == QImage::Format_ARGB32
TRUEFALSE
yes
Evaluation Count:121
yes
Evaluation Count:1222
121-2928
334 || sourceImage.format() == QImage::Format_ARGB32_Premultiplied))
evaluated: sourceImage.format() == QImage::Format_ARGB32_Premultiplied
TRUEFALSE
yes
Evaluation Count:987
yes
Evaluation Count:235
235-987
335 { -
336 image = sourceImage;
executed (the execution status of this line is deduced): image = sourceImage;
-
337 if (!inPlace)
evaluated: !inPlace
TRUEFALSE
yes
Evaluation Count:1105
yes
Evaluation Count:3
3-1105
338 image.detach();
executed: image.detach();
Execution Count:1105
1105
339 if (image.d)
partially evaluated: image.d
TRUEFALSE
yes
Evaluation Count:1108
no
Evaluation Count:0
0-1108
340 image.d->format = QImage::Format_RGB32;
executed: image.d->format = QImage::Format_RGB32;
Execution Count:1108
1108
341 } else if (inPlace && sourceImage.d->convertInPlace(format, flags)) {
executed: }
Execution Count:1108
evaluated: inPlace
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:3133
evaluated: sourceImage.d->convertInPlace(format, flags)
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:5
5-3133
342 image = sourceImage;
executed (the execution status of this line is deduced): image = sourceImage;
-
343 } else {
executed: }
Execution Count:25
25
344 image = sourceImage.convertToFormat(format);
executed (the execution status of this line is deduced): image = sourceImage.convertToFormat(format);
-
345 }
executed: }
Execution Count:3138
3138
346 -
347 if (image.d) {
partially evaluated: image.d
TRUEFALSE
yes
Evaluation Count:4271
no
Evaluation Count:0
0-4271
348 w = image.d->width;
executed (the execution status of this line is deduced): w = image.d->width;
-
349 h = image.d->height;
executed (the execution status of this line is deduced): h = image.d->height;
-
350 d = image.d->depth;
executed (the execution status of this line is deduced): d = image.d->depth;
-
351 } else {
executed: }
Execution Count:4271
4271
352 w = h = d = 0;
never executed (the execution status of this line is deduced): w = h = d = 0;
-
353 }
never executed: }
0
354 is_null = (w <= 0 || h <= 0);
partially evaluated: w <= 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4271
partially evaluated: h <= 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4271
0-4271
355 -
356 image.d->devicePixelRatio = sourceImage.devicePixelRatio();
executed (the execution status of this line is deduced): image.d->devicePixelRatio = sourceImage.devicePixelRatio();
-
357 setSerialNumber(image.cacheKey() >> 32);
executed (the execution status of this line is deduced): setSerialNumber(image.cacheKey() >> 32);
-
358}
executed: }
Execution Count:4271
4271
359 -
360QImage* QRasterPlatformPixmap::buffer() -
361{ -
362 return &image;
executed: return &image;
Execution Count:833
833
363} -
364 -
365qreal QRasterPlatformPixmap::devicePixelRatio() const -
366{ -
367 return image.devicePixelRatio();
executed: return image.devicePixelRatio();
Execution Count:5502
5502
368} -
369 -
370void QRasterPlatformPixmap::setDevicePixelRatio(qreal scaleFactor) -
371{ -
372 image.setDevicePixelRatio(scaleFactor);
executed (the execution status of this line is deduced): image.setDevicePixelRatio(scaleFactor);
-
373}
executed: }
Execution Count:8
8
374 -
375QT_END_NAMESPACE -
376 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial