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