10#include <private/qcolortransform_p.h>
11#include <private/qcolortrclut_p.h>
12#include <private/qdrawhelper_p.h>
13#include <private/qdrawhelper_x86_p.h>
14#include <private/qdrawingprimitive_sse2_p.h>
15#include <private/qdrawhelper_neon_p.h>
16#if defined(QT_COMPILER_SUPPORTS_MIPS_DSP) || defined(QT_COMPILER_SUPPORTS_MIPS_DSPR2)
17#include <private/qdrawhelper_mips_dsp_p.h>
19#include <private/qguiapplication_p.h>
20#include <private/qpaintengine_raster_p.h>
21#include <private/qpainter_p.h>
22#include <private/qpixellayout_p.h>
23#include <private/qrgba64_p.h>
28#if QT_CONFIG(thread) && !defined(Q_OS_WASM)
29#define QT_USE_THREAD_PARALLEL_FILLS
32#if defined(QT_USE_THREAD_PARALLEL_FILLS)
35#include <private/qthreadpool_p.h>
42#define MASK(src, a) src = BYTE_MUL(src, a)
51template <QPixelLayout::BPP bpp>
static
54 Q_UNREACHABLE_RETURN(0);
132#if QT_CONFIG(raster_64bit)
205 convertRGBA64PMToRGBA64PM,
206 convertRGBA64ToRGBA64PM,
207 convertRGBA64PMToRGBA64PM,
210 convertRGBA16FPMToRGBA64PM,
211 convertRGBA16FToRGBA64PM,
212 convertRGBA16FPMToRGBA64PM,
213 convertRGBA32FPMToRGBA64PM,
214 convertRGBA32FToRGBA64PM,
215 convertRGBA32FPMToRGBA64PM,
219#if QT_CONFIG(raster_fp)
222 const auto *
in =
reinterpret_cast<const QRgba64 *
>(
src);
231 const auto *
in =
reinterpret_cast<const QRgba64 *
>(
src);
276 convertRGBA64ToRGBA32F,
277 convertRGBA64PMToRGBA32F,
278 convertRGBA64ToRGBA32F,
281 convertRGBA16FToRGBA32F,
282 convertRGBA16FPMToRGBA32F,
283 convertRGBA16FToRGBA32F,
396#if QT_CONFIG(raster_64bit)
454#if QT_CONFIG(raster_fp)
529 dist_0 =
rx*
rx + gx*gx + bx*bx;
534 dist_1 =
rx*
rx + gx*gx + bx*bx;
551 data[
x >> 3] &= ~(0x80 >> (
x & 7));
553 data[
x >> 3] |= 0x80 >> (
x & 7);
555 data[
x >> 3] &= ~(0x80 >> (
x & 7));
557 data[
x >> 3] |= 0x80 >> (
x & 7);
564 data[
x >> 3] |= 0x80 >> (
x & 7);
566 data[
x >> 3] &= ~(0x80 >> (
x & 7));
578 data[
x >> 3] &= ~(1 << (
x & 7));
580 data[
x >> 3] |= 1 << (
x & 7);
582 data[
x >> 3] &= ~(1 << (
x & 7));
584 data[
x >> 3] |= 1 << (
x & 7);
591 data[
x >> 3] |= 1 << (
x & 7);
593 data[
x >> 3] &= ~(1 << (
x & 7));
611 store =
layout->storeFromRGB32;
621 for (
int k = 0; k <
length; ++k) {
642 for (
int k = 0; k <
length; ++k) {
655 for (
int k = 0; k <
length; ++k)
701#if QT_CONFIG(raster_64bit)
722 for (
int k = 0; k <
length; ++k) {
736 for (
int k = 0; k <
length; ++k)
746 for (
int k = 0; k <
length; ++k) {
802#if QT_CONFIG(raster_fp)
805 auto store = qStoreFromRGBA32F[rasterBuffer->
format];
846 const uchar *scanLine =
data->texture.scanLine(
y);
847 return reinterpret_cast<const uint *
>(scanLine) +
x;
860#if QT_CONFIG(raster_64bit)
871 const uchar *scanLine =
data->texture.scanLine(
y);
872 return reinterpret_cast<const QRgba64 *
>(scanLine) +
x;
876#if QT_CONFIG(raster_fp)
880 const auto fetch = qFetchToRGBA32F[
data->texture.format];
885template<TextureBlendType blendType>
890 if (v < 0 || v >= max) {
906 qreal minc = std::min(fx, fy);
907 qreal maxc = std::max(fx, fy);
910 minc = std::min(minc, std::min(fx, fy));
911 maxc = std::max(maxc, std::max(fx, fy));
913 return minc >= std::numeric_limits<int>::min() && maxc <= std::numeric_limits<int>::max();
916template<TextureBlendType blendType, QPixelLayout::BPP bpp,
typename T>
938 int fx = int((
data->m21 * cy
940 int fy = int((
data->m22 * cy
945 fetchTransformed_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1, py);
956 for (;
i < fastLen; ++
i) {
959 fetchTransformed_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1);
962 if constexpr (useFetch)
969 for (;
i < fastLen; ++
i) {
971 if constexpr (useFetch)
974 buffer[
i] =
reinterpret_cast<const T*
>(
src)[px];
981 fetchTransformed_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1, px);
982 if constexpr (useFetch)
985 buffer[
i] =
reinterpret_cast<const T*
>(
src)[px];
1001 for (;
i < fastLen; ++
i) {
1002 int x1 = (fx >> 16);
1003 int y1 = (fy >> 16);
1006 fetchTransformed_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1);
1007 fetchTransformed_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1);
1010 if constexpr (useFetch)
1018 for (;
i < fastLen; ++
i) {
1019 int px = (fx >> 16);
1020 int py = (fy >> 16);
1021 if constexpr (useFetch)
1024 buffer[
i] =
reinterpret_cast<const T*
>(
image.scanLine(py))[px];
1031 int px = (fx >> 16);
1032 int py = (fy >> 16);
1033 fetchTransformed_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1, px);
1034 fetchTransformed_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1, py);
1035 if constexpr (useFetch)
1038 buffer[
i] =
reinterpret_cast<const T*
>(
image.scanLine(py))[px];
1055 const qreal iw = fw == 0 ? 1 : 1 / fw;
1056 const qreal tx = fx * iw;
1061 fetchTransformed_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1, py);
1062 fetchTransformed_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1, px);
1063 if constexpr (useFetch)
1064 *
b = fetch1(
image.scanLine(py), px);
1066 *
b =
reinterpret_cast<const T*
>(
image.scanLine(py))[px];
1080template<TextureBlendType blendType, QPixelLayout::BPP bpp>
1091#if QT_CONFIG(raster_64bit)
1092template<TextureBlendType blendType>
1101 fetchTransformed_fetcher<blendType, QPixelLayout::BPP32, uint>(buffer32,
data,
y,
x,
length);
1103 fetchTransformed_fetcher<blendType, QPixelLayout::BPPNone, uint>(buffer32,
data,
y,
x,
length);
1107 fetchTransformed_fetcher<blendType, QPixelLayout::BPP64, quint64>(
reinterpret_cast<quint64*
>(
buffer),
data,
y,
x,
length);
1108 if (
auto convert = convert64ToRGBA64PM[
data->texture.format])
1114#if QT_CONFIG(raster_fp)
1115template<TextureBlendType blendType>
1124 fetchTransformed_fetcher<blendType, QPixelLayout::BPP32, uint>(buffer32,
data,
y,
x,
length);
1126 fetchTransformed_fetcher<blendType, QPixelLayout::BPPNone, uint>(buffer32,
data,
y,
x,
length);
1127 qConvertToRGBA32F[
data->texture.format](
buffer, buffer32,
length,
data->texture.colorTable,
nullptr);
1130 fetchTransformed_fetcher<blendType, QPixelLayout::BPP64, quint64>(buffer64,
data,
y,
x,
length);
1133 fetchTransformed_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgbaFloat32>(
buffer,
data,
y,
x,
length);
1148 uint distxy = distx * disty;
1151 uint tlrb = (tl & 0x00ff00ff) * (16*16 - 16*distx - 16*disty + distxy);
1152 uint tlag = ((tl & 0xff00ff00) >> 8) * (16*16 - 16*distx - 16*disty + distxy);
1153 uint trrb = ((
tr & 0x00ff00ff) * (distx*16 - distxy));
1154 uint trag = (((
tr & 0xff00ff00) >> 8) * (distx*16 - distxy));
1155 uint blrb = ((bl & 0x00ff00ff) * (disty*16 - distxy));
1156 uint blag = (((bl & 0xff00ff00) >> 8) * (disty*16 - distxy));
1157 uint brrb = ((br & 0x00ff00ff) * (distxy));
1158 uint brag = (((br & 0xff00ff00) >> 8) * (distxy));
1159 return (((tlrb + trrb + blrb + brrb) >> 8) & 0x00ff00ff) | ((tlag + trag + blag + brag) & 0xff00ff00);
1162#if defined(__SSE2__)
1163#define interpolate_4_pixels_16_sse2(tl, tr, bl, br, distx, disty, colorMask, v_256, b) \
1165 const __m128i dxdy = _mm_mullo_epi16 (distx, disty); \
1166 const __m128i distx_ = _mm_slli_epi16(distx, 4); \
1167 const __m128i disty_ = _mm_slli_epi16(disty, 4); \
1168 const __m128i idxidy = _mm_add_epi16(dxdy, _mm_sub_epi16(v_256, _mm_add_epi16(distx_, disty_))); \
1169 const __m128i dxidy = _mm_sub_epi16(distx_, dxdy); \
1170 const __m128i idxdy = _mm_sub_epi16(disty_, dxdy); \
1172 __m128i tlAG = _mm_srli_epi16(tl, 8); \
1173 __m128i tlRB = _mm_and_si128(tl, colorMask); \
1174 __m128i trAG = _mm_srli_epi16(tr, 8); \
1175 __m128i trRB = _mm_and_si128(tr, colorMask); \
1176 __m128i blAG = _mm_srli_epi16(bl, 8); \
1177 __m128i blRB = _mm_and_si128(bl, colorMask); \
1178 __m128i brAG = _mm_srli_epi16(br, 8); \
1179 __m128i brRB = _mm_and_si128(br, colorMask); \
1181 tlAG = _mm_mullo_epi16(tlAG, idxidy); \
1182 tlRB = _mm_mullo_epi16(tlRB, idxidy); \
1183 trAG = _mm_mullo_epi16(trAG, dxidy); \
1184 trRB = _mm_mullo_epi16(trRB, dxidy); \
1185 blAG = _mm_mullo_epi16(blAG, idxdy); \
1186 blRB = _mm_mullo_epi16(blRB, idxdy); \
1187 brAG = _mm_mullo_epi16(brAG, dxdy); \
1188 brRB = _mm_mullo_epi16(brRB, dxdy); \
1191 __m128i rAG =_mm_add_epi16(_mm_add_epi16(tlAG, trAG), _mm_add_epi16(blAG, brAG)); \
1192 __m128i rRB =_mm_add_epi16(_mm_add_epi16(tlRB, trRB), _mm_add_epi16(blRB, brRB)); \
1193 rAG = _mm_andnot_si128(colorMask, rAG); \
1194 rRB = _mm_srli_epi16(rRB, 8); \
1195 _mm_storeu_si128((__m128i*)(b), _mm_or_si128(rAG, rRB)); \
1199#if defined(__ARM_NEON__)
1200#define interpolate_4_pixels_16_neon(tl, tr, bl, br, distx, disty, disty_, colorMask, invColorMask, v_256, b) \
1202 const int16x8_t dxdy = vmulq_s16(distx, disty); \
1203 const int16x8_t distx_ = vshlq_n_s16(distx, 4); \
1204 const int16x8_t idxidy = vaddq_s16(dxdy, vsubq_s16(v_256, vaddq_s16(distx_, disty_))); \
1205 const int16x8_t dxidy = vsubq_s16(distx_, dxdy); \
1206 const int16x8_t idxdy = vsubq_s16(disty_, dxdy); \
1208 int16x8_t tlAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(tl), 8)); \
1209 int16x8_t tlRB = vandq_s16(tl, colorMask); \
1210 int16x8_t trAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(tr), 8)); \
1211 int16x8_t trRB = vandq_s16(tr, colorMask); \
1212 int16x8_t blAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(bl), 8)); \
1213 int16x8_t blRB = vandq_s16(bl, colorMask); \
1214 int16x8_t brAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(br), 8)); \
1215 int16x8_t brRB = vandq_s16(br, colorMask); \
1217 int16x8_t rAG = vmulq_s16(tlAG, idxidy); \
1218 int16x8_t rRB = vmulq_s16(tlRB, idxidy); \
1219 rAG = vmlaq_s16(rAG, trAG, dxidy); \
1220 rRB = vmlaq_s16(rRB, trRB, dxidy); \
1221 rAG = vmlaq_s16(rAG, blAG, idxdy); \
1222 rRB = vmlaq_s16(rRB, blRB, idxdy); \
1223 rAG = vmlaq_s16(rAG, brAG, dxdy); \
1224 rRB = vmlaq_s16(rRB, brRB, dxdy); \
1226 rAG = vandq_s16(invColorMask, rAG); \
1227 rRB = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(rRB), 8)); \
1228 vst1q_s16((int16_t*)(b), vorrq_s16(rAG, rRB)); \
1232template<TextureBlendType blendType>
1274#if defined(QT_COMPILER_SUPPORTS_AVX2)
1277 return intermediate_adder_avx2(
b,
end, intermediate,
offset, fx, fdx);
1284 const int x = (fx >> 16);
1286 const uint distx = (fx & 0x0000ffff) >> 8;
1287 const uint idistx = 256 - distx;
1290 *
b = (rb >> 8) | ag;
1299template<TextureBlendType blendType>
1301 int &fx,
int &fy,
int fdx,
int )
1303 int y1 = (fy >> 16);
1305 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
1309 const int disty = (fy & 0x0000ffff) >> 8;
1310 const int idisty = 256 - disty;
1314 const int adjust = (fdx < 0) ? fdx *
length : 0;
1315 const int offset = (fx + adjust) >> 16;
1335 quint32 rb = (((
t & 0xff00ff) * idisty + (
b & 0xff00ff) * disty) >> 8) & 0xff00ff;
1336 quint32 ag = ((((
t>>8) & 0xff00ff) * idisty + ((
b>>8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
1342 }
while (
x <
image.x1 &&
f < lim);
1347#if defined(__SSE2__)
1348 const __m128i disty_ = _mm_set1_epi16(disty);
1349 const __m128i idisty_ = _mm_set1_epi16(idisty);
1350 const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
1353 for (;
f < lim;
x += 4,
f += 4) {
1355 __m128i
top = _mm_loadu_si128((
const __m128i*)((
const uint *)(
s1)+
x));
1356 __m128i topAG = _mm_srli_epi16(
top, 8);
1357 __m128i topRB = _mm_and_si128(
top, colorMask);
1359 topAG = _mm_mullo_epi16 (topAG, idisty_);
1360 topRB = _mm_mullo_epi16 (topRB, idisty_);
1363 __m128i
bottom = _mm_loadu_si128((
const __m128i*)((
const uint *)(
s2)+
x));
1364 __m128i bottomAG = _mm_srli_epi16(
bottom, 8);
1365 __m128i bottomRB = _mm_and_si128(
bottom, colorMask);
1366 bottomAG = _mm_mullo_epi16 (bottomAG, disty_);
1367 bottomRB = _mm_mullo_epi16 (bottomRB, disty_);
1370 __m128i rAG =_mm_add_epi16(topAG, bottomAG);
1371 rAG = _mm_srli_epi16(rAG, 8);
1372 _mm_storeu_si128((__m128i*)(&intermediate.
buffer_ag[
f]), rAG);
1373 __m128i rRB =_mm_add_epi16(topRB, bottomRB);
1374 rRB = _mm_srli_epi16(rRB, 8);
1375 _mm_storeu_si128((__m128i*)(&intermediate.
buffer_rb[
f]), rRB);
1377#elif defined(__ARM_NEON__)
1378 const int16x8_t disty_ = vdupq_n_s16(disty);
1379 const int16x8_t idisty_ = vdupq_n_s16(idisty);
1380 const int16x8_t colorMask = vdupq_n_s16(0x00ff);
1383 for (;
f < lim;
x += 4,
f += 4) {
1385 int16x8_t
top = vld1q_s16((int16_t*)((
const uint *)(
s1)+
x));
1386 int16x8_t topAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(
top), 8));
1387 int16x8_t topRB = vandq_s16(
top, colorMask);
1389 topAG = vmulq_s16(topAG, idisty_);
1390 topRB = vmulq_s16(topRB, idisty_);
1393 int16x8_t
bottom = vld1q_s16((int16_t*)((
const uint *)(
s2)+
x));
1394 int16x8_t bottomAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(
bottom), 8));
1395 int16x8_t bottomRB = vandq_s16(
bottom, colorMask);
1396 bottomAG = vmulq_s16(bottomAG, disty_);
1397 bottomRB = vmulq_s16(bottomRB, disty_);
1400 int16x8_t rAG = vaddq_s16(topAG, bottomAG);
1401 rAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(rAG), 8));
1402 vst1q_s16((int16_t*)(&intermediate.
buffer_ag[
f]), rAG);
1403 int16x8_t rRB = vaddq_s16(topRB, bottomRB);
1404 rRB = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(rRB), 8));
1405 vst1q_s16((int16_t*)(&intermediate.
buffer_rb[
f]), rRB);
1419 intermediate.
buffer_rb[
f] = (((
t & 0xff00ff) * idisty + (
b & 0xff00ff) * disty) >> 8) & 0xff00ff;
1420 intermediate.
buffer_ag[
f] = ((((
t>>8) & 0xff00ff) * idisty + ((
b>>8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
1428template<TextureBlendType blendType>
1430 int &fx,
int &fy,
int fdx,
int )
1432 int y1 = (fy >> 16);
1434 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
1437 const int disty = (fy & 0x0000ffff) >> 8;
1443 int x1 = (fx >> 16);
1445 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
1456 boundedEnd =
qMin(boundedEnd,
b + (max_fx - fx) / fdx);
1458 boundedEnd =
qMin(boundedEnd,
b + (min_fx - fx) / fdx);
1461 while (
b < boundedEnd) {
1463 int distx = (fx & 0x0000ffff) >> 8;
1471 int x1 = (fx >> 16);
1473 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1 ,
x1,
x2);
1478 int distx = (fx & 0x0000ffff) >> 8;
1486template<TextureBlendType blendType>
1488 int &fx,
int &fy,
int fdx,
int )
1490 int y1 = (fy >> 16);
1492 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
1495 const int disty8 = (fy & 0x0000ffff) >> 8;
1496 const int disty4 = (disty8 + 0x08) >> 4;
1502 int x1 = (fx >> 16);
1504 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
1515 boundedEnd =
qMin(boundedEnd,
b + (max_fx - fx) / fdx);
1517 boundedEnd =
qMin(boundedEnd,
b + (min_fx - fx) / fdx);
1519#if defined(__SSE2__)
1520 const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
1521 const __m128i v_256 = _mm_set1_epi16(256);
1522 const __m128i v_disty = _mm_set1_epi16(disty4);
1523 const __m128i v_fdx = _mm_set1_epi32(fdx*4);
1524 const __m128i v_fx_r = _mm_set1_epi32(0x8);
1525 __m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx);
1527 while (
b < boundedEnd - 3) {
1528 __m128i
offset = _mm_srli_epi32(v_fx, 16);
1532 const int offset3 = _mm_cvtsi128_si32(
offset);
1533 const __m128i tl = _mm_setr_epi32(
s1[offset0],
s1[offset1],
s1[offset2],
s1[offset3]);
1534 const __m128i
tr = _mm_setr_epi32(
s1[offset0 + 1],
s1[offset1 + 1],
s1[offset2 + 1],
s1[offset3 + 1]);
1535 const __m128i bl = _mm_setr_epi32(
s2[offset0],
s2[offset1],
s2[offset2],
s2[offset3]);
1536 const __m128i br = _mm_setr_epi32(
s2[offset0 + 1],
s2[offset1 + 1],
s2[offset2 + 1],
s2[offset3 + 1]);
1538 __m128i v_distx = _mm_srli_epi16(v_fx, 8);
1539 v_distx = _mm_srli_epi16(_mm_add_epi32(v_distx, v_fx_r), 4);
1540 v_distx = _mm_shufflehi_epi16(v_distx, _MM_SHUFFLE(2,2,0,0));
1541 v_distx = _mm_shufflelo_epi16(v_distx, _MM_SHUFFLE(2,2,0,0));
1543 interpolate_4_pixels_16_sse2(tl,
tr, bl, br, v_distx, v_disty, colorMask, v_256,
b);
1545 v_fx = _mm_add_epi32(v_fx, v_fdx);
1547 fx = _mm_cvtsi128_si32(v_fx);
1548#elif defined(__ARM_NEON__)
1549 const int16x8_t colorMask = vdupq_n_s16(0x00ff);
1550 const int16x8_t invColorMask = vmvnq_s16(colorMask);
1551 const int16x8_t v_256 = vdupq_n_s16(256);
1552 const int16x8_t v_disty = vdupq_n_s16(disty4);
1553 const int16x8_t v_disty_ = vshlq_n_s16(v_disty, 4);
1554 int32x4_t v_fdx = vdupq_n_s32(fdx*4);
1556 int32x4_t v_fx = vmovq_n_s32(fx);
1557 v_fx = vsetq_lane_s32(fx + fdx, v_fx, 1);
1558 v_fx = vsetq_lane_s32(fx + fdx * 2, v_fx, 2);
1559 v_fx = vsetq_lane_s32(fx + fdx * 3, v_fx, 3);
1561 const int32x4_t v_ffff_mask = vdupq_n_s32(0x0000ffff);
1562 const int32x4_t v_fx_r = vdupq_n_s32(0x0800);
1564 while (
b < boundedEnd - 3) {
1565 uint32x4x2_t v_top, v_bot;
1567 int x1 = (fx >> 16);
1569 v_top = vld2q_lane_u32(
s1 +
x1, v_top, 0);
1570 v_bot = vld2q_lane_u32(
s2 +
x1, v_bot, 0);
1573 v_top = vld2q_lane_u32(
s1 +
x1, v_top, 1);
1574 v_bot = vld2q_lane_u32(
s2 +
x1, v_bot, 1);
1577 v_top = vld2q_lane_u32(
s1 +
x1, v_top, 2);
1578 v_bot = vld2q_lane_u32(
s2 +
x1, v_bot, 2);
1581 v_top = vld2q_lane_u32(
s1 +
x1, v_top, 3);
1582 v_bot = vld2q_lane_u32(
s2 +
x1, v_bot, 3);
1584 int32x4_t v_distx = vshrq_n_s32(vaddq_s32(vandq_s32(v_fx, v_ffff_mask), v_fx_r), 12);
1585 v_distx = vorrq_s32(v_distx, vshlq_n_s32(v_distx, 16));
1587 interpolate_4_pixels_16_neon(
1588 vreinterpretq_s16_u32(v_top.val[0]), vreinterpretq_s16_u32(v_top.val[1]),
1589 vreinterpretq_s16_u32(v_bot.val[0]), vreinterpretq_s16_u32(v_bot.val[1]),
1590 vreinterpretq_s16_s32(v_distx), v_disty, v_disty_,
1591 colorMask, invColorMask, v_256,
b);
1593 v_fx = vaddq_s32(v_fx, v_fdx);
1596 while (
b < boundedEnd) {
1599 int distx8 = (fx & 0x0000ffff) >> 8;
1602 int distx4 = ((fx & 0x0000ffff) + 0x0800) >> 12;
1611 int x1 = (fx >> 16);
1613 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
1619 int distx8 = (fx & 0x0000ffff) >> 8;
1622 int distx4 = ((fx & 0x0000ffff) + 0x0800) >> 12;
1630template<TextureBlendType blendType>
1632 int &fx,
int &fy,
int fdx,
int fdy)
1636 int x1 = (fx >> 16);
1638 int y1 = (fy >> 16);
1641 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
1642 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
1652 int distx = (fx & 0x0000ffff) >> 8;
1653 int disty = (fy & 0x0000ffff) >> 8;
1663template<TextureBlendType blendType>
1665 int &fx,
int &fy,
int fdx,
int fdy)
1675 int x1 = (fx >> 16);
1677 int y1 = (fy >> 16);
1679 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
1680 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
1690 int distx = (fx & 0x0000ffff) >> 8;
1691 int disty = (fy & 0x0000ffff) >> 8;
1694 int distx = ((fx & 0x0000ffff) + 0x0800) >> 12;
1695 int disty = ((fy & 0x0000ffff) + 0x0800) >> 12;
1704 boundedEnd =
qMin(boundedEnd,
b + (max_fx - fx) / fdx);
1706 boundedEnd =
qMin(boundedEnd,
b + (min_fx - fx) / fdx);
1708 boundedEnd =
qMin(boundedEnd,
b + (max_fy - fy) / fdy);
1710 boundedEnd =
qMin(boundedEnd,
b + (min_fy - fy) / fdy);
1713#if defined(__SSE2__)
1714 const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
1715 const __m128i v_256 = _mm_set1_epi16(256);
1716 const __m128i v_fdx = _mm_set1_epi32(fdx*4);
1717 const __m128i v_fdy = _mm_set1_epi32(fdy*4);
1718 const __m128i v_fxy_r = _mm_set1_epi32(0x8);
1719 __m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx);
1720 __m128i v_fy = _mm_setr_epi32(fy, fy + fdy, fy + fdy + fdy, fy + fdy + fdy + fdy);
1724 const __m128i vbpl = _mm_shufflelo_epi16(_mm_cvtsi32_si128(bytesPerLine/4), _MM_SHUFFLE(0, 0, 0, 0));
1726 while (
b < boundedEnd - 3) {
1727 const __m128i vy = _mm_packs_epi32(_mm_srli_epi32(v_fy, 16), _mm_setzero_si128());
1729 __m128i
offset = _mm_unpacklo_epi16(_mm_mullo_epi16(vy, vbpl), _mm_mulhi_epi16(vy, vbpl));
1730 offset = _mm_add_epi32(
offset, _mm_srli_epi32(v_fx, 16));
1734 const int offset3 = _mm_cvtsi128_si32(
offset);
1735 const uint *topData = (
const uint *)(textureData);
1736 const __m128i tl = _mm_setr_epi32(topData[offset0], topData[offset1], topData[offset2], topData[offset3]);
1737 const __m128i
tr = _mm_setr_epi32(topData[offset0 + 1], topData[offset1 + 1], topData[offset2 + 1], topData[offset3 + 1]);
1738 const uint *bottomData = (
const uint *)(textureData + bytesPerLine);
1739 const __m128i bl = _mm_setr_epi32(bottomData[offset0], bottomData[offset1], bottomData[offset2], bottomData[offset3]);
1740 const __m128i br = _mm_setr_epi32(bottomData[offset0 + 1], bottomData[offset1 + 1], bottomData[offset2 + 1], bottomData[offset3 + 1]);
1742 __m128i v_distx = _mm_srli_epi16(v_fx, 8);
1743 __m128i v_disty = _mm_srli_epi16(v_fy, 8);
1744 v_distx = _mm_srli_epi16(_mm_add_epi32(v_distx, v_fxy_r), 4);
1745 v_disty = _mm_srli_epi16(_mm_add_epi32(v_disty, v_fxy_r), 4);
1746 v_distx = _mm_shufflehi_epi16(v_distx, _MM_SHUFFLE(2,2,0,0));
1747 v_distx = _mm_shufflelo_epi16(v_distx, _MM_SHUFFLE(2,2,0,0));
1748 v_disty = _mm_shufflehi_epi16(v_disty, _MM_SHUFFLE(2,2,0,0));
1749 v_disty = _mm_shufflelo_epi16(v_disty, _MM_SHUFFLE(2,2,0,0));
1751 interpolate_4_pixels_16_sse2(tl,
tr, bl, br, v_distx, v_disty, colorMask, v_256,
b);
1753 v_fx = _mm_add_epi32(v_fx, v_fdx);
1754 v_fy = _mm_add_epi32(v_fy, v_fdy);
1756 fx = _mm_cvtsi128_si32(v_fx);
1757 fy = _mm_cvtsi128_si32(v_fy);
1758#elif defined(__ARM_NEON__)
1759 const int16x8_t colorMask = vdupq_n_s16(0x00ff);
1760 const int16x8_t invColorMask = vmvnq_s16(colorMask);
1761 const int16x8_t v_256 = vdupq_n_s16(256);
1762 int32x4_t v_fdx = vdupq_n_s32(fdx * 4);
1763 int32x4_t v_fdy = vdupq_n_s32(fdy * 4);
1768 int32x4_t v_fx = vmovq_n_s32(fx);
1769 int32x4_t v_fy = vmovq_n_s32(fy);
1770 v_fx = vsetq_lane_s32(fx + fdx, v_fx, 1);
1771 v_fy = vsetq_lane_s32(fy + fdy, v_fy, 1);
1772 v_fx = vsetq_lane_s32(fx + fdx * 2, v_fx, 2);
1773 v_fy = vsetq_lane_s32(fy + fdy * 2, v_fy, 2);
1774 v_fx = vsetq_lane_s32(fx + fdx * 3, v_fx, 3);
1775 v_fy = vsetq_lane_s32(fy + fdy * 3, v_fy, 3);
1777 const int32x4_t v_ffff_mask = vdupq_n_s32(0x0000ffff);
1778 const int32x4_t v_round = vdupq_n_s32(0x0800);
1780 while (
b < boundedEnd - 3) {
1781 uint32x4x2_t v_top, v_bot;
1783 int x1 = (fx >> 16);
1784 int y1 = (fy >> 16);
1785 fx += fdx; fy += fdy;
1786 const uchar *sl = textureData + bytesPerLine *
y1;
1787 const uint *
s1 =
reinterpret_cast<const uint *
>(sl);
1788 const uint *
s2 =
reinterpret_cast<const uint *
>(sl + bytesPerLine);
1789 v_top = vld2q_lane_u32(
s1 +
x1, v_top, 0);
1790 v_bot = vld2q_lane_u32(
s2 +
x1, v_bot, 0);
1793 fx += fdx; fy += fdy;
1794 sl = textureData + bytesPerLine *
y1;
1795 s1 =
reinterpret_cast<const uint *
>(sl);
1796 s2 =
reinterpret_cast<const uint *
>(sl + bytesPerLine);
1797 v_top = vld2q_lane_u32(
s1 +
x1, v_top, 1);
1798 v_bot = vld2q_lane_u32(
s2 +
x1, v_bot, 1);
1801 fx += fdx; fy += fdy;
1802 sl = textureData + bytesPerLine *
y1;
1803 s1 =
reinterpret_cast<const uint *
>(sl);
1804 s2 =
reinterpret_cast<const uint *
>(sl + bytesPerLine);
1805 v_top = vld2q_lane_u32(
s1 +
x1, v_top, 2);
1806 v_bot = vld2q_lane_u32(
s2 +
x1, v_bot, 2);
1809 fx += fdx; fy += fdy;
1810 sl = textureData + bytesPerLine *
y1;
1811 s1 =
reinterpret_cast<const uint *
>(sl);
1812 s2 =
reinterpret_cast<const uint *
>(sl + bytesPerLine);
1813 v_top = vld2q_lane_u32(
s1 +
x1, v_top, 3);
1814 v_bot = vld2q_lane_u32(
s2 +
x1, v_bot, 3);
1816 int32x4_t v_distx = vshrq_n_s32(vaddq_s32(vandq_s32(v_fx, v_ffff_mask), v_round), 12);
1817 int32x4_t v_disty = vshrq_n_s32(vaddq_s32(vandq_s32(v_fy, v_ffff_mask), v_round), 12);
1818 v_distx = vorrq_s32(v_distx, vshlq_n_s32(v_distx, 16));
1819 v_disty = vorrq_s32(v_disty, vshlq_n_s32(v_disty, 16));
1820 int16x8_t v_disty_ = vshlq_n_s16(vreinterpretq_s16_s32(v_disty), 4);
1822 interpolate_4_pixels_16_neon(
1823 vreinterpretq_s16_u32(v_top.val[0]), vreinterpretq_s16_u32(v_top.val[1]),
1824 vreinterpretq_s16_u32(v_bot.val[0]), vreinterpretq_s16_u32(v_bot.val[1]),
1825 vreinterpretq_s16_s32(v_distx), vreinterpretq_s16_s32(v_disty),
1826 v_disty_, colorMask, invColorMask, v_256,
b);
1828 v_fx = vaddq_s32(v_fx, v_fdx);
1829 v_fy = vaddq_s32(v_fy, v_fdy);
1832 while (
b < boundedEnd) {
1840 int distx = (fx & 0x0000ffff) >> 8;
1841 int disty = (fy & 0x0000ffff) >> 8;
1844 int distx = ((fx & 0x0000ffff) + 0x0800) >> 12;
1845 int disty = ((fy & 0x0000ffff) + 0x0800) >> 12;
1856 int x1 = (fx >> 16);
1858 int y1 = (fy >> 16);
1861 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
1862 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
1873 int distx = (fx & 0x0000ffff) >> 8;
1874 int disty = (fy & 0x0000ffff) >> 8;
1877 int distx = ((fx & 0x0000ffff) + 0x0800) >> 12;
1878 int disty = ((fy & 0x0000ffff) + 0x0800) >> 12;
1891 fetchTransformedBilinearARGB32PM_simple_scale_helper<BlendTransformedBilinear>,
1892 fetchTransformedBilinearARGB32PM_upscale_helper<BlendTransformedBilinear>,
1893 fetchTransformedBilinearARGB32PM_downscale_helper<BlendTransformedBilinear>,
1894 fetchTransformedBilinearARGB32PM_rotate_helper<BlendTransformedBilinear>,
1895 fetchTransformedBilinearARGB32PM_fast_rotate_helper<BlendTransformedBilinear>
1898 fetchTransformedBilinearARGB32PM_simple_scale_helper<BlendTransformedBilinearTiled>,
1899 fetchTransformedBilinearARGB32PM_upscale_helper<BlendTransformedBilinearTiled>,
1900 fetchTransformedBilinearARGB32PM_downscale_helper<BlendTransformedBilinearTiled>,
1901 fetchTransformedBilinearARGB32PM_rotate_helper<BlendTransformedBilinearTiled>,
1902 fetchTransformedBilinearARGB32PM_fast_rotate_helper<BlendTransformedBilinearTiled>
1906template<TextureBlendType blendType>
1922 int fx = int((
data->m21 * cy
1924 int fy = int((
data->m22 * cy
1968 const qreal iw = fw == 0 ? 1 : 1 / fw;
1972 int x1 = int(px) - (px < 0);
1974 int y1 = int(py) - (py < 0);
1977 int distx = int((px -
x1) * 256);
1978 int disty = int((py -
y1) * 256);
1980 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
1981 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
2007template<TextureBlendType blendType>
2009 int &fx,
int &fy,
int fdx,
int )
2015 int y1 = (fy >> 16);
2017 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
2021 const int disty = (fy & 0x0000ffff) >> 8;
2022 const int idisty = 256 - disty;
2026 const int adjust = (fdx < 0) ? fdx *
length : 0;
2027 const int offset = (fx + adjust) >> 16;
2046 ptr1 = fetch(buf1,
s1,
x, len1, clut,
nullptr);
2047 ptr2 = fetch(buf2,
s2,
x, len1, clut,
nullptr);
2048 for (
int i = 0;
i < len1; ++
i) {
2051 buf1[
i] = (((
t & 0xff00ff) * idisty + (
b & 0xff00ff) * disty) >> 8) & 0xff00ff;
2052 buf2[
i] = ((((
t >> 8) & 0xff00ff) * idisty + ((
b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
2056 ptr1 = fetch(buf1 + len1,
s1, 0, len2, clut,
nullptr);
2057 ptr2 = fetch(buf2 + len1,
s2, 0, len2, clut,
nullptr);
2058 for (
int i = 0;
i < len2; ++
i) {
2061 buf1[
i + len1] = (((
t & 0xff00ff) * idisty + (
b & 0xff00ff) * disty) >> 8) & 0xff00ff;
2062 buf2[
i + len1] = ((((
t >> 8) & 0xff00ff) * idisty + ((
b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
2067 buf1[
i] = buf1[
i -
image.width];
2068 buf2[
i] = buf2[
i -
image.width];
2076 ptr1 = fetch(buf1 + leading,
s1,
start,
len, clut,
nullptr);
2077 ptr2 = fetch(buf2 + leading,
s2,
start,
len, clut,
nullptr);
2079 for (
int i = 0;
i <
len; ++
i) {
2082 buf1[
i + leading] = (((
t & 0xff00ff) * idisty + (
b & 0xff00ff) * disty) >> 8) & 0xff00ff;
2083 buf2[
i + leading] = ((((
t >> 8) & 0xff00ff) * idisty + ((
b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
2086 for (
int i = 0;
i < leading; ++
i) {
2087 buf1[
i] = buf1[leading];
2088 buf2[
i] = buf2[leading];
2091 buf1[
i] = buf1[
i - 1];
2092 buf2[
i] = buf2[
i - 1];
2101template<TextureBlendType blendType, QPixelLayout::BPP bpp,
typename T>
2103 int fx,
int fy,
const int fdx,
const int fdy)
2113 int y1 = (fy >> 16);
2115 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
2121 for (;
i <
len; ++
i) {
2122 int x1 = (fx >> 16);
2124 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
2127 if constexpr (useFetch) {
2128 buf1[
i * 2 + 0] = buf1[
i * 2 + 1] = fetch1(
s1,
x1);
2129 buf2[
i * 2 + 0] = buf2[
i * 2 + 1] = fetch1(
s2,
x1);
2131 buf1[
i * 2 + 0] = buf1[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s1)[
x1];
2132 buf2[
i * 2 + 0] = buf2[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s2)[
x1];
2142 for (;
i < fastLen; ++
i) {
2144 if constexpr (useFetch) {
2145 buf1[
i * 2 + 0] = fetch1(
s1,
x);
2146 buf1[
i * 2 + 1] = fetch1(
s1,
x + 1);
2147 buf2[
i * 2 + 0] = fetch1(
s2,
x);
2148 buf2[
i * 2 + 1] = fetch1(
s2,
x + 1);
2150 buf1[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s1)[
x];
2151 buf1[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s1)[
x + 1];
2152 buf2[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s2)[
x];
2153 buf2[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s2)[
x + 1];
2159 for (;
i <
len; ++
i) {
2160 int x1 = (fx >> 16);
2162 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
2163 if constexpr (useFetch) {
2164 buf1[
i * 2 + 0] = fetch1(
s1,
x1);
2165 buf1[
i * 2 + 1] = fetch1(
s1,
x2);
2166 buf2[
i * 2 + 0] = fetch1(
s2,
x1);
2167 buf2[
i * 2 + 1] = fetch1(
s2,
x2);
2169 buf1[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s1)[
x1];
2170 buf1[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s1)[
x2];
2171 buf2[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s2)[
x1];
2172 buf2[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s2)[
x2];
2179 for (;
i <
len; ++
i) {
2180 int x1 = (fx >> 16);
2182 int y1 = (fy >> 16);
2184 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
2185 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
2190 if constexpr (useFetch) {
2191 buf1[
i * 2 + 0] = fetch1(
s1,
x1);
2192 buf1[
i * 2 + 1] = fetch1(
s1,
x2);
2193 buf2[
i * 2 + 0] = fetch1(
s2,
x1);
2194 buf2[
i * 2 + 1] = fetch1(
s2,
x2);
2196 buf1[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s1)[
x1];
2197 buf1[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s1)[
x2];
2198 buf2[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s2)[
x1];
2199 buf2[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s2)[
x2];
2214 for (;
i < fastLen; ++
i) {
2219 if constexpr (useFetch) {
2220 buf1[
i * 2 + 0] = fetch1(
s1,
x);
2221 buf1[
i * 2 + 1] = fetch1(
s1,
x + 1);
2222 buf2[
i * 2 + 0] = fetch1(
s2,
x);
2223 buf2[
i * 2 + 1] = fetch1(
s2,
x + 1);
2225 buf1[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s1)[
x];
2226 buf1[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s1)[
x + 1];
2227 buf2[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s2)[
x];
2228 buf2[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s2)[
x + 1];
2235 for (;
i <
len; ++
i) {
2236 int x1 = (fx >> 16);
2238 int y1 = (fy >> 16);
2240 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
2241 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
2245 if constexpr (useFetch) {
2246 buf1[
i * 2 + 0] = fetch1(
s1,
x1);
2247 buf1[
i * 2 + 1] = fetch1(
s1,
x2);
2248 buf2[
i * 2 + 0] = fetch1(
s2,
x1);
2249 buf2[
i * 2 + 1] = fetch1(
s2,
x2);
2251 buf1[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s1)[
x1];
2252 buf1[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s1)[
x2];
2253 buf2[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s2)[
x1];
2254 buf2[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s2)[
x2];
2262template<TextureBlendType blendType, QPixelLayout::BPP bpp,
typename T>
2277 for (
int i = 0;
i <
len; ++
i) {
2278 const qreal iw = fw == 0 ? 16384 : 1 / fw;
2287 distxs[
i] =
ushort((px -
x1) * (1<<16));
2288 distys[
i] =
ushort((py -
y1) * (1<<16));
2290 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
2291 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
2295 if constexpr (useFetch) {
2296 buf1[
i * 2 + 0] = fetch1(
s1,
x1);
2297 buf1[
i * 2 + 1] = fetch1(
s1,
x2);
2298 buf2[
i * 2 + 0] = fetch1(
s2,
x1);
2299 buf2[
i * 2 + 1] = fetch1(
s2,
x2);
2301 buf1[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s1)[
x1];
2302 buf1[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s1)[
x2];
2303 buf2[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s2)[
x1];
2304 buf2[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s2)[
x2];
2314template<TextureBlendType blendType, QPixelLayout::BPP bpp>
2338 fetchTransformedBilinear_simple_scale_helper<blendType>(
buffer,
buffer +
length,
data->texture, fx, fy, fdx, fdy);
2341 fetchTransformedBilinear_simple_scale_helper<blendType>(
buffer,
buffer + mid,
data->texture, fx, fy, fdx, fdy);
2343 fetchTransformedBilinear_simple_scale_helper<blendType>(
buffer + mid,
buffer +
length,
data->texture, fx, fy, fdx, fdy);
2345 const auto fetcher = fetchTransformedBilinear_fetcher<blendType,bpp,uint>;
2352 fetcher(buf1, buf2,
len,
data->texture, fx, fy, fdx, 0);
2353 layout->convertToARGB32PM(buf1,
len * 2, clut);
2354 layout->convertToARGB32PM(buf2,
len * 2, clut);
2357 int disty = (fy & 0x0000ffff) >> 8;
2358 for (
int i = 0;
i <
len; ++
i) {
2359 int distx = (fx & 0x0000ffff) >> 8;
2364 int disty = ((fy & 0x0000ffff) + 0x0800) >> 12;
2365 for (
int i = 0;
i <
len; ++
i) {
2366 uint tl = buf1[
i * 2 + 0];
2368 uint bl = buf2[
i * 2 + 0];
2369 uint br = buf2[
i * 2 + 1];
2370 int distx = ((fx & 0x0000ffff) + 0x0800) >> 12;
2380 const auto fetcher = fetchTransformedBilinear_fetcher<blendType,bpp,uint>;
2387 fetcher(buf1, buf2,
len,
data->texture, fx, fy, fdx, fdy);
2388 layout->convertToARGB32PM(buf1,
len * 2, clut);
2389 layout->convertToARGB32PM(buf2,
len * 2, clut);
2393 for (
int i = 0;
i <
len; ++
i) {
2394 int distx = (fx & 0x0000ffff) >> 8;
2395 int disty = (fy & 0x0000ffff) >> 8;
2403 for (
int i = 0;
i <
len; ++
i) {
2404 uint tl = buf1[
i * 2 + 0];
2406 uint bl = buf2[
i * 2 + 0];
2407 uint br = buf2[
i * 2 + 1];
2409 int distx = ((fx & 0x0000ffff) + 0x0800) >> 12;
2410 int disty = ((fy & 0x0000ffff) + 0x0800) >> 12;
2423 const auto fetcher = fetchTransformedBilinear_slow_fetcher<blendType,bpp,uint>;
2442 fetcher(buf1, buf2, distxs, distys,
len,
data->texture, fx, fy, fw, fdx, fdy, fdw);
2444 layout->convertToARGB32PM(buf1,
len * 2, clut);
2445 layout->convertToARGB32PM(buf2,
len * 2, clut);
2447 for (
int i = 0;
i <
len; ++
i) {
2448 const int distx = distxs[
i] >> 8;
2449 const int disty = distys[
i] >> 8;
2461#if QT_CONFIG(raster_64bit)
2462template<TextureBlendType blendType>
2467 const auto *clut =
data->texture.colorTable;
2490 const auto fetcher =
2492 ? fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP32, uint>
2498 const int disty = (fy & 0x0000ffff);
2499#if defined(__SSE2__)
2500 const __m128i vdy = _mm_set1_epi16(disty);
2501 const __m128i vidy = _mm_set1_epi16(0x10000 - disty);
2503 fetcher(sbuf1, sbuf2,
len,
data->texture, fx, fy, fdx, fdy);
2505 convert(buf1, sbuf1,
len * 2, clut,
nullptr);
2507 convert(buf2, sbuf2,
len * 2, clut,
nullptr);
2509 for (
int i = 0;
i <
len; ++
i) {
2510 const int distx = (fx & 0x0000ffff);
2511#if defined(__SSE2__)
2512 __m128i vt = _mm_loadu_si128((
const __m128i*)(buf1 +
i*2));
2514 __m128i vb = _mm_loadu_si128((
const __m128i*)(buf2 +
i*2));
2515 vt = _mm_mulhi_epu16(vt, vidy);
2516 vb = _mm_mulhi_epu16(vb, vdy);
2517 vt = _mm_add_epi16(vt, vb);
2520 const __m128i vdistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(distx), _MM_SHUFFLE(0, 0, 0, 0));
2521 const __m128i vidistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(0x10000 - distx), _MM_SHUFFLE(0, 0, 0, 0));
2522 vt = _mm_mulhi_epu16(vt, _mm_unpacklo_epi64(vidistx, vdistx));
2523 vt = _mm_add_epi16(vt, _mm_srli_si128(vt, 8));
2525 _mm_storel_epi64((__m128i*)(
b+
i), vt);
2538 fetcher(sbuf1, sbuf2,
len,
data->texture, fx, fy, fdx, fdy);
2540 convert(buf1, sbuf1,
len * 2, clut,
nullptr);
2541 convert(buf2, sbuf2,
len * 2, clut,
nullptr);
2543 for (
int i = 0;
i <
len; ++
i) {
2544 const int distx = (fx & 0x0000ffff);
2545 const int disty = (fy & 0x0000ffff);
2556 const auto fetcher =
2558 ? fetchTransformedBilinear_slow_fetcher<blendType, QPixelLayout::BPP32, uint>
2574 fetcher(sbuf1, sbuf2, distxs, distys,
len,
data->texture, fx, fy, fw, fdx, fdy, fdw);
2576 convert(buf1, sbuf1,
len * 2, clut,
nullptr);
2577 convert(buf2, sbuf2,
len * 2, clut,
nullptr);
2579 for (
int i = 0;
i <
len; ++
i) {
2580 const int distx = distxs[
i];
2581 const int disty = distys[
i];
2592template<TextureBlendType blendType>
2596 const auto convert = convert64ToRGBA64PM[
data->texture.format];
2616 const auto fetcher = fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP64, QRgba64>;
2621 int disty = (fy & 0x0000ffff);
2622#if defined(__SSE2__)
2623 const __m128i vdy = _mm_set1_epi16(disty);
2624 const __m128i vidy = _mm_set1_epi16(0x10000 - disty);
2626 fetcher(buf1, buf2,
len,
data->texture, fx, fy, fdx, fdy);
2632 for (
int i = 0;
i <
len; ++
i) {
2633 int distx = (fx & 0x0000ffff);
2634#if defined(__SSE2__)
2635 __m128i vt = _mm_loadu_si128((
const __m128i*)(buf1 +
i*2));
2637 __m128i vb = _mm_loadu_si128((
const __m128i*)(buf2 +
i*2));
2638 vt = _mm_mulhi_epu16(vt, vidy);
2639 vb = _mm_mulhi_epu16(vb, vdy);
2640 vt = _mm_add_epi16(vt, vb);
2643 const __m128i vdistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(distx), _MM_SHUFFLE(0, 0, 0, 0));
2644 const __m128i vidistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(0x10000 - distx), _MM_SHUFFLE(0, 0, 0, 0));
2645 vt = _mm_mulhi_epu16(vt, _mm_unpacklo_epi64(vidistx, vdistx));
2646 vt = _mm_add_epi16(vt, _mm_srli_si128(vt, 8));
2648 _mm_storel_epi64((__m128i*)(
b+
i), vt);
2661 fetcher(buf1, buf2,
len,
data->texture, fx, fy, fdx, fdy);
2666 for (
int i = 0;
i <
len; ++
i) {
2667 int distx = (fx & 0x0000ffff);
2668 int disty = (fy & 0x0000ffff);
2679 const auto fetcher = fetchTransformedBilinear_slow_fetcher<blendType, QPixelLayout::BPP64, QRgba64>;
2694 fetcher(buf1, buf2, distxs, distys,
len,
data->texture, fx, fy, fw, fdx, fdy, fdw);
2699 for (
int i = 0;
i <
len; ++
i) {
2700 const int distx = distxs[
i];
2701 const int disty = distys[
i];
2712template<TextureBlendType blendType>
2717 const auto *clut =
data->texture.colorTable;
2740 const auto fetcher = fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgbaFloat32>;
2742 const bool skipsecond = (fdy == 0) && ((fy & 0x0000ffff) == 0);
2746 fetcher(sbuf1, sbuf2,
len,
data->texture, fx, fy, fdx, fdy);
2752 for (
int i = 0;
i <
len; ++
i) {
2753 const int distx = (fx & 0x0000ffff);
2754 const int disty = (fy & 0x0000ffff);
2764 const auto fetcher = fetchTransformedBilinear_slow_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgbaFloat32>;
2779 fetcher(sbuf1, sbuf2, distxs, distys,
len,
data->texture, fx, fy, fw, fdx, fdy, fdw);
2784 for (
int i = 0;
i <
len; ++
i) {
2785 const int distx = distxs[
i];
2786 const int disty = distys[
i];
2797template<TextureBlendType blendType>
2813#if QT_CONFIG(raster_fp)
2818 for (
int i = 0;
i <
len; ++
i) {
2819 const int distx = (fx & 0x0000ffff);
2820 const int disty = (fy & 0x0000ffff);
2821 b[
i] = interpolate_4_pixels_rgba32f(buf1 +
i*2, buf2 +
i*2, distx, disty);
2828 unsigned short *distxs,
2829 unsigned short *distys)
2831 for (
int i = 0;
i <
len; ++
i) {
2832 const int dx = distxs[
i];
2833 const int dy = distys[
i];
2834 b[
i] = interpolate_4_pixels_rgba32f(buf1 +
i*2, buf2 +
i*2, dx, dy);
2838template<TextureBlendType blendType>
2843 const auto *clut =
data->texture.colorTable;
2844 const auto convert = qConvertToRGBA32F[
data->texture.format];
2866 const auto fetcher =
2868 ? fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP32, uint>
2871 const bool skipsecond = (fdy == 0) && ((fy & 0x0000ffff) == 0);
2874 fetcher(sbuf1, sbuf2,
len,
data->texture, fx, fy, fdx, fdy);
2876 convert(buf1, sbuf1,
len * 2, clut,
nullptr);
2878 convert(buf2, sbuf2,
len * 2, clut,
nullptr);
2880 interpolate_simple_rgba32f(
b, buf1, buf2,
len, fx, fdx, fy, fdy);
2886 const auto fetcher =
2888 ? fetchTransformedBilinear_slow_fetcher<blendType, QPixelLayout::BPP32, uint>
2902 fetcher(sbuf1, sbuf2, distxs, distys,
len,
data->texture, fx, fy, fw, fdx, fdy, fdw);
2904 convert(buf1, sbuf1,
len * 2, clut,
nullptr);
2905 convert(buf2, sbuf2,
len * 2, clut,
nullptr);
2907 interpolate_perspective_rgba32f(
b, buf1, buf2,
len, distxs, distys);
2916template<TextureBlendType blendType>
2920 const auto convert = convert64ToRGBA32F[
data->texture.format];
2941 const auto fetcher = fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP64, quint64>;
2943 const bool skipsecond = (fdy == 0) && ((fy & 0x0000ffff) == 0);
2946 fetcher(sbuf1, sbuf2,
len,
data->texture, fx, fy, fdx, fdy);
2952 interpolate_simple_rgba32f(
b, buf1, buf2,
len, fx, fdx, fy, fdy);
2958 const auto fetcher = fetchTransformedBilinear_slow_fetcher<blendType, QPixelLayout::BPP64, quint64>;
2973 fetcher(sbuf1, sbuf2, distxs, distys,
len,
data->texture, fx, fy, fw, fdx, fdy, fdw);
2978 interpolate_perspective_rgba32f(
b, buf1, buf2,
len, distxs, distys);
2987template<TextureBlendType blendType>
2992 : convertRGBA32FToRGBA32F;
3011 const auto fetcher = fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgbaFloat32>;
3013 const bool skipsecond = (fdy == 0) && ((fy & 0x0000ffff) == 0);
3016 fetcher(buf1, buf2,
len,
data->texture, fx, fy, fdx, fdy);
3022 interpolate_simple_rgba32f(
b, buf1, buf2,
len, fx, fdx, fy, fdy);
3028 const auto fetcher = fetchTransformedBilinear_slow_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgbaFloat32>;
3043 fetcher(buf1, buf2, distxs, distys,
len,
data->texture, fx, fy, fw, fdx, fdy, fdw);
3048 interpolate_perspective_rgba32f(
b, buf1, buf2,
len, distxs, distys);
3057template<TextureBlendType blendType>
3116 fetchTransformed<BlendTransformed, QPixelLayout::BPPNone>,
3117 fetchTransformed<BlendTransformedTiled, QPixelLayout::BPPNone>,
3118 fetchTransformedBilinear<BlendTransformedBilinear, QPixelLayout::BPPNone>,
3119 fetchTransformedBilinear<BlendTransformedBilinearTiled, QPixelLayout::BPPNone>
3125 fetchTransformed<BlendTransformed, QPixelLayout::BPP32>,
3126 fetchTransformed<BlendTransformedTiled, QPixelLayout::BPP32>,
3127 fetchTransformedBilinearARGB32PM<BlendTransformedBilinear>,
3128 fetchTransformedBilinearARGB32PM<BlendTransformedBilinearTiled>
3134 fetchTransformed<BlendTransformed, QPixelLayout::BPP16>,
3135 fetchTransformed<BlendTransformedTiled, QPixelLayout::BPP16>,
3136 fetchTransformedBilinear<BlendTransformedBilinear, QPixelLayout::BPP16>,
3137 fetchTransformedBilinear<BlendTransformedBilinearTiled, QPixelLayout::BPP16>
3143 fetchTransformed<BlendTransformed, QPixelLayout::BPP32>,
3144 fetchTransformed<BlendTransformedTiled, QPixelLayout::BPP32>,
3145 fetchTransformedBilinear<BlendTransformedBilinear, QPixelLayout::BPP32>,
3146 fetchTransformedBilinear<BlendTransformedBilinearTiled, QPixelLayout::BPP32>
3162#if QT_CONFIG(raster_64bit)
3164 fetchUntransformed64,
3165 fetchUntransformed64,
3166 fetchTransformed64<BlendTransformed>,
3167 fetchTransformed64<BlendTransformedTiled>,
3168 fetchTransformedBilinear64<BlendTransformedBilinear>,
3169 fetchTransformedBilinear64<BlendTransformedBilinearTiled>
3173 fetchUntransformedRGBA64PM,
3174 fetchUntransformedRGBA64PM,
3175 fetchTransformed64<BlendTransformed>,
3176 fetchTransformed64<BlendTransformedTiled>,
3177 fetchTransformedBilinear64<BlendTransformedBilinear>,
3178 fetchTransformedBilinear64<BlendTransformedBilinearTiled>
3184 return sourceFetchRGBA64PM[blendType];
3185 return sourceFetchGeneric64[blendType];
3189#if QT_CONFIG(raster_fp)
3191 fetchUntransformedFP,
3192 fetchUntransformedFP,
3193 fetchTransformedFP<BlendTransformed>,
3194 fetchTransformedFP<BlendTransformedTiled>,
3195 fetchTransformedBilinearFP<BlendTransformedBilinear>,
3196 fetchTransformedBilinearFP<BlendTransformedBilinearTiled>
3201 return sourceFetchGenericFP[blendType];
3206#define FIXPT_SIZE (1<<FIXPT_BITS)
3207#define FIXPT_MAX (INT_MAX >> (FIXPT_BITS + 1))
3215#if QT_CONFIG(raster_64bit)
3223#if QT_CONFIG(raster_fp)
3241 v->dx =
data->gradient.linear.end.x -
data->gradient.linear.origin.x;
3242 v->dy =
data->gradient.linear.end.y -
data->gradient.linear.origin.y;
3243 v->l =
v->dx *
v->dx +
v->dy *
v->dy;
3248 v->off = -
v->dx *
data->gradient.linear.origin.x -
v->dy *
data->gradient.linear.origin.y;
3271#if QT_CONFIG(raster_64bit)
3279 return qt_gradient_pixel64(&gradient,
v);
3283 return qt_gradient_pixel64_fixed(&gradient,
v);
3292#if QT_CONFIG(raster_fp)
3300 return qt_gradient_pixelFP(&gradient,
v);
3304 return qt_gradient_pixelFP_fixed(&gradient,
v);
3315template<
class GradientBase,
typename BlendType>
3353 *
buffer = GradientBase::fetchSingle(
data->gradient, t_fixed);
3354 t_fixed += inc_fixed;
3373 *
buffer = GradientBase::fetchSingle(
data->gradient,
t);
3390 return qt_fetch_linear_gradient_template<GradientBase32, uint>(
buffer, op,
data,
y,
x,
length);
3393#if QT_CONFIG(raster_64bit)
3397 return qt_fetch_linear_gradient_template<GradientBase64, QRgba64>(
buffer, op,
data,
y,
x,
length);
3400#if QT_CONFIG(raster_fp)
3404 return qt_fetch_linear_gradient_template<GradientBaseFP, QRgbaFloat32>(
buffer, op,
data,
y,
x,
length);
3410 v->dx =
data->gradient.radial.center.x -
data->gradient.radial.focal.x;
3411 v->dy =
data->gradient.radial.center.y -
data->gradient.radial.focal.y;
3413 v->dr =
data->gradient.radial.center.radius -
data->gradient.radial.focal.radius;
3414 v->sqrfr =
data->gradient.radial.focal.radius *
data->gradient.radial.focal.radius;
3416 v->a =
v->dr *
v->dr -
v->dx*
v->dx -
v->dy*
v->dy;
3417 v->inv2a = 1 / (2 *
v->a);
3422template <
class GradientBase>
3436 if (
data->gradient.radial.focal.radius + op->
radial.
dr *
w >= 0)
3437 result = GradientBase::fetchSingle(
data->gradient,
w);
3443 delta_det += delta_delta_det;
3453 delta_det += delta_delta_det;
3463 return qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase32>,
uint>(
buffer, op,
data,
y,
x,
length);
3468#if QT_CONFIG(raster_64bit)
3476#if QT_CONFIG(raster_fp)
3484template <
class GradientBase,
typename BlendType>
3494 bool affine = !
data->m13 && !
data->m23;
3500 rx -=
data->gradient.conical.center.x;
3501 ry -=
data->gradient.conical.center.y;
3505 *
buffer = GradientBase::fetchSingle(
data->gradient, 1 -
angle * inv2pi);
3518 rx/rw -
data->gradient.conical.center.y)
3519 +
data->gradient.conical.angle;
3521 *
buffer = GradientBase::fetchSingle(
data->gradient, 1 -
angle * inv2pi);
3538 return qt_fetch_conical_gradient_template<GradientBase32, uint>(
buffer,
data,
y,
x,
length);
3541#if QT_CONFIG(raster_64bit)
3545 return qt_fetch_conical_gradient_template<GradientBase64, QRgba64>(
buffer,
data,
y,
x,
length);
3549#if QT_CONFIG(raster_fp)
3553 return qt_fetch_conical_gradient_template<GradientBaseFP, QRgbaFloat32>(
buffer,
data,
y,
x,
length);
3562#if QT_CONFIG(raster_64bit)
3565#if QT_CONFIG(raster_fp)
3574#if QT_CONFIG(raster_64bit)
3577#if QT_CONFIG(raster_fp)
3591 else if (
data->bilinear)
3607 bool solidSource =
false;
3609 switch(
data->type) {
3611 solidSource =
data->solidColor.alphaF() >= 1.0f;
3617 solidSource = !
data->gradient.alphaColor;
3620#if QT_CONFIG(raster_64bit)
3621 op.
srcFetch64 = qt_fetch_linear_gradient_rgb64;
3623#if QT_CONFIG(raster_fp)
3624 op.
srcFetchFP = qt_fetch_linear_gradient_rgbfp;
3628 solidSource = !
data->gradient.alphaColor;
3631#if QT_CONFIG(raster_64bit)
3632 op.
srcFetch64 = qt_fetch_radial_gradient_rgb64;
3634#if QT_CONFIG(raster_fp)
3635 op.
srcFetchFP = qt_fetch_radial_gradient_rgbfp;
3639 solidSource = !
data->gradient.alphaColor;
3641#if QT_CONFIG(raster_64bit)
3642 op.
srcFetch64 = qt_fetch_conical_gradient_rgb64;
3644#if QT_CONFIG(raster_fp)
3645 op.
srcFetchFP = qt_fetch_conical_gradient_rgbfp;
3649 solidSource = !
data->texture.hasAlpha;
3651#if QT_CONFIG(raster_64bit)
3654#if QT_CONFIG(raster_fp)
3662#if !QT_CONFIG(raster_64bit)
3665#if !QT_CONFIG(raster_fp)
3669 op.
mode =
data->rasterBuffer->compositionMode;
3674#if QT_CONFIG(raster_64bit)
3679#if QT_CONFIG(raster_fp)
3686 const QT_FT_Span *lastSpan = spans + spanCount;
3687 bool alphaSpans =
false;
3688 while (spans < lastSpan) {
3695 if (!alphaSpans && spanCount > 0) {
3700#if QT_CONFIG(raster_64bit)
3704#if QT_CONFIG(raster_fp)
3714#if QT_CONFIG(raster_64bit)
3723#if QT_CONFIG(raster_fp)
3767 memset(dest + 1, dest[0],
length - 1);
3778#if defined(QT_USE_THREAD_PARALLEL_FILLS)
3779#define QT_THREAD_PARALLEL_FILLS(function) \
3780 const int segments = (count + 32) / 64; \
3781 QThreadPool *threadPool = QThreadPoolPrivate::qtGuiInstance(); \
3782 if (segments > 1 && threadPool && !threadPool->contains(QThread::currentThread())) { \
3783 QSemaphore semaphore; \
3785 for (int i = 0; i < segments; ++i) { \
3786 int cn = (count - c) / (segments - i); \
3787 threadPool->start([&, c, cn]() { \
3788 function(c, c + cn); \
3789 semaphore.release(1); \
3793 semaphore.acquire(segments); \
3797#define QT_THREAD_PARALLEL_FILLS(function) function(0, count)
3808 auto function = [=] (
int cStart,
int cEnd) {
3810 for (
int c = cStart;
c < cEnd; ++
c) {
3848 }
else if (spans->
len > 16) {
3853 int ialpha = 255 - spans->
coverage;
3854 for (
int i = 0;
i < spans->
len; ++
i)
3862 auto function = [=] (
int cStart,
int cEnd) {
3863 for (
int c = cStart;
c < cEnd; ++
c) {
3873#if QT_CONFIG(raster_64bit)
3877 qCDebug(lcQtGuiDrawHelper,
"blend_color_generic_rgb64: unsupported 64bit blend attempted, falling back to 32-bit");
3885 auto function = [=, &op] (
int cStart,
int cEnd)
3888 for (
int c = cStart;
c < cEnd; ++
c) {
3917#if QT_CONFIG(raster_fp)
3921 qCDebug(lcQtGuiDrawHelper,
"blend_color_generic_fp: unsupported 4xF16 blend attempted, falling back to 32-bit");
3926 data->solidColor.getRgbF(&
r, &
g, &
b, &
a);
3931 auto function = [=, &op] (
int cStart,
int cEnd)
3934 for (
int c = cStart;
c < cEnd; ++
c) {
3961template <
typename T>
3967 auto function = [=, &op] (
int cStart,
int cEnd)
3969 T handler(
data, op);
3971 for (
int c = cStart;
c < cEnd;) {
3972 if (!spans[
c].
len) {
3977 const int y = spans[
c].
y;
3979 const bool fetchDest = !solidSource || spans[
c].
coverage < 255;
3982 for (
int i =
c + 1;
i < cEnd && spans[
i].
y ==
y && spans[
i].
x ==
right && fetchDest == (!solidSource || spans[
i].
coverage < 255); ++
i)
3990 int process_length = l;
3993 const auto *
src = handler.fetch(process_x,
y, process_length, fetchDest);
3996 if (
x == spans[
c].
x)
3997 coverage = (spans[
c].
coverage * const_alpha) >> 8;
4011 handler.store(process_x,
y, process_length);
4056#if QT_CONFIG(raster_64bit)
4057class BlendSrcGenericRGB64 :
public QBlendBase
4070 return op.func64 && op.destFetch64;
4073 const QRgba64 *fetch(
int x,
int y,
int len,
bool fetchDest)
4075 if (fetchDest || op.destFetch64 == destFetchRGB64)
4079 return op.srcFetch64(src_buffer, &op,
data,
y,
x,
len);
4087 void store(
int x,
int y,
int len)
4090 op.destStore64(
data->rasterBuffer,
x,
y, dest,
len);
4095#if QT_CONFIG(raster_fp)
4096class BlendSrcGenericRGBFP :
public QBlendBase
4109 return op.funcFP && op.destFetchFP && op.srcFetchFP;
4114 if (fetchDest || op.destFetchFP == destFetchRGBFP)
4118 return op.srcFetchFP(src_buffer, &op,
data,
y,
x,
len);
4126 void store(
int x,
int y,
int len)
4129 op.destStoreFP(
data->rasterBuffer,
x,
y, dest,
len);
4138 handleSpans<BlendSrcGeneric>(
count, spans,
data, op);
4141#if QT_CONFIG(raster_64bit)
4142static void blend_src_generic_rgb64(
int count,
const QT_FT_Span *spans,
void *userData)
4147 handleSpans<BlendSrcGenericRGB64>(
count, spans,
data, op);
4149 qCDebug(lcQtGuiDrawHelper,
"blend_src_generic_rgb64: unsupported 64-bit blend attempted, falling back to 32-bit");
4150 handleSpans<BlendSrcGeneric>(
count, spans,
data, op);
4155#if QT_CONFIG(raster_fp)
4156static void blend_src_generic_fp(
int count,
const QT_FT_Span *spans,
void *userData)
4161 handleSpans<BlendSrcGenericRGBFP>(
count, spans,
data, op);
4163 qCDebug(lcQtGuiDrawHelper,
"blend_src_generic_fp: unsupported 4xFP blend attempted, falling back to 32-bit");
4164 handleSpans<BlendSrcGeneric>(
count, spans,
data, op);
4175 const int image_width =
data->texture.width;
4176 const int image_height =
data->texture.height;
4177 const int const_alpha =
data->texture.const_alpha;
4182 auto function = [=, &op] (
int cStart,
int cEnd)
4186 for (
int c = cStart;
c < cEnd; ++
c) {
4192 int sy = yoff + spans[
c].
y;
4193 const bool fetchDest = !solidSource || spans[
c].
coverage < 255;
4194 if (sy >= 0 && sy < image_height && sx < image_width) {
4200 if (sx +
length > image_width)
4201 length = image_width - sx;
4203 const int coverage = (spans[
c].
coverage * const_alpha) >> 8;
4208 op.
func(dest,
src, l, coverage);
4222#if QT_CONFIG(raster_64bit)
4223static void blend_untransformed_generic_rgb64(
int count,
const QT_FT_Span *spans,
void *userData)
4229 qCDebug(lcQtGuiDrawHelper,
"blend_untransformed_generic_rgb64: unsupported 64-bit blend attempted, falling back to 32-bit");
4233 const int image_width =
data->texture.width;
4234 const int image_height =
data->texture.height;
4235 const int const_alpha =
data->texture.const_alpha;
4240 auto function = [=, &op] (
int cStart,
int cEnd)
4244 for (
int c = cStart;
c < cEnd; ++
c) {
4250 int sy = yoff + spans[
c].
y;
4251 const bool fetchDest = !solidSource || spans[
c].
coverage < 255;
4252 if (sy >= 0 && sy < image_height && sx < image_width) {
4258 if (sx +
length > image_width)
4259 length = image_width - sx;
4261 const int coverage = (spans[
c].
coverage * const_alpha) >> 8;
4281#if QT_CONFIG(raster_fp)
4282static void blend_untransformed_generic_fp(
int count,
const QT_FT_Span *spans,
void *userData)
4288 qCDebug(lcQtGuiDrawHelper,
"blend_untransformed_generic_rgbaf16: unsupported 4xFP16 blend attempted, falling back to 32-bit");
4292 const int image_width =
data->texture.width;
4293 const int image_height =
data->texture.height;
4298 auto function = [=, &op] (
int cStart,
int cEnd)
4302 for (
int c = cStart;
c < cEnd; ++
c) {
4308 int sy = yoff + spans[
c].
y;
4309 const bool fetchDest = !solidSource || spans[
c].
coverage < 255;
4310 if (sy >= 0 && sy < image_height && sx < image_width) {
4316 if (sx +
length > image_width)
4317 length = image_width - sx;
4319 const int coverage = (spans[
c].
coverage *
data->texture.const_alpha) >> 8;
4350 const int image_width =
data->texture.width;
4351 const int image_height =
data->texture.height;
4352 const int const_alpha =
data->texture.const_alpha;
4356 auto function = [=, &op] (
int cStart,
int cEnd)
4358 for (
int c = cStart;
c < cEnd; ++
c) {
4364 int sy = yoff + spans[
c].
y;
4365 if (sy >= 0 && sy < image_height && sx < image_width) {
4371 if (sx +
length > image_width)
4372 length = image_width - sx;
4374 const int coverage = (spans[
c].
coverage * const_alpha) >> 8;
4388 quint16 t = ((((
x & 0x07e0) *
a) + ((
y & 0x07e0) *
b)) >> 5) & 0x07e0;
4389 t |= ((((
x & 0xf81f) *
a) + ((
y & 0xf81f) *
b)) >> 5) & 0xf81f;
4398 t = ((((
x & 0xf81f07e0) >> 5) *
a) + (((
y & 0xf81f07e0) >> 5) *
b)) & 0xf81f07e0;
4399 t |= ((((
x & 0x07e0f81f) *
a) + ((
y & 0x07e0f81f) *
b)) >> 5) & 0x07e0f81f;
4409 const int dstAlign = ((
quintptr)dest) & 0x3;
4417 int length32 =
length >> 1;
4418 if (length32 && srcAlign == 0) {
4419 while (length32--) {
4449 const int image_width =
data->texture.width;
4450 const int image_height =
data->texture.height;
4454 auto function = [=](
int cStart,
int cEnd)
4456 for (
int c = cStart;
c < cEnd; ++
c) {
4466 int sy = yoff + spans[
c].
y;
4467 if (sy >= 0 && sy < image_height && sx < image_width) {
4473 if (sx +
length > image_width)
4474 length = image_width - sx;
4478 if (coverage == 255) {
4499 const int image_width =
data->texture.width;
4500 const int image_height =
data->texture.height;
4501 const int const_alpha =
data->texture.const_alpha;
4503 int yoff = -
qRound(-
data->dy) % image_height;
4506 xoff += image_width;
4508 yoff += image_height;
4510 auto function = [=, &op](
int cStart,
int cEnd)
4514 for (
int c = cStart;
c < cEnd; ++
c) {
4517 int sx = (xoff + spans[
c].
x) % image_width;
4518 int sy = (spans[
c].
y + yoff) % image_height;
4524 const int coverage = (spans[
c].
coverage * const_alpha) >> 8;
4531 op.
func(dest,
src, l, coverage);
4537 if (sx >= image_width)
4545#if QT_CONFIG(raster_64bit)
4546static void blend_tiled_generic_rgb64(
int count,
const QT_FT_Span *spans,
void *userData)
4552 qCDebug(lcQtGuiDrawHelper,
"blend_tiled_generic_rgb64: unsupported 64-bit blend attempted, falling back to 32-bit");
4556 const int image_width =
data->texture.width;
4557 const int image_height =
data->texture.height;
4559 int yoff = -
qRound(-
data->dy) % image_height;
4562 xoff += image_width;
4564 yoff += image_height;
4575 int sx = (xoff + spans->
x) % image_width;
4576 int sy = (spans->
y + yoff) % image_height;
4583 if (sx > 0 && sl > 0) {
4584 int l =
qMin(image_width - sx, sl);
4590 if (sx >= image_width)
4600 if (sx >= image_width)
4604 uint *dest =
reinterpret_cast<uint *
>(
data->rasterBuffer->scanLine(
y)) +
x - image_width;
4605 for (
int i = image_width;
i <
length; ++
i)
4606 dest[
i] = dest[
i - image_width];
4608 quint64 *dest =
reinterpret_cast<quint64 *
>(
data->rasterBuffer->scanLine(
y)) +
x - image_width;
4609 for (
int i = image_width;
i <
length; ++
i)
4610 dest[
i] = dest[
i - image_width];
4617 auto function = [=, &op](
int cStart,
int cEnd)
4621 for (
int c = cStart;
c < cEnd; ++
c) {
4624 int sx = (xoff + spans[
c].
x) % image_width;
4625 int sy = (spans[
c].
y + yoff) % image_height;
4631 const int coverage = (spans[
c].
coverage *
data->texture.const_alpha) >> 8;
4644 if (sx >= image_width)
4653#if QT_CONFIG(raster_fp)
4654static void blend_tiled_generic_fp(
int count,
const QT_FT_Span *spans,
void *userData)
4660 qCDebug(lcQtGuiDrawHelper,
"blend_tiled_generic_fp: unsupported 4xFP blend attempted, falling back to 32-bit");
4664 const int image_width =
data->texture.width;
4665 const int image_height =
data->texture.height;
4667 int yoff = -
qRound(-
data->dy) % image_height;
4670 xoff += image_width;
4672 yoff += image_height;
4676 auto function = [=, &op](
int cStart,
int cEnd)
4680 for (
int c = cStart;
c < cEnd; ++
c) {
4683 int sx = (xoff + spans[
c].
x) % image_width;
4684 int sy = (spans[
c].
y + yoff) % image_height;
4690 const int coverage = (spans[
c].
coverage *
data->texture.const_alpha) >> 8;
4703 if (sx >= image_width)
4723 const int image_width =
data->texture.width;
4724 const int image_height =
data->texture.height;
4726 int yoff = -
qRound(-
data->dy) % image_height;
4729 xoff += image_width;
4731 yoff += image_height;
4733 const int const_alpha =
data->texture.const_alpha;
4735 auto function = [=] (
int cStart,
int cEnd) {
4736 for (
int c = cStart;
c < cEnd; ++
c) {
4739 int sx = (xoff + spans[
c].
x) % image_width;
4740 int sy = (spans[
c].
y + yoff) % image_height;
4746 const int coverage = (spans[
c].
coverage * const_alpha) >> 8;
4757 if (sx >= image_width)
4778 const int image_width =
data->texture.width;
4779 const int image_height =
data->texture.height;
4781 int yoff = -
qRound(-
data->dy) % image_height;
4784 xoff += image_width;
4786 yoff += image_height;
4788 const int const_alpha =
data->texture.const_alpha;
4789 auto function = [=] (
int cStart,
int cEnd) {
4790 for (
int c = cStart;
c < cEnd; ++
c) {
4797 int sx = (xoff + spans[
c].
x) % image_width;
4798 int sy = (spans[
c].
y + yoff) % image_height;
4804 if (coverage == 255) {
4818 if (sx >= image_width)
4828 int copy_image_width =
qMin(image_width,
int(spans[
c].
len));
4832 while (copy_image_width <
length) {
4833 memcpy(dest,
src, copy_image_width *
sizeof(
quint16));
4834 dest += copy_image_width;
4835 length -= copy_image_width;
4836 copy_image_width *= 2;
4854 if (sx >= image_width)
4892#if QT_CONFIG(raster_64bit)
4894 blend_untransformed_generic_rgb64,
4895 blend_tiled_generic_rgb64,
4896 blend_src_generic_rgb64,
4897 blend_src_generic_rgb64,
4898 blend_src_generic_rgb64,
4899 blend_src_generic_rgb64
4903#if QT_CONFIG(raster_fp)
4905 blend_untransformed_generic_fp,
4906 blend_tiled_generic_fp,
4907 blend_src_generic_fp,
4908 blend_src_generic_fp,
4909 blend_src_generic_fp,
4910 blend_src_generic_fp
4918 switch (
data->rasterBuffer->format) {
4920 Q_UNREACHABLE_RETURN();
4927#if defined(__SSE2__) || defined(__ARM_NEON__) || (Q_PROCESSOR_WORDSIZE == 8)
4939#if !QT_CONFIG(raster_fp)
4947#if QT_CONFIG(raster_64bit)
4948 proc = processTextureSpansGeneric64[blendType];
4951#if QT_CONFIG(raster_fp)
4958 proc = processTextureSpansGenericFP[blendType];
4965 proc(
count, spans, userData);
5008template<ProcessSpans blend_color>
5025#if QT_CONFIG(raster_64bit)
5026 data->solidColor = qt_gradient_pixel64_fixed(&
data->gradient, yinc *
y + off);
5030 blend_color(1, spans, userData);
5038 bool isVerticalGradient =
5041 data->gradient.linear.end.x ==
data->gradient.linear.origin.x;
5042 switch (
data->rasterBuffer->format) {
5047 if (isVerticalGradient)
5050#if defined(__SSE2__) || defined(__ARM_NEON__) || (Q_PROCESSOR_WORDSIZE == 8)
5061#if !QT_CONFIG(raster_fp)
5069#if QT_CONFIG(raster_64bit)
5070 if (isVerticalGradient)
5071 return blend_vertical_gradient<blend_color_generic_rgb64>(
count, spans, userData);
5072 return blend_src_generic_rgb64(
count, spans, userData);
5074#if QT_CONFIG(raster_fp)
5081 if (isVerticalGradient)
5082 return blend_vertical_gradient<blend_color_generic_fp>(
count, spans, userData);
5083 return blend_src_generic_fp(
count, spans, userData);
5086 if (isVerticalGradient)
5087 return blend_vertical_gradient<blend_color_generic>(
count, spans, userData);
5093template <
class DST>
static
5097 int mapWidth,
int mapHeight,
int mapStride)
5099 DST *dest =
reinterpret_cast<DST *
>(rasterBuffer->
scanLine(
y)) +
x;
5100 const int destStride = rasterBuffer->
stride<DST>();
5103 while (--mapHeight >= 0) {
5106 for (
int x = 0;
x < mapWidth;
x += 8) {
5108 for (
int i = 0;
i < 8; ++
i) {
5133 while (--mapHeight >= 0) {
5158 int mapWidth,
int mapHeight,
int mapStride)
5160 qt_bitmapblit_template<quint32>(rasterBuffer,
x,
y,
color.toArgb32(),
5161 map, mapWidth, mapHeight, mapStride);
5167 int mapWidth,
int mapHeight,
int mapStride)
5169 qt_bitmapblit_template<quint32>(rasterBuffer,
x,
y,
ARGB2RGBA(
color.toArgb32()),
5170 map, mapWidth, mapHeight, mapStride);
5173template<QtPixelOrder PixelOrder>
5177 int mapWidth,
int mapHeight,
int mapStride)
5179 qt_bitmapblit_template<quint32>(rasterBuffer,
x,
y, qConvertRgb64ToRgb30<PixelOrder>(
color),
5180 map, mapWidth, mapHeight, mapStride);
5186 int mapWidth,
int mapHeight,
int mapStride)
5188 qt_bitmapblit_template<quint16>(rasterBuffer,
x,
y,
color.toRgb16(),
5189 map, mapWidth, mapHeight, mapStride);
5204 if (coverage == 0) {
5206 }
else if (coverage == 255 || !colorProfile) {
5208 }
else if (*
dst < 0xff000000) {
5211 }
else if (
src >= 0xff000000) {
5223#if QT_CONFIG(raster_64bit)
5231 dstColor = colorProfile->
toLinear(dstColor);
5240 dstColor = colorProfile->
fromLinear(dstColor);
5249 if (coverage == 0) {
5251 }
else if (coverage == 255) {
5253 }
else if (
src.isOpaque()) {
5269 int mapWidth,
int mapHeight,
int mapStride,
5270 const QClipData *clip,
bool useGammaCorrection)
5272 if (
color.isTransparent())
5277 if (useGammaCorrection)
5281 if (colorProfile &&
color.isOpaque())
5282 srcColor = colorProfile->
toLinear(srcColor);
5289 for (
int ly = 0; ly < mapHeight; ++ly) {
5295 for (
int j=0;
j < l; ++
j) {
5296 const int coverage =
map[
j + (
i -
x)];
5297 alphamapblend_generic(coverage, dest,
j, srcColor,
color, colorProfile);
5300 destStore64(rasterBuffer,
i,
y + ly, dest, l);
5319 int start = qMax<int>(
x, clip.
x);
5320 int end = qMin<int>(
x + mapWidth, clip.
x + clip.
len);
5327 const int coverage =
map[xp -
x];
5328 alphamapblend_generic(coverage, dest, xp -
start, srcColor,
color, colorProfile);
5341 int mapWidth,
int mapHeight,
int mapStride,
5342 const QClipData *clip,
bool useGammaCorrection)
5344 if (
color.isTransparent())
5351 if (useGammaCorrection)
5355 if (colorProfile &&
color.isOpaque())
5356 srcColor = colorProfile->
toLinear(srcColor);
5363 for (
int ly = 0; ly < mapHeight; ++ly) {
5369 for (
int j=0;
j < l; ++
j) {
5370 const int coverage =
map[
j + (
i -
x)];
5393 int start = qMax<int>(
x, clip.
x);
5394 int end = qMin<int>(
x + mapWidth, clip.
x + clip.
len);
5401 const int coverage =
map[xp -
x];
5415 if (coverage == 0) {
5417 }
else if (coverage == 255) {
5428 int mapWidth,
int mapHeight,
int mapStride,
5429 const QClipData *clip,
bool useGammaCorrection)
5431 if (useGammaCorrection || !
color.isOpaque()) {
5441 while (--mapHeight >= 0) {
5442 for (
int i = 0;
i < mapWidth; ++
i)
5461 int start = qMax<int>(
x, clip.
x);
5462 int end = qMin<int>(
x + mapWidth, clip.
x + clip.
len);
5475 int mapWidth,
int mapHeight,
int mapStride,
5476 const QClipData *clip,
bool useGammaCorrection)
5481 if (
color.isTransparent())
5486 if (useGammaCorrection)
5490 if (colorProfile &&
color.isOpaque())
5491 srcColor = colorProfile->
toLinear(srcColor);
5495 while (--mapHeight >= 0) {
5496 for (
int i = 0;
i < mapWidth; ++
i) {
5497 const int coverage =
map[
i];
5518 int start = qMax<int>(
x, clip.
x);
5519 int end = qMin<int>(
x + mapWidth, clip.
x + clip.
len);
5522 const int coverage =
map[xp -
x];
5548#if defined(__SSE2__)
5549 __m128i vd = _mm_cvtsi32_si128(
d);
5550 __m128i vs = _mm_cvtsi32_si128(
s);
5551 __m128i va = _mm_cvtsi32_si128(rgbAlpha);
5552 const __m128i vz = _mm_setzero_si128();
5553 vd = _mm_unpacklo_epi8(vd, vz);
5554 vs = _mm_unpacklo_epi8(vs, vz);
5555 va = _mm_unpacklo_epi8(va, vz);
5556 __m128i vb = _mm_xor_si128(_mm_set1_epi16(255), va);
5557 vs = _mm_mullo_epi16(vs, va);
5558 vd = _mm_mullo_epi16(vd, vb);
5559 vd = _mm_add_epi16(vd, vs);
5560 vd = _mm_add_epi16(vd, _mm_srli_epi16(vd, 8));
5561 vd = _mm_add_epi16(vd, _mm_set1_epi16(0x80));
5562 vd = _mm_srli_epi16(vd, 8);
5563 vd = _mm_packus_epi16(vd, vd);
5564 return _mm_cvtsi128_si32(vd);
5566 const int dr =
qRed(
d);
5570 const int sr =
qRed(
s);
5574 const int mr =
qRed(rgbAlpha);
5575 const int mg =
qGreen(rgbAlpha);
5576 const int mb =
qBlue(rgbAlpha);
5578 const int nr =
qt_div_255(sr * mr + dr * (255 - mr));
5579 const int ng =
qt_div_255(sg * mg + dg * (255 - mg));
5582 return 0xff000000 | (nr << 16) | (ng << 8) | nb;
5588 if (coverage == 0xff000000) {
5590 }
else if (coverage == 0xffffffff &&
qAlpha(
src) == 255) {
5592 }
else if (*
dst < 0xff000000) {
5595 }
else if (!colorProfile) {
5613#if QT_CONFIG(raster_64bit)
5621 dst = colorProfile ? colorProfile->
fromLinear(blend) : blend;
5626 if (coverage == 0xff000000) {
5628 }
else if (coverage == 0xffffffff) {
5630 }
else if (!dest[
x].isOpaque()) {
5632 alphamapblend_generic(
qRgbAvg(coverage), dest,
x, srcLinear,
src, colorProfile);
5633 }
else if (
src.isOpaque()) {
5648 const uint *
src,
int mapWidth,
int mapHeight,
int srcStride,
5649 const QClipData *clip,
bool useGammaCorrection)
5651 if (
color.isTransparent())
5656 if (useGammaCorrection)
5660 if (colorProfile &&
color.isOpaque())
5661 srcColor = colorProfile->
toLinear(srcColor);
5668 for (
int ly = 0; ly < mapHeight; ++ly) {
5674 for (
int j=0;
j < l; ++
j) {
5676 alphargbblend_generic(coverage, dest,
j, srcColor,
color, colorProfile);
5679 destStore64(rasterBuffer,
i,
y + ly, dest, l);
5698 int start = qMax<int>(
x, clip.
x);
5699 int end = qMin<int>(
x + mapWidth, clip.
x + clip.
len);
5707 alphargbblend_generic(coverage, dest, xp -
start, srcColor,
color, colorProfile);
5719 const uint *
src,
int mapWidth,
int mapHeight,
int srcStride,
5720 const QClipData *clip,
bool useGammaCorrection)
5722 if (
color.isTransparent())
5729 if (useGammaCorrection)
5733 if (colorProfile &&
color.isOpaque())
5734 srcColor = colorProfile->
toLinear(srcColor);
5741 for (
int ly = 0; ly < mapHeight; ++ly) {
5747 for (
int j=0;
j < l; ++
j) {
5771 int start = qMax<int>(
x, clip.
x);
5772 int end = qMin<int>(
x + mapWidth, clip.
x + clip.
len);
5793 const uint *
src,
int mapWidth,
int mapHeight,
int srcStride,
5794 const QClipData *clip,
bool useGammaCorrection)
5796 if (
color.isTransparent())
5803 if (useGammaCorrection)
5807 if (colorProfile &&
color.isOpaque())
5808 srcColor = colorProfile->
toLinear(srcColor);
5813 while (--mapHeight >= 0) {
5814 for (
int i = 0;
i < mapWidth; ++
i) {
5837 int start = qMax<int>(
x, clip.
x);
5838 int end = qMin<int>(
x + mapWidth, clip.
x + clip.
len);
5855 qt_rectfill<quint32>(
reinterpret_cast<quint32 *
>(rasterBuffer->
buffer()),
5866 layout.storeFromARGB32PM(
reinterpret_cast<uchar *
>(&c16), &c32, 0, 1,
nullptr,
nullptr);
5867 qt_rectfill<quint16>(
reinterpret_cast<quint16 *
>(rasterBuffer->
buffer()),
5878 layout.storeFromARGB32PM(
reinterpret_cast<uchar *
>(&c24), &c32, 0, 1,
nullptr,
nullptr);
5879 qt_rectfill<quint24>(
reinterpret_cast<quint24 *
>(rasterBuffer->
buffer()),
5887 qt_rectfill<quint32>(
reinterpret_cast<quint32 *
>(rasterBuffer->
buffer()),
5895 qt_rectfill<quint32>(
reinterpret_cast<quint32 *
>(rasterBuffer->
buffer()),
5903 qt_rectfill<quint32>(
reinterpret_cast<quint32 *
>(rasterBuffer->
buffer()),
5907template<QtPixelOrder PixelOrder>
5912 qt_rectfill<quint32>(
reinterpret_cast<quint32 *
>(rasterBuffer->
buffer()),
5920 qt_rectfill<quint8>(
reinterpret_cast<quint8 *
>(rasterBuffer->
buffer()),
5928 qt_rectfill<quint8>(
reinterpret_cast<quint8 *
>(rasterBuffer->
buffer()),
5938 store(
reinterpret_cast<uchar *
>(&c64), &
color, 0, 1,
nullptr,
nullptr);
5939 qt_rectfill<quint64>(
reinterpret_cast<quint64 *
>(rasterBuffer->
buffer()),
5949 store(
reinterpret_cast<uchar *
>(&
c), &
color, 0, 1,
nullptr,
nullptr);
5960 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr },
5964 nullptr,
nullptr,
nullptr,
nullptr
5969 nullptr,
nullptr,
nullptr,
nullptr
5974 nullptr,
nullptr,
nullptr,
nullptr
6099 qt_bitmapblit_rgb30<PixelOrderBGR>,
6102 qt_rectfill_rgb30<PixelOrderBGR>
6107 qt_bitmapblit_rgb30<PixelOrderBGR>,
6110 qt_rectfill_rgb30<PixelOrderBGR>
6115 qt_bitmapblit_rgb30<PixelOrderRGB>,
6118 qt_rectfill_rgb30<PixelOrderRGB>
6123 qt_bitmapblit_rgb30<PixelOrderRGB>,
6126 qt_rectfill_rgb30<PixelOrderRGB>
6234#if !defined(Q_PROCESSOR_X86)
6237 qt_memfill_template<quint64>(dest,
color,
count);
6241#if defined(QT_COMPILER_SUPPORTS_SSSE3) && defined(Q_CC_GNU) && !defined(Q_CC_CLANG)
6246# ifdef QT_COMPILER_SUPPORTS_SSSE3
6249 return qt_memfill24_ssse3(dest,
color,
count);
6266 for ( ; dest <= (
end - 4); dest += 4) {
6274 switch (
end - dest) {
6288 const int align =
quintptr(dest) & 0x3;
6301#if defined(Q_PROCESSOR_X86)
6304#elif !defined(__ARM_NEON__) && !defined(__MIPS_DSP__)
6307 qt_memfill_template<quint32>(dest,
color,
count);
6311#ifdef QT_COMPILER_SUPPORTS_SSE4_1
6322#if defined(Q_PROCESSOR_X86) && !defined(__SSE2__)
6325#elif defined(__SSE2__)
6338 extern void qt_scale_image_argb32_on_argb32_sse2(
uchar *destPixels,
int dbpl,
6339 const uchar *srcPixels,
int sbpl,
int srch,
6340 const QRectF &targetRect,
6341 const QRectF &sourceRect,
6349 extern void qt_blend_rgb32_on_rgb32_sse2(
uchar *destPixels,
int dbpl,
6350 const uchar *srcPixels,
int sbpl,
6353 extern void qt_blend_argb32_on_argb32_sse2(
uchar *destPixels,
int dbpl,
6354 const uchar *srcPixels,
int sbpl,
6383#ifdef QT_COMPILER_SUPPORTS_SSSE3
6385 extern void qt_blend_argb32_on_argb32_ssse3(
uchar *destPixels,
int dbpl,
6386 const uchar *srcPixels,
int sbpl,
6403#if defined(QT_COMPILER_SUPPORTS_SSE4_1)
6454#if QT_CONFIG(raster_64bit)
6458#if QT_CONFIG(raster_fp)
6469#if defined(QT_COMPILER_SUPPORTS_AVX2)
6473 extern void qt_blend_rgb32_on_rgb32_avx2(
uchar *destPixels,
int dbpl,
6474 const uchar *srcPixels,
int sbpl,
6475 int w,
int h,
int const_alpha);
6476 extern void qt_blend_argb32_on_argb32_avx2(
uchar *destPixels,
int dbpl,
6477 const uchar *srcPixels,
int sbpl,
6478 int w,
int h,
int const_alpha);
6494#if QT_CONFIG(raster_64bit)
6502#if QT_CONFIG(raster_fp)
6514 int &fx,
int &fy,
int fdx,
int );
6516 int &fx,
int &fy,
int fdx,
int );
6518 int &fx,
int &fy,
int fdx,
int fdy);
6564#if QT_CONFIG(raster_fp)
6578#if defined(__ARM_NEON__)
6583#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
6601#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
6637#if defined(ENABLE_PIXMAN_DRAWHELPERS)
6659#if defined(__MIPS_DSP__)
6694#if defined(__MIPS_DSPR2__)
const uint * fetch(int x, int y, int len, bool fetchDest)
uint src_buffer[BufferSize]
void store(int x, int y, int len)
BlendSrcGeneric(const QSpanData *d, const Operator &o)
void process(int, int, int len, int coverage, const uint *src, int offset)
static Type fetchSingle(const QGradientData &gradient, int v)
static Type fetchSingle(const QGradientData &gradient, qreal v)
static void memfill(Type *buffer, Type fill, int length)
struct QClipData::ClipLine * m_clipLines
QColorTransform transformationToXYZ() const
static const QColorSpacePrivate * get(const QColorSpace &colorSpace)
The QColorSpace class provides a color space abstraction.
bool isValid() const noexcept
Returns true if the color space is valid.
QRgb toLinear(QRgb rgb32) const
QRgb fromLinear(QRgb rgb32) const
QRgb fromLinear64(QRgba64 rgb64) const
QRgba64 toLinear64(QRgb rgb32) const
static QGuiApplicationPrivate * instance()
const QColorTrcLut * colorProfileForA8Text()
const QColorTrcLut * colorProfileForA32Text()
Format
The following image formats are available in Qt.
@ Format_RGBA32FPx4_Premultiplied
@ Format_RGBA64_Premultiplied
@ Format_RGBA8888_Premultiplied
@ Format_ARGB8565_Premultiplied
@ Format_RGBA16FPx4_Premultiplied
@ Format_A2BGR30_Premultiplied
@ Format_ARGB32_Premultiplied
@ Format_A2RGB30_Premultiplied
CompositionMode
Defines the modes supported for digital image compositing.
@ CompositionMode_DestinationAtop
@ CompositionMode_SourceOver
@ CompositionMode_DestinationOut
@ CompositionMode_SourceAtop
@ CompositionMode_DestinationOver
@ CompositionMode_DestinationIn
@ CompositionMode_SourceOut
@ CompositionMode_SourceIn
bool monoDestinationWithClut
QPainter::CompositionMode compositionMode
qsizetype bytesPerLine() const
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr quint16 red() const
constexpr quint16 alpha() const
constexpr QRgba64 unpremultiplied() const
constexpr quint16 green() const
constexpr quint16 blue() const
static constexpr QRgba64 fromRgba64(quint64 c)
constexpr uint toArgb32() const
constexpr bool isOpaque() const
static constexpr QRgba64 fromArgb32(uint rgb)
constexpr bool isTransparent() const
constexpr QRgba64 premultiplied() const
constexpr Q_ALWAYS_INLINE QRgbaFloat premultiplied() const
static constexpr QRgbaFloat fromRgba64(quint16 red, quint16 green, quint16 blue, quint16 alpha)
constexpr uint toArgb32() const
qsizetype count(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static void fetch(BlendType *buffer, BlendType *end, const Operator *op, const QSpanData *data, qreal det, qreal delta_det, qreal delta_delta_det, qreal b, qreal delta_b)
GradientBase::Type BlendType
\keyword 16-bit Floating Point Support\inmodule QtCore \inheaderfile QFloat16
QMap< QString, QString > map
[6]
Combined button and popup list for selecting options.
SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFormats]
SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats]
SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats]
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
void(QT_FASTCALL * BilinearFastTransformHelper)(uint *b, uint *end, const QTextureData &image, int &fx, int &fy, int fdx, int fdy)
static const uint *QT_FASTCALL qt_fetch_linear_gradient(uint *buffer, const Operator *op, const QSpanData *data, int y, int x, int length)
static SourceFetchProc qt_fetch_radial_gradient
CompositionFunctionFP qt_functionForModeFP_C[]
uint QT_FASTCALL fetch1Pixel< QPixelLayout::BPP1MSB >(const uchar *src, int index)
static int qRgbAvg(QRgb rgb)
static void qt_rectfill_quint16(QRasterBuffer *rasterBuffer, int x, int y, int width, int height, const QRgba64 &color)
DrawHelper qDrawHelper[QImage::NImageFormats]
void qt_memfill64(quint64 *dest, quint64 color, qsizetype count)
uint QT_FASTCALL fetch1Pixel< QPixelLayout::BPP24 >(const uchar *src, int index)
static uint interpolate_4_pixels_16(uint tl, uint tr, uint bl, uint br, uint distx, uint disty)
uint QT_FASTCALL fetch1Pixel< QPixelLayout::BPP8 >(const uchar *src, int index)
static uint *QT_FASTCALL destFetchMono(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)
static void alphamapblend_quint16(int coverage, quint16 *dest, int x, const quint16 srcColor)
static uint *QT_FASTCALL destFetchARGB32P(uint *, QRasterBuffer *rasterBuffer, int x, int y, int)
static const uint *QT_FASTCALL fetchUntransformed(uint *buffer, const Operator *, const QSpanData *data, int y, int x, int length)
CompositionFunctionSolid64 qt_functionForModeSolid64_C[]
static void QT_FASTCALL intermediate_adder(uint *b, uint *end, const IntermediateBuffer &intermediate, int offset, int &fx, int fdx)
void qInitBlendFunctions()
static BilinearFastTransformHelper bilinearFastTransformHelperARGB32PM[2][NFastTransformTypes]
static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *, const QSpanData *data, int y, int x, int length)
static uint qt_gradient_pixel_fixed(const QGradientData *data, int fixed_pos)
static const uint *QT_FASTCALL fetchUntransformedRGB16(uint *buffer, const Operator *, const QSpanData *data, int y, int x, int length)
static const BlendType *QT_FASTCALL qt_fetch_linear_gradient_template(BlendType *buffer, const Operator *op, const QSpanData *data, int y, int x, int length)
static void QT_FASTCALL destStoreGray16(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length)
CompositionFunctionSolid qt_functionForModeSolid_C[]
static void qt_rectfill_rgba(QRasterBuffer *rasterBuffer, int x, int y, int width, int height, const QRgba64 &color)
static void blend_color_generic(int count, const QT_FT_Span *spans, void *userData)
static void qt_bitmapblit_quint16(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 &color, const uchar *map, int mapWidth, int mapHeight, int mapStride)
static const ProcessSpans processTextureSpansRGB16[NBlendTypes]
uint QT_FASTCALL fetch1Pixel< QPixelLayout::BPP32FPx4 >(const uchar *src, int index)
uint QT_FASTCALL fetch1Pixel< QPixelLayout::BPP1LSB >(const uchar *src, int index)
static SourceFetchProc sourceFetchAny32[NBlendTypes]
static const BlendType *QT_FASTCALL qt_fetch_conical_gradient_template(BlendType *buffer, const QSpanData *data, int y, int x, int length)
uint QT_FASTCALL fetch1Pixel< QPixelLayout::BPP32 >(const uchar *src, int index)
static void qt_rectfill_quint64(QRasterBuffer *rasterBuffer, int x, int y, int width, int height, const QRgba64 &color)
@ BlendTransformedBilinearTiled
@ BlendTransformedBilinear
static void QT_FASTCALL destStoreMonoLsb(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length)
void qt_memfill32(quint32 *dest, quint32 color, qsizetype count)
static void blend_color_generic_fp(int count, const QT_FT_Span *spans, void *userData)
static void QT_FASTCALL fetchTransformedBilinearARGB32PM_fast_rotate_helper(uint *b, uint *end, const QTextureData &image, int &fx, int &fy, int fdx, int fdy)
static TextureBlendType getBlendType(const QSpanData *data)
void fetchTransformedBilinear_pixelBounds< BlendTransformedBilinear >(int, int l1, int l2, int &v1, int &v2)
void qt_memfill16(quint16 *dest, quint16 value, qsizetype count)
static void qt_bitmapblit_rgb30(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 &color, const uchar *map, int mapWidth, int mapHeight, int mapStride)
static void spanfill_from_first(QRasterBuffer *rasterBuffer, QPixelLayout::BPP bpp, int x, int y, int length)
Q_CONSTRUCTOR_FUNCTION(qInitDrawhelperFunctions)
uint QT_FASTCALL fetch1Pixel< QPixelLayout::BPP16FPx4 >(const uchar *src, int index)
static void qInitDrawhelperFunctions()
static void blend_untransformed_rgb565(int count, const QT_FT_Span *spans, void *userData)
static SourceFetchProc sourceFetchUntransformed[QImage::NImageFormats]
static QRgb rgbBlend(QRgb d, QRgb s, uint rgbAlpha)
static void qt_bitmapblit_rgba8888(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 &color, const uchar *map, int mapWidth, int mapHeight, int mapStride)
static void blend_untransformed_argb(int count, const QT_FT_Span *spans, void *userData)
static const uint *QT_FASTCALL fetchUntransformedARGB32PM(uint *, const Operator *, const QSpanData *data, int y, int x, int)
static SourceFetchProc getSourceFetch(TextureBlendType blendType, QImage::Format format)
static void qt_bitmapblit_argb32(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 &color, const uchar *map, int mapWidth, int mapHeight, int mapStride)
static void grayBlendPixel(quint32 *dst, int coverage, QRgba64 srcLinear, const QColorTrcLut *colorProfile)
static quint16 interpolate_pixel_rgb16_255(quint16 x, quint8 a, quint16 y, quint8 b)
static DestFetchProc destFetchProc[QImage::NImageFormats]
static void alphargbblend_argb32(quint32 *dst, uint coverage, const QRgba64 &srcLinear, quint32 src, const QColorTrcLut *colorProfile)
static void QT_FASTCALL fetchTransformedBilinear_simple_scale_helper(uint *b, uint *end, const QTextureData &image, int &fx, int &fy, int fdx, int)
static void qt_rectfill_nonpremul_argb32(QRasterBuffer *rasterBuffer, int x, int y, int width, int height, const QRgba64 &color)
static bool canUseFastMatrixPath(const qreal cx, const qreal cy, const qsizetype length, const QSpanData *data)
static void qt_alphargbblit_argb32(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 &color, const uint *src, int mapWidth, int mapHeight, int srcStride, const QClipData *clip, bool useGammaCorrection)
static void blend_color_generic_rgb64(int count, const QT_FT_Span *spans, void *userData)
static uint *QT_FASTCALL destFetchUndefined(uint *buffer, QRasterBuffer *, int, int, int)
void fetchTransformed_pixelBounds(int max, int l1, int l2, int &v)
static void qt_rectfill_gray(QRasterBuffer *rasterBuffer, int x, int y, int width, int height, const QRgba64 &color)
static void QT_FASTCALL destStoreMono(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length)
static void qt_alphamapblit_argb32(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 &color, const uchar *map, int mapWidth, int mapHeight, int mapStride, const QClipData *clip, bool useGammaCorrection)
constexpr int fixed_scale
uint QT_FASTCALL fetch1Pixel< QPixelLayout::BPP16 >(const uchar *src, int index)
static const uint *QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, const Operator *, const QSpanData *data, int y, int x, int length)
static Operator getOperator(const QSpanData *data, const QT_FT_Span *spans, int spanCount)
static void qt_rectfill_argb32(QRasterBuffer *rasterBuffer, int x, int y, int width, int height, const QRgba64 &color)
static void qt_rectfill_nonpremul_rgba(QRasterBuffer *rasterBuffer, int x, int y, int width, int height, const QRgba64 &color)
static void QT_FASTCALL fetchTransformed_fetcher(T *buffer, const QSpanData *data, int y, int x, int length)
static void qt_alphamapblit_generic(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 &color, const uchar *map, int mapWidth, int mapHeight, int mapStride, const QClipData *clip, bool useGammaCorrection)
static void blend_color_argb(int count, const QT_FT_Span *spans, void *userData)
static void qt_rectfill_alpha(QRasterBuffer *rasterBuffer, int x, int y, int width, int height, const QRgba64 &color)
static const SourceFetchProc sourceFetchGeneric[NBlendTypes]
static const ProcessSpans processTextureSpansGeneric[NBlendTypes]
static const ProcessSpans processTextureSpansARGB32PM[NBlendTypes]
static void rgbBlendPixel(quint32 *dst, int coverage, QRgba64 slinear, const QColorTrcLut *colorProfile)
uint QT_FASTCALL fetch1Pixel< QPixelLayout::BPP64 >(const uchar *src, int index)
static void QT_FASTCALL fetchTransformedBilinear_fetcher(T *buf1, T *buf2, const int len, const QTextureData &image, int fx, int fy, const int fdx, const int fdy)
static void QT_FASTCALL destStore(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length)
static uint *QT_FASTCALL destFetchMonoLsb(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)
static void QT_FASTCALL getRadialGradientValues(RadialGradientValues *v, const QSpanData *data)
static void blend_tiled_rgb565(int count, const QT_FT_Span *spans, void *userData)
static void qt_rectfill_quint24(QRasterBuffer *rasterBuffer, int x, int y, int width, int height, const QRgba64 &color)
static uint *QT_FASTCALL destFetch(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)
static void QT_FASTCALL fetchTransformedBilinearARGB32PM_rotate_helper(uint *b, uint *end, const QTextureData &image, int &fx, int &fy, int fdx, int fdy)
static const uint *QT_FASTCALL qt_fetch_conical_gradient(uint *buffer, const Operator *, const QSpanData *data, int y, int x, int length)
static void blend_vertical_gradient_argb(int count, const QT_FT_Span *spans, void *userData)
static SourceFetchProc sourceFetchAny16[NBlendTypes]
CompositionFunctionSolidFP qt_functionForModeSolidFP_C[]
uint(QT_FASTCALL * Fetch1PixelFunc)(const uchar *src, int index)
#define QT_THREAD_PARALLEL_FILLS(function)
const uint *QT_FASTCALL qt_fetch_radial_gradient_plain(uint *buffer, const Operator *op, const QSpanData *data, int y, int x, int length)
static void QT_FASTCALL fetchTransformedBilinearARGB32PM_simple_scale_helper(uint *b, uint *end, const QTextureData &image, int &fx, int &fy, int fdx, int)
static void qt_alphargbblit_generic(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 &color, const uint *src, int mapWidth, int mapHeight, int srcStride, const QClipData *clip, bool useGammaCorrection)
static void blend_src_generic(int count, const QT_FT_Span *spans, void *userData)
void fetchTransformedBilinear_pixelBounds(int max, int l1, int l2, int &v1, int &v2)
void fetchTransformedBilinear_pixelBounds< BlendTransformedBilinearTiled >(int max, int, int, int &v1, int &v2)
static const CompositionFunction * functionForMode
static const uint *QT_FASTCALL fetchTransformed(uint *buffer, const Operator *, const QSpanData *data, int y, int x, int length)
static void blend_sourceOver_rgb16_rgb16(quint16 *Q_DECL_RESTRICT dest, const quint16 *Q_DECL_RESTRICT src, int length, const quint8 alpha, const quint8 ialpha)
static uint *QT_FASTCALL destFetchRGB16(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)
static void QT_FASTCALL destStoreGray8(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length)
CompositionFunction qt_functionForMode_C[]
static void blend_untransformed_generic(int count, const QT_FT_Span *spans, void *userData)
static void blend_tiled_argb(int count, const QT_FT_Span *spans, void *userData)
static void QT_FASTCALL fetchTransformedBilinear_slow_fetcher(T *buf1, T *buf2, ushort *distxs, ushort *distys, const int len, const QTextureData &image, qreal &fx, qreal &fy, qreal &fw, const qreal fdx, const qreal fdy, const qreal fdw)
static void blend_vertical_gradient(int count, const QT_FT_Span *spans, void *userData)
static void alphamapblend_argb32(quint32 *dst, int coverage, QRgba64 srcLinear, quint32 src, const QColorTrcLut *colorProfile)
static SourceFetchProc sourceFetchARGB32PM[NBlendTypes]
static void QT_FASTCALL fetchTransformedBilinearARGB32PM_downscale_helper(uint *b, uint *end, const QTextureData &image, int &fx, int &fy, int fdx, int)
static const CompositionFunctionSolid * functionForModeSolid
static void blend_tiled_generic(int count, const QT_FT_Span *spans, void *userData)
static QRgb findNearestColor(QRgb color, QRasterBuffer *rbuf)
static void qt_rectfill_fp32x4(QRasterBuffer *rasterBuffer, int x, int y, int width, int height, const QRgba64 &color)
void qBlendGradient(int count, const QT_FT_Span *spans, void *userData)
void handleSpans(int count, const QT_FT_Span *spans, const QSpanData *data, const Operator &op)
static void qt_bitmapblit_template(QRasterBuffer *rasterBuffer, int x, int y, DST color, const uchar *map, int mapWidth, int mapHeight, int mapStride)
void qt_memfill24(quint24 *dest, quint24 color, qsizetype count)
static void QT_FASTCALL destStoreRGB16(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length)
static void QT_FASTCALL fetchTransformedBilinearARGB32PM_upscale_helper(uint *b, uint *end, const QTextureData &image, int &fx, int &fy, int fdx, int)
static void QT_FASTCALL getLinearGradientValues(LinearGradientValues *v, const QSpanData *data)
static quint32 interpolate_pixel_rgb16x2_255(quint32 x, quint8 a, quint32 y, quint8 b)
static void qt_rectfill_rgb30(QRasterBuffer *rasterBuffer, int x, int y, int width, int height, const QRgba64 &color)
void qBlendTexture(int count, const QT_FT_Span *spans, void *userData)
static uint QT_FASTCALL fetch1Pixel(const uchar *, int)
static DestStoreProc destStoreProc[QImage::NImageFormats]
void qt_alphamapblit_quint16(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 &color, const uchar *map, int mapWidth, int mapHeight, int mapStride, const QClipData *clip, bool useGammaCorrection)
CompositionFunction64 qt_functionForMode64_C[]
constexpr Fetch1PixelFunc fetch1PixelTable[QPixelLayout::BPPCount]
void QT_FASTCALL comp_func_solid_SourceOver_mips_dsp(uint *dest, int length, uint color, uint const_alpha)
void QT_FASTCALL comp_func_solid_SourceOut_mips_dsp(uint *dest, int length, uint color, uint const_alpha)
const uint *QT_FASTCALL qt_fetchUntransformed_argb8565_premultiplied_mips_dsp(uint *buffer, const Operator *, const QSpanData *data, int y, int x, int length)
void QT_FASTCALL comp_func_solid_DestinationAtop_mips_dsp(uint *dest, int length, uint color, uint const_alpha)
void qt_blend_argb32_on_argb32_mips_dsp(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)
uint *QT_FASTCALL qt_destFetchARGB32_mips_dsp(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)
void QT_FASTCALL comp_func_solid_SourceAtop_mips_dsp(uint *dest, int length, uint color, uint const_alpha)
void QT_FASTCALL comp_func_SourceOut_mips_dsp(uint *dest, const uint *src, int length, uint const_alpha)
void QT_FASTCALL comp_func_DestinationOut_mips_dsp(uint *dest, const uint *src, int length, uint const_alpha)
void QT_FASTCALL comp_func_XOR_mips_dsp(uint *dest, const uint *src, int length, uint const_alpha)
const uint *QT_FASTCALL qt_fetchUntransformed_888_mips_dsp(uint *buffer, const Operator *, const QSpanData *data, int y, int x, int length)
void QT_FASTCALL qt_destStoreARGB32_mips_dsp(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length)
void qt_blend_rgb16_on_rgb16_mips_dsp(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)
void QT_FASTCALL comp_func_DestinationAtop_mips_dsp(uint *dest, const uint *src, int length, uint const_alpha)
void QT_FASTCALL comp_func_DestinationIn_mips_dsp(uint *dest, const uint *src, int length, uint const_alpha)
void QT_FASTCALL comp_func_solid_DestinationOver_mips_dsp(uint *dest, int length, uint color, uint const_alpha)
void QT_FASTCALL comp_func_SourceAtop_mips_dsp(uint *dest, const uint *src, int length, uint const_alpha)
void QT_FASTCALL comp_func_solid_XOR_mips_dsp(uint *dest, int length, uint color, uint const_alpha)
void comp_func_Source_mips_dsp(uint *dest, const uint *src, int length, uint const_alpha)
const uint *QT_FASTCALL qt_fetchUntransformed_444_mips_dsp(uint *buffer, const Operator *, const QSpanData *data, int y, int x, int length)
void qt_blend_rgb32_on_rgb32_mips_dsp(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)
void QT_FASTCALL comp_func_solid_DestinationIn_mips_dsp(uint *dest, int length, uint color, uint const_alpha)
void QT_FASTCALL comp_func_SourceIn_mips_dsp(uint *dest, const uint *src, int length, uint const_alpha)
void QT_FASTCALL comp_func_solid_SourceIn_mips_dsp(uint *dest, int length, uint color, uint const_alpha)
void QT_FASTCALL comp_func_DestinationOver_mips_dsp(uint *dest, const uint *src, int length, uint const_alpha)
void(QT_FASTCALL * CompositionFunction64)(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
const QRgba64 *(QT_FASTCALL * SourceFetchProc64)(QRgba64 *buffer, const Operator *o, const QSpanData *data, int y, int x, int length)
void qt_memfill(T *dest, T value, qsizetype count)
void(QT_FASTCALL * CompositionFunctionSolid)(uint *dest, int length, uint color, uint const_alpha)
void(QT_FASTCALL * CompositionFunction)(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
const QRgbaFloat32 *(QT_FASTCALL * SourceFetchProcFP)(QRgbaFloat32 *buffer, const Operator *o, const QSpanData *data, int y, int x, int length)
static constexpr bool hasFastInterpolate4()
static constexpr int BufferSize
QRgba64 *(QT_FASTCALL * DestFetchProc64)(QRgba64 *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)
const uint *(QT_FASTCALL * SourceFetchProc)(uint *buffer, const Operator *o, const QSpanData *data, int y, int x, int length)
static constexpr uint qt_div_257(uint x)
static uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b)
ushort qConvertRgb32To16(uint c)
static void blend_pixel(quint32 &dst, const quint32 src)
static constexpr int qt_div_255(int x)
static uint interpolate_4_pixels(uint tl, uint tr, uint bl, uint br, uint distx, uint disty)
void(QT_FASTCALL * DestStoreProc)(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length)
QT_FT_SpanFunc ProcessSpans
static QRgba64 interpolate_4_pixels_rgb64(const QRgba64 t[], const QRgba64 b[], uint distx, uint disty)
static uint qt_gradient_pixel(const QGradientData *data, qreal pos)
void(QT_FASTCALL * CompositionFunctionFP)(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
static uint BYTE_MUL(uint x, uint a)
void(QT_FASTCALL * CompositionFunctionSolid64)(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
QRgbaFloat32 *(QT_FASTCALL * DestFetchProcFP)(QRgbaFloat32 *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)
static uint qt_gradient_clamp(const QGradientData *data, int ipos)
uint *(QT_FASTCALL * DestFetchProc)(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)
void(QT_FASTCALL * CompositionFunctionSolidFP)(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
#define GRADIENT_STOPTABLE_SIZE
void(QT_FASTCALL * DestStoreProc64)(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length)
const uint qt_bayer_matrix[16][16]
QRgb qConvertRgb16To32(uint c)
void qt_memfill_template(T *dest, T color, qsizetype count)
static uint BYTE_MUL_RGB16(uint x, uint a)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr T qFromBigEndian(T source)
Q_CORE_EXPORT void qFloatFromFloat16(float *, const qfloat16 *, qsizetype length) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
qfloat16 qSqrt(qfloat16 f)
int qRound(qfloat16 d) noexcept
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
MemRotateFunc qMemRotateFunctions[QPixelLayout::BPPCount][3]
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qBound(const T &min, const T &val, const T &max)
constexpr const T & qMax(const T &a, const T &b)
constexpr T qAbs(const T &t)
GLint GLfloat GLfloat GLfloat v2
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLuint GLfloat GLfloat GLfloat GLfloat y1
GLuint GLfloat GLfloat GLfloat x1
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
GLenum GLuint GLenum GLsizei length
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLint GLsizei GLsizei GLenum format
GLfloat GLfloat GLfloat GLfloat h
GLfixed GLfixed GLfixed y2
GLfloat GLfloat GLfloat alpha
ConvertAndStorePixelsFunc64 qStoreFromRGBA64PM[QImage::NImageFormats]
QPixelLayout qPixelLayouts[QImage::NImageFormats]
void(QT_FASTCALL * Convert64Func)(QRgba64 *buffer, int count)
const uint *(QT_FASTCALL * FetchAndConvertPixelsFunc)(uint *buffer, const uchar *src, int index, int count, const QList< QRgb > *clut, QDitherInfo *dither)
void(QT_FASTCALL * Convert64ToFPFunc)(QRgbaFloat32 *buffer, const quint64 *src, int count)
static quint32 ARGB2RGBA(quint32 x)
void(QT_FASTCALL * ConvertAndStorePixelsFunc)(uchar *dest, const uint *src, int index, int count, const QList< QRgb > *clut, QDitherInfo *dither)
constexpr bool qIsGray(QRgb rgb)
QT_BEGIN_NAMESPACE typedef unsigned int QRgb
constexpr int qRed(QRgb rgb)
constexpr int qGreen(QRgb rgb)
constexpr int qGray(int r, int g, int b)
constexpr int qBlue(QRgb rgb)
constexpr QRgb qPremultiply(QRgb x)
constexpr int qAlpha(QRgb rgb)
static uint toArgb32(QRgba64 rgba64)
static QRgba64 interpolate255(QRgba64 x, uint alpha1, QRgba64 y, uint alpha2)
#define qCpuHasFeature(feature)
unsigned long long quint64
AlphamapBlitFunc alphamapBlit
BitmapBlitFunc bitmapBlit
LinearGradientValues linear
CompositionFunction64 func64
DestStoreProcFP destStoreFP
CompositionFunctionSolidFP funcSolidFP
CompositionFunctionSolid funcSolid
DestStoreProc64 destStore64
SourceFetchProcFP srcFetchFP
SourceFetchProc64 srcFetch64
QPainter::CompositionMode mode
CompositionFunctionFP funcFP
DestFetchProcFP destFetchFP
DestFetchProc64 destFetch64
RadialGradientValues radial
CompositionFunctionSolid64 funcSolid64
ConvertFunc convertToARGB32PM
ConvertAndStorePixelsFunc storeFromARGB32PM
ConvertTo64Func convertToRGBA64PM
FetchAndConvertPixelsFunc64 fetchToRGBA64PM
FetchAndConvertPixelsFunc fetchToARGB32PM
ConvertAndStorePixelsFunc storeFromRGB32
QRasterBuffer * rasterBuffer