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);
121 fetch1Pixel<QPixelLayout::BPP1MSB>,
122 fetch1Pixel<QPixelLayout::BPP1LSB>,
123 fetch1Pixel<QPixelLayout::BPP8>,
124 fetch1Pixel<QPixelLayout::BPP16>,
125 fetch1Pixel<QPixelLayout::BPP24>,
126 fetch1Pixel<QPixelLayout::BPP32>,
127 fetch1Pixel<QPixelLayout::BPP64>,
128 fetch1Pixel<QPixelLayout::BPP16FPx4>,
129 fetch1Pixel<QPixelLayout::BPP32FPx4>,
132#if QT_CONFIG(raster_64bit)
205 convertRGBA64PMToRGBA64PM,
206 convertRGBA64ToRGBA64PM,
207 convertRGBA64PMToRGBA64PM,
210 convertRGBA16FPMToRGBA64PM,
211 convertRGBA16FToRGBA64PM,
212 convertRGBA16FPMToRGBA64PM,
213 convertRGBA32FPMToRGBA64PM,
214 convertRGBA32FToRGBA64PM,
215 convertRGBA32FPMToRGBA64PM,
222#if QT_CONFIG(raster_fp)
225 const auto *
in =
reinterpret_cast<const QRgba64 *
>(
src);
234 const auto *
in =
reinterpret_cast<const QRgba64 *
>(
src);
279 convertRGBA64ToRGBA32F,
280 convertRGBA64PMToRGBA32F,
281 convertRGBA64ToRGBA32F,
284 convertRGBA16FToRGBA32F,
285 convertRGBA16FPMToRGBA32F,
286 convertRGBA16FToRGBA32F,
405#if QT_CONFIG(raster_64bit)
466#if QT_CONFIG(raster_fp)
531 const QRgb color_0 = rbuf->destColor0;
532 const QRgb color_1 = rbuf->destColor1;
543 dist_0 =
rx*
rx + gx*gx + bx*bx;
548 dist_1 =
rx*
rx + gx*gx + bx*bx;
565 data[
x >> 3] &= ~(0x80 >> (
x & 7));
567 data[
x >> 3] |= 0x80 >> (
x & 7);
569 data[
x >> 3] &= ~(0x80 >> (
x & 7));
571 data[
x >> 3] |= 0x80 >> (
x & 7);
578 data[
x >> 3] |= 0x80 >> (
x & 7);
580 data[
x >> 3] &= ~(0x80 >> (
x & 7));
592 data[
x >> 3] &= ~(1 << (
x & 7));
594 data[
x >> 3] |= 1 << (
x & 7);
596 data[
x >> 3] &= ~(1 << (
x & 7));
598 data[
x >> 3] |= 1 << (
x & 7);
605 data[
x >> 3] |= 1 << (
x & 7);
607 data[
x >> 3] &= ~(1 << (
x & 7));
625 store =
layout->storeFromRGB32;
635 for (
int k = 0; k <
length; ++k) {
656 for (
int k = 0; k <
length; ++k) {
669 for (
int k = 0; k <
length; ++k)
718#if QT_CONFIG(raster_64bit)
739 for (
int k = 0; k <
length; ++k) {
753 for (
int k = 0; k <
length; ++k)
763 for (
int k = 0; k <
length; ++k) {
822#if QT_CONFIG(raster_fp)
825 auto store = qStoreFromRGBA32F[rasterBuffer->
format];
866 const uchar *scanLine =
data->texture.scanLine(
y);
867 return reinterpret_cast<const uint *
>(scanLine) +
x;
880#if QT_CONFIG(raster_64bit)
891 const uchar *scanLine =
data->texture.scanLine(
y);
892 return reinterpret_cast<const QRgba64 *
>(scanLine) +
x;
896#if QT_CONFIG(raster_fp)
900 const auto fetch = qFetchToRGBA32F[
data->texture.format];
905template<TextureBlendType blendType>
910 if (v < 0 || v >= max) {
926 qreal minc = std::min(fx, fy);
927 qreal maxc = std::max(fx, fy);
930 minc = std::min(minc, std::min(fx, fy));
931 maxc = std::max(maxc, std::max(fx, fy));
933 return minc >= std::numeric_limits<int>::min() && maxc <= std::numeric_limits<int>::max();
936template<TextureBlendType blendType, QPixelLayout::BPP bpp,
typename T>
958 int fx = int((
data->m21 * cy
960 int fy = int((
data->m22 * cy
965 fetchTransformed_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1, py);
976 for (;
i < fastLen; ++
i) {
979 fetchTransformed_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1);
982 if constexpr (useFetch)
989 for (;
i < fastLen; ++
i) {
991 if constexpr (useFetch)
994 buffer[
i] =
reinterpret_cast<const T*
>(
src)[px];
1000 int px = (fx >> 16);
1001 fetchTransformed_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1, px);
1002 if constexpr (useFetch)
1005 buffer[
i] =
reinterpret_cast<const T*
>(
src)[px];
1021 for (;
i < fastLen; ++
i) {
1022 int x1 = (fx >> 16);
1023 int y1 = (fy >> 16);
1026 fetchTransformed_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1);
1027 fetchTransformed_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1);
1030 if constexpr (useFetch)
1038 for (;
i < fastLen; ++
i) {
1039 int px = (fx >> 16);
1040 int py = (fy >> 16);
1041 if constexpr (useFetch)
1044 buffer[
i] =
reinterpret_cast<const T*
>(
image.scanLine(py))[px];
1051 int px = (fx >> 16);
1052 int py = (fy >> 16);
1053 fetchTransformed_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1, px);
1054 fetchTransformed_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1, py);
1055 if constexpr (useFetch)
1058 buffer[
i] =
reinterpret_cast<const T*
>(
image.scanLine(py))[px];
1075 const qreal iw = fw == 0 ? 1 : 1 / fw;
1076 const qreal tx = fx * iw;
1081 fetchTransformed_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1, py);
1082 fetchTransformed_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1, px);
1083 if constexpr (useFetch)
1084 *
b = fetch1(
image.scanLine(py), px);
1086 *
b =
reinterpret_cast<const T*
>(
image.scanLine(py))[px];
1100template<TextureBlendType blendType, QPixelLayout::BPP bpp>
1111#if QT_CONFIG(raster_64bit)
1112template<TextureBlendType blendType>
1121 fetchTransformed_fetcher<blendType, QPixelLayout::BPP32, uint>(buffer32,
data,
y,
x,
length);
1123 fetchTransformed_fetcher<blendType, QPixelLayout::BPPNone, uint>(buffer32,
data,
y,
x,
length);
1127 fetchTransformed_fetcher<blendType, QPixelLayout::BPP64, quint64>(
reinterpret_cast<quint64*
>(
buffer),
data,
y,
x,
length);
1128 if (
auto convert = convert64ToRGBA64PM[
data->texture.format])
1134#if QT_CONFIG(raster_fp)
1135template<TextureBlendType blendType>
1144 fetchTransformed_fetcher<blendType, QPixelLayout::BPP32, uint>(buffer32,
data,
y,
x,
length);
1146 fetchTransformed_fetcher<blendType, QPixelLayout::BPPNone, uint>(buffer32,
data,
y,
x,
length);
1147 qConvertToRGBA32F[
data->texture.format](
buffer, buffer32,
length,
data->texture.colorTable,
nullptr);
1150 fetchTransformed_fetcher<blendType, QPixelLayout::BPP64, quint64>(buffer64,
data,
y,
x,
length);
1153 fetchTransformed_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgbaFloat32>(
buffer,
data,
y,
x,
length);
1168 uint distxy = distx * disty;
1171 uint tlrb = (tl & 0x00ff00ff) * (16*16 - 16*distx - 16*disty + distxy);
1172 uint tlag = ((tl & 0xff00ff00) >> 8) * (16*16 - 16*distx - 16*disty + distxy);
1173 uint trrb = ((
tr & 0x00ff00ff) * (distx*16 - distxy));
1174 uint trag = (((
tr & 0xff00ff00) >> 8) * (distx*16 - distxy));
1175 uint blrb = ((bl & 0x00ff00ff) * (disty*16 - distxy));
1176 uint blag = (((bl & 0xff00ff00) >> 8) * (disty*16 - distxy));
1177 uint brrb = ((br & 0x00ff00ff) * (distxy));
1178 uint brag = (((br & 0xff00ff00) >> 8) * (distxy));
1179 return (((tlrb + trrb + blrb + brrb) >> 8) & 0x00ff00ff) | ((tlag + trag + blag + brag) & 0xff00ff00);
1182#if defined(__SSE2__)
1183#define interpolate_4_pixels_16_sse2(tl, tr, bl, br, distx, disty, colorMask, v_256, b) \
1185 const __m128i dxdy = _mm_mullo_epi16 (distx, disty); \
1186 const __m128i distx_ = _mm_slli_epi16(distx, 4); \
1187 const __m128i disty_ = _mm_slli_epi16(disty, 4); \
1188 const __m128i idxidy = _mm_add_epi16(dxdy, _mm_sub_epi16(v_256, _mm_add_epi16(distx_, disty_))); \
1189 const __m128i dxidy = _mm_sub_epi16(distx_, dxdy); \
1190 const __m128i idxdy = _mm_sub_epi16(disty_, dxdy); \
1192 __m128i tlAG = _mm_srli_epi16(tl, 8); \
1193 __m128i tlRB = _mm_and_si128(tl, colorMask); \
1194 __m128i trAG = _mm_srli_epi16(tr, 8); \
1195 __m128i trRB = _mm_and_si128(tr, colorMask); \
1196 __m128i blAG = _mm_srli_epi16(bl, 8); \
1197 __m128i blRB = _mm_and_si128(bl, colorMask); \
1198 __m128i brAG = _mm_srli_epi16(br, 8); \
1199 __m128i brRB = _mm_and_si128(br, colorMask); \
1201 tlAG = _mm_mullo_epi16(tlAG, idxidy); \
1202 tlRB = _mm_mullo_epi16(tlRB, idxidy); \
1203 trAG = _mm_mullo_epi16(trAG, dxidy); \
1204 trRB = _mm_mullo_epi16(trRB, dxidy); \
1205 blAG = _mm_mullo_epi16(blAG, idxdy); \
1206 blRB = _mm_mullo_epi16(blRB, idxdy); \
1207 brAG = _mm_mullo_epi16(brAG, dxdy); \
1208 brRB = _mm_mullo_epi16(brRB, dxdy); \
1211 __m128i rAG =_mm_add_epi16(_mm_add_epi16(tlAG, trAG), _mm_add_epi16(blAG, brAG)); \
1212 __m128i rRB =_mm_add_epi16(_mm_add_epi16(tlRB, trRB), _mm_add_epi16(blRB, brRB)); \
1213 rAG = _mm_andnot_si128(colorMask, rAG); \
1214 rRB = _mm_srli_epi16(rRB, 8); \
1215 _mm_storeu_si128((__m128i*)(b), _mm_or_si128(rAG, rRB)); \
1219#if defined(__ARM_NEON__)
1220#define interpolate_4_pixels_16_neon(tl, tr, bl, br, distx, disty, disty_, colorMask, invColorMask, v_256, b) \
1222 const int16x8_t dxdy = vmulq_s16(distx, disty); \
1223 const int16x8_t distx_ = vshlq_n_s16(distx, 4); \
1224 const int16x8_t idxidy = vaddq_s16(dxdy, vsubq_s16(v_256, vaddq_s16(distx_, disty_))); \
1225 const int16x8_t dxidy = vsubq_s16(distx_, dxdy); \
1226 const int16x8_t idxdy = vsubq_s16(disty_, dxdy); \
1228 int16x8_t tlAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(tl), 8)); \
1229 int16x8_t tlRB = vandq_s16(tl, colorMask); \
1230 int16x8_t trAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(tr), 8)); \
1231 int16x8_t trRB = vandq_s16(tr, colorMask); \
1232 int16x8_t blAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(bl), 8)); \
1233 int16x8_t blRB = vandq_s16(bl, colorMask); \
1234 int16x8_t brAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(br), 8)); \
1235 int16x8_t brRB = vandq_s16(br, colorMask); \
1237 int16x8_t rAG = vmulq_s16(tlAG, idxidy); \
1238 int16x8_t rRB = vmulq_s16(tlRB, idxidy); \
1239 rAG = vmlaq_s16(rAG, trAG, dxidy); \
1240 rRB = vmlaq_s16(rRB, trRB, dxidy); \
1241 rAG = vmlaq_s16(rAG, blAG, idxdy); \
1242 rRB = vmlaq_s16(rRB, blRB, idxdy); \
1243 rAG = vmlaq_s16(rAG, brAG, dxdy); \
1244 rRB = vmlaq_s16(rRB, brRB, dxdy); \
1246 rAG = vandq_s16(invColorMask, rAG); \
1247 rRB = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(rRB), 8)); \
1248 vst1q_s16((int16_t*)(b), vorrq_s16(rAG, rRB)); \
1252template<TextureBlendType blendType>
1294#if defined(QT_COMPILER_SUPPORTS_AVX2)
1297 return intermediate_adder_avx2(
b,
end, intermediate,
offset, fx, fdx);
1304 const int x = (fx >> 16);
1306 const uint distx = (fx & 0x0000ffff) >> 8;
1307 const uint idistx = 256 - distx;
1308 const uint rb = (intermediate.buffer_rb[
x] * idistx + intermediate.buffer_rb[
x + 1] * distx) & 0xff00ff00;
1309 const uint ag = (intermediate.buffer_ag[
x] * idistx + intermediate.buffer_ag[
x + 1] * distx) & 0xff00ff00;
1310 *
b = (rb >> 8) | ag;
1319template<TextureBlendType blendType>
1321 int &fx,
int &fy,
int fdx,
int )
1323 int y1 = (fy >> 16);
1325 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
1329 const int disty = (fy & 0x0000ffff) >> 8;
1330 const int idisty = 256 - disty;
1334 const int adjust = (fdx < 0) ? fdx *
length : 0;
1335 const int offset = (fx + adjust) >> 16;
1355 quint32 rb = (((
t & 0xff00ff) * idisty + (
b & 0xff00ff) * disty) >> 8) & 0xff00ff;
1356 quint32 ag = ((((
t>>8) & 0xff00ff) * idisty + ((
b>>8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
1358 intermediate.buffer_rb[
f] = rb;
1359 intermediate.buffer_ag[
f] = ag;
1362 }
while (
x <
image.x1 &&
f < lim);
1367#if defined(__SSE2__)
1368 const __m128i disty_ = _mm_set1_epi16(disty);
1369 const __m128i idisty_ = _mm_set1_epi16(idisty);
1370 const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
1373 for (;
f < lim;
x += 4,
f += 4) {
1375 __m128i
top = _mm_loadu_si128((
const __m128i*)((
const uint *)(
s1)+
x));
1376 __m128i topAG = _mm_srli_epi16(
top, 8);
1377 __m128i topRB = _mm_and_si128(
top, colorMask);
1379 topAG = _mm_mullo_epi16 (topAG, idisty_);
1380 topRB = _mm_mullo_epi16 (topRB, idisty_);
1383 __m128i
bottom = _mm_loadu_si128((
const __m128i*)((
const uint *)(
s2)+
x));
1384 __m128i bottomAG = _mm_srli_epi16(
bottom, 8);
1385 __m128i bottomRB = _mm_and_si128(
bottom, colorMask);
1386 bottomAG = _mm_mullo_epi16 (bottomAG, disty_);
1387 bottomRB = _mm_mullo_epi16 (bottomRB, disty_);
1390 __m128i rAG =_mm_add_epi16(topAG, bottomAG);
1391 rAG = _mm_srli_epi16(rAG, 8);
1392 _mm_storeu_si128((__m128i*)(&intermediate.buffer_ag[
f]), rAG);
1393 __m128i rRB =_mm_add_epi16(topRB, bottomRB);
1394 rRB = _mm_srli_epi16(rRB, 8);
1395 _mm_storeu_si128((__m128i*)(&intermediate.buffer_rb[
f]), rRB);
1397#elif defined(__ARM_NEON__)
1398 const int16x8_t disty_ = vdupq_n_s16(disty);
1399 const int16x8_t idisty_ = vdupq_n_s16(idisty);
1400 const int16x8_t colorMask = vdupq_n_s16(0x00ff);
1403 for (;
f < lim;
x += 4,
f += 4) {
1405 int16x8_t
top = vld1q_s16((int16_t*)((
const uint *)(
s1)+
x));
1406 int16x8_t topAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(
top), 8));
1407 int16x8_t topRB = vandq_s16(
top, colorMask);
1409 topAG = vmulq_s16(topAG, idisty_);
1410 topRB = vmulq_s16(topRB, idisty_);
1413 int16x8_t
bottom = vld1q_s16((int16_t*)((
const uint *)(
s2)+
x));
1414 int16x8_t bottomAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(
bottom), 8));
1415 int16x8_t bottomRB = vandq_s16(
bottom, colorMask);
1416 bottomAG = vmulq_s16(bottomAG, disty_);
1417 bottomRB = vmulq_s16(bottomRB, disty_);
1420 int16x8_t rAG = vaddq_s16(topAG, bottomAG);
1421 rAG = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(rAG), 8));
1422 vst1q_s16((int16_t*)(&intermediate.buffer_ag[
f]), rAG);
1423 int16x8_t rRB = vaddq_s16(topRB, bottomRB);
1424 rRB = vreinterpretq_s16_u16(vshrq_n_u16(vreinterpretq_u16_s16(rRB), 8));
1425 vst1q_s16((int16_t*)(&intermediate.buffer_rb[
f]), rRB);
1439 intermediate.buffer_rb[
f] = (((
t & 0xff00ff) * idisty + (
b & 0xff00ff) * disty) >> 8) & 0xff00ff;
1440 intermediate.buffer_ag[
f] = ((((
t>>8) & 0xff00ff) * idisty + ((
b>>8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
1448template<TextureBlendType blendType>
1450 int &fx,
int &fy,
int fdx,
int )
1452 int y1 = (fy >> 16);
1454 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
1457 const int disty = (fy & 0x0000ffff) >> 8;
1463 int x1 = (fx >> 16);
1465 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
1476 boundedEnd =
qMin(boundedEnd,
b + (max_fx - fx) / fdx);
1478 boundedEnd =
qMin(boundedEnd,
b + (min_fx - fx) / fdx);
1481 while (
b < boundedEnd) {
1483 int distx = (fx & 0x0000ffff) >> 8;
1491 int x1 = (fx >> 16);
1493 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1 ,
x1,
x2);
1498 int distx = (fx & 0x0000ffff) >> 8;
1506template<TextureBlendType blendType>
1508 int &fx,
int &fy,
int fdx,
int )
1510 int y1 = (fy >> 16);
1512 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
1515 const int disty8 = (fy & 0x0000ffff) >> 8;
1516 const int disty4 = (disty8 + 0x08) >> 4;
1522 int x1 = (fx >> 16);
1524 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
1535 boundedEnd =
qMin(boundedEnd,
b + (max_fx - fx) / fdx);
1537 boundedEnd =
qMin(boundedEnd,
b + (min_fx - fx) / fdx);
1539#if defined(__SSE2__)
1540 const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
1541 const __m128i v_256 = _mm_set1_epi16(256);
1542 const __m128i v_disty = _mm_set1_epi16(disty4);
1543 const __m128i v_fdx = _mm_set1_epi32(fdx*4);
1544 const __m128i v_fx_r = _mm_set1_epi32(0x8);
1545 __m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx);
1547 while (
b < boundedEnd - 3) {
1548 __m128i
offset = _mm_srli_epi32(v_fx, 16);
1552 const int offset3 = _mm_cvtsi128_si32(
offset);
1553 const __m128i tl = _mm_setr_epi32(
s1[offset0],
s1[offset1],
s1[offset2],
s1[offset3]);
1554 const __m128i
tr = _mm_setr_epi32(
s1[offset0 + 1],
s1[offset1 + 1],
s1[offset2 + 1],
s1[offset3 + 1]);
1555 const __m128i bl = _mm_setr_epi32(
s2[offset0],
s2[offset1],
s2[offset2],
s2[offset3]);
1556 const __m128i br = _mm_setr_epi32(
s2[offset0 + 1],
s2[offset1 + 1],
s2[offset2 + 1],
s2[offset3 + 1]);
1558 __m128i v_distx = _mm_srli_epi16(v_fx, 8);
1559 v_distx = _mm_srli_epi16(_mm_add_epi32(v_distx, v_fx_r), 4);
1560 v_distx = _mm_shufflehi_epi16(v_distx, _MM_SHUFFLE(2,2,0,0));
1561 v_distx = _mm_shufflelo_epi16(v_distx, _MM_SHUFFLE(2,2,0,0));
1563 interpolate_4_pixels_16_sse2(tl,
tr, bl, br, v_distx, v_disty, colorMask, v_256,
b);
1565 v_fx = _mm_add_epi32(v_fx, v_fdx);
1567 fx = _mm_cvtsi128_si32(v_fx);
1568#elif defined(__ARM_NEON__)
1569 const int16x8_t colorMask = vdupq_n_s16(0x00ff);
1570 const int16x8_t invColorMask = vmvnq_s16(colorMask);
1571 const int16x8_t v_256 = vdupq_n_s16(256);
1572 const int16x8_t v_disty = vdupq_n_s16(disty4);
1573 const int16x8_t v_disty_ = vshlq_n_s16(v_disty, 4);
1574 int32x4_t v_fdx = vdupq_n_s32(fdx*4);
1576 int32x4_t v_fx = vmovq_n_s32(fx);
1577 v_fx = vsetq_lane_s32(fx + fdx, v_fx, 1);
1578 v_fx = vsetq_lane_s32(fx + fdx * 2, v_fx, 2);
1579 v_fx = vsetq_lane_s32(fx + fdx * 3, v_fx, 3);
1581 const int32x4_t v_ffff_mask = vdupq_n_s32(0x0000ffff);
1582 const int32x4_t v_fx_r = vdupq_n_s32(0x0800);
1584 while (
b < boundedEnd - 3) {
1585 uint32x4x2_t v_top, v_bot;
1587 int x1 = (fx >> 16);
1589 v_top = vld2q_lane_u32(
s1 +
x1, v_top, 0);
1590 v_bot = vld2q_lane_u32(
s2 +
x1, v_bot, 0);
1593 v_top = vld2q_lane_u32(
s1 +
x1, v_top, 1);
1594 v_bot = vld2q_lane_u32(
s2 +
x1, v_bot, 1);
1597 v_top = vld2q_lane_u32(
s1 +
x1, v_top, 2);
1598 v_bot = vld2q_lane_u32(
s2 +
x1, v_bot, 2);
1601 v_top = vld2q_lane_u32(
s1 +
x1, v_top, 3);
1602 v_bot = vld2q_lane_u32(
s2 +
x1, v_bot, 3);
1604 int32x4_t v_distx = vshrq_n_s32(vaddq_s32(vandq_s32(v_fx, v_ffff_mask), v_fx_r), 12);
1605 v_distx = vorrq_s32(v_distx, vshlq_n_s32(v_distx, 16));
1607 interpolate_4_pixels_16_neon(
1608 vreinterpretq_s16_u32(v_top.val[0]), vreinterpretq_s16_u32(v_top.val[1]),
1609 vreinterpretq_s16_u32(v_bot.val[0]), vreinterpretq_s16_u32(v_bot.val[1]),
1610 vreinterpretq_s16_s32(v_distx), v_disty, v_disty_,
1611 colorMask, invColorMask, v_256,
b);
1613 v_fx = vaddq_s32(v_fx, v_fdx);
1616 while (
b < boundedEnd) {
1619 int distx8 = (fx & 0x0000ffff) >> 8;
1622 int distx4 = ((fx & 0x0000ffff) + 0x0800) >> 12;
1631 int x1 = (fx >> 16);
1633 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
1639 int distx8 = (fx & 0x0000ffff) >> 8;
1642 int distx4 = ((fx & 0x0000ffff) + 0x0800) >> 12;
1650template<TextureBlendType blendType>
1652 int &fx,
int &fy,
int fdx,
int fdy)
1656 int x1 = (fx >> 16);
1658 int y1 = (fy >> 16);
1661 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
1662 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
1672 int distx = (fx & 0x0000ffff) >> 8;
1673 int disty = (fy & 0x0000ffff) >> 8;
1683template<TextureBlendType blendType>
1685 int &fx,
int &fy,
int fdx,
int fdy)
1695 int x1 = (fx >> 16);
1697 int y1 = (fy >> 16);
1699 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
1700 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
1710 int distx = (fx & 0x0000ffff) >> 8;
1711 int disty = (fy & 0x0000ffff) >> 8;
1714 int distx = ((fx & 0x0000ffff) + 0x0800) >> 12;
1715 int disty = ((fy & 0x0000ffff) + 0x0800) >> 12;
1724 boundedEnd =
qMin(boundedEnd,
b + (max_fx - fx) / fdx);
1726 boundedEnd =
qMin(boundedEnd,
b + (min_fx - fx) / fdx);
1728 boundedEnd =
qMin(boundedEnd,
b + (max_fy - fy) / fdy);
1730 boundedEnd =
qMin(boundedEnd,
b + (min_fy - fy) / fdy);
1733#if defined(__SSE2__)
1734 const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
1735 const __m128i v_256 = _mm_set1_epi16(256);
1736 const __m128i v_fdx = _mm_set1_epi32(fdx*4);
1737 const __m128i v_fdy = _mm_set1_epi32(fdy*4);
1738 const __m128i v_fxy_r = _mm_set1_epi32(0x8);
1739 __m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx);
1740 __m128i v_fy = _mm_setr_epi32(fy, fy + fdy, fy + fdy + fdy, fy + fdy + fdy + fdy);
1744 const __m128i vbpl = _mm_shufflelo_epi16(_mm_cvtsi32_si128(bytesPerLine/4), _MM_SHUFFLE(0, 0, 0, 0));
1746 while (
b < boundedEnd - 3) {
1747 const __m128i vy = _mm_packs_epi32(_mm_srli_epi32(v_fy, 16), _mm_setzero_si128());
1749 __m128i
offset = _mm_unpacklo_epi16(_mm_mullo_epi16(vy, vbpl), _mm_mulhi_epi16(vy, vbpl));
1750 offset = _mm_add_epi32(
offset, _mm_srli_epi32(v_fx, 16));
1754 const int offset3 = _mm_cvtsi128_si32(
offset);
1755 const uint *topData = (
const uint *)(textureData);
1756 const __m128i tl = _mm_setr_epi32(topData[offset0], topData[offset1], topData[offset2], topData[offset3]);
1757 const __m128i
tr = _mm_setr_epi32(topData[offset0 + 1], topData[offset1 + 1], topData[offset2 + 1], topData[offset3 + 1]);
1758 const uint *bottomData = (
const uint *)(textureData + bytesPerLine);
1759 const __m128i bl = _mm_setr_epi32(bottomData[offset0], bottomData[offset1], bottomData[offset2], bottomData[offset3]);
1760 const __m128i br = _mm_setr_epi32(bottomData[offset0 + 1], bottomData[offset1 + 1], bottomData[offset2 + 1], bottomData[offset3 + 1]);
1762 __m128i v_distx = _mm_srli_epi16(v_fx, 8);
1763 __m128i v_disty = _mm_srli_epi16(v_fy, 8);
1764 v_distx = _mm_srli_epi16(_mm_add_epi32(v_distx, v_fxy_r), 4);
1765 v_disty = _mm_srli_epi16(_mm_add_epi32(v_disty, v_fxy_r), 4);
1766 v_distx = _mm_shufflehi_epi16(v_distx, _MM_SHUFFLE(2,2,0,0));
1767 v_distx = _mm_shufflelo_epi16(v_distx, _MM_SHUFFLE(2,2,0,0));
1768 v_disty = _mm_shufflehi_epi16(v_disty, _MM_SHUFFLE(2,2,0,0));
1769 v_disty = _mm_shufflelo_epi16(v_disty, _MM_SHUFFLE(2,2,0,0));
1771 interpolate_4_pixels_16_sse2(tl,
tr, bl, br, v_distx, v_disty, colorMask, v_256,
b);
1773 v_fx = _mm_add_epi32(v_fx, v_fdx);
1774 v_fy = _mm_add_epi32(v_fy, v_fdy);
1776 fx = _mm_cvtsi128_si32(v_fx);
1777 fy = _mm_cvtsi128_si32(v_fy);
1778#elif defined(__ARM_NEON__)
1779 const int16x8_t colorMask = vdupq_n_s16(0x00ff);
1780 const int16x8_t invColorMask = vmvnq_s16(colorMask);
1781 const int16x8_t v_256 = vdupq_n_s16(256);
1782 int32x4_t v_fdx = vdupq_n_s32(fdx * 4);
1783 int32x4_t v_fdy = vdupq_n_s32(fdy * 4);
1788 int32x4_t v_fx = vmovq_n_s32(fx);
1789 int32x4_t v_fy = vmovq_n_s32(fy);
1790 v_fx = vsetq_lane_s32(fx + fdx, v_fx, 1);
1791 v_fy = vsetq_lane_s32(fy + fdy, v_fy, 1);
1792 v_fx = vsetq_lane_s32(fx + fdx * 2, v_fx, 2);
1793 v_fy = vsetq_lane_s32(fy + fdy * 2, v_fy, 2);
1794 v_fx = vsetq_lane_s32(fx + fdx * 3, v_fx, 3);
1795 v_fy = vsetq_lane_s32(fy + fdy * 3, v_fy, 3);
1797 const int32x4_t v_ffff_mask = vdupq_n_s32(0x0000ffff);
1798 const int32x4_t v_round = vdupq_n_s32(0x0800);
1800 while (
b < boundedEnd - 3) {
1801 uint32x4x2_t v_top, v_bot;
1803 int x1 = (fx >> 16);
1804 int y1 = (fy >> 16);
1805 fx += fdx; fy += fdy;
1806 const uchar *sl = textureData + bytesPerLine *
y1;
1807 const uint *
s1 =
reinterpret_cast<const uint *
>(sl);
1808 const uint *
s2 =
reinterpret_cast<const uint *
>(sl + bytesPerLine);
1809 v_top = vld2q_lane_u32(
s1 +
x1, v_top, 0);
1810 v_bot = vld2q_lane_u32(
s2 +
x1, v_bot, 0);
1813 fx += fdx; fy += fdy;
1814 sl = textureData + bytesPerLine *
y1;
1815 s1 =
reinterpret_cast<const uint *
>(sl);
1816 s2 =
reinterpret_cast<const uint *
>(sl + bytesPerLine);
1817 v_top = vld2q_lane_u32(
s1 +
x1, v_top, 1);
1818 v_bot = vld2q_lane_u32(
s2 +
x1, v_bot, 1);
1821 fx += fdx; fy += fdy;
1822 sl = textureData + bytesPerLine *
y1;
1823 s1 =
reinterpret_cast<const uint *
>(sl);
1824 s2 =
reinterpret_cast<const uint *
>(sl + bytesPerLine);
1825 v_top = vld2q_lane_u32(
s1 +
x1, v_top, 2);
1826 v_bot = vld2q_lane_u32(
s2 +
x1, v_bot, 2);
1829 fx += fdx; fy += fdy;
1830 sl = textureData + bytesPerLine *
y1;
1831 s1 =
reinterpret_cast<const uint *
>(sl);
1832 s2 =
reinterpret_cast<const uint *
>(sl + bytesPerLine);
1833 v_top = vld2q_lane_u32(
s1 +
x1, v_top, 3);
1834 v_bot = vld2q_lane_u32(
s2 +
x1, v_bot, 3);
1836 int32x4_t v_distx = vshrq_n_s32(vaddq_s32(vandq_s32(v_fx, v_ffff_mask), v_round), 12);
1837 int32x4_t v_disty = vshrq_n_s32(vaddq_s32(vandq_s32(v_fy, v_ffff_mask), v_round), 12);
1838 v_distx = vorrq_s32(v_distx, vshlq_n_s32(v_distx, 16));
1839 v_disty = vorrq_s32(v_disty, vshlq_n_s32(v_disty, 16));
1840 int16x8_t v_disty_ = vshlq_n_s16(vreinterpretq_s16_s32(v_disty), 4);
1842 interpolate_4_pixels_16_neon(
1843 vreinterpretq_s16_u32(v_top.val[0]), vreinterpretq_s16_u32(v_top.val[1]),
1844 vreinterpretq_s16_u32(v_bot.val[0]), vreinterpretq_s16_u32(v_bot.val[1]),
1845 vreinterpretq_s16_s32(v_distx), vreinterpretq_s16_s32(v_disty),
1846 v_disty_, colorMask, invColorMask, v_256,
b);
1848 v_fx = vaddq_s32(v_fx, v_fdx);
1849 v_fy = vaddq_s32(v_fy, v_fdy);
1852 while (
b < boundedEnd) {
1860 int distx = (fx & 0x0000ffff) >> 8;
1861 int disty = (fy & 0x0000ffff) >> 8;
1864 int distx = ((fx & 0x0000ffff) + 0x0800) >> 12;
1865 int disty = ((fy & 0x0000ffff) + 0x0800) >> 12;
1876 int x1 = (fx >> 16);
1878 int y1 = (fy >> 16);
1881 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
1882 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
1893 int distx = (fx & 0x0000ffff) >> 8;
1894 int disty = (fy & 0x0000ffff) >> 8;
1897 int distx = ((fx & 0x0000ffff) + 0x0800) >> 12;
1898 int disty = ((fy & 0x0000ffff) + 0x0800) >> 12;
1911 fetchTransformedBilinearARGB32PM_simple_scale_helper<BlendTransformedBilinear>,
1912 fetchTransformedBilinearARGB32PM_upscale_helper<BlendTransformedBilinear>,
1913 fetchTransformedBilinearARGB32PM_downscale_helper<BlendTransformedBilinear>,
1914 fetchTransformedBilinearARGB32PM_rotate_helper<BlendTransformedBilinear>,
1915 fetchTransformedBilinearARGB32PM_fast_rotate_helper<BlendTransformedBilinear>
1918 fetchTransformedBilinearARGB32PM_simple_scale_helper<BlendTransformedBilinearTiled>,
1919 fetchTransformedBilinearARGB32PM_upscale_helper<BlendTransformedBilinearTiled>,
1920 fetchTransformedBilinearARGB32PM_downscale_helper<BlendTransformedBilinearTiled>,
1921 fetchTransformedBilinearARGB32PM_rotate_helper<BlendTransformedBilinearTiled>,
1922 fetchTransformedBilinearARGB32PM_fast_rotate_helper<BlendTransformedBilinearTiled>
1926template<TextureBlendType blendType>
1942 int fx = int((
data->m21 * cy
1944 int fy = int((
data->m22 * cy
1988 const qreal iw = fw == 0 ? 1 : 1 / fw;
1992 int x1 = int(px) - (px < 0);
1994 int y1 = int(py) - (py < 0);
1997 int distx = int((px -
x1) * 256);
1998 int disty = int((py -
y1) * 256);
2000 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
2001 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
2027template<TextureBlendType blendType>
2029 int &fx,
int &fy,
int fdx,
int )
2032 const QList<QRgb> *clut =
image.colorTable;
2035 int y1 = (fy >> 16);
2037 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
2041 const int disty = (fy & 0x0000ffff) >> 8;
2042 const int idisty = 256 - disty;
2046 const int adjust = (fdx < 0) ? fdx *
length : 0;
2047 const int offset = (fx + adjust) >> 16;
2052 uint *buf2 = intermediate.buffer_ag;
2066 ptr1 = fetch(buf1,
s1,
x, len1, clut,
nullptr);
2067 ptr2 = fetch(buf2,
s2,
x, len1, clut,
nullptr);
2068 for (
int i = 0;
i < len1; ++
i) {
2071 buf1[
i] = (((
t & 0xff00ff) * idisty + (
b & 0xff00ff) * disty) >> 8) & 0xff00ff;
2072 buf2[
i] = ((((
t >> 8) & 0xff00ff) * idisty + ((
b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
2076 ptr1 = fetch(buf1 + len1,
s1, 0, len2, clut,
nullptr);
2077 ptr2 = fetch(buf2 + len1,
s2, 0, len2, clut,
nullptr);
2078 for (
int i = 0;
i < len2; ++
i) {
2081 buf1[
i + len1] = (((
t & 0xff00ff) * idisty + (
b & 0xff00ff) * disty) >> 8) & 0xff00ff;
2082 buf2[
i + len1] = ((((
t >> 8) & 0xff00ff) * idisty + ((
b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
2087 buf1[
i] = buf1[
i -
image.width];
2088 buf2[
i] = buf2[
i -
image.width];
2096 ptr1 = fetch(buf1 + leading,
s1,
start,
len, clut,
nullptr);
2097 ptr2 = fetch(buf2 + leading,
s2,
start,
len, clut,
nullptr);
2099 for (
int i = 0;
i <
len; ++
i) {
2102 buf1[
i + leading] = (((
t & 0xff00ff) * idisty + (
b & 0xff00ff) * disty) >> 8) & 0xff00ff;
2103 buf2[
i + leading] = ((((
t >> 8) & 0xff00ff) * idisty + ((
b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
2106 for (
int i = 0;
i < leading; ++
i) {
2107 buf1[
i] = buf1[leading];
2108 buf2[
i] = buf2[leading];
2111 buf1[
i] = buf1[
i - 1];
2112 buf2[
i] = buf2[
i - 1];
2121template<TextureBlendType blendType, QPixelLayout::BPP bpp,
typename T>
2123 int fx,
int fy,
const int fdx,
const int fdy)
2133 int y1 = (fy >> 16);
2135 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
2141 for (;
i <
len; ++
i) {
2142 int x1 = (fx >> 16);
2144 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
2147 if constexpr (useFetch) {
2148 buf1[
i * 2 + 0] = buf1[
i * 2 + 1] = fetch1(
s1,
x1);
2149 buf2[
i * 2 + 0] = buf2[
i * 2 + 1] = fetch1(
s2,
x1);
2151 buf1[
i * 2 + 0] = buf1[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s1)[
x1];
2152 buf2[
i * 2 + 0] = buf2[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s2)[
x1];
2162 for (;
i < fastLen; ++
i) {
2164 if constexpr (useFetch) {
2165 buf1[
i * 2 + 0] = fetch1(
s1,
x);
2166 buf1[
i * 2 + 1] = fetch1(
s1,
x + 1);
2167 buf2[
i * 2 + 0] = fetch1(
s2,
x);
2168 buf2[
i * 2 + 1] = fetch1(
s2,
x + 1);
2170 buf1[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s1)[
x];
2171 buf1[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s1)[
x + 1];
2172 buf2[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s2)[
x];
2173 buf2[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s2)[
x + 1];
2179 for (;
i <
len; ++
i) {
2180 int x1 = (fx >> 16);
2182 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
2183 if constexpr (useFetch) {
2184 buf1[
i * 2 + 0] = fetch1(
s1,
x1);
2185 buf1[
i * 2 + 1] = fetch1(
s1,
x2);
2186 buf2[
i * 2 + 0] = fetch1(
s2,
x1);
2187 buf2[
i * 2 + 1] = fetch1(
s2,
x2);
2189 buf1[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s1)[
x1];
2190 buf1[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s1)[
x2];
2191 buf2[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s2)[
x1];
2192 buf2[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s2)[
x2];
2199 for (;
i <
len; ++
i) {
2200 int x1 = (fx >> 16);
2202 int y1 = (fy >> 16);
2204 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
2205 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
2210 if constexpr (useFetch) {
2211 buf1[
i * 2 + 0] = fetch1(
s1,
x1);
2212 buf1[
i * 2 + 1] = fetch1(
s1,
x2);
2213 buf2[
i * 2 + 0] = fetch1(
s2,
x1);
2214 buf2[
i * 2 + 1] = fetch1(
s2,
x2);
2216 buf1[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s1)[
x1];
2217 buf1[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s1)[
x2];
2218 buf2[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s2)[
x1];
2219 buf2[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s2)[
x2];
2234 for (;
i < fastLen; ++
i) {
2239 if constexpr (useFetch) {
2240 buf1[
i * 2 + 0] = fetch1(
s1,
x);
2241 buf1[
i * 2 + 1] = fetch1(
s1,
x + 1);
2242 buf2[
i * 2 + 0] = fetch1(
s2,
x);
2243 buf2[
i * 2 + 1] = fetch1(
s2,
x + 1);
2245 buf1[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s1)[
x];
2246 buf1[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s1)[
x + 1];
2247 buf2[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s2)[
x];
2248 buf2[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s2)[
x + 1];
2255 for (;
i <
len; ++
i) {
2256 int x1 = (fx >> 16);
2258 int y1 = (fy >> 16);
2260 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
2261 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
2265 if constexpr (useFetch) {
2266 buf1[
i * 2 + 0] = fetch1(
s1,
x1);
2267 buf1[
i * 2 + 1] = fetch1(
s1,
x2);
2268 buf2[
i * 2 + 0] = fetch1(
s2,
x1);
2269 buf2[
i * 2 + 1] = fetch1(
s2,
x2);
2271 buf1[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s1)[
x1];
2272 buf1[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s1)[
x2];
2273 buf2[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s2)[
x1];
2274 buf2[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s2)[
x2];
2282template<TextureBlendType blendType, QPixelLayout::BPP bpp,
typename T>
2297 for (
int i = 0;
i <
len; ++
i) {
2298 const qreal iw = fw == 0 ? 16384 : 1 / fw;
2307 distxs[
i] =
ushort((px -
x1) * (1<<16));
2308 distys[
i] =
ushort((py -
y1) * (1<<16));
2310 fetchTransformedBilinear_pixelBounds<blendType>(
image.width,
image.x1,
image.x2 - 1,
x1,
x2);
2311 fetchTransformedBilinear_pixelBounds<blendType>(
image.height,
image.y1,
image.y2 - 1,
y1,
y2);
2315 if constexpr (useFetch) {
2316 buf1[
i * 2 + 0] = fetch1(
s1,
x1);
2317 buf1[
i * 2 + 1] = fetch1(
s1,
x2);
2318 buf2[
i * 2 + 0] = fetch1(
s2,
x1);
2319 buf2[
i * 2 + 1] = fetch1(
s2,
x2);
2321 buf1[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s1)[
x1];
2322 buf1[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s1)[
x2];
2323 buf2[
i * 2 + 0] =
reinterpret_cast<const T *
>(
s2)[
x1];
2324 buf2[
i * 2 + 1] =
reinterpret_cast<const T *
>(
s2)[
x2];
2334template<TextureBlendType blendType, QPixelLayout::BPP bpp>
2339 const QList<QRgb> *clut =
data->texture.colorTable;
2358 fetchTransformedBilinear_simple_scale_helper<blendType>(
buffer,
buffer +
length,
data->texture, fx, fy, fdx, fdy);
2361 fetchTransformedBilinear_simple_scale_helper<blendType>(
buffer,
buffer + mid,
data->texture, fx, fy, fdx, fdy);
2363 fetchTransformedBilinear_simple_scale_helper<blendType>(
buffer + mid,
buffer +
length,
data->texture, fx, fy, fdx, fdy);
2365 const auto fetcher = fetchTransformedBilinear_fetcher<blendType,bpp,uint>;
2372 fetcher(buf1, buf2,
len,
data->texture, fx, fy, fdx, 0);
2373 layout->convertToARGB32PM(buf1,
len * 2, clut);
2374 layout->convertToARGB32PM(buf2,
len * 2, clut);
2377 int disty = (fy & 0x0000ffff) >> 8;
2378 for (
int i = 0;
i <
len; ++
i) {
2379 int distx = (fx & 0x0000ffff) >> 8;
2384 int disty = ((fy & 0x0000ffff) + 0x0800) >> 12;
2385 for (
int i = 0;
i <
len; ++
i) {
2386 uint tl = buf1[
i * 2 + 0];
2388 uint bl = buf2[
i * 2 + 0];
2389 uint br = buf2[
i * 2 + 1];
2390 int distx = ((fx & 0x0000ffff) + 0x0800) >> 12;
2400 const auto fetcher = fetchTransformedBilinear_fetcher<blendType,bpp,uint>;
2407 fetcher(buf1, buf2,
len,
data->texture, fx, fy, fdx, fdy);
2408 layout->convertToARGB32PM(buf1,
len * 2, clut);
2409 layout->convertToARGB32PM(buf2,
len * 2, clut);
2413 for (
int i = 0;
i <
len; ++
i) {
2414 int distx = (fx & 0x0000ffff) >> 8;
2415 int disty = (fy & 0x0000ffff) >> 8;
2423 for (
int i = 0;
i <
len; ++
i) {
2424 uint tl = buf1[
i * 2 + 0];
2426 uint bl = buf2[
i * 2 + 0];
2427 uint br = buf2[
i * 2 + 1];
2429 int distx = ((fx & 0x0000ffff) + 0x0800) >> 12;
2430 int disty = ((fy & 0x0000ffff) + 0x0800) >> 12;
2443 const auto fetcher = fetchTransformedBilinear_slow_fetcher<blendType,bpp,uint>;
2462 fetcher(buf1, buf2, distxs, distys,
len,
data->texture, fx, fy, fw, fdx, fdy, fdw);
2464 layout->convertToARGB32PM(buf1,
len * 2, clut);
2465 layout->convertToARGB32PM(buf2,
len * 2, clut);
2467 for (
int i = 0;
i <
len; ++
i) {
2468 const int distx = distxs[
i] >> 8;
2469 const int disty = distys[
i] >> 8;
2481#if QT_CONFIG(raster_64bit)
2482template<TextureBlendType blendType>
2487 const auto *clut =
data->texture.colorTable;
2510 const auto fetcher =
2512 ? fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP32, uint>
2518 const int disty = (fy & 0x0000ffff);
2519#if defined(__SSE2__)
2520 const __m128i vdy = _mm_set1_epi16(disty);
2521 const __m128i vidy = _mm_set1_epi16(0x10000 - disty);
2523 fetcher(sbuf1, sbuf2,
len,
data->texture, fx, fy, fdx, fdy);
2525 convert(buf1, sbuf1,
len * 2, clut,
nullptr);
2527 convert(buf2, sbuf2,
len * 2, clut,
nullptr);
2529 for (
int i = 0;
i <
len; ++
i) {
2530 const int distx = (fx & 0x0000ffff);
2531#if defined(__SSE2__)
2532 __m128i vt = _mm_loadu_si128((
const __m128i*)(buf1 +
i*2));
2534 __m128i vb = _mm_loadu_si128((
const __m128i*)(buf2 +
i*2));
2535 vt = _mm_mulhi_epu16(vt, vidy);
2536 vb = _mm_mulhi_epu16(vb, vdy);
2537 vt = _mm_add_epi16(vt, vb);
2540 const __m128i vdistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(distx), _MM_SHUFFLE(0, 0, 0, 0));
2541 const __m128i vidistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(0x10000 - distx), _MM_SHUFFLE(0, 0, 0, 0));
2542 vt = _mm_mulhi_epu16(vt, _mm_unpacklo_epi64(vidistx, vdistx));
2543 vt = _mm_add_epi16(vt, _mm_srli_si128(vt, 8));
2545 _mm_storel_epi64((__m128i*)(
b+
i), vt);
2558 fetcher(sbuf1, sbuf2,
len,
data->texture, fx, fy, fdx, fdy);
2560 convert(buf1, sbuf1,
len * 2, clut,
nullptr);
2561 convert(buf2, sbuf2,
len * 2, clut,
nullptr);
2563 for (
int i = 0;
i <
len; ++
i) {
2564 const int distx = (fx & 0x0000ffff);
2565 const int disty = (fy & 0x0000ffff);
2576 const auto fetcher =
2578 ? fetchTransformedBilinear_slow_fetcher<blendType, QPixelLayout::BPP32, uint>
2594 fetcher(sbuf1, sbuf2, distxs, distys,
len,
data->texture, fx, fy, fw, fdx, fdy, fdw);
2596 convert(buf1, sbuf1,
len * 2, clut,
nullptr);
2597 convert(buf2, sbuf2,
len * 2, clut,
nullptr);
2599 for (
int i = 0;
i <
len; ++
i) {
2600 const int distx = distxs[
i];
2601 const int disty = distys[
i];
2612template<TextureBlendType blendType>
2616 const auto convert = convert64ToRGBA64PM[
data->texture.format];
2636 const auto fetcher = fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP64, QRgba64>;
2641 int disty = (fy & 0x0000ffff);
2642#if defined(__SSE2__)
2643 const __m128i vdy = _mm_set1_epi16(disty);
2644 const __m128i vidy = _mm_set1_epi16(0x10000 - disty);
2646 fetcher(buf1, buf2,
len,
data->texture, fx, fy, fdx, fdy);
2652 for (
int i = 0;
i <
len; ++
i) {
2653 int distx = (fx & 0x0000ffff);
2654#if defined(__SSE2__)
2655 __m128i vt = _mm_loadu_si128((
const __m128i*)(buf1 +
i*2));
2657 __m128i vb = _mm_loadu_si128((
const __m128i*)(buf2 +
i*2));
2658 vt = _mm_mulhi_epu16(vt, vidy);
2659 vb = _mm_mulhi_epu16(vb, vdy);
2660 vt = _mm_add_epi16(vt, vb);
2663 const __m128i vdistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(distx), _MM_SHUFFLE(0, 0, 0, 0));
2664 const __m128i vidistx = _mm_shufflelo_epi16(_mm_cvtsi32_si128(0x10000 - distx), _MM_SHUFFLE(0, 0, 0, 0));
2665 vt = _mm_mulhi_epu16(vt, _mm_unpacklo_epi64(vidistx, vdistx));
2666 vt = _mm_add_epi16(vt, _mm_srli_si128(vt, 8));
2668 _mm_storel_epi64((__m128i*)(
b+
i), vt);
2681 fetcher(buf1, buf2,
len,
data->texture, fx, fy, fdx, fdy);
2686 for (
int i = 0;
i <
len; ++
i) {
2687 int distx = (fx & 0x0000ffff);
2688 int disty = (fy & 0x0000ffff);
2699 const auto fetcher = fetchTransformedBilinear_slow_fetcher<blendType, QPixelLayout::BPP64, QRgba64>;
2714 fetcher(buf1, buf2, distxs, distys,
len,
data->texture, fx, fy, fw, fdx, fdy, fdw);
2719 for (
int i = 0;
i <
len; ++
i) {
2720 const int distx = distxs[
i];
2721 const int disty = distys[
i];
2732template<TextureBlendType blendType>
2737 const auto *clut =
data->texture.colorTable;
2760 const auto fetcher = fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgbaFloat32>;
2762 const bool skipsecond = (fdy == 0) && ((fy & 0x0000ffff) == 0);
2766 fetcher(sbuf1, sbuf2,
len,
data->texture, fx, fy, fdx, fdy);
2772 for (
int i = 0;
i <
len; ++
i) {
2773 const int distx = (fx & 0x0000ffff);
2774 const int disty = (fy & 0x0000ffff);
2784 const auto fetcher = fetchTransformedBilinear_slow_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgbaFloat32>;
2799 fetcher(sbuf1, sbuf2, distxs, distys,
len,
data->texture, fx, fy, fw, fdx, fdy, fdw);
2804 for (
int i = 0;
i <
len; ++
i) {
2805 const int distx = distxs[
i];
2806 const int disty = distys[
i];
2817template<TextureBlendType blendType>
2833#if QT_CONFIG(raster_fp)
2838 for (
int i = 0;
i <
len; ++
i) {
2839 const int distx = (fx & 0x0000ffff);
2840 const int disty = (fy & 0x0000ffff);
2841 b[
i] = interpolate_4_pixels_rgba32f(buf1 +
i*2, buf2 +
i*2, distx, disty);
2848 unsigned short *distxs,
2849 unsigned short *distys)
2851 for (
int i = 0;
i <
len; ++
i) {
2852 const int dx = distxs[
i];
2853 const int dy = distys[
i];
2854 b[
i] = interpolate_4_pixels_rgba32f(buf1 +
i*2, buf2 +
i*2, dx, dy);
2858template<TextureBlendType blendType>
2863 const auto *clut =
data->texture.colorTable;
2864 const auto convert = qConvertToRGBA32F[
data->texture.format];
2886 const auto fetcher =
2888 ? fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP32, uint>
2891 const bool skipsecond = (fdy == 0) && ((fy & 0x0000ffff) == 0);
2894 fetcher(sbuf1, sbuf2,
len,
data->texture, fx, fy, fdx, fdy);
2896 convert(buf1, sbuf1,
len * 2, clut,
nullptr);
2898 convert(buf2, sbuf2,
len * 2, clut,
nullptr);
2900 interpolate_simple_rgba32f(
b, buf1, buf2,
len, fx, fdx, fy, fdy);
2906 const auto fetcher =
2908 ? fetchTransformedBilinear_slow_fetcher<blendType, QPixelLayout::BPP32, uint>
2922 fetcher(sbuf1, sbuf2, distxs, distys,
len,
data->texture, fx, fy, fw, fdx, fdy, fdw);
2924 convert(buf1, sbuf1,
len * 2, clut,
nullptr);
2925 convert(buf2, sbuf2,
len * 2, clut,
nullptr);
2927 interpolate_perspective_rgba32f(
b, buf1, buf2,
len, distxs, distys);
2936template<TextureBlendType blendType>
2940 const auto convert = convert64ToRGBA32F[
data->texture.format];
2961 const auto fetcher = fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP64, quint64>;
2963 const bool skipsecond = (fdy == 0) && ((fy & 0x0000ffff) == 0);
2966 fetcher(sbuf1, sbuf2,
len,
data->texture, fx, fy, fdx, fdy);
2972 interpolate_simple_rgba32f(
b, buf1, buf2,
len, fx, fdx, fy, fdy);
2978 const auto fetcher = fetchTransformedBilinear_slow_fetcher<blendType, QPixelLayout::BPP64, quint64>;
2993 fetcher(sbuf1, sbuf2, distxs, distys,
len,
data->texture, fx, fy, fw, fdx, fdy, fdw);
2998 interpolate_perspective_rgba32f(
b, buf1, buf2,
len, distxs, distys);
3007template<TextureBlendType blendType>
3012 : convertRGBA32FToRGBA32F;
3031 const auto fetcher = fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgbaFloat32>;
3033 const bool skipsecond = (fdy == 0) && ((fy & 0x0000ffff) == 0);
3036 fetcher(buf1, buf2,
len,
data->texture, fx, fy, fdx, fdy);
3042 interpolate_simple_rgba32f(
b, buf1, buf2,
len, fx, fdx, fy, fdy);
3048 const auto fetcher = fetchTransformedBilinear_slow_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgbaFloat32>;
3063 fetcher(buf1, buf2, distxs, distys,
len,
data->texture, fx, fy, fw, fdx, fdy, fdw);
3068 interpolate_perspective_rgba32f(
b, buf1, buf2,
len, distxs, distys);
3077template<TextureBlendType blendType>
3139 fetchTransformed<BlendTransformed, QPixelLayout::BPPNone>,
3140 fetchTransformed<BlendTransformedTiled, QPixelLayout::BPPNone>,
3141 fetchTransformedBilinear<BlendTransformedBilinear, QPixelLayout::BPPNone>,
3142 fetchTransformedBilinear<BlendTransformedBilinearTiled, QPixelLayout::BPPNone>
3150 fetchTransformed<BlendTransformed, QPixelLayout::BPP32>,
3151 fetchTransformed<BlendTransformedTiled, QPixelLayout::BPP32>,
3152 fetchTransformedBilinearARGB32PM<BlendTransformedBilinear>,
3153 fetchTransformedBilinearARGB32PM<BlendTransformedBilinearTiled>
3161 fetchTransformed<BlendTransformed, QPixelLayout::BPP16>,
3162 fetchTransformed<BlendTransformedTiled, QPixelLayout::BPP16>,
3163 fetchTransformedBilinear<BlendTransformedBilinear, QPixelLayout::BPP16>,
3164 fetchTransformedBilinear<BlendTransformedBilinearTiled, QPixelLayout::BPP16>
3172 fetchTransformed<BlendTransformed, QPixelLayout::BPP32>,
3173 fetchTransformed<BlendTransformedTiled, QPixelLayout::BPP32>,
3174 fetchTransformedBilinear<BlendTransformedBilinear, QPixelLayout::BPP32>,
3175 fetchTransformedBilinear<BlendTransformedBilinearTiled, QPixelLayout::BPP32>
3193#if QT_CONFIG(raster_64bit)
3195 fetchUntransformed64,
3196 fetchUntransformed64,
3197 fetchTransformed64<BlendTransformed>,
3198 fetchTransformed64<BlendTransformedTiled>,
3199 fetchTransformedBilinear64<BlendTransformedBilinear>,
3200 fetchTransformedBilinear64<BlendTransformedBilinearTiled>
3203static_assert(std::size(sourceFetchGeneric64) ==
NBlendTypes);
3206 fetchUntransformedRGBA64PM,
3207 fetchUntransformedRGBA64PM,
3208 fetchTransformed64<BlendTransformed>,
3209 fetchTransformed64<BlendTransformedTiled>,
3210 fetchTransformedBilinear64<BlendTransformedBilinear>,
3211 fetchTransformedBilinear64<BlendTransformedBilinearTiled>
3214static_assert(std::size(sourceFetchRGBA64PM) ==
NBlendTypes);
3219 return sourceFetchRGBA64PM[blendType];
3220 return sourceFetchGeneric64[blendType];
3224#if QT_CONFIG(raster_fp)
3226 fetchUntransformedFP,
3227 fetchUntransformedFP,
3228 fetchTransformedFP<BlendTransformed>,
3229 fetchTransformedFP<BlendTransformedTiled>,
3230 fetchTransformedBilinearFP<BlendTransformedBilinear>,
3231 fetchTransformedBilinearFP<BlendTransformedBilinearTiled>
3234static_assert(std::size(sourceFetchGenericFP) ==
NBlendTypes);
3238 return sourceFetchGenericFP[blendType];
3243#define FIXPT_SIZE (1<<FIXPT_BITS)
3244#define FIXPT_MAX (INT_MAX >> (FIXPT_BITS + 1))
3252#if QT_CONFIG(raster_64bit)
3260#if QT_CONFIG(raster_fp)
3278 v->dx =
data->gradient.linear.end.x -
data->gradient.linear.origin.x;
3279 v->dy =
data->gradient.linear.end.y -
data->gradient.linear.origin.y;
3280 v->l =
v->dx *
v->dx +
v->dy *
v->dy;
3285 v->off = -
v->dx *
data->gradient.linear.origin.x -
v->dy *
data->gradient.linear.origin.y;
3309#if QT_CONFIG(raster_64bit)
3318 return qt_gradient_pixel64(&gradient,
v);
3322 return qt_gradient_pixel64_fixed(&gradient,
v);
3331#if QT_CONFIG(raster_fp)
3340 return qt_gradient_pixelFP(&gradient,
v);
3344 return qt_gradient_pixelFP_fixed(&gradient,
v);
3355template<
class GradientBase,
typename BlendType>
3382 if (inc >
qreal(-1e-5) && inc <
qreal(1e-5)) {
3393 *
buffer = GradientBase::fetchSingle(
data->gradient, t_fixed);
3394 t_fixed += inc_fixed;
3413 *
buffer = GradientBase::fetchSingle(
data->gradient,
t);
3430 return qt_fetch_linear_gradient_template<GradientBase32, uint>(
buffer, op,
data,
y,
x,
length);
3433#if QT_CONFIG(raster_64bit)
3437 return qt_fetch_linear_gradient_template<GradientBase64, QRgba64>(
buffer, op,
data,
y,
x,
length);
3440#if QT_CONFIG(raster_fp)
3444 return qt_fetch_linear_gradient_template<GradientBaseFP, QRgbaFloat32>(
buffer, op,
data,
y,
x,
length);
3450 v->dx =
data->gradient.radial.center.x -
data->gradient.radial.focal.x;
3451 v->dy =
data->gradient.radial.center.y -
data->gradient.radial.focal.y;
3453 v->dr =
data->gradient.radial.center.radius -
data->gradient.radial.focal.radius;
3454 v->sqrfr =
data->gradient.radial.focal.radius *
data->gradient.radial.focal.radius;
3456 v->a =
v->dr *
v->dr -
v->dx*
v->dx -
v->dy*
v->dy;
3461template <
class GradientBase>
3475 if (
data->gradient.radial.focal.radius + op->
radial.
dr *
w >= 0)
3476 result = GradientBase::fetchSingle(
data->gradient,
w);
3482 delta_det += delta_delta_det;
3492 result = GradientBase::fetchSingle(
data->gradient,
w);
3498 delta_det += delta_delta_det;
3508 return qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase32>,
uint>(
buffer, op,
data,
y,
x,
length);
3513#if QT_CONFIG(raster_64bit)
3521#if QT_CONFIG(raster_fp)
3529template <
class GradientBase,
typename BlendType>
3539 bool affine = !
data->m13 && !
data->m23;
3545 rx -=
data->gradient.conical.center.x;
3546 ry -=
data->gradient.conical.center.y;
3550 *
buffer = GradientBase::fetchSingle(
data->gradient, 1 -
angle * inv2pi);
3563 rx/rw -
data->gradient.conical.center.y)
3564 +
data->gradient.conical.angle;
3566 *
buffer = GradientBase::fetchSingle(
data->gradient, 1 -
angle * inv2pi);
3583 return qt_fetch_conical_gradient_template<GradientBase32, uint>(
buffer,
data,
y,
x,
length);
3586#if QT_CONFIG(raster_64bit)
3590 return qt_fetch_conical_gradient_template<GradientBase64, QRgba64>(
buffer,
data,
y,
x,
length);
3594#if QT_CONFIG(raster_fp)
3598 return qt_fetch_conical_gradient_template<GradientBaseFP, QRgbaFloat32>(
buffer,
data,
y,
x,
length);
3607#if QT_CONFIG(raster_64bit)
3610#if QT_CONFIG(raster_fp)
3619#if QT_CONFIG(raster_64bit)
3622#if QT_CONFIG(raster_fp)
3636 else if (
data->bilinear)
3652 bool solidSource =
false;
3653 switch(
data->type) {
3655 solidSource =
data->solidColor.alphaF() >= 1.0f;
3661 solidSource = !
data->gradient.alphaColor;
3664#if QT_CONFIG(raster_64bit)
3665 op.
srcFetch64 = qt_fetch_linear_gradient_rgb64;
3667#if QT_CONFIG(raster_fp)
3668 op.
srcFetchFP = qt_fetch_linear_gradient_rgbfp;
3672 solidSource = !
data->gradient.alphaColor;
3675#if QT_CONFIG(raster_64bit)
3676 op.
srcFetch64 = qt_fetch_radial_gradient_rgb64;
3678#if QT_CONFIG(raster_fp)
3679 op.
srcFetchFP = qt_fetch_radial_gradient_rgbfp;
3683 solidSource = !
data->gradient.alphaColor;
3685#if QT_CONFIG(raster_64bit)
3686 op.
srcFetch64 = qt_fetch_conical_gradient_rgb64;
3688#if QT_CONFIG(raster_fp)
3689 op.
srcFetchFP = qt_fetch_conical_gradient_rgbfp;
3693 solidSource = !
data->texture.hasAlpha;
3695#if QT_CONFIG(raster_64bit)
3698#if QT_CONFIG(raster_fp)
3706#if !QT_CONFIG(raster_64bit)
3709#if !QT_CONFIG(raster_fp)
3713 op.
mode =
data->rasterBuffer->compositionMode;
3718#if QT_CONFIG(raster_64bit)
3723#if QT_CONFIG(raster_fp)
3730 const QT_FT_Span *lastSpan = spans + spanCount;
3731 bool alphaSpans =
false;
3732 while (spans < lastSpan) {
3739 if (!alphaSpans && spanCount > 0) {
3744#if QT_CONFIG(raster_64bit)
3748#if QT_CONFIG(raster_fp)
3758#if QT_CONFIG(raster_64bit)
3767#if QT_CONFIG(raster_fp)
3811 memset(dest + 1, dest[0],
length - 1);
3822#if defined(QT_USE_THREAD_PARALLEL_FILLS)
3823#define QT_THREAD_PARALLEL_FILLS(function) \
3824 const int segments = (count + 32) / 64; \
3825 QThreadPool *threadPool = QThreadPoolPrivate::qtGuiInstance(); \
3826 if (segments > 1 && qPixelLayouts[data->rasterBuffer->format].bpp >= QPixelLayout::BPP8 \
3827 && threadPool && !threadPool->contains(QThread::currentThread())) { \
3828 QSemaphore semaphore; \
3830 for (int i = 0; i < segments; ++i) { \
3831 int cn = (count - c) / (segments - i); \
3832 threadPool->start([&, c, cn]() { \
3833 function(c, c + cn); \
3834 semaphore.release(1); \
3838 semaphore.acquire(segments); \
3842#define QT_THREAD_PARALLEL_FILLS(function) function(0, count)
3853 auto function = [=] (
int cStart,
int cEnd) {
3855 for (
int c = cStart;
c < cEnd; ++
c) {
3893 }
else if (spans->
len > 16) {
3898 int ialpha = 255 - spans->
coverage;
3899 for (
int i = 0;
i < spans->
len; ++
i)
3907 auto function = [=] (
int cStart,
int cEnd) {
3908 for (
int c = cStart;
c < cEnd; ++
c) {
3918#if QT_CONFIG(raster_64bit)
3922 qCDebug(lcQtGuiDrawHelper,
"blend_color_generic_rgb64: unsupported 64bit blend attempted, falling back to 32-bit");
3930 auto function = [=, &op] (
int cStart,
int cEnd)
3933 for (
int c = cStart;
c < cEnd; ++
c) {
3962#if QT_CONFIG(raster_fp)
3966 qCDebug(lcQtGuiDrawHelper,
"blend_color_generic_fp: unsupported 4xF16 blend attempted, falling back to 32-bit");
3971 data->solidColor.getRgbF(&
r, &
g, &
b, &
a);
3976 auto function = [=, &op] (
int cStart,
int cEnd)
3979 for (
int c = cStart;
c < cEnd; ++
c) {
4006template <
typename T>
4012 auto function = [=, &op] (
int cStart,
int cEnd)
4014 T handler(
data, op);
4016 for (
int c = cStart;
c < cEnd;) {
4017 if (!spans[
c].
len) {
4022 const int y = spans[
c].
y;
4024 const bool fetchDest = !solidSource || spans[
c].
coverage < 255;
4027 for (
int i =
c + 1;
i < cEnd && spans[
i].
y ==
y && spans[
i].
x ==
right && fetchDest == (!solidSource || spans[
i].
coverage < 255); ++
i)
4035 int process_length = l;
4038 const auto *
src = handler.fetch(process_x,
y, process_length, fetchDest);
4041 if (
x == spans[
c].
x)
4042 coverage = (spans[
c].
coverage * const_alpha) >> 8;
4056 handler.store(process_x,
y, process_length);
4086 return op.srcFetch(src_buffer, &op,
data,
y,
x,
len);
4097 op.destStore(
data->rasterBuffer,
x,
y, dest,
len);
4101#if QT_CONFIG(raster_64bit)
4102class BlendSrcGenericRGB64 :
public QBlendBase
4115 return op.func64 && op.destFetch64;
4118 const QRgba64 *fetch(
int x,
int y,
int len,
bool fetchDest)
4120 if (fetchDest || op.destFetch64 == destFetchRGB64)
4124 return op.srcFetch64(src_buffer, &op,
data,
y,
x,
len);
4132 void store(
int x,
int y,
int len)
4135 op.destStore64(
data->rasterBuffer,
x,
y, dest,
len);
4140#if QT_CONFIG(raster_fp)
4141class BlendSrcGenericRGBFP :
public QBlendBase
4154 return op.funcFP && op.destFetchFP && op.srcFetchFP;
4159 if (fetchDest || op.destFetchFP == destFetchRGBFP)
4163 return op.srcFetchFP(src_buffer, &op,
data,
y,
x,
len);
4171 void store(
int x,
int y,
int len)
4174 op.destStoreFP(
data->rasterBuffer,
x,
y, dest,
len);
4183 handleSpans<BlendSrcGeneric>(
count, spans,
data, op);
4186#if QT_CONFIG(raster_64bit)
4187static void blend_src_generic_rgb64(
int count,
const QT_FT_Span *spans,
void *userData)
4192 handleSpans<BlendSrcGenericRGB64>(
count, spans,
data, op);
4194 qCDebug(lcQtGuiDrawHelper,
"blend_src_generic_rgb64: unsupported 64-bit blend attempted, falling back to 32-bit");
4195 handleSpans<BlendSrcGeneric>(
count, spans,
data, op);
4200#if QT_CONFIG(raster_fp)
4201static void blend_src_generic_fp(
int count,
const QT_FT_Span *spans,
void *userData)
4206 handleSpans<BlendSrcGenericRGBFP>(
count, spans,
data, op);
4208 qCDebug(lcQtGuiDrawHelper,
"blend_src_generic_fp: unsupported 4xFP blend attempted, falling back to 32-bit");
4209 handleSpans<BlendSrcGeneric>(
count, spans,
data, op);
4220 const int image_width =
data->texture.width;
4221 const int image_height =
data->texture.height;
4222 const int const_alpha =
data->texture.const_alpha;
4227 auto function = [=, &op] (
int cStart,
int cEnd)
4231 for (
int c = cStart;
c < cEnd; ++
c) {
4237 int sy = yoff + spans[
c].
y;
4238 const bool fetchDest = !solidSource || spans[
c].
coverage < 255;
4239 if (sy >= 0 && sy < image_height && sx < image_width) {
4245 if (sx +
length > image_width)
4246 length = image_width - sx;
4248 const int coverage = (spans[
c].
coverage * const_alpha) >> 8;
4253 op.
func(dest,
src, l, coverage);
4267#if QT_CONFIG(raster_64bit)
4268static void blend_untransformed_generic_rgb64(
int count,
const QT_FT_Span *spans,
void *userData)
4274 qCDebug(lcQtGuiDrawHelper,
"blend_untransformed_generic_rgb64: unsupported 64-bit blend attempted, falling back to 32-bit");
4278 const int image_width =
data->texture.width;
4279 const int image_height =
data->texture.height;
4280 const int const_alpha =
data->texture.const_alpha;
4285 auto function = [=, &op] (
int cStart,
int cEnd)
4289 for (
int c = cStart;
c < cEnd; ++
c) {
4295 int sy = yoff + spans[
c].
y;
4296 const bool fetchDest = !solidSource || spans[
c].
coverage < 255;
4297 if (sy >= 0 && sy < image_height && sx < image_width) {
4303 if (sx +
length > image_width)
4304 length = image_width - sx;
4306 const int coverage = (spans[
c].
coverage * const_alpha) >> 8;
4326#if QT_CONFIG(raster_fp)
4327static void blend_untransformed_generic_fp(
int count,
const QT_FT_Span *spans,
void *userData)
4333 qCDebug(lcQtGuiDrawHelper,
"blend_untransformed_generic_rgbaf16: unsupported 4xFP16 blend attempted, falling back to 32-bit");
4337 const int image_width =
data->texture.width;
4338 const int image_height =
data->texture.height;
4343 auto function = [=, &op] (
int cStart,
int cEnd)
4347 for (
int c = cStart;
c < cEnd; ++
c) {
4353 int sy = yoff + spans[
c].
y;
4354 const bool fetchDest = !solidSource || spans[
c].
coverage < 255;
4355 if (sy >= 0 && sy < image_height && sx < image_width) {
4361 if (sx +
length > image_width)
4362 length = image_width - sx;
4364 const int coverage = (spans[
c].
coverage *
data->texture.const_alpha) >> 8;
4395 const int image_width =
data->texture.width;
4396 const int image_height =
data->texture.height;
4397 const int const_alpha =
data->texture.const_alpha;
4401 auto function = [=, &op] (
int cStart,
int cEnd)
4403 for (
int c = cStart;
c < cEnd; ++
c) {
4409 int sy = yoff + spans[
c].
y;
4410 if (sy >= 0 && sy < image_height && sx < image_width) {
4416 if (sx +
length > image_width)
4417 length = image_width - sx;
4419 const int coverage = (spans[
c].
coverage * const_alpha) >> 8;
4433 quint16 t = ((((
x & 0x07e0) *
a) + ((
y & 0x07e0) *
b)) >> 5) & 0x07e0;
4434 t |= ((((
x & 0xf81f) *
a) + ((
y & 0xf81f) *
b)) >> 5) & 0xf81f;
4443 t = ((((
x & 0xf81f07e0) >> 5) *
a) + (((
y & 0xf81f07e0) >> 5) *
b)) & 0xf81f07e0;
4444 t |= ((((
x & 0x07e0f81f) *
a) + ((
y & 0x07e0f81f) *
b)) >> 5) & 0x07e0f81f;
4454 const int dstAlign = ((
quintptr)dest) & 0x3;
4462 int length32 =
length >> 1;
4463 if (length32 && srcAlign == 0) {
4464 while (length32--) {
4494 const int image_width =
data->texture.width;
4495 const int image_height =
data->texture.height;
4499 auto function = [=](
int cStart,
int cEnd)
4501 for (
int c = cStart;
c < cEnd; ++
c) {
4511 int sy = yoff + spans[
c].
y;
4512 if (sy >= 0 && sy < image_height && sx < image_width) {
4518 if (sx +
length > image_width)
4519 length = image_width - sx;
4523 if (coverage == 255) {
4544 const int image_width =
data->texture.width;
4545 const int image_height =
data->texture.height;
4546 const int const_alpha =
data->texture.const_alpha;
4548 int yoff = -
qRound(-
data->dy) % image_height;
4551 xoff += image_width;
4553 yoff += image_height;
4555 auto function = [=, &op](
int cStart,
int cEnd)
4559 for (
int c = cStart;
c < cEnd; ++
c) {
4562 int sx = (xoff + spans[
c].
x) % image_width;
4563 int sy = (spans[
c].
y + yoff) % image_height;
4569 const int coverage = (spans[
c].
coverage * const_alpha) >> 8;
4576 op.
func(dest,
src, l, coverage);
4582 if (sx >= image_width)
4590#if QT_CONFIG(raster_64bit)
4591static void blend_tiled_generic_rgb64(
int count,
const QT_FT_Span *spans,
void *userData)
4597 qCDebug(lcQtGuiDrawHelper,
"blend_tiled_generic_rgb64: unsupported 64-bit blend attempted, falling back to 32-bit");
4601 const int image_width =
data->texture.width;
4602 const int image_height =
data->texture.height;
4604 int yoff = -
qRound(-
data->dy) % image_height;
4607 xoff += image_width;
4609 yoff += image_height;
4620 int sx = (xoff + spans->
x) % image_width;
4621 int sy = (spans->
y + yoff) % image_height;
4628 if (sx > 0 && sl > 0) {
4629 int l =
qMin(image_width - sx, sl);
4635 if (sx >= image_width)
4645 if (sx >= image_width)
4649 uint *dest =
reinterpret_cast<uint *
>(
data->rasterBuffer->scanLine(
y)) +
x - image_width;
4650 for (
int i = image_width;
i <
length; ++
i)
4651 dest[
i] = dest[
i - image_width];
4653 quint64 *dest =
reinterpret_cast<quint64 *
>(
data->rasterBuffer->scanLine(
y)) +
x - image_width;
4654 for (
int i = image_width;
i <
length; ++
i)
4655 dest[
i] = dest[
i - image_width];
4662 auto function = [=, &op](
int cStart,
int cEnd)
4666 for (
int c = cStart;
c < cEnd; ++
c) {
4669 int sx = (xoff + spans[
c].
x) % image_width;
4670 int sy = (spans[
c].
y + yoff) % image_height;
4676 const int coverage = (spans[
c].
coverage *
data->texture.const_alpha) >> 8;
4689 if (sx >= image_width)
4698#if QT_CONFIG(raster_fp)
4699static void blend_tiled_generic_fp(
int count,
const QT_FT_Span *spans,
void *userData)
4705 qCDebug(lcQtGuiDrawHelper,
"blend_tiled_generic_fp: unsupported 4xFP blend attempted, falling back to 32-bit");
4709 const int image_width =
data->texture.width;
4710 const int image_height =
data->texture.height;
4712 int yoff = -
qRound(-
data->dy) % image_height;
4715 xoff += image_width;
4717 yoff += image_height;
4721 auto function = [=, &op](
int cStart,
int cEnd)
4725 for (
int c = cStart;
c < cEnd; ++
c) {
4728 int sx = (xoff + spans[
c].
x) % image_width;
4729 int sy = (spans[
c].
y + yoff) % image_height;
4735 const int coverage = (spans[
c].
coverage *
data->texture.const_alpha) >> 8;
4748 if (sx >= image_width)
4768 const int image_width =
data->texture.width;
4769 const int image_height =
data->texture.height;
4771 int yoff = -
qRound(-
data->dy) % image_height;
4774 xoff += image_width;
4776 yoff += image_height;
4778 const int const_alpha =
data->texture.const_alpha;
4780 auto function = [=] (
int cStart,
int cEnd) {
4781 for (
int c = cStart;
c < cEnd; ++
c) {
4784 int sx = (xoff + spans[
c].
x) % image_width;
4785 int sy = (spans[
c].
y + yoff) % image_height;
4791 const int coverage = (spans[
c].
coverage * const_alpha) >> 8;
4802 if (sx >= image_width)
4823 const int image_width =
data->texture.width;
4824 const int image_height =
data->texture.height;
4826 int yoff = -
qRound(-
data->dy) % image_height;
4829 xoff += image_width;
4831 yoff += image_height;
4833 const int const_alpha =
data->texture.const_alpha;
4834 auto function = [=] (
int cStart,
int cEnd) {
4835 for (
int c = cStart;
c < cEnd; ++
c) {
4842 int sx = (xoff + spans[
c].
x) % image_width;
4843 int sy = (spans[
c].
y + yoff) % image_height;
4849 if (coverage == 255) {
4863 if (sx >= image_width)
4873 int copy_image_width =
qMin(image_width,
int(spans[
c].
len));
4877 while (copy_image_width <
length) {
4878 memcpy(dest,
src, copy_image_width *
sizeof(
quint16));
4879 dest += copy_image_width;
4880 length -= copy_image_width;
4881 copy_image_width *= 2;
4899 if (sx >= image_width)
4937#if QT_CONFIG(raster_64bit)
4939 blend_untransformed_generic_rgb64,
4940 blend_tiled_generic_rgb64,
4941 blend_src_generic_rgb64,
4942 blend_src_generic_rgb64,
4943 blend_src_generic_rgb64,
4944 blend_src_generic_rgb64
4948#if QT_CONFIG(raster_fp)
4950 blend_untransformed_generic_fp,
4951 blend_tiled_generic_fp,
4952 blend_src_generic_fp,
4953 blend_src_generic_fp,
4954 blend_src_generic_fp,
4955 blend_src_generic_fp
4963 switch (
data->rasterBuffer->format) {
4965 Q_UNREACHABLE_RETURN();
4972#if defined(__SSE2__) || defined(__ARM_NEON__) || (Q_PROCESSOR_WORDSIZE == 8)
4984#if !QT_CONFIG(raster_fp)
4992#if QT_CONFIG(raster_64bit)
4993 proc = processTextureSpansGeneric64[blendType];
4996#if QT_CONFIG(raster_fp)
5003 proc = processTextureSpansGenericFP[blendType];
5010 proc(
count, spans, userData);
5016 int *pyinc,
int *poff)
5036 && (std::fabs(ryinc * spans->
y + roff) <
limit)
5037 && (std::fabs(ryinc * (spans +
count - 1)->y + roff) <
limit)) {
5038 *pyinc = int(ryinc);
5055 int yinc(0), off(0);
5073template<ProcessSpans blend_color>
5081 int yinc(0), off(0);
5088#if QT_CONFIG(raster_64bit)
5089 data->solidColor = qt_gradient_pixel64_fixed(&
data->gradient, yinc *
y + off);
5093 blend_color(1, spans, userData);
5102 bool isVerticalGradient =
5105 data->gradient.linear.end.x ==
data->gradient.linear.origin.x;
5106 switch (
data->rasterBuffer->format) {
5114#if defined(__SSE2__) || defined(__ARM_NEON__) || (Q_PROCESSOR_WORDSIZE == 8)
5125#if !QT_CONFIG(raster_fp)
5133#if QT_CONFIG(raster_64bit)
5134 if (isVerticalGradient && blend_vertical_gradient<blend_color_generic_rgb64>(
count, spans, userData))
5136 return blend_src_generic_rgb64(
count, spans, userData);
5138#if QT_CONFIG(raster_fp)
5145 if (isVerticalGradient && blend_vertical_gradient<blend_color_generic_fp>(
count, spans, userData))
5147 return blend_src_generic_fp(
count, spans, userData);
5150 if (isVerticalGradient && blend_vertical_gradient<blend_color_generic>(
count, spans, userData))
5157template <
class DST>
static
5161 int mapWidth,
int mapHeight,
int mapStride)
5163 DST *dest =
reinterpret_cast<DST *
>(rasterBuffer->
scanLine(
y)) +
x;
5164 const int destStride = rasterBuffer->
stride<DST>();
5167 while (--mapHeight >= 0) {
5170 for (
int x = 0;
x < mapWidth;
x += 8) {
5172 for (
int i = 0;
i < 8; ++
i) {
5197 while (--mapHeight >= 0) {
5222 int mapWidth,
int mapHeight,
int mapStride)
5224 qt_bitmapblit_template<quint32>(rasterBuffer,
x,
y,
color.toArgb32(),
5225 map, mapWidth, mapHeight, mapStride);
5231 int mapWidth,
int mapHeight,
int mapStride)
5233 qt_bitmapblit_template<quint32>(rasterBuffer,
x,
y,
ARGB2RGBA(
color.toArgb32()),
5234 map, mapWidth, mapHeight, mapStride);
5237template<QtPixelOrder PixelOrder>
5241 int mapWidth,
int mapHeight,
int mapStride)
5243 qt_bitmapblit_template<quint32>(rasterBuffer,
x,
y, qConvertRgb64ToRgb30<PixelOrder>(
color),
5244 map, mapWidth, mapHeight, mapStride);
5250 int mapWidth,
int mapHeight,
int mapStride)
5252 qt_bitmapblit_template<quint16>(rasterBuffer,
x,
y,
color.toRgb16(),
5253 map, mapWidth, mapHeight, mapStride);
5263 *
dst = colorProfile ? colorProfile->fromLinear64(blend) :
toArgb32(blend);
5268 if (coverage == 0) {
5270 }
else if (coverage == 255 || !colorProfile) {
5272 }
else if (*
dst < 0xff000000) {
5275 }
else if (
src >= 0xff000000) {
5287#if QT_CONFIG(raster_64bit)
5295 dstColor = colorProfile->toLinear(dstColor);
5304 dstColor = colorProfile->fromLinear(dstColor);
5313 if (coverage == 0) {
5315 }
else if (coverage == 255) {
5317 }
else if (
src.isOpaque()) {
5325 s = colorProfile->toLinear(
s);
5333 int mapWidth,
int mapHeight,
int mapStride,
5334 const QClipData *clip,
bool useGammaCorrection)
5336 if (
color.isTransparent())
5341 if (useGammaCorrection)
5345 if (colorProfile &&
color.isOpaque())
5346 srcColor = colorProfile->toLinear(srcColor);
5353 for (
int ly = 0; ly < mapHeight; ++ly) {
5359 for (
int j=0;
j < l; ++
j) {
5360 const int coverage =
map[
j + (
i -
x)];
5361 alphamapblend_generic(coverage, dest,
j, srcColor,
color, colorProfile);
5364 destStore64(rasterBuffer,
i,
y + ly, dest, l);
5383 int start = qMax<int>(
x, clip.
x);
5384 int end = qMin<int>(
x + mapWidth, clip.
x + clip.
len);
5391 const int coverage =
map[xp -
x];
5392 alphamapblend_generic(coverage, dest, xp -
start, srcColor,
color, colorProfile);
5405 int mapWidth,
int mapHeight,
int mapStride,
5406 const QClipData *clip,
bool useGammaCorrection)
5408 if (
color.isTransparent())
5415 if (useGammaCorrection)
5419 if (colorProfile &&
color.isOpaque())
5420 srcColor = colorProfile->toLinear(srcColor);
5427 for (
int ly = 0; ly < mapHeight; ++ly) {
5433 for (
int j=0;
j < l; ++
j) {
5434 const int coverage =
map[
j + (
i -
x)];
5457 int start = qMax<int>(
x, clip.
x);
5458 int end = qMin<int>(
x + mapWidth, clip.
x + clip.
len);
5465 const int coverage =
map[xp -
x];
5479 if (coverage == 0) {
5481 }
else if (coverage == 255) {
5492 int mapWidth,
int mapHeight,
int mapStride,
5493 const QClipData *clip,
bool useGammaCorrection)
5495 if (useGammaCorrection || !
color.isOpaque()) {
5505 while (--mapHeight >= 0) {
5506 for (
int i = 0;
i < mapWidth; ++
i)
5525 int start = qMax<int>(
x, clip.
x);
5526 int end = qMin<int>(
x + mapWidth, clip.
x + clip.
len);
5539 int mapWidth,
int mapHeight,
int mapStride,
5540 const QClipData *clip,
bool useGammaCorrection)
5545 if (
color.isTransparent())
5550 if (useGammaCorrection)
5554 if (colorProfile &&
color.isOpaque())
5555 srcColor = colorProfile->toLinear(srcColor);
5559 while (--mapHeight >= 0) {
5560 for (
int i = 0;
i < mapWidth; ++
i) {
5561 const int coverage =
map[
i];
5582 int start = qMax<int>(
x, clip.
x);
5583 int end = qMin<int>(
x + mapWidth, clip.
x + clip.
len);
5586 const int coverage =
map[xp -
x];
5607 *
dst = colorProfile ? colorProfile->fromLinear64(blend) :
toArgb32(blend);
5612#if defined(__SSE2__)
5613 __m128i vd = _mm_cvtsi32_si128(
d);
5614 __m128i vs = _mm_cvtsi32_si128(
s);
5615 __m128i va = _mm_cvtsi32_si128(rgbAlpha);
5616 const __m128i vz = _mm_setzero_si128();
5617 vd = _mm_unpacklo_epi8(vd, vz);
5618 vs = _mm_unpacklo_epi8(vs, vz);
5619 va = _mm_unpacklo_epi8(va, vz);
5620 __m128i vb = _mm_xor_si128(_mm_set1_epi16(255), va);
5621 vs = _mm_mullo_epi16(vs, va);
5622 vd = _mm_mullo_epi16(vd, vb);
5623 vd = _mm_add_epi16(vd, vs);
5624 vd = _mm_add_epi16(vd, _mm_srli_epi16(vd, 8));
5625 vd = _mm_add_epi16(vd, _mm_set1_epi16(0x80));
5626 vd = _mm_srli_epi16(vd, 8);
5627 vd = _mm_packus_epi16(vd, vd);
5628 return _mm_cvtsi128_si32(vd);
5630 const int dr =
qRed(
d);
5634 const int sr =
qRed(
s);
5638 const int mr =
qRed(rgbAlpha);
5639 const int mg =
qGreen(rgbAlpha);
5640 const int mb =
qBlue(rgbAlpha);
5642 const int nr =
qt_div_255(sr * mr + dr * (255 - mr));
5643 const int ng =
qt_div_255(sg * mg + dg * (255 - mg));
5646 return 0xff000000 | (nr << 16) | (ng << 8) | nb;
5652 if (coverage == 0xff000000) {
5654 }
else if (coverage == 0xffffffff &&
qAlpha(
src) == 255) {
5656 }
else if (*
dst < 0xff000000) {
5659 }
else if (!colorProfile) {
5665 }
else if (srcLinear.isOpaque()) {
5677#if QT_CONFIG(raster_64bit)
5681 const QRgba64 dlinear = colorProfile ? colorProfile->toLinear(
dst) :
dst;
5685 dst = colorProfile ? colorProfile->fromLinear(blend) : blend;
5690 if (coverage == 0xff000000) {
5692 }
else if (coverage == 0xffffffff) {
5694 }
else if (!dest[
x].isOpaque()) {
5696 alphamapblend_generic(
qRgbAvg(coverage), dest,
x, srcLinear,
src, colorProfile);
5697 }
else if (
src.isOpaque()) {
5705 s = colorProfile->toLinear(
s);
5712 const uint *
src,
int mapWidth,
int mapHeight,
int srcStride,
5713 const QClipData *clip,
bool useGammaCorrection)
5715 if (
color.isTransparent())
5720 if (useGammaCorrection)
5724 if (colorProfile &&
color.isOpaque())
5725 srcColor = colorProfile->toLinear(srcColor);
5732 for (
int ly = 0; ly < mapHeight; ++ly) {
5738 for (
int j=0;
j < l; ++
j) {
5740 alphargbblend_generic(coverage, dest,
j, srcColor,
color, colorProfile);
5743 destStore64(rasterBuffer,
i,
y + ly, dest, l);
5762 int start = qMax<int>(
x, clip.
x);
5763 int end = qMin<int>(
x + mapWidth, clip.
x + clip.
len);
5771 alphargbblend_generic(coverage, dest, xp -
start, srcColor,
color, colorProfile);
5783 const uint *
src,
int mapWidth,
int mapHeight,
int srcStride,
5784 const QClipData *clip,
bool useGammaCorrection)
5786 if (
color.isTransparent())
5793 if (useGammaCorrection)
5797 if (colorProfile &&
color.isOpaque())
5798 srcColor = colorProfile->toLinear(srcColor);
5805 for (
int ly = 0; ly < mapHeight; ++ly) {
5811 for (
int j=0;
j < l; ++
j) {
5835 int start = qMax<int>(
x, clip.
x);
5836 int end = qMin<int>(
x + mapWidth, clip.
x + clip.
len);
5857 const uint *
src,
int mapWidth,
int mapHeight,
int srcStride,
5858 const QClipData *clip,
bool useGammaCorrection)
5860 if (
color.isTransparent())
5867 if (useGammaCorrection)
5871 if (colorProfile &&
color.isOpaque())
5872 srcColor = colorProfile->toLinear(srcColor);
5877 while (--mapHeight >= 0) {
5878 for (
int i = 0;
i < mapWidth; ++
i) {
5901 int start = qMax<int>(
x, clip.
x);
5902 int end = qMin<int>(
x + mapWidth, clip.
x + clip.
len);
5919 qt_rectfill<quint32>(
reinterpret_cast<quint32 *
>(rasterBuffer->
buffer()),
5930 layout.storeFromARGB32PM(
reinterpret_cast<uchar *
>(&c16), &c32, 0, 1,
nullptr,
nullptr);
5931 qt_rectfill<quint16>(
reinterpret_cast<quint16 *
>(rasterBuffer->
buffer()),
5942 layout.storeFromARGB32PM(
reinterpret_cast<uchar *
>(&c24), &c32, 0, 1,
nullptr,
nullptr);
5943 qt_rectfill<quint24>(
reinterpret_cast<quint24 *
>(rasterBuffer->
buffer()),
5951 qt_rectfill<quint32>(
reinterpret_cast<quint32 *
>(rasterBuffer->
buffer()),
5959 qt_rectfill<quint32>(
reinterpret_cast<quint32 *
>(rasterBuffer->
buffer()),
5967 qt_rectfill<quint32>(
reinterpret_cast<quint32 *
>(rasterBuffer->
buffer()),
5971template<QtPixelOrder PixelOrder>
5976 qt_rectfill<quint32>(
reinterpret_cast<quint32 *
>(rasterBuffer->
buffer()),
5984 qt_rectfill<quint8>(
reinterpret_cast<quint8 *
>(rasterBuffer->
buffer()),
5992 qt_rectfill<quint8>(
reinterpret_cast<quint8 *
>(rasterBuffer->
buffer()),
6002 store(
reinterpret_cast<uchar *
>(&c64), &
color, 0, 1,
nullptr,
nullptr);
6003 qt_rectfill<quint64>(
reinterpret_cast<quint64 *
>(rasterBuffer->
buffer()),
6013 store(
reinterpret_cast<uchar *
>(&
c), &
color, 0, 1,
nullptr,
nullptr);
6024 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr },
6028 nullptr,
nullptr,
nullptr,
nullptr
6033 nullptr,
nullptr,
nullptr,
nullptr
6038 nullptr,
nullptr,
nullptr,
nullptr
6163 qt_bitmapblit_rgb30<PixelOrderBGR>,
6166 qt_rectfill_rgb30<PixelOrderBGR>
6171 qt_bitmapblit_rgb30<PixelOrderBGR>,
6174 qt_rectfill_rgb30<PixelOrderBGR>
6179 qt_bitmapblit_rgb30<PixelOrderRGB>,
6182 qt_rectfill_rgb30<PixelOrderRGB>
6187 qt_bitmapblit_rgb30<PixelOrderRGB>,
6190 qt_rectfill_rgb30<PixelOrderRGB>
6300#if !defined(Q_PROCESSOR_X86)
6303 qt_memfill_template<quint64>(dest,
color,
count);
6307#if defined(QT_COMPILER_SUPPORTS_SSSE3) && defined(Q_CC_GNU) && !defined(Q_CC_CLANG)
6312# ifdef QT_COMPILER_SUPPORTS_SSSE3
6315 return qt_memfill24_ssse3(dest,
color,
count);
6332 for ( ; dest <= (
end - 4); dest += 4) {
6340 switch (
end - dest) {
6354 const int align =
quintptr(dest) & 0x3;
6367#if defined(Q_PROCESSOR_X86)
6370#elif !defined(__ARM_NEON__) && !defined(__MIPS_DSP__)
6373 qt_memfill_template<quint32>(dest,
color,
count);
6377#ifdef QT_COMPILER_SUPPORTS_SSE4_1
6388#if defined(Q_PROCESSOR_X86) && !defined(__SSE2__)
6391#elif defined(__SSE2__)
6404 extern void qt_scale_image_argb32_on_argb32_sse2(
uchar *destPixels,
int dbpl,
6405 const uchar *srcPixels,
int sbpl,
int srch,
6406 const QRectF &targetRect,
6407 const QRectF &sourceRect,
6415 extern void qt_blend_rgb32_on_rgb32_sse2(
uchar *destPixels,
int dbpl,
6416 const uchar *srcPixels,
int sbpl,
6419 extern void qt_blend_argb32_on_argb32_sse2(
uchar *destPixels,
int dbpl,
6420 const uchar *srcPixels,
int sbpl,
6449#ifdef QT_COMPILER_SUPPORTS_SSSE3
6451 extern void qt_blend_argb32_on_argb32_ssse3(
uchar *destPixels,
int dbpl,
6452 const uchar *srcPixels,
int sbpl,
6469#if defined(QT_COMPILER_SUPPORTS_SSE4_1)
6520#if QT_CONFIG(raster_64bit)
6524#if QT_CONFIG(raster_fp)
6535#if defined(QT_COMPILER_SUPPORTS_AVX2)
6539 extern void qt_blend_rgb32_on_rgb32_avx2(
uchar *destPixels,
int dbpl,
6540 const uchar *srcPixels,
int sbpl,
6541 int w,
int h,
int const_alpha);
6542 extern void qt_blend_argb32_on_argb32_avx2(
uchar *destPixels,
int dbpl,
6543 const uchar *srcPixels,
int sbpl,
6544 int w,
int h,
int const_alpha);
6560#if QT_CONFIG(raster_64bit)
6568#if QT_CONFIG(raster_fp)
6580 int &fx,
int &fy,
int fdx,
int );
6582 int &fx,
int &fy,
int fdx,
int );
6584 int &fx,
int &fy,
int fdx,
int fdy);
6630#if QT_CONFIG(raster_fp)
6644#if defined(__ARM_NEON__)
6649#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
6667#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
6703#if defined(ENABLE_PIXMAN_DRAWHELPERS)
6725#if defined(__MIPS_DSP__)
6760#if defined(__MIPS_DSPR2__)
struct capHdr __attribute__
const uint * fetch(int x, int y, int len, bool fetchDest)
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
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.
static QGuiApplicationPrivate * instance()
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 QRgba64 unpremultiplied() 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
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.
void qInitBlendFunctions()
SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFormats]
SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats]
SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats]
CompositionFunctionFP qt_functionForModeFP_C[]
CompositionFunctionSolid64 qt_functionForModeSolid64_C[]
CompositionFunctionSolid qt_functionForModeSolid_C[]
CompositionFunctionSolidFP qt_functionForModeSolidFP_C[]
CompositionFunction qt_functionForMode_C[]
CompositionFunction64 qt_functionForMode64_C[]
Q_CONSTRUCTOR_FUNCTION(qt_apple_check_os_version)
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
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
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)
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)
static void QT_FASTCALL intermediate_adder(uint *b, uint *end, const IntermediateBuffer &intermediate, int offset, int &fx, int fdx)
static SourceFetchProc sourceFetchAny32[]
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 DestStoreProc destStoreProc[]
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)
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 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 bool calculate_fixed_gradient_factors(int count, const QT_FT_Span *spans, const QSpanData *data, const LinearGradientValues &linear, int *pyinc, int *poff)
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)
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 sourceFetchARGB32PM[]
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 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 DestFetchProc destFetchProc[]
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
static SourceFetchProc sourceFetchAny16[]
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 bool blend_vertical_gradient_argb(int count, const QT_FT_Span *spans, void *userData)
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 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)
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)
static SourceFetchProc sourceFetchUntransformed[]
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)
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 alphamapblend_argb32(quint32 *dst, int coverage, QRgba64 srcLinear, quint32 src, const QColorTrcLut *colorProfile)
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 bool blend_vertical_gradient(int count, const QT_FT_Span *spans, void *userData)
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 const SourceFetchProc sourceFetchGeneric[]
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)
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
QPixelLayout qPixelLayouts[]
ConvertAndStorePixelsFunc64 qStoreFromRGBA64PM[]
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 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