Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/util/qquickimageprovider.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||
2 | - | |||||||||||||||||||
3 | - | |||||||||||||||||||
4 | QQuickTextureFactory::QQuickTextureFactory() | - | ||||||||||||||||||
5 | { | - | ||||||||||||||||||
6 | } | - | ||||||||||||||||||
7 | - | |||||||||||||||||||
8 | - | |||||||||||||||||||
9 | - | |||||||||||||||||||
10 | - | |||||||||||||||||||
11 | - | |||||||||||||||||||
12 | QQuickTextureFactory::~QQuickTextureFactory() | - | ||||||||||||||||||
13 | { | - | ||||||||||||||||||
14 | } | - | ||||||||||||||||||
15 | QImage QQuickTextureFactory::image() const | - | ||||||||||||||||||
16 | { | - | ||||||||||||||||||
17 | return never executed: QImage();return QImage(); never executed: return QImage(); | 0 | ||||||||||||||||||
18 | } | - | ||||||||||||||||||
19 | QQuickTextureFactory *QQuickTextureFactory::textureFactoryForImage(const QImage &image) | - | ||||||||||||||||||
20 | { | - | ||||||||||||||||||
21 | if (image.isNull()
| 22-8874 | ||||||||||||||||||
22 | return executed 22 times by 6 tests: nullptr;return nullptr; Executed by:
executed 22 times by 6 tests: return nullptr; Executed by:
| 22 | ||||||||||||||||||
23 | QQuickTextureFactory *texture = QSGContext::createTextureFactoryFromImage(image); | - | ||||||||||||||||||
24 | if (texture
| 0-8874 | ||||||||||||||||||
25 | return never executed: texture;return texture; never executed: return texture; | 0 | ||||||||||||||||||
26 | return executed 8874 times by 37 tests: new QQuickDefaultTextureFactory(image);return new QQuickDefaultTextureFactory(image); Executed by:
executed 8874 times by 37 tests: return new QQuickDefaultTextureFactory(image); Executed by:
| 8874 | ||||||||||||||||||
27 | } | - | ||||||||||||||||||
28 | QQuickImageResponse::QQuickImageResponse() | - | ||||||||||||||||||
29 | : QObject(*(new QQuickImageResponsePrivate)) | - | ||||||||||||||||||
30 | { | - | ||||||||||||||||||
31 | { QQuickImageResponse *sender = (this); QQuickImageResponse *receiver = (this); const char *signal = (qFlagLocation("2""finished()" "\0" __FILE__ ":" "168")); const char *method = (qFlagLocation("1""_q_finished()" "\0" __FILE__ ":" "168")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
| 2-14 | ||||||||||||||||||
32 | __FILE__ | - | ||||||||||||||||||
33 | , | - | ||||||||||||||||||
34 | 168 | - | ||||||||||||||||||
35 | )); signalIdx = QQuickImageResponse::staticMetaObject.indexOfSignal(signal+1); } executed 2 times by 1 test: if (methodIdx < 0end of block Executed by:
| 2-14 | ||||||||||||||||||
36 | __FILE__ | - | ||||||||||||||||||
37 | , | - | ||||||||||||||||||
38 | 168 | - | ||||||||||||||||||
39 | )); if (code == 1
executed 2 times by 1 test: else methodIdx = QQuickImageResponse::staticMetaObject.indexOfSignal(method+1);methodIdx = QQuickImageResponse::staticMetaObject.indexOfSlot(method+1); Executed by:
never executed: } ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",methodIdx = QQuickImageResponse::staticMetaObject.indexOfSignal(method+1); | 0-2 | ||||||||||||||||||
40 | __FILE__ | - | ||||||||||||||||||
41 | , | - | ||||||||||||||||||
42 | 168 | - | ||||||||||||||||||
43 | )); QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); } | - | ||||||||||||||||||
44 | ; | - | ||||||||||||||||||
45 | } executed 16 times by 1 test: end of block Executed by:
| 16 | ||||||||||||||||||
46 | - | |||||||||||||||||||
47 | - | |||||||||||||||||||
48 | - | |||||||||||||||||||
49 | - | |||||||||||||||||||
50 | QQuickImageResponse::~QQuickImageResponse() | - | ||||||||||||||||||
51 | { | - | ||||||||||||||||||
52 | } | - | ||||||||||||||||||
53 | - | |||||||||||||||||||
54 | - | |||||||||||||||||||
55 | - | |||||||||||||||||||
56 | - | |||||||||||||||||||
57 | QString QQuickImageResponse::errorString() const | - | ||||||||||||||||||
58 | { | - | ||||||||||||||||||
59 | return executed 16 times by 1 test: QString();return QString(); Executed by:
executed 16 times by 1 test: return QString(); Executed by:
| 16 | ||||||||||||||||||
60 | } | - | ||||||||||||||||||
61 | void QQuickImageResponse::cancel() | - | ||||||||||||||||||
62 | { | - | ||||||||||||||||||
63 | } | - | ||||||||||||||||||
64 | QQuickImageProvider::QQuickImageProvider(ImageType type, Flags flags) | - | ||||||||||||||||||
65 | : d(new QQuickImageProviderPrivate) | - | ||||||||||||||||||
66 | { | - | ||||||||||||||||||
67 | d->type = type; | - | ||||||||||||||||||
68 | d->flags = flags; | - | ||||||||||||||||||
69 | d->isProviderWithOptions = false; | - | ||||||||||||||||||
70 | } executed 116 times by 5 tests: end of block Executed by:
| 116 | ||||||||||||||||||
71 | - | |||||||||||||||||||
72 | - | |||||||||||||||||||
73 | - | |||||||||||||||||||
74 | - | |||||||||||||||||||
75 | - | |||||||||||||||||||
76 | - | |||||||||||||||||||
77 | QQuickImageProvider::~QQuickImageProvider() | - | ||||||||||||||||||
78 | { | - | ||||||||||||||||||
79 | delete d; | - | ||||||||||||||||||
80 | } executed 116 times by 5 tests: end of block Executed by:
| 116 | ||||||||||||||||||
81 | - | |||||||||||||||||||
82 | - | |||||||||||||||||||
83 | - | |||||||||||||||||||
84 | - | |||||||||||||||||||
85 | QQuickImageProvider::ImageType QQuickImageProvider::imageType() const | - | ||||||||||||||||||
86 | { | - | ||||||||||||||||||
87 | return executed 8116 times by 5 tests: d->type;return d->type; Executed by:
executed 8116 times by 5 tests: return d->type; Executed by:
| 8116 | ||||||||||||||||||
88 | } | - | ||||||||||||||||||
89 | - | |||||||||||||||||||
90 | - | |||||||||||||||||||
91 | - | |||||||||||||||||||
92 | - | |||||||||||||||||||
93 | QQuickImageProvider::Flags QQuickImageProvider::flags() const | - | ||||||||||||||||||
94 | { | - | ||||||||||||||||||
95 | return executed 8182 times by 5 tests: d->flags;return d->flags; Executed by:
executed 8182 times by 5 tests: return d->flags; Executed by:
| 8182 | ||||||||||||||||||
96 | } | - | ||||||||||||||||||
97 | QImage QQuickImageProvider::requestImage(const QString &id, QSize *size, const QSize& requestedSize) | - | ||||||||||||||||||
98 | { | - | ||||||||||||||||||
99 | (void)id;; | - | ||||||||||||||||||
100 | (void)size;; | - | ||||||||||||||||||
101 | (void)requestedSize;; | - | ||||||||||||||||||
102 | if (d->type == Image
| 0 | ||||||||||||||||||
103 | QMessageLogger(__FILE__, 405, __PRETTY_FUNCTION__).warning("ImageProvider supports Image type but has not implemented requestImage()"); never executed: QMessageLogger(__FILE__, 405, __PRETTY_FUNCTION__).warning("ImageProvider supports Image type but has not implemented requestImage()"); | 0 | ||||||||||||||||||
104 | return never executed: QImage();return QImage(); never executed: return QImage(); | 0 | ||||||||||||||||||
105 | } | - | ||||||||||||||||||
106 | QPixmap QQuickImageProvider::requestPixmap(const QString &id, QSize *size, const QSize& requestedSize) | - | ||||||||||||||||||
107 | { | - | ||||||||||||||||||
108 | (void)id;; | - | ||||||||||||||||||
109 | (void)size;; | - | ||||||||||||||||||
110 | (void)requestedSize;; | - | ||||||||||||||||||
111 | if (d->type == Pixmap
| 0 | ||||||||||||||||||
112 | QMessageLogger(__FILE__, 434, __PRETTY_FUNCTION__).warning("ImageProvider supports Pixmap type but has not implemented requestPixmap()"); never executed: QMessageLogger(__FILE__, 434, __PRETTY_FUNCTION__).warning("ImageProvider supports Pixmap type but has not implemented requestPixmap()"); | 0 | ||||||||||||||||||
113 | return never executed: QPixmap();return QPixmap(); never executed: return QPixmap(); | 0 | ||||||||||||||||||
114 | } | - | ||||||||||||||||||
115 | QQuickTextureFactory *QQuickImageProvider::requestTexture(const QString &id, QSize *size, const QSize &requestedSize) | - | ||||||||||||||||||
116 | { | - | ||||||||||||||||||
117 | (void)id;; | - | ||||||||||||||||||
118 | (void)size;; | - | ||||||||||||||||||
119 | (void)requestedSize;; | - | ||||||||||||||||||
120 | if (d->type == Texture
| 0 | ||||||||||||||||||
121 | QMessageLogger(__FILE__, 465, __PRETTY_FUNCTION__).warning("ImageProvider supports Texture type but has not implemented requestTexture()"); never executed: QMessageLogger(__FILE__, 465, __PRETTY_FUNCTION__).warning("ImageProvider supports Texture type but has not implemented requestTexture()"); | 0 | ||||||||||||||||||
122 | return never executed: nullptr;return nullptr; never executed: return nullptr; | 0 | ||||||||||||||||||
123 | } | - | ||||||||||||||||||
124 | QQuickAsyncImageProvider::QQuickAsyncImageProvider() | - | ||||||||||||||||||
125 | : QQuickImageProvider(ImageResponse, ForceAsynchronousImageLoading) | - | ||||||||||||||||||
126 | , d(nullptr) | - | ||||||||||||||||||
127 | { | - | ||||||||||||||||||
128 | (void)d;; | - | ||||||||||||||||||
129 | } executed 20 times by 2 tests: end of block Executed by:
| 20 | ||||||||||||||||||
130 | - | |||||||||||||||||||
131 | QQuickAsyncImageProvider::~QQuickAsyncImageProvider() | - | ||||||||||||||||||
132 | { | - | ||||||||||||||||||
133 | } | - | ||||||||||||||||||
134 | class QQuickImageProviderOptionsPrivate : public QSharedData | - | ||||||||||||||||||
135 | { | - | ||||||||||||||||||
136 | public: | - | ||||||||||||||||||
137 | QQuickImageProviderOptionsPrivate() | - | ||||||||||||||||||
138 | { | - | ||||||||||||||||||
139 | } | - | ||||||||||||||||||
140 | - | |||||||||||||||||||
141 | QQuickImageProviderOptions::AutoTransform autoTransform = QQuickImageProviderOptions::UsePluginDefaultTransform; | - | ||||||||||||||||||
142 | bool preserveAspectRatioCrop = false; | - | ||||||||||||||||||
143 | bool preserveAspectRatioFit = false; | - | ||||||||||||||||||
144 | }; | - | ||||||||||||||||||
145 | QQuickImageProviderOptions::QQuickImageProviderOptions() | - | ||||||||||||||||||
146 | : d(new QQuickImageProviderOptionsPrivate()) | - | ||||||||||||||||||
147 | { | - | ||||||||||||||||||
148 | } executed 16891 times by 42 tests: end of block Executed by:
| 16891 | ||||||||||||||||||
149 | - | |||||||||||||||||||
150 | QQuickImageProviderOptions::~QQuickImageProviderOptions() | - | ||||||||||||||||||
151 | { | - | ||||||||||||||||||
152 | } | - | ||||||||||||||||||
153 | - | |||||||||||||||||||
154 | QQuickImageProviderOptions::QQuickImageProviderOptions(const QQuickImageProviderOptions &other) | - | ||||||||||||||||||
155 | : d(other.d) | - | ||||||||||||||||||
156 | { | - | ||||||||||||||||||
157 | } executed 63745 times by 40 tests: end of block Executed by:
| 63745 | ||||||||||||||||||
158 | - | |||||||||||||||||||
159 | QQuickImageProviderOptions& QQuickImageProviderOptions::operator=(const QQuickImageProviderOptions &other) | - | ||||||||||||||||||
160 | { | - | ||||||||||||||||||
161 | d = other.d; | - | ||||||||||||||||||
162 | return executed 16 times by 1 test: *this;return *this; Executed by:
executed 16 times by 1 test: return *this; Executed by:
| 16 | ||||||||||||||||||
163 | } | - | ||||||||||||||||||
164 | - | |||||||||||||||||||
165 | bool QQuickImageProviderOptions::operator==(const QQuickImageProviderOptions &other) const | - | ||||||||||||||||||
166 | { | - | ||||||||||||||||||
167 | return executed 16503 times by 39 tests: d->autoTransform == other.d->autoTransform &&return d->autoTransform == other.d->autoTransform && d->preserveAspectRatioCrop == other.d->preserveAspectRatioCrop && d->preserveAspectRatioFit == other.d->preserveAspectRatioFit; Executed by:
executed 16503 times by 39 tests: return d->autoTransform == other.d->autoTransform && d->preserveAspectRatioCrop == other.d->preserveAspectRatioCrop && d->preserveAspectRatioFit == other.d->preserveAspectRatioFit; Executed by:
| 16503 | ||||||||||||||||||
168 | d->preserveAspectRatioCrop == other.d->preserveAspectRatioCrop && executed 16503 times by 39 tests: return d->autoTransform == other.d->autoTransform && d->preserveAspectRatioCrop == other.d->preserveAspectRatioCrop && d->preserveAspectRatioFit == other.d->preserveAspectRatioFit; Executed by:
| 16503 | ||||||||||||||||||
169 | d->preserveAspectRatioFit == other.d->preserveAspectRatioFit; executed 16503 times by 39 tests: return d->autoTransform == other.d->autoTransform && d->preserveAspectRatioCrop == other.d->preserveAspectRatioCrop && d->preserveAspectRatioFit == other.d->preserveAspectRatioFit; Executed by:
| 16503 | ||||||||||||||||||
170 | } | - | ||||||||||||||||||
171 | - | |||||||||||||||||||
172 | - | |||||||||||||||||||
173 | - | |||||||||||||||||||
174 | - | |||||||||||||||||||
175 | QQuickImageProviderOptions::AutoTransform QQuickImageProviderOptions::autoTransform() const | - | ||||||||||||||||||
176 | { | - | ||||||||||||||||||
177 | return executed 45645 times by 40 tests: d->autoTransform;return d->autoTransform; Executed by:
executed 45645 times by 40 tests: return d->autoTransform; Executed by:
| 45645 | ||||||||||||||||||
178 | } | - | ||||||||||||||||||
179 | - | |||||||||||||||||||
180 | void QQuickImageProviderOptions::setAutoTransform(QQuickImageProviderOptions::AutoTransform autoTransform) | - | ||||||||||||||||||
181 | { | - | ||||||||||||||||||
182 | d->autoTransform = autoTransform; | - | ||||||||||||||||||
183 | } never executed: end of block | 0 | ||||||||||||||||||
184 | - | |||||||||||||||||||
185 | - | |||||||||||||||||||
186 | - | |||||||||||||||||||
187 | - | |||||||||||||||||||
188 | - | |||||||||||||||||||
189 | bool QQuickImageProviderOptions::preserveAspectRatioCrop() const | - | ||||||||||||||||||
190 | { | - | ||||||||||||||||||
191 | return executed 152 times by 5 tests: d->preserveAspectRatioCrop;return d->preserveAspectRatioCrop; Executed by:
executed 152 times by 5 tests: return d->preserveAspectRatioCrop; Executed by:
| 152 | ||||||||||||||||||
192 | } | - | ||||||||||||||||||
193 | - | |||||||||||||||||||
194 | void QQuickImageProviderOptions::setPreserveAspectRatioCrop(bool preserveAspectRatioCrop) | - | ||||||||||||||||||
195 | { | - | ||||||||||||||||||
196 | d->preserveAspectRatioCrop = preserveAspectRatioCrop; | - | ||||||||||||||||||
197 | } executed 26 times by 2 tests: end of block Executed by:
| 26 | ||||||||||||||||||
198 | - | |||||||||||||||||||
199 | - | |||||||||||||||||||
200 | - | |||||||||||||||||||
201 | - | |||||||||||||||||||
202 | - | |||||||||||||||||||
203 | bool QQuickImageProviderOptions::preserveAspectRatioFit() const | - | ||||||||||||||||||
204 | { | - | ||||||||||||||||||
205 | return executed 126 times by 5 tests: d->preserveAspectRatioFit;return d->preserveAspectRatioFit; Executed by:
executed 126 times by 5 tests: return d->preserveAspectRatioFit; Executed by:
| 126 | ||||||||||||||||||
206 | } | - | ||||||||||||||||||
207 | - | |||||||||||||||||||
208 | void QQuickImageProviderOptions::setPreserveAspectRatioFit(bool preserveAspectRatioFit) | - | ||||||||||||||||||
209 | { | - | ||||||||||||||||||
210 | d->preserveAspectRatioFit = preserveAspectRatioFit; | - | ||||||||||||||||||
211 | } executed 28 times by 2 tests: end of block Executed by:
| 28 | ||||||||||||||||||
212 | - | |||||||||||||||||||
213 | QQuickImageProviderWithOptions::QQuickImageProviderWithOptions(ImageType type, Flags flags) | - | ||||||||||||||||||
214 | : QQuickAsyncImageProvider() | - | ||||||||||||||||||
215 | { | - | ||||||||||||||||||
216 | QQuickImageProvider::d->type = type; | - | ||||||||||||||||||
217 | QQuickImageProvider::d->flags = flags; | - | ||||||||||||||||||
218 | QQuickImageProvider::d->isProviderWithOptions = true; | - | ||||||||||||||||||
219 | } executed 16 times by 1 test: end of block Executed by:
| 16 | ||||||||||||||||||
220 | - | |||||||||||||||||||
221 | QImage QQuickImageProviderWithOptions::requestImage(const QString &id, QSize *size, const QSize& requestedSize) | - | ||||||||||||||||||
222 | { | - | ||||||||||||||||||
223 | return never executed: requestImage(id, size, requestedSize, QQuickImageProviderOptions());return requestImage(id, size, requestedSize, QQuickImageProviderOptions()); never executed: return requestImage(id, size, requestedSize, QQuickImageProviderOptions()); | 0 | ||||||||||||||||||
224 | } | - | ||||||||||||||||||
225 | - | |||||||||||||||||||
226 | QPixmap QQuickImageProviderWithOptions::requestPixmap(const QString &id, QSize *size, const QSize& requestedSize) | - | ||||||||||||||||||
227 | { | - | ||||||||||||||||||
228 | return never executed: requestPixmap(id, size, requestedSize, QQuickImageProviderOptions());return requestPixmap(id, size, requestedSize, QQuickImageProviderOptions()); never executed: return requestPixmap(id, size, requestedSize, QQuickImageProviderOptions()); | 0 | ||||||||||||||||||
229 | } | - | ||||||||||||||||||
230 | - | |||||||||||||||||||
231 | QQuickTextureFactory *QQuickImageProviderWithOptions::requestTexture(const QString &id, QSize *size, const QSize &requestedSize) | - | ||||||||||||||||||
232 | { | - | ||||||||||||||||||
233 | return never executed: requestTexture(id, size, requestedSize, QQuickImageProviderOptions());return requestTexture(id, size, requestedSize, QQuickImageProviderOptions()); never executed: return requestTexture(id, size, requestedSize, QQuickImageProviderOptions()); | 0 | ||||||||||||||||||
234 | } | - | ||||||||||||||||||
235 | - | |||||||||||||||||||
236 | QImage QQuickImageProviderWithOptions::requestImage(const QString &id, QSize *size, const QSize& requestedSize, const QQuickImageProviderOptions &options) | - | ||||||||||||||||||
237 | { | - | ||||||||||||||||||
238 | (void)options;; | - | ||||||||||||||||||
239 | return never executed: QQuickAsyncImageProvider::requestImage(id, size, requestedSize);return QQuickAsyncImageProvider::requestImage(id, size, requestedSize); never executed: return QQuickAsyncImageProvider::requestImage(id, size, requestedSize); | 0 | ||||||||||||||||||
240 | } | - | ||||||||||||||||||
241 | - | |||||||||||||||||||
242 | QPixmap QQuickImageProviderWithOptions::requestPixmap(const QString &id, QSize *size, const QSize& requestedSize, const QQuickImageProviderOptions &options) | - | ||||||||||||||||||
243 | { | - | ||||||||||||||||||
244 | (void)options;; | - | ||||||||||||||||||
245 | return never executed: QQuickAsyncImageProvider::requestPixmap(id, size, requestedSize);return QQuickAsyncImageProvider::requestPixmap(id, size, requestedSize); never executed: return QQuickAsyncImageProvider::requestPixmap(id, size, requestedSize); | 0 | ||||||||||||||||||
246 | } | - | ||||||||||||||||||
247 | - | |||||||||||||||||||
248 | QQuickTextureFactory *QQuickImageProviderWithOptions::requestTexture(const QString &id, QSize *size, const QSize &requestedSize, const QQuickImageProviderOptions &options) | - | ||||||||||||||||||
249 | { | - | ||||||||||||||||||
250 | (void)options;; | - | ||||||||||||||||||
251 | return never executed: QQuickAsyncImageProvider::requestTexture(id, size, requestedSize);return QQuickAsyncImageProvider::requestTexture(id, size, requestedSize); never executed: return QQuickAsyncImageProvider::requestTexture(id, size, requestedSize); | 0 | ||||||||||||||||||
252 | } | - | ||||||||||||||||||
253 | - | |||||||||||||||||||
254 | QQuickImageResponse *QQuickImageProviderWithOptions::requestImageResponse(const QString &id, const QSize &requestedSize) | - | ||||||||||||||||||
255 | { | - | ||||||||||||||||||
256 | (void)id;; | - | ||||||||||||||||||
257 | (void)requestedSize;; | - | ||||||||||||||||||
258 | if (imageType() == ImageResponse
| 0 | ||||||||||||||||||
259 | QMessageLogger(__FILE__, 653, __PRETTY_FUNCTION__).warning("ImageProvider is of ImageResponse type but has not implemented requestImageResponse()"); never executed: QMessageLogger(__FILE__, 653, __PRETTY_FUNCTION__).warning("ImageProvider is of ImageResponse type but has not implemented requestImageResponse()"); | 0 | ||||||||||||||||||
260 | return never executed: nullptr;return nullptr; never executed: return nullptr; | 0 | ||||||||||||||||||
261 | } | - | ||||||||||||||||||
262 | - | |||||||||||||||||||
263 | QQuickImageResponse *QQuickImageProviderWithOptions::requestImageResponse(const QString &id, const QSize &requestedSize, const QQuickImageProviderOptions &options) | - | ||||||||||||||||||
264 | { | - | ||||||||||||||||||
265 | (void)options;; | - | ||||||||||||||||||
266 | return never executed: requestImageResponse(id, requestedSize);return requestImageResponse(id, requestedSize); never executed: return requestImageResponse(id, requestedSize); | 0 | ||||||||||||||||||
267 | } | - | ||||||||||||||||||
268 | QSize QQuickImageProviderWithOptions::loadSize(const QSize &originalSize, const QSize &requestedSize, const QByteArray &format, const QQuickImageProviderOptions &options) | - | ||||||||||||||||||
269 | { | - | ||||||||||||||||||
270 | QSize res; | - | ||||||||||||||||||
271 | if ((requestedSize.width() <= 0
| 0-726 | ||||||||||||||||||
272 | return executed 720 times by 35 tests: res;return res; Executed by:
executed 720 times by 35 tests: return res; Executed by:
| 720 | ||||||||||||||||||
273 | - | |||||||||||||||||||
274 | const bool preserveAspectCropOrFit = options.preserveAspectRatioCrop()
| 0-42 | ||||||||||||||||||
275 | const bool formatIsSvg = (format == "svg"
| 0-42 | ||||||||||||||||||
276 | - | |||||||||||||||||||
277 | if (!preserveAspectCropOrFit
| 0-38 | ||||||||||||||||||
278 | return never executed: requestedSize;return requestedSize; never executed: return requestedSize; | 0 | ||||||||||||||||||
279 | - | |||||||||||||||||||
280 | qreal ratio = 0.0; | - | ||||||||||||||||||
281 | if (requestedSize.width()
| 0-36 | ||||||||||||||||||
282 | requestedSize.width() < originalSize.width()
| 2-30 | ||||||||||||||||||
283 | ratio = qreal(requestedSize.width()) / originalSize.width(); | - | ||||||||||||||||||
284 | } executed 34 times by 4 tests: end of block Executed by:
| 34 | ||||||||||||||||||
285 | if (requestedSize.height()
| 0-40 | ||||||||||||||||||
286 | requestedSize.height() < originalSize.height()
| 6-30 | ||||||||||||||||||
287 | qreal hr = qreal(requestedSize.height()) / originalSize.height(); | - | ||||||||||||||||||
288 | if (ratio == 0.0
| 6-28 | ||||||||||||||||||
289 | ratio = hr; executed 6 times by 2 tests: ratio = hr; Executed by:
| 6 | ||||||||||||||||||
290 | else if (!preserveAspectCropOrFit
| 4-24 | ||||||||||||||||||
291 | ratio = hr; executed 20 times by 2 tests: ratio = hr; Executed by:
| 20 | ||||||||||||||||||
292 | else if (preserveAspectCropOrFit
| 0-4 | ||||||||||||||||||
293 | ratio = hr; executed 4 times by 1 test: ratio = hr; Executed by:
| 4 | ||||||||||||||||||
294 | } executed 34 times by 5 tests: end of block Executed by:
| 34 | ||||||||||||||||||
295 | if (ratio > 0.0
| 2-40 | ||||||||||||||||||
296 | res.setHeight(qRound(originalSize.height() * ratio)); | - | ||||||||||||||||||
297 | res.setWidth(qRound(originalSize.width() * ratio)); | - | ||||||||||||||||||
298 | } executed 40 times by 5 tests: end of block Executed by:
| 40 | ||||||||||||||||||
299 | return executed 42 times by 5 tests: res;return res; Executed by:
executed 42 times by 5 tests: return res; Executed by:
| 42 | ||||||||||||||||||
300 | } | - | ||||||||||||||||||
301 | - | |||||||||||||||||||
302 | QQuickImageProviderWithOptions *QQuickImageProviderWithOptions::checkedCast(QQuickImageProvider *provider) | - | ||||||||||||||||||
303 | { | - | ||||||||||||||||||
304 | if (provider
| 0-8116 | ||||||||||||||||||
305 | return executed 8 times by 1 test: static_cast<QQuickImageProviderWithOptions *>(provider);return static_cast<QQuickImageProviderWithOptions *>(provider); Executed by:
executed 8 times by 1 test: return static_cast<QQuickImageProviderWithOptions *>(provider); Executed by:
| 8 | ||||||||||||||||||
306 | - | |||||||||||||||||||
307 | return executed 8118 times by 4 tests: nullptr;return nullptr; Executed by:
executed 8118 times by 4 tests: return nullptr; Executed by:
| 8118 | ||||||||||||||||||
308 | } | - | ||||||||||||||||||
309 | - | |||||||||||||||||||
310 | - | |||||||||||||||||||
311 | - | |||||||||||||||||||
Switch to Source code | Preprocessed file |