qdrawhelper.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/painting/qdrawhelper.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Copyright (C) 2016 Intel Corporation.-
5** Contact: https://www.qt.io/licensing/-
6**-
7** This file is part of the QtGui module of the Qt Toolkit.-
8**-
9** $QT_BEGIN_LICENSE:LGPL$-
10** Commercial License Usage-
11** Licensees holding valid commercial Qt licenses may use this file in-
12** accordance with the commercial license agreement provided with the-
13** Software or, alternatively, in accordance with the terms contained in-
14** a written agreement between you and The Qt Company. For licensing terms-
15** and conditions see https://www.qt.io/terms-conditions. For further-
16** information use the contact form at https://www.qt.io/contact-us.-
17**-
18** GNU Lesser General Public License Usage-
19** Alternatively, this file may be used under the terms of the GNU Lesser-
20** General Public License version 3 as published by the Free Software-
21** Foundation and appearing in the file LICENSE.LGPL3 included in the-
22** packaging of this file. Please review the following information to-
23** ensure the GNU Lesser General Public License version 3 requirements-
24** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
25**-
26** GNU General Public License Usage-
27** Alternatively, this file may be used under the terms of the GNU-
28** General Public License version 2.0 or (at your option) the GNU General-
29** Public license version 3 or any later version approved by the KDE Free-
30** Qt Foundation. The licenses are as published by the Free Software-
31** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
32** included in the packaging of this file. Please review the following-
33** information to ensure the GNU General Public License requirements will-
34** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
35** https://www.gnu.org/licenses/gpl-3.0.html.-
36**-
37** $QT_END_LICENSE$-
38**-
39****************************************************************************/-
40-
41#include <qglobal.h>-
42-
43#include <qstylehints.h>-
44#include <qguiapplication.h>-
45#include <qatomic.h>-
46#include <private/qdrawhelper_p.h>-
47#include <private/qpaintengine_raster_p.h>-
48#include <private/qpainter_p.h>-
49#include <private/qdrawhelper_x86_p.h>-
50#include <private/qdrawingprimitive_sse2_p.h>-
51#include <private/qdrawhelper_neon_p.h>-
52#if defined(QT_COMPILER_SUPPORTS_MIPS_DSP) || defined(QT_COMPILER_SUPPORTS_MIPS_DSPR2)-
53#include <private/qdrawhelper_mips_dsp_p.h>-
54#endif-
55#include <private/qguiapplication_p.h>-
56#include <private/qrgba64_p.h>-
57#include <qmath.h>-
58-
59QT_BEGIN_NAMESPACE-
60-
61#define MASK(src, a) src = BYTE_MUL(src, a)-
62-
63/*-
64 constants and structures-
65*/-
66-
67enum {-
68 fixed_scale = 1 << 16,-
69 half_point = 1 << 15-
70};-
71-
72// must be multiple of 4 for easier SIMD implementations-
73static const int buffer_size = 2048;-
74-
75template<QImage::Format> Q_DECL_CONSTEXPR uint redWidth();-
76template<QImage::Format> Q_DECL_CONSTEXPR uint redShift();-
77template<QImage::Format> Q_DECL_CONSTEXPR uint greenWidth();-
78template<QImage::Format> Q_DECL_CONSTEXPR uint greenShift();-
79template<QImage::Format> Q_DECL_CONSTEXPR uint blueWidth();-
80template<QImage::Format> Q_DECL_CONSTEXPR uint blueShift();-
81template<QImage::Format> Q_DECL_CONSTEXPR uint alphaWidth();-
82template<QImage::Format> Q_DECL_CONSTEXPR uint alphaShift();-
83-
84template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_RGB16>() { return 5; }-
85template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_RGB444>() { return 4; }-
86template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_RGB555>() { return 5; }-
87template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_RGB666>() { return 6; }-
88template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_RGB888>() { return 8; }-
89template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_ARGB4444_Premultiplied>() { return 4; }-
90template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_ARGB8555_Premultiplied>() { return 5; }-
91template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_ARGB8565_Premultiplied>() { return 5; }-
92template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_ARGB6666_Premultiplied>() { return 6; }-
93template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_RGB16>() { return 11; }-
94template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_RGB444>() { return 8; }-
95template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_RGB555>() { return 10; }-
96template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_RGB666>() { return 12; }-
97template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_RGB888>() { return 16; }-
98template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_ARGB4444_Premultiplied>() { return 8; }-
99template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_ARGB8555_Premultiplied>() { return 18; }-
100template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_ARGB8565_Premultiplied>() { return 19; }-
101template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_ARGB6666_Premultiplied>() { return 12; }-
102template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_RGB16>() { return 6; }-
103template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_RGB444>() { return 4; }-
104template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_RGB555>() { return 5; }-
105template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_RGB666>() { return 6; }-
106template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_RGB888>() { return 8; }-
107template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_ARGB4444_Premultiplied>() { return 4; }-
108template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_ARGB8555_Premultiplied>() { return 5; }-
109template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_ARGB8565_Premultiplied>() { return 6; }-
110template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_ARGB6666_Premultiplied>() { return 6; }-
111template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_RGB16>() { return 5; }-
112template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_RGB444>() { return 4; }-
113template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_RGB555>() { return 5; }-
114template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_RGB666>() { return 6; }-
115template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_RGB888>() { return 8; }-
116template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_ARGB4444_Premultiplied>() { return 4; }-
117template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_ARGB8555_Premultiplied>() { return 13; }-
118template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_ARGB8565_Premultiplied>() { return 13; }-
119template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_ARGB6666_Premultiplied>() { return 6; }-
120template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_RGB16>() { return 5; }-
121template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_RGB444>() { return 4; }-
122template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_RGB555>() { return 5; }-
123template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_RGB666>() { return 6; }-
124template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_RGB888>() { return 8; }-
125template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_ARGB4444_Premultiplied>() { return 4; }-
126template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_ARGB8555_Premultiplied>() { return 5; }-
127template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_ARGB8565_Premultiplied>() { return 5; }-
128template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_ARGB6666_Premultiplied>() { return 6; }-
129template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_RGB16>() { return 0; }-
130template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_RGB444>() { return 0; }-
131template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_RGB555>() { return 0; }-
132template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_RGB666>() { return 0; }-
133template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_RGB888>() { return 0; }-
134template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_ARGB4444_Premultiplied>() { return 0; }-
135template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_ARGB8555_Premultiplied>() { return 8; }-
136template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_ARGB8565_Premultiplied>() { return 8; }-
137template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_ARGB6666_Premultiplied>() { return 0; }-
138template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_RGB16>() { return 0; }-
139template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_RGB444>() { return 0; }-
140template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_RGB555>() { return 0; }-
141template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_RGB666>() { return 0; }-
142template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_RGB888>() { return 0; }-
143template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_ARGB4444_Premultiplied>() { return 4; }-
144template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_ARGB8555_Premultiplied>() { return 8; }-
145template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_ARGB8565_Premultiplied>() { return 8; }-
146template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_ARGB6666_Premultiplied>() { return 6; }-
147template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_RGB16>() { return 0; }-
148template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_RGB444>() { return 0; }-
149template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_RGB555>() { return 0; }-
150template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_RGB666>() { return 0; }-
151template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_RGB888>() { return 0; }-
152template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_ARGB4444_Premultiplied>() { return 12; }-
153template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_ARGB8555_Premultiplied>() { return 0; }-
154template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_ARGB8565_Premultiplied>() { return 0; }-
155template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_ARGB6666_Premultiplied>() { return 18; }-
156-
157template<QImage::Format> Q_DECL_CONSTEXPR QPixelLayout::BPP bitsPerPixel();-
158template<> Q_DECL_CONSTEXPR QPixelLayout::BPP bitsPerPixel<QImage::Format_RGB16>() { return QPixelLayout::BPP16; }-
159template<> Q_DECL_CONSTEXPR QPixelLayout::BPP bitsPerPixel<QImage::Format_RGB444>() { return QPixelLayout::BPP16; }-
160template<> Q_DECL_CONSTEXPR QPixelLayout::BPP bitsPerPixel<QImage::Format_RGB555>() { return QPixelLayout::BPP16; }-
161template<> Q_DECL_CONSTEXPR QPixelLayout::BPP bitsPerPixel<QImage::Format_RGB666>() { return QPixelLayout::BPP24; }-
162template<> Q_DECL_CONSTEXPR QPixelLayout::BPP bitsPerPixel<QImage::Format_RGB888>() { return QPixelLayout::BPP24; }-
163template<> Q_DECL_CONSTEXPR QPixelLayout::BPP bitsPerPixel<QImage::Format_ARGB4444_Premultiplied>() { return QPixelLayout::BPP16; }-
164template<> Q_DECL_CONSTEXPR QPixelLayout::BPP bitsPerPixel<QImage::Format_ARGB8555_Premultiplied>() { return QPixelLayout::BPP24; }-
165template<> Q_DECL_CONSTEXPR QPixelLayout::BPP bitsPerPixel<QImage::Format_ARGB8565_Premultiplied>() { return QPixelLayout::BPP24; }-
166template<> Q_DECL_CONSTEXPR QPixelLayout::BPP bitsPerPixel<QImage::Format_ARGB6666_Premultiplied>() { return QPixelLayout::BPP24; }-
167-
168-
169template<QImage::Format Format>-
170static const uint *QT_FASTCALL convertToRGB32(uint *buffer, const uint *src, int count,-
171 const QPixelLayout *, const QRgb *)-
172{-
173 Q_CONSTEXPR uint redMask = ((1 << redWidth<Format>()) - 1);-
174 Q_CONSTEXPR uint greenMask = ((1 << greenWidth<Format>()) - 1);-
175 Q_CONSTEXPR uint blueMask = ((1 << blueWidth<Format>()) - 1);-
176-
177 Q_CONSTEXPR uchar redLeftShift = 8 - redWidth<Format>();-
178 Q_CONSTEXPR uchar greenLeftShift = 8 - greenWidth<Format>();-
179 Q_CONSTEXPR uchar blueLeftShift = 8 - blueWidth<Format>();-
180-
181 Q_CONSTEXPR uchar redRightShift = 2 * redWidth<Format>() - 8;-
182 Q_CONSTEXPR uchar greenRightShift = 2 * greenWidth<Format>() - 8;-
183 Q_CONSTEXPR uchar blueRightShift = 2 * blueWidth<Format>() - 8;-
184-
185 for (int i = 0; i < count; ++i) {
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
186 uint red = (src[i] >> redShift<Format>()) & redMask;-
187 uint green = (src[i] >> greenShift<Format>()) & greenMask;-
188 uint blue = (src[i] >> blueShift<Format>()) & blueMask;-
189-
190 red = ((red << redLeftShift) | (red >> redRightShift)) << 16;-
191 green = ((green << greenLeftShift) | (green >> greenRightShift)) << 8;-
192 blue = (blue << blueLeftShift) | (blue >> blueRightShift);-
193 buffer[i] = 0xff000000 | red | green | blue;-
194 }
never executed: end of block
0
195-
196 return buffer;
never executed: return buffer;
0
197}-
198-
199template<QImage::Format Format>-
200static const QRgba64 *QT_FASTCALL convertToRGB64(QRgba64 *buffer, const uint *src, int count,-
201 const QPixelLayout *, const QRgb *)-
202{-
203 Q_CONSTEXPR uint redMask = ((1 << redWidth<Format>()) - 1);-
204 Q_CONSTEXPR uint greenMask = ((1 << greenWidth<Format>()) - 1);-
205 Q_CONSTEXPR uint blueMask = ((1 << blueWidth<Format>()) - 1);-
206-
207 Q_CONSTEXPR uchar redLeftShift = 8 - redWidth<Format>();-
208 Q_CONSTEXPR uchar greenLeftShift = 8 - greenWidth<Format>();-
209 Q_CONSTEXPR uchar blueLeftShift = 8 - blueWidth<Format>();-
210-
211 Q_CONSTEXPR uchar redRightShift = 2 * redWidth<Format>() - 8;-
212 Q_CONSTEXPR uchar greenRightShift = 2 * greenWidth<Format>() - 8;-
213 Q_CONSTEXPR uchar blueRightShift = 2 * blueWidth<Format>() - 8;-
214-
215 for (int i = 0; i < count; ++i) {
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
216 uint red = (src[i] >> redShift<Format>()) & redMask;-
217 uint green = (src[i] >> greenShift<Format>()) & greenMask;-
218 uint blue = (src[i] >> blueShift<Format>()) & blueMask;-
219-
220 red = ((red << redLeftShift) | (red >> redRightShift)) << 16;-
221 green = ((green << greenLeftShift) | (green >> greenRightShift)) << 8;-
222 blue = (blue << blueLeftShift) | (blue >> blueRightShift);-
223 buffer[i] = QRgba64::fromRgba(red, green, blue, 255);-
224 }
never executed: end of block
0
225-
226 return buffer;
never executed: return buffer;
0
227}-
228-
229template<QImage::Format Format>-
230static const uint *QT_FASTCALL convertARGBPMToARGB32PM(uint *buffer, const uint *src, int count,-
231 const QPixelLayout *, const QRgb *)-
232{-
233 Q_CONSTEXPR uint alphaMask = ((1 << alphaWidth<Format>()) - 1);-
234 Q_CONSTEXPR uint redMask = ((1 << redWidth<Format>()) - 1);-
235 Q_CONSTEXPR uint greenMask = ((1 << greenWidth<Format>()) - 1);-
236 Q_CONSTEXPR uint blueMask = ((1 << blueWidth<Format>()) - 1);-
237-
238 Q_CONSTEXPR uchar alphaLeftShift = 8 - alphaWidth<Format>();-
239 Q_CONSTEXPR uchar redLeftShift = 8 - redWidth<Format>();-
240 Q_CONSTEXPR uchar greenLeftShift = 8 - greenWidth<Format>();-
241 Q_CONSTEXPR uchar blueLeftShift = 8 - blueWidth<Format>();-
242-
243 Q_CONSTEXPR uchar alphaRightShift = 2 * alphaWidth<Format>() - 8;-
244 Q_CONSTEXPR uchar redRightShift = 2 * redWidth<Format>() - 8;-
245 Q_CONSTEXPR uchar greenRightShift = 2 * greenWidth<Format>() - 8;-
246 Q_CONSTEXPR uchar blueRightShift = 2 * blueWidth<Format>() - 8;-
247-
248 Q_CONSTEXPR bool mustMin = (alphaWidth<Format>() != redWidth<Format>()) ||-
249 (alphaWidth<Format>() != greenWidth<Format>()) ||-
250 (alphaWidth<Format>() != blueWidth<Format>());-
251-
252 if (mustMin) {
mustMinDescription
TRUEnever evaluated
FALSEnever evaluated
0
253 for (int i = 0; i < count; ++i) {
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
254 uint alpha = (src[i] >> alphaShift<Format>()) & alphaMask;-
255 uint red = (src[i] >> redShift<Format>()) & redMask;-
256 uint green = (src[i] >> greenShift<Format>()) & greenMask;-
257 uint blue = (src[i] >> blueShift<Format>()) & blueMask;-
258-
259 alpha = (alpha << alphaLeftShift) | (alpha >> alphaRightShift);-
260 red = qMin(alpha, (red << redLeftShift) | (red >> redRightShift));-
261 green = qMin(alpha, (green << greenLeftShift) | (green >> greenRightShift));-
262 blue = qMin(alpha, (blue << blueLeftShift) | (blue >> blueRightShift));-
263 buffer[i] = (alpha << 24) | (red << 16) | (green << 8) | blue;-
264 }
never executed: end of block
0
265 } else {
never executed: end of block
0
266 for (int i = 0; i < count; ++i) {
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
267 uint alpha = (src[i] >> alphaShift<Format>()) & alphaMask;-
268 uint red = (src[i] >> redShift<Format>()) & redMask;-
269 uint green = (src[i] >> greenShift<Format>()) & greenMask;-
270 uint blue = (src[i] >> blueShift<Format>()) & blueMask;-
271-
272 alpha = ((alpha << alphaLeftShift) | (alpha >> alphaRightShift)) << 24;-
273 red = ((red << redLeftShift) | (red >> redRightShift)) << 16;-
274 green = ((green << greenLeftShift) | (green >> greenRightShift)) << 8;-
275 blue = (blue << blueLeftShift) | (blue >> blueRightShift);-
276 buffer[i] = alpha | red | green | blue;-
277 }
never executed: end of block
0
278 }
never executed: end of block
0
279-
280 return buffer;
never executed: return buffer;
0
281}-
282-
283template<QImage::Format Format>-
284static const QRgba64 *QT_FASTCALL convertARGBPMToARGB64PM(QRgba64 *buffer, const uint *src, int count,-
285 const QPixelLayout *, const QRgb *)-
286{-
287 Q_CONSTEXPR uint alphaMask = ((1 << alphaWidth<Format>()) - 1);-
288 Q_CONSTEXPR uint redMask = ((1 << redWidth<Format>()) - 1);-
289 Q_CONSTEXPR uint greenMask = ((1 << greenWidth<Format>()) - 1);-
290 Q_CONSTEXPR uint blueMask = ((1 << blueWidth<Format>()) - 1);-
291-
292 Q_CONSTEXPR uchar alphaLeftShift = 8 - alphaWidth<Format>();-
293 Q_CONSTEXPR uchar redLeftShift = 8 - redWidth<Format>();-
294 Q_CONSTEXPR uchar greenLeftShift = 8 - greenWidth<Format>();-
295 Q_CONSTEXPR uchar blueLeftShift = 8 - blueWidth<Format>();-
296-
297 Q_CONSTEXPR uchar alphaRightShift = 2 * alphaWidth<Format>() - 8;-
298 Q_CONSTEXPR uchar redRightShift = 2 * redWidth<Format>() - 8;-
299 Q_CONSTEXPR uchar greenRightShift = 2 * greenWidth<Format>() - 8;-
300 Q_CONSTEXPR uchar blueRightShift = 2 * blueWidth<Format>() - 8;-
301-
302 Q_CONSTEXPR bool mustMin = (alphaWidth<Format>() != redWidth<Format>()) ||-
303 (alphaWidth<Format>() != greenWidth<Format>()) ||-
304 (alphaWidth<Format>() != blueWidth<Format>());-
305-
306 if (mustMin) {
mustMinDescription
TRUEnever evaluated
FALSEnever evaluated
0
307 for (int i = 0; i < count; ++i) {
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
308 uint alpha = (src[i] >> alphaShift<Format>()) & alphaMask;-
309 uint red = (src[i] >> redShift<Format>()) & redMask;-
310 uint green = (src[i] >> greenShift<Format>()) & greenMask;-
311 uint blue = (src[i] >> blueShift<Format>()) & blueMask;-
312-
313 alpha = (alpha << alphaLeftShift) | (alpha >> alphaRightShift);-
314 red = qMin(alpha, (red << redLeftShift) | (red >> redRightShift));-
315 green = qMin(alpha, (green << greenLeftShift) | (green >> greenRightShift));-
316 blue = qMin(alpha, (blue << blueLeftShift) | (blue >> blueRightShift));-
317 buffer[i] = QRgba64::fromRgba(red, green, blue, alpha);-
318 }
never executed: end of block
0
319 } else {
never executed: end of block
0
320 for (int i = 0; i < count; ++i) {
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
321 uint alpha = (src[i] >> alphaShift<Format>()) & alphaMask;-
322 uint red = (src[i] >> redShift<Format>()) & redMask;-
323 uint green = (src[i] >> greenShift<Format>()) & greenMask;-
324 uint blue = (src[i] >> blueShift<Format>()) & blueMask;-
325-
326 alpha = (alpha << alphaLeftShift) | (alpha >> alphaRightShift);-
327 red = (red << redLeftShift) | (red >> redRightShift);-
328 green = (green << greenLeftShift) | (green >> greenRightShift);-
329 blue = (blue << blueLeftShift) | (blue >> blueRightShift);-
330 buffer[i] = QRgba64::fromRgba(red, green, blue, alpha);-
331 }
never executed: end of block
0
332 }
never executed: end of block
0
333-
334 return buffer;
never executed: return buffer;
0
335}-
336-
337template<QImage::Format Format, bool fromRGB>-
338static const uint *QT_FASTCALL convertRGBFromARGB32PM(uint *buffer, const uint *src, int count,-
339 const QPixelLayout *, const QRgb *)-
340{-
341 Q_CONSTEXPR uint rMask = ((1 << redWidth<Format>()) - 1);-
342 Q_CONSTEXPR uint gMask = ((1 << greenWidth<Format>()) - 1);-
343 Q_CONSTEXPR uint bMask = ((1 << blueWidth<Format>()) - 1);-
344-
345 Q_CONSTEXPR uchar rRightShift = 24 - redWidth<Format>();-
346 Q_CONSTEXPR uchar gRightShift = 16 - greenWidth<Format>();-
347 Q_CONSTEXPR uchar bRightShift = 8 - blueWidth<Format>();-
348-
349 for (int i = 0; i < count; ++i) {
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
350 const uint c = fromRGB ? src[i] : qUnpremultiply(src[i]);-
351 const uint r = ((c >> rRightShift) & rMask) << redShift<Format>();-
352 const uint g = ((c >> gRightShift) & gMask) << greenShift<Format>();-
353 const uint b = ((c >> bRightShift) & bMask) << blueShift<Format>();-
354 buffer[i] = r | g | b;-
355 }
never executed: end of block
0
356 return buffer;
never executed: return buffer;
0
357}-
358-
359template<QImage::Format Format, bool fromRGB>-
360static const uint *QT_FASTCALL convertARGBPMFromARGB32PM(uint *buffer, const uint *src, int count,-
361 const QPixelLayout *, const QRgb *)-
362{-
363 Q_CONSTEXPR uint aMask = ((1 << alphaWidth<Format>()) - 1);-
364 Q_CONSTEXPR uint rMask = ((1 << redWidth<Format>()) - 1);-
365 Q_CONSTEXPR uint gMask = ((1 << greenWidth<Format>()) - 1);-
366 Q_CONSTEXPR uint bMask = ((1 << blueWidth<Format>()) - 1);-
367-
368 Q_CONSTEXPR uchar aRightShift = 32 - alphaWidth<Format>();-
369 Q_CONSTEXPR uchar rRightShift = 24 - redWidth<Format>();-
370 Q_CONSTEXPR uchar gRightShift = 16 - greenWidth<Format>();-
371 Q_CONSTEXPR uchar bRightShift = 8 - blueWidth<Format>();-
372-
373 Q_CONSTEXPR uint aOpaque = (0xff & aMask) << alphaShift<Format>();-
374 for (int i = 0; i < count; ++i) {
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
375 const uint c = src[i];-
376 const uint a = fromRGB ? aOpaque : (((c >> aRightShift) & aMask) << alphaShift<Format>());-
377 const uint r = ((c >> rRightShift) & rMask) << redShift<Format>();-
378 const uint g = ((c >> gRightShift) & gMask) << greenShift<Format>();-
379 const uint b = ((c >> bRightShift) & bMask) << blueShift<Format>();-
380 buffer[i] = a | r | g | b;-
381 }
never executed: end of block
0
382 return buffer;
never executed: return buffer;
0
383}-
384-
385#ifdef Q_COMPILER_CONSTEXPR-
386-
387template<QImage::Format Format> Q_DECL_CONSTEXPR static inline QPixelLayout pixelLayoutRGB()-
388{-
389 return QPixelLayout{-
390 uchar(redWidth<Format>()), uchar(redShift<Format>()),-
391 uchar(greenWidth<Format>()), uchar(greenShift<Format>()),-
392 uchar(blueWidth<Format>()), uchar(blueShift<Format>()),-
393 0, 0,-
394 false, bitsPerPixel<Format>(),-
395 convertToRGB32<Format>,-
396 convertRGBFromARGB32PM<Format, false>,-
397 convertRGBFromARGB32PM<Format, true>,-
398 convertToRGB64<Format>-
399 };-
400}-
401-
402template<QImage::Format Format> Q_DECL_CONSTEXPR static inline QPixelLayout pixelLayoutARGBPM()-
403{-
404 return QPixelLayout{-
405 uchar(redWidth<Format>()), uchar(redShift<Format>()),-
406 uchar(greenWidth<Format>()), uchar(greenShift<Format>()),-
407 uchar(blueWidth<Format>()), uchar(blueShift<Format>()),-
408 uchar(alphaWidth<Format>()), uchar(alphaShift<Format>()),-
409 true, bitsPerPixel<Format>(),-
410 convertARGBPMToARGB32PM<Format>,-
411 convertARGBPMFromARGB32PM<Format, false>,-
412 convertARGBPMFromARGB32PM<Format, true>,-
413 convertARGBPMToARGB64PM<Format>-
414 };-
415}-
416-
417#endif-
418-
419// To convert in place, let 'dest' and 'src' be the same.-
420static const uint *QT_FASTCALL convertIndexedToARGB32PM(uint *buffer, const uint *src, int count,-
421 const QPixelLayout *, const QRgb *clut)-
422{-
423 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
424 buffer[i] = qPremultiply(clut[src[i]]);
never executed: buffer[i] = qPremultiply(clut[src[i]]);
0
425 return buffer;
never executed: return buffer;
0
426}-
427-
428static const QRgba64 *QT_FASTCALL convertIndexedToARGB64PM(QRgba64 *buffer, const uint *src, int count,-
429 const QPixelLayout *, const QRgb *clut)-
430{-
431 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
432 buffer[i] = QRgba64::fromArgb32(clut[src[i]]).premultiplied();
never executed: buffer[i] = QRgba64::fromArgb32(clut[src[i]]).premultiplied();
0
433 return buffer;
never executed: return buffer;
0
434}-
435-
436static const uint *QT_FASTCALL convertPassThrough(uint *, const uint *src, int,-
437 const QPixelLayout *, const QRgb *)-
438{-
439 return src;
never executed: return src;
0
440}-
441-
442static const uint *QT_FASTCALL convertARGB32ToARGB32PM(uint *buffer, const uint *src, int count,-
443 const QPixelLayout *, const QRgb *)-
444{-
445 return qt_convertARGB32ToARGB32PM(buffer, src, count);
never executed: return qt_convertARGB32ToARGB32PM(buffer, src, count);
0
446}-
447-
448static const uint *QT_FASTCALL convertRGBA8888PMToARGB32PM(uint *buffer, const uint *src, int count,-
449 const QPixelLayout *, const QRgb *)-
450{-
451 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
452 buffer[i] = RGBA2ARGB(src[i]);
never executed: buffer[i] = RGBA2ARGB(src[i]);
0
453 return buffer;
never executed: return buffer;
0
454}-
455-
456static const uint *QT_FASTCALL convertRGBA8888ToARGB32PM(uint *buffer, const uint *src, int count,-
457 const QPixelLayout *, const QRgb *)-
458{-
459 return qt_convertRGBA8888ToARGB32PM(buffer, src, count);
never executed: return qt_convertRGBA8888ToARGB32PM(buffer, src, count);
0
460}-
461-
462static const uint *QT_FASTCALL convertAlpha8ToRGB32(uint *buffer, const uint *src, int count,-
463 const QPixelLayout *, const QRgb *)-
464{-
465 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
466 buffer[i] = qRgba(0, 0, 0, src[i]);
never executed: buffer[i] = qRgba(0, 0, 0, src[i]);
0
467 return buffer;
never executed: return buffer;
0
468}-
469-
470static const uint *QT_FASTCALL convertGrayscale8ToRGB32(uint *buffer, const uint *src, int count,-
471 const QPixelLayout *, const QRgb *)-
472{-
473 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
474 buffer[i] = qRgb(src[i], src[i], src[i]);
never executed: buffer[i] = qRgb(src[i], src[i], src[i]);
0
475 return buffer;
never executed: return buffer;
0
476}-
477-
478static const QRgba64 *QT_FASTCALL convertAlpha8ToRGB64(QRgba64 *buffer, const uint *src, int count,-
479 const QPixelLayout *, const QRgb *)-
480{-
481 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
482 buffer[i] = QRgba64::fromRgba(0, 0, 0, src[i]);
never executed: buffer[i] = QRgba64::fromRgba(0, 0, 0, src[i]);
0
483 return buffer;
never executed: return buffer;
0
484}-
485-
486static const QRgba64 *QT_FASTCALL convertGrayscale8ToRGB64(QRgba64 *buffer, const uint *src, int count,-
487 const QPixelLayout *, const QRgb *)-
488{-
489 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
490 buffer[i] = QRgba64::fromRgba(src[i], src[i], src[i], 255);
never executed: buffer[i] = QRgba64::fromRgba(src[i], src[i], src[i], 255);
0
491 return buffer;
never executed: return buffer;
0
492}-
493-
494static const uint *QT_FASTCALL convertARGB32FromARGB32PM(uint *buffer, const uint *src, int count,-
495 const QPixelLayout *, const QRgb *)-
496{-
497 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
498 buffer[i] = qUnpremultiply(src[i]);
never executed: buffer[i] = qUnpremultiply(src[i]);
0
499 return buffer;
never executed: return buffer;
0
500}-
501-
502static const uint *QT_FASTCALL convertRGBA8888PMFromARGB32PM(uint *buffer, const uint *src, int count,-
503 const QPixelLayout *, const QRgb *)-
504{-
505 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
506 buffer[i] = ARGB2RGBA(src[i]);
never executed: buffer[i] = ARGB2RGBA(src[i]);
0
507 return buffer;
never executed: return buffer;
0
508}-
509-
510#ifdef __SSE2__-
511template<bool RGBA, bool maskAlpha>-
512static inline void qConvertARGB32PMToARGB64PM_sse2(QRgba64 *buffer, const uint *src, int count)-
513{-
514 if (count <= 0)
count <= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
515 return;
never executed: return;
0
516-
517 const __m128i amask = _mm_set1_epi32(0xff000000);-
518 int i = 0;-
519 for (; ((uintptr_t)buffer & 0xf) && i < count; ++i) {
((uintptr_t)buffer & 0xf)Description
TRUEnever evaluated
FALSEnever evaluated
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
520 uint s = *src++;-
521 if (RGBA)
RGBADescription
TRUEnever evaluated
FALSEnever evaluated
0
522 s = RGBA2ARGB(s);
never executed: s = RGBA2ARGB(s);
0
523 *buffer++ = QRgba64::fromArgb32(s);-
524 }
never executed: end of block
0
525 for (; i < count-3; i += 4) {
i < count-3Description
TRUEnever evaluated
FALSEnever evaluated
0
526 __m128i vs = _mm_loadu_si128((const __m128i*)src);-
527 if (maskAlpha)
maskAlphaDescription
TRUEnever evaluated
FALSEnever evaluated
0
528 vs = _mm_or_si128(vs, amask);
never executed: vs = _mm_or_si128(vs, amask);
0
529 src += 4;-
530 __m128i v1 = _mm_unpacklo_epi8(vs, vs);-
531 __m128i v2 = _mm_unpackhi_epi8(vs, vs);-
532 if (!RGBA) {
!RGBADescription
TRUEnever evaluated
FALSEnever evaluated
0
533 v1 = _mm_shufflelo_epi16(v1, _MM_SHUFFLE(3, 0, 1, 2));-
534 v2 = _mm_shufflelo_epi16(v2, _MM_SHUFFLE(3, 0, 1, 2));-
535 v1 = _mm_shufflehi_epi16(v1, _MM_SHUFFLE(3, 0, 1, 2));-
536 v2 = _mm_shufflehi_epi16(v2, _MM_SHUFFLE(3, 0, 1, 2));-
537 }
never executed: end of block
0
538 _mm_store_si128((__m128i*)(buffer), v1);-
539 buffer += 2;-
540 _mm_store_si128((__m128i*)(buffer), v2);-
541 buffer += 2;-
542 }
never executed: end of block
0
543-
544 for (; i < count; ++i) {
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
545 uint s = *src++;-
546 if (RGBA)
RGBADescription
TRUEnever evaluated
FALSEnever evaluated
0
547 s = RGBA2ARGB(s);
never executed: s = RGBA2ARGB(s);
0
548 *buffer++ = QRgba64::fromArgb32(s);-
549 }
never executed: end of block
0
550}
never executed: end of block
0
551#endif-
552-
553static const QRgba64 *QT_FASTCALL convertRGB32ToRGB64(QRgba64 *buffer, const uint *src, int count,-
554 const QPixelLayout *, const QRgb *)-
555{-
556#ifdef __SSE2__-
557 qConvertARGB32PMToARGB64PM_sse2<false, true>(buffer, src, count);-
558#else-
559 for (int i = 0; i < count; ++i)-
560 buffer[i] = QRgba64::fromArgb32(0xff000000 | src[i]);-
561#endif-
562 return buffer;
never executed: return buffer;
0
563}-
564-
565static const QRgba64 *QT_FASTCALL convertARGB32ToARGB64PM(QRgba64 *buffer, const uint *src, int count,-
566 const QPixelLayout *, const QRgb *)-
567{-
568#ifdef __SSE2__-
569 qConvertARGB32PMToARGB64PM_sse2<false, false>(buffer, src, count);-
570 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
571 buffer[i] = buffer[i].premultiplied();
never executed: buffer[i] = buffer[i].premultiplied();
0
572#else-
573 for (int i = 0; i < count; ++i)-
574 buffer[i] = QRgba64::fromArgb32(src[i]).premultiplied();-
575#endif-
576 return buffer;
never executed: return buffer;
0
577}-
578-
579static const QRgba64 *QT_FASTCALL convertARGB32PMToARGB64PM(QRgba64 *buffer, const uint *src, int count,-
580 const QPixelLayout *, const QRgb *)-
581{-
582#ifdef __SSE2__-
583 qConvertARGB32PMToARGB64PM_sse2<false, false>(buffer, src, count);-
584#else-
585 for (int i = 0; i < count; ++i)-
586 buffer[i] = QRgba64::fromArgb32(src[i]);-
587#endif-
588 return buffer;
never executed: return buffer;
0
589}-
590-
591static const QRgba64 *QT_FASTCALL convertRGBA8888ToARGB64PM(QRgba64 *buffer, const uint *src, int count,-
592 const QPixelLayout *, const QRgb *)-
593{-
594#ifdef __SSE2__-
595 qConvertARGB32PMToARGB64PM_sse2<true, false>(buffer, src, count);-
596 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
597 buffer[i] = buffer[i].premultiplied();
never executed: buffer[i] = buffer[i].premultiplied();
0
598#else-
599 for (int i = 0; i < count; ++i)-
600 buffer[i] = QRgba64::fromArgb32(RGBA2ARGB(src[i])).premultiplied();-
601#endif-
602 return buffer;
never executed: return buffer;
0
603}-
604-
605static const QRgba64 *QT_FASTCALL convertRGBA8888PMToARGB64PM(QRgba64 *buffer, const uint *src, int count,-
606 const QPixelLayout *, const QRgb *)-
607{-
608#ifdef __SSE2__-
609 qConvertARGB32PMToARGB64PM_sse2<true, false>(buffer, src, count);-
610#else-
611 for (int i = 0; i < count; ++i)-
612 buffer[i] = QRgba64::fromArgb32(RGBA2ARGB(src[i]));-
613#endif-
614 return buffer;
never executed: return buffer;
0
615}-
616-
617static const uint *QT_FASTCALL convertRGBA8888FromARGB32PM(uint *buffer, const uint *src, int count,-
618 const QPixelLayout *, const QRgb *)-
619{-
620 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
621 buffer[i] = ARGB2RGBA(qUnpremultiply(src[i]));
never executed: buffer[i] = ARGB2RGBA(qUnpremultiply(src[i]));
0
622 return buffer;
never executed: return buffer;
0
623}-
624-
625static const uint *QT_FASTCALL convertRGBXFromRGB32(uint *buffer, const uint *src, int count,-
626 const QPixelLayout *, const QRgb *)-
627{-
628 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
629 buffer[i] = ARGB2RGBA(0xff000000 | src[i]);
never executed: buffer[i] = ARGB2RGBA(0xff000000 | src[i]);
0
630 return buffer;
never executed: return buffer;
0
631}-
632-
633static const uint *QT_FASTCALL convertRGBXFromARGB32PM(uint *buffer, const uint *src, int count,-
634 const QPixelLayout *, const QRgb *)-
635{-
636 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
637 buffer[i] = ARGB2RGBA(0xff000000 | qUnpremultiply(src[i]));
never executed: buffer[i] = ARGB2RGBA(0xff000000 | qUnpremultiply(src[i]));
0
638 return buffer;
never executed: return buffer;
0
639}-
640-
641template<QtPixelOrder PixelOrder>-
642static const uint *QT_FASTCALL convertA2RGB30PMToARGB32PM(uint *buffer, const uint *src, int count,-
643 const QPixelLayout *, const QRgb *)-
644{-
645 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
646 buffer[i] = qConvertA2rgb30ToArgb32<PixelOrder>(src[i]);
never executed: buffer[i] = qConvertA2rgb30ToArgb32<PixelOrder>(src[i]);
0
647 return buffer;
never executed: return buffer;
0
648}-
649-
650#ifdef __SSE2__-
651template<QtPixelOrder PixelOrder>-
652static inline void qConvertA2RGB30PMToARGB64PM_sse2(QRgba64 *buffer, const uint *src, int count)-
653{-
654 if (count <= 0)
count <= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
655 return;
never executed: return;
0
656-
657 const __m128i rmask = _mm_set1_epi32(0x3ff00000);-
658 const __m128i gmask = _mm_set1_epi32(0x000ffc00);-
659 const __m128i bmask = _mm_set1_epi32(0x000003ff);-
660 const __m128i afactor = _mm_set1_epi16(0x5555);-
661 int i = 0;-
662-
663 for (; ((uintptr_t)buffer & 0xf) && i < count; ++i)
((uintptr_t)buffer & 0xf)Description
TRUEnever evaluated
FALSEnever evaluated
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
664 *buffer++ = qConvertA2rgb30ToRgb64<PixelOrder>(*src++);
never executed: *buffer++ = qConvertA2rgb30ToRgb64<PixelOrder>(*src++);
0
665-
666 for (; i < count-3; i += 4) {
i < count-3Description
TRUEnever evaluated
FALSEnever evaluated
0
667 __m128i vs = _mm_loadu_si128((const __m128i*)src);-
668 src += 4;-
669 __m128i va = _mm_srli_epi32(vs, 30);-
670 __m128i vr = _mm_and_si128(vs, rmask);-
671 __m128i vb = _mm_and_si128(vs, bmask);-
672 __m128i vg = _mm_and_si128(vs, gmask);-
673 va = _mm_mullo_epi16(va, afactor);-
674 vr = _mm_or_si128(_mm_srli_epi32(vr, 14), _mm_srli_epi32(vr, 24));-
675 vg = _mm_or_si128(_mm_srli_epi32(vg, 4), _mm_srli_epi32(vg, 14));-
676 vb = _mm_or_si128(_mm_slli_epi32(vb, 6), _mm_srli_epi32(vb, 4));-
677 __m128i vrb;-
678 if (PixelOrder == PixelOrderRGB)
PixelOrder == PixelOrderRGBDescription
TRUEnever evaluated
FALSEnever evaluated
0
679 vrb = _mm_or_si128(vr, _mm_slli_si128(vb, 2));
never executed: vrb = _mm_or_si128(vr, ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(vb), (int)(2) * 8)));
0
680 else-
681 vrb = _mm_or_si128(vb, _mm_slli_si128(vr, 2));
never executed: vrb = _mm_or_si128(vb, ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(vr), (int)(2) * 8)));
0
682 __m128i vga = _mm_or_si128(vg, _mm_slli_si128(va, 2));-
683 _mm_store_si128((__m128i*)(buffer), _mm_unpacklo_epi16(vrb, vga));-
684 buffer += 2;-
685 _mm_store_si128((__m128i*)(buffer), _mm_unpackhi_epi16(vrb, vga));-
686 buffer += 2;-
687 }
never executed: end of block
0
688-
689 for (; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
690 *buffer++ = qConvertA2rgb30ToRgb64<PixelOrder>(*src++);
never executed: *buffer++ = qConvertA2rgb30ToRgb64<PixelOrder>(*src++);
0
691}
never executed: end of block
0
692#endif-
693-
694template<QtPixelOrder PixelOrder>-
695static const QRgba64 *QT_FASTCALL convertA2RGB30PMToARGB64PM(QRgba64 *buffer, const uint *src, int count,-
696 const QPixelLayout *, const QRgb *)-
697{-
698#ifdef __SSE2__-
699 qConvertA2RGB30PMToARGB64PM_sse2<PixelOrder>(buffer, src, count);-
700#else-
701 for (int i = 0; i < count; ++i)-
702 buffer[i] = qConvertA2rgb30ToRgb64<PixelOrder>(src[i]);-
703#endif-
704 return buffer;
never executed: return buffer;
0
705}-
706-
707template<QtPixelOrder PixelOrder>-
708static const uint *QT_FASTCALL convertA2RGB30PMFromARGB32PM(uint *buffer, const uint *src, int count,-
709 const QPixelLayout *, const QRgb *)-
710{-
711 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
712 buffer[i] = qConvertArgb32ToA2rgb30<PixelOrder>(src[i]);
never executed: buffer[i] = qConvertArgb32ToA2rgb30<PixelOrder>(src[i]);
0
713 return buffer;
never executed: return buffer;
0
714}-
715-
716template<QtPixelOrder PixelOrder>-
717static const uint *QT_FASTCALL convertRGB30FromRGB32(uint *buffer, const uint *src, int count,-
718 const QPixelLayout *, const QRgb *)-
719{-
720 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
721 buffer[i] = qConvertRgb32ToRgb30<PixelOrder>(src[i]);
never executed: buffer[i] = qConvertRgb32ToRgb30<PixelOrder>(src[i]);
0
722 return buffer;
never executed: return buffer;
0
723}-
724-
725template<QtPixelOrder PixelOrder>-
726static const uint *QT_FASTCALL convertRGB30FromARGB32PM(uint *buffer, const uint *src, int count,-
727 const QPixelLayout *, const QRgb *)-
728{-
729 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
730 buffer[i] = qConvertRgb32ToRgb30<PixelOrder>(qUnpremultiply(src[i]));
never executed: buffer[i] = qConvertRgb32ToRgb30<PixelOrder>(qUnpremultiply(src[i]));
0
731 return buffer;
never executed: return buffer;
0
732}-
733-
734static const uint *QT_FASTCALL convertAlpha8FromARGB32PM(uint *buffer, const uint *src, int count,-
735 const QPixelLayout *, const QRgb *)-
736{-
737 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
738 buffer[i] = qAlpha(src[i]);
never executed: buffer[i] = qAlpha(src[i]);
0
739 return buffer;
never executed: return buffer;
0
740}-
741-
742static const uint *QT_FASTCALL convertGrayscale8FromRGB32(uint *buffer, const uint *src, int count,-
743 const QPixelLayout *, const QRgb *)-
744{-
745 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
746 buffer[i] = qGray(src[i]);
never executed: buffer[i] = qGray(src[i]);
0
747 return buffer;
never executed: return buffer;
0
748}-
749-
750static const uint *QT_FASTCALL convertGrayscale8FromARGB32PM(uint *buffer, const uint *src, int count,-
751 const QPixelLayout *, const QRgb *)-
752{-
753 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
754 buffer[i] = qGray(qUnpremultiply(src[i]));
never executed: buffer[i] = qGray(qUnpremultiply(src[i]));
0
755 return buffer;
never executed: return buffer;
0
756}-
757-
758template <QPixelLayout::BPP bpp> static-
759uint QT_FASTCALL fetchPixel(const uchar *src, int index);-
760-
761template <>-
762inline uint QT_FASTCALL fetchPixel<QPixelLayout::BPP1LSB>(const uchar *src, int index)-
763{-
764 return (src[index >> 3] >> (index & 7)) & 1;
never executed: return (src[index >> 3] >> (index & 7)) & 1;
0
765}-
766-
767template <>-
768inline uint QT_FASTCALL fetchPixel<QPixelLayout::BPP1MSB>(const uchar *src, int index)-
769{-
770 return (src[index >> 3] >> (~index & 7)) & 1;
never executed: return (src[index >> 3] >> (~index & 7)) & 1;
0
771}-
772-
773template <>-
774inline uint QT_FASTCALL fetchPixel<QPixelLayout::BPP8>(const uchar *src, int index)-
775{-
776 return src[index];
never executed: return src[index];
0
777}-
778-
779template <>-
780inline uint QT_FASTCALL fetchPixel<QPixelLayout::BPP16>(const uchar *src, int index)-
781{-
782 return reinterpret_cast<const quint16 *>(src)[index];
never executed: return reinterpret_cast<const quint16 *>(src)[index];
0
783}-
784-
785template <>-
786inline uint QT_FASTCALL fetchPixel<QPixelLayout::BPP24>(const uchar *src, int index)-
787{-
788 return reinterpret_cast<const quint24 *>(src)[index];
never executed: return reinterpret_cast<const quint24 *>(src)[index];
0
789}-
790-
791template <>-
792inline uint QT_FASTCALL fetchPixel<QPixelLayout::BPP32>(const uchar *src, int index)-
793{-
794 return reinterpret_cast<const uint *>(src)[index];
never executed: return reinterpret_cast<const uint *>(src)[index];
0
795}-
796-
797template <QPixelLayout::BPP bpp>-
798inline const uint *QT_FASTCALL fetchPixels(uint *buffer, const uchar *src, int index, int count)-
799{-
800 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
801 buffer[i] = fetchPixel<bpp>(src, index + i);
never executed: buffer[i] = fetchPixel<bpp>(src, index + i);
0
802 return buffer;
never executed: return buffer;
0
803}-
804-
805template <>-
806inline const uint *QT_FASTCALL fetchPixels<QPixelLayout::BPP32>(uint *, const uchar *src, int index, int)-
807{-
808 return reinterpret_cast<const uint *>(src) + index;
never executed: return reinterpret_cast<const uint *>(src) + index;
0
809}-
810-
811template <QPixelLayout::BPP width> static-
812void QT_FASTCALL storePixel(uchar *dest, int index, uint pixel);-
813-
814template <>-
815inline void QT_FASTCALL storePixel<QPixelLayout::BPP1LSB>(uchar *dest, int index, uint pixel)-
816{-
817 if (pixel)
pixelDescription
TRUEnever evaluated
FALSEnever evaluated
0
818 dest[index >> 3] |= 1 << (index & 7);
never executed: dest[index >> 3] |= 1 << (index & 7);
0
819 else-
820 dest[index >> 3] &= ~(1 << (index & 7));
never executed: dest[index >> 3] &= ~(1 << (index & 7));
0
821}-
822-
823template <>-
824inline void QT_FASTCALL storePixel<QPixelLayout::BPP1MSB>(uchar *dest, int index, uint pixel)-
825{-
826 if (pixel)
pixelDescription
TRUEnever evaluated
FALSEnever evaluated
0
827 dest[index >> 3] |= 1 << (~index & 7);
never executed: dest[index >> 3] |= 1 << (~index & 7);
0
828 else-
829 dest[index >> 3] &= ~(1 << (~index & 7));
never executed: dest[index >> 3] &= ~(1 << (~index & 7));
0
830}-
831-
832template <>-
833inline void QT_FASTCALL storePixel<QPixelLayout::BPP8>(uchar *dest, int index, uint pixel)-
834{-
835 dest[index] = uchar(pixel);-
836}
never executed: end of block
0
837-
838template <>-
839inline void QT_FASTCALL storePixel<QPixelLayout::BPP16>(uchar *dest, int index, uint pixel)-
840{-
841 reinterpret_cast<quint16 *>(dest)[index] = quint16(pixel);-
842}
never executed: end of block
0
843-
844template <>-
845inline void QT_FASTCALL storePixel<QPixelLayout::BPP24>(uchar *dest, int index, uint pixel)-
846{-
847 reinterpret_cast<quint24 *>(dest)[index] = quint24(pixel);-
848}
never executed: end of block
0
849-
850template <QPixelLayout::BPP width>-
851inline void QT_FASTCALL storePixels(uchar *dest, const uint *src, int index, int count)-
852{-
853 for (int i = 0; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
854 storePixel<width>(dest, index + i, src[i]);
never executed: storePixel<width>(dest, index + i, src[i]);
0
855}
never executed: end of block
0
856-
857template <>-
858inline void QT_FASTCALL storePixels<QPixelLayout::BPP32>(uchar *dest, const uint *src, int index, int count)-
859{-
860 memcpy(reinterpret_cast<uint *>(dest) + index, src, count * sizeof(uint));-
861}
never executed: end of block
0
862-
863// Note:-
864// convertToArgb32() assumes that no color channel is less than 4 bits.-
865// convertFromArgb32() assumes that no color channel is more than 8 bits.-
866// QImage::rgbSwapped() assumes that the red and blue color channels have the same number of bits.-
867QPixelLayout qPixelLayouts[QImage::NImageFormats] = {-
868 { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPPNone, 0, 0, 0, 0 }, // Format_Invalid-
869 { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP1MSB, convertIndexedToARGB32PM, 0, 0, convertIndexedToARGB64PM }, // Format_Mono-
870 { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP1LSB, convertIndexedToARGB32PM, 0, 0, convertIndexedToARGB64PM }, // Format_MonoLSB-
871 { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP8, convertIndexedToARGB32PM, 0, 0, convertIndexedToARGB64PM }, // Format_Indexed8-
872 // Technically using convertPassThrough to convert from ARGB32PM to RGB32 is wrong,-
873 // but everywhere this generic conversion would be wrong is currently overloaded.-
874 { 8, 16, 8, 8, 8, 0, 0, 0, false, QPixelLayout::BPP32, convertPassThrough, convertPassThrough, convertPassThrough, convertRGB32ToRGB64 }, // Format_RGB32-
875 { 8, 16, 8, 8, 8, 0, 8, 24, false, QPixelLayout::BPP32, convertARGB32ToARGB32PM, convertARGB32FromARGB32PM, convertPassThrough, convertARGB32ToARGB64PM }, // Format_ARGB32-
876 { 8, 16, 8, 8, 8, 0, 8, 24, true, QPixelLayout::BPP32, convertPassThrough, convertPassThrough, convertPassThrough, convertARGB32PMToARGB64PM }, // Format_ARGB32_Premultiplied-
877#ifdef Q_COMPILER_CONSTEXPR-
878 pixelLayoutRGB<QImage::Format_RGB16>(),-
879 pixelLayoutARGBPM<QImage::Format_ARGB8565_Premultiplied>(),-
880 pixelLayoutRGB<QImage::Format_RGB666>(),-
881 pixelLayoutARGBPM<QImage::Format_ARGB6666_Premultiplied>(),-
882 pixelLayoutRGB<QImage::Format_RGB555>(),-
883 pixelLayoutARGBPM<QImage::Format_ARGB8555_Premultiplied>(),-
884 pixelLayoutRGB<QImage::Format_RGB888>(),-
885 pixelLayoutRGB<QImage::Format_RGB444>(),-
886 pixelLayoutARGBPM<QImage::Format_ARGB4444_Premultiplied>(),-
887#else-
888 { 5, 11, 6, 5, 5, 0, 0, 0, false, QPixelLayout::BPP16,-
889 convertToRGB32<QImage::Format_RGB16>,-
890 convertRGBFromARGB32PM<QImage::Format_RGB16, false>,-
891 convertRGBFromARGB32PM<QImage::Format_RGB16, true>,-
892 convertToRGB64<QImage::Format_RGB16>,-
893 },-
894 { 5, 19, 6, 13, 5, 8, 8, 0, true, QPixelLayout::BPP24,-
895 convertARGBPMToARGB32PM<QImage::Format_ARGB8565_Premultiplied>,-
896 convertARGBPMFromARGB32PM<QImage::Format_ARGB8565_Premultiplied, false>,-
897 convertARGBPMFromARGB32PM<QImage::Format_ARGB8565_Premultiplied, true>,-
898 convertARGBPMToARGB64PM<QImage::Format_ARGB8565_Premultiplied>,-
899 },-
900 { 6, 12, 6, 6, 6, 0, 0, 0, false, QPixelLayout::BPP24,-
901 convertToRGB32<QImage::Format_RGB666>,-
902 convertRGBFromARGB32PM<QImage::Format_RGB666, false>,-
903 convertRGBFromARGB32PM<QImage::Format_RGB666, true>,-
904 convertToRGB64<QImage::Format_RGB666>,-
905 },-
906 { 6, 12, 6, 6, 6, 0, 6, 18, true, QPixelLayout::BPP24,-
907 convertARGBPMToARGB32PM<QImage::Format_ARGB6666_Premultiplied>,-
908 convertARGBPMFromARGB32PM<QImage::Format_ARGB6666_Premultiplied, false>,-
909 convertARGBPMFromARGB32PM<QImage::Format_ARGB6666_Premultiplied, true>,-
910 convertARGBPMToARGB64PM<QImage::Format_ARGB6666_Premultiplied>,-
911 },-
912 { 5, 10, 5, 5, 5, 0, 0, 0, false, QPixelLayout::BPP16,-
913 convertToRGB32<QImage::Format_RGB555>,-
914 convertRGBFromARGB32PM<QImage::Format_RGB555, false>,-
915 convertRGBFromARGB32PM<QImage::Format_RGB555, true>,-
916 convertToRGB64<QImage::Format_RGB555>,-
917 },-
918 { 5, 18, 5, 13, 5, 8, 8, 0, true, QPixelLayout::BPP24,-
919 convertARGBPMToARGB32PM<QImage::Format_ARGB8555_Premultiplied>,-
920 convertARGBPMFromARGB32PM<QImage::Format_ARGB8555_Premultiplied, false>,-
921 convertARGBPMFromARGB32PM<QImage::Format_ARGB8555_Premultiplied, true>,-
922 convertARGBPMToARGB64PM<QImage::Format_ARGB8555_Premultiplied>,-
923 },-
924 { 8, 16, 8, 8, 8, 0, 0, 0, false, QPixelLayout::BPP24,-
925 convertToRGB32<QImage::Format_RGB888>,-
926 convertRGBFromARGB32PM<QImage::Format_RGB888, false>,-
927 convertRGBFromARGB32PM<QImage::Format_RGB888, true>,-
928 convertToRGB64<QImage::Format_RGB888>,-
929 },-
930 { 4, 8, 4, 4, 4, 0, 0, 0, false, QPixelLayout::BPP16,-
931 convertToRGB32<QImage::Format_RGB444>,-
932 convertRGBFromARGB32PM<QImage::Format_RGB444, false>,-
933 convertRGBFromARGB32PM<QImage::Format_RGB444, true>,-
934 convertToRGB64<QImage::Format_RGB444>,-
935 },-
936 { 4, 8, 4, 4, 4, 0, 4, 12, true, QPixelLayout::BPP16,-
937 convertARGBPMToARGB32PM<QImage::Format_ARGB4444_Premultiplied>,-
938 convertARGBPMFromARGB32PM<QImage::Format_ARGB4444_Premultiplied, false>,-
939 convertARGBPMFromARGB32PM<QImage::Format_ARGB4444_Premultiplied, true>,-
940 convertARGBPMToARGB64PM<QImage::Format_ARGB4444_Premultiplied>,-
941 },-
942#endif-
943#if Q_BYTE_ORDER == Q_BIG_ENDIAN-
944 { 8, 24, 8, 16, 8, 8, 0, 0, false, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBXFromARGB32PM, convertRGBXFromRGB32, convertRGBA8888PMToARGB64PM }, // Format_RGBX8888-
945 { 8, 24, 8, 16, 8, 8, 8, 0, false, QPixelLayout::BPP32, convertRGBA8888ToARGB32PM, convertRGBA8888FromARGB32PM, convertRGBXFromRGB32, convertRGBA8888ToARGB64PM }, // Format_RGBA8888-
946 { 8, 24, 8, 16, 8, 8, 8, 0, true, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBA8888PMFromARGB32PM, convertRGBXFromRGB32, convertRGBA8888PMToARGB64PM}, // Format_RGBA8888_Premultiplied-
947#else-
948 { 8, 0, 8, 8, 8, 16, 0, 24, false, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBXFromARGB32PM, convertRGBXFromRGB32, convertRGBA8888PMToARGB64PM }, // Format_RGBX8888-
949 { 8, 0, 8, 8, 8, 16, 8, 24, false, QPixelLayout::BPP32, convertRGBA8888ToARGB32PM, convertRGBA8888FromARGB32PM, convertRGBXFromRGB32, convertRGBA8888ToARGB64PM }, // Format_RGBA8888 (ABGR32)-
950 { 8, 0, 8, 8, 8, 16, 8, 24, true, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBA8888PMFromARGB32PM, convertRGBXFromRGB32, convertRGBA8888PMToARGB64PM }, // Format_RGBA8888_Premultiplied-
951#endif-
952 { 10, 20, 10, 10, 10, 0, 0, 30, false, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderBGR>, convertRGB30FromARGB32PM<PixelOrderBGR>, convertRGB30FromRGB32<PixelOrderBGR>, convertA2RGB30PMToARGB64PM<PixelOrderBGR> }, // Format_BGR30-
953 { 10, 20, 10, 10, 10, 0, 2, 30, true, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderBGR>, convertA2RGB30PMFromARGB32PM<PixelOrderBGR>, convertRGB30FromRGB32<PixelOrderBGR>, convertA2RGB30PMToARGB64PM<PixelOrderBGR> }, // Format_A2BGR30_Premultiplied-
954 { 10, 0, 10, 10, 10, 20, 0, 30, false, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderRGB>, convertRGB30FromARGB32PM<PixelOrderRGB>, convertRGB30FromRGB32<PixelOrderRGB>, convertA2RGB30PMToARGB64PM<PixelOrderRGB> }, // Format_RGB30-
955 { 10, 0, 10, 10, 10, 20, 2, 30, true, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderRGB>, convertA2RGB30PMFromARGB32PM<PixelOrderRGB>, convertRGB30FromRGB32<PixelOrderRGB>, convertA2RGB30PMToARGB64PM<PixelOrderRGB> }, // Format_A2RGB30_Premultiplied-
956 { 0, 0, 0, 0, 0, 0, 8, 0, false, QPixelLayout::BPP8, convertAlpha8ToRGB32, convertAlpha8FromARGB32PM, 0, convertAlpha8ToRGB64 }, // Format_Alpha8-
957 { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP8, convertGrayscale8ToRGB32, convertGrayscale8FromARGB32PM, convertGrayscale8FromRGB32, convertGrayscale8ToRGB64 } // Format_Grayscale8-
958};-
959-
960const FetchPixelsFunc qFetchPixels[QPixelLayout::BPPCount] = {-
961 0, // BPPNone-
962 fetchPixels<QPixelLayout::BPP1MSB>, // BPP1MSB-
963 fetchPixels<QPixelLayout::BPP1LSB>, // BPP1LSB-
964 fetchPixels<QPixelLayout::BPP8>, // BPP8-
965 fetchPixels<QPixelLayout::BPP16>, // BPP16-
966 fetchPixels<QPixelLayout::BPP24>, // BPP24-
967 fetchPixels<QPixelLayout::BPP32> // BPP32-
968};-
969-
970StorePixelsFunc qStorePixels[QPixelLayout::BPPCount] = {-
971 0, // BPPNone-
972 storePixels<QPixelLayout::BPP1MSB>, // BPP1MSB-
973 storePixels<QPixelLayout::BPP1LSB>, // BPP1LSB-
974 storePixels<QPixelLayout::BPP8>, // BPP8-
975 storePixels<QPixelLayout::BPP16>, // BPP16-
976 storePixels<QPixelLayout::BPP24>, // BPP24-
977 storePixels<QPixelLayout::BPP32> // BPP32-
978};-
979-
980typedef uint (QT_FASTCALL *FetchPixelFunc)(const uchar *src, int index);-
981-
982static const FetchPixelFunc qFetchPixel[QPixelLayout::BPPCount] = {-
983 0, // BPPNone-
984 fetchPixel<QPixelLayout::BPP1MSB>, // BPP1MSB-
985 fetchPixel<QPixelLayout::BPP1LSB>, // BPP1LSB-
986 fetchPixel<QPixelLayout::BPP8>, // BPP8-
987 fetchPixel<QPixelLayout::BPP16>, // BPP16-
988 fetchPixel<QPixelLayout::BPP24>, // BPP24-
989 fetchPixel<QPixelLayout::BPP32> // BPP32-
990};-
991-
992/*-
993 Destination fetch. This is simple as we don't have to do bounds checks or-
994 transformations-
995*/-
996-
997static uint * QT_FASTCALL destFetchMono(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)-
998{-
999 uchar *Q_DECL_RESTRICT data = (uchar *)rasterBuffer->scanLine(y);-
1000 uint *start = buffer;-
1001 const uint *end = buffer + length;-
1002 while (buffer < end) {
buffer < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
1003 *buffer = data[x>>3] & (0x80 >> (x & 7)) ? rasterBuffer->destColor1 : rasterBuffer->destColor0;
data[x>>3] & (0x80 >> (x & 7))Description
TRUEnever evaluated
FALSEnever evaluated
0
1004 ++buffer;-
1005 ++x;-
1006 }
never executed: end of block
0
1007 return start;
never executed: return start;
0
1008}-
1009-
1010static uint * QT_FASTCALL destFetchMonoLsb(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)-
1011{-
1012 uchar *Q_DECL_RESTRICT data = (uchar *)rasterBuffer->scanLine(y);-
1013 uint *start = buffer;-
1014 const uint *end = buffer + length;-
1015 while (buffer < end) {
buffer < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
1016 *buffer = data[x>>3] & (0x1 << (x & 7)) ? rasterBuffer->destColor1 : rasterBuffer->destColor0;
data[x>>3] & (0x1 << (x & 7))Description
TRUEnever evaluated
FALSEnever evaluated
0
1017 ++buffer;-
1018 ++x;-
1019 }
never executed: end of block
0
1020 return start;
never executed: return start;
0
1021}-
1022-
1023static uint * QT_FASTCALL destFetchARGB32P(uint *, QRasterBuffer *rasterBuffer, int x, int y, int)-
1024{-
1025 return (uint *)rasterBuffer->scanLine(y) + x;
never executed: return (uint *)rasterBuffer->scanLine(y) + x;
0
1026}-
1027-
1028static uint * QT_FASTCALL destFetchRGB16(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)-
1029{-
1030 const ushort *Q_DECL_RESTRICT data = (const ushort *)rasterBuffer->scanLine(y) + x;-
1031 for (int i = 0; i < length; ++i)
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1032 buffer[i] = qConvertRgb16To32(data[i]);
never executed: buffer[i] = qConvertRgb16To32(data[i]);
0
1033 return buffer;
never executed: return buffer;
0
1034}-
1035-
1036static uint *QT_FASTCALL destFetch(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)-
1037{-
1038 const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format];-
1039 const uint *ptr = qFetchPixels[layout->bpp](buffer, rasterBuffer->scanLine(y), x, length);-
1040 return const_cast<uint *>(layout->convertToARGB32PM(buffer, ptr, length, layout, 0));
never executed: return const_cast<uint *>(layout->convertToARGB32PM(buffer, ptr, length, layout, 0));
0
1041}-
1042-
1043static QRgba64 *QT_FASTCALL destFetch64(QRgba64 *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)-
1044{-
1045 const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format];-
1046 uint buffer32[buffer_size];-
1047 const uint *ptr = qFetchPixels[layout->bpp](buffer32, rasterBuffer->scanLine(y), x, length);-
1048 return const_cast<QRgba64 *>(layout->convertToARGB64PM(buffer, ptr, length, layout, 0));
never executed: return const_cast<QRgba64 *>(layout->convertToARGB64PM(buffer, ptr, length, layout, 0));
0
1049}-
1050-
1051static QRgba64 *QT_FASTCALL destFetch64uint32(QRgba64 *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)-
1052{-
1053 const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format];-
1054 const uint *src = ((const uint *)rasterBuffer->scanLine(y)) + x;-
1055 return const_cast<QRgba64 *>(layout->convertToARGB64PM(buffer, src, length, layout, 0));
never executed: return const_cast<QRgba64 *>(layout->convertToARGB64PM(buffer, src, length, layout, 0));
0
1056}-
1057-
1058static DestFetchProc destFetchProc[QImage::NImageFormats] =-
1059{-
1060 0, // Format_Invalid-
1061 destFetchMono, // Format_Mono,-
1062 destFetchMonoLsb, // Format_MonoLSB-
1063 0, // Format_Indexed8-
1064 destFetchARGB32P, // Format_RGB32-
1065 destFetch, // Format_ARGB32,-
1066 destFetchARGB32P, // Format_ARGB32_Premultiplied-
1067 destFetchRGB16, // Format_RGB16-
1068 destFetch, // Format_ARGB8565_Premultiplied-
1069 destFetch, // Format_RGB666-
1070 destFetch, // Format_ARGB6666_Premultiplied-
1071 destFetch, // Format_RGB555-
1072 destFetch, // Format_ARGB8555_Premultiplied-
1073 destFetch, // Format_RGB888-
1074 destFetch, // Format_RGB444-
1075 destFetch, // Format_ARGB4444_Premultiplied-
1076 destFetch, // Format_RGBX8888-
1077 destFetch, // Format_RGBA8888-
1078 destFetch, // Format_RGBA8888_Premultiplied-
1079 destFetch, // Format_BGR30-
1080 destFetch, // Format_A2BGR30_Premultiplied-
1081 destFetch, // Format_RGB30-
1082 destFetch, // Format_A2RGB30_Premultiplied-
1083 destFetch, // Format_Alpha8-
1084 destFetch, // Format_Grayscale8-
1085};-
1086-
1087static DestFetchProc64 destFetchProc64[QImage::NImageFormats] =-
1088{-
1089 0, // Format_Invalid-
1090 destFetch64, // Format_Mono,-
1091 destFetch64, // Format_MonoLSB-
1092 0, // Format_Indexed8-
1093 destFetch64uint32, // Format_RGB32-
1094 destFetch64uint32, // Format_ARGB32,-
1095 destFetch64uint32, // Format_ARGB32_Premultiplied-
1096 destFetch64, // Format_RGB16-
1097 destFetch64, // Format_ARGB8565_Premultiplied-
1098 destFetch64, // Format_RGB666-
1099 destFetch64, // Format_ARGB6666_Premultiplied-
1100 destFetch64, // Format_RGB555-
1101 destFetch64, // Format_ARGB8555_Premultiplied-
1102 destFetch64, // Format_RGB888-
1103 destFetch64, // Format_RGB444-
1104 destFetch64, // Format_ARGB4444_Premultiplied-
1105 destFetch64uint32, // Format_RGBX8888-
1106 destFetch64uint32, // Format_RGBA8888-
1107 destFetch64uint32, // Format_RGBA8888_Premultiplied-
1108 destFetch64uint32, // Format_BGR30-
1109 destFetch64uint32, // Format_A2BGR30_Premultiplied-
1110 destFetch64uint32, // Format_RGB30-
1111 destFetch64uint32, // Format_A2RGB30_Premultiplied-
1112 destFetch64, // Format_Alpha8-
1113 destFetch64, // Format_Grayscale8-
1114};-
1115-
1116/*-
1117 Returns the color in the mono destination color table-
1118 that is the "nearest" to /color/.-
1119*/-
1120static inline QRgb findNearestColor(QRgb color, QRasterBuffer *rbuf)-
1121{-
1122 QRgb color_0 = qPremultiply(rbuf->destColor0);-
1123 QRgb color_1 = qPremultiply(rbuf->destColor1);-
1124 color = qPremultiply(color);-
1125-
1126 int r = qRed(color);-
1127 int g = qGreen(color);-
1128 int b = qBlue(color);-
1129 int rx, gx, bx;-
1130 int dist_0, dist_1;-
1131-
1132 rx = r - qRed(color_0);-
1133 gx = g - qGreen(color_0);-
1134 bx = b - qBlue(color_0);-
1135 dist_0 = rx*rx + gx*gx + bx*bx;-
1136-
1137 rx = r - qRed(color_1);-
1138 gx = g - qGreen(color_1);-
1139 bx = b - qBlue(color_1);-
1140 dist_1 = rx*rx + gx*gx + bx*bx;-
1141-
1142 if (dist_0 < dist_1)
dist_0 < dist_1Description
TRUEnever evaluated
FALSEnever evaluated
0
1143 return color_0;
never executed: return color_0;
0
1144 return color_1;
never executed: return color_1;
0
1145}-
1146-
1147/*-
1148 Destination store.-
1149*/-
1150-
1151static void QT_FASTCALL destStoreMono(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length)-
1152{-
1153 uchar *Q_DECL_RESTRICT data = (uchar *)rasterBuffer->scanLine(y);-
1154 if (rasterBuffer->monoDestinationWithClut) {
rasterBuffer->...nationWithClutDescription
TRUEnever evaluated
FALSEnever evaluated
0
1155 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1156 if (buffer[i] == rasterBuffer->destColor0) {
buffer[i] == r...er->destColor0Description
TRUEnever evaluated
FALSEnever evaluated
0
1157 data[x >> 3] &= ~(0x80 >> (x & 7));-
1158 } else if (buffer[i] == rasterBuffer->destColor1) {
never executed: end of block
buffer[i] == r...er->destColor1Description
TRUEnever evaluated
FALSEnever evaluated
0
1159 data[x >> 3] |= 0x80 >> (x & 7);-
1160 } else if (findNearestColor(buffer[i], rasterBuffer) == rasterBuffer->destColor0) {
never executed: end of block
findNearestCol...er->destColor0Description
TRUEnever evaluated
FALSEnever evaluated
0
1161 data[x >> 3] &= ~(0x80 >> (x & 7));-
1162 } else {
never executed: end of block
0
1163 data[x >> 3] |= 0x80 >> (x & 7);-
1164 }
never executed: end of block
0
1165 ++x;-
1166 }
never executed: end of block
0
1167 } else {
never executed: end of block
0
1168 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1169 if (qGray(buffer[i]) < int(qt_bayer_matrix[y & 15][x & 15]))
qGray(buffer[i...& 15][x & 15])Description
TRUEnever evaluated
FALSEnever evaluated
0
1170 data[x >> 3] |= 0x80 >> (x & 7);
never executed: data[x >> 3] |= 0x80 >> (x & 7);
0
1171 else-
1172 data[x >> 3] &= ~(0x80 >> (x & 7));
never executed: data[x >> 3] &= ~(0x80 >> (x & 7));
0
1173 ++x;-
1174 }
never executed: end of block
0
1175 }
never executed: end of block
0
1176}-
1177-
1178static void QT_FASTCALL destStoreMonoLsb(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length)-
1179{-
1180 uchar *Q_DECL_RESTRICT data = (uchar *)rasterBuffer->scanLine(y);-
1181 if (rasterBuffer->monoDestinationWithClut) {
rasterBuffer->...nationWithClutDescription
TRUEnever evaluated
FALSEnever evaluated
0
1182 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1183 if (buffer[i] == rasterBuffer->destColor0) {
buffer[i] == r...er->destColor0Description
TRUEnever evaluated
FALSEnever evaluated
0
1184 data[x >> 3] &= ~(1 << (x & 7));-
1185 } else if (buffer[i] == rasterBuffer->destColor1) {
never executed: end of block
buffer[i] == r...er->destColor1Description
TRUEnever evaluated
FALSEnever evaluated
0
1186 data[x >> 3] |= 1 << (x & 7);-
1187 } else if (findNearestColor(buffer[i], rasterBuffer) == rasterBuffer->destColor0) {
never executed: end of block
findNearestCol...er->destColor0Description
TRUEnever evaluated
FALSEnever evaluated
0
1188 data[x >> 3] &= ~(1 << (x & 7));-
1189 } else {
never executed: end of block
0
1190 data[x >> 3] |= 1 << (x & 7);-
1191 }
never executed: end of block
0
1192 ++x;-
1193 }
never executed: end of block
0
1194 } else {
never executed: end of block
0
1195 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1196 if (qGray(buffer[i]) < int(qt_bayer_matrix[y & 15][x & 15]))
qGray(buffer[i...& 15][x & 15])Description
TRUEnever evaluated
FALSEnever evaluated
0
1197 data[x >> 3] |= 1 << (x & 7);
never executed: data[x >> 3] |= 1 << (x & 7);
0
1198 else-
1199 data[x >> 3] &= ~(1 << (x & 7));
never executed: data[x >> 3] &= ~(1 << (x & 7));
0
1200 ++x;-
1201 }
never executed: end of block
0
1202 }
never executed: end of block
0
1203}-
1204-
1205static void QT_FASTCALL destStoreRGB16(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length)-
1206{-
1207 quint16 *data = (quint16*)rasterBuffer->scanLine(y) + x;-
1208 for (int i = 0; i < length; ++i)
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1209 data[i] = qConvertRgb32To16(buffer[i]);
never executed: data[i] = qConvertRgb32To16(buffer[i]);
0
1210}
never executed: end of block
0
1211-
1212static void QT_FASTCALL destStore(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length)-
1213{-
1214 uint buf[buffer_size];-
1215 const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format];-
1216 StorePixelsFunc store = qStorePixels[layout->bpp];-
1217 uchar *dest = rasterBuffer->scanLine(y);-
1218 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1219 int l = qMin(length, buffer_size);-
1220 const uint *ptr = 0;-
1221 if (!layout->premultiplied && !layout->alphaWidth)
!layout->premultipliedDescription
TRUEnever evaluated
FALSEnever evaluated
!layout->alphaWidthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1222 ptr = layout->convertFromRGB32(buf, buffer, l, layout, 0);
never executed: ptr = layout->convertFromRGB32(buf, buffer, l, layout, 0);
0
1223 else-
1224 ptr = layout->convertFromARGB32PM(buf, buffer, l, layout, 0);
never executed: ptr = layout->convertFromARGB32PM(buf, buffer, l, layout, 0);
0
1225 store(dest, ptr, x, l);-
1226 length -= l;-
1227 buffer += l;-
1228 x += l;-
1229 }
never executed: end of block
0
1230}
never executed: end of block
0
1231-
1232static void QT_FASTCALL convertFromRgb64(uint *dest, const QRgba64 *src, int length)-
1233{-
1234 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1235 dest[i] = src[i].toArgb32();-
1236 }
never executed: end of block
0
1237}
never executed: end of block
0
1238-
1239static void QT_FASTCALL destStore64(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length)-
1240{-
1241 uint buf[buffer_size];-
1242 const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format];-
1243 StorePixelsFunc store = qStorePixels[layout->bpp];-
1244 uchar *dest = rasterBuffer->scanLine(y);-
1245 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1246 int l = qMin(length, buffer_size);-
1247 const uint *ptr = 0;-
1248 convertFromRgb64(buf, buffer, l);-
1249 if (!layout->premultiplied && !layout->alphaWidth)
!layout->premultipliedDescription
TRUEnever evaluated
FALSEnever evaluated
!layout->alphaWidthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1250 ptr = layout->convertFromRGB32(buf, buf, l, layout, 0);
never executed: ptr = layout->convertFromRGB32(buf, buf, l, layout, 0);
0
1251 else-
1252 ptr = layout->convertFromARGB32PM(buf, buf, l, layout, 0);
never executed: ptr = layout->convertFromARGB32PM(buf, buf, l, layout, 0);
0
1253 store(dest, ptr, x, l);-
1254 length -= l;-
1255 buffer += l;-
1256 x += l;-
1257 }
never executed: end of block
0
1258}
never executed: end of block
0
1259-
1260#ifdef __SSE2__-
1261template<QtPixelOrder PixelOrder>-
1262static inline void qConvertARGB64PMToA2RGB30PM_sse2(uint *dest, const QRgba64 *buffer, int count)-
1263{-
1264 const __m128i gmask = _mm_set1_epi32(0x000ffc00);-
1265 const __m128i cmask = _mm_set1_epi32(0x000003ff);-
1266 int i = 0;-
1267 __m128i vr, vg, vb, va;-
1268 for (; i < count && (const uintptr_t)buffer & 0xF; ++i) {
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
(const uintptr_t)buffer & 0xFDescription
TRUEnever evaluated
FALSEnever evaluated
0
1269 *dest++ = qConvertRgb64ToRgb30<PixelOrder>(*buffer++);-
1270 }
never executed: end of block
0
1271-
1272 for (; i < count-15; i += 16) {
i < count-15Description
TRUEnever evaluated
FALSEnever evaluated
0
1273 // Repremultiplying is really expensive and hard to do in SIMD without AVX2,-
1274 // so we try to avoid it by checking if it is needed 16 samples at a time.-
1275 __m128i vOr = _mm_set1_epi32(0);-
1276 __m128i vAnd = _mm_set1_epi32(0xffffffff);-
1277 for (int j = 0; j < 16; j += 2) {
j < 16Description
TRUEnever evaluated
FALSEnever evaluated
0
1278 __m128i vs = _mm_load_si128((const __m128i*)(buffer + j));-
1279 vOr = _mm_or_si128(vOr, vs);-
1280 vAnd = _mm_and_si128(vAnd, vs);-
1281 }
never executed: end of block
0
1282 const quint16 orAlpha = ((uint)_mm_extract_epi16(vOr, 3)) | ((uint)_mm_extract_epi16(vOr, 7));-
1283 const quint16 andAlpha = ((uint)_mm_extract_epi16(vAnd, 3)) & ((uint)_mm_extract_epi16(vAnd, 7));-
1284-
1285 if (andAlpha == 0xffff) {
andAlpha == 0xffffDescription
TRUEnever evaluated
FALSEnever evaluated
0
1286 for (int j = 0; j < 16; j += 2) {
j < 16Description
TRUEnever evaluated
FALSEnever evaluated
0
1287 __m128i vs = _mm_load_si128((const __m128i*)buffer);-
1288 buffer += 2;-
1289 vr = _mm_srli_epi64(vs, 6);-
1290 vg = _mm_srli_epi64(vs, 16 + 6 - 10);-
1291 vb = _mm_srli_epi64(vs, 32 + 6);-
1292 vr = _mm_and_si128(vr, cmask);-
1293 vg = _mm_and_si128(vg, gmask);-
1294 vb = _mm_and_si128(vb, cmask);-
1295 va = _mm_srli_epi64(vs, 48 + 14);-
1296 if (PixelOrder == PixelOrderRGB)
PixelOrder == PixelOrderRGBDescription
TRUEnever evaluated
FALSEnever evaluated
0
1297 vr = _mm_slli_epi32(vr, 20);
never executed: vr = _mm_slli_epi32(vr, 20);
0
1298 else-
1299 vb = _mm_slli_epi32(vb, 20);
never executed: vb = _mm_slli_epi32(vb, 20);
0
1300 va = _mm_slli_epi32(va, 30);-
1301 __m128i vd = _mm_or_si128(_mm_or_si128(vr, vg), _mm_or_si128(vb, va));-
1302 vd = _mm_shuffle_epi32(vd, _MM_SHUFFLE(3, 1, 2, 0));-
1303 _mm_storel_epi64((__m128i*)dest, vd);-
1304 dest += 2;-
1305 }
never executed: end of block
0
1306 } else if (orAlpha == 0) {
never executed: end of block
orAlpha == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1307 for (int j = 0; j < 16; ++j) {
j < 16Description
TRUEnever evaluated
FALSEnever evaluated
0
1308 *dest++ = 0;-
1309 buffer++;-
1310 }
never executed: end of block
0
1311 } else {
never executed: end of block
0
1312 for (int j = 0; j < 16; ++j)
j < 16Description
TRUEnever evaluated
FALSEnever evaluated
0
1313 *dest++ = qConvertRgb64ToRgb30<PixelOrder>(*buffer++);
never executed: *dest++ = qConvertRgb64ToRgb30<PixelOrder>(*buffer++);
0
1314 }
never executed: end of block
0
1315 }-
1316-
1317 for (; i < count; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
1318 *dest++ = qConvertRgb64ToRgb30<PixelOrder>(*buffer++);
never executed: *dest++ = qConvertRgb64ToRgb30<PixelOrder>(*buffer++);
0
1319}
never executed: end of block
0
1320#endif-
1321-
1322static void QT_FASTCALL destStore64ARGB32(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length)-
1323{-
1324 uint *dest = (uint*)rasterBuffer->scanLine(y) + x;-
1325 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1326 dest[i] = buffer[i].unpremultiplied().toArgb32();-
1327 }
never executed: end of block
0
1328}
never executed: end of block
0
1329-
1330static void QT_FASTCALL destStore64RGBA8888(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length)-
1331{-
1332 uint *dest = (uint*)rasterBuffer->scanLine(y) + x;-
1333 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1334 dest[i] = ARGB2RGBA(buffer[i].unpremultiplied().toArgb32());-
1335 }
never executed: end of block
0
1336}
never executed: end of block
0
1337-
1338template<QtPixelOrder PixelOrder>-
1339static void QT_FASTCALL destStore64RGB30(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length)-
1340{-
1341 uint *dest = (uint*)rasterBuffer->scanLine(y) + x;-
1342#ifdef __SSE2__-
1343 qConvertARGB64PMToA2RGB30PM_sse2<PixelOrder>(dest, buffer, length);-
1344#else-
1345 for (int i = 0; i < length; ++i) {-
1346 dest[i] = qConvertRgb64ToRgb30<PixelOrder>(buffer[i]);-
1347 }-
1348#endif-
1349}
never executed: end of block
0
1350-
1351static DestStoreProc destStoreProc[QImage::NImageFormats] =-
1352{-
1353 0, // Format_Invalid-
1354 destStoreMono, // Format_Mono,-
1355 destStoreMonoLsb, // Format_MonoLSB-
1356 0, // Format_Indexed8-
1357 0, // Format_RGB32-
1358 destStore, // Format_ARGB32,-
1359 0, // Format_ARGB32_Premultiplied-
1360 destStoreRGB16, // Format_RGB16-
1361 destStore, // Format_ARGB8565_Premultiplied-
1362 destStore, // Format_RGB666-
1363 destStore, // Format_ARGB6666_Premultiplied-
1364 destStore, // Format_RGB555-
1365 destStore, // Format_ARGB8555_Premultiplied-
1366 destStore, // Format_RGB888-
1367 destStore, // Format_RGB444-
1368 destStore, // Format_ARGB4444_Premultiplied-
1369 destStore, // Format_RGBX8888-
1370 destStore, // Format_RGBA8888-
1371 destStore, // Format_RGBA8888_Premultiplied-
1372 destStore, // Format_BGR30-
1373 destStore, // Format_A2BGR30_Premultiplied-
1374 destStore, // Format_RGB30-
1375 destStore, // Format_A2RGB30_Premultiplied-
1376 destStore, // Format_Alpha8-
1377 destStore, // Format_Grayscale8-
1378};-
1379-
1380static DestStoreProc64 destStoreProc64[QImage::NImageFormats] =-
1381{-
1382 0, // Format_Invalid-
1383 destStore64, // Format_Mono,-
1384 destStore64, // Format_MonoLSB-
1385 0, // Format_Indexed8-
1386 destStore64, // Format_RGB32-
1387 destStore64ARGB32, // Format_ARGB32,-
1388 destStore64, // Format_ARGB32_Premultiplied-
1389 destStore64, // Format_RGB16-
1390 destStore64, // Format_ARGB8565_Premultiplied-
1391 destStore64, // Format_RGB666-
1392 destStore64, // Format_ARGB6666_Premultiplied-
1393 destStore64, // Format_RGB555-
1394 destStore64, // Format_ARGB8555_Premultiplied-
1395 destStore64, // Format_RGB888-
1396 destStore64, // Format_RGB444-
1397 destStore64, // Format_ARGB4444_Premultiplied-
1398 destStore64, // Format_RGBX8888-
1399 destStore64RGBA8888, // Format_RGBA8888-
1400 destStore64, // Format_RGBA8888_Premultiplied-
1401 destStore64RGB30<PixelOrderBGR>, // Format_BGR30-
1402 destStore64RGB30<PixelOrderBGR>, // Format_A2BGR30_Premultiplied-
1403 destStore64RGB30<PixelOrderRGB>, // Format_RGB30-
1404 destStore64RGB30<PixelOrderRGB>, // Format_A2RGB30_Premultiplied-
1405 destStore64, // Format_Alpha8-
1406 destStore64, // Format_Grayscale8-
1407};-
1408-
1409/*-
1410 Source fetches-
1411-
1412 This is a bit more complicated, as we need several fetch routines for every surface type-
1413-
1414 We need 5 fetch methods per surface type:-
1415 untransformed-
1416 transformed (tiled and not tiled)-
1417 transformed bilinear (tiled and not tiled)-
1418-
1419 We don't need bounds checks for untransformed, but we need them for the other ones.-
1420-
1421 The generic implementation does pixel by pixel fetches-
1422*/-
1423-
1424enum TextureBlendType {-
1425 BlendUntransformed,-
1426 BlendTiled,-
1427 BlendTransformed,-
1428 BlendTransformedTiled,-
1429 BlendTransformedBilinear,-
1430 BlendTransformedBilinearTiled,-
1431 NBlendTypes-
1432};-
1433-
1434static const uint *QT_FASTCALL fetchUntransformed(uint *buffer, const Operator *,-
1435 const QSpanData *data, int y, int x, int length)-
1436{-
1437 const QPixelLayout *layout = &qPixelLayouts[data->texture.format];-
1438 const uint *ptr = qFetchPixels[layout->bpp](buffer, data->texture.scanLine(y), x, length);-
1439 const QRgb *clut = data->texture.colorTable ? data->texture.colorTable->constData() : 0;
data->texture.colorTableDescription
TRUEnever evaluated
FALSEnever evaluated
0
1440 return layout->convertToARGB32PM(buffer, ptr, length, layout, clut);
never executed: return layout->convertToARGB32PM(buffer, ptr, length, layout, clut);
0
1441}-
1442-
1443static const uint *QT_FASTCALL fetchUntransformedARGB32PM(uint *, const Operator *,-
1444 const QSpanData *data, int y, int x, int)-
1445{-
1446 const uchar *scanLine = data->texture.scanLine(y);-
1447 return ((const uint *)scanLine) + x;
never executed: return ((const uint *)scanLine) + x;
0
1448}-
1449-
1450static const uint *QT_FASTCALL fetchUntransformedRGB16(uint *buffer, const Operator *,-
1451 const QSpanData *data, int y, int x,-
1452 int length)-
1453{-
1454 const quint16 *scanLine = (const quint16 *)data->texture.scanLine(y) + x;-
1455#ifdef QT_COMPILER_SUPPORTS_MIPS_DSPR2-
1456 qConvertRgb16To32_asm_mips_dspr2(buffer, scanLine, length);-
1457#else-
1458 for (int i = 0; i < length; ++i)
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1459 buffer[i] = qConvertRgb16To32(scanLine[i]);
never executed: buffer[i] = qConvertRgb16To32(scanLine[i]);
0
1460#endif-
1461 return buffer;
never executed: return buffer;
0
1462}-
1463-
1464static const QRgba64 *QT_FASTCALL fetchUntransformed64(QRgba64 *buffer, const Operator *,-
1465 const QSpanData *data, int y, int x, int length)-
1466{-
1467 const QPixelLayout *layout = &qPixelLayouts[data->texture.format];-
1468 const QRgb *clut = data->texture.colorTable ? data->texture.colorTable->constData() : 0;
data->texture.colorTableDescription
TRUEnever evaluated
FALSEnever evaluated
0
1469 if (layout->bpp != QPixelLayout::BPP32) {
layout->bpp !=...lLayout::BPP32Description
TRUEnever evaluated
FALSEnever evaluated
0
1470 uint buffer32[buffer_size];-
1471 const uint *ptr = qFetchPixels[layout->bpp](buffer32, data->texture.scanLine(y), x, length);-
1472 return layout->convertToARGB64PM(buffer, ptr, length, layout, clut);
never executed: return layout->convertToARGB64PM(buffer, ptr, length, layout, clut);
0
1473 } else {-
1474 const uint *src = (const uint *)data->texture.scanLine(y) + x;-
1475 return layout->convertToARGB64PM(buffer, src, length, layout, clut);
never executed: return layout->convertToARGB64PM(buffer, src, length, layout, clut);
0
1476 }-
1477}-
1478-
1479// blendType is either BlendTransformed or BlendTransformedTiled-
1480template<TextureBlendType blendType>-
1481static const uint *QT_FASTCALL fetchTransformedARGB32PM(uint *buffer, const Operator *, const QSpanData *data,-
1482 int y, int x, int length)-
1483{-
1484 int image_width = data->texture.width;-
1485 int image_height = data->texture.height;-
1486-
1487 const qreal cx = x + qreal(0.5);-
1488 const qreal cy = y + qreal(0.5);-
1489-
1490 const uint *end = buffer + length;-
1491 uint *b = buffer;-
1492 if (data->fast_matrix) {
data->fast_matrixDescription
TRUEnever evaluated
FALSEnever evaluated
0
1493 // The increment pr x in the scanline-
1494 int fdx = (int)(data->m11 * fixed_scale);-
1495 int fdy = (int)(data->m12 * fixed_scale);-
1496-
1497 int fx = int((data->m21 * cy-
1498 + data->m11 * cx + data->dx) * fixed_scale);-
1499 int fy = int((data->m22 * cy-
1500 + data->m12 * cx + data->dy) * fixed_scale);-
1501-
1502 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
1503 int px = fx >> 16;-
1504 int py = fy >> 16;-
1505-
1506 if (blendType == BlendTransformedTiled) {
blendType == B...ansformedTiledDescription
TRUEnever evaluated
FALSEnever evaluated
0
1507 px %= image_width;-
1508 py %= image_height;-
1509 if (px < 0) px += image_width;
never executed: px += image_width;
px < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1510 if (py < 0) py += image_height;
never executed: py += image_height;
py < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1511 } else {
never executed: end of block
0
1512 px = qBound(0, px, image_width - 1);-
1513 py = qBound(0, py, image_height - 1);-
1514 }
never executed: end of block
0
1515 *b = reinterpret_cast<const uint *>(data->texture.scanLine(py))[px];-
1516-
1517 fx += fdx;-
1518 fy += fdy;-
1519 ++b;-
1520 }
never executed: end of block
0
1521 } else {
never executed: end of block
0
1522 const qreal fdx = data->m11;-
1523 const qreal fdy = data->m12;-
1524 const qreal fdw = data->m13;-
1525-
1526 qreal fx = data->m21 * cy + data->m11 * cx + data->dx;-
1527 qreal fy = data->m22 * cy + data->m12 * cx + data->dy;-
1528 qreal fw = data->m23 * cy + data->m13 * cx + data->m33;-
1529-
1530 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
1531 const qreal iw = fw == 0 ? 1 : 1 / fw;-
1532 const qreal tx = fx * iw;-
1533 const qreal ty = fy * iw;-
1534 int px = int(tx) - (tx < 0);-
1535 int py = int(ty) - (ty < 0);-
1536-
1537 if (blendType == BlendTransformedTiled) {
blendType == B...ansformedTiledDescription
TRUEnever evaluated
FALSEnever evaluated
0
1538 px %= image_width;-
1539 py %= image_height;-
1540 if (px < 0) px += image_width;
never executed: px += image_width;
px < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1541 if (py < 0) py += image_height;
never executed: py += image_height;
py < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1542 } else {
never executed: end of block
0
1543 px = qBound(0, px, image_width - 1);-
1544 py = qBound(0, py, image_height - 1);-
1545 }
never executed: end of block
0
1546 *b = reinterpret_cast<const uint *>(data->texture.scanLine(py))[px];-
1547-
1548 fx += fdx;-
1549 fy += fdy;-
1550 fw += fdw;-
1551 //force increment to avoid /0-
1552 if (!fw) {
!fwDescription
TRUEnever evaluated
FALSEnever evaluated
0
1553 fw += fdw;-
1554 }
never executed: end of block
0
1555 ++b;-
1556 }
never executed: end of block
0
1557 }
never executed: end of block
0
1558 return buffer;
never executed: return buffer;
0
1559}-
1560-
1561template<TextureBlendType blendType> /* either BlendTransformed or BlendTransformedTiled */-
1562static const uint *QT_FASTCALL fetchTransformed(uint *buffer, const Operator *, const QSpanData *data,-
1563 int y, int x, int length)-
1564{-
1565 int image_width = data->texture.width;-
1566 int image_height = data->texture.height;-
1567-
1568 const qreal cx = x + qreal(0.5);-
1569 const qreal cy = y + qreal(0.5);-
1570-
1571 const QPixelLayout *layout = &qPixelLayouts[data->texture.format];-
1572 FetchPixelFunc fetch = qFetchPixel[layout->bpp];-
1573-
1574 const uint *end = buffer + length;-
1575 uint *b = buffer;-
1576 if (data->fast_matrix) {
data->fast_matrixDescription
TRUEnever evaluated
FALSEnever evaluated
0
1577 // The increment pr x in the scanline-
1578 int fdx = (int)(data->m11 * fixed_scale);-
1579 int fdy = (int)(data->m12 * fixed_scale);-
1580-
1581 int fx = int((data->m21 * cy-
1582 + data->m11 * cx + data->dx) * fixed_scale);-
1583 int fy = int((data->m22 * cy-
1584 + data->m12 * cx + data->dy) * fixed_scale);-
1585-
1586 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
1587 int px = fx >> 16;-
1588 int py = fy >> 16;-
1589-
1590 if (blendType == BlendTransformedTiled) {
blendType == B...ansformedTiledDescription
TRUEnever evaluated
FALSEnever evaluated
0
1591 px %= image_width;-
1592 py %= image_height;-
1593 if (px < 0) px += image_width;
never executed: px += image_width;
px < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1594 if (py < 0) py += image_height;
never executed: py += image_height;
py < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1595 } else {
never executed: end of block
0
1596 px = qBound(0, px, image_width - 1);-
1597 py = qBound(0, py, image_height - 1);-
1598 }
never executed: end of block
0
1599 *b = fetch(data->texture.scanLine(py), px);-
1600-
1601 fx += fdx;-
1602 fy += fdy;-
1603 ++b;-
1604 }
never executed: end of block
0
1605 } else {
never executed: end of block
0
1606 const qreal fdx = data->m11;-
1607 const qreal fdy = data->m12;-
1608 const qreal fdw = data->m13;-
1609-
1610 qreal fx = data->m21 * cy + data->m11 * cx + data->dx;-
1611 qreal fy = data->m22 * cy + data->m12 * cx + data->dy;-
1612 qreal fw = data->m23 * cy + data->m13 * cx + data->m33;-
1613-
1614 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
1615 const qreal iw = fw == 0 ? 1 : 1 / fw;-
1616 const qreal tx = fx * iw;-
1617 const qreal ty = fy * iw;-
1618 int px = int(tx) - (tx < 0);-
1619 int py = int(ty) - (ty < 0);-
1620-
1621 if (blendType == BlendTransformedTiled) {
blendType == B...ansformedTiledDescription
TRUEnever evaluated
FALSEnever evaluated
0
1622 px %= image_width;-
1623 py %= image_height;-
1624 if (px < 0) px += image_width;
never executed: px += image_width;
px < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1625 if (py < 0) py += image_height;
never executed: py += image_height;
py < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1626 } else {
never executed: end of block
0
1627 px = qBound(0, px, image_width - 1);-
1628 py = qBound(0, py, image_height - 1);-
1629 }
never executed: end of block
0
1630 *b = fetch(data->texture.scanLine(py), px);-
1631-
1632 fx += fdx;-
1633 fy += fdy;-
1634 fw += fdw;-
1635 //force increment to avoid /0-
1636 if (!fw) {
!fwDescription
TRUEnever evaluated
FALSEnever evaluated
0
1637 fw += fdw;-
1638 }
never executed: end of block
0
1639 ++b;-
1640 }
never executed: end of block
0
1641 }
never executed: end of block
0
1642 const QRgb *clut = data->texture.colorTable ? data->texture.colorTable->constData() : 0;-
1643 return layout->convertToARGB32PM(buffer, buffer, length, layout, clut);
never executed: return layout->convertToARGB32PM(buffer, buffer, length, layout, clut);
0
1644}-
1645-
1646template<TextureBlendType blendType> /* either BlendTransformed or BlendTransformedTiled */-
1647static const QRgba64 *QT_FASTCALL fetchTransformed64(QRgba64 *buffer, const Operator *, const QSpanData *data,-
1648 int y, int x, int length)-
1649{-
1650 int image_width = data->texture.width;-
1651 int image_height = data->texture.height;-
1652-
1653 const qreal cx = x + qreal(0.5);-
1654 const qreal cy = y + qreal(0.5);-
1655-
1656 const QPixelLayout *layout = &qPixelLayouts[data->texture.format];-
1657 FetchPixelFunc fetch = qFetchPixel[layout->bpp];-
1658 const QRgb *clut = data->texture.colorTable ? data->texture.colorTable->constData() : 0;-
1659-
1660 uint buffer32[buffer_size];-
1661 QRgba64 *b = buffer;-
1662 if (data->fast_matrix) {
data->fast_matrixDescription
TRUEnever evaluated
FALSEnever evaluated
0
1663 // The increment pr x in the scanline-
1664 int fdx = (int)(data->m11 * fixed_scale);-
1665 int fdy = (int)(data->m12 * fixed_scale);-
1666-
1667 int fx = int((data->m21 * cy-
1668 + data->m11 * cx + data->dx) * fixed_scale);-
1669 int fy = int((data->m22 * cy-
1670 + data->m12 * cx + data->dy) * fixed_scale);-
1671-
1672 int i = 0, j = 0;-
1673 while (i < length) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1674 if (j == buffer_size) {
j == buffer_sizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
1675 layout->convertToARGB64PM(b, buffer32, buffer_size, layout, clut);-
1676 b += buffer_size;-
1677 j = 0;-
1678 }
never executed: end of block
0
1679 int px = fx >> 16;-
1680 int py = fy >> 16;-
1681-
1682 if (blendType == BlendTransformedTiled) {
blendType == B...ansformedTiledDescription
TRUEnever evaluated
FALSEnever evaluated
0
1683 px %= image_width;-
1684 py %= image_height;-
1685 if (px < 0) px += image_width;
never executed: px += image_width;
px < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1686 if (py < 0) py += image_height;
never executed: py += image_height;
py < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1687 } else {
never executed: end of block
0
1688 px = qBound(0, px, image_width - 1);-
1689 py = qBound(0, py, image_height - 1);-
1690 }
never executed: end of block
0
1691 buffer32[j] = fetch(data->texture.scanLine(py), px);-
1692-
1693 fx += fdx;-
1694 fy += fdy;-
1695 ++i; ++j;-
1696 }
never executed: end of block
0
1697 if (j > 0) {
j > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1698 layout->convertToARGB64PM(b, buffer32, j, layout, clut);-
1699 b += j;-
1700 }
never executed: end of block
0
1701 } else {
never executed: end of block
0
1702 const qreal fdx = data->m11;-
1703 const qreal fdy = data->m12;-
1704 const qreal fdw = data->m13;-
1705-
1706 qreal fx = data->m21 * cy + data->m11 * cx + data->dx;-
1707 qreal fy = data->m22 * cy + data->m12 * cx + data->dy;-
1708 qreal fw = data->m23 * cy + data->m13 * cx + data->m33;-
1709-
1710 int i = 0, j = 0;-
1711 while (i < length) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1712 if (j == buffer_size) {
j == buffer_sizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
1713 layout->convertToARGB64PM(b, buffer32, buffer_size, layout, clut);-
1714 b += buffer_size;-
1715 j = 0;-
1716 }
never executed: end of block
0
1717 const qreal iw = fw == 0 ? 1 : 1 / fw;-
1718 const qreal tx = fx * iw;-
1719 const qreal ty = fy * iw;-
1720 int px = int(tx) - (tx < 0);-
1721 int py = int(ty) - (ty < 0);-
1722-
1723 if (blendType == BlendTransformedTiled) {
blendType == B...ansformedTiledDescription
TRUEnever evaluated
FALSEnever evaluated
0
1724 px %= image_width;-
1725 py %= image_height;-
1726 if (px < 0) px += image_width;
never executed: px += image_width;
px < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1727 if (py < 0) py += image_height;
never executed: py += image_height;
py < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1728 } else {
never executed: end of block
0
1729 px = qBound(0, px, image_width - 1);-
1730 py = qBound(0, py, image_height - 1);-
1731 }
never executed: end of block
0
1732 buffer32[j] = fetch(data->texture.scanLine(py), px);-
1733-
1734 fx += fdx;-
1735 fy += fdy;-
1736 fw += fdw;-
1737 //force increment to avoid /0-
1738 if (!fw) {
!fwDescription
TRUEnever evaluated
FALSEnever evaluated
0
1739 fw += fdw;-
1740 }
never executed: end of block
0
1741 ++i; ++j;-
1742 }
never executed: end of block
0
1743 if (j > 0) {
j > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1744 layout->convertToARGB64PM(b, buffer32, j, layout, clut);-
1745 b += j;-
1746 }
never executed: end of block
0
1747 }
never executed: end of block
0
1748 return buffer;
never executed: return buffer;
0
1749}-
1750-
1751/** \internal-
1752 interpolate 4 argb pixels with the distx and disty factor.-
1753 distx and disty bust be between 0 and 16-
1754 */-
1755static inline uint interpolate_4_pixels_16(uint tl, uint tr, uint bl, uint br, int distx, int disty)-
1756{-
1757 uint distxy = distx * disty;-
1758 //idistx * disty = (16-distx) * disty = 16*disty - distxy-
1759 //idistx * idisty = (16-distx) * (16-disty) = 16*16 - 16*distx -16*disty + distxy-
1760 uint tlrb = (tl & 0x00ff00ff) * (16*16 - 16*distx - 16*disty + distxy);-
1761 uint tlag = ((tl & 0xff00ff00) >> 8) * (16*16 - 16*distx - 16*disty + distxy);-
1762 uint trrb = ((tr & 0x00ff00ff) * (distx*16 - distxy));-
1763 uint trag = (((tr & 0xff00ff00) >> 8) * (distx*16 - distxy));-
1764 uint blrb = ((bl & 0x00ff00ff) * (disty*16 - distxy));-
1765 uint blag = (((bl & 0xff00ff00) >> 8) * (disty*16 - distxy));-
1766 uint brrb = ((br & 0x00ff00ff) * (distxy));-
1767 uint brag = (((br & 0xff00ff00) >> 8) * (distxy));-
1768 return (((tlrb + trrb + blrb + brrb) >> 8) & 0x00ff00ff) | ((tlag + trag + blag + brag) & 0xff00ff00);
never executed: return (((tlrb + trrb + blrb + brrb) >> 8) & 0x00ff00ff) | ((tlag + trag + blag + brag) & 0xff00ff00);
0
1769}-
1770-
1771#if defined(__SSE2__)-
1772#define interpolate_4_pixels_16_sse2(tl, tr, bl, br, distx, disty, colorMask, v_256, b) \-
1773{ \-
1774 const __m128i dxdy = _mm_mullo_epi16 (distx, disty); \-
1775 const __m128i distx_ = _mm_slli_epi16(distx, 4); \-
1776 const __m128i disty_ = _mm_slli_epi16(disty, 4); \-
1777 const __m128i idxidy = _mm_add_epi16(dxdy, _mm_sub_epi16(v_256, _mm_add_epi16(distx_, disty_))); \-
1778 const __m128i dxidy = _mm_sub_epi16(distx_, dxdy); \-
1779 const __m128i idxdy = _mm_sub_epi16(disty_, dxdy); \-
1780 \-
1781 __m128i tlAG = _mm_srli_epi16(tl, 8); \-
1782 __m128i tlRB = _mm_and_si128(tl, colorMask); \-
1783 __m128i trAG = _mm_srli_epi16(tr, 8); \-
1784 __m128i trRB = _mm_and_si128(tr, colorMask); \-
1785 __m128i blAG = _mm_srli_epi16(bl, 8); \-
1786 __m128i blRB = _mm_and_si128(bl, colorMask); \-
1787 __m128i brAG = _mm_srli_epi16(br, 8); \-
1788 __m128i brRB = _mm_and_si128(br, colorMask); \-
1789 \-
1790 tlAG = _mm_mullo_epi16(tlAG, idxidy); \-
1791 tlRB = _mm_mullo_epi16(tlRB, idxidy); \-
1792 trAG = _mm_mullo_epi16(trAG, dxidy); \-
1793 trRB = _mm_mullo_epi16(trRB, dxidy); \-
1794 blAG = _mm_mullo_epi16(blAG, idxdy); \-
1795 blRB = _mm_mullo_epi16(blRB, idxdy); \-
1796 brAG = _mm_mullo_epi16(brAG, dxdy); \-
1797 brRB = _mm_mullo_epi16(brRB, dxdy); \-
1798 \-
1799 /* Add the values, and shift to only keep 8 significant bits per colors */ \-
1800 __m128i rAG =_mm_add_epi16(_mm_add_epi16(tlAG, trAG), _mm_add_epi16(blAG, brAG)); \-
1801 __m128i rRB =_mm_add_epi16(_mm_add_epi16(tlRB, trRB), _mm_add_epi16(blRB, brRB)); \-
1802 rAG = _mm_andnot_si128(colorMask, rAG); \-
1803 rRB = _mm_srli_epi16(rRB, 8); \-
1804 _mm_storeu_si128((__m128i*)(b), _mm_or_si128(rAG, rRB)); \-
1805}-
1806#endif-
1807-
1808#if defined(__ARM_NEON__)-
1809#define interpolate_4_pixels_16_neon(tl, tr, bl, br, distx, disty, disty_, colorMask, invColorMask, v_256, b) \-
1810{ \-
1811 const int16x8_t dxdy = vmulq_s16(distx, disty); \-
1812 const int16x8_t distx_ = vshlq_n_s16(distx, 4); \-
1813 const int16x8_t idxidy = vaddq_s16(dxdy, vsubq_s16(v_256, vaddq_s16(distx_, disty_))); \-
1814 const int16x8_t dxidy = vsubq_s16(distx_, dxdy); \-
1815 const int16x8_t idxdy = vsubq_s16(disty_, dxdy); \-
1816 \-
1817 int16x8_t tlAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(tl), 8)); \-
1818 int16x8_t tlRB = vandq_s16(tl, colorMask); \-
1819 int16x8_t trAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(tr), 8)); \-
1820 int16x8_t trRB = vandq_s16(tr, colorMask); \-
1821 int16x8_t blAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(bl), 8)); \-
1822 int16x8_t blRB = vandq_s16(bl, colorMask); \-
1823 int16x8_t brAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(br), 8)); \-
1824 int16x8_t brRB = vandq_s16(br, colorMask); \-
1825 \-
1826 int16x8_t rAG = vmulq_s16(tlAG, idxidy); \-
1827 int16x8_t rRB = vmulq_s16(tlRB, idxidy); \-
1828 rAG = vmlaq_s16(rAG, trAG, dxidy); \-
1829 rRB = vmlaq_s16(rRB, trRB, dxidy); \-
1830 rAG = vmlaq_s16(rAG, blAG, idxdy); \-
1831 rRB = vmlaq_s16(rRB, blRB, idxdy); \-
1832 rAG = vmlaq_s16(rAG, brAG, dxdy); \-
1833 rRB = vmlaq_s16(rRB, brRB, dxdy); \-
1834 \-
1835 rAG = vandq_s16(invColorMask, rAG); \-
1836 rRB = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(rRB), 8)); \-
1837 vst1q_s16((int16_t*)(b), vorrq_s16(rAG, rRB)); \-
1838}-
1839#endif-
1840-
1841#if defined(__SSE2__)-
1842static inline QRgba64 interpolate_4_pixels_rgb64(QRgba64 t[], QRgba64 b[], uint distx, uint disty)-
1843{-
1844 const __m128i vdistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(distx), _MM_SHUFFLE(0, 0, 0, 0));-
1845 const __m128i vidistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(0x10000 - distx), _MM_SHUFFLE(0, 0, 0, 0));-
1846-
1847 __m128i vt = _mm_loadu_si128((const __m128i*)t);-
1848 if (disty) {
distyDescription
TRUEnever evaluated
FALSEnever evaluated
0
1849 __m128i vb = _mm_loadu_si128((const __m128i*)b);-
1850 vt = _mm_mulhi_epu16(vt, _mm_set1_epi16(0x10000 - disty));-
1851 vb = _mm_mulhi_epu16(vb, _mm_set1_epi16(disty));-
1852 vt = _mm_add_epi16(vt, vb);-
1853 }
never executed: end of block
0
1854 vt = _mm_mulhi_epu16(vt, _mm_unpacklo_epi64(vidistx, vdistx));-
1855 vt = _mm_add_epi16(vt, _mm_srli_si128(vt, 8));-
1856#ifdef Q_PROCESSOR_X86_64-
1857 return QRgba64::fromRgba64(_mm_cvtsi128_si64(vt));
never executed: return QRgba64::fromRgba64(_mm_cvtsi128_si64(vt));
0
1858#else-
1859 QRgba64 out;-
1860 _mm_storel_epi64((__m128i*)&out, vt);-
1861 return out;-
1862#endif-
1863}-
1864#else-
1865static inline QRgba64 interpolate_4_pixels_rgb64(QRgba64 t[], QRgba64 b[], uint distx, uint disty)-
1866{-
1867 const uint dx = distx>>8;-
1868 const uint dy = disty>>8;-
1869 const uint idx = 256 - dx;-
1870 const uint idy = 256 - dy;-
1871 QRgba64 xtop = interpolate256(t[0], idx, t[1], dx);-
1872 QRgba64 xbot = interpolate256(b[0], idx, b[1], dx);-
1873 return interpolate256(xtop, idy, xbot, dy);-
1874}-
1875#endif-
1876-
1877template<TextureBlendType blendType>-
1878void fetchTransformedBilinear_pixelBounds(int max, int l1, int l2, int &v1, int &v2);-
1879-
1880template<>-
1881inline void fetchTransformedBilinear_pixelBounds<BlendTransformedBilinearTiled>(int max, int, int, int &v1, int &v2)-
1882{-
1883 v1 %= max;-
1884 if (v1 < 0)
v1 < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1885 v1 += max;
never executed: v1 += max;
0
1886 v2 = v1 + 1;-
1887 if (v2 == max)
v2 == maxDescription
TRUEnever evaluated
FALSEnever evaluated
0
1888 v2 = 0;
never executed: v2 = 0;
0
1889 Q_ASSERT(v1 >= 0 && v1 < max);-
1890 Q_ASSERT(v2 >= 0 && v2 < max);-
1891}
never executed: end of block
0
1892-
1893template<>-
1894inline void fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(int, int l1, int l2, int &v1, int &v2)-
1895{-
1896 if (v1 < l1)
v1 < l1Description
TRUEnever evaluated
FALSEnever evaluated
0
1897 v2 = v1 = l1;
never executed: v2 = v1 = l1;
0
1898 else if (v1 >= l2)
v1 >= l2Description
TRUEnever evaluated
FALSEnever evaluated
0
1899 v2 = v1 = l2;
never executed: v2 = v1 = l2;
0
1900 else-
1901 v2 = v1 + 1;
never executed: v2 = v1 + 1;
0
1902 Q_ASSERT(v1 >= l1 && v1 <= l2);-
1903 Q_ASSERT(v2 >= l1 && v2 <= l2);-
1904}
never executed: end of block
0
1905-
1906template<TextureBlendType blendType> /* blendType = BlendTransformedBilinear or BlendTransformedBilinearTiled */-
1907static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, const Operator *,-
1908 const QSpanData *data, int y, int x,-
1909 int length)-
1910{-
1911 int image_width = data->texture.width;-
1912 int image_height = data->texture.height;-
1913-
1914 int image_x1 = data->texture.x1;-
1915 int image_y1 = data->texture.y1;-
1916 int image_x2 = data->texture.x2 - 1;-
1917 int image_y2 = data->texture.y2 - 1;-
1918-
1919 const qreal cx = x + qreal(0.5);-
1920 const qreal cy = y + qreal(0.5);-
1921-
1922 uint *end = buffer + length;-
1923 uint *b = buffer;-
1924 if (data->fast_matrix) {
data->fast_matrixDescription
TRUEnever evaluated
FALSEnever evaluated
0
1925 // The increment pr x in the scanline-
1926 int fdx = (int)(data->m11 * fixed_scale);-
1927 int fdy = (int)(data->m12 * fixed_scale);-
1928-
1929 int fx = int((data->m21 * cy-
1930 + data->m11 * cx + data->dx) * fixed_scale);-
1931 int fy = int((data->m22 * cy-
1932 + data->m12 * cx + data->dy) * fixed_scale);-
1933-
1934 fx -= half_point;-
1935 fy -= half_point;-
1936-
1937 if (fdy == 0) { //simple scale, no rotation
fdy == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1938 int y1 = (fy >> 16);-
1939 int y2;-
1940 fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);-
1941 const uint *s1 = (const uint *)data->texture.scanLine(y1);-
1942 const uint *s2 = (const uint *)data->texture.scanLine(y2);-
1943-
1944 if (fdx <= fixed_scale && fdx > 0) { // scale up on X
fdx <= fixed_scaleDescription
TRUEnever evaluated
FALSEnever evaluated
fdx > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1945 int disty = (fy & 0x0000ffff) >> 8;-
1946 int idisty = 256 - disty;-
1947 int x = fx >> 16;-
1948-
1949 // The idea is first to do the interpolation between the row s1 and the row s2-
1950 // into an intermediate buffer, then we interpolate between two pixel of this buffer.-
1951-
1952 // intermediate_buffer[0] is a buffer of red-blue component of the pixel, in the form 0x00RR00BB-
1953 // intermediate_buffer[1] is the alpha-green component of the pixel, in the form 0x00AA00GG-
1954 // +1 for the last pixel to interpolate with, and +1 for rounding errors.-
1955 quint32 intermediate_buffer[2][buffer_size + 2];-
1956 // count is the size used in the intermediate_buffer.-
1957 int count = (qint64(length) * fdx + fixed_scale - 1) / fixed_scale + 2;-
1958 Q_ASSERT(count <= buffer_size + 2); //length is supposed to be <= buffer_size and data->m11 < 1 in this case-
1959 int f = 0;-
1960 int lim = count;-
1961 if (blendType == BlendTransformedBilinearTiled) {
blendType == B...dBilinearTiledDescription
TRUEnever evaluated
FALSEnever evaluated
0
1962 x %= image_width;-
1963 if (x < 0) x += image_width;
never executed: x += image_width;
x < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1964 } else {
never executed: end of block
0
1965 lim = qMin(count, image_x2-x+1);-
1966 if (x < image_x1) {
x < image_x1Description
TRUEnever evaluated
FALSEnever evaluated
0
1967 Q_ASSERT(x <= image_x2);-
1968 uint t = s1[image_x1];-
1969 uint b = s2[image_x1];-
1970 quint32 rb = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff;-
1971 quint32 ag = ((((t>>8) & 0xff00ff) * idisty + ((b>>8) & 0xff00ff) * disty) >> 8) & 0xff00ff;-
1972 do {-
1973 intermediate_buffer[0][f] = rb;-
1974 intermediate_buffer[1][f] = ag;-
1975 f++;-
1976 x++;-
1977 } while (x < image_x1 && f < lim);
never executed: end of block
x < image_x1Description
TRUEnever evaluated
FALSEnever evaluated
f < limDescription
TRUEnever evaluated
FALSEnever evaluated
0
1978 }
never executed: end of block
0
1979 }
never executed: end of block
0
1980-
1981 if (blendType != BlendTransformedBilinearTiled) {
blendType != B...dBilinearTiledDescription
TRUEnever evaluated
FALSEnever evaluated
0
1982#if defined(__SSE2__)-
1983 const __m128i disty_ = _mm_set1_epi16(disty);-
1984 const __m128i idisty_ = _mm_set1_epi16(idisty);-
1985 const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);-
1986-
1987 lim -= 3;-
1988 for (; f < lim; x += 4, f += 4) {
f < limDescription
TRUEnever evaluated
FALSEnever evaluated
0
1989 // Load 4 pixels from s1, and split the alpha-green and red-blue component-
1990 __m128i top = _mm_loadu_si128((const __m128i*)((const uint *)(s1)+x));-
1991 __m128i topAG = _mm_srli_epi16(top, 8);-
1992 __m128i topRB = _mm_and_si128(top, colorMask);-
1993 // Multiplies each colour component by idisty-
1994 topAG = _mm_mullo_epi16 (topAG, idisty_);-
1995 topRB = _mm_mullo_epi16 (topRB, idisty_);-
1996-
1997 // Same for the s2 vector-
1998 __m128i bottom = _mm_loadu_si128((const __m128i*)((const uint *)(s2)+x));-
1999 __m128i bottomAG = _mm_srli_epi16(bottom, 8);-
2000 __m128i bottomRB = _mm_and_si128(bottom, colorMask);-
2001 bottomAG = _mm_mullo_epi16 (bottomAG, disty_);-
2002 bottomRB = _mm_mullo_epi16 (bottomRB, disty_);-
2003-
2004 // Add the values, and shift to only keep 8 significant bits per colors-
2005 __m128i rAG =_mm_add_epi16(topAG, bottomAG);-
2006 rAG = _mm_srli_epi16(rAG, 8);-
2007 _mm_storeu_si128((__m128i*)(&intermediate_buffer[1][f]), rAG);-
2008 __m128i rRB =_mm_add_epi16(topRB, bottomRB);-
2009 rRB = _mm_srli_epi16(rRB, 8);-
2010 _mm_storeu_si128((__m128i*)(&intermediate_buffer[0][f]), rRB);-
2011 }
never executed: end of block
0
2012#elif defined(__ARM_NEON__)-
2013 const int16x8_t disty_ = vdupq_n_s16(disty);-
2014 const int16x8_t idisty_ = vdupq_n_s16(idisty);-
2015 const int16x8_t colorMask = vdupq_n_s16(0x00ff);-
2016-
2017 lim -= 3;-
2018 for (; f < lim; x += 4, f += 4) {-
2019 // Load 4 pixels from s1, and split the alpha-green and red-blue component-
2020 int16x8_t top = vld1q_s16((int16_t*)((const uint *)(s1)+x));-
2021 int16x8_t topAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(top), 8));-
2022 int16x8_t topRB = vandq_s16(top, colorMask);-
2023 // Multiplies each colour component by idisty-
2024 topAG = vmulq_s16(topAG, idisty_);-
2025 topRB = vmulq_s16(topRB, idisty_);-
2026-
2027 // Same for the s2 vector-
2028 int16x8_t bottom = vld1q_s16((int16_t*)((const uint *)(s2)+x));-
2029 int16x8_t bottomAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(bottom), 8));-
2030 int16x8_t bottomRB = vandq_s16(bottom, colorMask);-
2031 bottomAG = vmulq_s16(bottomAG, disty_);-
2032 bottomRB = vmulq_s16(bottomRB, disty_);-
2033-
2034 // Add the values, and shift to only keep 8 significant bits per colors-
2035 int16x8_t rAG = vaddq_s16(topAG, bottomAG);-
2036 rAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(rAG), 8));-
2037 vst1q_s16((int16_t*)(&intermediate_buffer[1][f]), rAG);-
2038 int16x8_t rRB = vaddq_s16(topRB, bottomRB);-
2039 rRB = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(rRB), 8));-
2040 vst1q_s16((int16_t*)(&intermediate_buffer[0][f]), rRB);-
2041 }-
2042#endif-
2043 }
never executed: end of block
0
2044 for (; f < count; f++) { // Same as above but without sse2
f < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
2045 if (blendType == BlendTransformedBilinearTiled) {
blendType == B...dBilinearTiledDescription
TRUEnever evaluated
FALSEnever evaluated
0
2046 if (x >= image_width) x -= image_width;
never executed: x -= image_width;
x >= image_widthDescription
TRUEnever evaluated
FALSEnever evaluated
0
2047 } else {
never executed: end of block
0
2048 x = qMin(x, image_x2);-
2049 }
never executed: end of block
0
2050-
2051 uint t = s1[x];-
2052 uint b = s2[x];-
2053-
2054 intermediate_buffer[0][f] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff;-
2055 intermediate_buffer[1][f] = ((((t>>8) & 0xff00ff) * idisty + ((b>>8) & 0xff00ff) * disty) >> 8) & 0xff00ff;-
2056 x++;-
2057 }
never executed: end of block
0
2058 // Now interpolate the values from the intermediate_buffer to get the final result.-
2059 fx &= fixed_scale - 1;-
2060 Q_ASSERT((fx >> 16) == 0);-
2061 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
2062 int x1 = (fx >> 16);-
2063 int x2 = x1 + 1;-
2064 Q_ASSERT(x1 >= 0);-
2065 Q_ASSERT(x2 < count);-
2066-
2067 int distx = (fx & 0x0000ffff) >> 8;-
2068 int idistx = 256 - distx;-
2069 int rb = ((intermediate_buffer[0][x1] * idistx + intermediate_buffer[0][x2] * distx) >> 8) & 0xff00ff;-
2070 int ag = (intermediate_buffer[1][x1] * idistx + intermediate_buffer[1][x2] * distx) & 0xff00ff00;-
2071 *b = rb | ag;-
2072 b++;-
2073 fx += fdx;-
2074 }
never executed: end of block
0
2075 } else if ((fdx < 0 && fdx > -(fixed_scale / 8)) || std::abs(data->m22) < (1./8.)) { // scale up more than 8x
never executed: end of block
fdx < 0Description
TRUEnever evaluated
FALSEnever evaluated
fdx > -(fixed_scale / 8)Description
TRUEnever evaluated
FALSEnever evaluated
std::abs(data->m22) < (1./8.)Description
TRUEnever evaluated
FALSEnever evaluated
0
2076 int y1 = (fy >> 16);-
2077 int y2;-
2078 fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);-
2079 const uint *s1 = (const uint *)data->texture.scanLine(y1);-
2080 const uint *s2 = (const uint *)data->texture.scanLine(y2);-
2081 int disty = (fy & 0x0000ffff) >> 8;-
2082 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
2083 int x1 = (fx >> 16);-
2084 int x2;-
2085 fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);-
2086 uint tl = s1[x1];-
2087 uint tr = s1[x2];-
2088 uint bl = s2[x1];-
2089 uint br = s2[x2];-
2090 int distx = (fx & 0x0000ffff) >> 8;-
2091 *b = interpolate_4_pixels(tl, tr, bl, br, distx, disty);-
2092-
2093 fx += fdx;-
2094 ++b;-
2095 }
never executed: end of block
0
2096 } else { //scale down
never executed: end of block
0
2097 int y1 = (fy >> 16);-
2098 int y2;-
2099 fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);-
2100 const uint *s1 = (const uint *)data->texture.scanLine(y1);-
2101 const uint *s2 = (const uint *)data->texture.scanLine(y2);-
2102 int disty = (fy & 0x0000ffff) >> 12;-
2103-
2104 if (blendType != BlendTransformedBilinearTiled) {
blendType != B...dBilinearTiledDescription
TRUEnever evaluated
FALSEnever evaluated
0
2105#define BILINEAR_DOWNSCALE_BOUNDS_PROLOG \-
2106 while (b < end) { \-
2107 int x1 = (fx >> 16); \-
2108 int x2; \-
2109 fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); \-
2110 if (x1 != x2) \-
2111 break; \-
2112 uint tl = s1[x1]; \-
2113 uint tr = s1[x2]; \-
2114 uint bl = s2[x1]; \-
2115 uint br = s2[x2]; \-
2116 int distx = (fx & 0x0000ffff) >> 12; \-
2117 *b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty); \-
2118 fx += fdx; \-
2119 ++b; \-
2120 } \-
2121 uint *boundedEnd; \-
2122 if (fdx > 0) \-
2123 boundedEnd = qMin(end, buffer + uint((image_x2 - (fx >> 16)) / data->m11)); \-
2124 else \-
2125 boundedEnd = qMin(end, buffer + uint((image_x1 - (fx >> 16)) / data->m11)); \-
2126 boundedEnd -= 3;-
2127-
2128#if defined(__SSE2__)-
2129 BILINEAR_DOWNSCALE_BOUNDS_PROLOG
never executed: break;
never executed: end of block
never executed: boundedEnd = qMin(end, buffer + uint((image_x2 - (fx >> 16)) / data->m11));
never executed: boundedEnd = qMin(end, buffer + uint((image_x1 - (fx >> 16)) / data->m11));
x1 != x2Description
TRUEnever evaluated
FALSEnever evaluated
fdx > 0Description
TRUEnever evaluated
FALSEnever evaluated
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
2130-
2131 const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);-
2132 const __m128i v_256 = _mm_set1_epi16(256);-
2133 const __m128i v_disty = _mm_set1_epi16(disty);-
2134 const __m128i v_fdx = _mm_set1_epi32(fdx*4);-
2135 __m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx);-
2136-
2137 while (b < boundedEnd) {
b < boundedEndDescription
TRUEnever evaluated
FALSEnever evaluated
0
2138 __m128i offset = _mm_srli_epi32(v_fx, 16);-
2139 const int offset0 = _mm_cvtsi128_si32(offset); offset = _mm_srli_si128(offset, 4);-
2140 const int offset1 = _mm_cvtsi128_si32(offset); offset = _mm_srli_si128(offset, 4);-
2141 const int offset2 = _mm_cvtsi128_si32(offset); offset = _mm_srli_si128(offset, 4);-
2142 const int offset3 = _mm_cvtsi128_si32(offset);-
2143 const __m128i tl = _mm_setr_epi32(s1[offset0], s1[offset1], s1[offset2], s1[offset3]);-
2144 const __m128i tr = _mm_setr_epi32(s1[offset0 + 1], s1[offset1 + 1], s1[offset2 + 1], s1[offset3 + 1]);-
2145 const __m128i bl = _mm_setr_epi32(s2[offset0], s2[offset1], s2[offset2], s2[offset3]);-
2146 const __m128i br = _mm_setr_epi32(s2[offset0 + 1], s2[offset1 + 1], s2[offset2 + 1], s2[offset3 + 1]);-
2147-
2148 __m128i v_distx = _mm_srli_epi16(v_fx, 12);-
2149 v_distx = _mm_shufflehi_epi16(v_distx, _MM_SHUFFLE(2,2,0,0));-
2150 v_distx = _mm_shufflelo_epi16(v_distx, _MM_SHUFFLE(2,2,0,0));-
2151-
2152 interpolate_4_pixels_16_sse2(tl, tr, bl, br, v_distx, v_disty, colorMask, v_256, b);-
2153 b += 4;-
2154 v_fx = _mm_add_epi32(v_fx, v_fdx);-
2155 }
never executed: end of block
0
2156 fx = _mm_cvtsi128_si32(v_fx);-
2157#elif defined(__ARM_NEON__)-
2158 BILINEAR_DOWNSCALE_BOUNDS_PROLOG-
2159-
2160 const int16x8_t colorMask = vdupq_n_s16(0x00ff);-
2161 const int16x8_t invColorMask = vmvnq_s16(colorMask);-
2162 const int16x8_t v_256 = vdupq_n_s16(256);-
2163 const int16x8_t v_disty = vdupq_n_s16(disty);-
2164 const int16x8_t v_disty_ = vshlq_n_s16(v_disty, 4);-
2165 int32x4_t v_fdx = vdupq_n_s32(fdx*4);-
2166-
2167 ptrdiff_t secondLine = reinterpret_cast<const uint *>(s2) - reinterpret_cast<const uint *>(s1);-
2168-
2169 union Vect_buffer { int32x4_t vect; quint32 i[4]; };-
2170 Vect_buffer v_fx;-
2171-
2172 for (int i = 0; i < 4; i++) {-
2173 v_fx.i[i] = fx;-
2174 fx += fdx;-
2175 }-
2176-
2177 const int32x4_t v_ffff_mask = vdupq_n_s32(0x0000ffff);-
2178-
2179 while (b < boundedEnd) {-
2180-
2181 Vect_buffer tl, tr, bl, br;-
2182-
2183 Vect_buffer v_fx_shifted;-
2184 v_fx_shifted.vect = vshrq_n_s32(v_fx.vect, 16);-
2185-
2186 int32x4_t v_distx = vshrq_n_s32(vandq_s32(v_fx.vect, v_ffff_mask), 12);-
2187-
2188 for (int i = 0; i < 4; i++) {-
2189 int x1 = v_fx_shifted.i[i];-
2190 const uint *addr_tl = reinterpret_cast<const uint *>(s1) + x1;-
2191 const uint *addr_tr = addr_tl + 1;-
2192 tl.i[i] = *addr_tl;-
2193 tr.i[i] = *addr_tr;-
2194 bl.i[i] = *(addr_tl+secondLine);-
2195 br.i[i] = *(addr_tr+secondLine);-
2196 }-
2197-
2198 v_distx = vorrq_s32(v_distx, vshlq_n_s32(v_distx, 16));-
2199-
2200 interpolate_4_pixels_16_neon(vreinterpretq_s16_s32(tl.vect), vreinterpretq_s16_s32(tr.vect), vreinterpretq_s16_s32(bl.vect), vreinterpretq_s16_s32(br.vect), vreinterpretq_s16_s32(v_distx), v_disty, v_disty_, colorMask, invColorMask, v_256, b);-
2201 b+=4;-
2202 v_fx.vect = vaddq_s32(v_fx.vect, v_fdx);-
2203 }-
2204 fx = v_fx.i[0];-
2205#endif-
2206 }
never executed: end of block
0
2207-
2208 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
2209 int x1 = (fx >> 16);-
2210 int x2;-
2211 fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);-
2212 uint tl = s1[x1];-
2213 uint tr = s1[x2];-
2214 uint bl = s2[x1];-
2215 uint br = s2[x2];-
2216 int distx = (fx & 0x0000ffff) >> 12;-
2217 *b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty);-
2218 fx += fdx;-
2219 ++b;-
2220 }
never executed: end of block
0
2221 }
never executed: end of block
0
2222 } else { //rotation-
2223 if (std::abs(data->m11) > 8 || std::abs(data->m22) > 8) {
std::abs(data->m11) > 8Description
TRUEnever evaluated
FALSEnever evaluated
std::abs(data->m22) > 8Description
TRUEnever evaluated
FALSEnever evaluated
0
2224 //if we are zooming more than 8 times, we use 8bit precision for the position.-
2225 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
2226 int x1 = (fx >> 16);-
2227 int x2;-
2228 int y1 = (fy >> 16);-
2229 int y2;-
2230-
2231 fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);-
2232 fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);-
2233-
2234 const uint *s1 = (const uint *)data->texture.scanLine(y1);-
2235 const uint *s2 = (const uint *)data->texture.scanLine(y2);-
2236-
2237 uint tl = s1[x1];-
2238 uint tr = s1[x2];-
2239 uint bl = s2[x1];-
2240 uint br = s2[x2];-
2241-
2242 int distx = (fx & 0x0000ffff) >> 8;-
2243 int disty = (fy & 0x0000ffff) >> 8;-
2244-
2245 *b = interpolate_4_pixels(tl, tr, bl, br, distx, disty);-
2246-
2247 fx += fdx;-
2248 fy += fdy;-
2249 ++b;-
2250 }
never executed: end of block
0
2251 } else {
never executed: end of block
0
2252 //we are zooming less than 8x, use 4bit precision-
2253-
2254 if (blendType != BlendTransformedBilinearTiled) {
blendType != B...dBilinearTiledDescription
TRUEnever evaluated
FALSEnever evaluated
0
2255#define BILINEAR_ROTATE_BOUNDS_PROLOG \-
2256 while (b < end) { \-
2257 int x1 = (fx >> 16); \-
2258 int x2; \-
2259 int y1 = (fy >> 16); \-
2260 int y2; \-
2261 fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); \-
2262 fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); \-
2263 if (x1 != x2 && y1 != y2) \-
2264 break; \-
2265 const uint *s1 = (const uint *)data->texture.scanLine(y1); \-
2266 const uint *s2 = (const uint *)data->texture.scanLine(y2); \-
2267 uint tl = s1[x1]; \-
2268 uint tr = s1[x2]; \-
2269 uint bl = s2[x1]; \-
2270 uint br = s2[x2]; \-
2271 int distx = (fx & 0x0000ffff) >> 8; \-
2272 int disty = (fy & 0x0000ffff) >> 8; \-
2273 *b = interpolate_4_pixels(tl, tr, bl, br, distx, disty); \-
2274 fx += fdx; \-
2275 fy += fdy; \-
2276 ++b; \-
2277 } \-
2278 uint *boundedEnd = end - 3; \-
2279 boundedEnd -= 3;-
2280-
2281#if defined(__SSE2__)-
2282 BILINEAR_ROTATE_BOUNDS_PROLOG
never executed: break;
never executed: end of block
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
x1 != x2Description
TRUEnever evaluated
FALSEnever evaluated
y1 != y2Description
TRUEnever evaluated
FALSEnever evaluated
0
2283-
2284 const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);-
2285 const __m128i v_256 = _mm_set1_epi16(256);-
2286 const __m128i v_fdx = _mm_set1_epi32(fdx*4);-
2287 const __m128i v_fdy = _mm_set1_epi32(fdy*4);-
2288 __m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx);-
2289 __m128i v_fy = _mm_setr_epi32(fy, fy + fdy, fy + fdy + fdy, fy + fdy + fdy + fdy);-
2290-
2291 const uchar *textureData = data->texture.imageData;-
2292 const int bytesPerLine = data->texture.bytesPerLine;-
2293 const __m128i vbpl = _mm_shufflelo_epi16(_mm_cvtsi32_si128(bytesPerLine/4), _MM_SHUFFLE(0, 0, 0, 0));-
2294-
2295 while (b < boundedEnd) {
b < boundedEndDescription
TRUEnever evaluated
FALSEnever evaluated
0
2296 if (fdx > 0 && (short)_mm_extract_epi16(v_fx, 7) >= image_x2)
fdx > 0Description
TRUEnever evaluated
FALSEnever evaluated
(short)((int) ...)) >= image_x2Description
TRUEnever evaluated
FALSEnever evaluated
0
2297 break;
never executed: break;
0
2298 if (fdx < 0 && (short)_mm_extract_epi16(v_fx, 7) < image_x1)
fdx < 0Description
TRUEnever evaluated
FALSEnever evaluated
(short)((int) ...))) < image_x1Description
TRUEnever evaluated
FALSEnever evaluated
0
2299 break;
never executed: break;
0
2300 if (fdy > 0 && (short)_mm_extract_epi16(v_fy, 7) >= image_y2)
fdy > 0Description
TRUEnever evaluated
FALSEnever evaluated
(short)((int) ...)) >= image_y2Description
TRUEnever evaluated
FALSEnever evaluated
0
2301 break;
never executed: break;
0
2302 if (fdy < 0 && (short)_mm_extract_epi16(v_fy, 7) < image_y1)
fdy < 0Description
TRUEnever evaluated
FALSEnever evaluated
(short)((int) ...))) < image_y1Description
TRUEnever evaluated
FALSEnever evaluated
0
2303 break;
never executed: break;
0
2304-
2305 const __m128i vy = _mm_packs_epi32(_mm_srli_epi32(v_fy, 16), _mm_setzero_si128());-
2306 // 4x16bit * 4x16bit -> 4x32bit-
2307 __m128i offset = _mm_unpacklo_epi16(_mm_mullo_epi16(vy, vbpl), _mm_mulhi_epi16(vy, vbpl));-
2308 offset = _mm_add_epi32(offset, _mm_srli_epi32(v_fx, 16));-
2309 const int offset0 = _mm_cvtsi128_si32(offset); offset = _mm_srli_si128(offset, 4);-
2310 const int offset1 = _mm_cvtsi128_si32(offset); offset = _mm_srli_si128(offset, 4);-
2311 const int offset2 = _mm_cvtsi128_si32(offset); offset = _mm_srli_si128(offset, 4);-
2312 const int offset3 = _mm_cvtsi128_si32(offset);-
2313 const uint *topData = (const uint *)(textureData);-
2314 const __m128i tl = _mm_setr_epi32(topData[offset0], topData[offset1], topData[offset2], topData[offset3]);-
2315 const __m128i tr = _mm_setr_epi32(topData[offset0 + 1], topData[offset1 + 1], topData[offset2 + 1], topData[offset3 + 1]);-
2316 const uint *bottomData = (const uint *)(textureData + bytesPerLine);-
2317 const __m128i bl = _mm_setr_epi32(bottomData[offset0], bottomData[offset1], bottomData[offset2], bottomData[offset3]);-
2318 const __m128i br = _mm_setr_epi32(bottomData[offset0 + 1], bottomData[offset1 + 1], bottomData[offset2 + 1], bottomData[offset3 + 1]);-
2319-
2320 __m128i v_distx = _mm_srli_epi16(v_fx, 12);-
2321 __m128i v_disty = _mm_srli_epi16(v_fy, 12);-
2322 v_distx = _mm_shufflehi_epi16(v_distx, _MM_SHUFFLE(2,2,0,0));-
2323 v_distx = _mm_shufflelo_epi16(v_distx, _MM_SHUFFLE(2,2,0,0));-
2324 v_disty = _mm_shufflehi_epi16(v_disty, _MM_SHUFFLE(2,2,0,0));-
2325 v_disty = _mm_shufflelo_epi16(v_disty, _MM_SHUFFLE(2,2,0,0));-
2326-
2327 interpolate_4_pixels_16_sse2(tl, tr, bl, br, v_distx, v_disty, colorMask, v_256, b);-
2328 b += 4;-
2329 v_fx = _mm_add_epi32(v_fx, v_fdx);-
2330 v_fy = _mm_add_epi32(v_fy, v_fdy);-
2331 }
never executed: end of block
0
2332 fx = _mm_cvtsi128_si32(v_fx);-
2333 fy = _mm_cvtsi128_si32(v_fy);-
2334#endif-
2335 }
never executed: end of block
0
2336-
2337 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
2338 int x1 = (fx >> 16);-
2339 int x2;-
2340 int y1 = (fy >> 16);-
2341 int y2;-
2342-
2343 fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);-
2344 fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);-
2345-
2346 const uint *s1 = (const uint *)data->texture.scanLine(y1);-
2347 const uint *s2 = (const uint *)data->texture.scanLine(y2);-
2348-
2349 uint tl = s1[x1];-
2350 uint tr = s1[x2];-
2351 uint bl = s2[x1];-
2352 uint br = s2[x2];-
2353-
2354#if defined(__SSE2__) || defined(__ARM_NEON__)-
2355 // The optimized interpolate_4_pixels are faster than interpolate_4_pixels_16.-
2356 int distx = (fx & 0x0000ffff) >> 8;-
2357 int disty = (fy & 0x0000ffff) >> 8;-
2358 *b = interpolate_4_pixels(tl, tr, bl, br, distx, disty);-
2359#else-
2360 int distx = (fx & 0x0000ffff) >> 12;-
2361 int disty = (fy & 0x0000ffff) >> 12;-
2362 *b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty);-
2363#endif-
2364-
2365 fx += fdx;-
2366 fy += fdy;-
2367 ++b;-
2368 }
never executed: end of block
0
2369 }
never executed: end of block
0
2370 }-
2371 } else {-
2372 const qreal fdx = data->m11;-
2373 const qreal fdy = data->m12;-
2374 const qreal fdw = data->m13;-
2375-
2376 qreal fx = data->m21 * cy + data->m11 * cx + data->dx;-
2377 qreal fy = data->m22 * cy + data->m12 * cx + data->dy;-
2378 qreal fw = data->m23 * cy + data->m13 * cx + data->m33;-
2379-
2380 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
2381 const qreal iw = fw == 0 ? 1 : 1 / fw;-
2382 const qreal px = fx * iw - qreal(0.5);-
2383 const qreal py = fy * iw - qreal(0.5);-
2384-
2385 int x1 = int(px) - (px < 0);-
2386 int x2;-
2387 int y1 = int(py) - (py < 0);-
2388 int y2;-
2389-
2390 int distx = int((px - x1) * 256);-
2391 int disty = int((py - y1) * 256);-
2392-
2393 fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);-
2394 fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);-
2395-
2396 const uint *s1 = (const uint *)data->texture.scanLine(y1);-
2397 const uint *s2 = (const uint *)data->texture.scanLine(y2);-
2398-
2399 uint tl = s1[x1];-
2400 uint tr = s1[x2];-
2401 uint bl = s2[x1];-
2402 uint br = s2[x2];-
2403-
2404 *b = interpolate_4_pixels(tl, tr, bl, br, distx, disty);-
2405-
2406 fx += fdx;-
2407 fy += fdy;-
2408 fw += fdw;-
2409 //force increment to avoid /0-
2410 if (!fw) {
!fwDescription
TRUEnever evaluated
FALSEnever evaluated
0
2411 fw += fdw;-
2412 }
never executed: end of block
0
2413 ++b;-
2414 }
never executed: end of block
0
2415 }
never executed: end of block
0
2416-
2417 return buffer;
never executed: return buffer;
0
2418}-
2419-
2420// blendType = BlendTransformedBilinear or BlendTransformedBilinearTiled-
2421template<TextureBlendType blendType>-
2422static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *,-
2423 const QSpanData *data, int y, int x, int length)-
2424{-
2425 const QPixelLayout *layout = &qPixelLayouts[data->texture.format];-
2426 const QRgb *clut = data->texture.colorTable ? data->texture.colorTable->constData() : 0;-
2427-
2428 int image_width = data->texture.width;-
2429 int image_height = data->texture.height;-
2430-
2431 int image_x1 = data->texture.x1;-
2432 int image_y1 = data->texture.y1;-
2433 int image_x2 = data->texture.x2 - 1;-
2434 int image_y2 = data->texture.y2 - 1;-
2435-
2436 const qreal cx = x + qreal(0.5);-
2437 const qreal cy = y + qreal(0.5);-
2438-
2439 if (data->fast_matrix) {
data->fast_matrixDescription
TRUEnever evaluated
FALSEnever evaluated
0
2440 // The increment pr x in the scanline-
2441 int fdx = (int)(data->m11 * fixed_scale);-
2442 int fdy = (int)(data->m12 * fixed_scale);-
2443-
2444 int fx = int((data->m21 * cy + data->m11 * cx + data->dx) * fixed_scale);-
2445 int fy = int((data->m22 * cy + data->m12 * cx + data->dy) * fixed_scale);-
2446-
2447 fx -= half_point;-
2448 fy -= half_point;-
2449-
2450 if (fdy == 0) { //simple scale, no rotation
fdy == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2451 int y1 = (fy >> 16);-
2452 int y2;-
2453 fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);-
2454 const uchar *s1 = data->texture.scanLine(y1);-
2455 const uchar *s2 = data->texture.scanLine(y2);-
2456-
2457 if (fdx <= fixed_scale && fdx > 0) { // scale up on X
fdx <= fixed_scaleDescription
TRUEnever evaluated
FALSEnever evaluated
fdx > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2458 int disty = (fy & 0x0000ffff) >> 8;-
2459 int idisty = 256 - disty;-
2460 int x = fx >> 16;-
2461-
2462 // The idea is first to do the interpolation between the row s1 and the row s2-
2463 // into an intermediate buffer, then we interpolate between two pixel of this buffer.-
2464 FetchPixelsFunc fetch = qFetchPixels[layout->bpp];-
2465 // +1 for the last pixel to interpolate with, and +1 for rounding errors.-
2466 uint buf1[buffer_size + 2];-
2467 uint buf2[buffer_size + 2];-
2468 const uint *ptr1;-
2469 const uint *ptr2;-
2470-
2471 int count = (qint64(length) * fdx + fixed_scale - 1) / fixed_scale + 2;-
2472 Q_ASSERT(count <= buffer_size + 2); //length is supposed to be <= buffer_size and data->m11 < 1 in this case-
2473-
2474 if (blendType == BlendTransformedBilinearTiled) {
blendType == B...dBilinearTiledDescription
TRUEnever evaluated
FALSEnever evaluated
0
2475 x %= image_width;-
2476 if (x < 0)
x < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2477 x += image_width;
never executed: x += image_width;
0
2478 int len1 = qMin(count, image_width - x);-
2479 int len2 = qMin(x, count - len1);-
2480-
2481 ptr1 = fetch(buf1, s1, x, len1);-
2482 ptr1 = layout->convertToARGB32PM(buf1, ptr1, len1, layout, clut);-
2483 ptr2 = fetch(buf2, s2, x, len1);-
2484 ptr2 = layout->convertToARGB32PM(buf2, ptr2, len1, layout, clut);-
2485 for (int i = 0; i < len1; ++i) {
i < len1Description
TRUEnever evaluated
FALSEnever evaluated
0
2486 uint t = ptr1[i];-
2487 uint b = ptr2[i];-
2488 buf1[i] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff;-
2489 buf2[i] = ((((t >> 8) & 0xff00ff) * idisty + ((b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff;-
2490 }
never executed: end of block
0
2491-
2492 if (len2) {
len2Description
TRUEnever evaluated
FALSEnever evaluated
0
2493 ptr1 = fetch(buf1 + len1, s1, 0, len2);-
2494 ptr1 = layout->convertToARGB32PM(buf1 + len1, ptr1, len2, layout, clut);-
2495 ptr2 = fetch(buf2 + len1, s2, 0, len2);-
2496 ptr2 = layout->convertToARGB32PM(buf2 + len1, ptr2, len2, layout, clut);-
2497 for (int i = 0; i < len2; ++i) {
i < len2Description
TRUEnever evaluated
FALSEnever evaluated
0
2498 uint t = ptr1[i];-
2499 uint b = ptr2[i];-
2500 buf1[i + len1] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff;-
2501 buf2[i + len1] = ((((t >> 8) & 0xff00ff) * idisty + ((b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff;-
2502 }
never executed: end of block
0
2503 }
never executed: end of block
0
2504 for (int i = image_width; i < count; ++i) {
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
2505 buf1[i] = buf1[i - image_width];-
2506 buf2[i] = buf2[i - image_width];-
2507 }
never executed: end of block
0
2508 } else {
never executed: end of block
0
2509 int start = qMax(x, image_x1);-
2510 int end = qMin(x + count, image_x2 + 1);-
2511 int len = qMax(1, end - start);-
2512 int leading = start - x;-
2513-
2514 ptr1 = fetch(buf1 + leading, s1, start, len);-
2515 ptr1 = layout->convertToARGB32PM(buf1 + leading, ptr1, len, layout, clut);-
2516 ptr2 = fetch(buf2 + leading, s2, start, len);-
2517 ptr2 = layout->convertToARGB32PM(buf2 + leading, ptr2, len, layout, clut);-
2518-
2519 for (int i = 0; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
2520 uint t = ptr1[i];-
2521 uint b = ptr2[i];-
2522 buf1[i + leading] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff;-
2523 buf2[i + leading] = ((((t >> 8) & 0xff00ff) * idisty + ((b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff;-
2524 }
never executed: end of block
0
2525-
2526 for (int i = 0; i < leading; ++i) {
i < leadingDescription
TRUEnever evaluated
FALSEnever evaluated
0
2527 buf1[i] = buf1[leading];-
2528 buf2[i] = buf2[leading];-
2529 }
never executed: end of block
0
2530 for (int i = leading + len; i < count; ++i) {
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
0
2531 buf1[i] = buf1[i - 1];-
2532 buf2[i] = buf2[i - 1];-
2533 }
never executed: end of block
0
2534 }
never executed: end of block
0
2535-
2536 // Now interpolate the values from the intermediate_buffer to get the final result.-
2537 fx &= fixed_scale - 1;-
2538 Q_ASSERT((fx >> 16) == 0);-
2539 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
2540 int x1 = (fx >> 16);-
2541 int x2 = x1 + 1;-
2542 Q_ASSERT(x1 >= 0);-
2543 Q_ASSERT(x2 < count);-
2544-
2545 int distx = (fx & 0x0000ffff) >> 8;-
2546 int idistx = 256 - distx;-
2547 int rb = ((buf1[x1] * idistx + buf1[x2] * distx) >> 8) & 0xff00ff;-
2548 int ag = (buf2[x1] * idistx + buf2[x2] * distx) & 0xff00ff00;-
2549 buffer[i] = rb | ag;-
2550 fx += fdx;-
2551 }
never executed: end of block
0
2552 } else {
never executed: end of block
0
2553 FetchPixelFunc fetch = qFetchPixel[layout->bpp];-
2554 uint buf1[buffer_size];-
2555 uint buf2[buffer_size];-
2556 uint *b = buffer;-
2557 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
2558 int len = qMin(length, buffer_size / 2);-
2559 int fracX = fx;-
2560 for (int i = 0; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
2561 int x1 = (fx >> 16);-
2562 int x2;-
2563 fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);-
2564-
2565 if (layout->bpp == QPixelLayout::BPP32) {
layout->bpp ==...lLayout::BPP32Description
TRUEnever evaluated
FALSEnever evaluated
0
2566 buf1[i * 2 + 0] = ((const uint*)s1)[x1];-
2567 buf1[i * 2 + 1] = ((const uint*)s1)[x2];-
2568 buf2[i * 2 + 0] = ((const uint*)s2)[x1];-
2569 buf2[i * 2 + 1] = ((const uint*)s2)[x2];-
2570 } else {
never executed: end of block
0
2571 buf1[i * 2 + 0] = fetch(s1, x1);-
2572 buf1[i * 2 + 1] = fetch(s1, x2);-
2573 buf2[i * 2 + 0] = fetch(s2, x1);-
2574 buf2[i * 2 + 1] = fetch(s2, x2);-
2575 }
never executed: end of block
0
2576-
2577 fx += fdx;-
2578 }
never executed: end of block
0
2579 layout->convertToARGB32PM(buf1, buf1, len * 2, layout, clut);-
2580 layout->convertToARGB32PM(buf2, buf2, len * 2, layout, clut);-
2581-
2582 if ((fdx < 0 && fdx > -(fixed_scale / 8)) || std::abs(data->m22) < (1./8.)) { // scale up more than 8x
fdx < 0Description
TRUEnever evaluated
FALSEnever evaluated
fdx > -(fixed_scale / 8)Description
TRUEnever evaluated
FALSEnever evaluated
std::abs(data->m22) < (1./8.)Description
TRUEnever evaluated
FALSEnever evaluated
0
2583 int disty = (fy & 0x0000ffff) >> 8;-
2584 for (int i = 0; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
2585 int distx = (fracX & 0x0000ffff) >> 8;-
2586 b[i] = interpolate_4_pixels(buf1 + i * 2, buf2 + i * 2, distx, disty);-
2587 fracX += fdx;-
2588 }
never executed: end of block
0
2589 } else { //scale down
never executed: end of block
0
2590 int disty = (fy & 0x0000ffff) >> 12;-
2591 for (int i = 0; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
2592 uint tl = buf1[i * 2 + 0];-
2593 uint tr = buf1[i * 2 + 1];-
2594 uint bl = buf2[i * 2 + 0];-
2595 uint br = buf2[i * 2 + 1];-
2596 int distx = (fracX & 0x0000ffff) >> 12;-
2597 b[i] = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty);-
2598 fracX += fdx;-
2599 }
never executed: end of block
0
2600 }
never executed: end of block
0
2601 length -= len;-
2602 b += len;-
2603 }
never executed: end of block
0
2604 }
never executed: end of block
0
2605 } else { //rotation-
2606 FetchPixelFunc fetch = qFetchPixel[layout->bpp];-
2607 uint buf1[buffer_size];-
2608 uint buf2[buffer_size];-
2609 uint *b = buffer;-
2610-
2611 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
2612 int len = qMin(length, buffer_size / 2);-
2613 int fracX = fx;-
2614 int fracY = fy;-
2615 for (int i = 0; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
2616 int x1 = (fx >> 16);-
2617 int x2;-
2618 int y1 = (fy >> 16);-
2619 int y2;-
2620 fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);-
2621 fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);-
2622-
2623 const uchar *s1 = data->texture.scanLine(y1);-
2624 const uchar *s2 = data->texture.scanLine(y2);-
2625-
2626 if (layout->bpp == QPixelLayout::BPP32) {
layout->bpp ==...lLayout::BPP32Description
TRUEnever evaluated
FALSEnever evaluated
0
2627 buf1[i * 2 + 0] = ((const uint*)s1)[x1];-
2628 buf1[i * 2 + 1] = ((const uint*)s1)[x2];-
2629 buf2[i * 2 + 0] = ((const uint*)s2)[x1];-
2630 buf2[i * 2 + 1] = ((const uint*)s2)[x2];-
2631 } else {
never executed: end of block
0
2632 buf1[i * 2 + 0] = fetch(s1, x1);-
2633 buf1[i * 2 + 1] = fetch(s1, x2);-
2634 buf2[i * 2 + 0] = fetch(s2, x1);-
2635 buf2[i * 2 + 1] = fetch(s2, x2);-
2636 }
never executed: end of block
0
2637-
2638 fx += fdx;-
2639 fy += fdy;-
2640 }
never executed: end of block
0
2641 layout->convertToARGB32PM(buf1, buf1, len * 2, layout, clut);-
2642 layout->convertToARGB32PM(buf2, buf2, len * 2, layout, clut);-
2643-
2644 if (std::abs(data->m11) > 8 || std::abs(data->m22) > 8) {
std::abs(data->m11) > 8Description
TRUEnever evaluated
FALSEnever evaluated
std::abs(data->m22) > 8Description
TRUEnever evaluated
FALSEnever evaluated
0
2645 //if we are zooming more than 8 times, we use 8bit precision for the position.-
2646 for (int i = 0; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
2647 int distx = (fracX & 0x0000ffff) >> 8;-
2648 int disty = (fracY & 0x0000ffff) >> 8;-
2649-
2650 b[i] = interpolate_4_pixels(buf1 + i * 2, buf2 + i * 2, distx, disty);-
2651 fracX += fdx;-
2652 fracY += fdy;-
2653 }
never executed: end of block
0
2654 } else {
never executed: end of block
0
2655 //we are zooming less than 8x, use 4bit precision-
2656 for (int i = 0; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
2657 uint tl = buf1[i * 2 + 0];-
2658 uint tr = buf1[i * 2 + 1];-
2659 uint bl = buf2[i * 2 + 0];-
2660 uint br = buf2[i * 2 + 1];-
2661-
2662 int distx = (fracX & 0x0000ffff) >> 12;-
2663 int disty = (fracY & 0x0000ffff) >> 12;-
2664-
2665 b[i] = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty);-
2666 fracX += fdx;-
2667 fracY += fdy;-
2668 }
never executed: end of block
0
2669 }
never executed: end of block
0
2670-
2671 length -= len;-
2672 b += len;-
2673 }
never executed: end of block
0
2674 }
never executed: end of block
0
2675 } else {-
2676 const qreal fdx = data->m11;-
2677 const qreal fdy = data->m12;-
2678 const qreal fdw = data->m13;-
2679-
2680 qreal fx = data->m21 * cy + data->m11 * cx + data->dx;-
2681 qreal fy = data->m22 * cy + data->m12 * cx + data->dy;-
2682 qreal fw = data->m23 * cy + data->m13 * cx + data->m33;-
2683-
2684 FetchPixelFunc fetch = qFetchPixel[layout->bpp];-
2685 uint buf1[buffer_size];-
2686 uint buf2[buffer_size];-
2687 uint *b = buffer;-
2688-
2689 int distxs[buffer_size / 2];-
2690 int distys[buffer_size / 2];-
2691-
2692 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
2693 int len = qMin(length, buffer_size / 2);-
2694 for (int i = 0; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
2695 const qreal iw = fw == 0 ? 1 : 1 / fw;-
2696 const qreal px = fx * iw - qreal(0.5);-
2697 const qreal py = fy * iw - qreal(0.5);-
2698-
2699 int x1 = int(px) - (px < 0);-
2700 int x2;-
2701 int y1 = int(py) - (py < 0);-
2702 int y2;-
2703-
2704 distxs[i] = int((px - x1) * 256);-
2705 distys[i] = int((py - y1) * 256);-
2706-
2707 fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);-
2708 fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);-
2709-
2710 const uchar *s1 = data->texture.scanLine(y1);-
2711 const uchar *s2 = data->texture.scanLine(y2);-
2712-
2713 if (layout->bpp == QPixelLayout::BPP32) {
layout->bpp ==...lLayout::BPP32Description
TRUEnever evaluated
FALSEnever evaluated
0
2714 buf1[i * 2 + 0] = ((const uint*)s1)[x1];-
2715 buf1[i * 2 + 1] = ((const uint*)s1)[x2];-
2716 buf2[i * 2 + 0] = ((const uint*)s2)[x1];-
2717 buf2[i * 2 + 1] = ((const uint*)s2)[x2];-
2718 } else {
never executed: end of block
0
2719 buf1[i * 2 + 0] = fetch(s1, x1);-
2720 buf1[i * 2 + 1] = fetch(s1, x2);-
2721 buf2[i * 2 + 0] = fetch(s2, x1);-
2722 buf2[i * 2 + 1] = fetch(s2, x2);-
2723 }
never executed: end of block
0
2724-
2725 fx += fdx;-
2726 fy += fdy;-
2727 fw += fdw;-
2728 //force increment to avoid /0-
2729 if (!fw)
!fwDescription
TRUEnever evaluated
FALSEnever evaluated
0
2730 fw += fdw;
never executed: fw += fdw;
0
2731 }
never executed: end of block
0
2732-
2733 layout->convertToARGB32PM(buf1, buf1, len * 2, layout, clut);-
2734 layout->convertToARGB32PM(buf2, buf2, len * 2, layout, clut);-
2735-
2736 for (int i = 0; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
2737 int distx = distxs[i];-
2738 int disty = distys[i];-
2739-
2740 b[i] = interpolate_4_pixels(buf1 + i * 2, buf2 + i * 2, distx, disty);-
2741 }
never executed: end of block
0
2742 length -= len;-
2743 b += len;-
2744 }
never executed: end of block
0
2745 }
never executed: end of block
0
2746-
2747 return buffer;
never executed: return buffer;
0
2748}-
2749-
2750template<TextureBlendType blendType>-
2751static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, const Operator *,-
2752 const QSpanData *data, int y, int x, int length)-
2753{-
2754 const QPixelLayout *layout = &qPixelLayouts[data->texture.format];-
2755 const QRgb *clut = data->texture.colorTable ? data->texture.colorTable->constData() : 0;-
2756-
2757 int image_width = data->texture.width;-
2758 int image_height = data->texture.height;-
2759-
2760 int image_x1 = data->texture.x1;-
2761 int image_y1 = data->texture.y1;-
2762 int image_x2 = data->texture.x2 - 1;-
2763 int image_y2 = data->texture.y2 - 1;-
2764-
2765 const qreal cx = x + qreal(0.5);-
2766 const qreal cy = y + qreal(0.5);-
2767-
2768 const qreal fdx = data->m11;-
2769 const qreal fdy = data->m12;-
2770 const qreal fdw = data->m13;-
2771-
2772 if (data->fast_matrix) {
data->fast_matrixDescription
TRUEnever evaluated
FALSEnever evaluated
0
2773 // The increment pr x in the scanline-
2774 int fdx = (int)(data->m11 * fixed_scale);-
2775 int fdy = (int)(data->m12 * fixed_scale);-
2776-
2777 int fx = int((data->m21 * cy + data->m11 * cx + data->dx) * fixed_scale);-
2778 int fy = int((data->m22 * cy + data->m12 * cx + data->dy) * fixed_scale);-
2779-
2780 fx -= half_point;-
2781 fy -= half_point;-
2782-
2783 if (fdy == 0) { //simple scale, no rotation
fdy == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2784 int y1 = (fy >> 16);-
2785 int y2;-
2786 fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);-
2787 const uchar *s1 = data->texture.scanLine(y1);-
2788 const uchar *s2 = data->texture.scanLine(y2);-
2789-
2790 FetchPixelFunc fetch = qFetchPixel[layout->bpp];-
2791 uint sbuf1[buffer_size];-
2792 uint sbuf2[buffer_size];-
2793 QRgba64 buf1[buffer_size];-
2794 QRgba64 buf2[buffer_size];-
2795 QRgba64 *b = buffer;-
2796 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
2797 int len = qMin(length, buffer_size / 2);-
2798 int fracX = fx;-
2799 int i = 0;-
2800 int disty = (fy & 0x0000ffff);-
2801#if defined(__SSE2__)-
2802 const __m128i vdy = _mm_set1_epi16(disty);-
2803 const __m128i vidy = _mm_set1_epi16(0x10000 - disty);-
2804 if (blendType != BlendTransformedBilinearTiled && layout->bpp == QPixelLayout::BPP32) {
blendType != B...dBilinearTiledDescription
TRUEnever evaluated
FALSEnever evaluated
layout->bpp ==...lLayout::BPP32Description
TRUEnever evaluated
FALSEnever evaluated
0
2805 for (; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
2806 int x1 = (fx >> 16);-
2807 int x2;-
2808 fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);-
2809 if (x1 != x2)
x1 != x2Description
TRUEnever evaluated
FALSEnever evaluated
0
2810 break;
never executed: break;
0
2811 sbuf1[i * 2 + 0] = ((const uint*)s1)[x1];-
2812 sbuf1[i * 2 + 1] = ((const uint*)s1)[x2];-
2813 sbuf2[i * 2 + 0] = ((const uint*)s2)[x1];-
2814 sbuf2[i * 2 + 1] = ((const uint*)s2)[x2];-
2815 fx += fdx;-
2816 }
never executed: end of block
0
2817 int fastLen;-
2818 if (fdx > 0)
fdx > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2819 fastLen = qMin(len, int((image_x2 - (fx >> 16)) / data->m11));
never executed: fastLen = qMin(len, int((image_x2 - (fx >> 16)) / data->m11));
0
2820 else-
2821 fastLen = qMin(len, int((image_x1 - (fx >> 16)) / data->m11));
never executed: fastLen = qMin(len, int((image_x1 - (fx >> 16)) / data->m11));
0
2822 fastLen -= 3;-
2823-
2824 const __m128i v_fdx = _mm_set1_epi32(fdx*4);-
2825 __m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx);-
2826 for (; i < fastLen; i += 4) {
i < fastLenDescription
TRUEnever evaluated
FALSEnever evaluated
0
2827 int offset = _mm_extract_epi16(v_fx, 1);-
2828 sbuf1[i * 2 + 0] = ((const uint*)s1)[offset];-
2829 sbuf1[i * 2 + 1] = ((const uint*)s1)[offset + 1];-
2830 sbuf2[i * 2 + 0] = ((const uint*)s2)[offset];-
2831 sbuf2[i * 2 + 1] = ((const uint*)s2)[offset + 1];-
2832 offset = _mm_extract_epi16(v_fx, 3);-
2833 sbuf1[i * 2 + 2] = ((const uint*)s1)[offset];-
2834 sbuf1[i * 2 + 3] = ((const uint*)s1)[offset + 1];-
2835 sbuf2[i * 2 + 2] = ((const uint*)s2)[offset];-
2836 sbuf2[i * 2 + 3] = ((const uint*)s2)[offset + 1];-
2837 offset = _mm_extract_epi16(v_fx, 5);-
2838 sbuf1[i * 2 + 4] = ((const uint*)s1)[offset];-
2839 sbuf1[i * 2 + 5] = ((const uint*)s1)[offset + 1];-
2840 sbuf2[i * 2 + 4] = ((const uint*)s2)[offset];-
2841 sbuf2[i * 2 + 5] = ((const uint*)s2)[offset + 1];-
2842 offset = _mm_extract_epi16(v_fx, 7);-
2843 sbuf1[i * 2 + 6] = ((const uint*)s1)[offset];-
2844 sbuf1[i * 2 + 7] = ((const uint*)s1)[offset + 1];-
2845 sbuf2[i * 2 + 6] = ((const uint*)s2)[offset];-
2846 sbuf2[i * 2 + 7] = ((const uint*)s2)[offset + 1];-
2847 v_fx = _mm_add_epi32(v_fx, v_fdx);-
2848 }
never executed: end of block
0
2849 fx = _mm_cvtsi128_si32(v_fx);-
2850 }
never executed: end of block
0
2851#endif-
2852 for (; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
2853 int x1 = (fx >> 16);-
2854 int x2;-
2855 fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);-
2856-
2857 if (layout->bpp == QPixelLayout::BPP32) {
layout->bpp ==...lLayout::BPP32Description
TRUEnever evaluated
FALSEnever evaluated
0
2858 sbuf1[i * 2 + 0] = ((const uint*)s1)[x1];-
2859 sbuf1[i * 2 + 1] = ((const uint*)s1)[x2];-
2860 sbuf2[i * 2 + 0] = ((const uint*)s2)[x1];-
2861 sbuf2[i * 2 + 1] = ((const uint*)s2)[x2];-
2862-
2863 } else {
never executed: end of block
0
2864 sbuf1[i * 2 + 0] = fetch(s1, x1);-
2865 sbuf1[i * 2 + 1] = fetch(s1, x2);-
2866 sbuf2[i * 2 + 0] = fetch(s2, x1);-
2867 sbuf2[i * 2 + 1] = fetch(s2, x2);-
2868 }
never executed: end of block
0
2869-
2870 fx += fdx;-
2871 }
never executed: end of block
0
2872 layout->convertToARGB64PM(buf1, sbuf1, len * 2, layout, clut);-
2873 if (disty)
distyDescription
TRUEnever evaluated
FALSEnever evaluated
0
2874 layout->convertToARGB64PM(buf2, sbuf2, len * 2, layout, clut);
never executed: layout->convertToARGB64PM(buf2, sbuf2, len * 2, layout, clut);
0
2875-
2876 for (int i = 0; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
2877 int distx = (fracX & 0x0000ffff);-
2878#if defined(__SSE2__)-
2879 const __m128i vdistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(distx), _MM_SHUFFLE(0, 0, 0, 0));-
2880 const __m128i vidistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(0x10000 - distx), _MM_SHUFFLE(0, 0, 0, 0));-
2881 __m128i vt = _mm_loadu_si128((const __m128i*)(buf1 + i*2));-
2882 if (disty) {
distyDescription
TRUEnever evaluated
FALSEnever evaluated
0
2883 __m128i vb = _mm_loadu_si128((const __m128i*)(buf2 + i*2));-
2884 vt = _mm_mulhi_epu16(vt, vidy);-
2885 vb = _mm_mulhi_epu16(vb, vdy);-
2886 vt = _mm_add_epi16(vt, vb);-
2887 }
never executed: end of block
0
2888 vt = _mm_mulhi_epu16(vt, _mm_unpacklo_epi64(vidistx, vdistx));-
2889 vt = _mm_add_epi16(vt, _mm_srli_si128(vt, 8));-
2890 _mm_storel_epi64((__m128i*)(b+i), vt);-
2891#else-
2892 b[i] = interpolate_4_pixels_rgb64(buf1 + i*2, buf2 + i*2, distx, disty);-
2893#endif-
2894 fracX += fdx;-
2895 }
never executed: end of block
0
2896 length -= len;-
2897 b += len;-
2898 }
never executed: end of block
0
2899 } else { //rotation
never executed: end of block
0
2900 FetchPixelFunc fetch = qFetchPixel[layout->bpp];-
2901 uint sbuf1[buffer_size];-
2902 uint sbuf2[buffer_size];-
2903 QRgba64 buf1[buffer_size];-
2904 QRgba64 buf2[buffer_size];-
2905 QRgba64 *end = buffer + length;-
2906 QRgba64 *b = buffer;-
2907-
2908 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
2909 int len = qMin(length, buffer_size / 2);-
2910 int fracX = fx;-
2911 int fracY = fy;-
2912 int i = 0;-
2913#if defined(__SSE2__)-
2914 if (blendType != BlendTransformedBilinearTiled && layout->bpp == QPixelLayout::BPP32) {
blendType != B...dBilinearTiledDescription
TRUEnever evaluated
FALSEnever evaluated
layout->bpp ==...lLayout::BPP32Description
TRUEnever evaluated
FALSEnever evaluated
0
2915 for (; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
2916 int x1 = (fx >> 16);-
2917 int x2;-
2918 int y1 = (fy >> 16);-
2919 int y2;-
2920 fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);-
2921 fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);-
2922 if (x1 != x2 && y1 != y2)
x1 != x2Description
TRUEnever evaluated
FALSEnever evaluated
y1 != y2Description
TRUEnever evaluated
FALSEnever evaluated
0
2923 break;
never executed: break;
0
2924 const uchar *s1 = data->texture.scanLine(y1);-
2925 const uchar *s2 = data->texture.scanLine(y2);-
2926 sbuf1[i * 2 + 0] = ((const uint*)s1)[x1];-
2927 sbuf1[i * 2 + 1] = ((const uint*)s1)[x2];-
2928 sbuf2[i * 2 + 0] = ((const uint*)s2)[x1];-
2929 sbuf2[i * 2 + 1] = ((const uint*)s2)[x2];-
2930 fx += fdx;-
2931 fy += fdy;-
2932 }
never executed: end of block
0
2933-
2934 const __m128i v_fdx = _mm_set1_epi32(fdx*4);-
2935 const __m128i v_fdy = _mm_set1_epi32(fdy*4);-
2936 __m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx);-
2937 __m128i v_fy = _mm_setr_epi32(fy, fy + fdy, fy + fdy + fdy, fy + fdy + fdy + fdy);-
2938 const int bytesPerLine = data->texture.bytesPerLine;-
2939 const uchar *s1 = data->texture.imageData;-
2940 const uchar *s2 = s1 + bytesPerLine;-
2941 const __m128i vbpl = _mm_shufflelo_epi16(_mm_cvtsi32_si128(bytesPerLine/4), _MM_SHUFFLE(0, 0, 0, 0));-
2942 for (; i < len-3; i+=4) {
i < len-3Description
TRUEnever evaluated
FALSEnever evaluated
0
2943 if (fdx > 0 && (short)_mm_extract_epi16(v_fx, 7) >= image_x2)
fdx > 0Description
TRUEnever evaluated
FALSEnever evaluated
(short)((int) ...)) >= image_x2Description
TRUEnever evaluated
FALSEnever evaluated
0
2944 break;
never executed: break;
0
2945 if (fdx < 0 && (short)_mm_extract_epi16(v_fx, 7) < image_x1)
fdx < 0Description
TRUEnever evaluated
FALSEnever evaluated
(short)((int) ...))) < image_x1Description
TRUEnever evaluated
FALSEnever evaluated
0
2946 break;
never executed: break;
0
2947 if (fdy > 0 && (short)_mm_extract_epi16(v_fy, 7) >= image_y2)
fdy > 0Description
TRUEnever evaluated
FALSEnever evaluated
(short)((int) ...)) >= image_y2Description
TRUEnever evaluated
FALSEnever evaluated
0
2948 break;
never executed: break;
0
2949 if (fdy < 0 && (short)_mm_extract_epi16(v_fy, 7) < image_y1)
fdy < 0Description
TRUEnever evaluated
FALSEnever evaluated
(short)((int) ...))) < image_y1Description
TRUEnever evaluated
FALSEnever evaluated
0
2950 break;
never executed: break;
0
2951 const __m128i vy = _mm_packs_epi32(_mm_srai_epi32(v_fy, 16), _mm_setzero_si128());-
2952 __m128i voffset = _mm_unpacklo_epi16(_mm_mullo_epi16(vy, vbpl), _mm_mulhi_epu16(vy, vbpl));-
2953 voffset = _mm_add_epi32(voffset, _mm_srli_epi32(v_fx, 16));-
2954-
2955 int offset = _mm_cvtsi128_si32(voffset); voffset = _mm_srli_si128(voffset, 4);-
2956 sbuf1[i * 2 + 0] = ((const uint*)s1)[offset];-
2957 sbuf1[i * 2 + 1] = ((const uint*)s1)[offset + 1];-
2958 sbuf2[i * 2 + 0] = ((const uint*)s2)[offset];-
2959 sbuf2[i * 2 + 1] = ((const uint*)s2)[offset + 1];-
2960 offset = _mm_cvtsi128_si32(voffset); voffset = _mm_srli_si128(voffset, 4);-
2961 sbuf1[i * 2 + 2] = ((const uint*)s1)[offset];-
2962 sbuf1[i * 2 + 3] = ((const uint*)s1)[offset + 1];-
2963 sbuf2[i * 2 + 2] = ((const uint*)s2)[offset];-
2964 sbuf2[i * 2 + 3] = ((const uint*)s2)[offset + 1];-
2965 offset = _mm_cvtsi128_si32(voffset); voffset = _mm_srli_si128(voffset, 4);-
2966 sbuf1[i * 2 + 4] = ((const uint*)s1)[offset];-
2967 sbuf1[i * 2 + 5] = ((const uint*)s1)[offset + 1];-
2968 sbuf2[i * 2 + 4] = ((const uint*)s2)[offset];-
2969 sbuf2[i * 2 + 5] = ((const uint*)s2)[offset + 1];-
2970 offset = _mm_cvtsi128_si32(voffset);-
2971 sbuf1[i * 2 + 6] = ((const uint*)s1)[offset];-
2972 sbuf1[i * 2 + 7] = ((const uint*)s1)[offset + 1];-
2973 sbuf2[i * 2 + 6] = ((const uint*)s2)[offset];-
2974 sbuf2[i * 2 + 7] = ((const uint*)s2)[offset + 1];-
2975-
2976 v_fx = _mm_add_epi32(v_fx, v_fdx);-
2977 v_fy = _mm_add_epi32(v_fy, v_fdy);-
2978 }
never executed: end of block
0
2979 fx = _mm_cvtsi128_si32(v_fx);-
2980 fy = _mm_cvtsi128_si32(v_fy);-
2981 }
never executed: end of block
0
2982#endif-
2983 for (; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
2984 int x1 = (fx >> 16);-
2985 int x2;-
2986 int y1 = (fy >> 16);-
2987 int y2;-
2988 fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);-
2989 fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);-
2990-
2991 const uchar *s1 = data->texture.scanLine(y1);-
2992 const uchar *s2 = data->texture.scanLine(y2);-
2993-
2994 if (layout->bpp == QPixelLayout::BPP32) {
layout->bpp ==...lLayout::BPP32Description
TRUEnever evaluated
FALSEnever evaluated
0
2995 sbuf1[i * 2 + 0] = ((const uint*)s1)[x1];-
2996 sbuf1[i * 2 + 1] = ((const uint*)s1)[x2];-
2997 sbuf2[i * 2 + 0] = ((const uint*)s2)[x1];-
2998 sbuf2[i * 2 + 1] = ((const uint*)s2)[x2];-
2999-
3000 } else {
never executed: end of block
0
3001 sbuf1[i * 2 + 0] = fetch(s1, x1);-
3002 sbuf1[i * 2 + 1] = fetch(s1, x2);-
3003 sbuf2[i * 2 + 0] = fetch(s2, x1);-
3004 sbuf2[i * 2 + 1] = fetch(s2, x2);-
3005 }
never executed: end of block
0
3006-
3007 fx += fdx;-
3008 fy += fdy;-
3009 }
never executed: end of block
0
3010 layout->convertToARGB64PM(buf1, sbuf1, len * 2, layout, clut);-
3011 layout->convertToARGB64PM(buf2, sbuf2, len * 2, layout, clut);-
3012-
3013 for (int i = 0; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
3014 int distx = (fracX & 0x0000ffff);-
3015 int disty = (fracY & 0x0000ffff);-
3016 b[i] = interpolate_4_pixels_rgb64(buf1 + i*2, buf2 + i*2, distx, disty);-
3017 fracX += fdx;-
3018 fracY += fdy;-
3019 }
never executed: end of block
0
3020-
3021 length -= len;-
3022 b += len;-
3023 }
never executed: end of block
0
3024 }
never executed: end of block
0
3025 } else {-
3026 qreal fx = data->m21 * cy + data->m11 * cx + data->dx;-
3027 qreal fy = data->m22 * cy + data->m12 * cx + data->dy;-
3028 qreal fw = data->m23 * cy + data->m13 * cx + data->m33;-
3029-
3030 FetchPixelFunc fetch = qFetchPixel[layout->bpp];-
3031 uint sbuf1[buffer_size];-
3032 uint sbuf2[buffer_size];-
3033 QRgba64 buf1[buffer_size];-
3034 QRgba64 buf2[buffer_size];-
3035 QRgba64 *b = buffer;-
3036-
3037 int distxs[buffer_size / 2];-
3038 int distys[buffer_size / 2];-
3039-
3040 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
3041 int len = qMin(length, buffer_size / 2);-
3042 for (int i = 0; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
3043 const qreal iw = fw == 0 ? 1 : 1 / fw;-
3044 const qreal px = fx * iw - qreal(0.5);-
3045 const qreal py = fy * iw - qreal(0.5);-
3046-
3047 int x1 = int(px) - (px < 0);-
3048 int x2;-
3049 int y1 = int(py) - (py < 0);-
3050 int y2;-
3051-
3052 distxs[i] = int((px - x1) * (1<<16));-
3053 distys[i] = int((py - y1) * (1<<16));-
3054-
3055 fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);-
3056 fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);-
3057-
3058 const uchar *s1 = data->texture.scanLine(y1);-
3059 const uchar *s2 = data->texture.scanLine(y2);-
3060-
3061 if (layout->bpp == QPixelLayout::BPP32) {
layout->bpp ==...lLayout::BPP32Description
TRUEnever evaluated
FALSEnever evaluated
0
3062 sbuf1[i * 2 + 0] = ((const uint*)s1)[x1];-
3063 sbuf1[i * 2 + 1] = ((const uint*)s1)[x2];-
3064 sbuf2[i * 2 + 0] = ((const uint*)s2)[x1];-
3065 sbuf2[i * 2 + 1] = ((const uint*)s2)[x2];-
3066-
3067 } else {
never executed: end of block
0
3068 sbuf1[i * 2 + 0] = fetch(s1, x1);-
3069 sbuf1[i * 2 + 1] = fetch(s1, x2);-
3070 sbuf2[i * 2 + 0] = fetch(s2, x1);-
3071 sbuf2[i * 2 + 1] = fetch(s2, x2);-
3072 }
never executed: end of block
0
3073-
3074 fx += fdx;-
3075 fy += fdy;-
3076 fw += fdw;-
3077 //force increment to avoid /0-
3078 if (!fw)
!fwDescription
TRUEnever evaluated
FALSEnever evaluated
0
3079 fw += fdw;
never executed: fw += fdw;
0
3080 }
never executed: end of block
0
3081-
3082 layout->convertToARGB64PM(buf1, sbuf1, len * 2, layout, clut);-
3083 layout->convertToARGB64PM(buf2, sbuf2, len * 2, layout, clut);-
3084-
3085 for (int i = 0; i < len; ++i) {
i < lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
3086 int distx = distxs[i];-
3087 int disty = distys[i];-
3088 b[i] = interpolate_4_pixels_rgb64(buf1 + i*2, buf2 + i*2, distx, disty);-
3089 }
never executed: end of block
0
3090-
3091 length -= len;-
3092 b += len;-
3093 }
never executed: end of block
0
3094 }
never executed: end of block
0
3095-
3096 return buffer;
never executed: return buffer;
0
3097}-
3098-
3099static SourceFetchProc sourceFetch[NBlendTypes][QImage::NImageFormats] = {-
3100 // Untransformed-
3101 {-
3102 0, // Invalid-
3103 fetchUntransformed, // Mono-
3104 fetchUntransformed, // MonoLsb-
3105 fetchUntransformed, // Indexed8-
3106 fetchUntransformedARGB32PM, // RGB32-
3107 fetchUntransformed, // ARGB32-
3108 fetchUntransformedARGB32PM, // ARGB32_Premultiplied-
3109 fetchUntransformedRGB16, // RGB16-
3110 fetchUntransformed, // ARGB8565_Premultiplied-
3111 fetchUntransformed, // RGB666-
3112 fetchUntransformed, // ARGB6666_Premultiplied-
3113 fetchUntransformed, // RGB555-
3114 fetchUntransformed, // ARGB8555_Premultiplied-
3115 fetchUntransformed, // RGB888-
3116 fetchUntransformed, // RGB444-
3117 fetchUntransformed, // ARGB4444_Premultiplied-
3118 fetchUntransformed, // RGBX8888-
3119 fetchUntransformed, // RGBA8888-
3120 fetchUntransformed, // RGBA8888_Premultiplied-
3121 fetchUntransformed, // Format_BGR30-
3122 fetchUntransformed, // Format_A2BGR30_Premultiplied-
3123 fetchUntransformed, // Format_RGB30-
3124 fetchUntransformed, // Format_A2RGB30_Premultiplied-
3125 fetchUntransformed, // Alpha8-
3126 fetchUntransformed, // Grayscale8-
3127 },-
3128 // Tiled-
3129 {-
3130 0, // Invalid-
3131 fetchUntransformed, // Mono-
3132 fetchUntransformed, // MonoLsb-
3133 fetchUntransformed, // Indexed8-
3134 fetchUntransformedARGB32PM, // RGB32-
3135 fetchUntransformed, // ARGB32-
3136 fetchUntransformedARGB32PM, // ARGB32_Premultiplied-
3137 fetchUntransformedRGB16, // RGB16-
3138 fetchUntransformed, // ARGB8565_Premultiplied-
3139 fetchUntransformed, // RGB666-
3140 fetchUntransformed, // ARGB6666_Premultiplied-
3141 fetchUntransformed, // RGB555-
3142 fetchUntransformed, // ARGB8555_Premultiplied-
3143 fetchUntransformed, // RGB888-
3144 fetchUntransformed, // RGB444-
3145 fetchUntransformed, // ARGB4444_Premultiplied-
3146 fetchUntransformed, // RGBX8888-
3147 fetchUntransformed, // RGBA8888-
3148 fetchUntransformed, // RGBA8888_Premultiplied-
3149 fetchUntransformed, // BGR30-
3150 fetchUntransformed, // A2BGR30_Premultiplied-
3151 fetchUntransformed, // RGB30-
3152 fetchUntransformed, // A2RGB30_Premultiplied-
3153 fetchUntransformed, // Alpha8-
3154 fetchUntransformed, // Grayscale8-
3155 },-
3156 // Transformed-
3157 {-
3158 0, // Invalid-
3159 fetchTransformed<BlendTransformed>, // Mono-
3160 fetchTransformed<BlendTransformed>, // MonoLsb-
3161 fetchTransformed<BlendTransformed>, // Indexed8-
3162 fetchTransformedARGB32PM<BlendTransformed>, // RGB32-
3163 fetchTransformed<BlendTransformed>, // ARGB32-
3164 fetchTransformedARGB32PM<BlendTransformed>, // ARGB32_Premultiplied-
3165 fetchTransformed<BlendTransformed>, // RGB16-
3166 fetchTransformed<BlendTransformed>, // ARGB8565_Premultiplied-
3167 fetchTransformed<BlendTransformed>, // RGB666-
3168 fetchTransformed<BlendTransformed>, // ARGB6666_Premultiplied-
3169 fetchTransformed<BlendTransformed>, // RGB555-
3170 fetchTransformed<BlendTransformed>, // ARGB8555_Premultiplied-
3171 fetchTransformed<BlendTransformed>, // RGB888-
3172 fetchTransformed<BlendTransformed>, // RGB444-
3173 fetchTransformed<BlendTransformed>, // ARGB4444_Premultiplied-
3174 fetchTransformed<BlendTransformed>, // RGBX8888-
3175 fetchTransformed<BlendTransformed>, // RGBA8888-
3176 fetchTransformed<BlendTransformed>, // RGBA8888_Premultiplied-
3177 fetchTransformed<BlendTransformed>, // BGR30-
3178 fetchTransformed<BlendTransformed>, // A2BGR30_Premultiplied-
3179 fetchTransformed<BlendTransformed>, // RGB30-
3180 fetchTransformed<BlendTransformed>, // A2RGB30_Premultiplied-
3181 fetchTransformed<BlendTransformed>, // Alpah8-
3182 fetchTransformed<BlendTransformed>, // Grayscale8-
3183 },-
3184 {-
3185 0, // TransformedTiled-
3186 fetchTransformed<BlendTransformedTiled>, // Mono-
3187 fetchTransformed<BlendTransformedTiled>, // MonoLsb-
3188 fetchTransformed<BlendTransformedTiled>, // Indexed8-
3189 fetchTransformedARGB32PM<BlendTransformedTiled>, // RGB32-
3190 fetchTransformed<BlendTransformedTiled>, // ARGB32-
3191 fetchTransformedARGB32PM<BlendTransformedTiled>, // ARGB32_Premultiplied-
3192 fetchTransformed<BlendTransformedTiled>, // RGB16-
3193 fetchTransformed<BlendTransformedTiled>, // ARGB8565_Premultiplied-
3194 fetchTransformed<BlendTransformedTiled>, // RGB666-
3195 fetchTransformed<BlendTransformedTiled>, // ARGB6666_Premultiplied-
3196 fetchTransformed<BlendTransformedTiled>, // RGB555-
3197 fetchTransformed<BlendTransformedTiled>, // ARGB8555_Premultiplied-
3198 fetchTransformed<BlendTransformedTiled>, // RGB888-
3199 fetchTransformed<BlendTransformedTiled>, // RGB444-
3200 fetchTransformed<BlendTransformedTiled>, // ARGB4444_Premultiplied-
3201 fetchTransformed<BlendTransformedTiled>, // RGBX8888-
3202 fetchTransformed<BlendTransformedTiled>, // RGBA8888-
3203 fetchTransformed<BlendTransformedTiled>, // RGBA8888_Premultiplied-
3204 fetchTransformed<BlendTransformedTiled>, // BGR30-
3205 fetchTransformed<BlendTransformedTiled>, // A2BGR30_Premultiplied-
3206 fetchTransformed<BlendTransformedTiled>, // RGB30-
3207 fetchTransformed<BlendTransformedTiled>, // A2RGB30_Premultiplied-
3208 fetchTransformed<BlendTransformedTiled>, // Alpha8-
3209 fetchTransformed<BlendTransformedTiled>, // Grayscale8-
3210 },-
3211 {-
3212 0, // Bilinear-
3213 fetchTransformedBilinear<BlendTransformedBilinear>, // Mono-
3214 fetchTransformedBilinear<BlendTransformedBilinear>, // MonoLsb-
3215 fetchTransformedBilinear<BlendTransformedBilinear>, // Indexed8-
3216 fetchTransformedBilinearARGB32PM<BlendTransformedBilinear>, // RGB32-
3217 fetchTransformedBilinear<BlendTransformedBilinear>, // ARGB32-
3218 fetchTransformedBilinearARGB32PM<BlendTransformedBilinear>, // ARGB32_Premultiplied-
3219 fetchTransformedBilinear<BlendTransformedBilinear>, // RGB16-
3220 fetchTransformedBilinear<BlendTransformedBilinear>, // ARGB8565_Premultiplied-
3221 fetchTransformedBilinear<BlendTransformedBilinear>, // RGB666-
3222 fetchTransformedBilinear<BlendTransformedBilinear>, // ARGB6666_Premultiplied-
3223 fetchTransformedBilinear<BlendTransformedBilinear>, // RGB555-
3224 fetchTransformedBilinear<BlendTransformedBilinear>, // ARGB8555_Premultiplied-
3225 fetchTransformedBilinear<BlendTransformedBilinear>, // RGB888-
3226 fetchTransformedBilinear<BlendTransformedBilinear>, // RGB444-
3227 fetchTransformedBilinear<BlendTransformedBilinear>, // ARGB4444_Premultiplied-
3228 fetchTransformedBilinear<BlendTransformedBilinear>, // RGBX8888-
3229 fetchTransformedBilinear<BlendTransformedBilinear>, // RGBA8888-
3230 fetchTransformedBilinear<BlendTransformedBilinear>, // RGBA8888_Premultiplied-
3231 fetchTransformedBilinear<BlendTransformedBilinear>, // BGR30-
3232 fetchTransformedBilinear<BlendTransformedBilinear>, // A2BGR30_Premultiplied-
3233 fetchTransformedBilinear<BlendTransformedBilinear>, // RGB30-
3234 fetchTransformedBilinear<BlendTransformedBilinear>, // A2RGB30_Premultiplied-
3235 fetchTransformedBilinear<BlendTransformedBilinear>, // Alpha8-
3236 fetchTransformedBilinear<BlendTransformedBilinear>, // Grayscale8-
3237 },-
3238 {-
3239 0, // BilinearTiled-
3240 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // Mono-
3241 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // MonoLsb-
3242 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // Indexed8-
3243 fetchTransformedBilinearARGB32PM<BlendTransformedBilinearTiled>, // RGB32-
3244 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // ARGB32-
3245 fetchTransformedBilinearARGB32PM<BlendTransformedBilinearTiled>, // ARGB32_Premultiplied-
3246 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGB16-
3247 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // ARGB8565_Premultiplied-
3248 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGB666-
3249 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // ARGB6666_Premultiplied-
3250 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGB555-
3251 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // ARGB8555_Premultiplied-
3252 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGB888-
3253 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGB444-
3254 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // ARGB4444_Premultiplied-
3255 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGBX8888-
3256 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGBA8888-
3257 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGBA8888_Premultiplied-
3258 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // BGR30-
3259 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // A2BGR30_Premultiplied-
3260 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGB30-
3261 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // A2RGB30_Premultiplied-
3262 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // Alpha8-
3263 fetchTransformedBilinear<BlendTransformedBilinearTiled>, // Grayscale8-
3264 },-
3265};-
3266-
3267static SourceFetchProc64 sourceFetch64[NBlendTypes][QImage::NImageFormats] = {-
3268 // Untransformed-
3269 {-
3270 0, // Invalid-
3271 fetchUntransformed64, // Mono-
3272 fetchUntransformed64, // MonoLsb-
3273 fetchUntransformed64, // Indexed8-
3274 fetchUntransformed64, // RGB32-
3275 fetchUntransformed64, // ARGB32-
3276 fetchUntransformed64, // ARGB32_Premultiplied-
3277 fetchUntransformed64, // RGB16-
3278 fetchUntransformed64, // ARGB8565_Premultiplied-
3279 fetchUntransformed64, // RGB666-
3280 fetchUntransformed64, // ARGB6666_Premultiplied-
3281 fetchUntransformed64, // RGB555-
3282 fetchUntransformed64, // ARGB8555_Premultiplied-
3283 fetchUntransformed64, // RGB888-
3284 fetchUntransformed64, // RGB444-
3285 fetchUntransformed64, // ARGB4444_Premultiplied-
3286 fetchUntransformed64, // RGBX8888-
3287 fetchUntransformed64, // RGBA8888-
3288 fetchUntransformed64, // RGBA8888_Premultiplied-
3289 fetchUntransformed64, // Format_BGR30-
3290 fetchUntransformed64, // Format_A2BGR30_Premultiplied-
3291 fetchUntransformed64, // Format_RGB30-
3292 fetchUntransformed64, // Format_A2RGB30_Premultiplied-
3293 fetchUntransformed64, // Alpha8-
3294 fetchUntransformed64, // Grayscale8-
3295 },-
3296 // Tiled-
3297 {-
3298 0, // Invalid-
3299 fetchUntransformed64, // Mono-
3300 fetchUntransformed64, // MonoLsb-
3301 fetchUntransformed64, // Indexed8-
3302 fetchUntransformed64, // RGB32-
3303 fetchUntransformed64, // ARGB32-
3304 fetchUntransformed64, // ARGB32_Premultiplied-
3305 fetchUntransformed64, // RGB16-
3306 fetchUntransformed64, // ARGB8565_Premultiplied-
3307 fetchUntransformed64, // RGB666-
3308 fetchUntransformed64, // ARGB6666_Premultiplied-
3309 fetchUntransformed64, // RGB555-
3310 fetchUntransformed64, // ARGB8555_Premultiplied-
3311 fetchUntransformed64, // RGB888-
3312 fetchUntransformed64, // RGB444-
3313 fetchUntransformed64, // ARGB4444_Premultiplied-
3314 fetchUntransformed64, // RGBX8888-
3315 fetchUntransformed64, // RGBA8888-
3316 fetchUntransformed64, // RGBA8888_Premultiplied-
3317 fetchUntransformed64, // BGR30-
3318 fetchUntransformed64, // A2BGR30_Premultiplied-
3319 fetchUntransformed64, // RGB30-
3320 fetchUntransformed64, // A2RGB30_Premultiplied-
3321 fetchUntransformed64, // Alpha8-
3322 fetchUntransformed64, // Grayscale8-
3323 },-
3324 // Transformed-
3325 {-
3326 0, // Invalid-
3327 fetchTransformed64<BlendTransformed>, // Mono-
3328 fetchTransformed64<BlendTransformed>, // MonoLsb-
3329 fetchTransformed64<BlendTransformed>, // Indexed8-
3330 fetchTransformed64<BlendTransformed>, // RGB32-
3331 fetchTransformed64<BlendTransformed>, // ARGB32-
3332 fetchTransformed64<BlendTransformed>, // ARGB32_Premultiplied-
3333 fetchTransformed64<BlendTransformed>, // RGB16-
3334 fetchTransformed64<BlendTransformed>, // ARGB8565_Premultiplied-
3335 fetchTransformed64<BlendTransformed>, // RGB666-
3336 fetchTransformed64<BlendTransformed>, // ARGB6666_Premultiplied-
3337 fetchTransformed64<BlendTransformed>, // RGB555-
3338 fetchTransformed64<BlendTransformed>, // ARGB8555_Premultiplied-
3339 fetchTransformed64<BlendTransformed>, // RGB888-
3340 fetchTransformed64<BlendTransformed>, // RGB444-
3341 fetchTransformed64<BlendTransformed>, // ARGB4444_Premultiplied-
3342 fetchTransformed64<BlendTransformed>, // RGBX8888-
3343 fetchTransformed64<BlendTransformed>, // RGBA8888-
3344 fetchTransformed64<BlendTransformed>, // RGBA8888_Premultiplied-
3345 fetchTransformed64<BlendTransformed>, // BGR30-
3346 fetchTransformed64<BlendTransformed>, // A2BGR30_Premultiplied-
3347 fetchTransformed64<BlendTransformed>, // RGB30-
3348 fetchTransformed64<BlendTransformed>, // A2RGB30_Premultiplied-
3349 fetchTransformed64<BlendTransformed>, // Alpah8-
3350 fetchTransformed64<BlendTransformed>, // Grayscale8-
3351 },-
3352 {-
3353 0, // TransformedTiled-
3354 fetchTransformed64<BlendTransformedTiled>, // Mono-
3355 fetchTransformed64<BlendTransformedTiled>, // MonoLsb-
3356 fetchTransformed64<BlendTransformedTiled>, // Indexed8-
3357 fetchTransformed64<BlendTransformedTiled>, // RGB32-
3358 fetchTransformed64<BlendTransformedTiled>, // ARGB32-
3359 fetchTransformed64<BlendTransformedTiled>, // ARGB32_Premultiplied-
3360 fetchTransformed64<BlendTransformedTiled>, // RGB16-
3361 fetchTransformed64<BlendTransformedTiled>, // ARGB8565_Premultiplied-
3362 fetchTransformed64<BlendTransformedTiled>, // RGB666-
3363 fetchTransformed64<BlendTransformedTiled>, // ARGB6666_Premultiplied-
3364 fetchTransformed64<BlendTransformedTiled>, // RGB555-
3365 fetchTransformed64<BlendTransformedTiled>, // ARGB8555_Premultiplied-
3366 fetchTransformed64<BlendTransformedTiled>, // RGB888-
3367 fetchTransformed64<BlendTransformedTiled>, // RGB444-
3368 fetchTransformed64<BlendTransformedTiled>, // ARGB4444_Premultiplied-
3369 fetchTransformed64<BlendTransformedTiled>, // RGBX8888-
3370 fetchTransformed64<BlendTransformedTiled>, // RGBA8888-
3371 fetchTransformed64<BlendTransformedTiled>, // RGBA8888_Premultiplied-
3372 fetchTransformed64<BlendTransformedTiled>, // BGR30-
3373 fetchTransformed64<BlendTransformedTiled>, // A2BGR30_Premultiplied-
3374 fetchTransformed64<BlendTransformedTiled>, // RGB30-
3375 fetchTransformed64<BlendTransformedTiled>, // A2RGB30_Premultiplied-
3376 fetchTransformed64<BlendTransformedTiled>, // Alpha8-
3377 fetchTransformed64<BlendTransformedTiled>, // Grayscale8-
3378 },-
3379 {-
3380 0, // Bilinear-
3381 fetchTransformedBilinear64<BlendTransformedBilinear>, // Mono-
3382 fetchTransformedBilinear64<BlendTransformedBilinear>, // MonoLsb-
3383 fetchTransformedBilinear64<BlendTransformedBilinear>, // Indexed8-
3384 fetchTransformedBilinear64<BlendTransformedBilinear>, // RGB32-
3385 fetchTransformedBilinear64<BlendTransformedBilinear>, // ARGB32-
3386 fetchTransformedBilinear64<BlendTransformedBilinear>, // ARGB32_Premultiplied-
3387 fetchTransformedBilinear64<BlendTransformedBilinear>, // RGB16-
3388 fetchTransformedBilinear64<BlendTransformedBilinear>, // ARGB8565_Premultiplied-
3389 fetchTransformedBilinear64<BlendTransformedBilinear>, // RGB666-
3390 fetchTransformedBilinear64<BlendTransformedBilinear>, // ARGB6666_Premultiplied-
3391 fetchTransformedBilinear64<BlendTransformedBilinear>, // RGB555-
3392 fetchTransformedBilinear64<BlendTransformedBilinear>, // ARGB8555_Premultiplied-
3393 fetchTransformedBilinear64<BlendTransformedBilinear>, // RGB888-
3394 fetchTransformedBilinear64<BlendTransformedBilinear>, // RGB444-
3395 fetchTransformedBilinear64<BlendTransformedBilinear>, // ARGB4444_Premultiplied-
3396 fetchTransformedBilinear64<BlendTransformedBilinear>, // RGBX8888-
3397 fetchTransformedBilinear64<BlendTransformedBilinear>, // RGBA8888-
3398 fetchTransformedBilinear64<BlendTransformedBilinear>, // RGBA8888_Premultiplied-
3399 fetchTransformedBilinear64<BlendTransformedBilinear>, // BGR30-
3400 fetchTransformedBilinear64<BlendTransformedBilinear>, // A2BGR30_Premultiplied-
3401 fetchTransformedBilinear64<BlendTransformedBilinear>, // RGB30-
3402 fetchTransformedBilinear64<BlendTransformedBilinear>, // A2RGB30_Premultiplied-
3403 fetchTransformedBilinear64<BlendTransformedBilinear>, // Alpha8-
3404 fetchTransformedBilinear64<BlendTransformedBilinear>, // Grayscale8-
3405 },-
3406 {-
3407 0, // BilinearTiled-
3408 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // Mono-
3409 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // MonoLsb-
3410 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // Indexed8-
3411 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGB32-
3412 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // ARGB32-
3413 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // ARGB32_Premultiplied-
3414 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGB16-
3415 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // ARGB8565_Premultiplied-
3416 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGB666-
3417 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // ARGB6666_Premultiplied-
3418 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGB555-
3419 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // ARGB8555_Premultiplied-
3420 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGB888-
3421 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGB444-
3422 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // ARGB4444_Premultiplied-
3423 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGBX8888-
3424 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGBA8888-
3425 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGBA8888_Premultiplied-
3426 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // BGR30-
3427 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // A2BGR30_Premultiplied-
3428 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // RGB30-
3429 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // A2RGB30_Premultiplied-
3430 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // Alpha8-
3431 fetchTransformedBilinear64<BlendTransformedBilinearTiled>, // Grayscale8-
3432 },-
3433};-
3434-
3435#define FIXPT_BITS 8-
3436#define FIXPT_SIZE (1<<FIXPT_BITS)-
3437-
3438static uint qt_gradient_pixel_fixed(const QGradientData *data, int fixed_pos)-
3439{-
3440 int ipos = (fixed_pos + (FIXPT_SIZE / 2)) >> FIXPT_BITS;-
3441 return data->colorTable32[qt_gradient_clamp(data, ipos)];
never executed: return data->colorTable32[qt_gradient_clamp(data, ipos)];
0
3442}-
3443-
3444static const QRgba64& qt_gradient_pixel64_fixed(const QGradientData *data, int fixed_pos)-
3445{-
3446 int ipos = (fixed_pos + (FIXPT_SIZE / 2)) >> FIXPT_BITS;-
3447 return data->colorTable64[qt_gradient_clamp(data, ipos)];
never executed: return data->colorTable64[qt_gradient_clamp(data, ipos)];
0
3448}-
3449-
3450static void QT_FASTCALL getLinearGradientValues(LinearGradientValues *v, const QSpanData *data)-
3451{-
3452 v->dx = data->gradient.linear.end.x - data->gradient.linear.origin.x;-
3453 v->dy = data->gradient.linear.end.y - data->gradient.linear.origin.y;-
3454 v->l = v->dx * v->dx + v->dy * v->dy;-
3455 v->off = 0;-
3456 if (v->l != 0) {
v->l != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
3457 v->dx /= v->l;-
3458 v->dy /= v->l;-
3459 v->off = -v->dx * data->gradient.linear.origin.x - v->dy * data->gradient.linear.origin.y;-
3460 }
never executed: end of block
0
3461}
never executed: end of block
0
3462-
3463class GradientBase32-
3464{-
3465public:-
3466 typedef uint Type;-
3467 static Type null() { return 0; }
never executed: return 0;
0
3468 static Type fetchSingle(const QGradientData& gradient, qreal v)-
3469 {-
3470 return qt_gradient_pixel(&gradient, v);
never executed: return qt_gradient_pixel(&gradient, v);
0
3471 }-
3472 static Type fetchSingle(const QGradientData& gradient, int v)-
3473 {-
3474 return qt_gradient_pixel_fixed(&gradient, v);
never executed: return qt_gradient_pixel_fixed(&gradient, v);
0
3475 }-
3476 static void memfill(Type *buffer, Type fill, int length)-
3477 {-
3478 qt_memfill32(buffer, fill, length);-
3479 }
never executed: end of block
0
3480};-
3481-
3482class GradientBase64-
3483{-
3484public:-
3485 typedef QRgba64 Type;-
3486 static Type null() { return QRgba64::fromRgba64(0); }
never executed: return QRgba64::fromRgba64(0);
0
3487 static Type fetchSingle(const QGradientData& gradient, qreal v)-
3488 {-
3489 return qt_gradient_pixel64(&gradient, v);
never executed: return qt_gradient_pixel64(&gradient, v);
0
3490 }-
3491 static Type fetchSingle(const QGradientData& gradient, int v)-
3492 {-
3493 return qt_gradient_pixel64_fixed(&gradient, v);
never executed: return qt_gradient_pixel64_fixed(&gradient, v);
0
3494 }-
3495 static void memfill(Type *buffer, Type fill, int length)-
3496 {-
3497 qt_memfill64((quint64*)buffer, fill, length);-
3498 }
never executed: end of block
0
3499};-
3500-
3501template<class GradientBase, typename BlendType>-
3502static inline const BlendType * QT_FASTCALL qt_fetch_linear_gradient_template(-
3503 BlendType *buffer, const Operator *op, const QSpanData *data,-
3504 int y, int x, int length)-
3505{-
3506 const BlendType *b = buffer;-
3507 qreal t, inc;-
3508-
3509 bool affine = true;-
3510 qreal rx=0, ry=0;-
3511 if (op->linear.l == 0) {
op->linear.l == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
3512 t = inc = 0;-
3513 } else {
never executed: end of block
0
3514 rx = data->m21 * (y + qreal(0.5)) + data->m11 * (x + qreal(0.5)) + data->dx;-
3515 ry = data->m22 * (y + qreal(0.5)) + data->m12 * (x + qreal(0.5)) + data->dy;-
3516 t = op->linear.dx*rx + op->linear.dy*ry + op->linear.off;-
3517 inc = op->linear.dx * data->m11 + op->linear.dy * data->m12;-
3518 affine = !data->m13 && !data->m23;
!data->m13Description
TRUEnever evaluated
FALSEnever evaluated
!data->m23Description
TRUEnever evaluated
FALSEnever evaluated
0
3519-
3520 if (affine) {
affineDescription
TRUEnever evaluated
FALSEnever evaluated
0
3521 t *= (GRADIENT_STOPTABLE_SIZE - 1);-
3522 inc *= (GRADIENT_STOPTABLE_SIZE - 1);-
3523 }
never executed: end of block
0
3524 }
never executed: end of block
0
3525-
3526 const BlendType *end = buffer + length;-
3527 if (affine) {
affineDescription
TRUEnever evaluated
FALSEnever evaluated
0
3528 if (inc > qreal(-1e-5) && inc < qreal(1e-5)) {
inc > qreal(-1e-5)Description
TRUEnever evaluated
FALSEnever evaluated
inc < qreal(1e-5)Description
TRUEnever evaluated
FALSEnever evaluated
0
3529 GradientBase::memfill(buffer, GradientBase::fetchSingle(data->gradient, int(t * FIXPT_SIZE)), length);-
3530 } else {
never executed: end of block
0
3531 if (t+inc*length < qreal(INT_MAX >> (FIXPT_BITS + 1)) &&
t+inc*length <...47 >> (8 + 1))Description
TRUEnever evaluated
FALSEnever evaluated
0
3532 t+inc*length > qreal(INT_MIN >> (FIXPT_BITS + 1))) {
t+inc*length >...1) >> (8 + 1))Description
TRUEnever evaluated
FALSEnever evaluated
0
3533 // we can use fixed point math-
3534 int t_fixed = int(t * FIXPT_SIZE);-
3535 int inc_fixed = int(inc * FIXPT_SIZE);-
3536 while (buffer < end) {
buffer < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
3537 *buffer = GradientBase::fetchSingle(data->gradient, t_fixed);-
3538 t_fixed += inc_fixed;-
3539 ++buffer;-
3540 }
never executed: end of block
0
3541 } else {
never executed: end of block
0
3542 // we have to fall back to float math-
3543 while (buffer < end) {
buffer < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
3544 *buffer = GradientBase::fetchSingle(data->gradient, t/GRADIENT_STOPTABLE_SIZE);-
3545 t += inc;-
3546 ++buffer;-
3547 }
never executed: end of block
0
3548 }
never executed: end of block
0
3549 }-
3550 } else { // fall back to float math here as well-
3551 qreal rw = data->m23 * (y + qreal(0.5)) + data->m13 * (x + qreal(0.5)) + data->m33;-
3552 while (buffer < end) {
buffer < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
3553 qreal x = rx/rw;-
3554 qreal y = ry/rw;-
3555 t = (op->linear.dx*x + op->linear.dy *y) + op->linear.off;-
3556-
3557 *buffer = GradientBase::fetchSingle(data->gradient, t);-
3558 rx += data->m11;-
3559 ry += data->m12;-
3560 rw += data->m13;-
3561 if (!rw) {
!rwDescription
TRUEnever evaluated
FALSEnever evaluated
0
3562 rw += data->m13;-
3563 }
never executed: end of block
0
3564 ++buffer;-
3565 }
never executed: end of block
0
3566 }
never executed: end of block
0
3567-
3568 return b;
never executed: return b;
0
3569}-
3570-
3571static const uint * QT_FASTCALL qt_fetch_linear_gradient(uint *buffer, const Operator *op, const QSpanData *data,-
3572 int y, int x, int length)-
3573{-
3574 return qt_fetch_linear_gradient_template<GradientBase32, uint>(buffer, op, data, y, x, length);
never executed: return qt_fetch_linear_gradient_template<GradientBase32, uint>(buffer, op, data, y, x, length);
0
3575}-
3576-
3577static const QRgba64 * QT_FASTCALL qt_fetch_linear_gradient_rgb64(QRgba64 *buffer, const Operator *op, const QSpanData *data,-
3578 int y, int x, int length)-
3579{-
3580 return qt_fetch_linear_gradient_template<GradientBase64, QRgba64>(buffer, op, data, y, x, length);
never executed: return qt_fetch_linear_gradient_template<GradientBase64, QRgba64>(buffer, op, data, y, x, length);
0
3581}-
3582-
3583static void QT_FASTCALL getRadialGradientValues(RadialGradientValues *v, const QSpanData *data)-
3584{-
3585 v->dx = data->gradient.radial.center.x - data->gradient.radial.focal.x;-
3586 v->dy = data->gradient.radial.center.y - data->gradient.radial.focal.y;-
3587-
3588 v->dr = data->gradient.radial.center.radius - data->gradient.radial.focal.radius;-
3589 v->sqrfr = data->gradient.radial.focal.radius * data->gradient.radial.focal.radius;-
3590-
3591 v->a = v->dr * v->dr - v->dx*v->dx - v->dy*v->dy;-
3592 v->inv2a = 1 / (2 * v->a);-
3593-
3594 v->extended = !qFuzzyIsNull(data->gradient.radial.focal.radius) || v->a <= 0;
!qFuzzyIsNull(....focal.radius)Description
TRUEnever evaluated
FALSEnever evaluated
v->a <= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
3595}
never executed: end of block
0
3596-
3597template <class GradientBase>-
3598class RadialFetchPlain : public GradientBase-
3599{-
3600public:-
3601 typedef typename GradientBase::Type BlendType;-
3602 static void fetch(BlendType *buffer, BlendType *end,-
3603 const Operator *op, const QSpanData *data, qreal det,-
3604 qreal delta_det, qreal delta_delta_det, qreal b, qreal delta_b)-
3605 {-
3606 if (op->radial.extended) {
op->radial.extendedDescription
TRUEnever evaluated
FALSEnever evaluated
0
3607 while (buffer < end) {
buffer < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
3608 BlendType result = GradientBase::null();-
3609 if (det >= 0) {
det >= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
3610 qreal w = qSqrt(det) - b;-
3611 if (data->gradient.radial.focal.radius + op->radial.dr * w >= 0)
data->gradient...al.dr * w >= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
3612 result = GradientBase::fetchSingle(data->gradient, w);
never executed: result = GradientBase::fetchSingle(data->gradient, w);
0
3613 }
never executed: end of block
0
3614-
3615 *buffer = result;-
3616-
3617 det += delta_det;-
3618 delta_det += delta_delta_det;-
3619 b += delta_b;-
3620-
3621 ++buffer;-
3622 }
never executed: end of block
0
3623 } else {
never executed: end of block
0
3624 while (buffer < end) {
buffer < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
3625 *buffer++ = GradientBase::fetchSingle(data->gradient, qSqrt(det) - b);-
3626-
3627 det += delta_det;-
3628 delta_det += delta_delta_det;-
3629 b += delta_b;-
3630 }
never executed: end of block
0
3631 }
never executed: end of block
0
3632 }-
3633};-
3634-
3635const uint * QT_FASTCALL qt_fetch_radial_gradient_plain(uint *buffer, const Operator *op, const QSpanData *data,-
3636 int y, int x, int length)-
3637{-
3638 return qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase32>, uint>(buffer, op, data, y, x, length);
never executed: return qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase32>, uint>(buffer, op, data, y, x, length);
0
3639}-
3640-
3641static SourceFetchProc qt_fetch_radial_gradient = qt_fetch_radial_gradient_plain;-
3642-
3643const QRgba64 * QT_FASTCALL qt_fetch_radial_gradient_rgb64(QRgba64 *buffer, const Operator *op, const QSpanData *data,-
3644 int y, int x, int length)-
3645{-
3646 return qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase64>, QRgba64>(buffer, op, data, y, x, length);
never executed: return qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase64>, QRgba64>(buffer, op, data, y, x, length);
0
3647}-
3648-
3649template <class GradientBase, typename BlendType>-
3650static inline const BlendType * QT_FASTCALL qt_fetch_conical_gradient_template(-
3651 BlendType *buffer, const QSpanData *data,-
3652 int y, int x, int length)-
3653{-
3654 const BlendType *b = buffer;-
3655 qreal rx = data->m21 * (y + qreal(0.5))-
3656 + data->dx + data->m11 * (x + qreal(0.5));-
3657 qreal ry = data->m22 * (y + qreal(0.5))-
3658 + data->dy + data->m12 * (x + qreal(0.5));-
3659 bool affine = !data->m13 && !data->m23;
!data->m13Description
TRUEnever evaluated
FALSEnever evaluated
!data->m23Description
TRUEnever evaluated
FALSEnever evaluated
0
3660-
3661 const qreal inv2pi = M_1_PI / 2.0;-
3662-
3663 const BlendType *end = buffer + length;-
3664 if (affine) {
affineDescription
TRUEnever evaluated
FALSEnever evaluated
0
3665 rx -= data->gradient.conical.center.x;-
3666 ry -= data->gradient.conical.center.y;-
3667 while (buffer < end) {
buffer < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
3668 qreal angle = qAtan2(ry, rx) + data->gradient.conical.angle;-
3669-
3670 *buffer = GradientBase::fetchSingle(data->gradient, 1 - angle * inv2pi);-
3671-
3672 rx += data->m11;-
3673 ry += data->m12;-
3674 ++buffer;-
3675 }
never executed: end of block
0
3676 } else {
never executed: end of block
0
3677 qreal rw = data->m23 * (y + qreal(0.5))-
3678 + data->m33 + data->m13 * (x + qreal(0.5));-
3679 if (!rw)
!rwDescription
TRUEnever evaluated
FALSEnever evaluated
0
3680 rw = 1;
never executed: rw = 1;
0
3681 while (buffer < end) {
buffer < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
3682 qreal angle = qAtan2(ry/rw - data->gradient.conical.center.x,-
3683 rx/rw - data->gradient.conical.center.y)-
3684 + data->gradient.conical.angle;-
3685-
3686 *buffer = GradientBase::fetchSingle(data->gradient, 1 - angle * inv2pi);-
3687-
3688 rx += data->m11;-
3689 ry += data->m12;-
3690 rw += data->m13;-
3691 if (!rw) {
!rwDescription
TRUEnever evaluated
FALSEnever evaluated
0
3692 rw += data->m13;-
3693 }
never executed: end of block
0
3694 ++buffer;-
3695 }
never executed: end of block
0
3696 }
never executed: end of block
0
3697 return b;
never executed: return b;
0
3698}-
3699-
3700static const uint * QT_FASTCALL qt_fetch_conical_gradient(uint *buffer, const Operator *, const QSpanData *data,-
3701 int y, int x, int length)-
3702{-
3703 return qt_fetch_conical_gradient_template<GradientBase32, uint>(buffer, data, y, x, length);
never executed: return qt_fetch_conical_gradient_template<GradientBase32, uint>(buffer, data, y, x, length);
0
3704}-
3705-
3706static const QRgba64 * QT_FASTCALL qt_fetch_conical_gradient_rgb64(QRgba64 *buffer, const Operator *, const QSpanData *data,-
3707 int y, int x, int length)-
3708{-
3709 return qt_fetch_conical_gradient_template<GradientBase64, QRgba64>(buffer, data, y, x, length);
never executed: return qt_fetch_conical_gradient_template<GradientBase64, QRgba64>(buffer, data, y, x, length);
0
3710}-
3711-
3712extern CompositionFunctionSolid qt_functionForModeSolid_C[];-
3713extern CompositionFunctionSolid64 qt_functionForModeSolid64_C[];-
3714-
3715static const CompositionFunctionSolid *functionForModeSolid = qt_functionForModeSolid_C;-
3716static const CompositionFunctionSolid64 *functionForModeSolid64 = qt_functionForModeSolid64_C;-
3717-
3718extern CompositionFunction qt_functionForMode_C[];-
3719extern CompositionFunction64 qt_functionForMode64_C[];-
3720-
3721static const CompositionFunction *functionForMode = qt_functionForMode_C;-
3722static const CompositionFunction64 *functionForMode64 = qt_functionForMode64_C;-
3723-
3724static TextureBlendType getBlendType(const QSpanData *data)-
3725{-
3726 TextureBlendType ft;-
3727 if (data->txop <= QTransform::TxTranslate)
data->txop <= ...m::TxTranslateDescription
TRUEnever evaluated
FALSEnever evaluated
0
3728 if (data->texture.type == QTextureData::Tiled)
data->texture....ureData::TiledDescription
TRUEnever evaluated
FALSEnever evaluated
0
3729 ft = BlendTiled;
never executed: ft = BlendTiled;
0
3730 else-
3731 ft = BlendUntransformed;
never executed: ft = BlendUntransformed;
0
3732 else if (data->bilinear)
data->bilinearDescription
TRUEnever evaluated
FALSEnever evaluated
0
3733 if (data->texture.type == QTextureData::Tiled)
data->texture....ureData::TiledDescription
TRUEnever evaluated
FALSEnever evaluated
0
3734 ft = BlendTransformedBilinearTiled;
never executed: ft = BlendTransformedBilinearTiled;
0
3735 else-
3736 ft = BlendTransformedBilinear;
never executed: ft = BlendTransformedBilinear;
0
3737 else-
3738 if (data->texture.type == QTextureData::Tiled)
data->texture....ureData::TiledDescription
TRUEnever evaluated
FALSEnever evaluated
0
3739 ft = BlendTransformedTiled;
never executed: ft = BlendTransformedTiled;
0
3740 else-
3741 ft = BlendTransformed;
never executed: ft = BlendTransformed;
0
3742 return ft;
never executed: return ft;
0
3743}-
3744-
3745static inline Operator getOperator(const QSpanData *data, const QSpan *spans, int spanCount)-
3746{-
3747 Operator op;-
3748 bool solidSource = false;-
3749-
3750 switch(data->type) {-
3751 case QSpanData::Solid:
never executed: case QSpanData::Solid:
0
3752 solidSource = data->solid.color.isOpaque();-
3753 op.srcFetch = 0;-
3754 op.srcFetch64 = 0;-
3755 break;
never executed: break;
0
3756 case QSpanData::LinearGradient:
never executed: case QSpanData::LinearGradient:
0
3757 solidSource = !data->gradient.alphaColor;-
3758 getLinearGradientValues(&op.linear, data);-
3759 op.srcFetch = qt_fetch_linear_gradient;-
3760 op.srcFetch64 = qt_fetch_linear_gradient_rgb64;-
3761 break;
never executed: break;
0
3762 case QSpanData::RadialGradient:
never executed: case QSpanData::RadialGradient:
0
3763 solidSource = !data->gradient.alphaColor;-
3764 getRadialGradientValues(&op.radial, data);-
3765 op.srcFetch = qt_fetch_radial_gradient;-
3766 op.srcFetch64 = qt_fetch_radial_gradient_rgb64;-
3767 break;
never executed: break;
0
3768 case QSpanData::ConicalGradient:
never executed: case QSpanData::ConicalGradient:
0
3769 solidSource = !data->gradient.alphaColor;-
3770 op.srcFetch = qt_fetch_conical_gradient;-
3771 op.srcFetch64 = qt_fetch_conical_gradient_rgb64;-
3772 break;
never executed: break;
0
3773 case QSpanData::Texture:
never executed: case QSpanData::Texture:
0
3774 solidSource = !data->texture.hasAlpha;-
3775 op.srcFetch = sourceFetch[getBlendType(data)][data->texture.format];-
3776 op.srcFetch64 = sourceFetch64[getBlendType(data)][data->texture.format];-
3777 break;
never executed: break;
0
3778 default:
never executed: default:
0
3779 Q_UNREACHABLE();-
3780 break;
never executed: break;
0
3781 }-
3782-
3783 op.mode = data->rasterBuffer->compositionMode;-
3784 if (op.mode == QPainter::CompositionMode_SourceOver && solidSource)
op.mode == QPa...ode_SourceOverDescription
TRUEnever evaluated
FALSEnever evaluated
solidSourceDescription
TRUEnever evaluated
FALSEnever evaluated
0
3785 op.mode = QPainter::CompositionMode_Source;
never executed: op.mode = QPainter::CompositionMode_Source;
0
3786-
3787 op.destFetch = destFetchProc[data->rasterBuffer->format];-
3788 op.destFetch64 = destFetchProc64[data->rasterBuffer->format];-
3789 if (op.mode == QPainter::CompositionMode_Source) {
op.mode == QPa...ionMode_SourceDescription
TRUEnever evaluated
FALSEnever evaluated
0
3790 switch (data->rasterBuffer->format) {-
3791 case QImage::Format_RGB32:
never executed: case QImage::Format_RGB32:
0
3792 case QImage::Format_ARGB32_Premultiplied:
never executed: case QImage::Format_ARGB32_Premultiplied:
0
3793 // don't clear destFetch as it sets up the pointer correctly to save one copy-
3794 break;
never executed: break;
0
3795 default: {
never executed: default:
0
3796 if (data->type == QSpanData::Texture && data->texture.const_alpha != 256)
data->type == ...nData::TextureDescription
TRUEnever evaluated
FALSEnever evaluated
data->texture....t_alpha != 256Description
TRUEnever evaluated
FALSEnever evaluated
0
3797 break;
never executed: break;
0
3798 const QSpan *lastSpan = spans + spanCount;-
3799 bool alphaSpans = false;-
3800 while (spans < lastSpan) {
spans < lastSpanDescription
TRUEnever evaluated
FALSEnever evaluated
0
3801 if (spans->coverage != 255) {
spans->coverage != 255Description
TRUEnever evaluated
FALSEnever evaluated
0
3802 alphaSpans = true;-
3803 break;
never executed: break;
0
3804 }-
3805 ++spans;-
3806 }
never executed: end of block
0
3807 if (!alphaSpans)
!alphaSpansDescription
TRUEnever evaluated
FALSEnever evaluated
0
3808 op.destFetch = 0;
never executed: op.destFetch = 0;
0
3809 }-
3810 }
never executed: end of block
0
3811 }-
3812-
3813 op.destStore = destStoreProc[data->rasterBuffer->format];-
3814 op.destStore64 = destStoreProc64[data->rasterBuffer->format];-
3815-
3816 op.funcSolid = functionForModeSolid[op.mode];-
3817 op.funcSolid64 = functionForModeSolid64[op.mode];-
3818 op.func = functionForMode[op.mode];-
3819 op.func64 = functionForMode64[op.mode];-
3820-
3821 return op;
never executed: return op;
0
3822}-
3823-
3824-
3825-
3826// -------------------- blend methods ----------------------
3827-
3828#if !defined(Q_CC_SUN)-
3829static-
3830#endif-
3831void blend_color_generic(int count, const QSpan *spans, void *userData)-
3832{-
3833 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
3834 uint buffer[buffer_size];-
3835 Operator op = getOperator(data, spans, count);-
3836 const uint color = data->solid.color.toArgb32();-
3837-
3838 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
3839 int x = spans->x;-
3840 int length = spans->len;-
3841 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
3842 int l = qMin(buffer_size, length);-
3843 uint *dest = op.destFetch ? op.destFetch(buffer, data->rasterBuffer, x, spans->y, l) : buffer;
op.destFetchDescription
TRUEnever evaluated
FALSEnever evaluated
0
3844 op.funcSolid(dest, l, color, spans->coverage);-
3845 if (op.destStore)
op.destStoreDescription
TRUEnever evaluated
FALSEnever evaluated
0
3846 op.destStore(data->rasterBuffer, x, spans->y, dest, l);
never executed: op.destStore(data->rasterBuffer, x, spans->y, dest, l);
0
3847 length -= l;-
3848 x += l;-
3849 }
never executed: end of block
0
3850 ++spans;-
3851 }
never executed: end of block
0
3852}
never executed: end of block
0
3853-
3854static void blend_color_argb(int count, const QSpan *spans, void *userData)-
3855{-
3856 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
3857-
3858 Operator op = getOperator(data, spans, count);-
3859 const uint color = data->solid.color.toArgb32();-
3860-
3861 if (op.mode == QPainter::CompositionMode_Source) {
op.mode == QPa...ionMode_SourceDescription
TRUEnever evaluated
FALSEnever evaluated
0
3862 // inline for performance-
3863 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
3864 uint *target = ((uint *)data->rasterBuffer->scanLine(spans->y)) + spans->x;-
3865 if (spans->coverage == 255) {
spans->coverage == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
3866 QT_MEMFILL_UINT(target, spans->len, color);-
3867 } else {
never executed: end of block
0
3868 uint c = BYTE_MUL(color, spans->coverage);-
3869 int ialpha = 255 - spans->coverage;-
3870 for (int i = 0; i < spans->len; ++i)
i < spans->lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
3871 target[i] = c + BYTE_MUL(target[i], ialpha);
never executed: target[i] = c + BYTE_MUL(target[i], ialpha);
0
3872 }
never executed: end of block
0
3873 ++spans;-
3874 }
never executed: end of block
0
3875 return;
never executed: return;
0
3876 }-
3877-
3878 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
3879 uint *target = ((uint *)data->rasterBuffer->scanLine(spans->y)) + spans->x;-
3880 op.funcSolid(target, spans->len, color, spans->coverage);-
3881 ++spans;-
3882 }
never executed: end of block
0
3883}
never executed: end of block
0
3884-
3885void blend_color_generic_rgb64(int count, const QSpan *spans, void *userData)-
3886{-
3887 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
3888 Operator op = getOperator(data, spans, count);-
3889 if (!op.funcSolid64) {
!op.funcSolid64Description
TRUEnever evaluated
FALSEnever evaluated
0
3890 qDebug("unsupported 64bit blend attempted");-
3891 return blend_color_generic(count, spans, userData);
never executed: return blend_color_generic(count, spans, userData);
0
3892 }-
3893-
3894 QRgba64 buffer[buffer_size];-
3895 const QRgba64 color = data->solid.color;-
3896-
3897 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
3898 int x = spans->x;-
3899 int length = spans->len;-
3900 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
3901 int l = qMin(buffer_size, length);-
3902 QRgba64 *dest = op.destFetch64(buffer, data->rasterBuffer, x, spans->y, l);-
3903 op.funcSolid64(dest, l, color, spans->coverage);-
3904 op.destStore64(data->rasterBuffer, x, spans->y, dest, l);-
3905 length -= l;-
3906 x += l;-
3907 }
never executed: end of block
0
3908 ++spans;-
3909 }
never executed: end of block
0
3910}
never executed: end of block
0
3911-
3912static void blend_color_rgb16(int count, const QSpan *spans, void *userData)-
3913{-
3914 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
3915-
3916 /*-
3917 We duplicate a little logic from getOperator() and calculate the-
3918 composition mode directly. This allows blend_color_rgb16 to be used-
3919 from qt_gradient_quint16 with minimal overhead.-
3920 */-
3921 QPainter::CompositionMode mode = data->rasterBuffer->compositionMode;-
3922 if (mode == QPainter::CompositionMode_SourceOver && data->solid.color.isOpaque())
mode == QPaint...ode_SourceOverDescription
TRUEnever evaluated
FALSEnever evaluated
data->solid.color.isOpaque()Description
TRUEnever evaluated
FALSEnever evaluated
0
3923 mode = QPainter::CompositionMode_Source;
never executed: mode = QPainter::CompositionMode_Source;
0
3924-
3925 if (mode == QPainter::CompositionMode_Source) {
mode == QPaint...ionMode_SourceDescription
TRUEnever evaluated
FALSEnever evaluated
0
3926 // inline for performance-
3927 ushort c = data->solid.color.toRgb16();-
3928 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
3929 ushort *target = ((ushort *)data->rasterBuffer->scanLine(spans->y)) + spans->x;-
3930 if (spans->coverage == 255) {
spans->coverage == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
3931 QT_MEMFILL_USHORT(target, spans->len, c);-
3932 } else {
never executed: end of block
0
3933 ushort color = BYTE_MUL_RGB16(c, spans->coverage);-
3934 int ialpha = 255 - spans->coverage;-
3935 const ushort *end = target + spans->len;-
3936 while (target < end) {
target < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
3937 *target = color + BYTE_MUL_RGB16(*target, ialpha);-
3938 ++target;-
3939 }
never executed: end of block
0
3940 }
never executed: end of block
0
3941 ++spans;-
3942 }
never executed: end of block
0
3943 return;
never executed: return;
0
3944 }-
3945-
3946 if (mode == QPainter::CompositionMode_SourceOver) {
mode == QPaint...ode_SourceOverDescription
TRUEnever evaluated
FALSEnever evaluated
0
3947 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
3948 uint color = BYTE_MUL(data->solid.color.toArgb32(), spans->coverage);-
3949 int ialpha = qAlpha(~color);-
3950 ushort c = qConvertRgb32To16(color);-
3951 ushort *target = ((ushort *)data->rasterBuffer->scanLine(spans->y)) + spans->x;-
3952 int len = spans->len;-
3953 bool pre = (((quintptr)target) & 0x3) != 0;-
3954 bool post = false;-
3955 if (pre) {
preDescription
TRUEnever evaluated
FALSEnever evaluated
0
3956 // skip to word boundary-
3957 *target = c + BYTE_MUL_RGB16(*target, ialpha);-
3958 ++target;-
3959 --len;-
3960 }
never executed: end of block
0
3961 if (len & 0x1) {
len & 0x1Description
TRUEnever evaluated
FALSEnever evaluated
0
3962 post = true;-
3963 --len;-
3964 }
never executed: end of block
0
3965 uint *target32 = (uint*)target;-
3966 uint c32 = c | (c<<16);-
3967 len >>= 1;-
3968 uint salpha = (ialpha+1) >> 3; // calculate here rather than in loop-
3969 while (len--) {
len--Description
TRUEnever evaluated
FALSEnever evaluated
0
3970 // blend full words-
3971 *target32 = c32 + BYTE_MUL_RGB16_32(*target32, salpha);-
3972 ++target32;-
3973 target += 2;-
3974 }
never executed: end of block
0
3975 if (post) {
postDescription
TRUEnever evaluated
FALSEnever evaluated
0
3976 // one last pixel beyond a full word-
3977 *target = c + BYTE_MUL_RGB16(*target, ialpha);-
3978 }
never executed: end of block
0
3979 ++spans;-
3980 }
never executed: end of block
0
3981 return;
never executed: return;
0
3982 }-
3983-
3984 blend_color_generic(count, spans, userData);-
3985}
never executed: end of block
0
3986-
3987template <typename T>-
3988void handleSpans(int count, const QSpan *spans, const QSpanData *data, T &handler)-
3989{-
3990 uint const_alpha = 256;-
3991 if (data->type == QSpanData::Texture)
data->type == ...nData::TextureDescription
TRUEnever evaluated
FALSEnever evaluated
0
3992 const_alpha = data->texture.const_alpha;
never executed: const_alpha = data->texture.const_alpha;
0
3993-
3994 int coverage = 0;-
3995 while (count) {
countDescription
TRUEnever evaluated
FALSEnever evaluated
0
3996 int x = spans->x;-
3997 const int y = spans->y;-
3998 int right = x + spans->len;-
3999-
4000 // compute length of adjacent spans-
4001 for (int i = 1; i < count && spans[i].y == y && spans[i].x == right; ++i)
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
spans[i].y == yDescription
TRUEnever evaluated
FALSEnever evaluated
spans[i].x == rightDescription
TRUEnever evaluated
FALSEnever evaluated
0
4002 right += spans[i].len;
never executed: right += spans[i].len;
0
4003 int length = right - x;-
4004-
4005 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4006 int l = qMin(buffer_size, length);-
4007 length -= l;-
4008-
4009 int process_length = l;-
4010 int process_x = x;-
4011-
4012 const typename T::BlendType *src = handler.fetch(process_x, y, process_length);-
4013 int offset = 0;-
4014 while (l > 0) {
l > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4015 if (x == spans->x) // new span?
x == spans->xDescription
TRUEnever evaluated
FALSEnever evaluated
0
4016 coverage = (spans->coverage * const_alpha) >> 8;
never executed: coverage = (spans->coverage * const_alpha) >> 8;
0
4017-
4018 int right = spans->x + spans->len;-
4019 int len = qMin(l, right - x);-
4020-
4021 handler.process(x, y, len, coverage, src, offset);-
4022-
4023 l -= len;-
4024 x += len;-
4025 offset += len;-
4026-
4027 if (x == right) { // done with current span?
x == rightDescription
TRUEnever evaluated
FALSEnever evaluated
0
4028 ++spans;-
4029 --count;-
4030 }
never executed: end of block
0
4031 }
never executed: end of block
0
4032 handler.store(process_x, y, process_length);-
4033 }
never executed: end of block
0
4034 }
never executed: end of block
0
4035}
never executed: end of block
0
4036-
4037template<typename T>-
4038struct QBlendBase-
4039{-
4040 typedef T BlendType;-
4041 QBlendBase(QSpanData *d, Operator o)-
4042 : data(d)-
4043 , op(o)-
4044 , dest(0)-
4045 {-
4046 }
never executed: end of block
0
4047-
4048 QSpanData *data;-
4049 Operator op;-
4050-
4051 BlendType *dest;-
4052-
4053 BlendType buffer[buffer_size];-
4054 BlendType src_buffer[buffer_size];-
4055};-
4056-
4057class BlendSrcGeneric : public QBlendBase<uint>-
4058{-
4059public:-
4060 BlendSrcGeneric(QSpanData *d, Operator o)-
4061 : QBlendBase<uint>(d, o)-
4062 {-
4063 }
never executed: end of block
0
4064-
4065 const uint *fetch(int x, int y, int len)-
4066 {-
4067 dest = op.destFetch ? op.destFetch(buffer, data->rasterBuffer, x, y, len) : buffer;
op.destFetchDescription
TRUEnever evaluated
FALSEnever evaluated
0
4068 return op.srcFetch(src_buffer, &op, data, y, x, len);
never executed: return op.srcFetch(src_buffer, &op, data, y, x, len);
0
4069 }-
4070-
4071 void process(int, int, int len, int coverage, const uint *src, int offset)-
4072 {-
4073 op.func(dest + offset, src + offset, len, coverage);-
4074 }
never executed: end of block
0
4075-
4076 void store(int x, int y, int len)-
4077 {-
4078 if (op.destStore)
op.destStoreDescription
TRUEnever evaluated
FALSEnever evaluated
0
4079 op.destStore(data->rasterBuffer, x, y, dest, len);
never executed: op.destStore(data->rasterBuffer, x, y, dest, len);
0
4080 }
never executed: end of block
0
4081};-
4082-
4083class BlendSrcGenericRGB64 : public QBlendBase<QRgba64>-
4084{-
4085public:-
4086 BlendSrcGenericRGB64(QSpanData *d, Operator o)-
4087 : QBlendBase<QRgba64>(d, o)-
4088 {-
4089 }
never executed: end of block
0
4090-
4091 bool isSupported() const-
4092 {-
4093 return op.func64 && op.destFetch64 && op.destStore64;
never executed: return op.func64 && op.destFetch64 && op.destStore64;
0
4094 }-
4095-
4096 const QRgba64 *fetch(int x, int y, int len)-
4097 {-
4098 dest = op.destFetch64(buffer, data->rasterBuffer, x, y, len);-
4099 return op.srcFetch64(src_buffer, &op, data, y, x, len);
never executed: return op.srcFetch64(src_buffer, &op, data, y, x, len);
0
4100 }-
4101-
4102 void process(int, int, int len, int coverage, const QRgba64 *src, int offset)-
4103 {-
4104 op.func64(dest + offset, src + offset, len, coverage);-
4105 }
never executed: end of block
0
4106-
4107 void store(int x, int y, int len)-
4108 {-
4109 op.destStore64(data->rasterBuffer, x, y, dest, len);-
4110 }
never executed: end of block
0
4111};-
4112-
4113static void blend_src_generic(int count, const QSpan *spans, void *userData)-
4114{-
4115 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
4116 BlendSrcGeneric blend(data, getOperator(data, spans, count));-
4117 handleSpans(count, spans, data, blend);-
4118}
never executed: end of block
0
4119-
4120static void blend_src_generic_rgb64(int count, const QSpan *spans, void *userData)-
4121{-
4122 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
4123 Operator op = getOperator(data, spans, count);-
4124 BlendSrcGenericRGB64 blend64(data, op);-
4125 if (blend64.isSupported())
blend64.isSupported()Description
TRUEnever evaluated
FALSEnever evaluated
0
4126 handleSpans(count, spans, data, blend64);
never executed: handleSpans(count, spans, data, blend64);
0
4127 else {-
4128 qDebug("blend_src_generic_rgb64: unsupported 64-bit blend attempted");-
4129 BlendSrcGeneric blend32(data, op);-
4130 handleSpans(count, spans, data, blend32);-
4131 }
never executed: end of block
0
4132}-
4133-
4134static void blend_untransformed_generic(int count, const QSpan *spans, void *userData)-
4135{-
4136 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
4137-
4138 uint buffer[buffer_size];-
4139 uint src_buffer[buffer_size];-
4140 Operator op = getOperator(data, spans, count);-
4141-
4142 const int image_width = data->texture.width;-
4143 const int image_height = data->texture.height;-
4144 int xoff = -qRound(-data->dx);-
4145 int yoff = -qRound(-data->dy);-
4146-
4147 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
4148 int x = spans->x;-
4149 int length = spans->len;-
4150 int sx = xoff + x;-
4151 int sy = yoff + spans->y;-
4152 if (sy >= 0 && sy < image_height && sx < image_width) {
sy >= 0Description
TRUEnever evaluated
FALSEnever evaluated
sy < image_heightDescription
TRUEnever evaluated
FALSEnever evaluated
sx < image_widthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4153 if (sx < 0) {
sx < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4154 x -= sx;-
4155 length += sx;-
4156 sx = 0;-
4157 }
never executed: end of block
0
4158 if (sx + length > image_width)
sx + length > image_widthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4159 length = image_width - sx;
never executed: length = image_width - sx;
0
4160 if (length > 0) {
length > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4161 const int coverage = (spans->coverage * data->texture.const_alpha) >> 8;-
4162 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4163 int l = qMin(buffer_size, length);-
4164 const uint *src = op.srcFetch(src_buffer, &op, data, sy, sx, l);-
4165 uint *dest = op.destFetch ? op.destFetch(buffer, data->rasterBuffer, x, spans->y, l) : buffer;
op.destFetchDescription
TRUEnever evaluated
FALSEnever evaluated
0
4166 op.func(dest, src, l, coverage);-
4167 if (op.destStore)
op.destStoreDescription
TRUEnever evaluated
FALSEnever evaluated
0
4168 op.destStore(data->rasterBuffer, x, spans->y, dest, l);
never executed: op.destStore(data->rasterBuffer, x, spans->y, dest, l);
0
4169 x += l;-
4170 sx += l;-
4171 length -= l;-
4172 }
never executed: end of block
0
4173 }
never executed: end of block
0
4174 }
never executed: end of block
0
4175 ++spans;-
4176 }
never executed: end of block
0
4177}
never executed: end of block
0
4178-
4179static void blend_untransformed_generic_rgb64(int count, const QSpan *spans, void *userData)-
4180{-
4181 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
4182-
4183 Operator op = getOperator(data, spans, count);-
4184 if (!op.func64) {
!op.func64Description
TRUEnever evaluated
FALSEnever evaluated
0
4185 qWarning("Unsupported blend");-
4186 return blend_untransformed_generic(count, spans, userData);
never executed: return blend_untransformed_generic(count, spans, userData);
0
4187 }-
4188 QRgba64 buffer[buffer_size];-
4189 QRgba64 src_buffer[buffer_size];-
4190-
4191 const int image_width = data->texture.width;-
4192 const int image_height = data->texture.height;-
4193 int xoff = -qRound(-data->dx);-
4194 int yoff = -qRound(-data->dy);-
4195-
4196 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
4197 int x = spans->x;-
4198 int length = spans->len;-
4199 int sx = xoff + x;-
4200 int sy = yoff + spans->y;-
4201 if (sy >= 0 && sy < image_height && sx < image_width) {
sy >= 0Description
TRUEnever evaluated
FALSEnever evaluated
sy < image_heightDescription
TRUEnever evaluated
FALSEnever evaluated
sx < image_widthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4202 if (sx < 0) {
sx < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4203 x -= sx;-
4204 length += sx;-
4205 sx = 0;-
4206 }
never executed: end of block
0
4207 if (sx + length > image_width)
sx + length > image_widthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4208 length = image_width - sx;
never executed: length = image_width - sx;
0
4209 if (length > 0) {
length > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4210 const int coverage = (spans->coverage * data->texture.const_alpha) >> 8;-
4211 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4212 int l = qMin(buffer_size, length);-
4213 const QRgba64 *src = op.srcFetch64(src_buffer, &op, data, sy, sx, l);-
4214 QRgba64 *dest = op.destFetch64(buffer, data->rasterBuffer, x, spans->y, l);-
4215 op.func64(dest, src, l, coverage);-
4216 op.destStore64(data->rasterBuffer, x, spans->y, dest, l);-
4217 x += l;-
4218 sx += l;-
4219 length -= l;-
4220 }
never executed: end of block
0
4221 }
never executed: end of block
0
4222 }
never executed: end of block
0
4223 ++spans;-
4224 }
never executed: end of block
0
4225}
never executed: end of block
0
4226-
4227static void blend_untransformed_argb(int count, const QSpan *spans, void *userData)-
4228{-
4229 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
4230 if (data->texture.format != QImage::Format_ARGB32_Premultiplied
data->texture...._PremultipliedDescription
TRUEnever evaluated
FALSEnever evaluated
0
4231 && data->texture.format != QImage::Format_RGB32) {
data->texture....::Format_RGB32Description
TRUEnever evaluated
FALSEnever evaluated
0
4232 blend_untransformed_generic(count, spans, userData);-
4233 return;
never executed: return;
0
4234 }-
4235-
4236 Operator op = getOperator(data, spans, count);-
4237-
4238 const int image_width = data->texture.width;-
4239 const int image_height = data->texture.height;-
4240 int xoff = -qRound(-data->dx);-
4241 int yoff = -qRound(-data->dy);-
4242-
4243 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
4244 int x = spans->x;-
4245 int length = spans->len;-
4246 int sx = xoff + x;-
4247 int sy = yoff + spans->y;-
4248 if (sy >= 0 && sy < image_height && sx < image_width) {
sy >= 0Description
TRUEnever evaluated
FALSEnever evaluated
sy < image_heightDescription
TRUEnever evaluated
FALSEnever evaluated
sx < image_widthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4249 if (sx < 0) {
sx < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4250 x -= sx;-
4251 length += sx;-
4252 sx = 0;-
4253 }
never executed: end of block
0
4254 if (sx + length > image_width)
sx + length > image_widthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4255 length = image_width - sx;
never executed: length = image_width - sx;
0
4256 if (length > 0) {
length > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4257 const int coverage = (spans->coverage * data->texture.const_alpha) >> 8;-
4258 const uint *src = (const uint *)data->texture.scanLine(sy) + sx;-
4259 uint *dest = ((uint *)data->rasterBuffer->scanLine(spans->y)) + x;-
4260 op.func(dest, src, length, coverage);-
4261 }
never executed: end of block
0
4262 }
never executed: end of block
0
4263 ++spans;-
4264 }
never executed: end of block
0
4265}
never executed: end of block
0
4266-
4267static inline quint16 interpolate_pixel_rgb16_255(quint16 x, quint8 a,-
4268 quint16 y, quint8 b)-
4269{-
4270 quint16 t = ((((x & 0x07e0) * a) + ((y & 0x07e0) * b)) >> 5) & 0x07e0;-
4271 t |= ((((x & 0xf81f) * a) + ((y & 0xf81f) * b)) >> 5) & 0xf81f;-
4272-
4273 return t;
never executed: return t;
0
4274}-
4275-
4276static inline quint32 interpolate_pixel_rgb16x2_255(quint32 x, quint8 a,-
4277 quint32 y, quint8 b)-
4278{-
4279 uint t;-
4280 t = ((((x & 0xf81f07e0) >> 5) * a) + (((y & 0xf81f07e0) >> 5) * b)) & 0xf81f07e0;-
4281 t |= ((((x & 0x07e0f81f) * a) + ((y & 0x07e0f81f) * b)) >> 5) & 0x07e0f81f;-
4282 return t;
never executed: return t;
0
4283}-
4284-
4285static inline void blend_sourceOver_rgb16_rgb16(quint16 *Q_DECL_RESTRICT dest,-
4286 const quint16 *Q_DECL_RESTRICT src,-
4287 int length,-
4288 const quint8 alpha,-
4289 const quint8 ialpha)-
4290{-
4291 const int dstAlign = ((quintptr)dest) & 0x3;-
4292 if (dstAlign) {
dstAlignDescription
TRUEnever evaluated
FALSEnever evaluated
0
4293 *dest = interpolate_pixel_rgb16_255(*src, alpha, *dest, ialpha);-
4294 ++dest;-
4295 ++src;-
4296 --length;-
4297 }
never executed: end of block
0
4298 const int srcAlign = ((quintptr)src) & 0x3;-
4299 int length32 = length >> 1;-
4300 if (length32 && srcAlign == 0) {
length32Description
TRUEnever evaluated
FALSEnever evaluated
srcAlign == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4301 while (length32--) {
length32--Description
TRUEnever evaluated
FALSEnever evaluated
0
4302 const quint32 *src32 = reinterpret_cast<const quint32*>(src);-
4303 quint32 *dest32 = reinterpret_cast<quint32*>(dest);-
4304 *dest32 = interpolate_pixel_rgb16x2_255(*src32, alpha,-
4305 *dest32, ialpha);-
4306 dest += 2;-
4307 src += 2;-
4308 }
never executed: end of block
0
4309 length &= 0x1;-
4310 }
never executed: end of block
0
4311 while (length--) {
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
4312 *dest = interpolate_pixel_rgb16_255(*src, alpha, *dest, ialpha);-
4313 ++dest;-
4314 ++src;-
4315 }
never executed: end of block
0
4316}
never executed: end of block
0
4317-
4318static void blend_untransformed_rgb565(int count, const QSpan *spans, void *userData)-
4319{-
4320 QSpanData *data = reinterpret_cast<QSpanData*>(userData);-
4321 QPainter::CompositionMode mode = data->rasterBuffer->compositionMode;-
4322-
4323 if (data->texture.format != QImage::Format_RGB16
data->texture....::Format_RGB16Description
TRUEnever evaluated
FALSEnever evaluated
0
4324 || (mode != QPainter::CompositionMode_SourceOver
mode != QPaint...ode_SourceOverDescription
TRUEnever evaluated
FALSEnever evaluated
0
4325 && mode != QPainter::CompositionMode_Source))
mode != QPaint...ionMode_SourceDescription
TRUEnever evaluated
FALSEnever evaluated
0
4326 {-
4327 blend_untransformed_generic(count, spans, userData);-
4328 return;
never executed: return;
0
4329 }-
4330-
4331 const int image_width = data->texture.width;-
4332 const int image_height = data->texture.height;-
4333 int xoff = -qRound(-data->dx);-
4334 int yoff = -qRound(-data->dy);-
4335-
4336 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
4337 const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8;-
4338 if (coverage == 0) {
coverage == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4339 ++spans;-
4340 continue;
never executed: continue;
0
4341 }-
4342-
4343 int x = spans->x;-
4344 int length = spans->len;-
4345 int sx = xoff + x;-
4346 int sy = yoff + spans->y;-
4347 if (sy >= 0 && sy < image_height && sx < image_width) {
sy >= 0Description
TRUEnever evaluated
FALSEnever evaluated
sy < image_heightDescription
TRUEnever evaluated
FALSEnever evaluated
sx < image_widthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4348 if (sx < 0) {
sx < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4349 x -= sx;-
4350 length += sx;-
4351 sx = 0;-
4352 }
never executed: end of block
0
4353 if (sx + length > image_width)
sx + length > image_widthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4354 length = image_width - sx;
never executed: length = image_width - sx;
0
4355 if (length > 0) {
length > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4356 quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + x;-
4357 const quint16 *src = (const quint16 *)data->texture.scanLine(sy) + sx;-
4358 if (coverage == 255) {
coverage == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
4359 memcpy(dest, src, length * sizeof(quint16));-
4360 } else {
never executed: end of block
0
4361 const quint8 alpha = (coverage + 1) >> 3;-
4362 const quint8 ialpha = 0x20 - alpha;-
4363 if (alpha > 0)
alpha > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4364 blend_sourceOver_rgb16_rgb16(dest, src, length, alpha, ialpha);
never executed: blend_sourceOver_rgb16_rgb16(dest, src, length, alpha, ialpha);
0
4365 }
never executed: end of block
0
4366 }-
4367 }
never executed: end of block
0
4368 ++spans;-
4369 }
never executed: end of block
0
4370}
never executed: end of block
0
4371-
4372static void blend_tiled_generic(int count, const QSpan *spans, void *userData)-
4373{-
4374 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
4375-
4376 uint buffer[buffer_size];-
4377 uint src_buffer[buffer_size];-
4378 Operator op = getOperator(data, spans, count);-
4379-
4380 const int image_width = data->texture.width;-
4381 const int image_height = data->texture.height;-
4382 int xoff = -qRound(-data->dx) % image_width;-
4383 int yoff = -qRound(-data->dy) % image_height;-
4384-
4385 if (xoff < 0)
xoff < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4386 xoff += image_width;
never executed: xoff += image_width;
0
4387 if (yoff < 0)
yoff < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4388 yoff += image_height;
never executed: yoff += image_height;
0
4389-
4390 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
4391 int x = spans->x;-
4392 int length = spans->len;-
4393 int sx = (xoff + spans->x) % image_width;-
4394 int sy = (spans->y + yoff) % image_height;-
4395 if (sx < 0)
sx < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4396 sx += image_width;
never executed: sx += image_width;
0
4397 if (sy < 0)
sy < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4398 sy += image_height;
never executed: sy += image_height;
0
4399-
4400 const int coverage = (spans->coverage * data->texture.const_alpha) >> 8;-
4401 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4402 int l = qMin(image_width - sx, length);-
4403 if (buffer_size < l)
buffer_size < lDescription
TRUEnever evaluated
FALSEnever evaluated
0
4404 l = buffer_size;
never executed: l = buffer_size;
0
4405 const uint *src = op.srcFetch(src_buffer, &op, data, sy, sx, l);-
4406 uint *dest = op.destFetch ? op.destFetch(buffer, data->rasterBuffer, x, spans->y, l) : buffer;
op.destFetchDescription
TRUEnever evaluated
FALSEnever evaluated
0
4407 op.func(dest, src, l, coverage);-
4408 if (op.destStore)
op.destStoreDescription
TRUEnever evaluated
FALSEnever evaluated
0
4409 op.destStore(data->rasterBuffer, x, spans->y, dest, l);
never executed: op.destStore(data->rasterBuffer, x, spans->y, dest, l);
0
4410 x += l;-
4411 sx += l;-
4412 length -= l;-
4413 if (sx >= image_width)
sx >= image_widthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4414 sx = 0;
never executed: sx = 0;
0
4415 }
never executed: end of block
0
4416 ++spans;-
4417 }
never executed: end of block
0
4418}
never executed: end of block
0
4419-
4420static void blend_tiled_generic_rgb64(int count, const QSpan *spans, void *userData)-
4421{-
4422 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
4423-
4424 Operator op = getOperator(data, spans, count);-
4425 if (!op.func64) {
!op.func64Description
TRUEnever evaluated
FALSEnever evaluated
0
4426 qDebug("unsupported rgb64 blend");-
4427 return blend_tiled_generic(count, spans, userData);
never executed: return blend_tiled_generic(count, spans, userData);
0
4428 }-
4429 QRgba64 buffer[buffer_size];-
4430 QRgba64 src_buffer[buffer_size];-
4431-
4432 const int image_width = data->texture.width;-
4433 const int image_height = data->texture.height;-
4434 int xoff = -qRound(-data->dx) % image_width;-
4435 int yoff = -qRound(-data->dy) % image_height;-
4436-
4437 if (xoff < 0)
xoff < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4438 xoff += image_width;
never executed: xoff += image_width;
0
4439 if (yoff < 0)
yoff < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4440 yoff += image_height;
never executed: yoff += image_height;
0
4441-
4442 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
4443 int x = spans->x;-
4444 int length = spans->len;-
4445 int sx = (xoff + spans->x) % image_width;-
4446 int sy = (spans->y + yoff) % image_height;-
4447 if (sx < 0)
sx < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4448 sx += image_width;
never executed: sx += image_width;
0
4449 if (sy < 0)
sy < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4450 sy += image_height;
never executed: sy += image_height;
0
4451-
4452 const int coverage = (spans->coverage * data->texture.const_alpha) >> 8;-
4453 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4454 int l = qMin(image_width - sx, length);-
4455 if (buffer_size < l)
buffer_size < lDescription
TRUEnever evaluated
FALSEnever evaluated
0
4456 l = buffer_size;
never executed: l = buffer_size;
0
4457 const QRgba64 *src = op.srcFetch64(src_buffer, &op, data, sy, sx, l);-
4458 QRgba64 *dest = op.destFetch64(buffer, data->rasterBuffer, x, spans->y, l);-
4459 op.func64(dest, src, l, coverage);-
4460 op.destStore64(data->rasterBuffer, x, spans->y, dest, l);-
4461 x += l;-
4462 sx += l;-
4463 length -= l;-
4464 if (sx >= image_width)
sx >= image_widthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4465 sx = 0;
never executed: sx = 0;
0
4466 }
never executed: end of block
0
4467 ++spans;-
4468 }
never executed: end of block
0
4469}
never executed: end of block
0
4470-
4471static void blend_tiled_argb(int count, const QSpan *spans, void *userData)-
4472{-
4473 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
4474 if (data->texture.format != QImage::Format_ARGB32_Premultiplied
data->texture...._PremultipliedDescription
TRUEnever evaluated
FALSEnever evaluated
0
4475 && data->texture.format != QImage::Format_RGB32) {
data->texture....::Format_RGB32Description
TRUEnever evaluated
FALSEnever evaluated
0
4476 blend_tiled_generic(count, spans, userData);-
4477 return;
never executed: return;
0
4478 }-
4479-
4480 Operator op = getOperator(data, spans, count);-
4481-
4482 int image_width = data->texture.width;-
4483 int image_height = data->texture.height;-
4484 int xoff = -qRound(-data->dx) % image_width;-
4485 int yoff = -qRound(-data->dy) % image_height;-
4486-
4487 if (xoff < 0)
xoff < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4488 xoff += image_width;
never executed: xoff += image_width;
0
4489 if (yoff < 0)
yoff < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4490 yoff += image_height;
never executed: yoff += image_height;
0
4491-
4492 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
4493 int x = spans->x;-
4494 int length = spans->len;-
4495 int sx = (xoff + spans->x) % image_width;-
4496 int sy = (spans->y + yoff) % image_height;-
4497 if (sx < 0)
sx < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4498 sx += image_width;
never executed: sx += image_width;
0
4499 if (sy < 0)
sy < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4500 sy += image_height;
never executed: sy += image_height;
0
4501-
4502 const int coverage = (spans->coverage * data->texture.const_alpha) >> 8;-
4503 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4504 int l = qMin(image_width - sx, length);-
4505 if (buffer_size < l)
buffer_size < lDescription
TRUEnever evaluated
FALSEnever evaluated
0
4506 l = buffer_size;
never executed: l = buffer_size;
0
4507 const uint *src = (const uint *)data->texture.scanLine(sy) + sx;-
4508 uint *dest = ((uint *)data->rasterBuffer->scanLine(spans->y)) + x;-
4509 op.func(dest, src, l, coverage);-
4510 x += l;-
4511 sx += l;-
4512 length -= l;-
4513 if (sx >= image_width)
sx >= image_widthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4514 sx = 0;
never executed: sx = 0;
0
4515 }
never executed: end of block
0
4516 ++spans;-
4517 }
never executed: end of block
0
4518}
never executed: end of block
0
4519-
4520static void blend_tiled_rgb565(int count, const QSpan *spans, void *userData)-
4521{-
4522 QSpanData *data = reinterpret_cast<QSpanData*>(userData);-
4523 QPainter::CompositionMode mode = data->rasterBuffer->compositionMode;-
4524-
4525 if (data->texture.format != QImage::Format_RGB16
data->texture....::Format_RGB16Description
TRUEnever evaluated
FALSEnever evaluated
0
4526 || (mode != QPainter::CompositionMode_SourceOver
mode != QPaint...ode_SourceOverDescription
TRUEnever evaluated
FALSEnever evaluated
0
4527 && mode != QPainter::CompositionMode_Source))
mode != QPaint...ionMode_SourceDescription
TRUEnever evaluated
FALSEnever evaluated
0
4528 {-
4529 blend_tiled_generic(count, spans, userData);-
4530 return;
never executed: return;
0
4531 }-
4532-
4533 const int image_width = data->texture.width;-
4534 const int image_height = data->texture.height;-
4535 int xoff = -qRound(-data->dx) % image_width;-
4536 int yoff = -qRound(-data->dy) % image_height;-
4537-
4538 if (xoff < 0)
xoff < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4539 xoff += image_width;
never executed: xoff += image_width;
0
4540 if (yoff < 0)
yoff < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4541 yoff += image_height;
never executed: yoff += image_height;
0
4542-
4543 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
4544 const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8;-
4545 if (coverage == 0) {
coverage == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4546 ++spans;-
4547 continue;
never executed: continue;
0
4548 }-
4549-
4550 int x = spans->x;-
4551 int length = spans->len;-
4552 int sx = (xoff + spans->x) % image_width;-
4553 int sy = (spans->y + yoff) % image_height;-
4554 if (sx < 0)
sx < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4555 sx += image_width;
never executed: sx += image_width;
0
4556 if (sy < 0)
sy < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4557 sy += image_height;
never executed: sy += image_height;
0
4558-
4559 if (coverage == 255) {
coverage == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
4560 // Copy the first texture block-
4561 length = qMin(image_width,length);-
4562 int tx = x;-
4563 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4564 int l = qMin(image_width - sx, length);-
4565 if (buffer_size < l)
buffer_size < lDescription
TRUEnever evaluated
FALSEnever evaluated
0
4566 l = buffer_size;
never executed: l = buffer_size;
0
4567 quint16 *dest = ((quint16 *)data->rasterBuffer->scanLine(spans->y)) + tx;-
4568 const quint16 *src = (const quint16 *)data->texture.scanLine(sy) + sx;-
4569 memcpy(dest, src, l * sizeof(quint16));-
4570 length -= l;-
4571 tx += l;-
4572 sx += l;-
4573 if (sx >= image_width)
sx >= image_widthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4574 sx = 0;
never executed: sx = 0;
0
4575 }
never executed: end of block
0
4576-
4577 // Now use the rasterBuffer as the source of the texture,-
4578 // We can now progressively copy larger blocks-
4579 // - Less cpu time in code figuring out what to copy-
4580 // We are dealing with one block of data-
4581 // - More likely to fit in the cache-
4582 // - can use memcpy-
4583 int copy_image_width = qMin(image_width, int(spans->len));-
4584 length = spans->len - copy_image_width;-
4585 quint16 *src = ((quint16 *)data->rasterBuffer->scanLine(spans->y)) + x;-
4586 quint16 *dest = src + copy_image_width;-
4587 while (copy_image_width < length) {
copy_image_width < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4588 memcpy(dest, src, copy_image_width * sizeof(quint16));-
4589 dest += copy_image_width;-
4590 length -= copy_image_width;-
4591 copy_image_width *= 2;-
4592 }
never executed: end of block
0
4593 if (length > 0)
length > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4594 memcpy(dest, src, length * sizeof(quint16));
never executed: memcpy(dest, src, length * sizeof(quint16));
0
4595 } else {
never executed: end of block
0
4596 const quint8 alpha = (coverage + 1) >> 3;-
4597 const quint8 ialpha = 0x20 - alpha;-
4598 if (alpha > 0) {
alpha > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4599 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4600 int l = qMin(image_width - sx, length);-
4601 if (buffer_size < l)
buffer_size < lDescription
TRUEnever evaluated
FALSEnever evaluated
0
4602 l = buffer_size;
never executed: l = buffer_size;
0
4603 quint16 *dest = ((quint16 *)data->rasterBuffer->scanLine(spans->y)) + x;-
4604 const quint16 *src = (const quint16 *)data->texture.scanLine(sy) + sx;-
4605 blend_sourceOver_rgb16_rgb16(dest, src, l, alpha, ialpha);-
4606 x += l;-
4607 sx += l;-
4608 length -= l;-
4609 if (sx >= image_width)
sx >= image_widthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4610 sx = 0;
never executed: sx = 0;
0
4611 }
never executed: end of block
0
4612 }
never executed: end of block
0
4613 }
never executed: end of block
0
4614 ++spans;-
4615 }
never executed: end of block
0
4616}
never executed: end of block
0
4617-
4618static void blend_transformed_bilinear_rgb565(int count, const QSpan *spans, void *userData)-
4619{-
4620 QSpanData *data = reinterpret_cast<QSpanData*>(userData);-
4621 QPainter::CompositionMode mode = data->rasterBuffer->compositionMode;-
4622-
4623 if (data->texture.format != QImage::Format_RGB16
data->texture....::Format_RGB16Description
TRUEnever evaluated
FALSEnever evaluated
0
4624 || (mode != QPainter::CompositionMode_SourceOver
mode != QPaint...ode_SourceOverDescription
TRUEnever evaluated
FALSEnever evaluated
0
4625 && mode != QPainter::CompositionMode_Source))
mode != QPaint...ionMode_SourceDescription
TRUEnever evaluated
FALSEnever evaluated
0
4626 {-
4627 blend_src_generic(count, spans, userData);-
4628 return;
never executed: return;
0
4629 }-
4630-
4631 quint16 buffer[buffer_size];-
4632-
4633 const int src_minx = data->texture.x1;-
4634 const int src_miny = data->texture.y1;-
4635 const int src_maxx = data->texture.x2 - 1;-
4636 const int src_maxy = data->texture.y2 - 1;-
4637-
4638 if (data->fast_matrix) {
data->fast_matrixDescription
TRUEnever evaluated
FALSEnever evaluated
0
4639 // The increment pr x in the scanline-
4640 const int fdx = (int)(data->m11 * fixed_scale);-
4641 const int fdy = (int)(data->m12 * fixed_scale);-
4642-
4643 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
4644 const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8;-
4645 const quint8 alpha = (coverage + 1) >> 3;-
4646 const quint8 ialpha = 0x20 - alpha;-
4647 if (alpha == 0) {
alpha == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4648 ++spans;-
4649 continue;
never executed: continue;
0
4650 }-
4651-
4652 quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x;-
4653 const qreal cx = spans->x + qreal(0.5);-
4654 const qreal cy = spans->y + qreal(0.5);-
4655 int x = int((data->m21 * cy-
4656 + data->m11 * cx + data->dx) * fixed_scale) - half_point;-
4657 int y = int((data->m22 * cy-
4658 + data->m12 * cx + data->dy) * fixed_scale) - half_point;-
4659 int length = spans->len;-
4660-
4661 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4662 int l;-
4663 quint16 *b;-
4664 if (ialpha == 0) {
ialpha == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4665 l = length;-
4666 b = dest;-
4667 } else {
never executed: end of block
0
4668 l = qMin(length, buffer_size);-
4669 b = buffer;-
4670 }
never executed: end of block
0
4671 const quint16 *end = b + l;-
4672-
4673 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
4674 int x1 = (x >> 16);-
4675 int x2;-
4676 int y1 = (y >> 16);-
4677 int y2;-
4678-
4679 fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(0, src_minx, src_maxx, x1, x2);-
4680 fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(0, src_miny, src_maxy, y1, y2);-
4681-
4682 const quint16 *src1 = (const quint16*)data->texture.scanLine(y1);-
4683 const quint16 *src2 = (const quint16*)data->texture.scanLine(y2);-
4684 quint16 tl = src1[x1];-
4685 const quint16 tr = src1[x2];-
4686 quint16 bl = src2[x1];-
4687 const quint16 br = src2[x2];-
4688-
4689 const uint distxsl8 = x & 0xff00;-
4690 const uint distysl8 = y & 0xff00;-
4691 const uint distx = distxsl8 >> 8;-
4692 const uint disty = distysl8 >> 8;-
4693 const uint distxy = distx * disty;-
4694-
4695 const uint tlw = 0x10000 - distxsl8 - distysl8 + distxy; // (256 - distx) * (256 - disty)-
4696 const uint trw = distxsl8 - distxy; // distx * (256 - disty)-
4697 const uint blw = distysl8 - distxy; // (256 - distx) * disty-
4698 const uint brw = distxy; // distx * disty-
4699 uint red = ((tl & 0xf800) * tlw + (tr & 0xf800) * trw-
4700 + (bl & 0xf800) * blw + (br & 0xf800) * brw) & 0xf8000000;-
4701 uint green = ((tl & 0x07e0) * tlw + (tr & 0x07e0) * trw-
4702 + (bl & 0x07e0) * blw + (br & 0x07e0) * brw) & 0x07e00000;-
4703 uint blue = ((tl & 0x001f) * tlw + (tr & 0x001f) * trw-
4704 + (bl & 0x001f) * blw + (br & 0x001f) * brw);-
4705 *b = quint16((red | green | blue) >> 16);-
4706-
4707 ++b;-
4708 x += fdx;-
4709 y += fdy;-
4710 }
never executed: end of block
0
4711-
4712 if (ialpha != 0)
ialpha != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4713 blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha);
never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha);
0
4714-
4715 dest += l;-
4716 length -= l;-
4717 }
never executed: end of block
0
4718 ++spans;-
4719 }
never executed: end of block
0
4720 } else {
never executed: end of block
0
4721 const qreal fdx = data->m11;-
4722 const qreal fdy = data->m12;-
4723 const qreal fdw = data->m13;-
4724-
4725 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
4726 const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8;-
4727 const quint8 alpha = (coverage + 1) >> 3;-
4728 const quint8 ialpha = 0x20 - alpha;-
4729 if (alpha == 0) {
alpha == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4730 ++spans;-
4731 continue;
never executed: continue;
0
4732 }-
4733-
4734 quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x;-
4735-
4736 const qreal cx = spans->x + qreal(0.5);-
4737 const qreal cy = spans->y + qreal(0.5);-
4738-
4739 qreal x = data->m21 * cy + data->m11 * cx + data->dx;-
4740 qreal y = data->m22 * cy + data->m12 * cx + data->dy;-
4741 qreal w = data->m23 * cy + data->m13 * cx + data->m33;-
4742-
4743 int length = spans->len;-
4744 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4745 int l;-
4746 quint16 *b;-
4747 if (ialpha == 0) {
ialpha == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4748 l = length;-
4749 b = dest;-
4750 } else {
never executed: end of block
0
4751 l = qMin(length, buffer_size);-
4752 b = buffer;-
4753 }
never executed: end of block
0
4754 const quint16 *end = b + l;-
4755-
4756 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
4757 const qreal iw = w == 0 ? 1 : 1 / w;
w == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4758 const qreal px = x * iw - qreal(0.5);-
4759 const qreal py = y * iw - qreal(0.5);-
4760-
4761 int x1 = int(px) - (px < 0);-
4762 int x2;-
4763 int y1 = int(py) - (py < 0);-
4764 int y2;-
4765-
4766 fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(0, src_minx, src_maxx, x1, x2);-
4767 fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(0, src_miny, src_maxy, y1, y2);-
4768-
4769 const quint16 *src1 = (const quint16 *)data->texture.scanLine(y1);-
4770 const quint16 *src2 = (const quint16 *)data->texture.scanLine(y2);-
4771 quint16 tl = src1[x1];-
4772 const quint16 tr = src1[x2];-
4773 quint16 bl = src2[x1];-
4774 const quint16 br = src2[x2];-
4775-
4776 const uint distx = uint((px - x1) * 256);-
4777 const uint disty = uint((py - y1) * 256);-
4778 const uint distxsl8 = distx << 8;-
4779 const uint distysl8 = disty << 8;-
4780 const uint distxy = distx * disty;-
4781-
4782 const uint tlw = 0x10000 - distxsl8 - distysl8 + distxy; // (256 - distx) * (256 - disty)-
4783 const uint trw = distxsl8 - distxy; // distx * (256 - disty)-
4784 const uint blw = distysl8 - distxy; // (256 - distx) * disty-
4785 const uint brw = distxy; // distx * disty-
4786 uint red = ((tl & 0xf800) * tlw + (tr & 0xf800) * trw-
4787 + (bl & 0xf800) * blw + (br & 0xf800) * brw) & 0xf8000000;-
4788 uint green = ((tl & 0x07e0) * tlw + (tr & 0x07e0) * trw-
4789 + (bl & 0x07e0) * blw + (br & 0x07e0) * brw) & 0x07e00000;-
4790 uint blue = ((tl & 0x001f) * tlw + (tr & 0x001f) * trw-
4791 + (bl & 0x001f) * blw + (br & 0x001f) * brw);-
4792 *b = quint16((red | green | blue) >> 16);-
4793-
4794 ++b;-
4795 x += fdx;-
4796 y += fdy;-
4797 w += fdw;-
4798 }
never executed: end of block
0
4799-
4800 if (ialpha != 0)
ialpha != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4801 blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha);
never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha);
0
4802-
4803 dest += l;-
4804 length -= l;-
4805 }
never executed: end of block
0
4806 ++spans;-
4807 }
never executed: end of block
0
4808 }
never executed: end of block
0
4809}-
4810-
4811static void blend_transformed_argb(int count, const QSpan *spans, void *userData)-
4812{-
4813 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
4814 if (data->texture.format != QImage::Format_ARGB32_Premultiplied
data->texture...._PremultipliedDescription
TRUEnever evaluated
FALSEnever evaluated
0
4815 && data->texture.format != QImage::Format_RGB32) {
data->texture....::Format_RGB32Description
TRUEnever evaluated
FALSEnever evaluated
0
4816 blend_src_generic(count, spans, userData);-
4817 return;
never executed: return;
0
4818 }-
4819-
4820 CompositionFunction func = functionForMode[data->rasterBuffer->compositionMode];-
4821 uint buffer[buffer_size];-
4822-
4823 int image_width = data->texture.width;-
4824 int image_height = data->texture.height;-
4825-
4826 if (data->fast_matrix) {
data->fast_matrixDescription
TRUEnever evaluated
FALSEnever evaluated
0
4827 // The increment pr x in the scanline-
4828 int fdx = (int)(data->m11 * fixed_scale);-
4829 int fdy = (int)(data->m12 * fixed_scale);-
4830-
4831 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
4832 void *t = data->rasterBuffer->scanLine(spans->y);-
4833-
4834 uint *target = ((uint *)t) + spans->x;-
4835-
4836 const qreal cx = spans->x + qreal(0.5);-
4837 const qreal cy = spans->y + qreal(0.5);-
4838-
4839 int x = int((data->m21 * cy-
4840 + data->m11 * cx + data->dx) * fixed_scale);-
4841 int y = int((data->m22 * cy-
4842 + data->m12 * cx + data->dy) * fixed_scale);-
4843-
4844 int length = spans->len;-
4845 const int coverage = (spans->coverage * data->texture.const_alpha) >> 8;-
4846 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4847 int l = qMin(length, buffer_size);-
4848 const uint *end = buffer + l;-
4849 uint *b = buffer;-
4850 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
4851 int px = qBound(0, x >> 16, image_width - 1);-
4852 int py = qBound(0, y >> 16, image_height - 1);-
4853 *b = reinterpret_cast<const uint *>(data->texture.scanLine(py))[px];-
4854-
4855 x += fdx;-
4856 y += fdy;-
4857 ++b;-
4858 }
never executed: end of block
0
4859 func(target, buffer, l, coverage);-
4860 target += l;-
4861 length -= l;-
4862 }
never executed: end of block
0
4863 ++spans;-
4864 }
never executed: end of block
0
4865 } else {
never executed: end of block
0
4866 const qreal fdx = data->m11;-
4867 const qreal fdy = data->m12;-
4868 const qreal fdw = data->m13;-
4869 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
4870 void *t = data->rasterBuffer->scanLine(spans->y);-
4871-
4872 uint *target = ((uint *)t) + spans->x;-
4873-
4874 const qreal cx = spans->x + qreal(0.5);-
4875 const qreal cy = spans->y + qreal(0.5);-
4876-
4877 qreal x = data->m21 * cy + data->m11 * cx + data->dx;-
4878 qreal y = data->m22 * cy + data->m12 * cx + data->dy;-
4879 qreal w = data->m23 * cy + data->m13 * cx + data->m33;-
4880-
4881 int length = spans->len;-
4882 const int coverage = (spans->coverage * data->texture.const_alpha) >> 8;-
4883 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4884 int l = qMin(length, buffer_size);-
4885 const uint *end = buffer + l;-
4886 uint *b = buffer;-
4887 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
4888 const qreal iw = w == 0 ? 1 : 1 / w;
w == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4889 const qreal tx = x * iw;-
4890 const qreal ty = y * iw;-
4891 const int px = qBound(0, int(tx) - (tx < 0), image_width - 1);-
4892 const int py = qBound(0, int(ty) - (ty < 0), image_height - 1);-
4893-
4894 *b = reinterpret_cast<const uint *>(data->texture.scanLine(py))[px];-
4895 x += fdx;-
4896 y += fdy;-
4897 w += fdw;-
4898-
4899 ++b;-
4900 }
never executed: end of block
0
4901 func(target, buffer, l, coverage);-
4902 target += l;-
4903 length -= l;-
4904 }
never executed: end of block
0
4905 ++spans;-
4906 }
never executed: end of block
0
4907 }
never executed: end of block
0
4908}-
4909-
4910static void blend_transformed_rgb565(int count, const QSpan *spans, void *userData)-
4911{-
4912 QSpanData *data = reinterpret_cast<QSpanData*>(userData);-
4913 QPainter::CompositionMode mode = data->rasterBuffer->compositionMode;-
4914-
4915 if (data->texture.format != QImage::Format_RGB16
data->texture....::Format_RGB16Description
TRUEnever evaluated
FALSEnever evaluated
0
4916 || (mode != QPainter::CompositionMode_SourceOver
mode != QPaint...ode_SourceOverDescription
TRUEnever evaluated
FALSEnever evaluated
0
4917 && mode != QPainter::CompositionMode_Source))
mode != QPaint...ionMode_SourceDescription
TRUEnever evaluated
FALSEnever evaluated
0
4918 {-
4919 blend_src_generic(count, spans, userData);-
4920 return;
never executed: return;
0
4921 }-
4922-
4923 quint16 buffer[buffer_size];-
4924 const int image_width = data->texture.width;-
4925 const int image_height = data->texture.height;-
4926-
4927 if (data->fast_matrix) {
data->fast_matrixDescription
TRUEnever evaluated
FALSEnever evaluated
0
4928 // The increment pr x in the scanline-
4929 const int fdx = (int)(data->m11 * fixed_scale);-
4930 const int fdy = (int)(data->m12 * fixed_scale);-
4931-
4932 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
4933 const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8;-
4934 const quint8 alpha = (coverage + 1) >> 3;-
4935 const quint8 ialpha = 0x20 - alpha;-
4936 if (alpha == 0) {
alpha == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4937 ++spans;-
4938 continue;
never executed: continue;
0
4939 }-
4940-
4941 quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x;-
4942 const qreal cx = spans->x + qreal(0.5);-
4943 const qreal cy = spans->y + qreal(0.5);-
4944 int x = int((data->m21 * cy-
4945 + data->m11 * cx + data->dx) * fixed_scale);-
4946 int y = int((data->m22 * cy-
4947 + data->m12 * cx + data->dy) * fixed_scale);-
4948 int length = spans->len;-
4949-
4950 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
4951 int l;-
4952 quint16 *b;-
4953 if (ialpha == 0) {
ialpha == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4954 l = length;-
4955 b = dest;-
4956 } else {
never executed: end of block
0
4957 l = qMin(length, buffer_size);-
4958 b = buffer;-
4959 }
never executed: end of block
0
4960 const quint16 *end = b + l;-
4961-
4962 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
4963 const int px = qBound(0, x >> 16, image_width - 1);-
4964 const int py = qBound(0, y >> 16, image_height - 1);-
4965-
4966 *b = ((const quint16 *)data->texture.scanLine(py))[px];-
4967 ++b;-
4968-
4969 x += fdx;-
4970 y += fdy;-
4971 }
never executed: end of block
0
4972-
4973 if (ialpha != 0)
ialpha != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4974 blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha);
never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha);
0
4975-
4976 dest += l;-
4977 length -= l;-
4978 }
never executed: end of block
0
4979 ++spans;-
4980 }
never executed: end of block
0
4981 } else {
never executed: end of block
0
4982 const qreal fdx = data->m11;-
4983 const qreal fdy = data->m12;-
4984 const qreal fdw = data->m13;-
4985-
4986 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
4987 const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8;-
4988 const quint8 alpha = (coverage + 1) >> 3;-
4989 const quint8 ialpha = 0x20 - alpha;-
4990 if (alpha == 0) {
alpha == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
4991 ++spans;-
4992 continue;
never executed: continue;
0
4993 }-
4994-
4995 quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x;-
4996-
4997 const qreal cx = spans->x + qreal(0.5);-
4998 const qreal cy = spans->y + qreal(0.5);-
4999-
5000 qreal x = data->m21 * cy + data->m11 * cx + data->dx;-
5001 qreal y = data->m22 * cy + data->m12 * cx + data->dy;-
5002 qreal w = data->m23 * cy + data->m13 * cx + data->m33;-
5003-
5004 int length = spans->len;-
5005 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
5006 int l;-
5007 quint16 *b;-
5008 if (ialpha == 0) {
ialpha == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5009 l = length;-
5010 b = dest;-
5011 } else {
never executed: end of block
0
5012 l = qMin(length, buffer_size);-
5013 b = buffer;-
5014 }
never executed: end of block
0
5015 const quint16 *end = b + l;-
5016-
5017 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
5018 const qreal iw = w == 0 ? 1 : 1 / w;
w == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5019 const qreal tx = x * iw;-
5020 const qreal ty = y * iw;-
5021-
5022 const int px = qBound(0, int(tx) - (tx < 0), image_width - 1);-
5023 const int py = qBound(0, int(ty) - (ty < 0), image_height - 1);-
5024-
5025 *b = ((const quint16 *)data->texture.scanLine(py))[px];-
5026 ++b;-
5027-
5028 x += fdx;-
5029 y += fdy;-
5030 w += fdw;-
5031 }
never executed: end of block
0
5032-
5033 if (ialpha != 0)
ialpha != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5034 blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha);
never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha);
0
5035-
5036 dest += l;-
5037 length -= l;-
5038 }
never executed: end of block
0
5039 ++spans;-
5040 }
never executed: end of block
0
5041 }
never executed: end of block
0
5042}-
5043-
5044static void blend_transformed_tiled_argb(int count, const QSpan *spans, void *userData)-
5045{-
5046 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
5047 if (data->texture.format != QImage::Format_ARGB32_Premultiplied
data->texture...._PremultipliedDescription
TRUEnever evaluated
FALSEnever evaluated
0
5048 && data->texture.format != QImage::Format_RGB32) {
data->texture....::Format_RGB32Description
TRUEnever evaluated
FALSEnever evaluated
0
5049 blend_src_generic(count, spans, userData);-
5050 return;
never executed: return;
0
5051 }-
5052-
5053 CompositionFunction func = functionForMode[data->rasterBuffer->compositionMode];-
5054 uint buffer[buffer_size];-
5055-
5056 int image_width = data->texture.width;-
5057 int image_height = data->texture.height;-
5058 const int scanline_offset = data->texture.bytesPerLine / 4;-
5059-
5060 if (data->fast_matrix) {
data->fast_matrixDescription
TRUEnever evaluated
FALSEnever evaluated
0
5061 // The increment pr x in the scanline-
5062 int fdx = (int)(data->m11 * fixed_scale);-
5063 int fdy = (int)(data->m12 * fixed_scale);-
5064-
5065 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
5066 void *t = data->rasterBuffer->scanLine(spans->y);-
5067-
5068 uint *target = ((uint *)t) + spans->x;-
5069 const uint *image_bits = (const uint *)data->texture.imageData;-
5070-
5071 const qreal cx = spans->x + qreal(0.5);-
5072 const qreal cy = spans->y + qreal(0.5);-
5073-
5074 int x = int((data->m21 * cy-
5075 + data->m11 * cx + data->dx) * fixed_scale);-
5076 int y = int((data->m22 * cy-
5077 + data->m12 * cx + data->dy) * fixed_scale);-
5078-
5079 const int coverage = (spans->coverage * data->texture.const_alpha) >> 8;-
5080 int length = spans->len;-
5081 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
5082 int l = qMin(length, buffer_size);-
5083 const uint *end = buffer + l;-
5084 uint *b = buffer;-
5085 int px16 = x % (image_width << 16);-
5086 int py16 = y % (image_height << 16);-
5087 int px_delta = fdx % (image_width << 16);-
5088 int py_delta = fdy % (image_height << 16);-
5089 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
5090 if (px16 < 0) px16 += image_width << 16;
never executed: px16 += image_width << 16;
px16 < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5091 if (py16 < 0) py16 += image_height << 16;
never executed: py16 += image_height << 16;
py16 < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5092 int px = px16 >> 16;-
5093 int py = py16 >> 16;-
5094 int y_offset = py * scanline_offset;-
5095-
5096 Q_ASSERT(px >= 0 && px < image_width);-
5097 Q_ASSERT(py >= 0 && py < image_height);-
5098-
5099 *b = image_bits[y_offset + px];-
5100 x += fdx;-
5101 y += fdy;-
5102 px16 += px_delta;-
5103 if (px16 >= image_width << 16)
px16 >= image_width << 16Description
TRUEnever evaluated
FALSEnever evaluated
0
5104 px16 -= image_width << 16;
never executed: px16 -= image_width << 16;
0
5105 py16 += py_delta;-
5106 if (py16 >= image_height << 16)
py16 >= image_height << 16Description
TRUEnever evaluated
FALSEnever evaluated
0
5107 py16 -= image_height << 16;
never executed: py16 -= image_height << 16;
0
5108 ++b;-
5109 }
never executed: end of block
0
5110 func(target, buffer, l, coverage);-
5111 target += l;-
5112 length -= l;-
5113 }
never executed: end of block
0
5114 ++spans;-
5115 }
never executed: end of block
0
5116 } else {
never executed: end of block
0
5117 const qreal fdx = data->m11;-
5118 const qreal fdy = data->m12;-
5119 const qreal fdw = data->m13;-
5120 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
5121 void *t = data->rasterBuffer->scanLine(spans->y);-
5122-
5123 uint *target = ((uint *)t) + spans->x;-
5124 const uint *image_bits = (const uint *)data->texture.imageData;-
5125-
5126 const qreal cx = spans->x + qreal(0.5);-
5127 const qreal cy = spans->y + qreal(0.5);-
5128-
5129 qreal x = data->m21 * cy + data->m11 * cx + data->dx;-
5130 qreal y = data->m22 * cy + data->m12 * cx + data->dy;-
5131 qreal w = data->m23 * cy + data->m13 * cx + data->m33;-
5132-
5133 const int coverage = (spans->coverage * data->texture.const_alpha) >> 8;-
5134 int length = spans->len;-
5135 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
5136 int l = qMin(length, buffer_size);-
5137 const uint *end = buffer + l;-
5138 uint *b = buffer;-
5139 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
5140 const qreal iw = w == 0 ? 1 : 1 / w;
w == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5141 const qreal tx = x * iw;-
5142 const qreal ty = y * iw;-
5143 int px = int(tx) - (tx < 0);-
5144 int py = int(ty) - (ty < 0);-
5145-
5146 px %= image_width;-
5147 py %= image_height;-
5148 if (px < 0) px += image_width;
never executed: px += image_width;
px < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5149 if (py < 0) py += image_height;
never executed: py += image_height;
py < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5150 int y_offset = py * scanline_offset;-
5151-
5152 Q_ASSERT(px >= 0 && px < image_width);-
5153 Q_ASSERT(py >= 0 && py < image_height);-
5154-
5155 *b = image_bits[y_offset + px];-
5156 x += fdx;-
5157 y += fdy;-
5158 w += fdw;-
5159 //force increment to avoid /0-
5160 if (!w) {
!wDescription
TRUEnever evaluated
FALSEnever evaluated
0
5161 w += fdw;-
5162 }
never executed: end of block
0
5163 ++b;-
5164 }
never executed: end of block
0
5165 func(target, buffer, l, coverage);-
5166 target += l;-
5167 length -= l;-
5168 }
never executed: end of block
0
5169 ++spans;-
5170 }
never executed: end of block
0
5171 }
never executed: end of block
0
5172}-
5173-
5174static void blend_transformed_tiled_rgb565(int count, const QSpan *spans, void *userData)-
5175{-
5176 QSpanData *data = reinterpret_cast<QSpanData*>(userData);-
5177 QPainter::CompositionMode mode = data->rasterBuffer->compositionMode;-
5178-
5179 if (data->texture.format != QImage::Format_RGB16
data->texture....::Format_RGB16Description
TRUEnever evaluated
FALSEnever evaluated
0
5180 || (mode != QPainter::CompositionMode_SourceOver
mode != QPaint...ode_SourceOverDescription
TRUEnever evaluated
FALSEnever evaluated
0
5181 && mode != QPainter::CompositionMode_Source))
mode != QPaint...ionMode_SourceDescription
TRUEnever evaluated
FALSEnever evaluated
0
5182 {-
5183 blend_src_generic(count, spans, userData);-
5184 return;
never executed: return;
0
5185 }-
5186-
5187 quint16 buffer[buffer_size];-
5188 const int image_width = data->texture.width;-
5189 const int image_height = data->texture.height;-
5190-
5191 if (data->fast_matrix) {
data->fast_matrixDescription
TRUEnever evaluated
FALSEnever evaluated
0
5192 // The increment pr x in the scanline-
5193 const int fdx = (int)(data->m11 * fixed_scale);-
5194 const int fdy = (int)(data->m12 * fixed_scale);-
5195-
5196 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
5197 const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8;-
5198 const quint8 alpha = (coverage + 1) >> 3;-
5199 const quint8 ialpha = 0x20 - alpha;-
5200 if (alpha == 0) {
alpha == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5201 ++spans;-
5202 continue;
never executed: continue;
0
5203 }-
5204-
5205 quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x;-
5206 const qreal cx = spans->x + qreal(0.5);-
5207 const qreal cy = spans->y + qreal(0.5);-
5208 int x = int((data->m21 * cy-
5209 + data->m11 * cx + data->dx) * fixed_scale);-
5210 int y = int((data->m22 * cy-
5211 + data->m12 * cx + data->dy) * fixed_scale);-
5212 int length = spans->len;-
5213-
5214 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
5215 int l;-
5216 quint16 *b;-
5217 if (ialpha == 0) {
ialpha == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5218 l = length;-
5219 b = dest;-
5220 } else {
never executed: end of block
0
5221 l = qMin(length, buffer_size);-
5222 b = buffer;-
5223 }
never executed: end of block
0
5224 const quint16 *end = b + l;-
5225-
5226 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
5227 int px = (x >> 16) % image_width;-
5228 int py = (y >> 16) % image_height;-
5229-
5230 if (px < 0)
px < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5231 px += image_width;
never executed: px += image_width;
0
5232 if (py < 0)
py < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5233 py += image_height;
never executed: py += image_height;
0
5234-
5235 *b = ((const quint16 *)data->texture.scanLine(py))[px];-
5236 ++b;-
5237-
5238 x += fdx;-
5239 y += fdy;-
5240 }
never executed: end of block
0
5241-
5242 if (ialpha != 0)
ialpha != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5243 blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha);
never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha);
0
5244-
5245 dest += l;-
5246 length -= l;-
5247 }
never executed: end of block
0
5248 ++spans;-
5249 }
never executed: end of block
0
5250 } else {
never executed: end of block
0
5251 const qreal fdx = data->m11;-
5252 const qreal fdy = data->m12;-
5253 const qreal fdw = data->m13;-
5254-
5255 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
5256 const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8;-
5257 const quint8 alpha = (coverage + 1) >> 3;-
5258 const quint8 ialpha = 0x20 - alpha;-
5259 if (alpha == 0) {
alpha == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5260 ++spans;-
5261 continue;
never executed: continue;
0
5262 }-
5263-
5264 quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x;-
5265-
5266 const qreal cx = spans->x + qreal(0.5);-
5267 const qreal cy = spans->y + qreal(0.5);-
5268-
5269 qreal x = data->m21 * cy + data->m11 * cx + data->dx;-
5270 qreal y = data->m22 * cy + data->m12 * cx + data->dy;-
5271 qreal w = data->m23 * cy + data->m13 * cx + data->m33;-
5272-
5273 int length = spans->len;-
5274 while (length) {
lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
5275 int l;-
5276 quint16 *b;-
5277 if (ialpha == 0) {
ialpha == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5278 l = length;-
5279 b = dest;-
5280 } else {
never executed: end of block
0
5281 l = qMin(length, buffer_size);-
5282 b = buffer;-
5283 }
never executed: end of block
0
5284 const quint16 *end = b + l;-
5285-
5286 while (b < end) {
b < endDescription
TRUEnever evaluated
FALSEnever evaluated
0
5287 const qreal iw = w == 0 ? 1 : 1 / w;
w == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5288 const qreal tx = x * iw;-
5289 const qreal ty = y * iw;-
5290-
5291 int px = int(tx) - (tx < 0);-
5292 int py = int(ty) - (ty < 0);-
5293-
5294 px %= image_width;-
5295 py %= image_height;-
5296 if (px < 0)
px < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5297 px += image_width;
never executed: px += image_width;
0
5298 if (py < 0)
py < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5299 py += image_height;
never executed: py += image_height;
0
5300-
5301 *b = ((const quint16 *)data->texture.scanLine(py))[px];-
5302 ++b;-
5303-
5304 x += fdx;-
5305 y += fdy;-
5306 w += fdw;-
5307 // force increment to avoid /0-
5308 if (!w)
!wDescription
TRUEnever evaluated
FALSEnever evaluated
0
5309 w += fdw;
never executed: w += fdw;
0
5310 }
never executed: end of block
0
5311-
5312 if (ialpha != 0)
ialpha != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5313 blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha);
never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha);
0
5314-
5315 dest += l;-
5316 length -= l;-
5317 }
never executed: end of block
0
5318 ++spans;-
5319 }
never executed: end of block
0
5320 }
never executed: end of block
0
5321}-
5322-
5323-
5324/* Image formats here are target formats */-
5325static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats] = {-
5326 // Untransformed-
5327 {-
5328 0, // Invalid-
5329 blend_untransformed_generic, // Mono-
5330 blend_untransformed_generic, // MonoLsb-
5331 blend_untransformed_generic, // Indexed8-
5332 blend_untransformed_generic, // RGB32-
5333 blend_untransformed_generic, // ARGB32-
5334 blend_untransformed_argb, // ARGB32_Premultiplied-
5335 blend_untransformed_rgb565,-
5336 blend_untransformed_generic,-
5337 blend_untransformed_generic,-
5338 blend_untransformed_generic,-
5339 blend_untransformed_generic,-
5340 blend_untransformed_generic,-
5341 blend_untransformed_generic,-
5342 blend_untransformed_generic,-
5343 blend_untransformed_generic,-
5344 blend_untransformed_generic,-
5345 blend_untransformed_generic,-
5346 blend_untransformed_generic,-
5347 blend_untransformed_generic_rgb64,-
5348 blend_untransformed_generic_rgb64,-
5349 blend_untransformed_generic_rgb64,-
5350 blend_untransformed_generic_rgb64,-
5351 blend_untransformed_generic,-
5352 blend_untransformed_generic,-
5353 },-
5354 // Tiled-
5355 {-
5356 0, // Invalid-
5357 blend_tiled_generic, // Mono-
5358 blend_tiled_generic, // MonoLsb-
5359 blend_tiled_generic, // Indexed8-
5360 blend_tiled_generic, // RGB32-
5361 blend_tiled_generic, // ARGB32-
5362 blend_tiled_argb, // ARGB32_Premultiplied-
5363 blend_tiled_rgb565,-
5364 blend_tiled_generic,-
5365 blend_tiled_generic,-
5366 blend_tiled_generic,-
5367 blend_tiled_generic,-
5368 blend_tiled_generic,-
5369 blend_tiled_generic,-
5370 blend_tiled_generic,-
5371 blend_tiled_generic,-
5372 blend_tiled_generic,-
5373 blend_tiled_generic,-
5374 blend_tiled_generic,-
5375 blend_tiled_generic_rgb64,-
5376 blend_tiled_generic_rgb64,-
5377 blend_tiled_generic_rgb64,-
5378 blend_tiled_generic_rgb64,-
5379 blend_tiled_generic,-
5380 blend_tiled_generic,-
5381 },-
5382 // Transformed-
5383 {-
5384 0, // Invalid-
5385 blend_src_generic, // Mono-
5386 blend_src_generic, // MonoLsb-
5387 blend_src_generic, // Indexed8-
5388 blend_src_generic, // RGB32-
5389 blend_src_generic, // ARGB32-
5390 blend_transformed_argb, // ARGB32_Premultiplied-
5391 blend_transformed_rgb565,-
5392 blend_src_generic, // ARGB8565_Premultiplied-
5393 blend_src_generic, // RGB666-
5394 blend_src_generic, // ARGB6666_Premultiplied-
5395 blend_src_generic, // RGB555-
5396 blend_src_generic, // ARGB8555_Premultiplied-
5397 blend_src_generic, // RGB888-
5398 blend_src_generic, // RGB444-
5399 blend_src_generic, // ARGB4444_Premultiplied-
5400 blend_src_generic, // RGBX8888-
5401 blend_src_generic, // RGBA8888-
5402 blend_src_generic, // RGBA8888_Premultiplied-
5403 blend_src_generic_rgb64,-
5404 blend_src_generic_rgb64,-
5405 blend_src_generic_rgb64,-
5406 blend_src_generic_rgb64,-
5407 blend_src_generic,-
5408 blend_src_generic,-
5409 },-
5410 // TransformedTiled-
5411 {-
5412 0,-
5413 blend_src_generic, // Mono-
5414 blend_src_generic, // MonoLsb-
5415 blend_src_generic, // Indexed8-
5416 blend_src_generic, // RGB32-
5417 blend_src_generic, // ARGB32-
5418 blend_transformed_tiled_argb, // ARGB32_Premultiplied-
5419 blend_transformed_tiled_rgb565,-
5420 blend_src_generic, // ARGB8565_Premultiplied-
5421 blend_src_generic, // RGB666-
5422 blend_src_generic, // ARGB6666_Premultiplied-
5423 blend_src_generic, // RGB555-
5424 blend_src_generic, // ARGB8555_Premultiplied-
5425 blend_src_generic, // RGB888-
5426 blend_src_generic, // RGB444-
5427 blend_src_generic, // ARGB4444_Premultiplied-
5428 blend_src_generic, // RGBX8888-
5429 blend_src_generic, // RGBA8888-
5430 blend_src_generic, // RGBA8888_Premultiplied-
5431 blend_src_generic_rgb64,-
5432 blend_src_generic_rgb64,-
5433 blend_src_generic_rgb64,-
5434 blend_src_generic_rgb64,-
5435 blend_src_generic,-
5436 blend_src_generic,-
5437 },-
5438 // Bilinear-
5439 {-
5440 0,-
5441 blend_src_generic, // Mono-
5442 blend_src_generic, // MonoLsb-
5443 blend_src_generic, // Indexed8-
5444 blend_src_generic, // RGB32-
5445 blend_src_generic, // ARGB32-
5446 blend_src_generic, // ARGB32_Premultiplied-
5447 blend_transformed_bilinear_rgb565,-
5448 blend_src_generic, // ARGB8565_Premultiplied-
5449 blend_src_generic, // RGB666-
5450 blend_src_generic, // ARGB6666_Premultiplied-
5451 blend_src_generic, // RGB555-
5452 blend_src_generic, // ARGB8555_Premultiplied-
5453 blend_src_generic, // RGB888-
5454 blend_src_generic, // RGB444-
5455 blend_src_generic, // ARGB4444_Premultiplied-
5456 blend_src_generic, // RGBX8888-
5457 blend_src_generic, // RGBA8888-
5458 blend_src_generic, // RGBA8888_Premultiplied-
5459 blend_src_generic_rgb64,-
5460 blend_src_generic_rgb64,-
5461 blend_src_generic_rgb64,-
5462 blend_src_generic_rgb64,-
5463 blend_src_generic,-
5464 blend_src_generic,-
5465 },-
5466 // BilinearTiled-
5467 {-
5468 0,-
5469 blend_src_generic, // Mono-
5470 blend_src_generic, // MonoLsb-
5471 blend_src_generic, // Indexed8-
5472 blend_src_generic, // RGB32-
5473 blend_src_generic, // ARGB32-
5474 blend_src_generic, // ARGB32_Premultiplied-
5475 blend_src_generic, // RGB16-
5476 blend_src_generic, // ARGB8565_Premultiplied-
5477 blend_src_generic, // RGB666-
5478 blend_src_generic, // ARGB6666_Premultiplied-
5479 blend_src_generic, // RGB555-
5480 blend_src_generic, // ARGB8555_Premultiplied-
5481 blend_src_generic, // RGB888-
5482 blend_src_generic, // RGB444-
5483 blend_src_generic, // ARGB4444_Premultiplied-
5484 blend_src_generic, // RGBX8888-
5485 blend_src_generic, // RGBA8888-
5486 blend_src_generic, // RGBA8888_Premultiplied-
5487 blend_src_generic_rgb64, // BGR30-
5488 blend_src_generic_rgb64, // A2BGR30_Premultiplied-
5489 blend_src_generic_rgb64, // RGB30-
5490 blend_src_generic_rgb64, // A2RGB30_Premultiplied-
5491 blend_src_generic, // Alpha8-
5492 blend_src_generic, // Grayscale8-
5493 }-
5494};-
5495-
5496void qBlendTexture(int count, const QSpan *spans, void *userData)-
5497{-
5498 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
5499 ProcessSpans proc = processTextureSpans[getBlendType(data)][data->rasterBuffer->format];-
5500 proc(count, spans, userData);-
5501}
never executed: end of block
0
5502-
5503template <class DST> Q_STATIC_TEMPLATE_FUNCTION-
5504inline void qt_bitmapblit_template(QRasterBuffer *rasterBuffer,-
5505 int x, int y, DST color,-
5506 const uchar *map,-
5507 int mapWidth, int mapHeight, int mapStride)-
5508{-
5509 DST *dest = reinterpret_cast<DST *>(rasterBuffer->scanLine(y)) + x;-
5510 const int destStride = rasterBuffer->bytesPerLine() / sizeof(DST);-
5511-
5512 if (mapWidth > 8) {
mapWidth > 8Description
TRUEnever evaluated
FALSEnever evaluated
0
5513 while (mapHeight--) {
mapHeight--Description
TRUEnever evaluated
FALSEnever evaluated
0
5514 int x0 = 0;-
5515 int n = 0;-
5516 for (int x = 0; x < mapWidth; x += 8) {
x < mapWidthDescription
TRUEnever evaluated
FALSEnever evaluated
0
5517 uchar s = map[x >> 3];-
5518 for (int i = 0; i < 8; ++i) {
i < 8Description
TRUEnever evaluated
FALSEnever evaluated
0
5519 if (s & 0x80) {
s & 0x80Description
TRUEnever evaluated
FALSEnever evaluated
0
5520 ++n;-
5521 } else {
never executed: end of block
0
5522 if (n) {
nDescription
TRUEnever evaluated
FALSEnever evaluated
0
5523 qt_memfill(dest + x0, color, n);-
5524 x0 += n + 1;-
5525 n = 0;-
5526 } else {
never executed: end of block
0
5527 ++x0;-
5528 }
never executed: end of block
0
5529 if (!s) {
!sDescription
TRUEnever evaluated
FALSEnever evaluated
0
5530 x0 += 8 - 1 - i;-
5531 break;
never executed: break;
0
5532 }-
5533 }
never executed: end of block
0
5534 s <<= 1;-
5535 }
never executed: end of block
0
5536 }
never executed: end of block
0
5537 if (n)
nDescription
TRUEnever evaluated
FALSEnever evaluated
0
5538 qt_memfill(dest + x0, color, n);
never executed: qt_memfill(dest + x0, color, n);
0
5539 dest += destStride;-
5540 map += mapStride;-
5541 }
never executed: end of block
0
5542 } else {
never executed: end of block
0
5543 while (mapHeight--) {
mapHeight--Description
TRUEnever evaluated
FALSEnever evaluated
0
5544 int x0 = 0;-
5545 int n = 0;-
5546 for (uchar s = *map; s; s <<= 1) {
sDescription
TRUEnever evaluated
FALSEnever evaluated
0
5547 if (s & 0x80) {
s & 0x80Description
TRUEnever evaluated
FALSEnever evaluated
0
5548 ++n;-
5549 } else if (n) {
never executed: end of block
nDescription
TRUEnever evaluated
FALSEnever evaluated
0
5550 qt_memfill(dest + x0, color, n);-
5551 x0 += n + 1;-
5552 n = 0;-
5553 } else {
never executed: end of block
0
5554 ++x0;-
5555 }
never executed: end of block
0
5556 }-
5557 if (n)
nDescription
TRUEnever evaluated
FALSEnever evaluated
0
5558 qt_memfill(dest + x0, color, n);
never executed: qt_memfill(dest + x0, color, n);
0
5559 dest += destStride;-
5560 map += mapStride;-
5561 }
never executed: end of block
0
5562 }
never executed: end of block
0
5563}-
5564-
5565static void qt_gradient_argb32(int count, const QSpan *spans, void *userData)-
5566{-
5567 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
5568-
5569 bool isVerticalGradient =-
5570 data->txop <= QTransform::TxScale &&
data->txop <= ...sform::TxScaleDescription
TRUEnever evaluated
FALSEnever evaluated
0
5571 data->type == QSpanData::LinearGradient &&
data->type == ...LinearGradientDescription
TRUEnever evaluated
FALSEnever evaluated
0
5572 data->gradient.linear.end.x == data->gradient.linear.origin.x;
data->gradient...inear.origin.xDescription
TRUEnever evaluated
FALSEnever evaluated
0
5573-
5574 if (isVerticalGradient) {
isVerticalGradientDescription
TRUEnever evaluated
FALSEnever evaluated
0
5575 LinearGradientValues linear;-
5576 getLinearGradientValues(&linear, data);-
5577-
5578 CompositionFunctionSolid funcSolid =-
5579 functionForModeSolid[data->rasterBuffer->compositionMode];-
5580-
5581 /*-
5582 The logic for vertical gradient calculations is a mathematically-
5583 reduced copy of that in fetchLinearGradient() - which is basically:-
5584-
5585 qreal ry = data->m22 * (y + 0.5) + data->dy;-
5586 qreal t = linear.dy*ry + linear.off;-
5587 t *= (GRADIENT_STOPTABLE_SIZE - 1);-
5588 quint32 color =-
5589 qt_gradient_pixel_fixed(&data->gradient,-
5590 int(t * FIXPT_SIZE));-
5591-
5592 This has then been converted to fixed point to improve performance.-
5593 */-
5594 const int gss = GRADIENT_STOPTABLE_SIZE - 1;-
5595 int yinc = int((linear.dy * data->m22 * gss) * FIXPT_SIZE);-
5596 int off = int((((linear.dy * (data->m22 * qreal(0.5) + data->dy) + linear.off) * gss) * FIXPT_SIZE));-
5597-
5598 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
5599 int y = spans->y;-
5600 int x = spans->x;-
5601-
5602 quint32 *dst = (quint32 *)(data->rasterBuffer->scanLine(y)) + x;-
5603 quint32 color =-
5604 qt_gradient_pixel_fixed(&data->gradient, yinc * y + off);-
5605-
5606 funcSolid(dst, spans->len, color, spans->coverage);-
5607 ++spans;-
5608 }
never executed: end of block
0
5609-
5610 } else {
never executed: end of block
0
5611 blend_src_generic(count, spans, userData);-
5612 }
never executed: end of block
0
5613}-
5614-
5615static void qt_gradient_quint16(int count, const QSpan *spans, void *userData)-
5616{-
5617 QSpanData *data = reinterpret_cast<QSpanData *>(userData);-
5618-
5619 bool isVerticalGradient =-
5620 data->txop <= QTransform::TxScale &&
data->txop <= ...sform::TxScaleDescription
TRUEnever evaluated
FALSEnever evaluated
0
5621 data->type == QSpanData::LinearGradient &&
data->type == ...LinearGradientDescription
TRUEnever evaluated
FALSEnever evaluated
0
5622 data->gradient.linear.end.x == data->gradient.linear.origin.x;
data->gradient...inear.origin.xDescription
TRUEnever evaluated
FALSEnever evaluated
0
5623-
5624 if (isVerticalGradient) {
isVerticalGradientDescription
TRUEnever evaluated
FALSEnever evaluated
0
5625-
5626 LinearGradientValues linear;-
5627 getLinearGradientValues(&linear, data);-
5628-
5629 /*-
5630 The logic for vertical gradient calculations is a mathematically-
5631 reduced copy of that in fetchLinearGradient() - which is basically:-
5632-
5633 qreal ry = data->m22 * (y + 0.5) + data->dy;-
5634 qreal t = linear.dy*ry + linear.off;-
5635 t *= (GRADIENT_STOPTABLE_SIZE - 1);-
5636 quint32 color =-
5637 qt_gradient_pixel_fixed(&data->gradient,-
5638 int(t * FIXPT_SIZE));-
5639-
5640 This has then been converted to fixed point to improve performance.-
5641 */-
5642 const int gss = GRADIENT_STOPTABLE_SIZE - 1;-
5643 int yinc = int((linear.dy * data->m22 * gss) * FIXPT_SIZE);-
5644 int off = int((((linear.dy * (data->m22 * qreal(0.5) + data->dy) + linear.off) * gss) * FIXPT_SIZE));-
5645-
5646 // Save the fillData since we overwrite it when setting solid.color.-
5647 QGradientData gradient = data->gradient;-
5648 while (count--) {
count--Description
TRUEnever evaluated
FALSEnever evaluated
0
5649 int y = spans->y;-
5650-
5651 data->solid.color = QRgba64::fromArgb32(qt_gradient_pixel_fixed(&gradient, yinc * y + off));-
5652 blend_color_rgb16(1, spans, userData);-
5653 ++spans;-
5654 }
never executed: end of block
0
5655 data->gradient = gradient;-
5656-
5657 } else {
never executed: end of block
0
5658 blend_src_generic(count, spans, userData);-
5659 }
never executed: end of block
0
5660}-
5661-
5662inline static void qt_bitmapblit_argb32(QRasterBuffer *rasterBuffer,-
5663 int x, int y, const QRgba64 &color,-
5664 const uchar *map,-
5665 int mapWidth, int mapHeight, int mapStride)-
5666{-
5667 qt_bitmapblit_template<quint32>(rasterBuffer, x, y, color.toArgb32(),-
5668 map, mapWidth, mapHeight, mapStride);-
5669}
never executed: end of block
0
5670-
5671inline static void qt_bitmapblit_rgba8888(QRasterBuffer *rasterBuffer,-
5672 int x, int y, const QRgba64 &color,-
5673 const uchar *map,-
5674 int mapWidth, int mapHeight, int mapStride)-
5675{-
5676 qt_bitmapblit_template<quint32>(rasterBuffer, x, y, ARGB2RGBA(color.toArgb32()),-
5677 map, mapWidth, mapHeight, mapStride);-
5678}
never executed: end of block
0
5679-
5680template<QtPixelOrder PixelOrder>-
5681inline static void qt_bitmapblit_rgb30(QRasterBuffer *rasterBuffer,-
5682 int x, int y, const QRgba64 &color,-
5683 const uchar *map,-
5684 int mapWidth, int mapHeight, int mapStride)-
5685{-
5686 qt_bitmapblit_template<quint32>(rasterBuffer, x, y, qConvertRgb64ToRgb30<PixelOrder>(color),-
5687 map, mapWidth, mapHeight, mapStride);-
5688}
never executed: end of block
0
5689-
5690inline static void qt_bitmapblit_quint16(QRasterBuffer *rasterBuffer,-
5691 int x, int y, const QRgba64 &color,-
5692 const uchar *map,-
5693 int mapWidth, int mapHeight, int mapStride)-
5694{-
5695 qt_bitmapblit_template<quint16>(rasterBuffer, x, y, color.toRgb16(),-
5696 map, mapWidth, mapHeight, mapStride);-
5697}
never executed: end of block
0
5698-
5699static void qt_alphamapblit_quint16(QRasterBuffer *rasterBuffer,-
5700 int x, int y, const QRgba64 &color,-
5701 const uchar *map,-
5702 int mapWidth, int mapHeight, int mapStride,-
5703 const QClipData *)-
5704{-
5705 const quint16 c = color.toRgb16();-
5706 quint16 *dest = reinterpret_cast<quint16*>(rasterBuffer->scanLine(y)) + x;-
5707 const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint16);-
5708-
5709 while (mapHeight--) {
mapHeight--Description
TRUEnever evaluated
FALSEnever evaluated
0
5710 for (int i = 0; i < mapWidth; ++i) {
i < mapWidthDescription
TRUEnever evaluated
FALSEnever evaluated
0
5711 const int coverage = map[i];-
5712-
5713 if (coverage == 0) {
coverage == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5714 // nothing-
5715 } else if (coverage == 255) {
never executed: end of block
coverage == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
5716 dest[i] = c;-
5717 } else {
never executed: end of block
0
5718 int ialpha = 255 - coverage;-
5719 dest[i] = BYTE_MUL_RGB16(c, coverage)-
5720 + BYTE_MUL_RGB16(dest[i], ialpha);-
5721 }
never executed: end of block
0
5722 }-
5723 dest += destStride;-
5724 map += mapStride;-
5725 }
never executed: end of block
0
5726}
never executed: end of block
0
5727-
5728static inline void rgbBlendPixel(quint32 *dst, int coverage, int sr, int sg, int sb, const uchar *gamma, const uchar *invgamma)-
5729{-
5730 // Do a gray alphablend...-
5731 int da = qAlpha(*dst);-
5732 int dr = qRed(*dst);-
5733 int dg = qGreen(*dst);-
5734 int db = qBlue(*dst);-
5735-
5736 if (da != 255
da != 255Description
TRUEnever evaluated
FALSEnever evaluated
0
5737 ) {-
5738-
5739 int a = qGray(coverage);-
5740 sr = qt_div_255(invgamma[sr] * a);-
5741 sg = qt_div_255(invgamma[sg] * a);-
5742 sb = qt_div_255(invgamma[sb] * a);-
5743-
5744 int ia = 255 - a;-
5745 dr = qt_div_255(dr * ia);-
5746 dg = qt_div_255(dg * ia);-
5747 db = qt_div_255(db * ia);-
5748-
5749 *dst = ((a + qt_div_255((255 - a) * da)) << 24)-
5750 | ((sr + dr) << 16)-
5751 | ((sg + dg) << 8)-
5752 | ((sb + db));-
5753 return;
never executed: return;
0
5754 }-
5755-
5756 int mr = qRed(coverage);-
5757 int mg = qGreen(coverage);-
5758 int mb = qBlue(coverage);-
5759-
5760 dr = gamma[dr];-
5761 dg = gamma[dg];-
5762 db = gamma[db];-
5763-
5764 int nr = qt_div_255(sr * mr + dr * (255 - mr));-
5765 int ng = qt_div_255(sg * mg + dg * (255 - mg));-
5766 int nb = qt_div_255(sb * mb + db * (255 - mb));-
5767-
5768 nr = invgamma[nr];-
5769 ng = invgamma[ng];-
5770 nb = invgamma[nb];-
5771-
5772 *dst = qRgb(nr, ng, nb);-
5773}
never executed: end of block
0
5774-
5775#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)-
5776Q_GUI_EXPORT bool qt_needs_a8_gamma_correction = false;-
5777-
5778static inline void grayBlendPixel(quint32 *dst, int coverage, int sr, int sg, int sb, const uint *gamma, const uchar *invgamma)-
5779{-
5780 // Do a gammacorrected gray alphablend...-
5781 int dr = qRed(*dst);-
5782 int dg = qGreen(*dst);-
5783 int db = qBlue(*dst);-
5784-
5785 dr = gamma[dr];-
5786 dg = gamma[dg];-
5787 db = gamma[db];-
5788-
5789 int alpha = coverage;-
5790 int ialpha = 255 - alpha;-
5791 int nr = qt_div_255(sr * alpha + dr * ialpha);-
5792 int ng = qt_div_255(sg * alpha + dg * ialpha);-
5793 int nb = qt_div_255(sb * alpha + db * ialpha);-
5794-
5795 nr = invgamma[nr];-
5796 ng = invgamma[ng];-
5797 nb = invgamma[nb];-
5798-
5799 *dst = qRgb(nr, ng, nb);-
5800}-
5801#endif-
5802-
5803static void qt_alphamapblit_uint32(QRasterBuffer *rasterBuffer,-
5804 int x, int y, quint32 color,-
5805 const uchar *map,-
5806 int mapWidth, int mapHeight, int mapStride,-
5807 const QClipData *clip)-
5808{-
5809 const quint32 c = color;-
5810 const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint32);-
5811-
5812#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)-
5813 const QDrawHelperGammaTables *tables = QGuiApplicationPrivate::instance()->gammaTables();-
5814 if (!tables)-
5815 return;-
5816-
5817 const uint *gamma = tables->qt_pow_gamma;-
5818 const uchar *invgamma = tables->qt_pow_invgamma;-
5819-
5820 int sr = gamma[qRed(color)];-
5821 int sg = gamma[qGreen(color)];-
5822 int sb = gamma[qBlue(color)];-
5823-
5824 bool opaque_src = (qAlpha(color) == 255);-
5825 bool doGrayBlendPixel = opaque_src && qt_needs_a8_gamma_correction;-
5826#endif-
5827-
5828 if (!clip) {
!clipDescription
TRUEnever evaluated
FALSEnever evaluated
0
5829 quint32 *dest = reinterpret_cast<quint32*>(rasterBuffer->scanLine(y)) + x;-
5830 while (mapHeight--) {
mapHeight--Description
TRUEnever evaluated
FALSEnever evaluated
0
5831 for (int i = 0; i < mapWidth; ++i) {
i < mapWidthDescription
TRUEnever evaluated
FALSEnever evaluated
0
5832 const int coverage = map[i];-
5833-
5834 if (coverage == 0) {
coverage == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5835 // nothing-
5836 } else if (coverage == 255) {
never executed: end of block
coverage == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
5837 dest[i] = c;-
5838 } else {
never executed: end of block
0
5839#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)-
5840 if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && doGrayBlendPixel-
5841 && qAlpha(dest[i]) == 255) {-
5842 grayBlendPixel(dest+i, coverage, sr, sg, sb, gamma, invgamma);-
5843 } else-
5844#endif-
5845 {-
5846 int ialpha = 255 - coverage;-
5847 dest[i] = INTERPOLATE_PIXEL_255(c, coverage, dest[i], ialpha);-
5848 }-
5849 }
never executed: end of block
0
5850 }-
5851 dest += destStride;-
5852 map += mapStride;-
5853 }
never executed: end of block
0
5854 } else {
never executed: end of block
0
5855 int bottom = qMin(y + mapHeight, rasterBuffer->height());-
5856-
5857 int top = qMax(y, 0);-
5858 map += (top - y) * mapStride;-
5859-
5860 const_cast<QClipData *>(clip)->initialize();-
5861 for (int yp = top; yp<bottom; ++yp) {
yp<bottomDescription
TRUEnever evaluated
FALSEnever evaluated
0
5862 const QClipData::ClipLine &line = clip->m_clipLines[yp];-
5863-
5864 quint32 *dest = reinterpret_cast<quint32 *>(rasterBuffer->scanLine(yp));-
5865-
5866 for (int i=0; i<line.count; ++i) {
i<line.countDescription
TRUEnever evaluated
FALSEnever evaluated
0
5867 const QSpan &clip = line.spans[i];-
5868-
5869 int start = qMax<int>(x, clip.x);-
5870 int end = qMin<int>(x + mapWidth, clip.x + clip.len);-
5871-
5872 for (int xp=start; xp<end; ++xp) {
xp<endDescription
TRUEnever evaluated
FALSEnever evaluated
0
5873 const int coverage = map[xp - x];-
5874-
5875 if (coverage == 0) {
coverage == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5876 // nothing-
5877 } else if (coverage == 255) {
never executed: end of block
coverage == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
5878 dest[xp] = c;-
5879 } else {
never executed: end of block
0
5880#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)-
5881 if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && doGrayBlendPixel-
5882 && qAlpha(dest[xp]) == 255) {-
5883 grayBlendPixel(dest+xp, coverage, sr, sg, sb, gamma, invgamma);-
5884 } else-
5885#endif-
5886 {-
5887 int ialpha = 255 - coverage;-
5888 dest[xp] = INTERPOLATE_PIXEL_255(c, coverage, dest[xp], ialpha);-
5889 }-
5890 }
never executed: end of block
0
5891-
5892 } // for (i -> line.count)-
5893 } // for (yp -> bottom)
never executed: end of block
0
5894 map += mapStride;-
5895 }
never executed: end of block
0
5896 }
never executed: end of block
0
5897}-
5898-
5899-
5900static void qt_alphamapblit_argb32(QRasterBuffer *rasterBuffer,-
5901 int x, int y, const QRgba64 &color,-
5902 const uchar *map,-
5903 int mapWidth, int mapHeight, int mapStride,-
5904 const QClipData *clip)-
5905{-
5906 qt_alphamapblit_uint32(rasterBuffer, x, y, color.toArgb32(), map, mapWidth, mapHeight, mapStride, clip);-
5907}
never executed: end of block
0
5908-
5909#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN-
5910static void qt_alphamapblit_rgba8888(QRasterBuffer *rasterBuffer,-
5911 int x, int y, const QRgba64 &color,-
5912 const uchar *map,-
5913 int mapWidth, int mapHeight, int mapStride,-
5914 const QClipData *clip)-
5915{-
5916 qt_alphamapblit_uint32(rasterBuffer, x, y, ARGB2RGBA(color.toArgb32()), map, mapWidth, mapHeight, mapStride, clip);-
5917}
never executed: end of block
0
5918#endif-
5919-
5920static void qt_alphargbblit_argb32(QRasterBuffer *rasterBuffer,-
5921 int x, int y, const QRgba64 &color,-
5922 const uint *src, int mapWidth, int mapHeight, int srcStride,-
5923 const QClipData *clip)-
5924{-
5925 const quint32 c = color.toArgb32();-
5926-
5927 int sr = qRed(c);-
5928 int sg = qGreen(c);-
5929 int sb = qBlue(c);-
5930 int sa = qAlpha(c);-
5931-
5932 const QDrawHelperGammaTables *tables = QGuiApplicationPrivate::instance()->gammaTables();-
5933 if (!tables)
!tablesDescription
TRUEnever evaluated
FALSEnever evaluated
0
5934 return;
never executed: return;
0
5935-
5936 const uchar *gamma = tables->qt_pow_rgb_gamma;-
5937 const uchar *invgamma = tables->qt_pow_rgb_invgamma;-
5938-
5939 sr = gamma[sr];-
5940 sg = gamma[sg];-
5941 sb = gamma[sb];-
5942-
5943 if (sa == 0)
sa == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
5944 return;
never executed: return;
0
5945-
5946 if (!clip) {
!clipDescription
TRUEnever evaluated
FALSEnever evaluated
0
5947 quint32 *dst = reinterpret_cast<quint32*>(rasterBuffer->scanLine(y)) + x;-
5948 const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint32);-
5949 while (mapHeight--) {
mapHeight--Description
TRUEnever evaluated
FALSEnever evaluated
0
5950 for (int i = 0; i < mapWidth; ++i) {
i < mapWidthDescription
TRUEnever evaluated
FALSEnever evaluated
0
5951 const uint coverage = src[i];-
5952 if (coverage == 0xffffffff) {
coverage == 0xffffffffDescription
TRUEnever evaluated
FALSEnever evaluated
0
5953 dst[i] = c;-
5954 } else if (coverage != 0xff000000) {
never executed: end of block
coverage != 0xff000000Description
TRUEnever evaluated
FALSEnever evaluated
0
5955 rgbBlendPixel(dst+i, coverage, sr, sg, sb, gamma, invgamma);-
5956 }
never executed: end of block
0
5957 }
never executed: end of block
0
5958-
5959 dst += destStride;-
5960 src += srcStride;-
5961 }
never executed: end of block
0
5962 } else {
never executed: end of block
0
5963 int bottom = qMin(y + mapHeight, rasterBuffer->height());-
5964-
5965 int top = qMax(y, 0);-
5966 src += (top - y) * srcStride;-
5967-
5968 const_cast<QClipData *>(clip)->initialize();-
5969 for (int yp = top; yp<bottom; ++yp) {
yp<bottomDescription
TRUEnever evaluated
FALSEnever evaluated
0
5970 const QClipData::ClipLine &line = clip->m_clipLines[yp];-
5971-
5972 quint32 *dst = reinterpret_cast<quint32 *>(rasterBuffer->scanLine(yp));-
5973-
5974 for (int i=0; i<line.count; ++i) {
i<line.countDescription
TRUEnever evaluated
FALSEnever evaluated
0
5975 const QSpan &clip = line.spans[i];-
5976-
5977 int start = qMax<int>(x, clip.x);-
5978 int end = qMin<int>(x + mapWidth, clip.x + clip.len);-
5979-
5980 for (int xp=start; xp<end; ++xp) {
xp<endDescription
TRUEnever evaluated
FALSEnever evaluated
0
5981 const uint coverage = src[xp - x];-
5982 if (coverage == 0xffffffff) {
coverage == 0xffffffffDescription
TRUEnever evaluated
FALSEnever evaluated
0
5983 dst[xp] = c;-
5984 } else if (coverage != 0xff000000) {
never executed: end of block
coverage != 0xff000000Description
TRUEnever evaluated
FALSEnever evaluated
0
5985 rgbBlendPixel(dst+xp, coverage, sr, sg, sb, gamma, invgamma);-
5986 }
never executed: end of block
0
5987 }
never executed: end of block
0
5988 } // for (i -> line.count)
never executed: end of block
0
5989 src += srcStride;-
5990 } // for (yp -> bottom)
never executed: end of block
0
5991-
5992 }
never executed: end of block
0
5993}-
5994-
5995static void qt_rectfill_argb32(QRasterBuffer *rasterBuffer,-
5996 int x, int y, int width, int height,-
5997 const QRgba64 &color)-
5998{-
5999 qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()),-
6000 color.toArgb32(), x, y, width, height, rasterBuffer->bytesPerLine());-
6001}
never executed: end of block
0
6002-
6003static void qt_rectfill_quint16(QRasterBuffer *rasterBuffer,-
6004 int x, int y, int width, int height,-
6005 const QRgba64 &color)-
6006{-
6007 qt_rectfill<quint16>(reinterpret_cast<quint16 *>(rasterBuffer->buffer()),-
6008 color.toRgb16(), x, y, width, height, rasterBuffer->bytesPerLine());-
6009}
never executed: end of block
0
6010-
6011static void qt_rectfill_nonpremul_argb32(QRasterBuffer *rasterBuffer,-
6012 int x, int y, int width, int height,-
6013 const QRgba64 &color)-
6014{-
6015 qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()),-
6016 color.unpremultiplied().toArgb32(), x, y, width, height, rasterBuffer->bytesPerLine());-
6017}
never executed: end of block
0
6018-
6019static void qt_rectfill_rgba(QRasterBuffer *rasterBuffer,-
6020 int x, int y, int width, int height,-
6021 const QRgba64 &color)-
6022{-
6023 qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()),-
6024 ARGB2RGBA(color.toArgb32()), x, y, width, height, rasterBuffer->bytesPerLine());-
6025}
never executed: end of block
0
6026-
6027static void qt_rectfill_nonpremul_rgba(QRasterBuffer *rasterBuffer,-
6028 int x, int y, int width, int height,-
6029 const QRgba64 &color)-
6030{-
6031 qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()),-
6032 ARGB2RGBA(color.unpremultiplied().toArgb32()), x, y, width, height, rasterBuffer->bytesPerLine());-
6033}
never executed: end of block
0
6034-
6035template<QtPixelOrder PixelOrder>-
6036static void qt_rectfill_rgb30(QRasterBuffer *rasterBuffer,-
6037 int x, int y, int width, int height,-
6038 const QRgba64 &color)-
6039{-
6040 qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()),-
6041 qConvertRgb64ToRgb30<PixelOrder>(color), x, y, width, height, rasterBuffer->bytesPerLine());-
6042}
never executed: end of block
0
6043-
6044static void qt_rectfill_alpha(QRasterBuffer *rasterBuffer,-
6045 int x, int y, int width, int height,-
6046 const QRgba64 &color)-
6047{-
6048 qt_rectfill<quint8>(reinterpret_cast<quint8 *>(rasterBuffer->buffer()),-
6049 color.alpha() >> 8, x, y, width, height, rasterBuffer->bytesPerLine());-
6050}
never executed: end of block
0
6051-
6052static void qt_rectfill_gray(QRasterBuffer *rasterBuffer,-
6053 int x, int y, int width, int height,-
6054 const QRgba64 &color)-
6055{-
6056 qt_rectfill<quint8>(reinterpret_cast<quint8 *>(rasterBuffer->buffer()),-
6057 qGray(color.toArgb32()), x, y, width, height, rasterBuffer->bytesPerLine());-
6058}
never executed: end of block
0
6059-
6060// Map table for destination image format. Contains function pointers-
6061// for blends of various types unto the destination-
6062-
6063DrawHelper qDrawHelper[QImage::NImageFormats] =-
6064{-
6065 // Format_Invalid,-
6066 { 0, 0, 0, 0, 0, 0 },-
6067 // Format_Mono,-
6068 {-
6069 blend_color_generic,-
6070 blend_src_generic,-
6071 0, 0, 0, 0-
6072 },-
6073 // Format_MonoLSB,-
6074 {-
6075 blend_color_generic,-
6076 blend_src_generic,-
6077 0, 0, 0, 0-
6078 },-
6079 // Format_Indexed8,-
6080 {-
6081 blend_color_generic,-
6082 blend_src_generic,-
6083 0, 0, 0, 0-
6084 },-
6085 // Format_RGB32,-
6086 {-
6087 blend_color_argb,-
6088 qt_gradient_argb32,-
6089 qt_bitmapblit_argb32,-
6090 qt_alphamapblit_argb32,-
6091 qt_alphargbblit_argb32,-
6092 qt_rectfill_argb32-
6093 },-
6094 // Format_ARGB32,-
6095 {-
6096 blend_color_generic,-
6097 qt_gradient_argb32,-
6098 qt_bitmapblit_argb32,-
6099 qt_alphamapblit_argb32,-
6100 qt_alphargbblit_argb32,-
6101 qt_rectfill_nonpremul_argb32-
6102 },-
6103 // Format_ARGB32_Premultiplied-
6104 {-
6105 blend_color_argb,-
6106 qt_gradient_argb32,-
6107 qt_bitmapblit_argb32,-
6108 qt_alphamapblit_argb32,-
6109 qt_alphargbblit_argb32,-
6110 qt_rectfill_argb32-
6111 },-
6112 // Format_RGB16-
6113 {-
6114 blend_color_rgb16,-
6115 qt_gradient_quint16,-
6116 qt_bitmapblit_quint16,-
6117 qt_alphamapblit_quint16,-
6118 0,-
6119 qt_rectfill_quint16-
6120 },-
6121 // Format_ARGB8565_Premultiplied-
6122 {-
6123 blend_color_generic,-
6124 blend_src_generic,-
6125 0, 0, 0, 0-
6126 },-
6127 // Format_RGB666-
6128 {-
6129 blend_color_generic,-
6130 blend_src_generic,-
6131 0, 0, 0, 0-
6132 },-
6133 // Format_ARGB6666_Premultiplied-
6134 {-
6135 blend_color_generic,-
6136 blend_src_generic,-
6137 0, 0, 0, 0-
6138 },-
6139 // Format_RGB555-
6140 {-
6141 blend_color_generic,-
6142 blend_src_generic,-
6143 0, 0, 0, 0-
6144 },-
6145 // Format_ARGB8555_Premultiplied-
6146 {-
6147 blend_color_generic,-
6148 blend_src_generic,-
6149 0, 0, 0, 0-
6150 },-
6151 // Format_RGB888-
6152 {-
6153 blend_color_generic,-
6154 blend_src_generic,-
6155 0, 0, 0, 0-
6156 },-
6157 // Format_RGB444-
6158 {-
6159 blend_color_generic,-
6160 blend_src_generic,-
6161 0, 0, 0, 0-
6162 },-
6163 // Format_ARGB4444_Premultiplied-
6164 {-
6165 blend_color_generic,-
6166 blend_src_generic,-
6167 0, 0, 0, 0-
6168 },-
6169 // Format_RGBX8888-
6170 {-
6171 blend_color_generic,-
6172 blend_src_generic,-
6173 qt_bitmapblit_rgba8888,-
6174#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN-
6175 qt_alphamapblit_rgba8888,-
6176#else-
6177 0,-
6178#endif-
6179 0,-
6180 qt_rectfill_rgba-
6181 },-
6182 // Format_RGBA8888-
6183 {-
6184 blend_color_generic,-
6185 blend_src_generic,-
6186 qt_bitmapblit_rgba8888,-
6187#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN-
6188 qt_alphamapblit_rgba8888,-
6189#else-
6190 0,-
6191#endif-
6192 0,-
6193 qt_rectfill_nonpremul_rgba-
6194 },-
6195 // Format_RGB8888_Premultiplied-
6196 {-
6197 blend_color_generic,-
6198 blend_src_generic,-
6199 qt_bitmapblit_rgba8888,-
6200#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN-
6201 qt_alphamapblit_rgba8888,-
6202#else-
6203 0,-
6204#endif-
6205 0,-
6206 qt_rectfill_rgba-
6207 },-
6208 // Format_BGR30-
6209 {-
6210 blend_color_generic_rgb64,-
6211 blend_src_generic_rgb64,-
6212 qt_bitmapblit_rgb30<PixelOrderBGR>,-
6213 0,-
6214 0,-
6215 qt_rectfill_rgb30<PixelOrderBGR>-
6216 },-
6217 // Format_A2BGR30_Premultiplied-
6218 {-
6219 blend_color_generic_rgb64,-
6220 blend_src_generic_rgb64,-
6221 qt_bitmapblit_rgb30<PixelOrderBGR>,-
6222 0,-
6223 0,-
6224 qt_rectfill_rgb30<PixelOrderBGR>-
6225 },-
6226 // Format_RGB30-
6227 {-
6228 blend_color_generic_rgb64,-
6229 blend_src_generic_rgb64,-
6230 qt_bitmapblit_rgb30<PixelOrderRGB>,-
6231 0,-
6232 0,-
6233 qt_rectfill_rgb30<PixelOrderRGB>-
6234 },-
6235 // Format_A2RGB30_Premultiplied-
6236 {-
6237 blend_color_generic_rgb64,-
6238 blend_src_generic_rgb64,-
6239 qt_bitmapblit_rgb30<PixelOrderRGB>,-
6240 0,-
6241 0,-
6242 qt_rectfill_rgb30<PixelOrderRGB>-
6243 },-
6244 // Format_Alpha8-
6245 {-
6246 blend_color_generic,-
6247 blend_src_generic,-
6248 0, 0, 0,-
6249 qt_rectfill_alpha-
6250 },-
6251 // Format_Grayscale8-
6252 {-
6253 blend_color_generic,-
6254 blend_src_generic,-
6255 0, 0, 0,-
6256 qt_rectfill_gray-
6257 },-
6258};-
6259-
6260#if defined(Q_CC_MSVC) && !defined(_MIPS_)-
6261template <class T>-
6262inline void qt_memfill_template(T *dest, T color, int count)-
6263{-
6264 while (count--)-
6265 *dest++ = color;-
6266}-
6267-
6268#else-
6269-
6270template <class T>-
6271inline void qt_memfill_template(T *dest, T color, int count)-
6272{-
6273 int n = (count + 7) / 8;-
6274 switch (count & 0x07)-
6275 {-
6276 case 0: do { *dest++ = color;
never executed: case 0:
0
6277 case 7: *dest++ = color;
code before this statement never executed: case 7:
never executed: case 7:
0
6278 case 6: *dest++ = color;
code before this statement never executed: case 6:
never executed: case 6:
0
6279 case 5: *dest++ = color;
code before this statement never executed: case 5:
never executed: case 5:
0
6280 case 4: *dest++ = color;
code before this statement never executed: case 4:
never executed: case 4:
0
6281 case 3: *dest++ = color;
code before this statement never executed: case 3:
never executed: case 3:
0
6282 case 2: *dest++ = color;
code before this statement never executed: case 2:
never executed: case 2:
0
6283 case 1: *dest++ = color;
code before this statement never executed: case 1:
never executed: case 1:
0
6284 } while (--n > 0);
never executed: end of block
--n > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
6285 }
never executed: end of block
0
6286}
never executed: end of block
0
6287-
6288template <>-
6289inline void qt_memfill_template(quint16 *dest, quint16 value, int count)-
6290{-
6291 if (count < 3) {
count < 3Description
TRUEnever evaluated
FALSEnever evaluated
0
6292 switch (count) {-
6293 case 2: *dest++ = value;
never executed: case 2:
0
6294 case 1: *dest = value;
code before this statement never executed: case 1:
never executed: case 1:
0
6295 }
never executed: end of block
0
6296 return;
never executed: return;
0
6297 }-
6298-
6299 const int align = (quintptr)(dest) & 0x3;-
6300 switch (align) {-
6301 case 2: *dest++ = value; --count;
never executed: case 2:
0
6302 }
never executed: end of block
0
6303-
6304 const quint32 value32 = (value << 16) | value;-
6305 qt_memfill(reinterpret_cast<quint32*>(dest), value32, count / 2);-
6306 if (count & 0x1)
count & 0x1Description
TRUEnever evaluated
FALSEnever evaluated
0
6307 dest[count - 1] = value;
never executed: dest[count - 1] = value;
0
6308}
never executed: end of block
0
6309#endif-
6310-
6311void qt_memfill64(quint64 *dest, quint64 color, int count)-
6312{-
6313 qt_memfill_template<quint64>(dest, color, count);-
6314}
never executed: end of block
0
6315-
6316#if !defined(__SSE2__)-
6317void qt_memfill16(quint16 *dest, quint16 color, int count)-
6318{-
6319 qt_memfill_template<quint16>(dest, color, count);-
6320}-
6321#endif-
6322#if !defined(__SSE2__) && !defined(__ARM_NEON__)-
6323# ifdef QT_COMPILER_SUPPORTS_MIPS_DSP-
6324extern "C" void qt_memfill32_asm_mips_dsp(quint32 *, quint32, int);-
6325# endif-
6326-
6327void qt_memfill32(quint32 *dest, quint32 color, int count)-
6328{-
6329# ifdef QT_COMPILER_SUPPORTS_MIPS_DSP-
6330 qt_memfill32_asm_mips_dsp(dest, color, count);-
6331# else-
6332 qt_memfill_template<quint32>(dest, color, count);-
6333# endif-
6334}-
6335#endif-
6336-
6337#ifdef QT_COMPILER_SUPPORTS_SSE4_1-
6338template<QtPixelOrder> const uint *QT_FASTCALL convertA2RGB30PMFromARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *);-
6339#endif-
6340-
6341extern void qInitBlendFunctions();-
6342-
6343static void qInitDrawhelperFunctions()-
6344{-
6345 // Set up basic blend function tables.-
6346 qInitBlendFunctions();-
6347-
6348#ifdef __SSE2__-
6349 qDrawHelper[QImage::Format_RGB32].bitmapBlit = qt_bitmapblit32_sse2;-
6350 qDrawHelper[QImage::Format_ARGB32].bitmapBlit = qt_bitmapblit32_sse2;-
6351 qDrawHelper[QImage::Format_ARGB32_Premultiplied].bitmapBlit = qt_bitmapblit32_sse2;-
6352 qDrawHelper[QImage::Format_RGB16].bitmapBlit = qt_bitmapblit16_sse2;-
6353 qDrawHelper[QImage::Format_RGBX8888].bitmapBlit = qt_bitmapblit8888_sse2;-
6354 qDrawHelper[QImage::Format_RGBA8888].bitmapBlit = qt_bitmapblit8888_sse2;-
6355 qDrawHelper[QImage::Format_RGBA8888_Premultiplied].bitmapBlit = qt_bitmapblit8888_sse2;-
6356-
6357 extern void qt_scale_image_argb32_on_argb32_sse2(uchar *destPixels, int dbpl,-
6358 const uchar *srcPixels, int sbpl, int srch,-
6359 const QRectF &targetRect,-
6360 const QRectF &sourceRect,-
6361 const QRect &clip,-
6362 int const_alpha);-
6363 qScaleFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_argb32_sse2;-
6364 qScaleFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_argb32_sse2;-
6365 qScaleFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_scale_image_argb32_on_argb32_sse2;-
6366 qScaleFunctions[QImage::Format_RGBX8888][QImage::Format_RGBA8888_Premultiplied] = qt_scale_image_argb32_on_argb32_sse2;-
6367-
6368 extern void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,-
6369 const uchar *srcPixels, int sbpl,-
6370 int w, int h,-
6371 int const_alpha);-
6372 extern void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl,-
6373 const uchar *srcPixels, int sbpl,-
6374 int w, int h,-
6375 int const_alpha);-
6376-
6377 qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2;-
6378 qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2;-
6379 qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2;-
6380 qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2;-
6381 qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32_sse2;-
6382 qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32_sse2;-
6383 qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_sse2;-
6384 qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_sse2;-
6385-
6386 extern const uint * QT_FASTCALL qt_fetch_radial_gradient_sse2(uint *buffer, const Operator *op, const QSpanData *data,-
6387 int y, int x, int length);-
6388-
6389 qt_fetch_radial_gradient = qt_fetch_radial_gradient_sse2;-
6390-
6391#ifdef QT_COMPILER_SUPPORTS_SSSE3-
6392 if (qCpuHasFeature(SSSE3)) {
(qCompilerCpuF...FeatureSSSE3))Description
TRUEnever evaluated
FALSEnever evaluated
(qCpuFeatures(...FeatureSSSE3))Description
TRUEnever evaluated
FALSEnever evaluated
0
6393 extern void qt_blend_argb32_on_argb32_ssse3(uchar *destPixels, int dbpl,-
6394 const uchar *srcPixels, int sbpl,-
6395 int w, int h,-
6396 int const_alpha);-
6397-
6398 extern void QT_FASTCALL storePixelsBPP24_ssse3(uchar *dest, const uint *src, int index, int count);-
6399 extern const uint * QT_FASTCALL qt_fetchUntransformed_888_ssse3(uint *buffer, const Operator *, const QSpanData *data,-
6400 int y, int x, int length);-
6401 qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_ssse3;-
6402 qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_ssse3;-
6403 qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_ssse3;-
6404 qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_ssse3;-
6405 qStorePixels[QPixelLayout::BPP24] = storePixelsBPP24_ssse3;-
6406 sourceFetch[BlendUntransformed][QImage::Format_RGB888] = qt_fetchUntransformed_888_ssse3;-
6407 sourceFetch[BlendTiled][QImage::Format_RGB888] = qt_fetchUntransformed_888_ssse3;-
6408 }
never executed: end of block
0
6409#endif // SSSE3-
6410-
6411#if defined(QT_COMPILER_SUPPORTS_SSE4_1)-
6412 if (qCpuHasFeature(SSE4_1)) {
(qCompilerCpuF...eatureSSE4_1))Description
TRUEnever evaluated
FALSEnever evaluated
(qCpuFeatures(...eatureSSE4_1))Description
TRUEnever evaluated
FALSEnever evaluated
0
6413#if !defined(__SSE4_1__)-
6414 extern const uint *QT_FASTCALL convertARGB32ToARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *);-
6415 extern const uint *QT_FASTCALL convertRGBA8888ToARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *);-
6416 qPixelLayouts[QImage::Format_ARGB32].convertToARGB32PM = convertARGB32ToARGB32PM_sse4;-
6417 qPixelLayouts[QImage::Format_RGBA8888].convertToARGB32PM = convertRGBA8888ToARGB32PM_sse4;-
6418#endif-
6419 extern const uint *QT_FASTCALL convertARGB32FromARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *);-
6420 extern const uint *QT_FASTCALL convertRGBA8888FromARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *);-
6421 extern const uint *QT_FASTCALL convertRGBXFromARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *);-
6422 qPixelLayouts[QImage::Format_ARGB32].convertFromARGB32PM = convertARGB32FromARGB32PM_sse4;-
6423 qPixelLayouts[QImage::Format_RGBA8888].convertFromARGB32PM = convertRGBA8888FromARGB32PM_sse4;-
6424 qPixelLayouts[QImage::Format_RGBX8888].convertFromARGB32PM = convertRGBXFromARGB32PM_sse4;-
6425 qPixelLayouts[QImage::Format_A2BGR30_Premultiplied].convertFromARGB32PM = convertA2RGB30PMFromARGB32PM_sse4<PixelOrderBGR>;-
6426 qPixelLayouts[QImage::Format_A2RGB30_Premultiplied].convertFromARGB32PM = convertA2RGB30PMFromARGB32PM_sse4<PixelOrderRGB>;-
6427 }
never executed: end of block
0
6428#endif-
6429-
6430#if defined(QT_COMPILER_SUPPORTS_AVX2) && !defined(__AVX2__)-
6431 if (qCpuHasFeature(AVX2)) {
(qCompilerCpuF...uFeatureAVX2))Description
TRUEnever evaluated
FALSEnever evaluated
(qCpuFeatures(...uFeatureAVX2))Description
TRUEnever evaluated
FALSEnever evaluated
0
6432 extern const uint *QT_FASTCALL convertARGB32ToARGB32PM_avx2(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *);-
6433 extern const uint *QT_FASTCALL convertRGBA8888ToARGB32PM_avx2(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *);-
6434 qPixelLayouts[QImage::Format_ARGB32].convertToARGB32PM = convertARGB32ToARGB32PM_avx2;-
6435 qPixelLayouts[QImage::Format_RGBA8888].convertToARGB32PM = convertRGBA8888ToARGB32PM_avx2;-
6436 }
never executed: end of block
0
6437#endif-
6438 extern void QT_FASTCALL comp_func_SourceOver_sse2(uint *destPixels, const uint *srcPixels, int length, uint const_alpha);-
6439 extern void QT_FASTCALL comp_func_solid_SourceOver_sse2(uint *destPixels, int length, uint color, uint const_alpha);-
6440 extern void QT_FASTCALL comp_func_Source_sse2(uint *destPixels, const uint *srcPixels, int length, uint const_alpha);-
6441 extern void QT_FASTCALL comp_func_Plus_sse2(uint *destPixels, const uint *srcPixels, int length, uint const_alpha);-
6442 qt_functionForMode_C[QPainter::CompositionMode_SourceOver] = comp_func_SourceOver_sse2;-
6443 qt_functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_sse2;-
6444 qt_functionForMode_C[QPainter::CompositionMode_Source] = comp_func_Source_sse2;-
6445 qt_functionForMode_C[QPainter::CompositionMode_Plus] = comp_func_Plus_sse2;-
6446-
6447#endif // SSE2-
6448-
6449#if defined(__ARM_NEON__)-
6450 qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;-
6451 qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;-
6452 qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon;-
6453 qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon;-
6454#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN-
6455 qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32_neon;-
6456 qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32_neon;-
6457 qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_neon;-
6458 qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_neon;-
6459#endif-
6460-
6461 qt_functionForMode_C[QPainter::CompositionMode_SourceOver] = qt_blend_argb32_on_argb32_scanline_neon;-
6462 qt_functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_neon;-
6463 qt_functionForMode_C[QPainter::CompositionMode_Plus] = comp_func_Plus_neon;-
6464-
6465 extern const uint * QT_FASTCALL qt_fetch_radial_gradient_neon(uint *buffer, const Operator *op, const QSpanData *data,-
6466 int y, int x, int length);-
6467-
6468 qt_fetch_radial_gradient = qt_fetch_radial_gradient_neon;-
6469-
6470 sourceFetch[BlendUntransformed][QImage::Format_RGB888] = qt_fetchUntransformed_888_neon;-
6471 sourceFetch[BlendTiled][QImage::Format_RGB888] = qt_fetchUntransformed_888_neon;-
6472-
6473#if defined(ENABLE_PIXMAN_DRAWHELPERS)-
6474 // The RGB16 helpers are using Arm32 assemblythat has not been ported to AArch64-
6475 qBlendFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_rgb16_neon;-
6476 qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB16] = qt_blend_rgb16_on_argb32_neon;-
6477 qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_blend_rgb16_on_rgb16_neon;-
6478-
6479 qScaleFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_rgb16_neon;-
6480 qScaleFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_scale_image_rgb16_on_rgb16_neon;-
6481-
6482 qTransformFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_transform_image_argb32_on_rgb16_neon;-
6483 qTransformFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_transform_image_rgb16_on_rgb16_neon;-
6484-
6485 qDrawHelper[QImage::Format_RGB16].alphamapBlit = qt_alphamapblit_quint16_neon;-
6486-
6487 destFetchProc[QImage::Format_RGB16] = qt_destFetchRGB16_neon;-
6488 destStoreProc[QImage::Format_RGB16] = qt_destStoreRGB16_neon;-
6489-
6490 qMemRotateFunctions[QImage::Format_RGB16][0] = qt_memrotate90_16_neon;-
6491 qMemRotateFunctions[QImage::Format_RGB16][2] = qt_memrotate270_16_neon;-
6492#endif-
6493-
6494#endif-
6495-
6496#if defined(Q_PROCESSOR_MIPS_32) && defined(QT_COMPILER_SUPPORTS_MIPS_DSP)-
6497 qt_memfill32 = qt_memfill32_asm_mips_dsp;-
6498#endif // Q_PROCESSOR_MIPS_32-
6499-
6500#if defined(QT_COMPILER_SUPPORTS_MIPS_DSP) || defined(QT_COMPILER_SUPPORTS_MIPS_DSPR2)-
6501 if (qCpuHasFeature(DSP) && qCpuHasFeature(DSPR2)) {-
6502 // Composition functions are all DSP r1-
6503 qt_functionForMode_C[QPainter::CompositionMode_SourceOver] = comp_func_SourceOver_asm_mips_dsp;-
6504 qt_functionForMode_C[QPainter::CompositionMode_Source] = comp_func_Source_mips_dsp;-
6505 qt_functionForMode_C[QPainter::CompositionMode_DestinationOver] = comp_func_DestinationOver_mips_dsp;-
6506 qt_functionForMode_C[QPainter::CompositionMode_SourceIn] = comp_func_SourceIn_mips_dsp;-
6507 qt_functionForMode_C[QPainter::CompositionMode_DestinationIn] = comp_func_DestinationIn_mips_dsp;-
6508 qt_functionForMode_C[QPainter::CompositionMode_DestinationOut] = comp_func_DestinationOut_mips_dsp;-
6509 qt_functionForMode_C[QPainter::CompositionMode_SourceAtop] = comp_func_SourceAtop_mips_dsp;-
6510 qt_functionForMode_C[QPainter::CompositionMode_DestinationAtop] = comp_func_DestinationAtop_mips_dsp;-
6511 qt_functionForMode_C[QPainter::CompositionMode_Xor] = comp_func_XOR_mips_dsp;-
6512 qt_functionForMode_C[QPainter::CompositionMode_SourceOut] = comp_func_SourceOut_mips_dsp;-
6513-
6514 qt_functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_mips_dsp;-
6515 qt_functionForModeSolid_C[QPainter::CompositionMode_DestinationOver] = comp_func_solid_DestinationOver_mips_dsp;-
6516 qt_functionForModeSolid_C[QPainter::CompositionMode_SourceIn] = comp_func_solid_SourceIn_mips_dsp;-
6517 qt_functionForModeSolid_C[QPainter::CompositionMode_DestinationIn] = comp_func_solid_DestinationIn_mips_dsp;-
6518 qt_functionForModeSolid_C[QPainter::CompositionMode_SourceAtop] = comp_func_solid_SourceAtop_mips_dsp;-
6519 qt_functionForModeSolid_C[QPainter::CompositionMode_DestinationAtop] = comp_func_solid_DestinationAtop_mips_dsp;-
6520 qt_functionForModeSolid_C[QPainter::CompositionMode_Xor] = comp_func_solid_XOR_mips_dsp;-
6521 qt_functionForModeSolid_C[QPainter::CompositionMode_SourceOut] = comp_func_solid_SourceOut_mips_dsp;-
6522-
6523 qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_mips_dsp;-
6524 qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_mips_dsp;-
6525 qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_mips_dsp;-
6526 qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_mips_dsp;-
6527-
6528 destFetchProc[QImage::Format_ARGB32] = qt_destFetchARGB32_mips_dsp;-
6529-
6530 destStoreProc[QImage::Format_ARGB32] = qt_destStoreARGB32_mips_dsp;-
6531-
6532 sourceFetch[BlendUntransformed][QImage::Format_RGB888] = qt_fetchUntransformed_888_mips_dsp;-
6533 sourceFetch[BlendTiled][QImage::Format_RGB888] = qt_fetchUntransformed_888_mips_dsp;-
6534-
6535 sourceFetch[BlendUntransformed][QImage::Format_RGB444] = qt_fetchUntransformed_444_mips_dsp;-
6536 sourceFetch[BlendTiled][QImage::Format_RGB444] = qt_fetchUntransformed_444_mips_dsp;-
6537-
6538 sourceFetch[BlendUntransformed][QImage::Format_ARGB8565_Premultiplied] = qt_fetchUntransformed_argb8565_premultiplied_mips_dsp;-
6539 sourceFetch[BlendTiled][QImage::Format_ARGB8565_Premultiplied] = qt_fetchUntransformed_argb8565_premultiplied_mips_dsp;-
6540-
6541#if defined(QT_COMPILER_SUPPORTS_MIPS_DSPR2)-
6542 qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_blend_rgb16_on_rgb16_mips_dspr2;-
6543#else-
6544 qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_blend_rgb16_on_rgb16_mips_dsp;-
6545#endif // QT_COMPILER_SUPPORTS_MIPS_DSPR2-
6546 }-
6547#endif // QT_COMPILER_SUPPORTS_MIPS_DSP || QT_COMPILER_SUPPORTS_MIPS_DSPR2-
6548}
never executed: end of block
0
6549-
6550// Ensure initialization if this object file is linked.-
6551Q_CONSTRUCTOR_FUNCTION(qInitDrawhelperFunctions);
never executed: end of block
0
6552-
6553QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9