/src/qt/qtbase/src/gui/painting/qdrawhelper_p.h
Line | Count | Source |
1 | | // Copyright (C) 2016 The Qt Company Ltd. |
2 | | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | | |
4 | | #ifndef QDRAWHELPER_P_H |
5 | | #define QDRAWHELPER_P_H |
6 | | |
7 | | // |
8 | | // W A R N I N G |
9 | | // ------------- |
10 | | // |
11 | | // This file is not part of the Qt API. It exists purely as an |
12 | | // implementation detail. This header file may change from version to |
13 | | // version without notice, or even be removed. |
14 | | // |
15 | | // We mean it. |
16 | | // |
17 | | |
18 | | #include <QtGui/private/qtguiglobal_p.h> |
19 | | #include "QtCore/qmath.h" |
20 | | #include "QtGui/qcolor.h" |
21 | | #include "QtGui/qpainter.h" |
22 | | #include "QtGui/qimage.h" |
23 | | #include "QtGui/qrgba64.h" |
24 | | #ifndef QT_FT_BEGIN_HEADER |
25 | | #define QT_FT_BEGIN_HEADER |
26 | | #define QT_FT_END_HEADER |
27 | | #endif |
28 | | #include "private/qpixellayout_p.h" |
29 | | #include "private/qrasterdefs_p.h" |
30 | | #include <private/qsimd_p.h> |
31 | | |
32 | | #include <memory> |
33 | | #include <variant> // std::monostate |
34 | | |
35 | | QT_BEGIN_NAMESPACE |
36 | | |
37 | | #if defined(Q_CC_GNU) |
38 | | # define Q_DECL_RESTRICT __restrict__ |
39 | | # if defined(Q_PROCESSOR_X86_32) && defined(Q_CC_GNU) && !defined(Q_CC_CLANG) |
40 | | # define Q_DECL_VECTORCALL __attribute__((sseregparm,regparm(3))) |
41 | | # else |
42 | | # define Q_DECL_VECTORCALL |
43 | | # endif |
44 | | #elif defined(Q_CC_MSVC) |
45 | | # define Q_DECL_RESTRICT __restrict |
46 | | # define Q_DECL_VECTORCALL __vectorcall |
47 | | #else |
48 | | # define Q_DECL_RESTRICT |
49 | | # define Q_DECL_VECTORCALL |
50 | | #endif |
51 | | |
52 | | static const uint AMASK = 0xff000000; |
53 | | static const uint RMASK = 0x00ff0000; |
54 | | static const uint GMASK = 0x0000ff00; |
55 | | static const uint BMASK = 0x000000ff; |
56 | | |
57 | | struct QSolidData; |
58 | | struct QTextureData; |
59 | | struct QGradientData; |
60 | | struct QLinearGradientData; |
61 | | struct QRadialGradientData; |
62 | | struct QConicalGradientData; |
63 | | struct QSpanData; |
64 | | class QGradient; |
65 | | class QRasterBuffer; |
66 | | class QClipData; |
67 | | class QRasterPaintEngineState; |
68 | | |
69 | | template<typename F> class QRgbaFloat; |
70 | | typedef QRgbaFloat<float> QRgbaFloat32; |
71 | | |
72 | | typedef QT_FT_SpanFunc ProcessSpans; |
73 | | typedef void (*BitmapBlitFunc)(QRasterBuffer *rasterBuffer, |
74 | | int x, int y, const QRgba64 &color, |
75 | | const uchar *bitmap, |
76 | | int mapWidth, int mapHeight, int mapStride); |
77 | | |
78 | | typedef void (*AlphamapBlitFunc)(QRasterBuffer *rasterBuffer, |
79 | | int x, int y, const QRgba64 &color, |
80 | | const uchar *bitmap, |
81 | | int mapWidth, int mapHeight, int mapStride, |
82 | | const QClipData *clip, bool useGammaCorrection); |
83 | | |
84 | | typedef void (*AlphaRGBBlitFunc)(QRasterBuffer *rasterBuffer, |
85 | | int x, int y, const QRgba64 &color, |
86 | | const uint *rgbmask, |
87 | | int mapWidth, int mapHeight, int mapStride, |
88 | | const QClipData *clip, bool useGammaCorrection); |
89 | | |
90 | | typedef void (*RectFillFunc)(QRasterBuffer *rasterBuffer, |
91 | | int x, int y, int width, int height, |
92 | | const QRgba64 &color); |
93 | | |
94 | | typedef void (*SrcOverBlendFunc)(uchar *destPixels, int dbpl, |
95 | | const uchar *src, int spbl, |
96 | | int w, int h, |
97 | | int const_alpha); |
98 | | |
99 | | typedef void (*SrcOverScaleFunc)(uchar *destPixels, int dbpl, |
100 | | const uchar *src, int spbl, int srch, |
101 | | const QRectF &targetRect, |
102 | | const QRectF &sourceRect, |
103 | | const QRect &clipRect, |
104 | | int const_alpha); |
105 | | |
106 | | typedef void (*SrcOverTransformFunc)(uchar *destPixels, int dbpl, |
107 | | const uchar *src, int spbl, |
108 | | const QRectF &targetRect, |
109 | | const QRectF &sourceRect, |
110 | | const QRect &clipRect, |
111 | | const QTransform &targetRectTransform, |
112 | | int const_alpha); |
113 | | |
114 | | struct DrawHelper { |
115 | | ProcessSpans blendColor; |
116 | | BitmapBlitFunc bitmapBlit; |
117 | | AlphamapBlitFunc alphamapBlit; |
118 | | AlphaRGBBlitFunc alphaRGBBlit; |
119 | | RectFillFunc fillRect; |
120 | | }; |
121 | | |
122 | | extern SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats]; |
123 | | extern SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats]; |
124 | | extern SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFormats]; |
125 | | |
126 | | extern DrawHelper qDrawHelper[QImage::NImageFormats]; |
127 | | |
128 | | struct quint24 { |
129 | | quint24() = default; |
130 | | quint24(uint value) |
131 | 0 | { |
132 | 0 | data[0] = uchar(value >> 16); |
133 | 0 | data[1] = uchar(value >> 8); |
134 | 0 | data[2] = uchar(value); |
135 | 0 | } |
136 | | operator uint() const |
137 | 0 | { |
138 | 0 | return data[2] | (data[1] << 8) | (data[0] << 16); |
139 | 0 | } |
140 | | |
141 | | uchar data[3]; |
142 | | }; |
143 | | |
144 | | void qBlendGradient(int count, const QT_FT_Span *spans, void *userData); |
145 | | void qBlendTexture(int count, const QT_FT_Span *spans, void *userData); |
146 | | #if defined(Q_PROCESSOR_X86) || defined(QT_COMPILER_SUPPORTS_LSX) |
147 | | extern void (*qt_memfill64)(quint64 *dest, quint64 value, qsizetype count); |
148 | | extern void (*qt_memfill32)(quint32 *dest, quint32 value, qsizetype count); |
149 | | #else |
150 | | extern void qt_memfill64(quint64 *dest, quint64 value, qsizetype count); |
151 | | extern void qt_memfill32(quint32 *dest, quint32 value, qsizetype count); |
152 | | #endif |
153 | | extern void qt_memfill24(quint24 *dest, quint24 value, qsizetype count); |
154 | | extern void qt_memfill16(quint16 *dest, quint16 value, qsizetype count); |
155 | | |
156 | | typedef void (QT_FASTCALL *CompositionFunction)(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha); |
157 | | typedef void (QT_FASTCALL *CompositionFunction64)(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha); |
158 | | typedef void (QT_FASTCALL *CompositionFunctionFP)(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha); |
159 | | typedef void (QT_FASTCALL *CompositionFunctionSolid)(uint *dest, int length, uint color, uint const_alpha); |
160 | | typedef void (QT_FASTCALL *CompositionFunctionSolid64)(QRgba64 *dest, int length, QRgba64 color, uint const_alpha); |
161 | | typedef void (QT_FASTCALL *CompositionFunctionSolidFP)(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha); |
162 | | |
163 | | struct LinearGradientValues |
164 | | { |
165 | | qreal dx; |
166 | | qreal dy; |
167 | | qreal l; |
168 | | qreal off; |
169 | | }; |
170 | | |
171 | | struct RadialGradientValues |
172 | | { |
173 | | qreal dx; |
174 | | qreal dy; |
175 | | qreal dr; |
176 | | qreal sqrfr; |
177 | | qreal a; |
178 | | bool extended; |
179 | | }; |
180 | | |
181 | | struct Operator; |
182 | | typedef uint* (QT_FASTCALL *DestFetchProc)(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length); |
183 | | typedef QRgba64* (QT_FASTCALL *DestFetchProc64)(QRgba64 *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length); |
184 | | typedef QRgbaFloat32* (QT_FASTCALL *DestFetchProcFP)(QRgbaFloat32 *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length); |
185 | | typedef void (QT_FASTCALL *DestStoreProc)(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length); |
186 | | typedef void (QT_FASTCALL *DestStoreProc64)(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length); |
187 | | typedef void (QT_FASTCALL *DestStoreProcFP)(QRasterBuffer *rasterBuffer, int x, int y, const QRgbaFloat32 *buffer, int length); |
188 | | typedef const uint* (QT_FASTCALL *SourceFetchProc)(uint *buffer, const Operator *o, const QSpanData *data, int y, int x, int length); |
189 | | typedef const QRgba64* (QT_FASTCALL *SourceFetchProc64)(QRgba64 *buffer, const Operator *o, const QSpanData *data, int y, int x, int length); |
190 | | typedef const QRgbaFloat32* (QT_FASTCALL *SourceFetchProcFP)(QRgbaFloat32 *buffer, const Operator *o, const QSpanData *data, int y, int x, int length); |
191 | | |
192 | | struct Operator |
193 | | { |
194 | | QPainter::CompositionMode mode; |
195 | | DestFetchProc destFetch; |
196 | | DestStoreProc destStore; |
197 | | SourceFetchProc srcFetch; |
198 | | CompositionFunctionSolid funcSolid; |
199 | | CompositionFunction func; |
200 | | |
201 | | DestFetchProc64 destFetch64; |
202 | | DestStoreProc64 destStore64; |
203 | | SourceFetchProc64 srcFetch64; |
204 | | CompositionFunctionSolid64 funcSolid64; |
205 | | CompositionFunction64 func64; |
206 | | |
207 | | DestFetchProcFP destFetchFP; |
208 | | DestStoreProcFP destStoreFP; |
209 | | SourceFetchProcFP srcFetchFP; |
210 | | CompositionFunctionSolidFP funcSolidFP; |
211 | | CompositionFunctionFP funcFP; |
212 | | |
213 | | union { |
214 | | std::monostate noGradient; |
215 | | LinearGradientValues linear; |
216 | | RadialGradientValues radial; |
217 | | }; |
218 | | }; |
219 | | |
220 | | class QRasterPaintEngine; |
221 | | |
222 | | struct QLinearGradientData |
223 | | { |
224 | | struct { |
225 | | qreal x; |
226 | | qreal y; |
227 | | } origin; |
228 | | struct { |
229 | | qreal x; |
230 | | qreal y; |
231 | | } end; |
232 | | }; |
233 | | |
234 | | struct QRadialGradientData |
235 | | { |
236 | | struct { |
237 | | qreal x; |
238 | | qreal y; |
239 | | qreal radius; |
240 | | } center; |
241 | | struct { |
242 | | qreal x; |
243 | | qreal y; |
244 | | qreal radius; |
245 | | } focal; |
246 | | }; |
247 | | |
248 | | struct QConicalGradientData |
249 | | { |
250 | | struct { |
251 | | qreal x; |
252 | | qreal y; |
253 | | } center; |
254 | | qreal angle; |
255 | | }; |
256 | | |
257 | | struct QGradientData |
258 | | { |
259 | | QGradient::Spread spread; |
260 | | |
261 | | union { |
262 | | QLinearGradientData linear; |
263 | | QRadialGradientData radial; |
264 | | QConicalGradientData conical; |
265 | | }; |
266 | | |
267 | 173M | #define GRADIENT_STOPTABLE_SIZE 1024 |
268 | 38.1M | #define GRADIENT_STOPTABLE_SIZE_SHIFT 10 |
269 | | |
270 | | #if QT_CONFIG(raster_64bit) || QT_CONFIG(raster_fp) |
271 | | const QRgba64 *colorTable64; //[GRADIENT_STOPTABLE_SIZE]; |
272 | | #endif |
273 | | const QRgb *colorTable32; //[GRADIENT_STOPTABLE_SIZE]; |
274 | | |
275 | | uint alphaColor : 1; |
276 | | }; |
277 | | |
278 | | struct QTextureData |
279 | | { |
280 | | const uchar *imageData; |
281 | 155M | const uchar *scanLine(int y) const { return imageData + y*bytesPerLine; } |
282 | | |
283 | | int width; |
284 | | int height; |
285 | | // clip rect |
286 | | int x1; |
287 | | int y1; |
288 | | int x2; |
289 | | int y2; |
290 | | qsizetype bytesPerLine; |
291 | | QImage::Format format; |
292 | | const QList<QRgb> *colorTable; |
293 | | bool hasAlpha; |
294 | | enum Type { |
295 | | Plain, |
296 | | Tiled, |
297 | | Pattern |
298 | | }; |
299 | | Type type; |
300 | | int const_alpha; |
301 | | }; |
302 | | |
303 | | struct QSpanData |
304 | | { |
305 | 778k | QSpanData() : tempImage(nullptr) {} |
306 | 922k | ~QSpanData() { delete tempImage; } |
307 | | |
308 | | QRasterBuffer *rasterBuffer; |
309 | | ProcessSpans blend; |
310 | | ProcessSpans unclipped_blend; |
311 | | BitmapBlitFunc bitmapBlit; |
312 | | AlphamapBlitFunc alphamapBlit; |
313 | | AlphaRGBBlitFunc alphaRGBBlit; |
314 | | RectFillFunc fillRect; |
315 | | qreal m11, m12, m13, m21, m22, m23, m33, dx, dy; // inverse xform matrix |
316 | | const QClipData *clip; |
317 | | enum Type { |
318 | | None, |
319 | | Solid, |
320 | | LinearGradient, |
321 | | RadialGradient, |
322 | | ConicalGradient, |
323 | | Texture |
324 | | } type : 8; |
325 | | signed int txop : 8; |
326 | | uint fast_matrix : 1; |
327 | | bool bilinear; |
328 | | QImage *tempImage; |
329 | | QColor solidColor; |
330 | | union { |
331 | | QGradientData gradient; |
332 | | QTextureData texture; |
333 | | }; |
334 | | std::shared_ptr<const void> cachedGradient; |
335 | | |
336 | | |
337 | | void init(QRasterBuffer *rb, const QRasterPaintEngine *pe); |
338 | | void setup(const QBrush &brush, int alpha, QPainter::CompositionMode compositionMode, bool isCosmetic); |
339 | | void setupMatrix(const QTransform &matrix, int bilinear); |
340 | | void initTexture(const QImage *image, int alpha, QTextureData::Type = QTextureData::Plain, const QRect &sourceRect = QRect()); |
341 | | void adjustSpanMethods(); |
342 | | }; |
343 | | |
344 | | static inline uint qt_gradient_clamp(const QGradientData *data, int ipos) |
345 | 48.9M | { |
346 | 48.9M | if (ipos < 0 || ipos >= GRADIENT_STOPTABLE_SIZE) { |
347 | 31.5M | if (data->spread == QGradient::RepeatSpread) { |
348 | 0 | ipos = ipos % GRADIENT_STOPTABLE_SIZE; |
349 | 0 | ipos = ipos < 0 ? GRADIENT_STOPTABLE_SIZE + ipos : ipos; |
350 | 31.5M | } else if (data->spread == QGradient::ReflectSpread) { |
351 | 0 | const int limit = GRADIENT_STOPTABLE_SIZE * 2; |
352 | 0 | ipos = ipos % limit; |
353 | 0 | ipos = ipos < 0 ? limit + ipos : ipos; |
354 | 0 | ipos = ipos >= GRADIENT_STOPTABLE_SIZE ? limit - 1 - ipos : ipos; |
355 | 31.5M | } else { |
356 | 31.5M | if (ipos < 0) |
357 | 2.84M | ipos = 0; |
358 | 28.6M | else if (ipos >= GRADIENT_STOPTABLE_SIZE) |
359 | 28.8M | ipos = GRADIENT_STOPTABLE_SIZE-1; |
360 | 31.5M | } |
361 | 31.5M | } |
362 | | |
363 | 48.9M | Q_ASSERT(ipos >= 0); |
364 | 48.9M | Q_ASSERT(ipos < GRADIENT_STOPTABLE_SIZE); |
365 | | |
366 | 48.9M | return ipos; |
367 | 48.9M | } Unexecuted instantiation: qcolor.cpp:qt_gradient_clamp(QGradientData const*, int) Unexecuted instantiation: qimage.cpp:qt_gradient_clamp(QGradientData const*, int) Unexecuted instantiation: qimage_conversions.cpp:qt_gradient_clamp(QGradientData const*, int) Unexecuted instantiation: qimagescale.cpp:qt_gradient_clamp(QGradientData const*, int) Unexecuted instantiation: qmemrotate.cpp:qt_gradient_clamp(QGradientData const*, int) Unexecuted instantiation: qpaintengine_raster.cpp:qt_gradient_clamp(QGradientData const*, int) Unexecuted instantiation: qpainter.cpp:qt_gradient_clamp(QGradientData const*, int) Unexecuted instantiation: qpixellayout.cpp:qt_gradient_clamp(QGradientData const*, int) Unexecuted instantiation: qrasterizer.cpp:qt_gradient_clamp(QGradientData const*, int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:qt_gradient_clamp(QGradientData const*, int) Unexecuted instantiation: qdrawhelper_sse4.cpp:qt_gradient_clamp(QGradientData const*, int) Unexecuted instantiation: qimagescale_sse4.cpp:qt_gradient_clamp(QGradientData const*, int) qdrawhelper.cpp:qt_gradient_clamp(QGradientData const*, int) Line | Count | Source | 345 | 48.9M | { | 346 | 48.9M | if (ipos < 0 || ipos >= GRADIENT_STOPTABLE_SIZE) { | 347 | 31.5M | if (data->spread == QGradient::RepeatSpread) { | 348 | 0 | ipos = ipos % GRADIENT_STOPTABLE_SIZE; | 349 | 0 | ipos = ipos < 0 ? GRADIENT_STOPTABLE_SIZE + ipos : ipos; | 350 | 31.5M | } else if (data->spread == QGradient::ReflectSpread) { | 351 | 0 | const int limit = GRADIENT_STOPTABLE_SIZE * 2; | 352 | 0 | ipos = ipos % limit; | 353 | 0 | ipos = ipos < 0 ? limit + ipos : ipos; | 354 | 0 | ipos = ipos >= GRADIENT_STOPTABLE_SIZE ? limit - 1 - ipos : ipos; | 355 | 31.5M | } else { | 356 | 31.5M | if (ipos < 0) | 357 | 2.84M | ipos = 0; | 358 | 28.6M | else if (ipos >= GRADIENT_STOPTABLE_SIZE) | 359 | 28.8M | ipos = GRADIENT_STOPTABLE_SIZE-1; | 360 | 31.5M | } | 361 | 31.5M | } | 362 | | | 363 | 48.9M | Q_ASSERT(ipos >= 0); | 364 | 48.9M | Q_ASSERT(ipos < GRADIENT_STOPTABLE_SIZE); | 365 | | | 366 | 48.9M | return ipos; | 367 | 48.9M | } |
Unexecuted instantiation: qpixmap_raster.cpp:qt_gradient_clamp(QGradientData const*, int) Unexecuted instantiation: qblendfunctions.cpp:qt_gradient_clamp(QGradientData const*, int) Unexecuted instantiation: qcompositionfunctions.cpp:qt_gradient_clamp(QGradientData const*, int) Unexecuted instantiation: qcosmeticstroker.cpp:qt_gradient_clamp(QGradientData const*, int) Unexecuted instantiation: qdrawhelper_sse2.cpp:qt_gradient_clamp(QGradientData const*, int) Unexecuted instantiation: qdrawhelper_avx2.cpp:qt_gradient_clamp(QGradientData const*, int) |
368 | | |
369 | | static inline uint qt_gradient_pixel(const QGradientData *data, qreal pos) |
370 | 2.50M | { |
371 | 2.50M | int ipos = int(pos * (GRADIENT_STOPTABLE_SIZE - 1) + qreal(0.5)); |
372 | 2.50M | return data->colorTable32[qt_gradient_clamp(data, ipos)]; |
373 | 2.50M | } Unexecuted instantiation: qcolor.cpp:qt_gradient_pixel(QGradientData const*, double) Unexecuted instantiation: qimage.cpp:qt_gradient_pixel(QGradientData const*, double) Unexecuted instantiation: qimage_conversions.cpp:qt_gradient_pixel(QGradientData const*, double) Unexecuted instantiation: qimagescale.cpp:qt_gradient_pixel(QGradientData const*, double) Unexecuted instantiation: qmemrotate.cpp:qt_gradient_pixel(QGradientData const*, double) Unexecuted instantiation: qpaintengine_raster.cpp:qt_gradient_pixel(QGradientData const*, double) Unexecuted instantiation: qpainter.cpp:qt_gradient_pixel(QGradientData const*, double) Unexecuted instantiation: qpixellayout.cpp:qt_gradient_pixel(QGradientData const*, double) Unexecuted instantiation: qrasterizer.cpp:qt_gradient_pixel(QGradientData const*, double) Unexecuted instantiation: qdrawhelper_ssse3.cpp:qt_gradient_pixel(QGradientData const*, double) Unexecuted instantiation: qdrawhelper_sse4.cpp:qt_gradient_pixel(QGradientData const*, double) Unexecuted instantiation: qimagescale_sse4.cpp:qt_gradient_pixel(QGradientData const*, double) qdrawhelper.cpp:qt_gradient_pixel(QGradientData const*, double) Line | Count | Source | 370 | 2.50M | { | 371 | 2.50M | int ipos = int(pos * (GRADIENT_STOPTABLE_SIZE - 1) + qreal(0.5)); | 372 | 2.50M | return data->colorTable32[qt_gradient_clamp(data, ipos)]; | 373 | 2.50M | } |
Unexecuted instantiation: qpixmap_raster.cpp:qt_gradient_pixel(QGradientData const*, double) Unexecuted instantiation: qblendfunctions.cpp:qt_gradient_pixel(QGradientData const*, double) Unexecuted instantiation: qcompositionfunctions.cpp:qt_gradient_pixel(QGradientData const*, double) Unexecuted instantiation: qcosmeticstroker.cpp:qt_gradient_pixel(QGradientData const*, double) Unexecuted instantiation: qdrawhelper_sse2.cpp:qt_gradient_pixel(QGradientData const*, double) Unexecuted instantiation: qdrawhelper_avx2.cpp:qt_gradient_pixel(QGradientData const*, double) |
374 | | |
375 | | #if QT_CONFIG(raster_64bit) |
376 | | static inline const QRgba64& qt_gradient_pixel64(const QGradientData *data, qreal pos) |
377 | 0 | { |
378 | 0 | int ipos = int(pos * (GRADIENT_STOPTABLE_SIZE - 1) + qreal(0.5)); |
379 | 0 | return data->colorTable64[qt_gradient_clamp(data, ipos)]; |
380 | 0 | } Unexecuted instantiation: qcolor.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qimage.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qimage_conversions.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qimagescale.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qmemrotate.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qpaintengine_raster.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qpainter.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qpixellayout.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qrasterizer.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qdrawhelper_ssse3.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qdrawhelper_sse4.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qimagescale_sse4.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qdrawhelper.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qpixmap_raster.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qblendfunctions.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qcompositionfunctions.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qcosmeticstroker.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qdrawhelper_sse2.cpp:qt_gradient_pixel64(QGradientData const*, double) Unexecuted instantiation: qdrawhelper_avx2.cpp:qt_gradient_pixel64(QGradientData const*, double) |
381 | | #endif |
382 | | |
383 | | static inline qreal qRadialDeterminant(qreal a, qreal b, qreal c) |
384 | 0 | { |
385 | 0 | return (b * b) - (4 * a * c); |
386 | 0 | } Unexecuted instantiation: qcolor.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qimage.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qimage_conversions.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qimagescale.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qmemrotate.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qpaintengine_raster.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qpainter.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qpixellayout.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qrasterizer.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qdrawhelper_ssse3.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qdrawhelper_sse4.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qimagescale_sse4.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qdrawhelper.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qpixmap_raster.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qblendfunctions.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qcompositionfunctions.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qcosmeticstroker.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qdrawhelper_sse2.cpp:qRadialDeterminant(double, double, double) Unexecuted instantiation: qdrawhelper_avx2.cpp:qRadialDeterminant(double, double, double) |
387 | | |
388 | | template <class RadialFetchFunc, typename BlendType> static |
389 | | const BlendType * QT_FASTCALL qt_fetch_radial_gradient_template(BlendType *buffer, const Operator *op, |
390 | | const QSpanData *data, int y, int x, int length) |
391 | 20.4M | { |
392 | | // avoid division by zero |
393 | 20.4M | if (qFuzzyIsNull(op->radial.a)) { |
394 | 40.8k | RadialFetchFunc::memfill(buffer, RadialFetchFunc::null(), length); |
395 | 40.8k | return buffer; |
396 | 40.8k | } |
397 | | |
398 | 20.4M | const BlendType *beginOfBuffer = buffer; |
399 | 20.4M | qreal rx = data->m21 * (y + qreal(0.5)) |
400 | 20.4M | + data->dx + data->m11 * (x + qreal(0.5)); |
401 | 20.4M | qreal ry = data->m22 * (y + qreal(0.5)) |
402 | 20.4M | + data->dy + data->m12 * (x + qreal(0.5)); |
403 | 20.4M | bool affine = !data->m13 && !data->m23; |
404 | | |
405 | 20.4M | BlendType *end = buffer + length; |
406 | 20.4M | qreal inv_a = 1 / qreal(2 * op->radial.a); |
407 | | |
408 | 20.4M | if (affine) { |
409 | 20.4M | rx -= data->gradient.radial.focal.x; |
410 | 20.4M | ry -= data->gradient.radial.focal.y; |
411 | | |
412 | 20.4M | const qreal delta_rx = data->m11; |
413 | 20.4M | const qreal delta_ry = data->m12; |
414 | | |
415 | 20.4M | qreal b = 2*(op->radial.dr*data->gradient.radial.focal.radius + rx * op->radial.dx + ry * op->radial.dy); |
416 | 20.4M | qreal delta_b = 2*(delta_rx * op->radial.dx + delta_ry * op->radial.dy); |
417 | 20.4M | const qreal b_delta_b = 2 * b * delta_b; |
418 | 20.4M | const qreal delta_b_delta_b = 2 * delta_b * delta_b; |
419 | | |
420 | 20.4M | const qreal bb = b * b; |
421 | 20.4M | const qreal delta_bb = delta_b * delta_b; |
422 | | |
423 | 20.4M | b *= inv_a; |
424 | 20.4M | delta_b *= inv_a; |
425 | | |
426 | 20.4M | const qreal rxrxryry = rx * rx + ry * ry; |
427 | 20.4M | const qreal delta_rxrxryry = delta_rx * delta_rx + delta_ry * delta_ry; |
428 | 20.4M | const qreal rx_plus_ry = 2*(rx * delta_rx + ry * delta_ry); |
429 | 20.4M | const qreal delta_rx_plus_ry = 2 * delta_rxrxryry; |
430 | | |
431 | 20.4M | inv_a *= inv_a; |
432 | | |
433 | 20.4M | qreal det = (bb - 4 * op->radial.a * (op->radial.sqrfr - rxrxryry)) * inv_a; |
434 | 20.4M | qreal delta_det = (b_delta_b + delta_bb + 4 * op->radial.a * (rx_plus_ry + delta_rxrxryry)) * inv_a; |
435 | 20.4M | const qreal delta_delta_det = (delta_b_delta_b + 4 * op->radial.a * delta_rx_plus_ry) * inv_a; |
436 | | |
437 | 20.4M | if (std::isfinite(float(det)) && std::isfinite(float(delta_det)) |
438 | 19.0M | && std::isfinite(float(delta_delta_det))) |
439 | 19.0M | RadialFetchFunc::fetch(buffer, end, op, data, det, delta_det, delta_delta_det, b, delta_b); |
440 | 1.34M | else |
441 | 1.34M | RadialFetchFunc::memfill(buffer, RadialFetchFunc::null(), length); |
442 | 18.4E | } else { |
443 | 18.4E | qreal rw = data->m23 * (y + qreal(0.5)) |
444 | 18.4E | + data->m33 + data->m13 * (x + qreal(0.5)); |
445 | | |
446 | 18.4E | while (buffer < end) { |
447 | 0 | if (rw == 0) { |
448 | 0 | *buffer = RadialFetchFunc::null(); |
449 | 0 | } else { |
450 | 0 | qreal invRw = 1 / rw; |
451 | 0 | qreal gx = rx * invRw - data->gradient.radial.focal.x; |
452 | 0 | qreal gy = ry * invRw - data->gradient.radial.focal.y; |
453 | 0 | qreal b = 2*(op->radial.dr*data->gradient.radial.focal.radius + gx*op->radial.dx + gy*op->radial.dy); |
454 | 0 | qreal det = qRadialDeterminant(op->radial.a, b, op->radial.sqrfr - (gx*gx + gy*gy)); |
455 | |
|
456 | 0 | BlendType result = RadialFetchFunc::null(); |
457 | 0 | if (det >= 0) { |
458 | 0 | qreal detSqrt = qSqrt(det); |
459 | |
|
460 | 0 | qreal s0 = (-b - detSqrt) * inv_a; |
461 | 0 | qreal s1 = (-b + detSqrt) * inv_a; |
462 | |
|
463 | 0 | qreal s = qMax(s0, s1); |
464 | |
|
465 | 0 | if (data->gradient.radial.focal.radius + op->radial.dr * s >= 0) |
466 | 0 | result = RadialFetchFunc::fetchSingle(data->gradient, s); |
467 | 0 | } |
468 | |
|
469 | 0 | *buffer = result; |
470 | 0 | } |
471 | |
|
472 | 0 | rx += data->m11; |
473 | 0 | ry += data->m12; |
474 | 0 | rw += data->m13; |
475 | |
|
476 | 0 | ++buffer; |
477 | 0 | } |
478 | 18.4E | } |
479 | | |
480 | 20.4M | return beginOfBuffer; |
481 | 20.4M | } Unexecuted instantiation: qdrawhelper.cpp:QRgbaFloat<float> const* qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBaseFP>, QRgbaFloat<float> >(QRgbaFloat<float>*, Operator const*, QSpanData const*, int, int, int) Unexecuted instantiation: qdrawhelper.cpp:unsigned int const* qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase32>, unsigned int>(unsigned int*, Operator const*, QSpanData const*, int, int, int) Unexecuted instantiation: qdrawhelper.cpp:QRgba64 const* qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase64>, QRgba64>(QRgba64*, Operator const*, QSpanData const*, int, int, int) qdrawhelper_sse2.cpp:unsigned int const* qt_fetch_radial_gradient_template<QRadialFetchSimd<QSimdSse2>, unsigned int>(unsigned int*, Operator const*, QSpanData const*, int, int, int) Line | Count | Source | 391 | 20.4M | { | 392 | | // avoid division by zero | 393 | 20.4M | if (qFuzzyIsNull(op->radial.a)) { | 394 | 40.8k | RadialFetchFunc::memfill(buffer, RadialFetchFunc::null(), length); | 395 | 40.8k | return buffer; | 396 | 40.8k | } | 397 | | | 398 | 20.4M | const BlendType *beginOfBuffer = buffer; | 399 | 20.4M | qreal rx = data->m21 * (y + qreal(0.5)) | 400 | 20.4M | + data->dx + data->m11 * (x + qreal(0.5)); | 401 | 20.4M | qreal ry = data->m22 * (y + qreal(0.5)) | 402 | 20.4M | + data->dy + data->m12 * (x + qreal(0.5)); | 403 | 20.4M | bool affine = !data->m13 && !data->m23; | 404 | | | 405 | 20.4M | BlendType *end = buffer + length; | 406 | 20.4M | qreal inv_a = 1 / qreal(2 * op->radial.a); | 407 | | | 408 | 20.4M | if (affine) { | 409 | 20.4M | rx -= data->gradient.radial.focal.x; | 410 | 20.4M | ry -= data->gradient.radial.focal.y; | 411 | | | 412 | 20.4M | const qreal delta_rx = data->m11; | 413 | 20.4M | const qreal delta_ry = data->m12; | 414 | | | 415 | 20.4M | qreal b = 2*(op->radial.dr*data->gradient.radial.focal.radius + rx * op->radial.dx + ry * op->radial.dy); | 416 | 20.4M | qreal delta_b = 2*(delta_rx * op->radial.dx + delta_ry * op->radial.dy); | 417 | 20.4M | const qreal b_delta_b = 2 * b * delta_b; | 418 | 20.4M | const qreal delta_b_delta_b = 2 * delta_b * delta_b; | 419 | | | 420 | 20.4M | const qreal bb = b * b; | 421 | 20.4M | const qreal delta_bb = delta_b * delta_b; | 422 | | | 423 | 20.4M | b *= inv_a; | 424 | 20.4M | delta_b *= inv_a; | 425 | | | 426 | 20.4M | const qreal rxrxryry = rx * rx + ry * ry; | 427 | 20.4M | const qreal delta_rxrxryry = delta_rx * delta_rx + delta_ry * delta_ry; | 428 | 20.4M | const qreal rx_plus_ry = 2*(rx * delta_rx + ry * delta_ry); | 429 | 20.4M | const qreal delta_rx_plus_ry = 2 * delta_rxrxryry; | 430 | | | 431 | 20.4M | inv_a *= inv_a; | 432 | | | 433 | 20.4M | qreal det = (bb - 4 * op->radial.a * (op->radial.sqrfr - rxrxryry)) * inv_a; | 434 | 20.4M | qreal delta_det = (b_delta_b + delta_bb + 4 * op->radial.a * (rx_plus_ry + delta_rxrxryry)) * inv_a; | 435 | 20.4M | const qreal delta_delta_det = (delta_b_delta_b + 4 * op->radial.a * delta_rx_plus_ry) * inv_a; | 436 | | | 437 | 20.4M | if (std::isfinite(float(det)) && std::isfinite(float(delta_det)) | 438 | 19.0M | && std::isfinite(float(delta_delta_det))) | 439 | 19.0M | RadialFetchFunc::fetch(buffer, end, op, data, det, delta_det, delta_delta_det, b, delta_b); | 440 | 1.34M | else | 441 | 1.34M | RadialFetchFunc::memfill(buffer, RadialFetchFunc::null(), length); | 442 | 18.4E | } else { | 443 | 18.4E | qreal rw = data->m23 * (y + qreal(0.5)) | 444 | 18.4E | + data->m33 + data->m13 * (x + qreal(0.5)); | 445 | | | 446 | 18.4E | while (buffer < end) { | 447 | 0 | if (rw == 0) { | 448 | 0 | *buffer = RadialFetchFunc::null(); | 449 | 0 | } else { | 450 | 0 | qreal invRw = 1 / rw; | 451 | 0 | qreal gx = rx * invRw - data->gradient.radial.focal.x; | 452 | 0 | qreal gy = ry * invRw - data->gradient.radial.focal.y; | 453 | 0 | qreal b = 2*(op->radial.dr*data->gradient.radial.focal.radius + gx*op->radial.dx + gy*op->radial.dy); | 454 | 0 | qreal det = qRadialDeterminant(op->radial.a, b, op->radial.sqrfr - (gx*gx + gy*gy)); | 455 | |
| 456 | 0 | BlendType result = RadialFetchFunc::null(); | 457 | 0 | if (det >= 0) { | 458 | 0 | qreal detSqrt = qSqrt(det); | 459 | |
| 460 | 0 | qreal s0 = (-b - detSqrt) * inv_a; | 461 | 0 | qreal s1 = (-b + detSqrt) * inv_a; | 462 | |
| 463 | 0 | qreal s = qMax(s0, s1); | 464 | |
| 465 | 0 | if (data->gradient.radial.focal.radius + op->radial.dr * s >= 0) | 466 | 0 | result = RadialFetchFunc::fetchSingle(data->gradient, s); | 467 | 0 | } | 468 | |
| 469 | 0 | *buffer = result; | 470 | 0 | } | 471 | |
| 472 | 0 | rx += data->m11; | 473 | 0 | ry += data->m12; | 474 | 0 | rw += data->m13; | 475 | |
| 476 | 0 | ++buffer; | 477 | 0 | } | 478 | 18.4E | } | 479 | | | 480 | 20.4M | return beginOfBuffer; | 481 | 20.4M | } |
|
482 | | |
483 | | template <class Simd> |
484 | | class QRadialFetchSimd |
485 | | { |
486 | | public: |
487 | 1.41M | static uint null() { return 0; } |
488 | | static uint fetchSingle(const QGradientData& gradient, qreal v) |
489 | 0 | { |
490 | 0 | return qt_gradient_pixel(&gradient, v); |
491 | 0 | } |
492 | | static void memfill(uint *buffer, uint fill, int length) |
493 | 1.41M | { |
494 | 1.41M | qt_memfill32(buffer, fill, length); |
495 | 1.41M | } |
496 | | static void fetch(uint *buffer, uint *end, const Operator *op, const QSpanData *data, qreal det, |
497 | | qreal delta_det, qreal delta_delta_det, qreal b, qreal delta_b) |
498 | 19.0M | { |
499 | 19.0M | typename Simd::Vect_buffer_f det_vec; |
500 | 19.0M | typename Simd::Vect_buffer_f delta_det4_vec; |
501 | 19.0M | typename Simd::Vect_buffer_f b_vec; |
502 | | |
503 | 95.2M | for (int i = 0; i < 4; ++i) { |
504 | 76.1M | det_vec.f[i] = det; |
505 | 76.1M | delta_det4_vec.f[i] = 4 * delta_det; |
506 | 76.1M | b_vec.f[i] = b; |
507 | | |
508 | 76.1M | det += delta_det; |
509 | 76.1M | delta_det += delta_delta_det; |
510 | 76.1M | b += delta_b; |
511 | 76.1M | } |
512 | | |
513 | 19.0M | const typename Simd::Float32x4 v_delta_delta_det16 = Simd::v_dup(16 * delta_delta_det); |
514 | 19.0M | const typename Simd::Float32x4 v_delta_delta_det6 = Simd::v_dup(6 * delta_delta_det); |
515 | 19.0M | const typename Simd::Float32x4 v_delta_b4 = Simd::v_dup(4 * delta_b); |
516 | | |
517 | 19.0M | const typename Simd::Float32x4 v_r0 = Simd::v_dup(data->gradient.radial.focal.radius); |
518 | 19.0M | const typename Simd::Float32x4 v_dr = Simd::v_dup(op->radial.dr); |
519 | | |
520 | | #if defined(__ARM_NEON__) |
521 | | // NEON doesn't have SIMD sqrt, but uses rsqrt instead that can't be taken of 0. |
522 | | const typename Simd::Float32x4 v_min = Simd::v_dup(std::numeric_limits<float>::epsilon()); |
523 | | #else |
524 | 19.0M | const typename Simd::Float32x4 v_min = Simd::v_dup(0.0f); |
525 | 19.0M | #endif |
526 | 19.0M | const typename Simd::Float32x4 v_max = Simd::v_dup(float(GRADIENT_STOPTABLE_SIZE-1)); |
527 | 19.0M | const typename Simd::Float32x4 v_half = Simd::v_dup(0.5f); |
528 | | |
529 | 19.0M | const typename Simd::Int32x4 v_repeat_mask = Simd::v_dup(~(uint(0xffffff) << GRADIENT_STOPTABLE_SIZE_SHIFT)); |
530 | 19.0M | const typename Simd::Int32x4 v_reflect_mask = Simd::v_dup(~(uint(0xffffff) << (GRADIENT_STOPTABLE_SIZE_SHIFT+1))); |
531 | | |
532 | 19.0M | const typename Simd::Int32x4 v_reflect_limit = Simd::v_dup(2 * GRADIENT_STOPTABLE_SIZE - 1); |
533 | | |
534 | 19.0M | const int extended_mask = op->radial.extended ? 0x0 : ~0x0; |
535 | | |
536 | 19.0M | #define FETCH_RADIAL_LOOP_PROLOGUE \ |
537 | 40.7M | while (buffer < end) { \ |
538 | 21.7M | typename Simd::Vect_buffer_i v_buffer_mask; \ |
539 | 21.7M | v_buffer_mask.v = Simd::v_greaterOrEqual(det_vec.v, v_min); \ |
540 | 21.7M | const typename Simd::Float32x4 v_index_local = Simd::v_sub(Simd::v_sqrt(Simd::v_max(v_min, det_vec.v)), b_vec.v); \ |
541 | 21.7M | const typename Simd::Float32x4 v_index = Simd::v_add(Simd::v_mul(v_index_local, v_max), v_half); \ |
542 | 21.7M | v_buffer_mask.v = Simd::v_and(v_buffer_mask.v, Simd::v_greaterOrEqual(Simd::v_add(v_r0, Simd::v_mul(v_dr, v_index_local)), v_min)); \ |
543 | 21.7M | typename Simd::Vect_buffer_i index_vec; |
544 | 19.0M | #define FETCH_RADIAL_LOOP_CLAMP_REPEAT \ |
545 | 19.0M | index_vec.v = Simd::v_and(v_repeat_mask, Simd::v_toInt(v_index)); |
546 | 19.0M | #define FETCH_RADIAL_LOOP_CLAMP_REFLECT \ |
547 | 19.0M | const typename Simd::Int32x4 v_index_i = Simd::v_and(v_reflect_mask, Simd::v_toInt(v_index)); \ |
548 | 19.0M | const typename Simd::Int32x4 v_index_i_inv = Simd::v_sub(v_reflect_limit, v_index_i); \ |
549 | 19.0M | index_vec.v = Simd::v_min_16(v_index_i, v_index_i_inv); |
550 | 19.0M | #define FETCH_RADIAL_LOOP_CLAMP_PAD \ |
551 | 19.0M | index_vec.v = Simd::v_toInt(Simd::v_min(v_max, Simd::v_max(v_min, v_index))); |
552 | 19.0M | #define FETCH_RADIAL_LOOP_EPILOGUE \ |
553 | 40.7M | det_vec.v = Simd::v_add(Simd::v_add(det_vec.v, delta_det4_vec.v), v_delta_delta_det6); \ |
554 | 40.7M | delta_det4_vec.v = Simd::v_add(delta_det4_vec.v, v_delta_delta_det16); \ |
555 | 40.7M | b_vec.v = Simd::v_add(b_vec.v, v_delta_b4); \ |
556 | 108M | for (int i = 0; i < 4; ++i) \ |
557 | 86.6M | *buffer++ = (extended_mask | v_buffer_mask.i[i]) & data->gradient.colorTable32[index_vec.i[i]]; \ |
558 | 40.7M | } |
559 | | |
560 | 19.0M | #define FETCH_RADIAL_LOOP(FETCH_RADIAL_LOOP_CLAMP) \ |
561 | 21.7M | FETCH_RADIAL_LOOP_PROLOGUE \ |
562 | 21.7M | FETCH_RADIAL_LOOP_CLAMP \ |
563 | 21.7M | FETCH_RADIAL_LOOP_EPILOGUE |
564 | | |
565 | 19.0M | switch (data->gradient.spread) { |
566 | 0 | case QGradient::RepeatSpread: |
567 | 0 | FETCH_RADIAL_LOOP(FETCH_RADIAL_LOOP_CLAMP_REPEAT) |
568 | 0 | break; |
569 | 0 | case QGradient::ReflectSpread: |
570 | 0 | FETCH_RADIAL_LOOP(FETCH_RADIAL_LOOP_CLAMP_REFLECT) |
571 | 0 | break; |
572 | 18.9M | case QGradient::PadSpread: |
573 | 18.9M | FETCH_RADIAL_LOOP(FETCH_RADIAL_LOOP_CLAMP_PAD) |
574 | 18.9M | break; |
575 | 0 | default: |
576 | 0 | Q_UNREACHABLE(); |
577 | 19.0M | } |
578 | 19.0M | } |
579 | | }; |
580 | | |
581 | 1.27M | static inline uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b) { |
582 | 1.27M | uint t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; |
583 | 1.27M | t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8; |
584 | 1.27M | t &= 0xff00ff; |
585 | | |
586 | 1.27M | x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; |
587 | 1.27M | x = (x + ((x >> 8) & 0xff00ff) + 0x800080); |
588 | 1.27M | x &= 0xff00ff00; |
589 | 1.27M | x |= t; |
590 | 1.27M | return x; |
591 | 1.27M | } Unexecuted instantiation: qcolor.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qimage.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qimage_conversions.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qimagescale.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qmemrotate.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qpainter.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qpixellayout.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qrasterizer.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qimagescale_sse4.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qpixmap_raster.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qblendfunctions.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) qcompositionfunctions.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Line | Count | Source | 581 | 240 | static inline uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b) { | 582 | 240 | uint t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; | 583 | 240 | t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8; | 584 | 240 | t &= 0xff00ff; | 585 | | | 586 | 240 | x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; | 587 | 240 | x = (x + ((x >> 8) & 0xff00ff) + 0x800080); | 588 | 240 | x &= 0xff00ff00; | 589 | 240 | x |= t; | 590 | 240 | return x; | 591 | 240 | } |
Unexecuted instantiation: qcosmeticstroker.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) qdrawhelper_avx2.cpp:INTERPOLATE_PIXEL_255(unsigned int, unsigned int, unsigned int, unsigned int) Line | Count | Source | 581 | 1.27M | static inline uint INTERPOLATE_PIXEL_255(uint x, uint a, uint y, uint b) { | 582 | 1.27M | uint t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; | 583 | 1.27M | t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8; | 584 | 1.27M | t &= 0xff00ff; | 585 | | | 586 | 1.27M | x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; | 587 | 1.27M | x = (x + ((x >> 8) & 0xff00ff) + 0x800080); | 588 | 1.27M | x &= 0xff00ff00; | 589 | 1.27M | x |= t; | 590 | 1.27M | return x; | 591 | 1.27M | } |
|
592 | | |
593 | | #if Q_PROCESSOR_WORDSIZE == 8 // 64-bit versions |
594 | | |
595 | 0 | static inline uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) { |
596 | 0 | quint64 t = (((quint64(x)) | ((quint64(x)) << 24)) & 0x00ff00ff00ff00ff) * a; |
597 | 0 | t += (((quint64(y)) | ((quint64(y)) << 24)) & 0x00ff00ff00ff00ff) * b; |
598 | 0 | t >>= 8; |
599 | 0 | t &= 0x00ff00ff00ff00ff; |
600 | 0 | return (uint(t)) | (uint(t >> 24)); |
601 | 0 | } Unexecuted instantiation: qcolor.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qimage.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qimage_conversions.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qimagescale.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qmemrotate.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qpainter.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qpixellayout.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qrasterizer.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qimagescale_sse4.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qpixmap_raster.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qblendfunctions.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:INTERPOLATE_PIXEL_256(unsigned int, unsigned int, unsigned int, unsigned int) |
602 | | |
603 | 87.6M | static inline uint BYTE_MUL(uint x, uint a) { |
604 | 87.6M | quint64 t = (((quint64(x)) | ((quint64(x)) << 24)) & 0x00ff00ff00ff00ff) * a; |
605 | 87.6M | t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080) >> 8; |
606 | 87.6M | t &= 0x00ff00ff00ff00ff; |
607 | 87.6M | return (uint(t)) | (uint(t >> 24)); |
608 | 87.6M | } Unexecuted instantiation: qcolor.cpp:BYTE_MUL(unsigned int, unsigned int) Unexecuted instantiation: qimage.cpp:BYTE_MUL(unsigned int, unsigned int) Unexecuted instantiation: qimage_conversions.cpp:BYTE_MUL(unsigned int, unsigned int) Unexecuted instantiation: qimagescale.cpp:BYTE_MUL(unsigned int, unsigned int) Unexecuted instantiation: qmemrotate.cpp:BYTE_MUL(unsigned int, unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:BYTE_MUL(unsigned int, unsigned int) Unexecuted instantiation: qpainter.cpp:BYTE_MUL(unsigned int, unsigned int) Unexecuted instantiation: qpixellayout.cpp:BYTE_MUL(unsigned int, unsigned int) Unexecuted instantiation: qrasterizer.cpp:BYTE_MUL(unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:BYTE_MUL(unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:BYTE_MUL(unsigned int, unsigned int) Unexecuted instantiation: qimagescale_sse4.cpp:BYTE_MUL(unsigned int, unsigned int) qdrawhelper.cpp:BYTE_MUL(unsigned int, unsigned int) Line | Count | Source | 603 | 82.1M | static inline uint BYTE_MUL(uint x, uint a) { | 604 | 82.1M | quint64 t = (((quint64(x)) | ((quint64(x)) << 24)) & 0x00ff00ff00ff00ff) * a; | 605 | 82.1M | t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080) >> 8; | 606 | 82.1M | t &= 0x00ff00ff00ff00ff; | 607 | 82.1M | return (uint(t)) | (uint(t >> 24)); | 608 | 82.1M | } |
Unexecuted instantiation: qpixmap_raster.cpp:BYTE_MUL(unsigned int, unsigned int) Unexecuted instantiation: qblendfunctions.cpp:BYTE_MUL(unsigned int, unsigned int) qcompositionfunctions.cpp:BYTE_MUL(unsigned int, unsigned int) Line | Count | Source | 603 | 81.8k | static inline uint BYTE_MUL(uint x, uint a) { | 604 | 81.8k | quint64 t = (((quint64(x)) | ((quint64(x)) << 24)) & 0x00ff00ff00ff00ff) * a; | 605 | 81.8k | t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080) >> 8; | 606 | 81.8k | t &= 0x00ff00ff00ff00ff; | 607 | 81.8k | return (uint(t)) | (uint(t >> 24)); | 608 | 81.8k | } |
Unexecuted instantiation: qcosmeticstroker.cpp:BYTE_MUL(unsigned int, unsigned int) qdrawhelper_sse2.cpp:BYTE_MUL(unsigned int, unsigned int) Line | Count | Source | 603 | 315k | static inline uint BYTE_MUL(uint x, uint a) { | 604 | 315k | quint64 t = (((quint64(x)) | ((quint64(x)) << 24)) & 0x00ff00ff00ff00ff) * a; | 605 | 315k | t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080) >> 8; | 606 | 315k | t &= 0x00ff00ff00ff00ff; | 607 | 315k | return (uint(t)) | (uint(t >> 24)); | 608 | 315k | } |
qdrawhelper_avx2.cpp:BYTE_MUL(unsigned int, unsigned int) Line | Count | Source | 603 | 5.07M | static inline uint BYTE_MUL(uint x, uint a) { | 604 | 5.07M | quint64 t = (((quint64(x)) | ((quint64(x)) << 24)) & 0x00ff00ff00ff00ff) * a; | 605 | 5.07M | t = (t + ((t >> 8) & 0xff00ff00ff00ff) + 0x80008000800080) >> 8; | 606 | 5.07M | t &= 0x00ff00ff00ff00ff; | 607 | 5.07M | return (uint(t)) | (uint(t >> 24)); | 608 | 5.07M | } |
|
609 | | |
610 | | #else // 32-bit versions |
611 | | |
612 | | static inline uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) { |
613 | | uint t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; |
614 | | t >>= 8; |
615 | | t &= 0xff00ff; |
616 | | |
617 | | x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; |
618 | | x &= 0xff00ff00; |
619 | | x |= t; |
620 | | return x; |
621 | | } |
622 | | |
623 | | static inline uint BYTE_MUL(uint x, uint a) { |
624 | | uint t = (x & 0xff00ff) * a; |
625 | | t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8; |
626 | | t &= 0xff00ff; |
627 | | |
628 | | x = ((x >> 8) & 0xff00ff) * a; |
629 | | x = (x + ((x >> 8) & 0xff00ff) + 0x800080); |
630 | | x &= 0xff00ff00; |
631 | | x |= t; |
632 | | return x; |
633 | | } |
634 | | #endif |
635 | | |
636 | | static inline void blend_pixel(quint32 &dst, const quint32 src) |
637 | 169M | { |
638 | 169M | if (src >= 0xff000000) |
639 | 169M | dst = src; |
640 | 0 | else if (src != 0) |
641 | 0 | dst = src + BYTE_MUL(dst, qAlpha(~src)); |
642 | 169M | } Unexecuted instantiation: qcolor.cpp:blend_pixel(unsigned int&, unsigned int) Unexecuted instantiation: qimage.cpp:blend_pixel(unsigned int&, unsigned int) Unexecuted instantiation: qimage_conversions.cpp:blend_pixel(unsigned int&, unsigned int) Unexecuted instantiation: qimagescale.cpp:blend_pixel(unsigned int&, unsigned int) Unexecuted instantiation: qmemrotate.cpp:blend_pixel(unsigned int&, unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:blend_pixel(unsigned int&, unsigned int) Unexecuted instantiation: qpainter.cpp:blend_pixel(unsigned int&, unsigned int) Unexecuted instantiation: qpixellayout.cpp:blend_pixel(unsigned int&, unsigned int) Unexecuted instantiation: qrasterizer.cpp:blend_pixel(unsigned int&, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:blend_pixel(unsigned int&, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:blend_pixel(unsigned int&, unsigned int) Unexecuted instantiation: qimagescale_sse4.cpp:blend_pixel(unsigned int&, unsigned int) qdrawhelper.cpp:blend_pixel(unsigned int&, unsigned int) Line | Count | Source | 637 | 169M | { | 638 | 169M | if (src >= 0xff000000) | 639 | 169M | dst = src; | 640 | 0 | else if (src != 0) | 641 | 0 | dst = src + BYTE_MUL(dst, qAlpha(~src)); | 642 | 169M | } |
Unexecuted instantiation: qpixmap_raster.cpp:blend_pixel(unsigned int&, unsigned int) Unexecuted instantiation: qblendfunctions.cpp:blend_pixel(unsigned int&, unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:blend_pixel(unsigned int&, unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:blend_pixel(unsigned int&, unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:blend_pixel(unsigned int&, unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:blend_pixel(unsigned int&, unsigned int) |
643 | | |
644 | | static inline void blend_pixel(quint32 &dst, const quint32 src, const int const_alpha) |
645 | 212M | { |
646 | 212M | if (const_alpha == 255) |
647 | 169M | return blend_pixel(dst, src); |
648 | 43.0M | if (src != 0) { |
649 | 341k | const quint32 s = BYTE_MUL(src, const_alpha); |
650 | 341k | dst = s + BYTE_MUL(dst, qAlpha(~s)); |
651 | 341k | } |
652 | 43.0M | } Unexecuted instantiation: qcolor.cpp:blend_pixel(unsigned int&, unsigned int, int) Unexecuted instantiation: qimage.cpp:blend_pixel(unsigned int&, unsigned int, int) Unexecuted instantiation: qimage_conversions.cpp:blend_pixel(unsigned int&, unsigned int, int) Unexecuted instantiation: qimagescale.cpp:blend_pixel(unsigned int&, unsigned int, int) Unexecuted instantiation: qmemrotate.cpp:blend_pixel(unsigned int&, unsigned int, int) Unexecuted instantiation: qpaintengine_raster.cpp:blend_pixel(unsigned int&, unsigned int, int) Unexecuted instantiation: qpainter.cpp:blend_pixel(unsigned int&, unsigned int, int) Unexecuted instantiation: qpixellayout.cpp:blend_pixel(unsigned int&, unsigned int, int) Unexecuted instantiation: qrasterizer.cpp:blend_pixel(unsigned int&, unsigned int, int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:blend_pixel(unsigned int&, unsigned int, int) Unexecuted instantiation: qdrawhelper_sse4.cpp:blend_pixel(unsigned int&, unsigned int, int) Unexecuted instantiation: qimagescale_sse4.cpp:blend_pixel(unsigned int&, unsigned int, int) qdrawhelper.cpp:blend_pixel(unsigned int&, unsigned int, int) Line | Count | Source | 645 | 169M | { | 646 | 169M | if (const_alpha == 255) | 647 | 169M | return blend_pixel(dst, src); | 648 | 0 | if (src != 0) { | 649 | 0 | const quint32 s = BYTE_MUL(src, const_alpha); | 650 | 0 | dst = s + BYTE_MUL(dst, qAlpha(~s)); | 651 | 0 | } | 652 | 0 | } |
Unexecuted instantiation: qpixmap_raster.cpp:blend_pixel(unsigned int&, unsigned int, int) Unexecuted instantiation: qblendfunctions.cpp:blend_pixel(unsigned int&, unsigned int, int) Unexecuted instantiation: qcompositionfunctions.cpp:blend_pixel(unsigned int&, unsigned int, int) Unexecuted instantiation: qcosmeticstroker.cpp:blend_pixel(unsigned int&, unsigned int, int) Unexecuted instantiation: qdrawhelper_sse2.cpp:blend_pixel(unsigned int&, unsigned int, int) qdrawhelper_avx2.cpp:blend_pixel(unsigned int&, unsigned int, int) Line | Count | Source | 645 | 43.0M | { | 646 | 43.0M | if (const_alpha == 255) | 647 | 0 | return blend_pixel(dst, src); | 648 | 43.0M | if (src != 0) { | 649 | 341k | const quint32 s = BYTE_MUL(src, const_alpha); | 650 | 341k | dst = s + BYTE_MUL(dst, qAlpha(~s)); | 651 | 341k | } | 652 | 43.0M | } |
|
653 | | |
654 | | #if defined(__SSE2__) |
655 | | static inline uint Q_DECL_VECTORCALL interpolate_4_pixels_sse2(__m128i vt, __m128i vb, uint distx, uint disty) |
656 | 27.9k | { |
657 | | // First interpolate top and bottom pixels in parallel. |
658 | 27.9k | vt = _mm_unpacklo_epi8(vt, _mm_setzero_si128()); |
659 | 27.9k | vb = _mm_unpacklo_epi8(vb, _mm_setzero_si128()); |
660 | 27.9k | vt = _mm_mullo_epi16(vt, _mm_set1_epi16(256 - disty)); |
661 | 27.9k | vb = _mm_mullo_epi16(vb, _mm_set1_epi16(disty)); |
662 | 27.9k | __m128i vlr = _mm_add_epi16(vt, vb); |
663 | 27.9k | vlr = _mm_srli_epi16(vlr, 8); |
664 | | // vlr now contains the result of the first two interpolate calls vlr = unpacked((xright << 64) | xleft) |
665 | | |
666 | | // Now the last interpolate between left and right.. |
667 | 27.9k | const __m128i vidistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(256 - distx), _MM_SHUFFLE(0, 0, 0, 0)); |
668 | 27.9k | const __m128i vdistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(distx), _MM_SHUFFLE(0, 0, 0, 0)); |
669 | 27.9k | const __m128i vmulx = _mm_unpacklo_epi16(vidistx, vdistx); |
670 | 27.9k | vlr = _mm_unpacklo_epi16(vlr, _mm_srli_si128(vlr, 8)); |
671 | | // vlr now contains the colors of left and right interleaved { la, ra, lr, rr, lg, rg, lb, rb } |
672 | 27.9k | vlr = _mm_madd_epi16(vlr, vmulx); // Multiply and horizontal add. |
673 | 27.9k | vlr = _mm_srli_epi32(vlr, 8); |
674 | 27.9k | vlr = _mm_packs_epi32(vlr, vlr); |
675 | 27.9k | vlr = _mm_packus_epi16(vlr, vlr); |
676 | 27.9k | return _mm_cvtsi128_si32(vlr); |
677 | 27.9k | } Unexecuted instantiation: qcolor.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Unexecuted instantiation: qimage.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Unexecuted instantiation: qimage_conversions.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Unexecuted instantiation: qimagescale.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Unexecuted instantiation: qmemrotate.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Unexecuted instantiation: qpainter.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Unexecuted instantiation: qpixellayout.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Unexecuted instantiation: qrasterizer.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Unexecuted instantiation: qimagescale_sse4.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) qdrawhelper.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Line | Count | Source | 656 | 27.9k | { | 657 | | // First interpolate top and bottom pixels in parallel. | 658 | 27.9k | vt = _mm_unpacklo_epi8(vt, _mm_setzero_si128()); | 659 | 27.9k | vb = _mm_unpacklo_epi8(vb, _mm_setzero_si128()); | 660 | 27.9k | vt = _mm_mullo_epi16(vt, _mm_set1_epi16(256 - disty)); | 661 | 27.9k | vb = _mm_mullo_epi16(vb, _mm_set1_epi16(disty)); | 662 | 27.9k | __m128i vlr = _mm_add_epi16(vt, vb); | 663 | 27.9k | vlr = _mm_srli_epi16(vlr, 8); | 664 | | // vlr now contains the result of the first two interpolate calls vlr = unpacked((xright << 64) | xleft) | 665 | | | 666 | | // Now the last interpolate between left and right.. | 667 | 27.9k | const __m128i vidistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(256 - distx), _MM_SHUFFLE(0, 0, 0, 0)); | 668 | 27.9k | const __m128i vdistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(distx), _MM_SHUFFLE(0, 0, 0, 0)); | 669 | 27.9k | const __m128i vmulx = _mm_unpacklo_epi16(vidistx, vdistx); | 670 | 27.9k | vlr = _mm_unpacklo_epi16(vlr, _mm_srli_si128(vlr, 8)); | 671 | | // vlr now contains the colors of left and right interleaved { la, ra, lr, rr, lg, rg, lb, rb } | 672 | 27.9k | vlr = _mm_madd_epi16(vlr, vmulx); // Multiply and horizontal add. | 673 | 27.9k | vlr = _mm_srli_epi32(vlr, 8); | 674 | 27.9k | vlr = _mm_packs_epi32(vlr, vlr); | 675 | 27.9k | vlr = _mm_packus_epi16(vlr, vlr); | 676 | 27.9k | return _mm_cvtsi128_si32(vlr); | 677 | 27.9k | } |
Unexecuted instantiation: qpixmap_raster.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Unexecuted instantiation: qblendfunctions.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:interpolate_4_pixels_sse2(long long __vector(2), long long __vector(2), unsigned int, unsigned int) |
678 | | |
679 | | static inline uint interpolate_4_pixels(uint tl, uint tr, uint bl, uint br, uint distx, uint disty) |
680 | 0 | { |
681 | 0 | __m128i vt = _mm_unpacklo_epi32(_mm_cvtsi32_si128(tl), _mm_cvtsi32_si128(tr)); |
682 | 0 | __m128i vb = _mm_unpacklo_epi32(_mm_cvtsi32_si128(bl), _mm_cvtsi32_si128(br)); |
683 | 0 | return interpolate_4_pixels_sse2(vt, vb, distx, disty); |
684 | 0 | } Unexecuted instantiation: qcolor.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qimage.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qimage_conversions.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qimagescale.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qmemrotate.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qpainter.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qpixellayout.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qrasterizer.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qimagescale_sse4.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qpixmap_raster.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qblendfunctions.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:interpolate_4_pixels(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) |
685 | | |
686 | | static inline uint interpolate_4_pixels(const uint t[], const uint b[], uint distx, uint disty) |
687 | 27.9k | { |
688 | 27.9k | __m128i vt = _mm_loadl_epi64((const __m128i*)t); |
689 | 27.9k | __m128i vb = _mm_loadl_epi64((const __m128i*)b); |
690 | 27.9k | return interpolate_4_pixels_sse2(vt, vb, distx, disty); |
691 | 27.9k | } Unexecuted instantiation: qcolor.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Unexecuted instantiation: qimage.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Unexecuted instantiation: qimage_conversions.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Unexecuted instantiation: qimagescale.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Unexecuted instantiation: qmemrotate.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Unexecuted instantiation: qpainter.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Unexecuted instantiation: qpixellayout.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Unexecuted instantiation: qrasterizer.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Unexecuted instantiation: qimagescale_sse4.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) qdrawhelper.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Line | Count | Source | 687 | 27.9k | { | 688 | 27.9k | __m128i vt = _mm_loadl_epi64((const __m128i*)t); | 689 | 27.9k | __m128i vb = _mm_loadl_epi64((const __m128i*)b); | 690 | 27.9k | return interpolate_4_pixels_sse2(vt, vb, distx, disty); | 691 | 27.9k | } |
Unexecuted instantiation: qpixmap_raster.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Unexecuted instantiation: qblendfunctions.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:interpolate_4_pixels(unsigned int const*, unsigned int const*, unsigned int, unsigned int) |
692 | | |
693 | 0 | static constexpr inline bool hasFastInterpolate4() { return true; }Unexecuted instantiation: qcolor.cpp:hasFastInterpolate4() Unexecuted instantiation: qimage.cpp:hasFastInterpolate4() Unexecuted instantiation: qimage_conversions.cpp:hasFastInterpolate4() Unexecuted instantiation: qimagescale.cpp:hasFastInterpolate4() Unexecuted instantiation: qmemrotate.cpp:hasFastInterpolate4() Unexecuted instantiation: qpaintengine_raster.cpp:hasFastInterpolate4() Unexecuted instantiation: qpainter.cpp:hasFastInterpolate4() Unexecuted instantiation: qpixellayout.cpp:hasFastInterpolate4() Unexecuted instantiation: qrasterizer.cpp:hasFastInterpolate4() Unexecuted instantiation: qdrawhelper_ssse3.cpp:hasFastInterpolate4() Unexecuted instantiation: qdrawhelper_sse4.cpp:hasFastInterpolate4() Unexecuted instantiation: qimagescale_sse4.cpp:hasFastInterpolate4() Unexecuted instantiation: qdrawhelper.cpp:hasFastInterpolate4() Unexecuted instantiation: qpixmap_raster.cpp:hasFastInterpolate4() Unexecuted instantiation: qblendfunctions.cpp:hasFastInterpolate4() Unexecuted instantiation: qcompositionfunctions.cpp:hasFastInterpolate4() Unexecuted instantiation: qcosmeticstroker.cpp:hasFastInterpolate4() Unexecuted instantiation: qdrawhelper_sse2.cpp:hasFastInterpolate4() Unexecuted instantiation: qdrawhelper_avx2.cpp:hasFastInterpolate4() |
694 | | |
695 | | #elif defined(__ARM_NEON__) |
696 | | static inline uint interpolate_4_pixels_neon(uint32x2_t vt32, uint32x2_t vb32, uint distx, uint disty) |
697 | | { |
698 | | uint16x8_t vt16 = vmovl_u8(vreinterpret_u8_u32(vt32)); |
699 | | uint16x8_t vb16 = vmovl_u8(vreinterpret_u8_u32(vb32)); |
700 | | vt16 = vmulq_n_u16(vt16, 256 - disty); |
701 | | vt16 = vmlaq_n_u16(vt16, vb16, disty); |
702 | | vt16 = vshrq_n_u16(vt16, 8); |
703 | | uint16x4_t vl16 = vget_low_u16(vt16); |
704 | | uint16x4_t vr16 = vget_high_u16(vt16); |
705 | | vl16 = vmul_n_u16(vl16, 256 - distx); |
706 | | vl16 = vmla_n_u16(vl16, vr16, distx); |
707 | | vl16 = vshr_n_u16(vl16, 8); |
708 | | uint8x8_t vr = vmovn_u16(vcombine_u16(vl16, vl16)); |
709 | | return vget_lane_u32(vreinterpret_u32_u8(vr), 0); |
710 | | } |
711 | | |
712 | | static inline uint interpolate_4_pixels(uint tl, uint tr, uint bl, uint br, uint distx, uint disty) |
713 | | { |
714 | | uint32x2_t vt32 = vmov_n_u32(tl); |
715 | | uint32x2_t vb32 = vmov_n_u32(bl); |
716 | | vt32 = vset_lane_u32(tr, vt32, 1); |
717 | | vb32 = vset_lane_u32(br, vb32, 1); |
718 | | return interpolate_4_pixels_neon(vt32, vb32, distx, disty); |
719 | | } |
720 | | |
721 | | static inline uint interpolate_4_pixels(const uint t[], const uint b[], uint distx, uint disty) |
722 | | { |
723 | | uint32x2_t vt32 = vld1_u32(t); |
724 | | uint32x2_t vb32 = vld1_u32(b); |
725 | | return interpolate_4_pixels_neon(vt32, vb32, distx, disty); |
726 | | } |
727 | | |
728 | | static constexpr inline bool hasFastInterpolate4() { return true; } |
729 | | |
730 | | #else |
731 | | static inline uint interpolate_4_pixels(uint tl, uint tr, uint bl, uint br, uint distx, uint disty) |
732 | | { |
733 | | uint idistx = 256 - distx; |
734 | | uint idisty = 256 - disty; |
735 | | uint xtop = INTERPOLATE_PIXEL_256(tl, idistx, tr, distx); |
736 | | uint xbot = INTERPOLATE_PIXEL_256(bl, idistx, br, distx); |
737 | | return INTERPOLATE_PIXEL_256(xtop, idisty, xbot, disty); |
738 | | } |
739 | | |
740 | | static inline uint interpolate_4_pixels(const uint t[], const uint b[], uint distx, uint disty) |
741 | | { |
742 | | return interpolate_4_pixels(t[0], t[1], b[0], b[1], distx, disty); |
743 | | } |
744 | | |
745 | | static constexpr inline bool hasFastInterpolate4() { return false; } |
746 | | |
747 | | #endif |
748 | | |
749 | | static inline QRgba64 multiplyAlpha256(QRgba64 rgba64, uint alpha256) |
750 | 14.5k | { |
751 | 14.5k | return QRgba64::fromRgba64((rgba64.red() * alpha256) >> 8, |
752 | 14.5k | (rgba64.green() * alpha256) >> 8, |
753 | 14.5k | (rgba64.blue() * alpha256) >> 8, |
754 | 14.5k | (rgba64.alpha() * alpha256) >> 8); |
755 | 14.5k | } Unexecuted instantiation: qcolor.cpp:multiplyAlpha256(QRgba64, unsigned int) Unexecuted instantiation: qimage.cpp:multiplyAlpha256(QRgba64, unsigned int) Unexecuted instantiation: qimage_conversions.cpp:multiplyAlpha256(QRgba64, unsigned int) Unexecuted instantiation: qimagescale.cpp:multiplyAlpha256(QRgba64, unsigned int) Unexecuted instantiation: qmemrotate.cpp:multiplyAlpha256(QRgba64, unsigned int) qpaintengine_raster.cpp:multiplyAlpha256(QRgba64, unsigned int) Line | Count | Source | 750 | 14.5k | { | 751 | 14.5k | return QRgba64::fromRgba64((rgba64.red() * alpha256) >> 8, | 752 | 14.5k | (rgba64.green() * alpha256) >> 8, | 753 | 14.5k | (rgba64.blue() * alpha256) >> 8, | 754 | 14.5k | (rgba64.alpha() * alpha256) >> 8); | 755 | 14.5k | } |
Unexecuted instantiation: qpainter.cpp:multiplyAlpha256(QRgba64, unsigned int) Unexecuted instantiation: qpixellayout.cpp:multiplyAlpha256(QRgba64, unsigned int) Unexecuted instantiation: qrasterizer.cpp:multiplyAlpha256(QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:multiplyAlpha256(QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:multiplyAlpha256(QRgba64, unsigned int) Unexecuted instantiation: qimagescale_sse4.cpp:multiplyAlpha256(QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper.cpp:multiplyAlpha256(QRgba64, unsigned int) Unexecuted instantiation: qpixmap_raster.cpp:multiplyAlpha256(QRgba64, unsigned int) Unexecuted instantiation: qblendfunctions.cpp:multiplyAlpha256(QRgba64, unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:multiplyAlpha256(QRgba64, unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:multiplyAlpha256(QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:multiplyAlpha256(QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:multiplyAlpha256(QRgba64, unsigned int) |
756 | | static inline QRgba64 interpolate256(QRgba64 x, uint alpha1, QRgba64 y, uint alpha2) |
757 | 7.25k | { |
758 | 7.25k | return QRgba64::fromRgba64(multiplyAlpha256(x, alpha1) + multiplyAlpha256(y, alpha2)); |
759 | 7.25k | } Unexecuted instantiation: qcolor.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qimage.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qimage_conversions.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qimagescale.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qmemrotate.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) qpaintengine_raster.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Line | Count | Source | 757 | 7.25k | { | 758 | 7.25k | return QRgba64::fromRgba64(multiplyAlpha256(x, alpha1) + multiplyAlpha256(y, alpha2)); | 759 | 7.25k | } |
Unexecuted instantiation: qpainter.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qpixellayout.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qrasterizer.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qimagescale_sse4.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qpixmap_raster.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qblendfunctions.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:interpolate256(QRgba64, unsigned int, QRgba64, unsigned int) |
760 | | |
761 | | #ifdef __SSE2__ |
762 | | static inline QRgba64 interpolate_4_pixels_rgb64(const QRgba64 t[], const QRgba64 b[], uint distx, uint disty) |
763 | 0 | { |
764 | 0 | __m128i vt = _mm_loadu_si128((const __m128i*)t); |
765 | 0 | if (disty) { |
766 | 0 | __m128i vb = _mm_loadu_si128((const __m128i*)b); |
767 | 0 | vt = _mm_mulhi_epu16(vt, _mm_set1_epi16(0x10000 - disty)); |
768 | 0 | vb = _mm_mulhi_epu16(vb, _mm_set1_epi16(disty)); |
769 | 0 | vt = _mm_add_epi16(vt, vb); |
770 | 0 | } |
771 | 0 | if (distx) { |
772 | 0 | const __m128i vdistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(distx), _MM_SHUFFLE(0, 0, 0, 0)); |
773 | 0 | const __m128i vidistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(0x10000 - distx), _MM_SHUFFLE(0, 0, 0, 0)); |
774 | 0 | vt = _mm_mulhi_epu16(vt, _mm_unpacklo_epi64(vidistx, vdistx)); |
775 | 0 | vt = _mm_add_epi16(vt, _mm_srli_si128(vt, 8)); |
776 | 0 | } |
777 | 0 | #ifdef Q_PROCESSOR_X86_64 |
778 | 0 | return QRgba64::fromRgba64(_mm_cvtsi128_si64(vt)); |
779 | | #else |
780 | | QRgba64 out; |
781 | | _mm_storel_epi64((__m128i*)&out, vt); |
782 | | return out; |
783 | | #endif // Q_PROCESSOR_X86_64 |
784 | 0 | } Unexecuted instantiation: qcolor.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qimage.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qimage_conversions.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qimagescale.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qmemrotate.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qpainter.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qpixellayout.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qrasterizer.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qimagescale_sse4.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qpixmap_raster.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qblendfunctions.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:interpolate_4_pixels_rgb64(QRgba64 const*, QRgba64 const*, unsigned int, unsigned int) |
785 | | #elif defined(__ARM_NEON__) |
786 | | static inline QRgba64 interpolate_4_pixels_rgb64(const QRgba64 t[], const QRgba64 b[], uint distx, uint disty) |
787 | | { |
788 | | uint64x1x2_t vt = vld2_u64(reinterpret_cast<const uint64_t *>(t)); |
789 | | if (disty) { |
790 | | uint64x1x2_t vb = vld2_u64(reinterpret_cast<const uint64_t *>(b)); |
791 | | uint32x4_t vt0 = vmull_n_u16(vreinterpret_u16_u64(vt.val[0]), 0x10000 - disty); |
792 | | uint32x4_t vt1 = vmull_n_u16(vreinterpret_u16_u64(vt.val[1]), 0x10000 - disty); |
793 | | vt0 = vmlal_n_u16(vt0, vreinterpret_u16_u64(vb.val[0]), disty); |
794 | | vt1 = vmlal_n_u16(vt1, vreinterpret_u16_u64(vb.val[1]), disty); |
795 | | vt.val[0] = vreinterpret_u64_u16(vshrn_n_u32(vt0, 16)); |
796 | | vt.val[1] = vreinterpret_u64_u16(vshrn_n_u32(vt1, 16)); |
797 | | } |
798 | | if (distx) { |
799 | | uint32x4_t vt0 = vmull_n_u16(vreinterpret_u16_u64(vt.val[0]), 0x10000 - distx); |
800 | | vt0 = vmlal_n_u16(vt0, vreinterpret_u16_u64(vt.val[1]), distx); |
801 | | vt.val[0] = vreinterpret_u64_u16(vshrn_n_u32(vt0, 16)); |
802 | | } |
803 | | QRgba64 out; |
804 | | vst1_u64(reinterpret_cast<uint64_t *>(&out), vt.val[0]); |
805 | | return out; |
806 | | } |
807 | | #else |
808 | | static inline QRgba64 interpolate_4_pixels_rgb64(const QRgba64 t[], const QRgba64 b[], uint distx, uint disty) |
809 | | { |
810 | | const uint dx = distx>>8; |
811 | | const uint dy = disty>>8; |
812 | | const uint idx = 256 - dx; |
813 | | const uint idy = 256 - dy; |
814 | | QRgba64 xtop = interpolate256(t[0], idx, t[1], dx); |
815 | | QRgba64 xbot = interpolate256(b[0], idx, b[1], dx); |
816 | | return interpolate256(xtop, idy, xbot, dy); |
817 | | } |
818 | | #endif // __SSE2__ |
819 | | |
820 | | #if QT_CONFIG(raster_fp) |
821 | | static inline QRgbaFloat32 multiplyAlpha_rgba32f(QRgbaFloat32 c, float a) |
822 | 0 | { |
823 | 0 | return QRgbaFloat32 { c.r * a, c.g * a, c.b * a, c.a * a }; |
824 | 0 | } Unexecuted instantiation: qcolor.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qimage.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qimage_conversions.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qimagescale.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qmemrotate.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qpaintengine_raster.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qpainter.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qpixellayout.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qrasterizer.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qdrawhelper_ssse3.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qdrawhelper_sse4.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qimagescale_sse4.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qdrawhelper.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qpixmap_raster.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qblendfunctions.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qcompositionfunctions.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qcosmeticstroker.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qdrawhelper_sse2.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) Unexecuted instantiation: qdrawhelper_avx2.cpp:multiplyAlpha_rgba32f(QRgbaFloat<float>, float) |
825 | | |
826 | | static inline QRgbaFloat32 interpolate_rgba32f(QRgbaFloat32 x, float alpha1, QRgbaFloat32 y, float alpha2) |
827 | 0 | { |
828 | 0 | x = multiplyAlpha_rgba32f(x, alpha1); |
829 | 0 | y = multiplyAlpha_rgba32f(y, alpha2); |
830 | 0 | return QRgbaFloat32 { x.r + y.r, x.g + y.g, x.b + y.b, x.a + y.a }; |
831 | 0 | } Unexecuted instantiation: qcolor.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qimage.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qimage_conversions.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qimagescale.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qmemrotate.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qpaintengine_raster.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qpainter.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qpixellayout.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qrasterizer.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qdrawhelper_ssse3.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qdrawhelper_sse4.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qimagescale_sse4.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qdrawhelper.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qpixmap_raster.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qblendfunctions.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qcompositionfunctions.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qcosmeticstroker.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qdrawhelper_sse2.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) Unexecuted instantiation: qdrawhelper_avx2.cpp:interpolate_rgba32f(QRgbaFloat<float>, float, QRgbaFloat<float>, float) |
832 | | #ifdef __SSE2__ |
833 | | static inline __m128 Q_DECL_VECTORCALL interpolate_rgba32f(__m128 x, __m128 alpha1, __m128 y, __m128 alpha2) |
834 | 0 | { |
835 | 0 | return _mm_add_ps(_mm_mul_ps(x, alpha1), _mm_mul_ps(y, alpha2)); |
836 | 0 | } Unexecuted instantiation: qcolor.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qimage.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qimage_conversions.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qimagescale.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qmemrotate.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qpaintengine_raster.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qpainter.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qpixellayout.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qrasterizer.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qdrawhelper_ssse3.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qdrawhelper_sse4.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qimagescale_sse4.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qdrawhelper.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qpixmap_raster.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qblendfunctions.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qcompositionfunctions.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qcosmeticstroker.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qdrawhelper_sse2.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) Unexecuted instantiation: qdrawhelper_avx2.cpp:interpolate_rgba32f(float __vector(4), float __vector(4), float __vector(4), float __vector(4)) |
837 | | #endif |
838 | | |
839 | | static inline QRgbaFloat32 interpolate_4_pixels_rgba32f(const QRgbaFloat32 t[], const QRgbaFloat32 b[], uint distx, uint disty) |
840 | 0 | { |
841 | 0 | constexpr float f = 1.0f / 65536.0f; |
842 | 0 | const float dx = distx * f; |
843 | 0 | const float dy = disty * f; |
844 | 0 | const float idx = 1.0f - dx; |
845 | 0 | const float idy = 1.0f - dy; |
846 | 0 | #ifdef __SSE2__ |
847 | 0 | const __m128 vtl = _mm_load_ps((const float *)&t[0]); |
848 | 0 | const __m128 vtr = _mm_load_ps((const float *)&t[1]); |
849 | 0 | const __m128 vbl = _mm_load_ps((const float *)&b[0]); |
850 | 0 | const __m128 vbr = _mm_load_ps((const float *)&b[1]); |
851 | |
|
852 | 0 | const __m128 vdx = _mm_set1_ps(dx); |
853 | 0 | const __m128 vidx = _mm_set1_ps(idx); |
854 | 0 | __m128 vt = interpolate_rgba32f(vtl, vidx, vtr, vdx); |
855 | 0 | __m128 vb = interpolate_rgba32f(vbl, vidx, vbr, vdx); |
856 | 0 | const __m128 vdy = _mm_set1_ps(dy); |
857 | 0 | const __m128 vidy = _mm_set1_ps(idy); |
858 | 0 | vt = interpolate_rgba32f(vt, vidy, vb, vdy); |
859 | 0 | QRgbaFloat32 res; |
860 | 0 | _mm_store_ps((float*)&res, vt); |
861 | 0 | return res; |
862 | | #else |
863 | | QRgbaFloat32 xtop = interpolate_rgba32f(t[0], idx, t[1], dx); |
864 | | QRgbaFloat32 xbot = interpolate_rgba32f(b[0], idx, b[1], dx); |
865 | | xtop = interpolate_rgba32f(xtop, idy, xbot, dy); |
866 | | return xtop; |
867 | | #endif |
868 | 0 | } Unexecuted instantiation: qcolor.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qimage.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qimage_conversions.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qimagescale.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qmemrotate.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qpainter.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qpixellayout.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qrasterizer.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qimagescale_sse4.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qpixmap_raster.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qblendfunctions.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:interpolate_4_pixels_rgba32f(QRgbaFloat<float> const*, QRgbaFloat<float> const*, unsigned int, unsigned int) |
869 | | #endif // QT_CONFIG(raster_fp) |
870 | | |
871 | 0 | static inline uint BYTE_MUL_RGB16(uint x, uint a) { |
872 | 0 | a += 1; |
873 | 0 | uint t = (((x & 0x07e0)*a) >> 8) & 0x07e0; |
874 | 0 | t |= (((x & 0xf81f)*(a>>2)) >> 6) & 0xf81f; |
875 | 0 | return t; |
876 | 0 | } Unexecuted instantiation: qcolor.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qimage.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qimage_conversions.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qimagescale.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qmemrotate.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qpainter.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qpixellayout.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qrasterizer.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qimagescale_sse4.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qpixmap_raster.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qblendfunctions.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:BYTE_MUL_RGB16(unsigned int, unsigned int) |
877 | | |
878 | 0 | static inline uint BYTE_MUL_RGB16_32(uint x, uint a) { |
879 | 0 | uint t = (((x & 0xf81f07e0) >> 5)*a) & 0xf81f07e0; |
880 | 0 | t |= (((x & 0x07e0f81f)*a) >> 5) & 0x07e0f81f; |
881 | 0 | return t; |
882 | 0 | } Unexecuted instantiation: qcolor.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qimage.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qimage_conversions.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qimagescale.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qmemrotate.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qpainter.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qpixellayout.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qrasterizer.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qimagescale_sse4.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qpixmap_raster.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qblendfunctions.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:BYTE_MUL_RGB16_32(unsigned int, unsigned int) |
883 | | |
884 | | // qt_div_255 is a fast rounded division by 255 using an approximation that is accurate for all positive 16-bit integers |
885 | 795k | static constexpr inline int qt_div_255(int x) { return (x + (x>>8) + 0x80) >> 8; }Unexecuted instantiation: qcolor.cpp:qt_div_255(int) Unexecuted instantiation: qimage.cpp:qt_div_255(int) Unexecuted instantiation: qimage_conversions.cpp:qt_div_255(int) Unexecuted instantiation: qimagescale.cpp:qt_div_255(int) Unexecuted instantiation: qmemrotate.cpp:qt_div_255(int) qpaintengine_raster.cpp:qt_div_255(int) Line | Count | Source | 885 | 795k | static constexpr inline int qt_div_255(int x) { return (x + (x>>8) + 0x80) >> 8; } |
Unexecuted instantiation: qpainter.cpp:qt_div_255(int) Unexecuted instantiation: qpixellayout.cpp:qt_div_255(int) Unexecuted instantiation: qrasterizer.cpp:qt_div_255(int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:qt_div_255(int) Unexecuted instantiation: qdrawhelper_sse4.cpp:qt_div_255(int) Unexecuted instantiation: qimagescale_sse4.cpp:qt_div_255(int) Unexecuted instantiation: qdrawhelper.cpp:qt_div_255(int) Unexecuted instantiation: qpixmap_raster.cpp:qt_div_255(int) Unexecuted instantiation: qblendfunctions.cpp:qt_div_255(int) Unexecuted instantiation: qcompositionfunctions.cpp:qt_div_255(int) Unexecuted instantiation: qcosmeticstroker.cpp:qt_div_255(int) Unexecuted instantiation: qdrawhelper_sse2.cpp:qt_div_255(int) Unexecuted instantiation: qdrawhelper_avx2.cpp:qt_div_255(int) |
886 | 37.1M | static constexpr inline uint qt_div_257_floor(uint x) { return (x - (x >> 8)) >> 8; }qcolor.cpp:qt_div_257_floor(unsigned int) Line | Count | Source | 886 | 37.1M | static constexpr inline uint qt_div_257_floor(uint x) { return (x - (x >> 8)) >> 8; } |
Unexecuted instantiation: qimage.cpp:qt_div_257_floor(unsigned int) Unexecuted instantiation: qimage_conversions.cpp:qt_div_257_floor(unsigned int) Unexecuted instantiation: qimagescale.cpp:qt_div_257_floor(unsigned int) Unexecuted instantiation: qmemrotate.cpp:qt_div_257_floor(unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:qt_div_257_floor(unsigned int) Unexecuted instantiation: qpainter.cpp:qt_div_257_floor(unsigned int) qpixellayout.cpp:qt_div_257_floor(unsigned int) Line | Count | Source | 886 | 12.6k | static constexpr inline uint qt_div_257_floor(uint x) { return (x - (x >> 8)) >> 8; } |
Unexecuted instantiation: qrasterizer.cpp:qt_div_257_floor(unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:qt_div_257_floor(unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:qt_div_257_floor(unsigned int) Unexecuted instantiation: qimagescale_sse4.cpp:qt_div_257_floor(unsigned int) Unexecuted instantiation: qdrawhelper.cpp:qt_div_257_floor(unsigned int) Unexecuted instantiation: qpixmap_raster.cpp:qt_div_257_floor(unsigned int) Unexecuted instantiation: qblendfunctions.cpp:qt_div_257_floor(unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:qt_div_257_floor(unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:qt_div_257_floor(unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:qt_div_257_floor(unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:qt_div_257_floor(unsigned int) |
887 | 37.1M | static constexpr inline uint qt_div_257(uint x) { return qt_div_257_floor(x + 128); }qcolor.cpp:qt_div_257(unsigned int) Line | Count | Source | 887 | 37.1M | static constexpr inline uint qt_div_257(uint x) { return qt_div_257_floor(x + 128); } |
Unexecuted instantiation: qimage.cpp:qt_div_257(unsigned int) Unexecuted instantiation: qimage_conversions.cpp:qt_div_257(unsigned int) Unexecuted instantiation: qimagescale.cpp:qt_div_257(unsigned int) Unexecuted instantiation: qmemrotate.cpp:qt_div_257(unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:qt_div_257(unsigned int) Unexecuted instantiation: qpainter.cpp:qt_div_257(unsigned int) qpixellayout.cpp:qt_div_257(unsigned int) Line | Count | Source | 887 | 12.6k | static constexpr inline uint qt_div_257(uint x) { return qt_div_257_floor(x + 128); } |
Unexecuted instantiation: qrasterizer.cpp:qt_div_257(unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:qt_div_257(unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:qt_div_257(unsigned int) Unexecuted instantiation: qimagescale_sse4.cpp:qt_div_257(unsigned int) Unexecuted instantiation: qdrawhelper.cpp:qt_div_257(unsigned int) Unexecuted instantiation: qpixmap_raster.cpp:qt_div_257(unsigned int) Unexecuted instantiation: qblendfunctions.cpp:qt_div_257(unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:qt_div_257(unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:qt_div_257(unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:qt_div_257(unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:qt_div_257(unsigned int) |
888 | 0 | static constexpr inline uint qt_div_65535(uint x) { return (x + (x>>16) + 0x8000U) >> 16; }Unexecuted instantiation: qcolor.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qimage.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qimage_conversions.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qimagescale.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qmemrotate.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qpaintengine_raster.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qpainter.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qpixellayout.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qrasterizer.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qdrawhelper_ssse3.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qdrawhelper_sse4.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qimagescale_sse4.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qdrawhelper.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qpixmap_raster.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qblendfunctions.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qcompositionfunctions.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qcosmeticstroker.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qdrawhelper_sse2.cpp:qt_div_65535(unsigned int) Unexecuted instantiation: qdrawhelper_avx2.cpp:qt_div_65535(unsigned int) |
889 | | |
890 | | template <class T> inline void qt_memfill_template(T *dest, T color, qsizetype count) |
891 | 0 | { |
892 | 0 | if (!count) |
893 | 0 | return; |
894 | | |
895 | 0 | qsizetype n = (count + 7) / 8; |
896 | 0 | switch (count & 0x07) |
897 | 0 | { |
898 | 0 | case 0: do { *dest++ = color; Q_FALLTHROUGH(); |
899 | 0 | case 7: *dest++ = color; Q_FALLTHROUGH(); |
900 | 0 | case 6: *dest++ = color; Q_FALLTHROUGH(); |
901 | 0 | case 5: *dest++ = color; Q_FALLTHROUGH(); |
902 | 0 | case 4: *dest++ = color; Q_FALLTHROUGH(); |
903 | 0 | case 3: *dest++ = color; Q_FALLTHROUGH(); |
904 | 0 | case 2: *dest++ = color; Q_FALLTHROUGH(); |
905 | 0 | case 1: *dest++ = color; |
906 | 0 | } while (--n > 0); |
907 | 0 | } |
908 | 0 | } Unexecuted instantiation: void qt_memfill_template<QRgbaFloat<qfloat16> >(QRgbaFloat<qfloat16>*, QRgbaFloat<qfloat16>, long long) Unexecuted instantiation: void qt_memfill_template<QRgbaFloat<float> >(QRgbaFloat<float>*, QRgbaFloat<float>, long long) Unexecuted instantiation: void qt_memfill_template<unsigned long long>(unsigned long long*, unsigned long long, long long) Unexecuted instantiation: void qt_memfill_template<unsigned int>(unsigned int*, unsigned int, long long) Unexecuted instantiation: void qt_memfill_template<quint24>(quint24*, quint24, long long) Unexecuted instantiation: void qt_memfill_template<unsigned short>(unsigned short*, unsigned short, long long) |
909 | | |
910 | | template <class T> inline void qt_memfill(T *dest, T value, qsizetype count) |
911 | 0 | { |
912 | 0 | qt_memfill_template(dest, value, count); |
913 | 0 | } Unexecuted instantiation: void qt_memfill<QRgbaFloat<qfloat16> >(QRgbaFloat<qfloat16>*, QRgbaFloat<qfloat16>, long long) Unexecuted instantiation: void qt_memfill<QRgbaFloat<float> >(QRgbaFloat<float>*, QRgbaFloat<float>, long long) |
914 | | |
915 | | template<> inline void qt_memfill(quint64 *dest, quint64 color, qsizetype count) |
916 | 0 | { |
917 | 0 | qt_memfill64(dest, color, count); |
918 | 0 | } |
919 | | |
920 | | template<> inline void qt_memfill(quint32 *dest, quint32 color, qsizetype count) |
921 | 4.11M | { |
922 | 4.11M | qt_memfill32(dest, color, count); |
923 | 4.11M | } |
924 | | |
925 | | template<> inline void qt_memfill(quint24 *dest, quint24 color, qsizetype count) |
926 | 0 | { |
927 | 0 | qt_memfill24(dest, color, count); |
928 | 0 | } |
929 | | |
930 | | template<> inline void qt_memfill(quint16 *dest, quint16 color, qsizetype count) |
931 | 0 | { |
932 | 0 | qt_memfill16(dest, color, count); |
933 | 0 | } |
934 | | |
935 | | template<> inline void qt_memfill(quint8 *dest, quint8 color, qsizetype count) |
936 | 647k | { |
937 | 647k | memset(dest, color, count); |
938 | 647k | } |
939 | | |
940 | | template <class T> static |
941 | | inline void qt_rectfill(T *dest, T value, |
942 | | int x, int y, int width, int height, qsizetype stride) |
943 | 141k | { |
944 | 141k | char *d = reinterpret_cast<char*>(dest + x) + y * stride; |
945 | 141k | if (uint(stride) == (width * sizeof(T))) { |
946 | 141k | qt_memfill(reinterpret_cast<T*>(d), value, qsizetype(width) * height); |
947 | 141k | } else { |
948 | 606k | for (int j = 0; j < height; ++j) { |
949 | 606k | dest = reinterpret_cast<T*>(d); |
950 | 606k | qt_memfill(dest, value, width); |
951 | 606k | d += stride; |
952 | 606k | } |
953 | 394 | } |
954 | 141k | } qimage.cpp:void qt_rectfill<unsigned char>(unsigned char*, unsigned char, int, int, int, int, long long) Line | Count | Source | 943 | 41.2k | { | 944 | 41.2k | char *d = reinterpret_cast<char*>(dest + x) + y * stride; | 945 | 41.2k | if (uint(stride) == (width * sizeof(T))) { | 946 | 40.8k | qt_memfill(reinterpret_cast<T*>(d), value, qsizetype(width) * height); | 947 | 40.8k | } else { | 948 | 606k | for (int j = 0; j < height; ++j) { | 949 | 606k | dest = reinterpret_cast<T*>(d); | 950 | 606k | qt_memfill(dest, value, width); | 951 | 606k | d += stride; | 952 | 606k | } | 953 | 390 | } | 954 | 41.2k | } |
Unexecuted instantiation: qimage.cpp:void qt_rectfill<unsigned short>(unsigned short*, unsigned short, int, int, int, int, long long) Unexecuted instantiation: qimage.cpp:void qt_rectfill<quint24>(quint24*, quint24, int, int, int, int, long long) Unexecuted instantiation: qimage.cpp:void qt_rectfill<unsigned long long>(unsigned long long*, unsigned long long, int, int, int, int, long long) qimage.cpp:void qt_rectfill<unsigned int>(unsigned int*, unsigned int, int, int, int, int, long long) Line | Count | Source | 943 | 100k | { | 944 | 100k | char *d = reinterpret_cast<char*>(dest + x) + y * stride; | 945 | 100k | if (uint(stride) == (width * sizeof(T))) { | 946 | 100k | qt_memfill(reinterpret_cast<T*>(d), value, qsizetype(width) * height); | 947 | 100k | } else { | 948 | 0 | for (int j = 0; j < height; ++j) { | 949 | 0 | dest = reinterpret_cast<T*>(d); | 950 | 0 | qt_memfill(dest, value, width); | 951 | 0 | d += stride; | 952 | 0 | } | 953 | 0 | } | 954 | 100k | } |
Unexecuted instantiation: qimage.cpp:void qt_rectfill<QRgbaFloat<qfloat16> >(QRgbaFloat<qfloat16>*, QRgbaFloat<qfloat16>, int, int, int, int, long long) Unexecuted instantiation: qimage.cpp:void qt_rectfill<QRgbaFloat<float> >(QRgbaFloat<float>*, QRgbaFloat<float>, int, int, int, int, long long) qdrawhelper.cpp:void qt_rectfill<unsigned int>(unsigned int*, unsigned int, int, int, int, int, long long) Line | Count | Source | 943 | 4 | { | 944 | 4 | char *d = reinterpret_cast<char*>(dest + x) + y * stride; | 945 | 4 | if (uint(stride) == (width * sizeof(T))) { | 946 | 0 | qt_memfill(reinterpret_cast<T*>(d), value, qsizetype(width) * height); | 947 | 4 | } else { | 948 | 20 | for (int j = 0; j < height; ++j) { | 949 | 16 | dest = reinterpret_cast<T*>(d); | 950 | 16 | qt_memfill(dest, value, width); | 951 | 16 | d += stride; | 952 | 16 | } | 953 | 4 | } | 954 | 4 | } |
Unexecuted instantiation: qdrawhelper.cpp:void qt_rectfill<unsigned short>(unsigned short*, unsigned short, int, int, int, int, long long) Unexecuted instantiation: qdrawhelper.cpp:void qt_rectfill<quint24>(quint24*, quint24, int, int, int, int, long long) Unexecuted instantiation: qdrawhelper.cpp:void qt_rectfill<unsigned char>(unsigned char*, unsigned char, int, int, int, int, long long) Unexecuted instantiation: qdrawhelper.cpp:void qt_rectfill<unsigned long long>(unsigned long long*, unsigned long long, int, int, int, int, long long) Unexecuted instantiation: qdrawhelper.cpp:void qt_rectfill<QRgbaFloat<float> >(QRgbaFloat<float>*, QRgbaFloat<float>, int, int, int, int, long long) |
955 | | |
956 | | inline ushort qConvertRgb32To16(uint c) |
957 | 0 | { |
958 | 0 | return (((c) >> 3) & 0x001f) |
959 | 0 | | (((c) >> 5) & 0x07e0) |
960 | 0 | | (((c) >> 8) & 0xf800); |
961 | 0 | } |
962 | | |
963 | | inline QRgb qConvertRgb16To32(uint c) |
964 | 0 | { |
965 | 0 | return 0xff000000 |
966 | 0 | | ((((c) << 3) & 0xf8) | (((c) >> 2) & 0x7)) |
967 | 0 | | ((((c) << 5) & 0xfc00) | (((c) >> 1) & 0x300)) |
968 | 0 | | ((((c) << 8) & 0xf80000) | (((c) << 3) & 0x70000)); |
969 | 0 | } |
970 | | |
971 | | const uint qt_bayer_matrix[16][16] = { |
972 | | { 0x1, 0xc0, 0x30, 0xf0, 0xc, 0xcc, 0x3c, 0xfc, |
973 | | 0x3, 0xc3, 0x33, 0xf3, 0xf, 0xcf, 0x3f, 0xff}, |
974 | | { 0x80, 0x40, 0xb0, 0x70, 0x8c, 0x4c, 0xbc, 0x7c, |
975 | | 0x83, 0x43, 0xb3, 0x73, 0x8f, 0x4f, 0xbf, 0x7f}, |
976 | | { 0x20, 0xe0, 0x10, 0xd0, 0x2c, 0xec, 0x1c, 0xdc, |
977 | | 0x23, 0xe3, 0x13, 0xd3, 0x2f, 0xef, 0x1f, 0xdf}, |
978 | | { 0xa0, 0x60, 0x90, 0x50, 0xac, 0x6c, 0x9c, 0x5c, |
979 | | 0xa3, 0x63, 0x93, 0x53, 0xaf, 0x6f, 0x9f, 0x5f}, |
980 | | { 0x8, 0xc8, 0x38, 0xf8, 0x4, 0xc4, 0x34, 0xf4, |
981 | | 0xb, 0xcb, 0x3b, 0xfb, 0x7, 0xc7, 0x37, 0xf7}, |
982 | | { 0x88, 0x48, 0xb8, 0x78, 0x84, 0x44, 0xb4, 0x74, |
983 | | 0x8b, 0x4b, 0xbb, 0x7b, 0x87, 0x47, 0xb7, 0x77}, |
984 | | { 0x28, 0xe8, 0x18, 0xd8, 0x24, 0xe4, 0x14, 0xd4, |
985 | | 0x2b, 0xeb, 0x1b, 0xdb, 0x27, 0xe7, 0x17, 0xd7}, |
986 | | { 0xa8, 0x68, 0x98, 0x58, 0xa4, 0x64, 0x94, 0x54, |
987 | | 0xab, 0x6b, 0x9b, 0x5b, 0xa7, 0x67, 0x97, 0x57}, |
988 | | { 0x2, 0xc2, 0x32, 0xf2, 0xe, 0xce, 0x3e, 0xfe, |
989 | | 0x1, 0xc1, 0x31, 0xf1, 0xd, 0xcd, 0x3d, 0xfd}, |
990 | | { 0x82, 0x42, 0xb2, 0x72, 0x8e, 0x4e, 0xbe, 0x7e, |
991 | | 0x81, 0x41, 0xb1, 0x71, 0x8d, 0x4d, 0xbd, 0x7d}, |
992 | | { 0x22, 0xe2, 0x12, 0xd2, 0x2e, 0xee, 0x1e, 0xde, |
993 | | 0x21, 0xe1, 0x11, 0xd1, 0x2d, 0xed, 0x1d, 0xdd}, |
994 | | { 0xa2, 0x62, 0x92, 0x52, 0xae, 0x6e, 0x9e, 0x5e, |
995 | | 0xa1, 0x61, 0x91, 0x51, 0xad, 0x6d, 0x9d, 0x5d}, |
996 | | { 0xa, 0xca, 0x3a, 0xfa, 0x6, 0xc6, 0x36, 0xf6, |
997 | | 0x9, 0xc9, 0x39, 0xf9, 0x5, 0xc5, 0x35, 0xf5}, |
998 | | { 0x8a, 0x4a, 0xba, 0x7a, 0x86, 0x46, 0xb6, 0x76, |
999 | | 0x89, 0x49, 0xb9, 0x79, 0x85, 0x45, 0xb5, 0x75}, |
1000 | | { 0x2a, 0xea, 0x1a, 0xda, 0x26, 0xe6, 0x16, 0xd6, |
1001 | | 0x29, 0xe9, 0x19, 0xd9, 0x25, 0xe5, 0x15, 0xd5}, |
1002 | | { 0xaa, 0x6a, 0x9a, 0x5a, 0xa6, 0x66, 0x96, 0x56, |
1003 | | 0xa9, 0x69, 0x99, 0x59, 0xa5, 0x65, 0x95, 0x55} |
1004 | | }; |
1005 | | |
1006 | | #define ARGB_COMBINE_ALPHA(argb, alpha) \ |
1007 | | ((((argb >> 24) * alpha) >> 8) << 24) | (argb & 0x00ffffff) |
1008 | | |
1009 | | |
1010 | | #if Q_PROCESSOR_WORDSIZE == 8 // 64-bit versions |
1011 | 0 | #define AMIX(mask) (qMin(((quint64(s)&mask) + (quint64(d)&mask)), quint64(mask))) |
1012 | 0 | #define MIX(mask) (qMin(((quint64(s)&mask) + (quint64(d)&mask)), quint64(mask))) |
1013 | | #else // 32 bits |
1014 | | // The mask for alpha can overflow over 32 bits |
1015 | | #define AMIX(mask) quint32(qMin(((quint64(s)&mask) + (quint64(d)&mask)), quint64(mask))) |
1016 | | #define MIX(mask) (qMin(((quint32(s)&mask) + (quint32(d)&mask)), quint32(mask))) |
1017 | | #endif |
1018 | | |
1019 | | inline uint comp_func_Plus_one_pixel_const_alpha(uint d, const uint s, const uint const_alpha, const uint one_minus_const_alpha) |
1020 | 0 | { |
1021 | 0 | const uint result = uint(AMIX(AMASK) | MIX(RMASK) | MIX(GMASK) | MIX(BMASK)); |
1022 | 0 | return INTERPOLATE_PIXEL_255(result, const_alpha, d, one_minus_const_alpha); |
1023 | 0 | } |
1024 | | |
1025 | | inline uint comp_func_Plus_one_pixel(uint d, const uint s) |
1026 | 0 | { |
1027 | 0 | const uint result = uint(AMIX(AMASK) | MIX(RMASK) | MIX(GMASK) | MIX(BMASK)); |
1028 | 0 | return result; |
1029 | 0 | } |
1030 | | |
1031 | | #undef MIX |
1032 | | #undef AMIX |
1033 | | |
1034 | | // must be multiple of 4 for easier SIMD implementations |
1035 | | static constexpr int BufferSize = 2048; |
1036 | | |
1037 | | // A buffer of intermediate results used by simple bilinear scaling. |
1038 | | struct IntermediateBuffer |
1039 | | { |
1040 | | // The idea is first to do the interpolation between the row s1 and the row s2 |
1041 | | // into this intermediate buffer, then later interpolate between two pixel of this buffer. |
1042 | | // |
1043 | | // buffer_rb is a buffer of red-blue component of the pixel, in the form 0x00RR00BB |
1044 | | // buffer_ag is the alpha-green component of the pixel, in the form 0x00AA00GG |
1045 | | // +1 for the last pixel to interpolate with, and +1 for rounding errors. |
1046 | | quint32 buffer_rb[BufferSize+2]; |
1047 | | quint32 buffer_ag[BufferSize+2]; |
1048 | | }; |
1049 | | |
1050 | | QT_END_NAMESPACE |
1051 | | |
1052 | | #endif // QDRAWHELPER_P_H |