| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/painting/qdrawhelper.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||
| 11 | - | |||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||
| 14 | enum { | - | ||||||||||||||||||||||||
| 15 | fixed_scale = 1 << 16, | - | ||||||||||||||||||||||||
| 16 | half_point = 1 << 15 | - | ||||||||||||||||||||||||
| 17 | }; | - | ||||||||||||||||||||||||
| 18 | - | |||||||||||||||||||||||||
| 19 | - | |||||||||||||||||||||||||
| 20 | static const int buffer_size = 2048; | - | ||||||||||||||||||||||||
| 21 | - | |||||||||||||||||||||||||
| 22 | template<QImage::Format> constexpr uint redWidth(); | - | ||||||||||||||||||||||||
| 23 | template<QImage::Format> constexpr uint redShift(); | - | ||||||||||||||||||||||||
| 24 | template<QImage::Format> constexpr uint greenWidth(); | - | ||||||||||||||||||||||||
| 25 | template<QImage::Format> constexpr uint greenShift(); | - | ||||||||||||||||||||||||
| 26 | template<QImage::Format> constexpr uint blueWidth(); | - | ||||||||||||||||||||||||
| 27 | template<QImage::Format> constexpr uint blueShift(); | - | ||||||||||||||||||||||||
| 28 | template<QImage::Format> constexpr uint alphaWidth(); | - | ||||||||||||||||||||||||
| 29 | template<QImage::Format> constexpr uint alphaShift(); | - | ||||||||||||||||||||||||
| 30 | - | |||||||||||||||||||||||||
| 31 | template<> constexpr uint redWidth<QImage::Format_RGB16>() { return 5; } | - | ||||||||||||||||||||||||
| 32 | template<> constexpr uint redWidth<QImage::Format_RGB444>() { return 4; } | - | ||||||||||||||||||||||||
| 33 | template<> constexpr uint redWidth<QImage::Format_RGB555>() { return 5; } | - | ||||||||||||||||||||||||
| 34 | template<> constexpr uint redWidth<QImage::Format_RGB666>() { return 6; } | - | ||||||||||||||||||||||||
| 35 | template<> constexpr uint redWidth<QImage::Format_RGB888>() { return 8; } | - | ||||||||||||||||||||||||
| 36 | template<> constexpr uint redWidth<QImage::Format_ARGB4444_Premultiplied>() { return 4; } | - | ||||||||||||||||||||||||
| 37 | template<> constexpr uint redWidth<QImage::Format_ARGB8555_Premultiplied>() { return 5; } | - | ||||||||||||||||||||||||
| 38 | template<> constexpr uint redWidth<QImage::Format_ARGB8565_Premultiplied>() { return 5; } | - | ||||||||||||||||||||||||
| 39 | template<> constexpr uint redWidth<QImage::Format_ARGB6666_Premultiplied>() { return 6; } | - | ||||||||||||||||||||||||
| 40 | template<> constexpr uint redShift<QImage::Format_RGB16>() { return 11; } | - | ||||||||||||||||||||||||
| 41 | template<> constexpr uint redShift<QImage::Format_RGB444>() { return 8; } | - | ||||||||||||||||||||||||
| 42 | template<> constexpr uint redShift<QImage::Format_RGB555>() { return 10; } | - | ||||||||||||||||||||||||
| 43 | template<> constexpr uint redShift<QImage::Format_RGB666>() { return 12; } | - | ||||||||||||||||||||||||
| 44 | template<> constexpr uint redShift<QImage::Format_RGB888>() { return 16; } | - | ||||||||||||||||||||||||
| 45 | template<> constexpr uint redShift<QImage::Format_ARGB4444_Premultiplied>() { return 8; } | - | ||||||||||||||||||||||||
| 46 | template<> constexpr uint redShift<QImage::Format_ARGB8555_Premultiplied>() { return 18; } | - | ||||||||||||||||||||||||
| 47 | template<> constexpr uint redShift<QImage::Format_ARGB8565_Premultiplied>() { return 19; } | - | ||||||||||||||||||||||||
| 48 | template<> constexpr uint redShift<QImage::Format_ARGB6666_Premultiplied>() { return 12; } | - | ||||||||||||||||||||||||
| 49 | template<> constexpr uint greenWidth<QImage::Format_RGB16>() { return 6; } | - | ||||||||||||||||||||||||
| 50 | template<> constexpr uint greenWidth<QImage::Format_RGB444>() { return 4; } | - | ||||||||||||||||||||||||
| 51 | template<> constexpr uint greenWidth<QImage::Format_RGB555>() { return 5; } | - | ||||||||||||||||||||||||
| 52 | template<> constexpr uint greenWidth<QImage::Format_RGB666>() { return 6; } | - | ||||||||||||||||||||||||
| 53 | template<> constexpr uint greenWidth<QImage::Format_RGB888>() { return 8; } | - | ||||||||||||||||||||||||
| 54 | template<> constexpr uint greenWidth<QImage::Format_ARGB4444_Premultiplied>() { return 4; } | - | ||||||||||||||||||||||||
| 55 | template<> constexpr uint greenWidth<QImage::Format_ARGB8555_Premultiplied>() { return 5; } | - | ||||||||||||||||||||||||
| 56 | template<> constexpr uint greenWidth<QImage::Format_ARGB8565_Premultiplied>() { return 6; } | - | ||||||||||||||||||||||||
| 57 | template<> constexpr uint greenWidth<QImage::Format_ARGB6666_Premultiplied>() { return 6; } | - | ||||||||||||||||||||||||
| 58 | template<> constexpr uint greenShift<QImage::Format_RGB16>() { return 5; } | - | ||||||||||||||||||||||||
| 59 | template<> constexpr uint greenShift<QImage::Format_RGB444>() { return 4; } | - | ||||||||||||||||||||||||
| 60 | template<> constexpr uint greenShift<QImage::Format_RGB555>() { return 5; } | - | ||||||||||||||||||||||||
| 61 | template<> constexpr uint greenShift<QImage::Format_RGB666>() { return 6; } | - | ||||||||||||||||||||||||
| 62 | template<> constexpr uint greenShift<QImage::Format_RGB888>() { return 8; } | - | ||||||||||||||||||||||||
| 63 | template<> constexpr uint greenShift<QImage::Format_ARGB4444_Premultiplied>() { return 4; } | - | ||||||||||||||||||||||||
| 64 | template<> constexpr uint greenShift<QImage::Format_ARGB8555_Premultiplied>() { return 13; } | - | ||||||||||||||||||||||||
| 65 | template<> constexpr uint greenShift<QImage::Format_ARGB8565_Premultiplied>() { return 13; } | - | ||||||||||||||||||||||||
| 66 | template<> constexpr uint greenShift<QImage::Format_ARGB6666_Premultiplied>() { return 6; } | - | ||||||||||||||||||||||||
| 67 | template<> constexpr uint blueWidth<QImage::Format_RGB16>() { return 5; } | - | ||||||||||||||||||||||||
| 68 | template<> constexpr uint blueWidth<QImage::Format_RGB444>() { return 4; } | - | ||||||||||||||||||||||||
| 69 | template<> constexpr uint blueWidth<QImage::Format_RGB555>() { return 5; } | - | ||||||||||||||||||||||||
| 70 | template<> constexpr uint blueWidth<QImage::Format_RGB666>() { return 6; } | - | ||||||||||||||||||||||||
| 71 | template<> constexpr uint blueWidth<QImage::Format_RGB888>() { return 8; } | - | ||||||||||||||||||||||||
| 72 | template<> constexpr uint blueWidth<QImage::Format_ARGB4444_Premultiplied>() { return 4; } | - | ||||||||||||||||||||||||
| 73 | template<> constexpr uint blueWidth<QImage::Format_ARGB8555_Premultiplied>() { return 5; } | - | ||||||||||||||||||||||||
| 74 | template<> constexpr uint blueWidth<QImage::Format_ARGB8565_Premultiplied>() { return 5; } | - | ||||||||||||||||||||||||
| 75 | template<> constexpr uint blueWidth<QImage::Format_ARGB6666_Premultiplied>() { return 6; } | - | ||||||||||||||||||||||||
| 76 | template<> constexpr uint blueShift<QImage::Format_RGB16>() { return 0; } | - | ||||||||||||||||||||||||
| 77 | template<> constexpr uint blueShift<QImage::Format_RGB444>() { return 0; } | - | ||||||||||||||||||||||||
| 78 | template<> constexpr uint blueShift<QImage::Format_RGB555>() { return 0; } | - | ||||||||||||||||||||||||
| 79 | template<> constexpr uint blueShift<QImage::Format_RGB666>() { return 0; } | - | ||||||||||||||||||||||||
| 80 | template<> constexpr uint blueShift<QImage::Format_RGB888>() { return 0; } | - | ||||||||||||||||||||||||
| 81 | template<> constexpr uint blueShift<QImage::Format_ARGB4444_Premultiplied>() { return 0; } | - | ||||||||||||||||||||||||
| 82 | template<> constexpr uint blueShift<QImage::Format_ARGB8555_Premultiplied>() { return 8; } | - | ||||||||||||||||||||||||
| 83 | template<> constexpr uint blueShift<QImage::Format_ARGB8565_Premultiplied>() { return 8; } | - | ||||||||||||||||||||||||
| 84 | template<> constexpr uint blueShift<QImage::Format_ARGB6666_Premultiplied>() { return 0; } | - | ||||||||||||||||||||||||
| 85 | template<> constexpr uint alphaWidth<QImage::Format_ARGB4444_Premultiplied>() { return 4; } | - | ||||||||||||||||||||||||
| 86 | template<> constexpr uint alphaWidth<QImage::Format_ARGB8555_Premultiplied>() { return 8; } | - | ||||||||||||||||||||||||
| 87 | template<> constexpr uint alphaWidth<QImage::Format_ARGB8565_Premultiplied>() { return 8; } | - | ||||||||||||||||||||||||
| 88 | template<> constexpr uint alphaWidth<QImage::Format_ARGB6666_Premultiplied>() { return 6; } | - | ||||||||||||||||||||||||
| 89 | template<> constexpr uint alphaShift<QImage::Format_ARGB4444_Premultiplied>() { return 12; } | - | ||||||||||||||||||||||||
| 90 | template<> constexpr uint alphaShift<QImage::Format_ARGB8555_Premultiplied>() { return 0; } | - | ||||||||||||||||||||||||
| 91 | template<> constexpr uint alphaShift<QImage::Format_ARGB8565_Premultiplied>() { return 0; } | - | ||||||||||||||||||||||||
| 92 | template<> constexpr uint alphaShift<QImage::Format_ARGB6666_Premultiplied>() { return 18; } | - | ||||||||||||||||||||||||
| 93 | - | |||||||||||||||||||||||||
| 94 | template<QImage::Format> constexpr QPixelLayout::BPP bitsPerPixel(); | - | ||||||||||||||||||||||||
| 95 | template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_RGB16>() { return QPixelLayout::BPP16; } | - | ||||||||||||||||||||||||
| 96 | template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_RGB444>() { return QPixelLayout::BPP16; } | - | ||||||||||||||||||||||||
| 97 | template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_RGB555>() { return QPixelLayout::BPP16; } | - | ||||||||||||||||||||||||
| 98 | template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_RGB666>() { return QPixelLayout::BPP24; } | - | ||||||||||||||||||||||||
| 99 | template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_RGB888>() { return QPixelLayout::BPP24; } | - | ||||||||||||||||||||||||
| 100 | template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_ARGB4444_Premultiplied>() { return QPixelLayout::BPP16; } | - | ||||||||||||||||||||||||
| 101 | template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_ARGB8555_Premultiplied>() { return QPixelLayout::BPP24; } | - | ||||||||||||||||||||||||
| 102 | template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_ARGB8565_Premultiplied>() { return QPixelLayout::BPP24; } | - | ||||||||||||||||||||||||
| 103 | template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_ARGB6666_Premultiplied>() { return QPixelLayout::BPP24; } | - | ||||||||||||||||||||||||
| 104 | - | |||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||
| 106 | template<QImage::Format Format> | - | ||||||||||||||||||||||||
| 107 | static const uint * convertToRGB32(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 108 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 109 | { | - | ||||||||||||||||||||||||
| 110 | constexpr uint redMask = ((1 << redWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 111 | constexpr uint greenMask = ((1 << greenWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 112 | constexpr uint blueMask = ((1 << blueWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 113 | - | |||||||||||||||||||||||||
| 114 | constexpr uchar redLeftShift = 8 - redWidth<Format>(); | - | ||||||||||||||||||||||||
| 115 | constexpr uchar greenLeftShift = 8 - greenWidth<Format>(); | - | ||||||||||||||||||||||||
| 116 | constexpr uchar blueLeftShift = 8 - blueWidth<Format>(); | - | ||||||||||||||||||||||||
| 117 | - | |||||||||||||||||||||||||
| 118 | constexpr uchar redRightShift = 2 * redWidth<Format>() - 8; | - | ||||||||||||||||||||||||
| 119 | constexpr uchar greenRightShift = 2 * greenWidth<Format>() - 8; | - | ||||||||||||||||||||||||
| 120 | constexpr uchar blueRightShift = 2 * blueWidth<Format>() - 8; | - | ||||||||||||||||||||||||
| 121 | - | |||||||||||||||||||||||||
| 122 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 123 | uint red = (src[i] >> redShift<Format>()) & redMask; | - | ||||||||||||||||||||||||
| 124 | uint green = (src[i] >> greenShift<Format>()) & greenMask; | - | ||||||||||||||||||||||||
| 125 | uint blue = (src[i] >> blueShift<Format>()) & blueMask; | - | ||||||||||||||||||||||||
| 126 | - | |||||||||||||||||||||||||
| 127 | red = ((red << redLeftShift) | (red >> redRightShift)) << 16; | - | ||||||||||||||||||||||||
| 128 | green = ((green << greenLeftShift) | (green >> greenRightShift)) << 8; | - | ||||||||||||||||||||||||
| 129 | blue = (blue << blueLeftShift) | (blue >> blueRightShift); | - | ||||||||||||||||||||||||
| 130 | buffer[i] = 0xff000000 | red | green | blue; | - | ||||||||||||||||||||||||
| 131 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 132 | - | |||||||||||||||||||||||||
| 133 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 134 | } | - | ||||||||||||||||||||||||
| 135 | - | |||||||||||||||||||||||||
| 136 | template<QImage::Format Format> | - | ||||||||||||||||||||||||
| 137 | static const QRgba64 * convertToRGB64(QRgba64 *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 138 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 139 | { | - | ||||||||||||||||||||||||
| 140 | constexpr uint redMask = ((1 << redWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 141 | constexpr uint greenMask = ((1 << greenWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 142 | constexpr uint blueMask = ((1 << blueWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 143 | - | |||||||||||||||||||||||||
| 144 | constexpr uchar redLeftShift = 8 - redWidth<Format>(); | - | ||||||||||||||||||||||||
| 145 | constexpr uchar greenLeftShift = 8 - greenWidth<Format>(); | - | ||||||||||||||||||||||||
| 146 | constexpr uchar blueLeftShift = 8 - blueWidth<Format>(); | - | ||||||||||||||||||||||||
| 147 | - | |||||||||||||||||||||||||
| 148 | constexpr uchar redRightShift = 2 * redWidth<Format>() - 8; | - | ||||||||||||||||||||||||
| 149 | constexpr uchar greenRightShift = 2 * greenWidth<Format>() - 8; | - | ||||||||||||||||||||||||
| 150 | constexpr uchar blueRightShift = 2 * blueWidth<Format>() - 8; | - | ||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||
| 152 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 153 | uint red = (src[i] >> redShift<Format>()) & redMask; | - | ||||||||||||||||||||||||
| 154 | uint green = (src[i] >> greenShift<Format>()) & greenMask; | - | ||||||||||||||||||||||||
| 155 | uint blue = (src[i] >> blueShift<Format>()) & blueMask; | - | ||||||||||||||||||||||||
| 156 | - | |||||||||||||||||||||||||
| 157 | red = ((red << redLeftShift) | (red >> redRightShift)); | - | ||||||||||||||||||||||||
| 158 | green = ((green << greenLeftShift) | (green >> greenRightShift)); | - | ||||||||||||||||||||||||
| 159 | blue = (blue << blueLeftShift) | (blue >> blueRightShift); | - | ||||||||||||||||||||||||
| 160 | buffer[i] = QRgba64::fromRgba(red, green, blue, 255); | - | ||||||||||||||||||||||||
| 161 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 162 | - | |||||||||||||||||||||||||
| 163 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 164 | } | - | ||||||||||||||||||||||||
| 165 | - | |||||||||||||||||||||||||
| 166 | template<QImage::Format Format> | - | ||||||||||||||||||||||||
| 167 | static const uint * convertARGBPMToARGB32PM(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 168 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 169 | { | - | ||||||||||||||||||||||||
| 170 | constexpr uint alphaMask = ((1 << alphaWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 171 | constexpr uint redMask = ((1 << redWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 172 | constexpr uint greenMask = ((1 << greenWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 173 | constexpr uint blueMask = ((1 << blueWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 174 | - | |||||||||||||||||||||||||
| 175 | constexpr uchar alphaLeftShift = 8 - alphaWidth<Format>(); | - | ||||||||||||||||||||||||
| 176 | constexpr uchar redLeftShift = 8 - redWidth<Format>(); | - | ||||||||||||||||||||||||
| 177 | constexpr uchar greenLeftShift = 8 - greenWidth<Format>(); | - | ||||||||||||||||||||||||
| 178 | constexpr uchar blueLeftShift = 8 - blueWidth<Format>(); | - | ||||||||||||||||||||||||
| 179 | - | |||||||||||||||||||||||||
| 180 | constexpr uchar alphaRightShift = 2 * alphaWidth<Format>() - 8; | - | ||||||||||||||||||||||||
| 181 | constexpr uchar redRightShift = 2 * redWidth<Format>() - 8; | - | ||||||||||||||||||||||||
| 182 | constexpr uchar greenRightShift = 2 * greenWidth<Format>() - 8; | - | ||||||||||||||||||||||||
| 183 | constexpr uchar blueRightShift = 2 * blueWidth<Format>() - 8; | - | ||||||||||||||||||||||||
| 184 | - | |||||||||||||||||||||||||
| 185 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 186 | uint alpha = (src[i] >> alphaShift<Format>()) & alphaMask; | - | ||||||||||||||||||||||||
| 187 | uint red = (src[i] >> redShift<Format>()) & redMask; | - | ||||||||||||||||||||||||
| 188 | uint green = (src[i] >> greenShift<Format>()) & greenMask; | - | ||||||||||||||||||||||||
| 189 | uint blue = (src[i] >> blueShift<Format>()) & blueMask; | - | ||||||||||||||||||||||||
| 190 | - | |||||||||||||||||||||||||
| 191 | alpha = (alpha << alphaLeftShift) | (alpha >> alphaRightShift); | - | ||||||||||||||||||||||||
| 192 | red = qMin(alpha, (red << redLeftShift) | (red >> redRightShift)); | - | ||||||||||||||||||||||||
| 193 | green = qMin(alpha, (green << greenLeftShift) | (green >> greenRightShift)); | - | ||||||||||||||||||||||||
| 194 | blue = qMin(alpha, (blue << blueLeftShift) | (blue >> blueRightShift)); | - | ||||||||||||||||||||||||
| 195 | buffer[i] = (alpha << 24) | (red << 16) | (green << 8) | blue; | - | ||||||||||||||||||||||||
| 196 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 197 | - | |||||||||||||||||||||||||
| 198 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 199 | } | - | ||||||||||||||||||||||||
| 200 | - | |||||||||||||||||||||||||
| 201 | template<QImage::Format Format> | - | ||||||||||||||||||||||||
| 202 | static const QRgba64 * convertARGBPMToARGB64PM(QRgba64 *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 203 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 204 | { | - | ||||||||||||||||||||||||
| 205 | constexpr uint alphaMask = ((1 << alphaWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 206 | constexpr uint redMask = ((1 << redWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 207 | constexpr uint greenMask = ((1 << greenWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 208 | constexpr uint blueMask = ((1 << blueWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 209 | - | |||||||||||||||||||||||||
| 210 | constexpr uchar alphaLeftShift = 8 - alphaWidth<Format>(); | - | ||||||||||||||||||||||||
| 211 | constexpr uchar redLeftShift = 8 - redWidth<Format>(); | - | ||||||||||||||||||||||||
| 212 | constexpr uchar greenLeftShift = 8 - greenWidth<Format>(); | - | ||||||||||||||||||||||||
| 213 | constexpr uchar blueLeftShift = 8 - blueWidth<Format>(); | - | ||||||||||||||||||||||||
| 214 | - | |||||||||||||||||||||||||
| 215 | constexpr uchar alphaRightShift = 2 * alphaWidth<Format>() - 8; | - | ||||||||||||||||||||||||
| 216 | constexpr uchar redRightShift = 2 * redWidth<Format>() - 8; | - | ||||||||||||||||||||||||
| 217 | constexpr uchar greenRightShift = 2 * greenWidth<Format>() - 8; | - | ||||||||||||||||||||||||
| 218 | constexpr uchar blueRightShift = 2 * blueWidth<Format>() - 8; | - | ||||||||||||||||||||||||
| 219 | - | |||||||||||||||||||||||||
| 220 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 221 | uint alpha = (src[i] >> alphaShift<Format>()) & alphaMask; | - | ||||||||||||||||||||||||
| 222 | uint red = (src[i] >> redShift<Format>()) & redMask; | - | ||||||||||||||||||||||||
| 223 | uint green = (src[i] >> greenShift<Format>()) & greenMask; | - | ||||||||||||||||||||||||
| 224 | uint blue = (src[i] >> blueShift<Format>()) & blueMask; | - | ||||||||||||||||||||||||
| 225 | - | |||||||||||||||||||||||||
| 226 | alpha = (alpha << alphaLeftShift) | (alpha >> alphaRightShift); | - | ||||||||||||||||||||||||
| 227 | red = qMin(alpha, (red << redLeftShift) | (red >> redRightShift)); | - | ||||||||||||||||||||||||
| 228 | green = qMin(alpha, (green << greenLeftShift) | (green >> greenRightShift)); | - | ||||||||||||||||||||||||
| 229 | blue = qMin(alpha, (blue << blueLeftShift) | (blue >> blueRightShift)); | - | ||||||||||||||||||||||||
| 230 | buffer[i] = QRgba64::fromRgba(red, green, blue, alpha); | - | ||||||||||||||||||||||||
| 231 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 232 | - | |||||||||||||||||||||||||
| 233 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 234 | } | - | ||||||||||||||||||||||||
| 235 | - | |||||||||||||||||||||||||
| 236 | template<QImage::Format Format> | - | ||||||||||||||||||||||||
| 237 | static const uint * convertRGBFromARGB32PM(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 238 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 239 | { | - | ||||||||||||||||||||||||
| 240 | constexpr uint redMask = ((1 << redWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 241 | constexpr uint greenMask = ((1 << greenWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 242 | constexpr uint blueMask = ((1 << blueWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 243 | - | |||||||||||||||||||||||||
| 244 | constexpr uchar redRightShift = 24 - redWidth<Format>(); | - | ||||||||||||||||||||||||
| 245 | constexpr uchar greenRightShift = 16 - greenWidth<Format>(); | - | ||||||||||||||||||||||||
| 246 | constexpr uchar blueRightShift = 8 - blueWidth<Format>(); | - | ||||||||||||||||||||||||
| 247 | - | |||||||||||||||||||||||||
| 248 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 249 | const uint color = qUnpremultiply(src[i]); | - | ||||||||||||||||||||||||
| 250 | const uint red = ((color >> redRightShift) & redMask) << redShift<Format>(); | - | ||||||||||||||||||||||||
| 251 | const uint green = ((color >> greenRightShift) & greenMask) << greenShift<Format>(); | - | ||||||||||||||||||||||||
| 252 | const uint blue = ((color >> blueRightShift) & blueMask) << blueShift<Format>(); | - | ||||||||||||||||||||||||
| 253 | buffer[i] = red | green | blue; | - | ||||||||||||||||||||||||
| 254 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 255 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 256 | } | - | ||||||||||||||||||||||||
| 257 | - | |||||||||||||||||||||||||
| 258 | template<QImage::Format Format> | - | ||||||||||||||||||||||||
| 259 | static const uint * convertRGBFromRGB32(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 260 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 261 | { | - | ||||||||||||||||||||||||
| 262 | constexpr uint redMask = ((1 << redWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 263 | constexpr uint greenMask = ((1 << greenWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 264 | constexpr uint blueMask = ((1 << blueWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 265 | - | |||||||||||||||||||||||||
| 266 | constexpr uchar redRightShift = 24 - redWidth<Format>(); | - | ||||||||||||||||||||||||
| 267 | constexpr uchar greenRightShift = 16 - greenWidth<Format>(); | - | ||||||||||||||||||||||||
| 268 | constexpr uchar blueRightShift = 8 - blueWidth<Format>(); | - | ||||||||||||||||||||||||
| 269 | - | |||||||||||||||||||||||||
| 270 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 271 | const uint red = ((src[i] >> redRightShift) & redMask) << redShift<Format>(); | - | ||||||||||||||||||||||||
| 272 | const uint green = ((src[i] >> greenRightShift) & greenMask) << greenShift<Format>(); | - | ||||||||||||||||||||||||
| 273 | const uint blue = ((src[i] >> blueRightShift) & blueMask) << blueShift<Format>(); | - | ||||||||||||||||||||||||
| 274 | buffer[i] = red | green | blue; | - | ||||||||||||||||||||||||
| 275 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 276 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 277 | } | - | ||||||||||||||||||||||||
| 278 | - | |||||||||||||||||||||||||
| 279 | template<QImage::Format Format> | - | ||||||||||||||||||||||||
| 280 | static const uint * convertARGBPMFromRGB32(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 281 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 282 | { | - | ||||||||||||||||||||||||
| 283 | constexpr uint alphaMask = ((1 << alphaWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 284 | constexpr uint redMask = ((1 << redWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 285 | constexpr uint greenMask = ((1 << greenWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 286 | constexpr uint blueMask = ((1 << blueWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 287 | - | |||||||||||||||||||||||||
| 288 | constexpr uchar redRightShift = 24 - redWidth<Format>(); | - | ||||||||||||||||||||||||
| 289 | constexpr uchar greenRightShift = 16 - greenWidth<Format>(); | - | ||||||||||||||||||||||||
| 290 | constexpr uchar blueRightShift = 8 - blueWidth<Format>(); | - | ||||||||||||||||||||||||
| 291 | - | |||||||||||||||||||||||||
| 292 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 293 | constexpr uint alpha = (0xff & alphaMask) << alphaShift<Format>(); | - | ||||||||||||||||||||||||
| 294 | const uint red = ((src[i] >> redRightShift) & redMask) << redShift<Format>(); | - | ||||||||||||||||||||||||
| 295 | const uint green = ((src[i] >> greenRightShift) & greenMask) << greenShift<Format>(); | - | ||||||||||||||||||||||||
| 296 | const uint blue = ((src[i] >> blueRightShift) & blueMask) << blueShift<Format>(); | - | ||||||||||||||||||||||||
| 297 | buffer[i] = alpha | red | green | blue; | - | ||||||||||||||||||||||||
| 298 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 299 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 300 | } | - | ||||||||||||||||||||||||
| 301 | - | |||||||||||||||||||||||||
| 302 | template<QImage::Format Format> | - | ||||||||||||||||||||||||
| 303 | static const uint * convertARGBPMFromARGB32PM(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 304 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 305 | { | - | ||||||||||||||||||||||||
| 306 | constexpr uint alphaMask = ((1 << alphaWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 307 | constexpr uint redMask = ((1 << redWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 308 | constexpr uint greenMask = ((1 << greenWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 309 | constexpr uint blueMask = ((1 << blueWidth<Format>()) - 1); | - | ||||||||||||||||||||||||
| 310 | - | |||||||||||||||||||||||||
| 311 | constexpr uchar alphaRightShift = 32 - alphaWidth<Format>(); | - | ||||||||||||||||||||||||
| 312 | constexpr uchar redRightShift = 24 - redWidth<Format>(); | - | ||||||||||||||||||||||||
| 313 | constexpr uchar greenRightShift = 16 - greenWidth<Format>(); | - | ||||||||||||||||||||||||
| 314 | constexpr uchar blueRightShift = 8 - blueWidth<Format>(); | - | ||||||||||||||||||||||||
| 315 | - | |||||||||||||||||||||||||
| 316 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 317 | const uint alpha = ((src[i] >> alphaRightShift) & alphaMask) << alphaShift<Format>(); | - | ||||||||||||||||||||||||
| 318 | const uint red = ((src[i] >> redRightShift) & redMask) << redShift<Format>(); | - | ||||||||||||||||||||||||
| 319 | const uint green = ((src[i] >> greenRightShift) & greenMask) << greenShift<Format>(); | - | ||||||||||||||||||||||||
| 320 | const uint blue = ((src[i] >> blueRightShift) & blueMask) << blueShift<Format>(); | - | ||||||||||||||||||||||||
| 321 | buffer[i] = alpha | red | green | blue; | - | ||||||||||||||||||||||||
| 322 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 323 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 324 | } | - | ||||||||||||||||||||||||
| 325 | - | |||||||||||||||||||||||||
| 326 | - | |||||||||||||||||||||||||
| 327 | - | |||||||||||||||||||||||||
| 328 | template<QImage::Format Format> constexpr static inline QPixelLayout pixelLayoutRGB() | - | ||||||||||||||||||||||||
| 329 | { | - | ||||||||||||||||||||||||
| 330 | return QPixelLayout{ | - | ||||||||||||||||||||||||
| 331 | uchar(redWidth<Format>()), uchar(redShift<Format>()), | - | ||||||||||||||||||||||||
| 332 | uchar(greenWidth<Format>()), uchar(greenShift<Format>()), | - | ||||||||||||||||||||||||
| 333 | uchar(blueWidth<Format>()), uchar(blueShift<Format>()), | - | ||||||||||||||||||||||||
| 334 | 0, 0, | - | ||||||||||||||||||||||||
| 335 | false, bitsPerPixel<Format>(), | - | ||||||||||||||||||||||||
| 336 | convertToRGB32<Format>, | - | ||||||||||||||||||||||||
| 337 | convertRGBFromARGB32PM<Format>, | - | ||||||||||||||||||||||||
| 338 | convertRGBFromRGB32<Format>, | - | ||||||||||||||||||||||||
| 339 | convertToRGB64<Format> | - | ||||||||||||||||||||||||
| 340 | }; | - | ||||||||||||||||||||||||
| 341 | } | - | ||||||||||||||||||||||||
| 342 | - | |||||||||||||||||||||||||
| 343 | template<QImage::Format Format> constexpr static inline QPixelLayout pixelLayoutARGBPM() | - | ||||||||||||||||||||||||
| 344 | { | - | ||||||||||||||||||||||||
| 345 | return QPixelLayout{ | - | ||||||||||||||||||||||||
| 346 | uchar(redWidth<Format>()), uchar(redShift<Format>()), | - | ||||||||||||||||||||||||
| 347 | uchar(greenWidth<Format>()), uchar(greenShift<Format>()), | - | ||||||||||||||||||||||||
| 348 | uchar(blueWidth<Format>()), uchar(blueShift<Format>()), | - | ||||||||||||||||||||||||
| 349 | uchar(alphaWidth<Format>()), uchar(alphaShift<Format>()), | - | ||||||||||||||||||||||||
| 350 | true, bitsPerPixel<Format>(), | - | ||||||||||||||||||||||||
| 351 | convertARGBPMToARGB32PM<Format>, | - | ||||||||||||||||||||||||
| 352 | convertARGBPMFromARGB32PM<Format>, | - | ||||||||||||||||||||||||
| 353 | convertARGBPMFromRGB32<Format>, | - | ||||||||||||||||||||||||
| 354 | convertARGBPMToARGB64PM<Format> | - | ||||||||||||||||||||||||
| 355 | }; | - | ||||||||||||||||||||||||
| 356 | } | - | ||||||||||||||||||||||||
| 357 | - | |||||||||||||||||||||||||
| 358 | - | |||||||||||||||||||||||||
| 359 | - | |||||||||||||||||||||||||
| 360 | - | |||||||||||||||||||||||||
| 361 | static const uint * convertIndexedToARGB32PM(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 362 | const QPixelLayout *, const QRgb *clut) | - | ||||||||||||||||||||||||
| 363 | { | - | ||||||||||||||||||||||||
| 364 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 365 | buffer[i] = qPremultiply(clut[src[i]]); never executed: buffer[i] = qPremultiply(clut[src[i]]); | 0 | ||||||||||||||||||||||||
| 366 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 367 | } | - | ||||||||||||||||||||||||
| 368 | - | |||||||||||||||||||||||||
| 369 | static const QRgba64 * convertIndexedToARGB64PM(QRgba64 *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 370 | const QPixelLayout *, const QRgb *clut) | - | ||||||||||||||||||||||||
| 371 | { | - | ||||||||||||||||||||||||
| 372 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 373 | buffer[i] = QRgba64::fromArgb32(clut[src[i]]).premultiplied(); never executed: buffer[i] = QRgba64::fromArgb32(clut[src[i]]).premultiplied(); | 0 | ||||||||||||||||||||||||
| 374 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 375 | } | - | ||||||||||||||||||||||||
| 376 | - | |||||||||||||||||||||||||
| 377 | static const uint * convertPassThrough(uint *, const uint *src, int, | - | ||||||||||||||||||||||||
| 378 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 379 | { | - | ||||||||||||||||||||||||
| 380 | return never executed: src;return src;never executed: return src; | 0 | ||||||||||||||||||||||||
| 381 | } | - | ||||||||||||||||||||||||
| 382 | - | |||||||||||||||||||||||||
| 383 | static const uint * convertARGB32ToARGB32PM(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 384 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 385 | { | - | ||||||||||||||||||||||||
| 386 | return never executed: qt_convertARGB32ToARGB32PM(buffer, src, count);return qt_convertARGB32ToARGB32PM(buffer, src, count);never executed: return qt_convertARGB32ToARGB32PM(buffer, src, count); | 0 | ||||||||||||||||||||||||
| 387 | } | - | ||||||||||||||||||||||||
| 388 | - | |||||||||||||||||||||||||
| 389 | static const uint * convertRGBA8888PMToARGB32PM(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 390 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 391 | { | - | ||||||||||||||||||||||||
| 392 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 393 | buffer[i] = RGBA2ARGB(src[i]); never executed: buffer[i] = RGBA2ARGB(src[i]); | 0 | ||||||||||||||||||||||||
| 394 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 395 | } | - | ||||||||||||||||||||||||
| 396 | - | |||||||||||||||||||||||||
| 397 | static const uint * convertRGBA8888ToARGB32PM(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 398 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 399 | { | - | ||||||||||||||||||||||||
| 400 | return never executed: qt_convertRGBA8888ToARGB32PM(buffer, src, count);return qt_convertRGBA8888ToARGB32PM(buffer, src, count);never executed: return qt_convertRGBA8888ToARGB32PM(buffer, src, count); | 0 | ||||||||||||||||||||||||
| 401 | } | - | ||||||||||||||||||||||||
| 402 | - | |||||||||||||||||||||||||
| 403 | static const uint * convertAlpha8ToRGB32(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 404 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 405 | { | - | ||||||||||||||||||||||||
| 406 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 407 | buffer[i] = qRgba(0, 0, 0, src[i]); never executed: buffer[i] = qRgba(0, 0, 0, src[i]); | 0 | ||||||||||||||||||||||||
| 408 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 409 | } | - | ||||||||||||||||||||||||
| 410 | - | |||||||||||||||||||||||||
| 411 | static const uint * convertGrayscale8ToRGB32(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 412 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 413 | { | - | ||||||||||||||||||||||||
| 414 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 415 | buffer[i] = qRgb(src[i], src[i], src[i]); never executed: buffer[i] = qRgb(src[i], src[i], src[i]); | 0 | ||||||||||||||||||||||||
| 416 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 417 | } | - | ||||||||||||||||||||||||
| 418 | - | |||||||||||||||||||||||||
| 419 | static const QRgba64 * convertAlpha8ToRGB64(QRgba64 *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 420 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 421 | { | - | ||||||||||||||||||||||||
| 422 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 423 | buffer[i] = QRgba64::fromRgba(0, 0, 0, src[i]); never executed: buffer[i] = QRgba64::fromRgba(0, 0, 0, src[i]); | 0 | ||||||||||||||||||||||||
| 424 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 425 | } | - | ||||||||||||||||||||||||
| 426 | - | |||||||||||||||||||||||||
| 427 | static const QRgba64 * convertGrayscale8ToRGB64(QRgba64 *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 428 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 429 | { | - | ||||||||||||||||||||||||
| 430 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 431 | buffer[i] = QRgba64::fromRgba(src[i], src[i], src[i], 255); never executed: buffer[i] = QRgba64::fromRgba(src[i], src[i], src[i], 255); | 0 | ||||||||||||||||||||||||
| 432 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 433 | } | - | ||||||||||||||||||||||||
| 434 | - | |||||||||||||||||||||||||
| 435 | static const uint * convertARGB32FromARGB32PM(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 436 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 437 | { | - | ||||||||||||||||||||||||
| 438 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 439 | buffer[i] = qUnpremultiply(src[i]); never executed: buffer[i] = qUnpremultiply(src[i]); | 0 | ||||||||||||||||||||||||
| 440 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 441 | } | - | ||||||||||||||||||||||||
| 442 | - | |||||||||||||||||||||||||
| 443 | static const uint * convertRGBA8888PMFromARGB32PM(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 444 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 445 | { | - | ||||||||||||||||||||||||
| 446 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 447 | buffer[i] = ARGB2RGBA(src[i]); never executed: buffer[i] = ARGB2RGBA(src[i]); | 0 | ||||||||||||||||||||||||
| 448 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 449 | } | - | ||||||||||||||||||||||||
| 450 | - | |||||||||||||||||||||||||
| 451 | - | |||||||||||||||||||||||||
| 452 | template<bool RGBA, bool maskAlpha> | - | ||||||||||||||||||||||||
| 453 | static inline void qConvertARGB32PMToARGB64PM_sse2(QRgba64 *buffer, const uint *src, int count) | - | ||||||||||||||||||||||||
| 454 | { | - | ||||||||||||||||||||||||
| 455 | if (count <= 0
| 0 | ||||||||||||||||||||||||
| 456 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 457 | - | |||||||||||||||||||||||||
| 458 | const __m128i amask = _mm_set1_epi32(0xff000000); | - | ||||||||||||||||||||||||
| 459 | int i = 0; | - | ||||||||||||||||||||||||
| 460 | for (; ((
| 0 | ||||||||||||||||||||||||
| 461 | uint s = *src++; | - | ||||||||||||||||||||||||
| 462 | if (RGBA
| 0 | ||||||||||||||||||||||||
| 463 | s = RGBA2ARGB(s); never executed: s = RGBA2ARGB(s); | 0 | ||||||||||||||||||||||||
| 464 | *buffer++ = QRgba64::fromArgb32(s); | - | ||||||||||||||||||||||||
| 465 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 466 | for (; i < count-3
| 0 | ||||||||||||||||||||||||
| 467 | __m128i vs = _mm_loadu_si128((const __m128i*)src); | - | ||||||||||||||||||||||||
| 468 | if (maskAlpha
| 0 | ||||||||||||||||||||||||
| 469 | vs = _mm_or_si128(vs, amask); never executed: vs = _mm_or_si128(vs, amask); | 0 | ||||||||||||||||||||||||
| 470 | src += 4; | - | ||||||||||||||||||||||||
| 471 | __m128i v1 = _mm_unpacklo_epi8(vs, vs); | - | ||||||||||||||||||||||||
| 472 | __m128i v2 = _mm_unpackhi_epi8(vs, vs); | - | ||||||||||||||||||||||||
| 473 | if (!RGBA
| 0 | ||||||||||||||||||||||||
| 474 | v1 = ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(v1), (int)((((3) << 6) | ((0) << 4) | ((1) << 2) | (2))))); | - | ||||||||||||||||||||||||
| 475 | v2 = ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(v2), (int)((((3) << 6) | ((0) << 4) | ((1) << 2) | (2))))); | - | ||||||||||||||||||||||||
| 476 | v1 = ((__m128i)__builtin_ia32_pshufhw ((__v8hi)(__m128i)(v1), (int)((((3) << 6) | ((0) << 4) | ((1) << 2) | (2))))); | - | ||||||||||||||||||||||||
| 477 | v2 = ((__m128i)__builtin_ia32_pshufhw ((__v8hi)(__m128i)(v2), (int)((((3) << 6) | ((0) << 4) | ((1) << 2) | (2))))); | - | ||||||||||||||||||||||||
| 478 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 479 | _mm_store_si128((__m128i*)(buffer), v1); | - | ||||||||||||||||||||||||
| 480 | buffer += 2; | - | ||||||||||||||||||||||||
| 481 | _mm_store_si128((__m128i*)(buffer), v2); | - | ||||||||||||||||||||||||
| 482 | buffer += 2; | - | ||||||||||||||||||||||||
| 483 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 484 | - | |||||||||||||||||||||||||
| 485 | for (; i < count
| 0 | ||||||||||||||||||||||||
| 486 | uint s = *src++; | - | ||||||||||||||||||||||||
| 487 | if (RGBA
| 0 | ||||||||||||||||||||||||
| 488 | s = RGBA2ARGB(s); never executed: s = RGBA2ARGB(s); | 0 | ||||||||||||||||||||||||
| 489 | *buffer++ = QRgba64::fromArgb32(s); | - | ||||||||||||||||||||||||
| 490 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 491 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 492 | - | |||||||||||||||||||||||||
| 493 | - | |||||||||||||||||||||||||
| 494 | static const QRgba64 * convertRGB32ToRGB64(QRgba64 *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 495 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 496 | { | - | ||||||||||||||||||||||||
| 497 | - | |||||||||||||||||||||||||
| 498 | qConvertARGB32PMToARGB64PM_sse2<false, true>(buffer, src, count); | - | ||||||||||||||||||||||||
| 499 | - | |||||||||||||||||||||||||
| 500 | - | |||||||||||||||||||||||||
| 501 | - | |||||||||||||||||||||||||
| 502 | - | |||||||||||||||||||||||||
| 503 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 504 | } | - | ||||||||||||||||||||||||
| 505 | - | |||||||||||||||||||||||||
| 506 | static const QRgba64 * convertARGB32ToARGB64PM(QRgba64 *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 507 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 508 | { | - | ||||||||||||||||||||||||
| 509 | - | |||||||||||||||||||||||||
| 510 | qConvertARGB32PMToARGB64PM_sse2<false, false>(buffer, src, count); | - | ||||||||||||||||||||||||
| 511 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 512 | buffer[i] = buffer[i].premultiplied(); never executed: buffer[i] = buffer[i].premultiplied(); | 0 | ||||||||||||||||||||||||
| 513 | - | |||||||||||||||||||||||||
| 514 | - | |||||||||||||||||||||||||
| 515 | - | |||||||||||||||||||||||||
| 516 | - | |||||||||||||||||||||||||
| 517 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 518 | } | - | ||||||||||||||||||||||||
| 519 | - | |||||||||||||||||||||||||
| 520 | static const QRgba64 * convertARGB32PMToARGB64PM(QRgba64 *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 521 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 522 | { | - | ||||||||||||||||||||||||
| 523 | - | |||||||||||||||||||||||||
| 524 | qConvertARGB32PMToARGB64PM_sse2<false, false>(buffer, src, count); | - | ||||||||||||||||||||||||
| 525 | - | |||||||||||||||||||||||||
| 526 | - | |||||||||||||||||||||||||
| 527 | - | |||||||||||||||||||||||||
| 528 | - | |||||||||||||||||||||||||
| 529 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 530 | } | - | ||||||||||||||||||||||||
| 531 | - | |||||||||||||||||||||||||
| 532 | static const QRgba64 * convertRGBA8888ToARGB64PM(QRgba64 *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 533 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 534 | { | - | ||||||||||||||||||||||||
| 535 | - | |||||||||||||||||||||||||
| 536 | qConvertARGB32PMToARGB64PM_sse2<true, false>(buffer, src, count); | - | ||||||||||||||||||||||||
| 537 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 538 | buffer[i] = buffer[i].premultiplied(); never executed: buffer[i] = buffer[i].premultiplied(); | 0 | ||||||||||||||||||||||||
| 539 | - | |||||||||||||||||||||||||
| 540 | - | |||||||||||||||||||||||||
| 541 | - | |||||||||||||||||||||||||
| 542 | - | |||||||||||||||||||||||||
| 543 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 544 | } | - | ||||||||||||||||||||||||
| 545 | - | |||||||||||||||||||||||||
| 546 | static const QRgba64 * convertRGBA8888PMToARGB64PM(QRgba64 *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 547 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 548 | { | - | ||||||||||||||||||||||||
| 549 | - | |||||||||||||||||||||||||
| 550 | qConvertARGB32PMToARGB64PM_sse2<true, false>(buffer, src, count); | - | ||||||||||||||||||||||||
| 551 | - | |||||||||||||||||||||||||
| 552 | - | |||||||||||||||||||||||||
| 553 | - | |||||||||||||||||||||||||
| 554 | - | |||||||||||||||||||||||||
| 555 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 556 | } | - | ||||||||||||||||||||||||
| 557 | - | |||||||||||||||||||||||||
| 558 | static const uint * convertRGBA8888FromARGB32PM(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 559 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 560 | { | - | ||||||||||||||||||||||||
| 561 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 562 | buffer[i] = ARGB2RGBA(qUnpremultiply(src[i])); never executed: buffer[i] = ARGB2RGBA(qUnpremultiply(src[i])); | 0 | ||||||||||||||||||||||||
| 563 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 564 | } | - | ||||||||||||||||||||||||
| 565 | - | |||||||||||||||||||||||||
| 566 | static const uint * convertRGBXFromRGB32(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 567 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 568 | { | - | ||||||||||||||||||||||||
| 569 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 570 | buffer[i] = ARGB2RGBA(0xff000000 | src[i]); never executed: buffer[i] = ARGB2RGBA(0xff000000 | src[i]); | 0 | ||||||||||||||||||||||||
| 571 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 572 | } | - | ||||||||||||||||||||||||
| 573 | - | |||||||||||||||||||||||||
| 574 | static const uint * convertRGBXFromARGB32PM(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 575 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 576 | { | - | ||||||||||||||||||||||||
| 577 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 578 | buffer[i] = ARGB2RGBA(0xff000000 | qUnpremultiply(src[i])); never executed: buffer[i] = ARGB2RGBA(0xff000000 | qUnpremultiply(src[i])); | 0 | ||||||||||||||||||||||||
| 579 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 580 | } | - | ||||||||||||||||||||||||
| 581 | - | |||||||||||||||||||||||||
| 582 | template<QtPixelOrder PixelOrder> | - | ||||||||||||||||||||||||
| 583 | static const uint * convertA2RGB30PMToARGB32PM(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 584 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 585 | { | - | ||||||||||||||||||||||||
| 586 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 587 | buffer[i] = qConvertA2rgb30ToArgb32<PixelOrder>(src[i]); never executed: buffer[i] = qConvertA2rgb30ToArgb32<PixelOrder>(src[i]); | 0 | ||||||||||||||||||||||||
| 588 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 589 | } | - | ||||||||||||||||||||||||
| 590 | - | |||||||||||||||||||||||||
| 591 | - | |||||||||||||||||||||||||
| 592 | template<QtPixelOrder PixelOrder> | - | ||||||||||||||||||||||||
| 593 | static inline void qConvertA2RGB30PMToARGB64PM_sse2(QRgba64 *buffer, const uint *src, int count) | - | ||||||||||||||||||||||||
| 594 | { | - | ||||||||||||||||||||||||
| 595 | if (count <= 0
| 0 | ||||||||||||||||||||||||
| 596 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 597 | - | |||||||||||||||||||||||||
| 598 | const __m128i rmask = _mm_set1_epi32(0x3ff00000); | - | ||||||||||||||||||||||||
| 599 | const __m128i gmask = _mm_set1_epi32(0x000ffc00); | - | ||||||||||||||||||||||||
| 600 | const __m128i bmask = _mm_set1_epi32(0x000003ff); | - | ||||||||||||||||||||||||
| 601 | const __m128i afactor = _mm_set1_epi16(0x5555); | - | ||||||||||||||||||||||||
| 602 | int i = 0; | - | ||||||||||||||||||||||||
| 603 | - | |||||||||||||||||||||||||
| 604 | for (; ((
| 0 | ||||||||||||||||||||||||
| 605 | * never executed: buffer++ = qConvertA2rgb30ToRgb64<PixelOrder>(*src++);*buffer++ = qConvertA2rgb30ToRgb64<PixelOrder>(*src++);never executed: *buffer++ = qConvertA2rgb30ToRgb64<PixelOrder>(*src++); | 0 | ||||||||||||||||||||||||
| 606 | - | |||||||||||||||||||||||||
| 607 | for (; i < count-3
| 0 | ||||||||||||||||||||||||
| 608 | __m128i vs = _mm_loadu_si128((const __m128i*)src); | - | ||||||||||||||||||||||||
| 609 | src += 4; | - | ||||||||||||||||||||||||
| 610 | __m128i va = _mm_srli_epi32(vs, 30); | - | ||||||||||||||||||||||||
| 611 | __m128i vr = _mm_and_si128(vs, rmask); | - | ||||||||||||||||||||||||
| 612 | __m128i vb = _mm_and_si128(vs, bmask); | - | ||||||||||||||||||||||||
| 613 | __m128i vg = _mm_and_si128(vs, gmask); | - | ||||||||||||||||||||||||
| 614 | va = _mm_mullo_epi16(va, afactor); | - | ||||||||||||||||||||||||
| 615 | vr = _mm_or_si128(_mm_srli_epi32(vr, 14), _mm_srli_epi32(vr, 24)); | - | ||||||||||||||||||||||||
| 616 | vg = _mm_or_si128(_mm_srli_epi32(vg, 4), _mm_srli_epi32(vg, 14)); | - | ||||||||||||||||||||||||
| 617 | vb = _mm_or_si128(_mm_slli_epi32(vb, 6), _mm_srli_epi32(vb, 4)); | - | ||||||||||||||||||||||||
| 618 | __m128i vrb; | - | ||||||||||||||||||||||||
| 619 | if (PixelOrder == PixelOrderRGB
| 0 | ||||||||||||||||||||||||
| 620 | vrb = _mm_or_si128(vr, ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(vb), (int)(2) * 8))); never executed: vrb = _mm_or_si128(vr, ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(vb), (int)(2) * 8))); | 0 | ||||||||||||||||||||||||
| 621 | else | - | ||||||||||||||||||||||||
| 622 | vrb = _mm_or_si128(vb, ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(vr), (int)(2) * 8))); never executed: vrb = _mm_or_si128(vb, ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(vr), (int)(2) * 8))); | 0 | ||||||||||||||||||||||||
| 623 | __m128i vga = _mm_or_si128(vg, ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(va), (int)(2) * 8))); | - | ||||||||||||||||||||||||
| 624 | _mm_store_si128((__m128i*)(buffer), _mm_unpacklo_epi16(vrb, vga)); | - | ||||||||||||||||||||||||
| 625 | buffer += 2; | - | ||||||||||||||||||||||||
| 626 | _mm_store_si128((__m128i*)(buffer), _mm_unpackhi_epi16(vrb, vga)); | - | ||||||||||||||||||||||||
| 627 | buffer += 2; | - | ||||||||||||||||||||||||
| 628 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 629 | - | |||||||||||||||||||||||||
| 630 | for (; i < count
| 0 | ||||||||||||||||||||||||
| 631 | * never executed: buffer++ = qConvertA2rgb30ToRgb64<PixelOrder>(*src++);*buffer++ = qConvertA2rgb30ToRgb64<PixelOrder>(*src++);never executed: *buffer++ = qConvertA2rgb30ToRgb64<PixelOrder>(*src++); | 0 | ||||||||||||||||||||||||
| 632 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 633 | - | |||||||||||||||||||||||||
| 634 | - | |||||||||||||||||||||||||
| 635 | template<QtPixelOrder PixelOrder> | - | ||||||||||||||||||||||||
| 636 | static const QRgba64 * convertA2RGB30PMToARGB64PM(QRgba64 *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 637 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 638 | { | - | ||||||||||||||||||||||||
| 639 | - | |||||||||||||||||||||||||
| 640 | qConvertA2RGB30PMToARGB64PM_sse2<PixelOrder>(buffer, src, count); | - | ||||||||||||||||||||||||
| 641 | - | |||||||||||||||||||||||||
| 642 | - | |||||||||||||||||||||||||
| 643 | - | |||||||||||||||||||||||||
| 644 | - | |||||||||||||||||||||||||
| 645 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 646 | } | - | ||||||||||||||||||||||||
| 647 | - | |||||||||||||||||||||||||
| 648 | template<QtPixelOrder PixelOrder> | - | ||||||||||||||||||||||||
| 649 | static const uint * convertA2RGB30PMFromARGB32PM(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 650 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 651 | { | - | ||||||||||||||||||||||||
| 652 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 653 | buffer[i] = qConvertArgb32ToA2rgb30<PixelOrder>(src[i]); never executed: buffer[i] = qConvertArgb32ToA2rgb30<PixelOrder>(src[i]); | 0 | ||||||||||||||||||||||||
| 654 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 655 | } | - | ||||||||||||||||||||||||
| 656 | - | |||||||||||||||||||||||||
| 657 | template<QtPixelOrder PixelOrder> | - | ||||||||||||||||||||||||
| 658 | static const uint * convertRGB30FromRGB32(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 659 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 660 | { | - | ||||||||||||||||||||||||
| 661 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 662 | buffer[i] = qConvertRgb32ToRgb30<PixelOrder>(src[i]); never executed: buffer[i] = qConvertRgb32ToRgb30<PixelOrder>(src[i]); | 0 | ||||||||||||||||||||||||
| 663 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 664 | } | - | ||||||||||||||||||||||||
| 665 | - | |||||||||||||||||||||||||
| 666 | template<QtPixelOrder PixelOrder> | - | ||||||||||||||||||||||||
| 667 | static const uint * convertRGB30FromARGB32PM(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 668 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 669 | { | - | ||||||||||||||||||||||||
| 670 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 671 | buffer[i] = qConvertRgb32ToRgb30<PixelOrder>(qUnpremultiply(src[i])); never executed: buffer[i] = qConvertRgb32ToRgb30<PixelOrder>(qUnpremultiply(src[i])); | 0 | ||||||||||||||||||||||||
| 672 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 673 | } | - | ||||||||||||||||||||||||
| 674 | - | |||||||||||||||||||||||||
| 675 | static const uint * convertAlpha8FromARGB32PM(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 676 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 677 | { | - | ||||||||||||||||||||||||
| 678 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 679 | buffer[i] = qAlpha(src[i]); never executed: buffer[i] = qAlpha(src[i]); | 0 | ||||||||||||||||||||||||
| 680 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 681 | } | - | ||||||||||||||||||||||||
| 682 | - | |||||||||||||||||||||||||
| 683 | static const uint * convertGrayscale8FromRGB32(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 684 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 685 | { | - | ||||||||||||||||||||||||
| 686 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 687 | buffer[i] = qGray(src[i]); never executed: buffer[i] = qGray(src[i]); | 0 | ||||||||||||||||||||||||
| 688 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 689 | } | - | ||||||||||||||||||||||||
| 690 | - | |||||||||||||||||||||||||
| 691 | static const uint * convertGrayscale8FromARGB32PM(uint *buffer, const uint *src, int count, | - | ||||||||||||||||||||||||
| 692 | const QPixelLayout *, const QRgb *) | - | ||||||||||||||||||||||||
| 693 | { | - | ||||||||||||||||||||||||
| 694 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 695 | buffer[i] = qGray(qUnpremultiply(src[i])); never executed: buffer[i] = qGray(qUnpremultiply(src[i])); | 0 | ||||||||||||||||||||||||
| 696 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 697 | } | - | ||||||||||||||||||||||||
| 698 | - | |||||||||||||||||||||||||
| 699 | template <QPixelLayout::BPP bpp> static | - | ||||||||||||||||||||||||
| 700 | uint fetchPixel(const uchar *src, int index); | - | ||||||||||||||||||||||||
| 701 | - | |||||||||||||||||||||||||
| 702 | template <> | - | ||||||||||||||||||||||||
| 703 | inline uint fetchPixel<QPixelLayout::BPP1LSB>(const uchar *src, int index) | - | ||||||||||||||||||||||||
| 704 | { | - | ||||||||||||||||||||||||
| 705 | return never executed: (src[index >> 3] >> (index & 7)) & 1;return (src[index >> 3] >> (index & 7)) & 1;never executed: return (src[index >> 3] >> (index & 7)) & 1; | 0 | ||||||||||||||||||||||||
| 706 | } | - | ||||||||||||||||||||||||
| 707 | - | |||||||||||||||||||||||||
| 708 | template <> | - | ||||||||||||||||||||||||
| 709 | inline uint fetchPixel<QPixelLayout::BPP1MSB>(const uchar *src, int index) | - | ||||||||||||||||||||||||
| 710 | { | - | ||||||||||||||||||||||||
| 711 | return never executed: (src[index >> 3] >> (~index & 7)) & 1;return (src[index >> 3] >> (~index & 7)) & 1;never executed: return (src[index >> 3] >> (~index & 7)) & 1; | 0 | ||||||||||||||||||||||||
| 712 | } | - | ||||||||||||||||||||||||
| 713 | - | |||||||||||||||||||||||||
| 714 | template <> | - | ||||||||||||||||||||||||
| 715 | inline uint fetchPixel<QPixelLayout::BPP8>(const uchar *src, int index) | - | ||||||||||||||||||||||||
| 716 | { | - | ||||||||||||||||||||||||
| 717 | return never executed: src[index];return src[index];never executed: return src[index]; | 0 | ||||||||||||||||||||||||
| 718 | } | - | ||||||||||||||||||||||||
| 719 | - | |||||||||||||||||||||||||
| 720 | template <> | - | ||||||||||||||||||||||||
| 721 | inline uint fetchPixel<QPixelLayout::BPP16>(const uchar *src, int index) | - | ||||||||||||||||||||||||
| 722 | { | - | ||||||||||||||||||||||||
| 723 | return never executed: reinterpret_cast<const quint16 *>(src)[index];return reinterpret_cast<const quint16 *>(src)[index];never executed: return reinterpret_cast<const quint16 *>(src)[index]; | 0 | ||||||||||||||||||||||||
| 724 | } | - | ||||||||||||||||||||||||
| 725 | - | |||||||||||||||||||||||||
| 726 | template <> | - | ||||||||||||||||||||||||
| 727 | inline uint fetchPixel<QPixelLayout::BPP24>(const uchar *src, int index) | - | ||||||||||||||||||||||||
| 728 | { | - | ||||||||||||||||||||||||
| 729 | return never executed: reinterpret_cast<const quint24 *>(src)[index];return reinterpret_cast<const quint24 *>(src)[index];never executed: return reinterpret_cast<const quint24 *>(src)[index]; | 0 | ||||||||||||||||||||||||
| 730 | } | - | ||||||||||||||||||||||||
| 731 | - | |||||||||||||||||||||||||
| 732 | template <> | - | ||||||||||||||||||||||||
| 733 | inline uint fetchPixel<QPixelLayout::BPP32>(const uchar *src, int index) | - | ||||||||||||||||||||||||
| 734 | { | - | ||||||||||||||||||||||||
| 735 | return never executed: reinterpret_cast<const uint *>(src)[index];return reinterpret_cast<const uint *>(src)[index];never executed: return reinterpret_cast<const uint *>(src)[index]; | 0 | ||||||||||||||||||||||||
| 736 | } | - | ||||||||||||||||||||||||
| 737 | - | |||||||||||||||||||||||||
| 738 | template <QPixelLayout::BPP bpp> | - | ||||||||||||||||||||||||
| 739 | inline const uint * fetchPixels(uint *buffer, const uchar *src, int index, int count) | - | ||||||||||||||||||||||||
| 740 | { | - | ||||||||||||||||||||||||
| 741 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 742 | buffer[i] = fetchPixel<bpp>(src, index + i); never executed: buffer[i] = fetchPixel<bpp>(src, index + i); | 0 | ||||||||||||||||||||||||
| 743 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 744 | } | - | ||||||||||||||||||||||||
| 745 | - | |||||||||||||||||||||||||
| 746 | template <> | - | ||||||||||||||||||||||||
| 747 | inline const uint * fetchPixels<QPixelLayout::BPP32>(uint *, const uchar *src, int index, int) | - | ||||||||||||||||||||||||
| 748 | { | - | ||||||||||||||||||||||||
| 749 | return never executed: reinterpret_cast<const uint *>(src) + index;return reinterpret_cast<const uint *>(src) + index;never executed: return reinterpret_cast<const uint *>(src) + index; | 0 | ||||||||||||||||||||||||
| 750 | } | - | ||||||||||||||||||||||||
| 751 | - | |||||||||||||||||||||||||
| 752 | template <QPixelLayout::BPP width> static | - | ||||||||||||||||||||||||
| 753 | void storePixel(uchar *dest, int index, uint pixel); | - | ||||||||||||||||||||||||
| 754 | - | |||||||||||||||||||||||||
| 755 | template <> | - | ||||||||||||||||||||||||
| 756 | inline void storePixel<QPixelLayout::BPP1LSB>(uchar *dest, int index, uint pixel) | - | ||||||||||||||||||||||||
| 757 | { | - | ||||||||||||||||||||||||
| 758 | if (pixel
| 0 | ||||||||||||||||||||||||
| 759 | dest[index >> 3] |= 1 << (index & 7); never executed: dest[index >> 3] |= 1 << (index & 7); | 0 | ||||||||||||||||||||||||
| 760 | else | - | ||||||||||||||||||||||||
| 761 | dest[index >> 3] &= ~(1 << (index & 7)); never executed: dest[index >> 3] &= ~(1 << (index & 7)); | 0 | ||||||||||||||||||||||||
| 762 | } | - | ||||||||||||||||||||||||
| 763 | - | |||||||||||||||||||||||||
| 764 | template <> | - | ||||||||||||||||||||||||
| 765 | inline void storePixel<QPixelLayout::BPP1MSB>(uchar *dest, int index, uint pixel) | - | ||||||||||||||||||||||||
| 766 | { | - | ||||||||||||||||||||||||
| 767 | if (pixel
| 0 | ||||||||||||||||||||||||
| 768 | dest[index >> 3] |= 1 << (~index & 7); never executed: dest[index >> 3] |= 1 << (~index & 7); | 0 | ||||||||||||||||||||||||
| 769 | else | - | ||||||||||||||||||||||||
| 770 | dest[index >> 3] &= ~(1 << (~index & 7)); never executed: dest[index >> 3] &= ~(1 << (~index & 7)); | 0 | ||||||||||||||||||||||||
| 771 | } | - | ||||||||||||||||||||||||
| 772 | - | |||||||||||||||||||||||||
| 773 | template <> | - | ||||||||||||||||||||||||
| 774 | inline void storePixel<QPixelLayout::BPP8>(uchar *dest, int index, uint pixel) | - | ||||||||||||||||||||||||
| 775 | { | - | ||||||||||||||||||||||||
| 776 | dest[index] = uchar(pixel); | - | ||||||||||||||||||||||||
| 777 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 778 | - | |||||||||||||||||||||||||
| 779 | template <> | - | ||||||||||||||||||||||||
| 780 | inline void storePixel<QPixelLayout::BPP16>(uchar *dest, int index, uint pixel) | - | ||||||||||||||||||||||||
| 781 | { | - | ||||||||||||||||||||||||
| 782 | reinterpret_cast<quint16 *>(dest)[index] = quint16(pixel); | - | ||||||||||||||||||||||||
| 783 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 784 | - | |||||||||||||||||||||||||
| 785 | template <> | - | ||||||||||||||||||||||||
| 786 | inline void storePixel<QPixelLayout::BPP24>(uchar *dest, int index, uint pixel) | - | ||||||||||||||||||||||||
| 787 | { | - | ||||||||||||||||||||||||
| 788 | reinterpret_cast<quint24 *>(dest)[index] = quint24(pixel); | - | ||||||||||||||||||||||||
| 789 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 790 | - | |||||||||||||||||||||||||
| 791 | template <QPixelLayout::BPP width> | - | ||||||||||||||||||||||||
| 792 | inline void storePixels(uchar *dest, const uint *src, int index, int count) | - | ||||||||||||||||||||||||
| 793 | { | - | ||||||||||||||||||||||||
| 794 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||
| 795 | storePixel<width>(dest, index + i, src[i]); never executed: storePixel<width>(dest, index + i, src[i]); | 0 | ||||||||||||||||||||||||
| 796 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 797 | - | |||||||||||||||||||||||||
| 798 | template <> | - | ||||||||||||||||||||||||
| 799 | inline void storePixels<QPixelLayout::BPP32>(uchar *dest, const uint *src, int index, int count) | - | ||||||||||||||||||||||||
| 800 | { | - | ||||||||||||||||||||||||
| 801 | memcpy(reinterpret_cast<uint *>(dest) + index, src, count * sizeof(uint)); | - | ||||||||||||||||||||||||
| 802 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 803 | - | |||||||||||||||||||||||||
| 804 | - | |||||||||||||||||||||||||
| 805 | - | |||||||||||||||||||||||||
| 806 | - | |||||||||||||||||||||||||
| 807 | - | |||||||||||||||||||||||||
| 808 | QPixelLayout qPixelLayouts[QImage::NImageFormats] = { | - | ||||||||||||||||||||||||
| 809 | { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPPNone, 0, 0, 0, 0 }, | - | ||||||||||||||||||||||||
| 810 | { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP1MSB, convertIndexedToARGB32PM, 0, 0, convertIndexedToARGB64PM }, | - | ||||||||||||||||||||||||
| 811 | { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP1LSB, convertIndexedToARGB32PM, 0, 0, convertIndexedToARGB64PM }, | - | ||||||||||||||||||||||||
| 812 | { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP8, convertIndexedToARGB32PM, 0, 0, convertIndexedToARGB64PM }, | - | ||||||||||||||||||||||||
| 813 | - | |||||||||||||||||||||||||
| 814 | - | |||||||||||||||||||||||||
| 815 | { 8, 16, 8, 8, 8, 0, 0, 0, false, QPixelLayout::BPP32, convertPassThrough, convertPassThrough, convertPassThrough, convertRGB32ToRGB64 }, | - | ||||||||||||||||||||||||
| 816 | { 8, 16, 8, 8, 8, 0, 8, 24, false, QPixelLayout::BPP32, convertARGB32ToARGB32PM, convertARGB32FromARGB32PM, convertPassThrough, convertARGB32ToARGB64PM }, | - | ||||||||||||||||||||||||
| 817 | { 8, 16, 8, 8, 8, 0, 8, 24, true, QPixelLayout::BPP32, convertPassThrough, convertPassThrough, convertPassThrough, convertARGB32PMToARGB64PM }, | - | ||||||||||||||||||||||||
| 818 | - | |||||||||||||||||||||||||
| 819 | pixelLayoutRGB<QImage::Format_RGB16>(), | - | ||||||||||||||||||||||||
| 820 | pixelLayoutARGBPM<QImage::Format_ARGB8565_Premultiplied>(), | - | ||||||||||||||||||||||||
| 821 | pixelLayoutRGB<QImage::Format_RGB666>(), | - | ||||||||||||||||||||||||
| 822 | pixelLayoutARGBPM<QImage::Format_ARGB6666_Premultiplied>(), | - | ||||||||||||||||||||||||
| 823 | pixelLayoutRGB<QImage::Format_RGB555>(), | - | ||||||||||||||||||||||||
| 824 | pixelLayoutARGBPM<QImage::Format_ARGB8555_Premultiplied>(), | - | ||||||||||||||||||||||||
| 825 | pixelLayoutRGB<QImage::Format_RGB888>(), | - | ||||||||||||||||||||||||
| 826 | pixelLayoutRGB<QImage::Format_RGB444>(), | - | ||||||||||||||||||||||||
| 827 | pixelLayoutARGBPM<QImage::Format_ARGB4444_Premultiplied>(), | - | ||||||||||||||||||||||||
| 828 | { 8, 0, 8, 8, 8, 16, 0, 24, false, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBXFromARGB32PM, convertRGBXFromRGB32, convertRGBA8888PMToARGB64PM }, | - | ||||||||||||||||||||||||
| 829 | { 8, 0, 8, 8, 8, 16, 8, 24, false, QPixelLayout::BPP32, convertRGBA8888ToARGB32PM, convertRGBA8888FromARGB32PM, convertRGBXFromRGB32, convertRGBA8888ToARGB64PM }, | - | ||||||||||||||||||||||||
| 830 | { 8, 0, 8, 8, 8, 16, 8, 24, true, QPixelLayout::BPP32, convertRGBA8888PMToARGB32PM, convertRGBA8888PMFromARGB32PM, convertRGBXFromRGB32, convertRGBA8888PMToARGB64PM }, | - | ||||||||||||||||||||||||
| 831 | - | |||||||||||||||||||||||||
| 832 | { 10, 20, 10, 10, 10, 0, 0, 30, false, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderBGR>, convertRGB30FromARGB32PM<PixelOrderBGR>, convertRGB30FromRGB32<PixelOrderBGR>, convertA2RGB30PMToARGB64PM<PixelOrderBGR> }, | - | ||||||||||||||||||||||||
| 833 | { 10, 20, 10, 10, 10, 0, 2, 30, true, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderBGR>, convertA2RGB30PMFromARGB32PM<PixelOrderBGR>, convertRGB30FromRGB32<PixelOrderBGR>, convertA2RGB30PMToARGB64PM<PixelOrderBGR> }, | - | ||||||||||||||||||||||||
| 834 | { 10, 0, 10, 10, 10, 20, 0, 30, false, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderRGB>, convertRGB30FromARGB32PM<PixelOrderRGB>, convertRGB30FromRGB32<PixelOrderRGB>, convertA2RGB30PMToARGB64PM<PixelOrderRGB> }, | - | ||||||||||||||||||||||||
| 835 | { 10, 0, 10, 10, 10, 20, 2, 30, true, QPixelLayout::BPP32, convertA2RGB30PMToARGB32PM<PixelOrderRGB>, convertA2RGB30PMFromARGB32PM<PixelOrderRGB>, convertRGB30FromRGB32<PixelOrderRGB>, convertA2RGB30PMToARGB64PM<PixelOrderRGB> }, | - | ||||||||||||||||||||||||
| 836 | { 0, 0, 0, 0, 0, 0, 8, 0, false, QPixelLayout::BPP8, convertAlpha8ToRGB32, convertAlpha8FromARGB32PM, 0, convertAlpha8ToRGB64 }, | - | ||||||||||||||||||||||||
| 837 | { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP8, convertGrayscale8ToRGB32, convertGrayscale8FromARGB32PM, convertGrayscale8FromRGB32, convertGrayscale8ToRGB64 } | - | ||||||||||||||||||||||||
| 838 | }; | - | ||||||||||||||||||||||||
| 839 | - | |||||||||||||||||||||||||
| 840 | const FetchPixelsFunc qFetchPixels[QPixelLayout::BPPCount] = { | - | ||||||||||||||||||||||||
| 841 | 0, | - | ||||||||||||||||||||||||
| 842 | fetchPixels<QPixelLayout::BPP1MSB>, | - | ||||||||||||||||||||||||
| 843 | fetchPixels<QPixelLayout::BPP1LSB>, | - | ||||||||||||||||||||||||
| 844 | fetchPixels<QPixelLayout::BPP8>, | - | ||||||||||||||||||||||||
| 845 | fetchPixels<QPixelLayout::BPP16>, | - | ||||||||||||||||||||||||
| 846 | fetchPixels<QPixelLayout::BPP24>, | - | ||||||||||||||||||||||||
| 847 | fetchPixels<QPixelLayout::BPP32> | - | ||||||||||||||||||||||||
| 848 | }; | - | ||||||||||||||||||||||||
| 849 | - | |||||||||||||||||||||||||
| 850 | const StorePixelsFunc qStorePixels[QPixelLayout::BPPCount] = { | - | ||||||||||||||||||||||||
| 851 | 0, | - | ||||||||||||||||||||||||
| 852 | storePixels<QPixelLayout::BPP1MSB>, | - | ||||||||||||||||||||||||
| 853 | storePixels<QPixelLayout::BPP1LSB>, | - | ||||||||||||||||||||||||
| 854 | storePixels<QPixelLayout::BPP8>, | - | ||||||||||||||||||||||||
| 855 | storePixels<QPixelLayout::BPP16>, | - | ||||||||||||||||||||||||
| 856 | storePixels<QPixelLayout::BPP24>, | - | ||||||||||||||||||||||||
| 857 | storePixels<QPixelLayout::BPP32> | - | ||||||||||||||||||||||||
| 858 | }; | - | ||||||||||||||||||||||||
| 859 | - | |||||||||||||||||||||||||
| 860 | typedef uint ( *FetchPixelFunc)(const uchar *src, int index); | - | ||||||||||||||||||||||||
| 861 | - | |||||||||||||||||||||||||
| 862 | static const FetchPixelFunc qFetchPixel[QPixelLayout::BPPCount] = { | - | ||||||||||||||||||||||||
| 863 | 0, | - | ||||||||||||||||||||||||
| 864 | fetchPixel<QPixelLayout::BPP1MSB>, | - | ||||||||||||||||||||||||
| 865 | fetchPixel<QPixelLayout::BPP1LSB>, | - | ||||||||||||||||||||||||
| 866 | fetchPixel<QPixelLayout::BPP8>, | - | ||||||||||||||||||||||||
| 867 | fetchPixel<QPixelLayout::BPP16>, | - | ||||||||||||||||||||||||
| 868 | fetchPixel<QPixelLayout::BPP24>, | - | ||||||||||||||||||||||||
| 869 | fetchPixel<QPixelLayout::BPP32> | - | ||||||||||||||||||||||||
| 870 | }; | - | ||||||||||||||||||||||||
| 871 | - | |||||||||||||||||||||||||
| 872 | - | |||||||||||||||||||||||||
| 873 | - | |||||||||||||||||||||||||
| 874 | - | |||||||||||||||||||||||||
| 875 | - | |||||||||||||||||||||||||
| 876 | - | |||||||||||||||||||||||||
| 877 | static uint * destFetchMono(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length) | - | ||||||||||||||||||||||||
| 878 | { | - | ||||||||||||||||||||||||
| 879 | uchar *__restrict__ data = (uchar *)rasterBuffer->scanLine(y); | - | ||||||||||||||||||||||||
| 880 | uint *start = buffer; | - | ||||||||||||||||||||||||
| 881 | const uint *end = buffer + length; | - | ||||||||||||||||||||||||
| 882 | while (buffer < end
| 0 | ||||||||||||||||||||||||
| 883 | *buffer = data[x>>3] & (0x80 >> (x & 7))
| 0 | ||||||||||||||||||||||||
| 884 | ++buffer; | - | ||||||||||||||||||||||||
| 885 | ++x; | - | ||||||||||||||||||||||||
| 886 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 887 | return never executed: start;return start;never executed: return start; | 0 | ||||||||||||||||||||||||
| 888 | } | - | ||||||||||||||||||||||||
| 889 | - | |||||||||||||||||||||||||
| 890 | static uint * destFetchMonoLsb(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length) | - | ||||||||||||||||||||||||
| 891 | { | - | ||||||||||||||||||||||||
| 892 | uchar *__restrict__ data = (uchar *)rasterBuffer->scanLine(y); | - | ||||||||||||||||||||||||
| 893 | uint *start = buffer; | - | ||||||||||||||||||||||||
| 894 | const uint *end = buffer + length; | - | ||||||||||||||||||||||||
| 895 | while (buffer < end
| 0 | ||||||||||||||||||||||||
| 896 | *buffer = data[x>>3] & (0x1 << (x & 7))
| 0 | ||||||||||||||||||||||||
| 897 | ++buffer; | - | ||||||||||||||||||||||||
| 898 | ++x; | - | ||||||||||||||||||||||||
| 899 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 900 | return never executed: start;return start;never executed: return start; | 0 | ||||||||||||||||||||||||
| 901 | } | - | ||||||||||||||||||||||||
| 902 | - | |||||||||||||||||||||||||
| 903 | static uint * destFetchARGB32P(uint *, QRasterBuffer *rasterBuffer, int x, int y, int) | - | ||||||||||||||||||||||||
| 904 | { | - | ||||||||||||||||||||||||
| 905 | return never executed: (uint *)rasterBuffer->scanLine(y) + x;return (uint *)rasterBuffer->scanLine(y) + x;never executed: return (uint *)rasterBuffer->scanLine(y) + x; | 0 | ||||||||||||||||||||||||
| 906 | } | - | ||||||||||||||||||||||||
| 907 | - | |||||||||||||||||||||||||
| 908 | static uint * destFetchRGB16(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length) | - | ||||||||||||||||||||||||
| 909 | { | - | ||||||||||||||||||||||||
| 910 | const ushort *__restrict__ data = (const ushort *)rasterBuffer->scanLine(y) + x; | - | ||||||||||||||||||||||||
| 911 | for (int i = 0; i < length
| 0 | ||||||||||||||||||||||||
| 912 | buffer[i] = qConvertRgb16To32(data[i]); never executed: buffer[i] = qConvertRgb16To32(data[i]); | 0 | ||||||||||||||||||||||||
| 913 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 914 | } | - | ||||||||||||||||||||||||
| 915 | - | |||||||||||||||||||||||||
| 916 | static uint * destFetch(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length) | - | ||||||||||||||||||||||||
| 917 | { | - | ||||||||||||||||||||||||
| 918 | const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format]; | - | ||||||||||||||||||||||||
| 919 | const uint *ptr = qFetchPixels[layout->bpp](buffer, rasterBuffer->scanLine(y), x, length); | - | ||||||||||||||||||||||||
| 920 | return never executed: const_cast<uint *>(layout->convertToARGB32PM(buffer, ptr, length, layout, 0));return const_cast<uint *>(layout->convertToARGB32PM(buffer, ptr, length, layout, 0));never executed: return const_cast<uint *>(layout->convertToARGB32PM(buffer, ptr, length, layout, 0)); | 0 | ||||||||||||||||||||||||
| 921 | } | - | ||||||||||||||||||||||||
| 922 | - | |||||||||||||||||||||||||
| 923 | static QRgba64 * destFetch64(QRgba64 *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length) | - | ||||||||||||||||||||||||
| 924 | { | - | ||||||||||||||||||||||||
| 925 | const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format]; | - | ||||||||||||||||||||||||
| 926 | uint buffer32[buffer_size]; | - | ||||||||||||||||||||||||
| 927 | const uint *ptr = qFetchPixels[layout->bpp](buffer32, rasterBuffer->scanLine(y), x, length); | - | ||||||||||||||||||||||||
| 928 | return never executed: const_cast<QRgba64 *>(layout->convertToARGB64PM(buffer, ptr, length, layout, 0));return const_cast<QRgba64 *>(layout->convertToARGB64PM(buffer, ptr, length, layout, 0));never executed: return const_cast<QRgba64 *>(layout->convertToARGB64PM(buffer, ptr, length, layout, 0)); | 0 | ||||||||||||||||||||||||
| 929 | } | - | ||||||||||||||||||||||||
| 930 | - | |||||||||||||||||||||||||
| 931 | static QRgba64 * destFetch64uint32(QRgba64 *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length) | - | ||||||||||||||||||||||||
| 932 | { | - | ||||||||||||||||||||||||
| 933 | const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format]; | - | ||||||||||||||||||||||||
| 934 | const uint *src = ((const uint *)rasterBuffer->scanLine(y)) + x; | - | ||||||||||||||||||||||||
| 935 | return never executed: const_cast<QRgba64 *>(layout->convertToARGB64PM(buffer, src, length, layout, 0));return const_cast<QRgba64 *>(layout->convertToARGB64PM(buffer, src, length, layout, 0));never executed: return const_cast<QRgba64 *>(layout->convertToARGB64PM(buffer, src, length, layout, 0)); | 0 | ||||||||||||||||||||||||
| 936 | } | - | ||||||||||||||||||||||||
| 937 | - | |||||||||||||||||||||||||
| 938 | static DestFetchProc destFetchProc[QImage::NImageFormats] = | - | ||||||||||||||||||||||||
| 939 | { | - | ||||||||||||||||||||||||
| 940 | 0, | - | ||||||||||||||||||||||||
| 941 | destFetchMono, | - | ||||||||||||||||||||||||
| 942 | destFetchMonoLsb, | - | ||||||||||||||||||||||||
| 943 | 0, | - | ||||||||||||||||||||||||
| 944 | destFetchARGB32P, | - | ||||||||||||||||||||||||
| 945 | destFetch, | - | ||||||||||||||||||||||||
| 946 | destFetchARGB32P, | - | ||||||||||||||||||||||||
| 947 | destFetchRGB16, | - | ||||||||||||||||||||||||
| 948 | destFetch, | - | ||||||||||||||||||||||||
| 949 | destFetch, | - | ||||||||||||||||||||||||
| 950 | destFetch, | - | ||||||||||||||||||||||||
| 951 | destFetch, | - | ||||||||||||||||||||||||
| 952 | destFetch, | - | ||||||||||||||||||||||||
| 953 | destFetch, | - | ||||||||||||||||||||||||
| 954 | destFetch, | - | ||||||||||||||||||||||||
| 955 | destFetch, | - | ||||||||||||||||||||||||
| 956 | destFetch, | - | ||||||||||||||||||||||||
| 957 | destFetch, | - | ||||||||||||||||||||||||
| 958 | destFetch, | - | ||||||||||||||||||||||||
| 959 | destFetch, | - | ||||||||||||||||||||||||
| 960 | destFetch, | - | ||||||||||||||||||||||||
| 961 | destFetch, | - | ||||||||||||||||||||||||
| 962 | destFetch, | - | ||||||||||||||||||||||||
| 963 | destFetch, | - | ||||||||||||||||||||||||
| 964 | destFetch, | - | ||||||||||||||||||||||||
| 965 | }; | - | ||||||||||||||||||||||||
| 966 | - | |||||||||||||||||||||||||
| 967 | static DestFetchProc64 destFetchProc64[QImage::NImageFormats] = | - | ||||||||||||||||||||||||
| 968 | { | - | ||||||||||||||||||||||||
| 969 | 0, | - | ||||||||||||||||||||||||
| 970 | destFetch64, | - | ||||||||||||||||||||||||
| 971 | destFetch64, | - | ||||||||||||||||||||||||
| 972 | 0, | - | ||||||||||||||||||||||||
| 973 | destFetch64uint32, | - | ||||||||||||||||||||||||
| 974 | destFetch64uint32, | - | ||||||||||||||||||||||||
| 975 | destFetch64uint32, | - | ||||||||||||||||||||||||
| 976 | destFetch64, | - | ||||||||||||||||||||||||
| 977 | destFetch64, | - | ||||||||||||||||||||||||
| 978 | destFetch64, | - | ||||||||||||||||||||||||
| 979 | destFetch64, | - | ||||||||||||||||||||||||
| 980 | destFetch64, | - | ||||||||||||||||||||||||
| 981 | destFetch64, | - | ||||||||||||||||||||||||
| 982 | destFetch64, | - | ||||||||||||||||||||||||
| 983 | destFetch64, | - | ||||||||||||||||||||||||
| 984 | destFetch64, | - | ||||||||||||||||||||||||
| 985 | destFetch64uint32, | - | ||||||||||||||||||||||||
| 986 | destFetch64uint32, | - | ||||||||||||||||||||||||
| 987 | destFetch64uint32, | - | ||||||||||||||||||||||||
| 988 | destFetch64uint32, | - | ||||||||||||||||||||||||
| 989 | destFetch64uint32, | - | ||||||||||||||||||||||||
| 990 | destFetch64uint32, | - | ||||||||||||||||||||||||
| 991 | destFetch64uint32, | - | ||||||||||||||||||||||||
| 992 | destFetch64, | - | ||||||||||||||||||||||||
| 993 | destFetch64, | - | ||||||||||||||||||||||||
| 994 | }; | - | ||||||||||||||||||||||||
| 995 | - | |||||||||||||||||||||||||
| 996 | - | |||||||||||||||||||||||||
| 997 | - | |||||||||||||||||||||||||
| 998 | - | |||||||||||||||||||||||||
| 999 | - | |||||||||||||||||||||||||
| 1000 | static inline QRgb findNearestColor(QRgb color, QRasterBuffer *rbuf) | - | ||||||||||||||||||||||||
| 1001 | { | - | ||||||||||||||||||||||||
| 1002 | QRgb color_0 = qPremultiply(rbuf->destColor0); | - | ||||||||||||||||||||||||
| 1003 | QRgb color_1 = qPremultiply(rbuf->destColor1); | - | ||||||||||||||||||||||||
| 1004 | color = qPremultiply(color); | - | ||||||||||||||||||||||||
| 1005 | - | |||||||||||||||||||||||||
| 1006 | int r = qRed(color); | - | ||||||||||||||||||||||||
| 1007 | int g = qGreen(color); | - | ||||||||||||||||||||||||
| 1008 | int b = qBlue(color); | - | ||||||||||||||||||||||||
| 1009 | int rx, gx, bx; | - | ||||||||||||||||||||||||
| 1010 | int dist_0, dist_1; | - | ||||||||||||||||||||||||
| 1011 | - | |||||||||||||||||||||||||
| 1012 | rx = r - qRed(color_0); | - | ||||||||||||||||||||||||
| 1013 | gx = g - qGreen(color_0); | - | ||||||||||||||||||||||||
| 1014 | bx = b - qBlue(color_0); | - | ||||||||||||||||||||||||
| 1015 | dist_0 = rx*rx + gx*gx + bx*bx; | - | ||||||||||||||||||||||||
| 1016 | - | |||||||||||||||||||||||||
| 1017 | rx = r - qRed(color_1); | - | ||||||||||||||||||||||||
| 1018 | gx = g - qGreen(color_1); | - | ||||||||||||||||||||||||
| 1019 | bx = b - qBlue(color_1); | - | ||||||||||||||||||||||||
| 1020 | dist_1 = rx*rx + gx*gx + bx*bx; | - | ||||||||||||||||||||||||
| 1021 | - | |||||||||||||||||||||||||
| 1022 | if (dist_0 < dist_1
| 0 | ||||||||||||||||||||||||
| 1023 | return never executed: color_0;return color_0;never executed: return color_0; | 0 | ||||||||||||||||||||||||
| 1024 | return never executed: color_1;return color_1;never executed: return color_1; | 0 | ||||||||||||||||||||||||
| 1025 | } | - | ||||||||||||||||||||||||
| 1026 | - | |||||||||||||||||||||||||
| 1027 | - | |||||||||||||||||||||||||
| 1028 | - | |||||||||||||||||||||||||
| 1029 | - | |||||||||||||||||||||||||
| 1030 | - | |||||||||||||||||||||||||
| 1031 | static void destStoreMono(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length) | - | ||||||||||||||||||||||||
| 1032 | { | - | ||||||||||||||||||||||||
| 1033 | uchar *__restrict__ data = (uchar *)rasterBuffer->scanLine(y); | - | ||||||||||||||||||||||||
| 1034 | if (rasterBuffer->monoDestinationWithClut
| 0 | ||||||||||||||||||||||||
| 1035 | for (int i = 0; i < length
| 0 | ||||||||||||||||||||||||
| 1036 | if (buffer[i] == rasterBuffer->destColor0
| 0 | ||||||||||||||||||||||||
| 1037 | data[x >> 3] &= ~(0x80 >> (x & 7)); | - | ||||||||||||||||||||||||
| 1038 | } never executed: else if (buffer[i] == rasterBuffer->destColor1end of block
| 0 | ||||||||||||||||||||||||
| 1039 | data[x >> 3] |= 0x80 >> (x & 7); | - | ||||||||||||||||||||||||
| 1040 | } never executed: else if (findNearestColor(buffer[i], rasterBuffer) == rasterBuffer->destColor0end of block
| 0 | ||||||||||||||||||||||||
| 1041 | data[x >> 3] &= ~(0x80 >> (x & 7)); | - | ||||||||||||||||||||||||
| 1042 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1043 | data[x >> 3] |= 0x80 >> (x & 7); | - | ||||||||||||||||||||||||
| 1044 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1045 | ++x; | - | ||||||||||||||||||||||||
| 1046 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1047 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1048 | for (int i = 0; i < length
| 0 | ||||||||||||||||||||||||
| 1049 | if (qGray(buffer[i]) < int(qt_bayer_matrix[y & 15][x & 15])
| 0 | ||||||||||||||||||||||||
| 1050 | data[x >> 3] |= 0x80 >> (x & 7); never executed: data[x >> 3] |= 0x80 >> (x & 7); | 0 | ||||||||||||||||||||||||
| 1051 | else | - | ||||||||||||||||||||||||
| 1052 | data[x >> 3] &= ~(0x80 >> (x & 7)); never executed: data[x >> 3] &= ~(0x80 >> (x & 7)); | 0 | ||||||||||||||||||||||||
| 1053 | ++x; | - | ||||||||||||||||||||||||
| 1054 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1055 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1056 | } | - | ||||||||||||||||||||||||
| 1057 | - | |||||||||||||||||||||||||
| 1058 | static void destStoreMonoLsb(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length) | - | ||||||||||||||||||||||||
| 1059 | { | - | ||||||||||||||||||||||||
| 1060 | uchar *__restrict__ data = (uchar *)rasterBuffer->scanLine(y); | - | ||||||||||||||||||||||||
| 1061 | if (rasterBuffer->monoDestinationWithClut
| 0 | ||||||||||||||||||||||||
| 1062 | for (int i = 0; i < length
| 0 | ||||||||||||||||||||||||
| 1063 | if (buffer[i] == rasterBuffer->destColor0
| 0 | ||||||||||||||||||||||||
| 1064 | data[x >> 3] &= ~(1 << (x & 7)); | - | ||||||||||||||||||||||||
| 1065 | } never executed: else if (buffer[i] == rasterBuffer->destColor1end of block
| 0 | ||||||||||||||||||||||||
| 1066 | data[x >> 3] |= 1 << (x & 7); | - | ||||||||||||||||||||||||
| 1067 | } never executed: else if (findNearestColor(buffer[i], rasterBuffer) == rasterBuffer->destColor0end of block
| 0 | ||||||||||||||||||||||||
| 1068 | data[x >> 3] &= ~(1 << (x & 7)); | - | ||||||||||||||||||||||||
| 1069 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1070 | data[x >> 3] |= 1 << (x & 7); | - | ||||||||||||||||||||||||
| 1071 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1072 | ++x; | - | ||||||||||||||||||||||||
| 1073 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1074 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1075 | for (int i = 0; i < length
| 0 | ||||||||||||||||||||||||
| 1076 | if (qGray(buffer[i]) < int(qt_bayer_matrix[y & 15][x & 15])
| 0 | ||||||||||||||||||||||||
| 1077 | data[x >> 3] |= 1 << (x & 7); never executed: data[x >> 3] |= 1 << (x & 7); | 0 | ||||||||||||||||||||||||
| 1078 | else | - | ||||||||||||||||||||||||
| 1079 | data[x >> 3] &= ~(1 << (x & 7)); never executed: data[x >> 3] &= ~(1 << (x & 7)); | 0 | ||||||||||||||||||||||||
| 1080 | ++x; | - | ||||||||||||||||||||||||
| 1081 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1082 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1083 | } | - | ||||||||||||||||||||||||
| 1084 | - | |||||||||||||||||||||||||
| 1085 | static void destStoreRGB16(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length) | - | ||||||||||||||||||||||||
| 1086 | { | - | ||||||||||||||||||||||||
| 1087 | quint16 *data = (quint16*)rasterBuffer->scanLine(y) + x; | - | ||||||||||||||||||||||||
| 1088 | for (int i = 0; i < length
| 0 | ||||||||||||||||||||||||
| 1089 | data[i] = qConvertRgb32To16(buffer[i]); never executed: data[i] = qConvertRgb32To16(buffer[i]); | 0 | ||||||||||||||||||||||||
| 1090 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1091 | - | |||||||||||||||||||||||||
| 1092 | static void destStore(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length) | - | ||||||||||||||||||||||||
| 1093 | { | - | ||||||||||||||||||||||||
| 1094 | uint buf[buffer_size]; | - | ||||||||||||||||||||||||
| 1095 | const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format]; | - | ||||||||||||||||||||||||
| 1096 | StorePixelsFunc store = qStorePixels[layout->bpp]; | - | ||||||||||||||||||||||||
| 1097 | uchar *dest = rasterBuffer->scanLine(y); | - | ||||||||||||||||||||||||
| 1098 | while (length
| 0 | ||||||||||||||||||||||||
| 1099 | int l = qMin(length, buffer_size); | - | ||||||||||||||||||||||||
| 1100 | const uint *ptr = 0; | - | ||||||||||||||||||||||||
| 1101 | if (!layout->premultiplied
| 0 | ||||||||||||||||||||||||
| 1102 | ptr = layout->convertFromRGB32(buf, buffer, l, layout, 0); never executed: ptr = layout->convertFromRGB32(buf, buffer, l, layout, 0); | 0 | ||||||||||||||||||||||||
| 1103 | else | - | ||||||||||||||||||||||||
| 1104 | ptr = layout->convertFromARGB32PM(buf, buffer, l, layout, 0); never executed: ptr = layout->convertFromARGB32PM(buf, buffer, l, layout, 0); | 0 | ||||||||||||||||||||||||
| 1105 | store(dest, ptr, x, l); | - | ||||||||||||||||||||||||
| 1106 | length -= l; | - | ||||||||||||||||||||||||
| 1107 | buffer += l; | - | ||||||||||||||||||||||||
| 1108 | x += l; | - | ||||||||||||||||||||||||
| 1109 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1110 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1111 | - | |||||||||||||||||||||||||
| 1112 | static void convertFromRgb64(uint *dest, const QRgba64 *src, int length) | - | ||||||||||||||||||||||||
| 1113 | { | - | ||||||||||||||||||||||||
| 1114 | for (int i = 0; i < length
| 0 | ||||||||||||||||||||||||
| 1115 | dest[i] = src[i].toArgb32(); | - | ||||||||||||||||||||||||
| 1116 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1117 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1118 | - | |||||||||||||||||||||||||
| 1119 | static void destStore64(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length) | - | ||||||||||||||||||||||||
| 1120 | { | - | ||||||||||||||||||||||||
| 1121 | uint buf[buffer_size]; | - | ||||||||||||||||||||||||
| 1122 | const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format]; | - | ||||||||||||||||||||||||
| 1123 | StorePixelsFunc store = qStorePixels[layout->bpp]; | - | ||||||||||||||||||||||||
| 1124 | uchar *dest = rasterBuffer->scanLine(y); | - | ||||||||||||||||||||||||
| 1125 | while (length
| 0 | ||||||||||||||||||||||||
| 1126 | int l = qMin(length, buffer_size); | - | ||||||||||||||||||||||||
| 1127 | const uint *ptr = 0; | - | ||||||||||||||||||||||||
| 1128 | convertFromRgb64(buf, buffer, l); | - | ||||||||||||||||||||||||
| 1129 | if (!layout->premultiplied
| 0 | ||||||||||||||||||||||||
| 1130 | ptr = layout->convertFromRGB32(buf, buf, l, layout, 0); never executed: ptr = layout->convertFromRGB32(buf, buf, l, layout, 0); | 0 | ||||||||||||||||||||||||
| 1131 | else | - | ||||||||||||||||||||||||
| 1132 | ptr = layout->convertFromARGB32PM(buf, buf, l, layout, 0); never executed: ptr = layout->convertFromARGB32PM(buf, buf, l, layout, 0); | 0 | ||||||||||||||||||||||||
| 1133 | store(dest, ptr, x, l); | - | ||||||||||||||||||||||||
| 1134 | length -= l; | - | ||||||||||||||||||||||||
| 1135 | buffer += l; | - | ||||||||||||||||||||||||
| 1136 | x += l; | - | ||||||||||||||||||||||||
| 1137 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1138 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1139 | - | |||||||||||||||||||||||||
| 1140 | - | |||||||||||||||||||||||||
| 1141 | template<QtPixelOrder PixelOrder> | - | ||||||||||||||||||||||||
| 1142 | static inline void qConvertARGB64PMToA2RGB30PM_sse2(uint *dest, const QRgba64 *buffer, int count) | - | ||||||||||||||||||||||||
| 1143 | { | - | ||||||||||||||||||||||||
| 1144 | const __m128i gmask = _mm_set1_epi32(0x000ffc00); | - | ||||||||||||||||||||||||
| 1145 | const __m128i cmask = _mm_set1_epi32(0x000003ff); | - | ||||||||||||||||||||||||
| 1146 | int i = 0; | - | ||||||||||||||||||||||||
| 1147 | __m128i vr, vg, vb, va; | - | ||||||||||||||||||||||||
| 1148 | for (; i < count
| 0 | ||||||||||||||||||||||||
| 1149 | *dest++ = qConvertRgb64ToRgb30<PixelOrder>(*buffer++); | - | ||||||||||||||||||||||||
| 1150 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1151 | - | |||||||||||||||||||||||||
| 1152 | for (; i < count-15
| 0 | ||||||||||||||||||||||||
| 1153 | - | |||||||||||||||||||||||||
| 1154 | - | |||||||||||||||||||||||||
| 1155 | __m128i vOr = _mm_set1_epi32(0); | - | ||||||||||||||||||||||||
| 1156 | __m128i vAnd = _mm_set1_epi32(0xffffffff); | - | ||||||||||||||||||||||||
| 1157 | for (int j = 0; j < 16
| 0 | ||||||||||||||||||||||||
| 1158 | __m128i vs = _mm_load_si128((const __m128i*)(buffer + j)); | - | ||||||||||||||||||||||||
| 1159 | vOr = _mm_or_si128(vOr, vs); | - | ||||||||||||||||||||||||
| 1160 | vAnd = _mm_and_si128(vAnd, vs); | - | ||||||||||||||||||||||||
| 1161 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1162 | const quint16 orAlpha = ((uint)((int) (unsigned short) __builtin_ia32_vec_ext_v8hi ((__v8hi)(__m128i)(vOr), (int)(3)))) | ((uint)((int) (unsigned short) __builtin_ia32_vec_ext_v8hi ((__v8hi)(__m128i)(vOr), (int)(7)))); | - | ||||||||||||||||||||||||
| 1163 | const quint16 andAlpha = ((uint)((int) (unsigned short) __builtin_ia32_vec_ext_v8hi ((__v8hi)(__m128i)(vAnd), (int)(3)))) & ((uint)((int) (unsigned short) __builtin_ia32_vec_ext_v8hi ((__v8hi)(__m128i)(vAnd), (int)(7)))); | - | ||||||||||||||||||||||||
| 1164 | - | |||||||||||||||||||||||||
| 1165 | if (andAlpha == 0xffff
| 0 | ||||||||||||||||||||||||
| 1166 | for (int j = 0; j < 16
| 0 | ||||||||||||||||||||||||
| 1167 | __m128i vs = _mm_load_si128((const __m128i*)buffer); | - | ||||||||||||||||||||||||
| 1168 | buffer += 2; | - | ||||||||||||||||||||||||
| 1169 | vr = _mm_srli_epi64(vs, 6); | - | ||||||||||||||||||||||||
| 1170 | vg = _mm_srli_epi64(vs, 16 + 6 - 10); | - | ||||||||||||||||||||||||
| 1171 | vb = _mm_srli_epi64(vs, 32 + 6); | - | ||||||||||||||||||||||||
| 1172 | vr = _mm_and_si128(vr, cmask); | - | ||||||||||||||||||||||||
| 1173 | vg = _mm_and_si128(vg, gmask); | - | ||||||||||||||||||||||||
| 1174 | vb = _mm_and_si128(vb, cmask); | - | ||||||||||||||||||||||||
| 1175 | va = _mm_srli_epi64(vs, 48 + 14); | - | ||||||||||||||||||||||||
| 1176 | if (PixelOrder == PixelOrderRGB
| 0 | ||||||||||||||||||||||||
| 1177 | vr = _mm_slli_epi32(vr, 20); never executed: vr = _mm_slli_epi32(vr, 20); | 0 | ||||||||||||||||||||||||
| 1178 | else | - | ||||||||||||||||||||||||
| 1179 | vb = _mm_slli_epi32(vb, 20); never executed: vb = _mm_slli_epi32(vb, 20); | 0 | ||||||||||||||||||||||||
| 1180 | va = _mm_slli_epi32(va, 30); | - | ||||||||||||||||||||||||
| 1181 | __m128i vd = _mm_or_si128(_mm_or_si128(vr, vg), _mm_or_si128(vb, va)); | - | ||||||||||||||||||||||||
| 1182 | vd = ((__m128i)__builtin_ia32_pshufd ((__v4si)(__m128i)(vd), (int)((((3) << 6) | ((1) << 4) | ((2) << 2) | (0))))); | - | ||||||||||||||||||||||||
| 1183 | _mm_storel_epi64((__m128i*)dest, vd); | - | ||||||||||||||||||||||||
| 1184 | dest += 2; | - | ||||||||||||||||||||||||
| 1185 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1186 | } never executed: else if (orAlpha == 0end of block
| 0 | ||||||||||||||||||||||||
| 1187 | for (int j = 0; j < 16
| 0 | ||||||||||||||||||||||||
| 1188 | *dest++ = 0; | - | ||||||||||||||||||||||||
| 1189 | buffer++; | - | ||||||||||||||||||||||||
| 1190 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1191 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1192 | for (int j = 0; j < 16
| 0 | ||||||||||||||||||||||||
| 1193 | * never executed: dest++ = qConvertRgb64ToRgb30<PixelOrder>(*buffer++);*dest++ = qConvertRgb64ToRgb30<PixelOrder>(*buffer++);never executed: *dest++ = qConvertRgb64ToRgb30<PixelOrder>(*buffer++); | 0 | ||||||||||||||||||||||||
| 1194 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1195 | } | - | ||||||||||||||||||||||||
| 1196 | - | |||||||||||||||||||||||||
| 1197 | for (; i < count
| 0 | ||||||||||||||||||||||||
| 1198 | * never executed: dest++ = qConvertRgb64ToRgb30<PixelOrder>(*buffer++);*dest++ = qConvertRgb64ToRgb30<PixelOrder>(*buffer++);never executed: *dest++ = qConvertRgb64ToRgb30<PixelOrder>(*buffer++); | 0 | ||||||||||||||||||||||||
| 1199 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1200 | - | |||||||||||||||||||||||||
| 1201 | - | |||||||||||||||||||||||||
| 1202 | static void destStore64ARGB32(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length) | - | ||||||||||||||||||||||||
| 1203 | { | - | ||||||||||||||||||||||||
| 1204 | uint *dest = (uint*)rasterBuffer->scanLine(y) + x; | - | ||||||||||||||||||||||||
| 1205 | for (int i = 0; i < length
| 0 | ||||||||||||||||||||||||
| 1206 | dest[i] = buffer[i].unpremultiplied().toArgb32(); | - | ||||||||||||||||||||||||
| 1207 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1208 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1209 | - | |||||||||||||||||||||||||
| 1210 | static void destStore64RGBA8888(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length) | - | ||||||||||||||||||||||||
| 1211 | { | - | ||||||||||||||||||||||||
| 1212 | uint *dest = (uint*)rasterBuffer->scanLine(y) + x; | - | ||||||||||||||||||||||||
| 1213 | for (int i = 0; i < length
| 0 | ||||||||||||||||||||||||
| 1214 | dest[i] = ARGB2RGBA(buffer[i].unpremultiplied().toArgb32()); | - | ||||||||||||||||||||||||
| 1215 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1216 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1217 | - | |||||||||||||||||||||||||
| 1218 | template<QtPixelOrder PixelOrder> | - | ||||||||||||||||||||||||
| 1219 | static void destStore64RGB30(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length) | - | ||||||||||||||||||||||||
| 1220 | { | - | ||||||||||||||||||||||||
| 1221 | uint *dest = (uint*)rasterBuffer->scanLine(y) + x; | - | ||||||||||||||||||||||||
| 1222 | - | |||||||||||||||||||||||||
| 1223 | qConvertARGB64PMToA2RGB30PM_sse2<PixelOrder>(dest, buffer, length); | - | ||||||||||||||||||||||||
| 1224 | - | |||||||||||||||||||||||||
| 1225 | - | |||||||||||||||||||||||||
| 1226 | - | |||||||||||||||||||||||||
| 1227 | - | |||||||||||||||||||||||||
| 1228 | - | |||||||||||||||||||||||||
| 1229 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1230 | - | |||||||||||||||||||||||||
| 1231 | static DestStoreProc destStoreProc[QImage::NImageFormats] = | - | ||||||||||||||||||||||||
| 1232 | { | - | ||||||||||||||||||||||||
| 1233 | 0, | - | ||||||||||||||||||||||||
| 1234 | destStoreMono, | - | ||||||||||||||||||||||||
| 1235 | destStoreMonoLsb, | - | ||||||||||||||||||||||||
| 1236 | 0, | - | ||||||||||||||||||||||||
| 1237 | 0, | - | ||||||||||||||||||||||||
| 1238 | destStore, | - | ||||||||||||||||||||||||
| 1239 | 0, | - | ||||||||||||||||||||||||
| 1240 | destStoreRGB16, | - | ||||||||||||||||||||||||
| 1241 | destStore, | - | ||||||||||||||||||||||||
| 1242 | destStore, | - | ||||||||||||||||||||||||
| 1243 | destStore, | - | ||||||||||||||||||||||||
| 1244 | destStore, | - | ||||||||||||||||||||||||
| 1245 | destStore, | - | ||||||||||||||||||||||||
| 1246 | destStore, | - | ||||||||||||||||||||||||
| 1247 | destStore, | - | ||||||||||||||||||||||||
| 1248 | destStore, | - | ||||||||||||||||||||||||
| 1249 | destStore, | - | ||||||||||||||||||||||||
| 1250 | destStore, | - | ||||||||||||||||||||||||
| 1251 | destStore, | - | ||||||||||||||||||||||||
| 1252 | destStore, | - | ||||||||||||||||||||||||
| 1253 | destStore, | - | ||||||||||||||||||||||||
| 1254 | destStore, | - | ||||||||||||||||||||||||
| 1255 | destStore, | - | ||||||||||||||||||||||||
| 1256 | destStore, | - | ||||||||||||||||||||||||
| 1257 | destStore, | - | ||||||||||||||||||||||||
| 1258 | }; | - | ||||||||||||||||||||||||
| 1259 | - | |||||||||||||||||||||||||
| 1260 | static DestStoreProc64 destStoreProc64[QImage::NImageFormats] = | - | ||||||||||||||||||||||||
| 1261 | { | - | ||||||||||||||||||||||||
| 1262 | 0, | - | ||||||||||||||||||||||||
| 1263 | destStore64, | - | ||||||||||||||||||||||||
| 1264 | destStore64, | - | ||||||||||||||||||||||||
| 1265 | 0, | - | ||||||||||||||||||||||||
| 1266 | destStore64, | - | ||||||||||||||||||||||||
| 1267 | destStore64ARGB32, | - | ||||||||||||||||||||||||
| 1268 | destStore64, | - | ||||||||||||||||||||||||
| 1269 | destStore64, | - | ||||||||||||||||||||||||
| 1270 | destStore64, | - | ||||||||||||||||||||||||
| 1271 | destStore64, | - | ||||||||||||||||||||||||
| 1272 | destStore64, | - | ||||||||||||||||||||||||
| 1273 | destStore64, | - | ||||||||||||||||||||||||
| 1274 | destStore64, | - | ||||||||||||||||||||||||
| 1275 | destStore64, | - | ||||||||||||||||||||||||
| 1276 | destStore64, | - | ||||||||||||||||||||||||
| 1277 | destStore64, | - | ||||||||||||||||||||||||
| 1278 | destStore64, | - | ||||||||||||||||||||||||
| 1279 | destStore64RGBA8888, | - | ||||||||||||||||||||||||
| 1280 | destStore64, | - | ||||||||||||||||||||||||
| 1281 | destStore64RGB30<PixelOrderBGR>, | - | ||||||||||||||||||||||||
| 1282 | destStore64RGB30<PixelOrderBGR>, | - | ||||||||||||||||||||||||
| 1283 | destStore64RGB30<PixelOrderRGB>, | - | ||||||||||||||||||||||||
| 1284 | destStore64RGB30<PixelOrderRGB>, | - | ||||||||||||||||||||||||
| 1285 | destStore64, | - | ||||||||||||||||||||||||
| 1286 | destStore64, | - | ||||||||||||||||||||||||
| 1287 | }; | - | ||||||||||||||||||||||||
| 1288 | enum TextureBlendType { | - | ||||||||||||||||||||||||
| 1289 | BlendUntransformed, | - | ||||||||||||||||||||||||
| 1290 | BlendTiled, | - | ||||||||||||||||||||||||
| 1291 | BlendTransformed, | - | ||||||||||||||||||||||||
| 1292 | BlendTransformedTiled, | - | ||||||||||||||||||||||||
| 1293 | BlendTransformedBilinear, | - | ||||||||||||||||||||||||
| 1294 | BlendTransformedBilinearTiled, | - | ||||||||||||||||||||||||
| 1295 | NBlendTypes | - | ||||||||||||||||||||||||
| 1296 | }; | - | ||||||||||||||||||||||||
| 1297 | - | |||||||||||||||||||||||||
| 1298 | static const uint * fetchUntransformed(uint *buffer, const Operator *, | - | ||||||||||||||||||||||||
| 1299 | const QSpanData *data, int y, int x, int length) | - | ||||||||||||||||||||||||
| 1300 | { | - | ||||||||||||||||||||||||
| 1301 | const QPixelLayout *layout = &qPixelLayouts[data->texture.format]; | - | ||||||||||||||||||||||||
| 1302 | const uint *ptr = qFetchPixels[layout->bpp](buffer, data->texture.scanLine(y), x, length); | - | ||||||||||||||||||||||||
| 1303 | const QRgb *clut = data->texture.colorTable
| 0 | ||||||||||||||||||||||||
| 1304 | return never executed: layout->convertToARGB32PM(buffer, ptr, length, layout, clut);return layout->convertToARGB32PM(buffer, ptr, length, layout, clut);never executed: return layout->convertToARGB32PM(buffer, ptr, length, layout, clut); | 0 | ||||||||||||||||||||||||
| 1305 | } | - | ||||||||||||||||||||||||
| 1306 | - | |||||||||||||||||||||||||
| 1307 | static const uint * fetchUntransformedARGB32PM(uint *, const Operator *, | - | ||||||||||||||||||||||||
| 1308 | const QSpanData *data, int y, int x, int) | - | ||||||||||||||||||||||||
| 1309 | { | - | ||||||||||||||||||||||||
| 1310 | const uchar *scanLine = data->texture.scanLine(y); | - | ||||||||||||||||||||||||
| 1311 | return never executed: ((const uint *)scanLine) + x;return ((const uint *)scanLine) + x;never executed: return ((const uint *)scanLine) + x; | 0 | ||||||||||||||||||||||||
| 1312 | } | - | ||||||||||||||||||||||||
| 1313 | - | |||||||||||||||||||||||||
| 1314 | static const uint * fetchUntransformedRGB16(uint *buffer, const Operator *, | - | ||||||||||||||||||||||||
| 1315 | const QSpanData *data, int y, int x, | - | ||||||||||||||||||||||||
| 1316 | int length) | - | ||||||||||||||||||||||||
| 1317 | { | - | ||||||||||||||||||||||||
| 1318 | const quint16 *scanLine = (const quint16 *)data->texture.scanLine(y) + x; | - | ||||||||||||||||||||||||
| 1319 | - | |||||||||||||||||||||||||
| 1320 | - | |||||||||||||||||||||||||
| 1321 | - | |||||||||||||||||||||||||
| 1322 | for (int i = 0; i < length
| 0 | ||||||||||||||||||||||||
| 1323 | buffer[i] = qConvertRgb16To32(scanLine[i]); never executed: buffer[i] = qConvertRgb16To32(scanLine[i]); | 0 | ||||||||||||||||||||||||
| 1324 | - | |||||||||||||||||||||||||
| 1325 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 1326 | } | - | ||||||||||||||||||||||||
| 1327 | - | |||||||||||||||||||||||||
| 1328 | static const QRgba64 * fetchUntransformed64(QRgba64 *buffer, const Operator *, | - | ||||||||||||||||||||||||
| 1329 | const QSpanData *data, int y, int x, int length) | - | ||||||||||||||||||||||||
| 1330 | { | - | ||||||||||||||||||||||||
| 1331 | const QPixelLayout *layout = &qPixelLayouts[data->texture.format]; | - | ||||||||||||||||||||||||
| 1332 | const QRgb *clut = data->texture.colorTable
| 0 | ||||||||||||||||||||||||
| 1333 | if (layout->bpp != QPixelLayout::BPP32
| 0 | ||||||||||||||||||||||||
| 1334 | uint buffer32[buffer_size]; | - | ||||||||||||||||||||||||
| 1335 | const uint *ptr = qFetchPixels[layout->bpp](buffer32, data->texture.scanLine(y), x, length); | - | ||||||||||||||||||||||||
| 1336 | return never executed: layout->convertToARGB64PM(buffer, ptr, length, layout, clut);return layout->convertToARGB64PM(buffer, ptr, length, layout, clut);never executed: return layout->convertToARGB64PM(buffer, ptr, length, layout, clut); | 0 | ||||||||||||||||||||||||
| 1337 | } else { | - | ||||||||||||||||||||||||
| 1338 | const uint *src = (const uint *)data->texture.scanLine(y) + x; | - | ||||||||||||||||||||||||
| 1339 | return never executed: layout->convertToARGB64PM(buffer, src, length, layout, clut);return layout->convertToARGB64PM(buffer, src, length, layout, clut);never executed: return layout->convertToARGB64PM(buffer, src, length, layout, clut); | 0 | ||||||||||||||||||||||||
| 1340 | } | - | ||||||||||||||||||||||||
| 1341 | } | - | ||||||||||||||||||||||||
| 1342 | - | |||||||||||||||||||||||||
| 1343 | - | |||||||||||||||||||||||||
| 1344 | template<TextureBlendType blendType> | - | ||||||||||||||||||||||||
| 1345 | static const uint * fetchTransformedARGB32PM(uint *buffer, const Operator *, const QSpanData *data, | - | ||||||||||||||||||||||||
| 1346 | int y, int x, int length) | - | ||||||||||||||||||||||||
| 1347 | { | - | ||||||||||||||||||||||||
| 1348 | int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 1349 | int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 1350 | - | |||||||||||||||||||||||||
| 1351 | const qreal cx = x + qreal(0.5); | - | ||||||||||||||||||||||||
| 1352 | const qreal cy = y + qreal(0.5); | - | ||||||||||||||||||||||||
| 1353 | - | |||||||||||||||||||||||||
| 1354 | const uint *end = buffer + length; | - | ||||||||||||||||||||||||
| 1355 | uint *b = buffer; | - | ||||||||||||||||||||||||
| 1356 | if (data->fast_matrix
| 0 | ||||||||||||||||||||||||
| 1357 | - | |||||||||||||||||||||||||
| 1358 | int fdx = (int)(data->m11 * fixed_scale); | - | ||||||||||||||||||||||||
| 1359 | int fdy = (int)(data->m12 * fixed_scale); | - | ||||||||||||||||||||||||
| 1360 | - | |||||||||||||||||||||||||
| 1361 | int fx = int((data->m21 * cy | - | ||||||||||||||||||||||||
| 1362 | + data->m11 * cx + data->dx) * fixed_scale); | - | ||||||||||||||||||||||||
| 1363 | int fy = int((data->m22 * cy | - | ||||||||||||||||||||||||
| 1364 | + data->m12 * cx + data->dy) * fixed_scale); | - | ||||||||||||||||||||||||
| 1365 | - | |||||||||||||||||||||||||
| 1366 | while (b < end
| 0 | ||||||||||||||||||||||||
| 1367 | int px = fx >> 16; | - | ||||||||||||||||||||||||
| 1368 | int py = fy >> 16; | - | ||||||||||||||||||||||||
| 1369 | - | |||||||||||||||||||||||||
| 1370 | if (blendType == BlendTransformedTiled
| 0 | ||||||||||||||||||||||||
| 1371 | px %= image_width; | - | ||||||||||||||||||||||||
| 1372 | py %= image_height; | - | ||||||||||||||||||||||||
| 1373 | if (px < 0
never executed: px += image_width; | 0 | ||||||||||||||||||||||||
| 1374 | if (py < 0
never executed: py += image_height; | 0 | ||||||||||||||||||||||||
| 1375 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1376 | px = qBound(0, px, image_width - 1); | - | ||||||||||||||||||||||||
| 1377 | py = qBound(0, py, image_height - 1); | - | ||||||||||||||||||||||||
| 1378 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1379 | *b = reinterpret_cast<const uint *>(data->texture.scanLine(py))[px]; | - | ||||||||||||||||||||||||
| 1380 | - | |||||||||||||||||||||||||
| 1381 | fx += fdx; | - | ||||||||||||||||||||||||
| 1382 | fy += fdy; | - | ||||||||||||||||||||||||
| 1383 | ++b; | - | ||||||||||||||||||||||||
| 1384 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1385 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1386 | const qreal fdx = data->m11; | - | ||||||||||||||||||||||||
| 1387 | const qreal fdy = data->m12; | - | ||||||||||||||||||||||||
| 1388 | const qreal fdw = data->m13; | - | ||||||||||||||||||||||||
| 1389 | - | |||||||||||||||||||||||||
| 1390 | qreal fx = data->m21 * cy + data->m11 * cx + data->dx; | - | ||||||||||||||||||||||||
| 1391 | qreal fy = data->m22 * cy + data->m12 * cx + data->dy; | - | ||||||||||||||||||||||||
| 1392 | qreal fw = data->m23 * cy + data->m13 * cx + data->m33; | - | ||||||||||||||||||||||||
| 1393 | - | |||||||||||||||||||||||||
| 1394 | while (b < end
| 0 | ||||||||||||||||||||||||
| 1395 | const qreal iw = fw == 0 ? 1 : 1 / fw; | - | ||||||||||||||||||||||||
| 1396 | const qreal tx = fx * iw; | - | ||||||||||||||||||||||||
| 1397 | const qreal ty = fy * iw; | - | ||||||||||||||||||||||||
| 1398 | int px = int(tx) - (tx < 0); | - | ||||||||||||||||||||||||
| 1399 | int py = int(ty) - (ty < 0); | - | ||||||||||||||||||||||||
| 1400 | - | |||||||||||||||||||||||||
| 1401 | if (blendType == BlendTransformedTiled
| 0 | ||||||||||||||||||||||||
| 1402 | px %= image_width; | - | ||||||||||||||||||||||||
| 1403 | py %= image_height; | - | ||||||||||||||||||||||||
| 1404 | if (px < 0
never executed: px += image_width; | 0 | ||||||||||||||||||||||||
| 1405 | if (py < 0
never executed: py += image_height; | 0 | ||||||||||||||||||||||||
| 1406 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1407 | px = qBound(0, px, image_width - 1); | - | ||||||||||||||||||||||||
| 1408 | py = qBound(0, py, image_height - 1); | - | ||||||||||||||||||||||||
| 1409 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1410 | *b = reinterpret_cast<const uint *>(data->texture.scanLine(py))[px]; | - | ||||||||||||||||||||||||
| 1411 | - | |||||||||||||||||||||||||
| 1412 | fx += fdx; | - | ||||||||||||||||||||||||
| 1413 | fy += fdy; | - | ||||||||||||||||||||||||
| 1414 | fw += fdw; | - | ||||||||||||||||||||||||
| 1415 | - | |||||||||||||||||||||||||
| 1416 | if (!fw
| 0 | ||||||||||||||||||||||||
| 1417 | fw += fdw; | - | ||||||||||||||||||||||||
| 1418 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1419 | ++b; | - | ||||||||||||||||||||||||
| 1420 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1421 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1422 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 1423 | } | - | ||||||||||||||||||||||||
| 1424 | - | |||||||||||||||||||||||||
| 1425 | template<TextureBlendType blendType> | - | ||||||||||||||||||||||||
| 1426 | static const uint * fetchTransformed(uint *buffer, const Operator *, const QSpanData *data, | - | ||||||||||||||||||||||||
| 1427 | int y, int x, int length) | - | ||||||||||||||||||||||||
| 1428 | { | - | ||||||||||||||||||||||||
| 1429 | int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 1430 | int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 1431 | - | |||||||||||||||||||||||||
| 1432 | const qreal cx = x + qreal(0.5); | - | ||||||||||||||||||||||||
| 1433 | const qreal cy = y + qreal(0.5); | - | ||||||||||||||||||||||||
| 1434 | - | |||||||||||||||||||||||||
| 1435 | const QPixelLayout *layout = &qPixelLayouts[data->texture.format]; | - | ||||||||||||||||||||||||
| 1436 | FetchPixelFunc fetch = qFetchPixel[layout->bpp]; | - | ||||||||||||||||||||||||
| 1437 | - | |||||||||||||||||||||||||
| 1438 | const uint *end = buffer + length; | - | ||||||||||||||||||||||||
| 1439 | uint *b = buffer; | - | ||||||||||||||||||||||||
| 1440 | if (data->fast_matrix
| 0 | ||||||||||||||||||||||||
| 1441 | - | |||||||||||||||||||||||||
| 1442 | int fdx = (int)(data->m11 * fixed_scale); | - | ||||||||||||||||||||||||
| 1443 | int fdy = (int)(data->m12 * fixed_scale); | - | ||||||||||||||||||||||||
| 1444 | - | |||||||||||||||||||||||||
| 1445 | int fx = int((data->m21 * cy | - | ||||||||||||||||||||||||
| 1446 | + data->m11 * cx + data->dx) * fixed_scale); | - | ||||||||||||||||||||||||
| 1447 | int fy = int((data->m22 * cy | - | ||||||||||||||||||||||||
| 1448 | + data->m12 * cx + data->dy) * fixed_scale); | - | ||||||||||||||||||||||||
| 1449 | - | |||||||||||||||||||||||||
| 1450 | while (b < end
| 0 | ||||||||||||||||||||||||
| 1451 | int px = fx >> 16; | - | ||||||||||||||||||||||||
| 1452 | int py = fy >> 16; | - | ||||||||||||||||||||||||
| 1453 | - | |||||||||||||||||||||||||
| 1454 | if (blendType == BlendTransformedTiled
| 0 | ||||||||||||||||||||||||
| 1455 | px %= image_width; | - | ||||||||||||||||||||||||
| 1456 | py %= image_height; | - | ||||||||||||||||||||||||
| 1457 | if (px < 0
never executed: px += image_width; | 0 | ||||||||||||||||||||||||
| 1458 | if (py < 0
never executed: py += image_height; | 0 | ||||||||||||||||||||||||
| 1459 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1460 | px = qBound(0, px, image_width - 1); | - | ||||||||||||||||||||||||
| 1461 | py = qBound(0, py, image_height - 1); | - | ||||||||||||||||||||||||
| 1462 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1463 | *b = fetch(data->texture.scanLine(py), px); | - | ||||||||||||||||||||||||
| 1464 | - | |||||||||||||||||||||||||
| 1465 | fx += fdx; | - | ||||||||||||||||||||||||
| 1466 | fy += fdy; | - | ||||||||||||||||||||||||
| 1467 | ++b; | - | ||||||||||||||||||||||||
| 1468 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1469 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1470 | const qreal fdx = data->m11; | - | ||||||||||||||||||||||||
| 1471 | const qreal fdy = data->m12; | - | ||||||||||||||||||||||||
| 1472 | const qreal fdw = data->m13; | - | ||||||||||||||||||||||||
| 1473 | - | |||||||||||||||||||||||||
| 1474 | qreal fx = data->m21 * cy + data->m11 * cx + data->dx; | - | ||||||||||||||||||||||||
| 1475 | qreal fy = data->m22 * cy + data->m12 * cx + data->dy; | - | ||||||||||||||||||||||||
| 1476 | qreal fw = data->m23 * cy + data->m13 * cx + data->m33; | - | ||||||||||||||||||||||||
| 1477 | - | |||||||||||||||||||||||||
| 1478 | while (b < end
| 0 | ||||||||||||||||||||||||
| 1479 | const qreal iw = fw == 0 ? 1 : 1 / fw; | - | ||||||||||||||||||||||||
| 1480 | const qreal tx = fx * iw; | - | ||||||||||||||||||||||||
| 1481 | const qreal ty = fy * iw; | - | ||||||||||||||||||||||||
| 1482 | int px = int(tx) - (tx < 0); | - | ||||||||||||||||||||||||
| 1483 | int py = int(ty) - (ty < 0); | - | ||||||||||||||||||||||||
| 1484 | - | |||||||||||||||||||||||||
| 1485 | if (blendType == BlendTransformedTiled
| 0 | ||||||||||||||||||||||||
| 1486 | px %= image_width; | - | ||||||||||||||||||||||||
| 1487 | py %= image_height; | - | ||||||||||||||||||||||||
| 1488 | if (px < 0
never executed: px += image_width; | 0 | ||||||||||||||||||||||||
| 1489 | if (py < 0
never executed: py += image_height; | 0 | ||||||||||||||||||||||||
| 1490 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1491 | px = qBound(0, px, image_width - 1); | - | ||||||||||||||||||||||||
| 1492 | py = qBound(0, py, image_height - 1); | - | ||||||||||||||||||||||||
| 1493 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1494 | *b = fetch(data->texture.scanLine(py), px); | - | ||||||||||||||||||||||||
| 1495 | - | |||||||||||||||||||||||||
| 1496 | fx += fdx; | - | ||||||||||||||||||||||||
| 1497 | fy += fdy; | - | ||||||||||||||||||||||||
| 1498 | fw += fdw; | - | ||||||||||||||||||||||||
| 1499 | - | |||||||||||||||||||||||||
| 1500 | if (!fw
| 0 | ||||||||||||||||||||||||
| 1501 | fw += fdw; | - | ||||||||||||||||||||||||
| 1502 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1503 | ++b; | - | ||||||||||||||||||||||||
| 1504 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1505 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1506 | const QRgb *clut = data->texture.colorTable ? data->texture.colorTable->constData() : 0; | - | ||||||||||||||||||||||||
| 1507 | return never executed: layout->convertToARGB32PM(buffer, buffer, length, layout, clut);return layout->convertToARGB32PM(buffer, buffer, length, layout, clut);never executed: return layout->convertToARGB32PM(buffer, buffer, length, layout, clut); | 0 | ||||||||||||||||||||||||
| 1508 | } | - | ||||||||||||||||||||||||
| 1509 | - | |||||||||||||||||||||||||
| 1510 | template<TextureBlendType blendType> | - | ||||||||||||||||||||||||
| 1511 | static const QRgba64 * fetchTransformed64(QRgba64 *buffer, const Operator *, const QSpanData *data, | - | ||||||||||||||||||||||||
| 1512 | int y, int x, int length) | - | ||||||||||||||||||||||||
| 1513 | { | - | ||||||||||||||||||||||||
| 1514 | int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 1515 | int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 1516 | - | |||||||||||||||||||||||||
| 1517 | const qreal cx = x + qreal(0.5); | - | ||||||||||||||||||||||||
| 1518 | const qreal cy = y + qreal(0.5); | - | ||||||||||||||||||||||||
| 1519 | - | |||||||||||||||||||||||||
| 1520 | const QPixelLayout *layout = &qPixelLayouts[data->texture.format]; | - | ||||||||||||||||||||||||
| 1521 | FetchPixelFunc fetch = qFetchPixel[layout->bpp]; | - | ||||||||||||||||||||||||
| 1522 | const QRgb *clut = data->texture.colorTable ? data->texture.colorTable->constData() : 0; | - | ||||||||||||||||||||||||
| 1523 | - | |||||||||||||||||||||||||
| 1524 | uint buffer32[buffer_size]; | - | ||||||||||||||||||||||||
| 1525 | QRgba64 *b = buffer; | - | ||||||||||||||||||||||||
| 1526 | if (data->fast_matrix
| 0 | ||||||||||||||||||||||||
| 1527 | - | |||||||||||||||||||||||||
| 1528 | int fdx = (int)(data->m11 * fixed_scale); | - | ||||||||||||||||||||||||
| 1529 | int fdy = (int)(data->m12 * fixed_scale); | - | ||||||||||||||||||||||||
| 1530 | - | |||||||||||||||||||||||||
| 1531 | int fx = int((data->m21 * cy | - | ||||||||||||||||||||||||
| 1532 | + data->m11 * cx + data->dx) * fixed_scale); | - | ||||||||||||||||||||||||
| 1533 | int fy = int((data->m22 * cy | - | ||||||||||||||||||||||||
| 1534 | + data->m12 * cx + data->dy) * fixed_scale); | - | ||||||||||||||||||||||||
| 1535 | - | |||||||||||||||||||||||||
| 1536 | int i = 0, j = 0; | - | ||||||||||||||||||||||||
| 1537 | while (i < length
| 0 | ||||||||||||||||||||||||
| 1538 | if (j == buffer_size
| 0 | ||||||||||||||||||||||||
| 1539 | layout->convertToARGB64PM(b, buffer32, buffer_size, layout, clut); | - | ||||||||||||||||||||||||
| 1540 | b += buffer_size; | - | ||||||||||||||||||||||||
| 1541 | j = 0; | - | ||||||||||||||||||||||||
| 1542 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1543 | int px = fx >> 16; | - | ||||||||||||||||||||||||
| 1544 | int py = fy >> 16; | - | ||||||||||||||||||||||||
| 1545 | - | |||||||||||||||||||||||||
| 1546 | if (blendType == BlendTransformedTiled
| 0 | ||||||||||||||||||||||||
| 1547 | px %= image_width; | - | ||||||||||||||||||||||||
| 1548 | py %= image_height; | - | ||||||||||||||||||||||||
| 1549 | if (px < 0
never executed: px += image_width; | 0 | ||||||||||||||||||||||||
| 1550 | if (py < 0
never executed: py += image_height; | 0 | ||||||||||||||||||||||||
| 1551 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1552 | px = qBound(0, px, image_width - 1); | - | ||||||||||||||||||||||||
| 1553 | py = qBound(0, py, image_height - 1); | - | ||||||||||||||||||||||||
| 1554 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1555 | buffer32[j] = fetch(data->texture.scanLine(py), px); | - | ||||||||||||||||||||||||
| 1556 | - | |||||||||||||||||||||||||
| 1557 | fx += fdx; | - | ||||||||||||||||||||||||
| 1558 | fy += fdy; | - | ||||||||||||||||||||||||
| 1559 | ++i; ++j; | - | ||||||||||||||||||||||||
| 1560 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1561 | if (j > 0
| 0 | ||||||||||||||||||||||||
| 1562 | layout->convertToARGB64PM(b, buffer32, j, layout, clut); | - | ||||||||||||||||||||||||
| 1563 | b += j; | - | ||||||||||||||||||||||||
| 1564 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1565 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1566 | const qreal fdx = data->m11; | - | ||||||||||||||||||||||||
| 1567 | const qreal fdy = data->m12; | - | ||||||||||||||||||||||||
| 1568 | const qreal fdw = data->m13; | - | ||||||||||||||||||||||||
| 1569 | - | |||||||||||||||||||||||||
| 1570 | qreal fx = data->m21 * cy + data->m11 * cx + data->dx; | - | ||||||||||||||||||||||||
| 1571 | qreal fy = data->m22 * cy + data->m12 * cx + data->dy; | - | ||||||||||||||||||||||||
| 1572 | qreal fw = data->m23 * cy + data->m13 * cx + data->m33; | - | ||||||||||||||||||||||||
| 1573 | - | |||||||||||||||||||||||||
| 1574 | int i = 0, j = 0; | - | ||||||||||||||||||||||||
| 1575 | while (i < length
| 0 | ||||||||||||||||||||||||
| 1576 | if (j == buffer_size
| 0 | ||||||||||||||||||||||||
| 1577 | layout->convertToARGB64PM(b, buffer32, buffer_size, layout, clut); | - | ||||||||||||||||||||||||
| 1578 | b += buffer_size; | - | ||||||||||||||||||||||||
| 1579 | j = 0; | - | ||||||||||||||||||||||||
| 1580 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1581 | const qreal iw = fw == 0 ? 1 : 1 / fw; | - | ||||||||||||||||||||||||
| 1582 | const qreal tx = fx * iw; | - | ||||||||||||||||||||||||
| 1583 | const qreal ty = fy * iw; | - | ||||||||||||||||||||||||
| 1584 | int px = int(tx) - (tx < 0); | - | ||||||||||||||||||||||||
| 1585 | int py = int(ty) - (ty < 0); | - | ||||||||||||||||||||||||
| 1586 | - | |||||||||||||||||||||||||
| 1587 | if (blendType == BlendTransformedTiled
| 0 | ||||||||||||||||||||||||
| 1588 | px %= image_width; | - | ||||||||||||||||||||||||
| 1589 | py %= image_height; | - | ||||||||||||||||||||||||
| 1590 | if (px < 0
never executed: px += image_width; | 0 | ||||||||||||||||||||||||
| 1591 | if (py < 0
never executed: py += image_height; | 0 | ||||||||||||||||||||||||
| 1592 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1593 | px = qBound(0, px, image_width - 1); | - | ||||||||||||||||||||||||
| 1594 | py = qBound(0, py, image_height - 1); | - | ||||||||||||||||||||||||
| 1595 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1596 | buffer32[j] = fetch(data->texture.scanLine(py), px); | - | ||||||||||||||||||||||||
| 1597 | - | |||||||||||||||||||||||||
| 1598 | fx += fdx; | - | ||||||||||||||||||||||||
| 1599 | fy += fdy; | - | ||||||||||||||||||||||||
| 1600 | fw += fdw; | - | ||||||||||||||||||||||||
| 1601 | - | |||||||||||||||||||||||||
| 1602 | if (!fw
| 0 | ||||||||||||||||||||||||
| 1603 | fw += fdw; | - | ||||||||||||||||||||||||
| 1604 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1605 | ++i; ++j; | - | ||||||||||||||||||||||||
| 1606 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1607 | if (j > 0
| 0 | ||||||||||||||||||||||||
| 1608 | layout->convertToARGB64PM(b, buffer32, j, layout, clut); | - | ||||||||||||||||||||||||
| 1609 | b += j; | - | ||||||||||||||||||||||||
| 1610 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1611 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1612 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 1613 | } | - | ||||||||||||||||||||||||
| 1614 | - | |||||||||||||||||||||||||
| 1615 | - | |||||||||||||||||||||||||
| 1616 | - | |||||||||||||||||||||||||
| 1617 | - | |||||||||||||||||||||||||
| 1618 | - | |||||||||||||||||||||||||
| 1619 | static inline uint interpolate_4_pixels_16(uint tl, uint tr, uint bl, uint br, int distx, int disty) | - | ||||||||||||||||||||||||
| 1620 | { | - | ||||||||||||||||||||||||
| 1621 | uint distxy = distx * disty; | - | ||||||||||||||||||||||||
| 1622 | - | |||||||||||||||||||||||||
| 1623 | - | |||||||||||||||||||||||||
| 1624 | uint tlrb = (tl & 0x00ff00ff) * (16*16 - 16*distx - 16*disty + distxy); | - | ||||||||||||||||||||||||
| 1625 | uint tlag = ((tl & 0xff00ff00) >> 8) * (16*16 - 16*distx - 16*disty + distxy); | - | ||||||||||||||||||||||||
| 1626 | uint trrb = ((tr & 0x00ff00ff) * (distx*16 - distxy)); | - | ||||||||||||||||||||||||
| 1627 | uint trag = (((tr & 0xff00ff00) >> 8) * (distx*16 - distxy)); | - | ||||||||||||||||||||||||
| 1628 | uint blrb = ((bl & 0x00ff00ff) * (disty*16 - distxy)); | - | ||||||||||||||||||||||||
| 1629 | uint blag = (((bl & 0xff00ff00) >> 8) * (disty*16 - distxy)); | - | ||||||||||||||||||||||||
| 1630 | uint brrb = ((br & 0x00ff00ff) * (distxy)); | - | ||||||||||||||||||||||||
| 1631 | uint brag = (((br & 0xff00ff00) >> 8) * (distxy)); | - | ||||||||||||||||||||||||
| 1632 | return never executed: (((tlrb + trrb + blrb + brrb) >> 8) & 0x00ff00ff) | ((tlag + trag + blag + brag) & 0xff00ff00);return (((tlrb + trrb + blrb + brrb) >> 8) & 0x00ff00ff) | ((tlag + trag + blag + brag) & 0xff00ff00);never executed: return (((tlrb + trrb + blrb + brrb) >> 8) & 0x00ff00ff) | ((tlag + trag + blag + brag) & 0xff00ff00); | 0 | ||||||||||||||||||||||||
| 1633 | } | - | ||||||||||||||||||||||||
| 1634 | static inline QRgba64 interpolate_4_pixels_rgb64(QRgba64 t[], QRgba64 b[], uint distx, uint disty) | - | ||||||||||||||||||||||||
| 1635 | { | - | ||||||||||||||||||||||||
| 1636 | const __m128i vdistx = ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(_mm_cvtsi32_si128(distx)), (int)((((0) << 6) | ((0) << 4) | ((0) << 2) | (0))))); | - | ||||||||||||||||||||||||
| 1637 | const __m128i vidistx = ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(_mm_cvtsi32_si128(0x10000 - distx)), (int)((((0) << 6) | ((0) << 4) | ((0) << 2) | (0))))); | - | ||||||||||||||||||||||||
| 1638 | - | |||||||||||||||||||||||||
| 1639 | __m128i vt = _mm_loadu_si128((const __m128i*)t); | - | ||||||||||||||||||||||||
| 1640 | if (disty
| 0 | ||||||||||||||||||||||||
| 1641 | __m128i vb = _mm_loadu_si128((const __m128i*)b); | - | ||||||||||||||||||||||||
| 1642 | vt = _mm_mulhi_epu16(vt, _mm_set1_epi16(0x10000 - disty)); | - | ||||||||||||||||||||||||
| 1643 | vb = _mm_mulhi_epu16(vb, _mm_set1_epi16(disty)); | - | ||||||||||||||||||||||||
| 1644 | vt = _mm_add_epi16(vt, vb); | - | ||||||||||||||||||||||||
| 1645 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1646 | vt = _mm_mulhi_epu16(vt, _mm_unpacklo_epi64(vidistx, vdistx)); | - | ||||||||||||||||||||||||
| 1647 | vt = _mm_add_epi16(vt, ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(vt), (int)(8) * 8))); | - | ||||||||||||||||||||||||
| 1648 | - | |||||||||||||||||||||||||
| 1649 | return never executed: QRgba64::fromRgba64(_mm_cvtsi128_si64(vt));return QRgba64::fromRgba64(_mm_cvtsi128_si64(vt));never executed: return QRgba64::fromRgba64(_mm_cvtsi128_si64(vt)); | 0 | ||||||||||||||||||||||||
| 1650 | - | |||||||||||||||||||||||||
| 1651 | - | |||||||||||||||||||||||||
| 1652 | - | |||||||||||||||||||||||||
| 1653 | - | |||||||||||||||||||||||||
| 1654 | - | |||||||||||||||||||||||||
| 1655 | } | - | ||||||||||||||||||||||||
| 1656 | template<TextureBlendType blendType> | - | ||||||||||||||||||||||||
| 1657 | void fetchTransformedBilinear_pixelBounds(int max, int l1, int l2, int &v1, int &v2); | - | ||||||||||||||||||||||||
| 1658 | - | |||||||||||||||||||||||||
| 1659 | template<> | - | ||||||||||||||||||||||||
| 1660 | inline void fetchTransformedBilinear_pixelBounds<BlendTransformedBilinearTiled>(int max, int, int, int &v1, int &v2) | - | ||||||||||||||||||||||||
| 1661 | { | - | ||||||||||||||||||||||||
| 1662 | v1 %= max; | - | ||||||||||||||||||||||||
| 1663 | if (v1 < 0
| 0 | ||||||||||||||||||||||||
| 1664 | v1 += max; never executed: v1 += max; | 0 | ||||||||||||||||||||||||
| 1665 | v2 = v1 + 1; | - | ||||||||||||||||||||||||
| 1666 | if (v2 == max
| 0 | ||||||||||||||||||||||||
| 1667 | v2 = 0; never executed: v2 = 0; | 0 | ||||||||||||||||||||||||
| 1668 | ((!(v1 >= 0 && v1 < max)) ? qt_assert("v1 >= 0 && v1 < max",__FILE__,1876) : qt_noop()); | - | ||||||||||||||||||||||||
| 1669 | ((!(v2 >= 0 && v2 < max)) ? qt_assert("v2 >= 0 && v2 < max",__FILE__,1877) : qt_noop()); | - | ||||||||||||||||||||||||
| 1670 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1671 | - | |||||||||||||||||||||||||
| 1672 | template<> | - | ||||||||||||||||||||||||
| 1673 | inline void fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(int, int l1, int l2, int &v1, int &v2) | - | ||||||||||||||||||||||||
| 1674 | { | - | ||||||||||||||||||||||||
| 1675 | if (v1 < l1
| 0 | ||||||||||||||||||||||||
| 1676 | v2 = v1 = l1; never executed: v2 = v1 = l1; | 0 | ||||||||||||||||||||||||
| 1677 | else if (v1 >= l2
| 0 | ||||||||||||||||||||||||
| 1678 | v2 = v1 = l2; never executed: v2 = v1 = l2; | 0 | ||||||||||||||||||||||||
| 1679 | else | - | ||||||||||||||||||||||||
| 1680 | v2 = v1 + 1; never executed: v2 = v1 + 1; | 0 | ||||||||||||||||||||||||
| 1681 | ((!(v1 >= l1 && v1 <= l2)) ? qt_assert("v1 >= l1 && v1 <= l2",__FILE__,1889) : qt_noop()); | - | ||||||||||||||||||||||||
| 1682 | ((!(v2 >= l1 && v2 <= l2)) ? qt_assert("v2 >= l1 && v2 <= l2",__FILE__,1890) : qt_noop()); | - | ||||||||||||||||||||||||
| 1683 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1684 | - | |||||||||||||||||||||||||
| 1685 | template<TextureBlendType blendType> | - | ||||||||||||||||||||||||
| 1686 | static const uint * fetchTransformedBilinearARGB32PM(uint *buffer, const Operator *, | - | ||||||||||||||||||||||||
| 1687 | const QSpanData *data, int y, int x, | - | ||||||||||||||||||||||||
| 1688 | int length) | - | ||||||||||||||||||||||||
| 1689 | { | - | ||||||||||||||||||||||||
| 1690 | int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 1691 | int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 1692 | - | |||||||||||||||||||||||||
| 1693 | int image_x1 = data->texture.x1; | - | ||||||||||||||||||||||||
| 1694 | int image_y1 = data->texture.y1; | - | ||||||||||||||||||||||||
| 1695 | int image_x2 = data->texture.x2 - 1; | - | ||||||||||||||||||||||||
| 1696 | int image_y2 = data->texture.y2 - 1; | - | ||||||||||||||||||||||||
| 1697 | - | |||||||||||||||||||||||||
| 1698 | const qreal cx = x + qreal(0.5); | - | ||||||||||||||||||||||||
| 1699 | const qreal cy = y + qreal(0.5); | - | ||||||||||||||||||||||||
| 1700 | - | |||||||||||||||||||||||||
| 1701 | uint *end = buffer + length; | - | ||||||||||||||||||||||||
| 1702 | uint *b = buffer; | - | ||||||||||||||||||||||||
| 1703 | if (data->fast_matrix
| 0 | ||||||||||||||||||||||||
| 1704 | - | |||||||||||||||||||||||||
| 1705 | int fdx = (int)(data->m11 * fixed_scale); | - | ||||||||||||||||||||||||
| 1706 | int fdy = (int)(data->m12 * fixed_scale); | - | ||||||||||||||||||||||||
| 1707 | - | |||||||||||||||||||||||||
| 1708 | int fx = int((data->m21 * cy | - | ||||||||||||||||||||||||
| 1709 | + data->m11 * cx + data->dx) * fixed_scale); | - | ||||||||||||||||||||||||
| 1710 | int fy = int((data->m22 * cy | - | ||||||||||||||||||||||||
| 1711 | + data->m12 * cx + data->dy) * fixed_scale); | - | ||||||||||||||||||||||||
| 1712 | - | |||||||||||||||||||||||||
| 1713 | fx -= half_point; | - | ||||||||||||||||||||||||
| 1714 | fy -= half_point; | - | ||||||||||||||||||||||||
| 1715 | - | |||||||||||||||||||||||||
| 1716 | if (fdy == 0
| 0 | ||||||||||||||||||||||||
| 1717 | int y1 = (fy >> 16); | - | ||||||||||||||||||||||||
| 1718 | int y2; | - | ||||||||||||||||||||||||
| 1719 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - | ||||||||||||||||||||||||
| 1720 | const uint *s1 = (const uint *)data->texture.scanLine(y1); | - | ||||||||||||||||||||||||
| 1721 | const uint *s2 = (const uint *)data->texture.scanLine(y2); | - | ||||||||||||||||||||||||
| 1722 | - | |||||||||||||||||||||||||
| 1723 | if (fdx <= fixed_scale
| 0 | ||||||||||||||||||||||||
| 1724 | int disty = (fy & 0x0000ffff) >> 8; | - | ||||||||||||||||||||||||
| 1725 | int idisty = 256 - disty; | - | ||||||||||||||||||||||||
| 1726 | int x = fx >> 16; | - | ||||||||||||||||||||||||
| 1727 | - | |||||||||||||||||||||||||
| 1728 | - | |||||||||||||||||||||||||
| 1729 | - | |||||||||||||||||||||||||
| 1730 | - | |||||||||||||||||||||||||
| 1731 | - | |||||||||||||||||||||||||
| 1732 | - | |||||||||||||||||||||||||
| 1733 | - | |||||||||||||||||||||||||
| 1734 | quint32 intermediate_buffer[2][buffer_size + 2]; | - | ||||||||||||||||||||||||
| 1735 | - | |||||||||||||||||||||||||
| 1736 | int count = (qint64(length) * fdx + fixed_scale - 1) / fixed_scale + 2; | - | ||||||||||||||||||||||||
| 1737 | ((!(count <= buffer_size + 2)) ? qt_assert("count <= buffer_size + 2",__FILE__,1945) : qt_noop()); | - | ||||||||||||||||||||||||
| 1738 | int f = 0; | - | ||||||||||||||||||||||||
| 1739 | int lim = count; | - | ||||||||||||||||||||||||
| 1740 | if (blendType == BlendTransformedBilinearTiled
| 0 | ||||||||||||||||||||||||
| 1741 | x %= image_width; | - | ||||||||||||||||||||||||
| 1742 | if (x < 0
never executed: x += image_width; | 0 | ||||||||||||||||||||||||
| 1743 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1744 | lim = qMin(count, image_x2-x+1); | - | ||||||||||||||||||||||||
| 1745 | if (x < image_x1
| 0 | ||||||||||||||||||||||||
| 1746 | ((!(x <= image_x2)) ? qt_assert("x <= image_x2",__FILE__,1954) : qt_noop()); | - | ||||||||||||||||||||||||
| 1747 | uint t = s1[image_x1]; | - | ||||||||||||||||||||||||
| 1748 | uint b = s2[image_x1]; | - | ||||||||||||||||||||||||
| 1749 | quint32 rb = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff; | - | ||||||||||||||||||||||||
| 1750 | quint32 ag = ((((t>>8) & 0xff00ff) * idisty + ((b>>8) & 0xff00ff) * disty) >> 8) & 0xff00ff; | - | ||||||||||||||||||||||||
| 1751 | do { | - | ||||||||||||||||||||||||
| 1752 | intermediate_buffer[0][f] = rb; | - | ||||||||||||||||||||||||
| 1753 | intermediate_buffer[1][f] = ag; | - | ||||||||||||||||||||||||
| 1754 | f++; | - | ||||||||||||||||||||||||
| 1755 | x++; | - | ||||||||||||||||||||||||
| 1756 | } never executed: while (x < image_x1end of block
| 0 | ||||||||||||||||||||||||
| 1757 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1758 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1759 | - | |||||||||||||||||||||||||
| 1760 | if (blendType != BlendTransformedBilinearTiled
| 0 | ||||||||||||||||||||||||
| 1761 | - | |||||||||||||||||||||||||
| 1762 | const __m128i disty_ = _mm_set1_epi16(disty); | - | ||||||||||||||||||||||||
| 1763 | const __m128i idisty_ = _mm_set1_epi16(idisty); | - | ||||||||||||||||||||||||
| 1764 | const __m128i colorMask = _mm_set1_epi32(0x00ff00ff); | - | ||||||||||||||||||||||||
| 1765 | - | |||||||||||||||||||||||||
| 1766 | lim -= 3; | - | ||||||||||||||||||||||||
| 1767 | for (; f < lim
| 0 | ||||||||||||||||||||||||
| 1768 | - | |||||||||||||||||||||||||
| 1769 | __m128i top = _mm_loadu_si128((const __m128i*)((const uint *)(s1)+x)); | - | ||||||||||||||||||||||||
| 1770 | __m128i topAG = _mm_srli_epi16(top, 8); | - | ||||||||||||||||||||||||
| 1771 | __m128i topRB = _mm_and_si128(top, colorMask); | - | ||||||||||||||||||||||||
| 1772 | - | |||||||||||||||||||||||||
| 1773 | topAG = _mm_mullo_epi16 (topAG, idisty_); | - | ||||||||||||||||||||||||
| 1774 | topRB = _mm_mullo_epi16 (topRB, idisty_); | - | ||||||||||||||||||||||||
| 1775 | - | |||||||||||||||||||||||||
| 1776 | - | |||||||||||||||||||||||||
| 1777 | __m128i bottom = _mm_loadu_si128((const __m128i*)((const uint *)(s2)+x)); | - | ||||||||||||||||||||||||
| 1778 | __m128i bottomAG = _mm_srli_epi16(bottom, 8); | - | ||||||||||||||||||||||||
| 1779 | __m128i bottomRB = _mm_and_si128(bottom, colorMask); | - | ||||||||||||||||||||||||
| 1780 | bottomAG = _mm_mullo_epi16 (bottomAG, disty_); | - | ||||||||||||||||||||||||
| 1781 | bottomRB = _mm_mullo_epi16 (bottomRB, disty_); | - | ||||||||||||||||||||||||
| 1782 | - | |||||||||||||||||||||||||
| 1783 | - | |||||||||||||||||||||||||
| 1784 | __m128i rAG =_mm_add_epi16(topAG, bottomAG); | - | ||||||||||||||||||||||||
| 1785 | rAG = _mm_srli_epi16(rAG, 8); | - | ||||||||||||||||||||||||
| 1786 | _mm_storeu_si128((__m128i*)(&intermediate_buffer[1][f]), rAG); | - | ||||||||||||||||||||||||
| 1787 | __m128i rRB =_mm_add_epi16(topRB, bottomRB); | - | ||||||||||||||||||||||||
| 1788 | rRB = _mm_srli_epi16(rRB, 8); | - | ||||||||||||||||||||||||
| 1789 | _mm_storeu_si128((__m128i*)(&intermediate_buffer[0][f]), rRB); | - | ||||||||||||||||||||||||
| 1790 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1791 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1792 | for (; f < count
| 0 | ||||||||||||||||||||||||
| 1793 | if (blendType == BlendTransformedBilinearTiled
| 0 | ||||||||||||||||||||||||
| 1794 | if (x >= image_width
never executed: x -= image_width; | 0 | ||||||||||||||||||||||||
| 1795 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1796 | x = qMin(x, image_x2); | - | ||||||||||||||||||||||||
| 1797 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1798 | - | |||||||||||||||||||||||||
| 1799 | uint t = s1[x]; | - | ||||||||||||||||||||||||
| 1800 | uint b = s2[x]; | - | ||||||||||||||||||||||||
| 1801 | - | |||||||||||||||||||||||||
| 1802 | intermediate_buffer[0][f] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff; | - | ||||||||||||||||||||||||
| 1803 | intermediate_buffer[1][f] = ((((t>>8) & 0xff00ff) * idisty + ((b>>8) & 0xff00ff) * disty) >> 8) & 0xff00ff; | - | ||||||||||||||||||||||||
| 1804 | x++; | - | ||||||||||||||||||||||||
| 1805 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1806 | - | |||||||||||||||||||||||||
| 1807 | fx &= fixed_scale - 1; | - | ||||||||||||||||||||||||
| 1808 | ((!((fx >> 16) == 0)) ? qt_assert("(fx >> 16) == 0",__FILE__,2047) : qt_noop()); | - | ||||||||||||||||||||||||
| 1809 | while (b < end
| 0 | ||||||||||||||||||||||||
| 1810 | int x1 = (fx >> 16); | - | ||||||||||||||||||||||||
| 1811 | int x2 = x1 + 1; | - | ||||||||||||||||||||||||
| 1812 | ((!(x1 >= 0)) ? qt_assert("x1 >= 0",__FILE__,2051) : qt_noop()); | - | ||||||||||||||||||||||||
| 1813 | ((!(x2 < count)) ? qt_assert("x2 < count",__FILE__,2052) : qt_noop()); | - | ||||||||||||||||||||||||
| 1814 | - | |||||||||||||||||||||||||
| 1815 | int distx = (fx & 0x0000ffff) >> 8; | - | ||||||||||||||||||||||||
| 1816 | int idistx = 256 - distx; | - | ||||||||||||||||||||||||
| 1817 | int rb = ((intermediate_buffer[0][x1] * idistx + intermediate_buffer[0][x2] * distx) >> 8) & 0xff00ff; | - | ||||||||||||||||||||||||
| 1818 | int ag = (intermediate_buffer[1][x1] * idistx + intermediate_buffer[1][x2] * distx) & 0xff00ff00; | - | ||||||||||||||||||||||||
| 1819 | *b = rb | ag; | - | ||||||||||||||||||||||||
| 1820 | b++; | - | ||||||||||||||||||||||||
| 1821 | fx += fdx; | - | ||||||||||||||||||||||||
| 1822 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1823 | } never executed: else if ((fdx < 0end of block
| 0 | ||||||||||||||||||||||||
| 1824 | int y1 = (fy >> 16); | - | ||||||||||||||||||||||||
| 1825 | int y2; | - | ||||||||||||||||||||||||
| 1826 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - | ||||||||||||||||||||||||
| 1827 | const uint *s1 = (const uint *)data->texture.scanLine(y1); | - | ||||||||||||||||||||||||
| 1828 | const uint *s2 = (const uint *)data->texture.scanLine(y2); | - | ||||||||||||||||||||||||
| 1829 | int disty = (fy & 0x0000ffff) >> 8; | - | ||||||||||||||||||||||||
| 1830 | while (b < end
| 0 | ||||||||||||||||||||||||
| 1831 | int x1 = (fx >> 16); | - | ||||||||||||||||||||||||
| 1832 | int x2; | - | ||||||||||||||||||||||||
| 1833 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - | ||||||||||||||||||||||||
| 1834 | uint tl = s1[x1]; | - | ||||||||||||||||||||||||
| 1835 | uint tr = s1[x2]; | - | ||||||||||||||||||||||||
| 1836 | uint bl = s2[x1]; | - | ||||||||||||||||||||||||
| 1837 | uint br = s2[x2]; | - | ||||||||||||||||||||||||
| 1838 | int distx = (fx & 0x0000ffff) >> 8; | - | ||||||||||||||||||||||||
| 1839 | *b = interpolate_4_pixels(tl, tr, bl, br, distx, disty); | - | ||||||||||||||||||||||||
| 1840 | - | |||||||||||||||||||||||||
| 1841 | fx += fdx; | - | ||||||||||||||||||||||||
| 1842 | ++b; | - | ||||||||||||||||||||||||
| 1843 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1844 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1845 | int y1 = (fy >> 16); | - | ||||||||||||||||||||||||
| 1846 | int y2; | - | ||||||||||||||||||||||||
| 1847 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - | ||||||||||||||||||||||||
| 1848 | const uint *s1 = (const uint *)data->texture.scanLine(y1); | - | ||||||||||||||||||||||||
| 1849 | const uint *s2 = (const uint *)data->texture.scanLine(y2); | - | ||||||||||||||||||||||||
| 1850 | int disty = (fy & 0x0000ffff) >> 12; | - | ||||||||||||||||||||||||
| 1851 | - | |||||||||||||||||||||||||
| 1852 | if (blendType != BlendTransformedBilinearTiled
| 0 | ||||||||||||||||||||||||
| 1853 | while (b < end
never executed: uint tl = s1[x1]; uint tr = s1[x2]; uint bl = s2[x1]; uint br = s2[x2]; int distx = (fx & 0x0000ffff) >> 12; *b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty); fx += fdx; ++b; }break;never executed: uint *boundedEnd; if (fdx > 0end of block
never executed: else boundedEnd = qMin(end, buffer + uint((image_x1 - (fx >> 16)) / data->m11));boundedEnd = qMin(end, buffer + uint((image_x2 - (fx >> 16)) / data->m11));never executed: boundedEnd -= 3;boundedEnd = qMin(end, buffer + uint((image_x1 - (fx >> 16)) / data->m11)); | 0 | ||||||||||||||||||||||||
| 1854 | - | |||||||||||||||||||||||||
| 1855 | const __m128i colorMask = _mm_set1_epi32(0x00ff00ff); | - | ||||||||||||||||||||||||
| 1856 | const __m128i v_256 = _mm_set1_epi16(256); | - | ||||||||||||||||||||||||
| 1857 | const __m128i v_disty = _mm_set1_epi16(disty); | - | ||||||||||||||||||||||||
| 1858 | const __m128i v_fdx = _mm_set1_epi32(fdx*4); | - | ||||||||||||||||||||||||
| 1859 | __m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx); | - | ||||||||||||||||||||||||
| 1860 | - | |||||||||||||||||||||||||
| 1861 | while (b < boundedEnd
| 0 | ||||||||||||||||||||||||
| 1862 | __m128i offset = _mm_srli_epi32(v_fx, 16); | - | ||||||||||||||||||||||||
| 1863 | const int offset0 = _mm_cvtsi128_si32(offset); offset = ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(offset), (int)(4) * 8)); | - | ||||||||||||||||||||||||
| 1864 | const int offset1 = _mm_cvtsi128_si32(offset); offset = ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(offset), (int)(4) * 8)); | - | ||||||||||||||||||||||||
| 1865 | const int offset2 = _mm_cvtsi128_si32(offset); offset = ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(offset), (int)(4) * 8)); | - | ||||||||||||||||||||||||
| 1866 | const int offset3 = _mm_cvtsi128_si32(offset); | - | ||||||||||||||||||||||||
| 1867 | const __m128i tl = _mm_setr_epi32(s1[offset0], s1[offset1], s1[offset2], s1[offset3]); | - | ||||||||||||||||||||||||
| 1868 | const __m128i tr = _mm_setr_epi32(s1[offset0 + 1], s1[offset1 + 1], s1[offset2 + 1], s1[offset3 + 1]); | - | ||||||||||||||||||||||||
| 1869 | const __m128i bl = _mm_setr_epi32(s2[offset0], s2[offset1], s2[offset2], s2[offset3]); | - | ||||||||||||||||||||||||
| 1870 | const __m128i br = _mm_setr_epi32(s2[offset0 + 1], s2[offset1 + 1], s2[offset2 + 1], s2[offset3 + 1]); | - | ||||||||||||||||||||||||
| 1871 | - | |||||||||||||||||||||||||
| 1872 | __m128i v_distx = _mm_srli_epi16(v_fx, 12); | - | ||||||||||||||||||||||||
| 1873 | v_distx = ((__m128i)__builtin_ia32_pshufhw ((__v8hi)(__m128i)(v_distx), (int)((((2) << 6) | ((2) << 4) | ((0) << 2) | (0))))); | - | ||||||||||||||||||||||||
| 1874 | v_distx = ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(v_distx), (int)((((2) << 6) | ((2) << 4) | ((0) << 2) | (0))))); | - | ||||||||||||||||||||||||
| 1875 | - | |||||||||||||||||||||||||
| 1876 | { const __m128i dxdy = _mm_mullo_epi16 (v_distx, v_disty); const __m128i distx_ = _mm_slli_epi16(v_distx, 4); const __m128i disty_ = _mm_slli_epi16(v_disty, 4); const __m128i idxidy = _mm_add_epi16(dxdy, _mm_sub_epi16(v_256, _mm_add_epi16(distx_, disty_))); const __m128i dxidy = _mm_sub_epi16(distx_, dxdy); const __m128i idxdy = _mm_sub_epi16(disty_, dxdy); __m128i tlAG = _mm_srli_epi16(tl, 8); __m128i tlRB = _mm_and_si128(tl, colorMask); __m128i trAG = _mm_srli_epi16(tr, 8); __m128i trRB = _mm_and_si128(tr, colorMask); __m128i blAG = _mm_srli_epi16(bl, 8); __m128i blRB = _mm_and_si128(bl, colorMask); __m128i brAG = _mm_srli_epi16(br, 8); __m128i brRB = _mm_and_si128(br, colorMask); tlAG = _mm_mullo_epi16(tlAG, idxidy); tlRB = _mm_mullo_epi16(tlRB, idxidy); trAG = _mm_mullo_epi16(trAG, dxidy); trRB = _mm_mullo_epi16(trRB, dxidy); blAG = _mm_mullo_epi16(blAG, idxdy); blRB = _mm_mullo_epi16(blRB, idxdy); brAG = _mm_mullo_epi16(brAG, dxdy); brRB = _mm_mullo_epi16(brRB, dxdy); __m128i rAG =_mm_add_epi16(_mm_add_epi16(tlAG, trAG), _mm_add_epi16(blAG, brAG)); __m128i rRB =_mm_add_epi16(_mm_add_epi16(tlRB, trRB), _mm_add_epi16(blRB, brRB)); rAG = _mm_andnot_si128(colorMask, rAG); rRB = _mm_srli_epi16(rRB, 8); _mm_storeu_si128((__m128i*)(b), _mm_or_si128(rAG, rRB)); }; | - | ||||||||||||||||||||||||
| 1877 | b += 4; | - | ||||||||||||||||||||||||
| 1878 | v_fx = _mm_add_epi32(v_fx, v_fdx); | - | ||||||||||||||||||||||||
| 1879 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1880 | fx = _mm_cvtsi128_si32(v_fx); | - | ||||||||||||||||||||||||
| 1881 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1882 | - | |||||||||||||||||||||||||
| 1883 | while (b < end
| 0 | ||||||||||||||||||||||||
| 1884 | int x1 = (fx >> 16); | - | ||||||||||||||||||||||||
| 1885 | int x2; | - | ||||||||||||||||||||||||
| 1886 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - | ||||||||||||||||||||||||
| 1887 | uint tl = s1[x1]; | - | ||||||||||||||||||||||||
| 1888 | uint tr = s1[x2]; | - | ||||||||||||||||||||||||
| 1889 | uint bl = s2[x1]; | - | ||||||||||||||||||||||||
| 1890 | uint br = s2[x2]; | - | ||||||||||||||||||||||||
| 1891 | int distx = (fx & 0x0000ffff) >> 12; | - | ||||||||||||||||||||||||
| 1892 | *b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty); | - | ||||||||||||||||||||||||
| 1893 | fx += fdx; | - | ||||||||||||||||||||||||
| 1894 | ++b; | - | ||||||||||||||||||||||||
| 1895 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1896 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1897 | } else { | - | ||||||||||||||||||||||||
| 1898 | if (std::abs(data->m11) > 8
| 0 | ||||||||||||||||||||||||
| 1899 | - | |||||||||||||||||||||||||
| 1900 | while (b < end
| 0 | ||||||||||||||||||||||||
| 1901 | int x1 = (fx >> 16); | - | ||||||||||||||||||||||||
| 1902 | int x2; | - | ||||||||||||||||||||||||
| 1903 | int y1 = (fy >> 16); | - | ||||||||||||||||||||||||
| 1904 | int y2; | - | ||||||||||||||||||||||||
| 1905 | - | |||||||||||||||||||||||||
| 1906 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - | ||||||||||||||||||||||||
| 1907 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - | ||||||||||||||||||||||||
| 1908 | - | |||||||||||||||||||||||||
| 1909 | const uint *s1 = (const uint *)data->texture.scanLine(y1); | - | ||||||||||||||||||||||||
| 1910 | const uint *s2 = (const uint *)data->texture.scanLine(y2); | - | ||||||||||||||||||||||||
| 1911 | - | |||||||||||||||||||||||||
| 1912 | uint tl = s1[x1]; | - | ||||||||||||||||||||||||
| 1913 | uint tr = s1[x2]; | - | ||||||||||||||||||||||||
| 1914 | uint bl = s2[x1]; | - | ||||||||||||||||||||||||
| 1915 | uint br = s2[x2]; | - | ||||||||||||||||||||||||
| 1916 | - | |||||||||||||||||||||||||
| 1917 | int distx = (fx & 0x0000ffff) >> 8; | - | ||||||||||||||||||||||||
| 1918 | int disty = (fy & 0x0000ffff) >> 8; | - | ||||||||||||||||||||||||
| 1919 | - | |||||||||||||||||||||||||
| 1920 | *b = interpolate_4_pixels(tl, tr, bl, br, distx, disty); | - | ||||||||||||||||||||||||
| 1921 | - | |||||||||||||||||||||||||
| 1922 | fx += fdx; | - | ||||||||||||||||||||||||
| 1923 | fy += fdy; | - | ||||||||||||||||||||||||
| 1924 | ++b; | - | ||||||||||||||||||||||||
| 1925 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1926 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1927 | - | |||||||||||||||||||||||||
| 1928 | - | |||||||||||||||||||||||||
| 1929 | if (blendType != BlendTransformedBilinearTiled
| 0 | ||||||||||||||||||||||||
| 1930 | while (b < end
never executed: const uint *s1 = (const uint *)data->texture.scanLine(y1); const uint *s2 = (const uint *)data->texture.scanLine(y2); uint tl = s1[x1]; uint tr = s1[x2]; uint bl = s2[x1]; uint br = s2[x2]; int distx = (fx & 0x0000ffff) >> 8; int disty = (fy & 0x0000ffff) >> 8; *b = interpolate_4_pixels(tl, tr, bl, br, distx, disty); fx += fdx; fy += fdy; ++b; }break;never executed: uint *boundedEnd = end - 3; boundedEnd -= 3;end of block | 0 | ||||||||||||||||||||||||
| 1931 | - | |||||||||||||||||||||||||
| 1932 | const __m128i colorMask = _mm_set1_epi32(0x00ff00ff); | - | ||||||||||||||||||||||||
| 1933 | const __m128i v_256 = _mm_set1_epi16(256); | - | ||||||||||||||||||||||||
| 1934 | const __m128i v_fdx = _mm_set1_epi32(fdx*4); | - | ||||||||||||||||||||||||
| 1935 | const __m128i v_fdy = _mm_set1_epi32(fdy*4); | - | ||||||||||||||||||||||||
| 1936 | __m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx); | - | ||||||||||||||||||||||||
| 1937 | __m128i v_fy = _mm_setr_epi32(fy, fy + fdy, fy + fdy + fdy, fy + fdy + fdy + fdy); | - | ||||||||||||||||||||||||
| 1938 | - | |||||||||||||||||||||||||
| 1939 | const uchar *textureData = data->texture.imageData; | - | ||||||||||||||||||||||||
| 1940 | const int bytesPerLine = data->texture.bytesPerLine; | - | ||||||||||||||||||||||||
| 1941 | const __m128i vbpl = ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(_mm_cvtsi32_si128(bytesPerLine/4)), (int)((((0) << 6) | ((0) << 4) | ((0) << 2) | (0))))); | - | ||||||||||||||||||||||||
| 1942 | - | |||||||||||||||||||||||||
| 1943 | while (b < boundedEnd
| 0 | ||||||||||||||||||||||||
| 1944 | if (fdx > 0
| 0 | ||||||||||||||||||||||||
| 1945 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1946 | if (fdx < 0
| 0 | ||||||||||||||||||||||||
| 1947 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1948 | if (fdy > 0
| 0 | ||||||||||||||||||||||||
| 1949 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1950 | if (fdy < 0
| 0 | ||||||||||||||||||||||||
| 1951 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1952 | - | |||||||||||||||||||||||||
| 1953 | const __m128i vy = _mm_packs_epi32(_mm_srli_epi32(v_fy, 16), _mm_setzero_si128()); | - | ||||||||||||||||||||||||
| 1954 | - | |||||||||||||||||||||||||
| 1955 | __m128i offset = _mm_unpacklo_epi16(_mm_mullo_epi16(vy, vbpl), _mm_mulhi_epi16(vy, vbpl)); | - | ||||||||||||||||||||||||
| 1956 | offset = _mm_add_epi32(offset, _mm_srli_epi32(v_fx, 16)); | - | ||||||||||||||||||||||||
| 1957 | const int offset0 = _mm_cvtsi128_si32(offset); offset = ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(offset), (int)(4) * 8)); | - | ||||||||||||||||||||||||
| 1958 | const int offset1 = _mm_cvtsi128_si32(offset); offset = ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(offset), (int)(4) * 8)); | - | ||||||||||||||||||||||||
| 1959 | const int offset2 = _mm_cvtsi128_si32(offset); offset = ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(offset), (int)(4) * 8)); | - | ||||||||||||||||||||||||
| 1960 | const int offset3 = _mm_cvtsi128_si32(offset); | - | ||||||||||||||||||||||||
| 1961 | const uint *topData = (const uint *)(textureData); | - | ||||||||||||||||||||||||
| 1962 | const __m128i tl = _mm_setr_epi32(topData[offset0], topData[offset1], topData[offset2], topData[offset3]); | - | ||||||||||||||||||||||||
| 1963 | const __m128i tr = _mm_setr_epi32(topData[offset0 + 1], topData[offset1 + 1], topData[offset2 + 1], topData[offset3 + 1]); | - | ||||||||||||||||||||||||
| 1964 | const uint *bottomData = (const uint *)(textureData + bytesPerLine); | - | ||||||||||||||||||||||||
| 1965 | const __m128i bl = _mm_setr_epi32(bottomData[offset0], bottomData[offset1], bottomData[offset2], bottomData[offset3]); | - | ||||||||||||||||||||||||
| 1966 | const __m128i br = _mm_setr_epi32(bottomData[offset0 + 1], bottomData[offset1 + 1], bottomData[offset2 + 1], bottomData[offset3 + 1]); | - | ||||||||||||||||||||||||
| 1967 | - | |||||||||||||||||||||||||
| 1968 | __m128i v_distx = _mm_srli_epi16(v_fx, 12); | - | ||||||||||||||||||||||||
| 1969 | __m128i v_disty = _mm_srli_epi16(v_fy, 12); | - | ||||||||||||||||||||||||
| 1970 | v_distx = ((__m128i)__builtin_ia32_pshufhw ((__v8hi)(__m128i)(v_distx), (int)((((2) << 6) | ((2) << 4) | ((0) << 2) | (0))))); | - | ||||||||||||||||||||||||
| 1971 | v_distx = ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(v_distx), (int)((((2) << 6) | ((2) << 4) | ((0) << 2) | (0))))); | - | ||||||||||||||||||||||||
| 1972 | v_disty = ((__m128i)__builtin_ia32_pshufhw ((__v8hi)(__m128i)(v_disty), (int)((((2) << 6) | ((2) << 4) | ((0) << 2) | (0))))); | - | ||||||||||||||||||||||||
| 1973 | v_disty = ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(v_disty), (int)((((2) << 6) | ((2) << 4) | ((0) << 2) | (0))))); | - | ||||||||||||||||||||||||
| 1974 | - | |||||||||||||||||||||||||
| 1975 | { const __m128i dxdy = _mm_mullo_epi16 (v_distx, v_disty); const __m128i distx_ = _mm_slli_epi16(v_distx, 4); const __m128i disty_ = _mm_slli_epi16(v_disty, 4); const __m128i idxidy = _mm_add_epi16(dxdy, _mm_sub_epi16(v_256, _mm_add_epi16(distx_, disty_))); const __m128i dxidy = _mm_sub_epi16(distx_, dxdy); const __m128i idxdy = _mm_sub_epi16(disty_, dxdy); __m128i tlAG = _mm_srli_epi16(tl, 8); __m128i tlRB = _mm_and_si128(tl, colorMask); __m128i trAG = _mm_srli_epi16(tr, 8); __m128i trRB = _mm_and_si128(tr, colorMask); __m128i blAG = _mm_srli_epi16(bl, 8); __m128i blRB = _mm_and_si128(bl, colorMask); __m128i brAG = _mm_srli_epi16(br, 8); __m128i brRB = _mm_and_si128(br, colorMask); tlAG = _mm_mullo_epi16(tlAG, idxidy); tlRB = _mm_mullo_epi16(tlRB, idxidy); trAG = _mm_mullo_epi16(trAG, dxidy); trRB = _mm_mullo_epi16(trRB, dxidy); blAG = _mm_mullo_epi16(blAG, idxdy); blRB = _mm_mullo_epi16(blRB, idxdy); brAG = _mm_mullo_epi16(brAG, dxdy); brRB = _mm_mullo_epi16(brRB, dxdy); __m128i rAG =_mm_add_epi16(_mm_add_epi16(tlAG, trAG), _mm_add_epi16(blAG, brAG)); __m128i rRB =_mm_add_epi16(_mm_add_epi16(tlRB, trRB), _mm_add_epi16(blRB, brRB)); rAG = _mm_andnot_si128(colorMask, rAG); rRB = _mm_srli_epi16(rRB, 8); _mm_storeu_si128((__m128i*)(b), _mm_or_si128(rAG, rRB)); }; | - | ||||||||||||||||||||||||
| 1976 | b += 4; | - | ||||||||||||||||||||||||
| 1977 | v_fx = _mm_add_epi32(v_fx, v_fdx); | - | ||||||||||||||||||||||||
| 1978 | v_fy = _mm_add_epi32(v_fy, v_fdy); | - | ||||||||||||||||||||||||
| 1979 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1980 | fx = _mm_cvtsi128_si32(v_fx); | - | ||||||||||||||||||||||||
| 1981 | fy = _mm_cvtsi128_si32(v_fy); | - | ||||||||||||||||||||||||
| 1982 | - | |||||||||||||||||||||||||
| 1983 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1984 | - | |||||||||||||||||||||||||
| 1985 | while (b < end
| 0 | ||||||||||||||||||||||||
| 1986 | int x1 = (fx >> 16); | - | ||||||||||||||||||||||||
| 1987 | int x2; | - | ||||||||||||||||||||||||
| 1988 | int y1 = (fy >> 16); | - | ||||||||||||||||||||||||
| 1989 | int y2; | - | ||||||||||||||||||||||||
| 1990 | - | |||||||||||||||||||||||||
| 1991 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - | ||||||||||||||||||||||||
| 1992 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - | ||||||||||||||||||||||||
| 1993 | - | |||||||||||||||||||||||||
| 1994 | const uint *s1 = (const uint *)data->texture.scanLine(y1); | - | ||||||||||||||||||||||||
| 1995 | const uint *s2 = (const uint *)data->texture.scanLine(y2); | - | ||||||||||||||||||||||||
| 1996 | - | |||||||||||||||||||||||||
| 1997 | uint tl = s1[x1]; | - | ||||||||||||||||||||||||
| 1998 | uint tr = s1[x2]; | - | ||||||||||||||||||||||||
| 1999 | uint bl = s2[x1]; | - | ||||||||||||||||||||||||
| 2000 | uint br = s2[x2]; | - | ||||||||||||||||||||||||
| 2001 | - | |||||||||||||||||||||||||
| 2002 | - | |||||||||||||||||||||||||
| 2003 | - | |||||||||||||||||||||||||
| 2004 | int distx = (fx & 0x0000ffff) >> 8; | - | ||||||||||||||||||||||||
| 2005 | int disty = (fy & 0x0000ffff) >> 8; | - | ||||||||||||||||||||||||
| 2006 | *b = interpolate_4_pixels(tl, tr, bl, br, distx, disty); | - | ||||||||||||||||||||||||
| 2007 | - | |||||||||||||||||||||||||
| 2008 | - | |||||||||||||||||||||||||
| 2009 | - | |||||||||||||||||||||||||
| 2010 | - | |||||||||||||||||||||||||
| 2011 | - | |||||||||||||||||||||||||
| 2012 | - | |||||||||||||||||||||||||
| 2013 | fx += fdx; | - | ||||||||||||||||||||||||
| 2014 | fy += fdy; | - | ||||||||||||||||||||||||
| 2015 | ++b; | - | ||||||||||||||||||||||||
| 2016 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2017 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2018 | } | - | ||||||||||||||||||||||||
| 2019 | } else { | - | ||||||||||||||||||||||||
| 2020 | const qreal fdx = data->m11; | - | ||||||||||||||||||||||||
| 2021 | const qreal fdy = data->m12; | - | ||||||||||||||||||||||||
| 2022 | const qreal fdw = data->m13; | - | ||||||||||||||||||||||||
| 2023 | - | |||||||||||||||||||||||||
| 2024 | qreal fx = data->m21 * cy + data->m11 * cx + data->dx; | - | ||||||||||||||||||||||||
| 2025 | qreal fy = data->m22 * cy + data->m12 * cx + data->dy; | - | ||||||||||||||||||||||||
| 2026 | qreal fw = data->m23 * cy + data->m13 * cx + data->m33; | - | ||||||||||||||||||||||||
| 2027 | - | |||||||||||||||||||||||||
| 2028 | while (b < end
| 0 | ||||||||||||||||||||||||
| 2029 | const qreal iw = fw == 0 ? 1 : 1 / fw; | - | ||||||||||||||||||||||||
| 2030 | const qreal px = fx * iw - qreal(0.5); | - | ||||||||||||||||||||||||
| 2031 | const qreal py = fy * iw - qreal(0.5); | - | ||||||||||||||||||||||||
| 2032 | - | |||||||||||||||||||||||||
| 2033 | int x1 = int(px) - (px < 0); | - | ||||||||||||||||||||||||
| 2034 | int x2; | - | ||||||||||||||||||||||||
| 2035 | int y1 = int(py) - (py < 0); | - | ||||||||||||||||||||||||
| 2036 | int y2; | - | ||||||||||||||||||||||||
| 2037 | - | |||||||||||||||||||||||||
| 2038 | int distx = int((px - x1) * 256); | - | ||||||||||||||||||||||||
| 2039 | int disty = int((py - y1) * 256); | - | ||||||||||||||||||||||||
| 2040 | - | |||||||||||||||||||||||||
| 2041 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - | ||||||||||||||||||||||||
| 2042 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - | ||||||||||||||||||||||||
| 2043 | - | |||||||||||||||||||||||||
| 2044 | const uint *s1 = (const uint *)data->texture.scanLine(y1); | - | ||||||||||||||||||||||||
| 2045 | const uint *s2 = (const uint *)data->texture.scanLine(y2); | - | ||||||||||||||||||||||||
| 2046 | - | |||||||||||||||||||||||||
| 2047 | uint tl = s1[x1]; | - | ||||||||||||||||||||||||
| 2048 | uint tr = s1[x2]; | - | ||||||||||||||||||||||||
| 2049 | uint bl = s2[x1]; | - | ||||||||||||||||||||||||
| 2050 | uint br = s2[x2]; | - | ||||||||||||||||||||||||
| 2051 | - | |||||||||||||||||||||||||
| 2052 | *b = interpolate_4_pixels(tl, tr, bl, br, distx, disty); | - | ||||||||||||||||||||||||
| 2053 | - | |||||||||||||||||||||||||
| 2054 | fx += fdx; | - | ||||||||||||||||||||||||
| 2055 | fy += fdy; | - | ||||||||||||||||||||||||
| 2056 | fw += fdw; | - | ||||||||||||||||||||||||
| 2057 | - | |||||||||||||||||||||||||
| 2058 | if (!fw
| 0 | ||||||||||||||||||||||||
| 2059 | fw += fdw; | - | ||||||||||||||||||||||||
| 2060 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2061 | ++b; | - | ||||||||||||||||||||||||
| 2062 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2063 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2064 | - | |||||||||||||||||||||||||
| 2065 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 2066 | } | - | ||||||||||||||||||||||||
| 2067 | - | |||||||||||||||||||||||||
| 2068 | - | |||||||||||||||||||||||||
| 2069 | template<TextureBlendType blendType> | - | ||||||||||||||||||||||||
| 2070 | static const uint * fetchTransformedBilinear(uint *buffer, const Operator *, | - | ||||||||||||||||||||||||
| 2071 | const QSpanData *data, int y, int x, int length) | - | ||||||||||||||||||||||||
| 2072 | { | - | ||||||||||||||||||||||||
| 2073 | const QPixelLayout *layout = &qPixelLayouts[data->texture.format]; | - | ||||||||||||||||||||||||
| 2074 | const QRgb *clut = data->texture.colorTable ? data->texture.colorTable->constData() : 0; | - | ||||||||||||||||||||||||
| 2075 | - | |||||||||||||||||||||||||
| 2076 | int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 2077 | int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 2078 | - | |||||||||||||||||||||||||
| 2079 | int image_x1 = data->texture.x1; | - | ||||||||||||||||||||||||
| 2080 | int image_y1 = data->texture.y1; | - | ||||||||||||||||||||||||
| 2081 | int image_x2 = data->texture.x2 - 1; | - | ||||||||||||||||||||||||
| 2082 | int image_y2 = data->texture.y2 - 1; | - | ||||||||||||||||||||||||
| 2083 | - | |||||||||||||||||||||||||
| 2084 | const qreal cx = x + qreal(0.5); | - | ||||||||||||||||||||||||
| 2085 | const qreal cy = y + qreal(0.5); | - | ||||||||||||||||||||||||
| 2086 | - | |||||||||||||||||||||||||
| 2087 | if (data->fast_matrix
| 0 | ||||||||||||||||||||||||
| 2088 | - | |||||||||||||||||||||||||
| 2089 | int fdx = (int)(data->m11 * fixed_scale); | - | ||||||||||||||||||||||||
| 2090 | int fdy = (int)(data->m12 * fixed_scale); | - | ||||||||||||||||||||||||
| 2091 | - | |||||||||||||||||||||||||
| 2092 | int fx = int((data->m21 * cy + data->m11 * cx + data->dx) * fixed_scale); | - | ||||||||||||||||||||||||
| 2093 | int fy = int((data->m22 * cy + data->m12 * cx + data->dy) * fixed_scale); | - | ||||||||||||||||||||||||
| 2094 | - | |||||||||||||||||||||||||
| 2095 | fx -= half_point; | - | ||||||||||||||||||||||||
| 2096 | fy -= half_point; | - | ||||||||||||||||||||||||
| 2097 | - | |||||||||||||||||||||||||
| 2098 | if (fdy == 0
| 0 | ||||||||||||||||||||||||
| 2099 | int y1 = (fy >> 16); | - | ||||||||||||||||||||||||
| 2100 | int y2; | - | ||||||||||||||||||||||||
| 2101 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - | ||||||||||||||||||||||||
| 2102 | const uchar *s1 = data->texture.scanLine(y1); | - | ||||||||||||||||||||||||
| 2103 | const uchar *s2 = data->texture.scanLine(y2); | - | ||||||||||||||||||||||||
| 2104 | - | |||||||||||||||||||||||||
| 2105 | if (fdx <= fixed_scale
| 0 | ||||||||||||||||||||||||
| 2106 | int disty = (fy & 0x0000ffff) >> 8; | - | ||||||||||||||||||||||||
| 2107 | int idisty = 256 - disty; | - | ||||||||||||||||||||||||
| 2108 | int x = fx >> 16; | - | ||||||||||||||||||||||||
| 2109 | - | |||||||||||||||||||||||||
| 2110 | - | |||||||||||||||||||||||||
| 2111 | - | |||||||||||||||||||||||||
| 2112 | FetchPixelsFunc fetch = qFetchPixels[layout->bpp]; | - | ||||||||||||||||||||||||
| 2113 | - | |||||||||||||||||||||||||
| 2114 | uint buf1[buffer_size + 2]; | - | ||||||||||||||||||||||||
| 2115 | uint buf2[buffer_size + 2]; | - | ||||||||||||||||||||||||
| 2116 | const uint *ptr1; | - | ||||||||||||||||||||||||
| 2117 | const uint *ptr2; | - | ||||||||||||||||||||||||
| 2118 | - | |||||||||||||||||||||||||
| 2119 | int count = (qint64(length) * fdx + fixed_scale - 1) / fixed_scale + 2; | - | ||||||||||||||||||||||||
| 2120 | ((!(count <= buffer_size + 2)) ? qt_assert("count <= buffer_size + 2",__FILE__,2459) : qt_noop()); | - | ||||||||||||||||||||||||
| 2121 | - | |||||||||||||||||||||||||
| 2122 | if (blendType == BlendTransformedBilinearTiled
| 0 | ||||||||||||||||||||||||
| 2123 | x %= image_width; | - | ||||||||||||||||||||||||
| 2124 | if (x < 0
| 0 | ||||||||||||||||||||||||
| 2125 | x += image_width; never executed: x += image_width; | 0 | ||||||||||||||||||||||||
| 2126 | int len1 = qMin(count, image_width - x); | - | ||||||||||||||||||||||||
| 2127 | int len2 = qMin(x, count - len1); | - | ||||||||||||||||||||||||
| 2128 | - | |||||||||||||||||||||||||
| 2129 | ptr1 = fetch(buf1, s1, x, len1); | - | ||||||||||||||||||||||||
| 2130 | ptr1 = layout->convertToARGB32PM(buf1, ptr1, len1, layout, clut); | - | ||||||||||||||||||||||||
| 2131 | ptr2 = fetch(buf2, s2, x, len1); | - | ||||||||||||||||||||||||
| 2132 | ptr2 = layout->convertToARGB32PM(buf2, ptr2, len1, layout, clut); | - | ||||||||||||||||||||||||
| 2133 | for (int i = 0; i < len1
| 0 | ||||||||||||||||||||||||
| 2134 | uint t = ptr1[i]; | - | ||||||||||||||||||||||||
| 2135 | uint b = ptr2[i]; | - | ||||||||||||||||||||||||
| 2136 | buf1[i] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff; | - | ||||||||||||||||||||||||
| 2137 | buf2[i] = ((((t >> 8) & 0xff00ff) * idisty + ((b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff; | - | ||||||||||||||||||||||||
| 2138 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2139 | - | |||||||||||||||||||||||||
| 2140 | if (len2
| 0 | ||||||||||||||||||||||||
| 2141 | ptr1 = fetch(buf1 + len1, s1, 0, len2); | - | ||||||||||||||||||||||||
| 2142 | ptr1 = layout->convertToARGB32PM(buf1 + len1, ptr1, len2, layout, clut); | - | ||||||||||||||||||||||||
| 2143 | ptr2 = fetch(buf2 + len1, s2, 0, len2); | - | ||||||||||||||||||||||||
| 2144 | ptr2 = layout->convertToARGB32PM(buf2 + len1, ptr2, len2, layout, clut); | - | ||||||||||||||||||||||||
| 2145 | for (int i = 0; i < len2
| 0 | ||||||||||||||||||||||||
| 2146 | uint t = ptr1[i]; | - | ||||||||||||||||||||||||
| 2147 | uint b = ptr2[i]; | - | ||||||||||||||||||||||||
| 2148 | buf1[i + len1] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff; | - | ||||||||||||||||||||||||
| 2149 | buf2[i + len1] = ((((t >> 8) & 0xff00ff) * idisty + ((b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff; | - | ||||||||||||||||||||||||
| 2150 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2151 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2152 | for (int i = image_width; i < count
| 0 | ||||||||||||||||||||||||
| 2153 | buf1[i] = buf1[i - image_width]; | - | ||||||||||||||||||||||||
| 2154 | buf2[i] = buf2[i - image_width]; | - | ||||||||||||||||||||||||
| 2155 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2156 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2157 | int start = qMax(x, image_x1); | - | ||||||||||||||||||||||||
| 2158 | int end = qMin(x + count, image_x2 + 1); | - | ||||||||||||||||||||||||
| 2159 | int len = qMax(1, end - start); | - | ||||||||||||||||||||||||
| 2160 | int leading = start - x; | - | ||||||||||||||||||||||||
| 2161 | - | |||||||||||||||||||||||||
| 2162 | ptr1 = fetch(buf1 + leading, s1, start, len); | - | ||||||||||||||||||||||||
| 2163 | ptr1 = layout->convertToARGB32PM(buf1 + leading, ptr1, len, layout, clut); | - | ||||||||||||||||||||||||
| 2164 | ptr2 = fetch(buf2 + leading, s2, start, len); | - | ||||||||||||||||||||||||
| 2165 | ptr2 = layout->convertToARGB32PM(buf2 + leading, ptr2, len, layout, clut); | - | ||||||||||||||||||||||||
| 2166 | - | |||||||||||||||||||||||||
| 2167 | for (int i = 0; i < len
| 0 | ||||||||||||||||||||||||
| 2168 | uint t = ptr1[i]; | - | ||||||||||||||||||||||||
| 2169 | uint b = ptr2[i]; | - | ||||||||||||||||||||||||
| 2170 | buf1[i + leading] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff; | - | ||||||||||||||||||||||||
| 2171 | buf2[i + leading] = ((((t >> 8) & 0xff00ff) * idisty + ((b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff; | - | ||||||||||||||||||||||||
| 2172 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2173 | - | |||||||||||||||||||||||||
| 2174 | for (int i = 0; i < leading
| 0 | ||||||||||||||||||||||||
| 2175 | buf1[i] = buf1[leading]; | - | ||||||||||||||||||||||||
| 2176 | buf2[i] = buf2[leading]; | - | ||||||||||||||||||||||||
| 2177 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2178 | for (int i = leading + len; i < count
| 0 | ||||||||||||||||||||||||
| 2179 | buf1[i] = buf1[i - 1]; | - | ||||||||||||||||||||||||
| 2180 | buf2[i] = buf2[i - 1]; | - | ||||||||||||||||||||||||
| 2181 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2182 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2183 | - | |||||||||||||||||||||||||
| 2184 | - | |||||||||||||||||||||||||
| 2185 | fx &= fixed_scale - 1; | - | ||||||||||||||||||||||||
| 2186 | ((!((fx >> 16) == 0)) ? qt_assert("(fx >> 16) == 0",__FILE__,2525) : qt_noop()); | - | ||||||||||||||||||||||||
| 2187 | for (int i = 0; i < length
| 0 | ||||||||||||||||||||||||
| 2188 | int x1 = (fx >> 16); | - | ||||||||||||||||||||||||
| 2189 | int x2 = x1 + 1; | - | ||||||||||||||||||||||||
| 2190 | ((!(x1 >= 0)) ? qt_assert("x1 >= 0",__FILE__,2529) : qt_noop()); | - | ||||||||||||||||||||||||
| 2191 | ((!(x2 < count)) ? qt_assert("x2 < count",__FILE__,2530) : qt_noop()); | - | ||||||||||||||||||||||||
| 2192 | - | |||||||||||||||||||||||||
| 2193 | int distx = (fx & 0x0000ffff) >> 8; | - | ||||||||||||||||||||||||
| 2194 | int idistx = 256 - distx; | - | ||||||||||||||||||||||||
| 2195 | int rb = ((buf1[x1] * idistx + buf1[x2] * distx) >> 8) & 0xff00ff; | - | ||||||||||||||||||||||||
| 2196 | int ag = (buf2[x1] * idistx + buf2[x2] * distx) & 0xff00ff00; | - | ||||||||||||||||||||||||
| 2197 | buffer[i] = rb | ag; | - | ||||||||||||||||||||||||
| 2198 | fx += fdx; | - | ||||||||||||||||||||||||
| 2199 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2200 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2201 | FetchPixelFunc fetch = qFetchPixel[layout->bpp]; | - | ||||||||||||||||||||||||
| 2202 | uint buf1[buffer_size]; | - | ||||||||||||||||||||||||
| 2203 | uint buf2[buffer_size]; | - | ||||||||||||||||||||||||
| 2204 | uint *b = buffer; | - | ||||||||||||||||||||||||
| 2205 | while (length
| 0 | ||||||||||||||||||||||||
| 2206 | int len = qMin(length, buffer_size / 2); | - | ||||||||||||||||||||||||
| 2207 | int fracX = fx; | - | ||||||||||||||||||||||||
| 2208 | for (int i = 0; i < len
| 0 | ||||||||||||||||||||||||
| 2209 | int x1 = (fx >> 16); | - | ||||||||||||||||||||||||
| 2210 | int x2; | - | ||||||||||||||||||||||||
| 2211 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - | ||||||||||||||||||||||||
| 2212 | - | |||||||||||||||||||||||||
| 2213 | if (layout->bpp == QPixelLayout::BPP32
| 0 | ||||||||||||||||||||||||
| 2214 | buf1[i * 2 + 0] = ((const uint*)s1)[x1]; | - | ||||||||||||||||||||||||
| 2215 | buf1[i * 2 + 1] = ((const uint*)s1)[x2]; | - | ||||||||||||||||||||||||
| 2216 | buf2[i * 2 + 0] = ((const uint*)s2)[x1]; | - | ||||||||||||||||||||||||
| 2217 | buf2[i * 2 + 1] = ((const uint*)s2)[x2]; | - | ||||||||||||||||||||||||
| 2218 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2219 | buf1[i * 2 + 0] = fetch(s1, x1); | - | ||||||||||||||||||||||||
| 2220 | buf1[i * 2 + 1] = fetch(s1, x2); | - | ||||||||||||||||||||||||
| 2221 | buf2[i * 2 + 0] = fetch(s2, x1); | - | ||||||||||||||||||||||||
| 2222 | buf2[i * 2 + 1] = fetch(s2, x2); | - | ||||||||||||||||||||||||
| 2223 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2224 | - | |||||||||||||||||||||||||
| 2225 | fx += fdx; | - | ||||||||||||||||||||||||
| 2226 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2227 | layout->convertToARGB32PM(buf1, buf1, len * 2, layout, clut); | - | ||||||||||||||||||||||||
| 2228 | layout->convertToARGB32PM(buf2, buf2, len * 2, layout, clut); | - | ||||||||||||||||||||||||
| 2229 | - | |||||||||||||||||||||||||
| 2230 | if ((fdx < 0
| 0 | ||||||||||||||||||||||||
| 2231 | int disty = (fy & 0x0000ffff) >> 8; | - | ||||||||||||||||||||||||
| 2232 | for (int i = 0; i < len
| 0 | ||||||||||||||||||||||||
| 2233 | uint tl = buf1[i * 2 + 0]; | - | ||||||||||||||||||||||||
| 2234 | uint tr = buf1[i * 2 + 1]; | - | ||||||||||||||||||||||||
| 2235 | uint bl = buf2[i * 2 + 0]; | - | ||||||||||||||||||||||||
| 2236 | uint br = buf2[i * 2 + 1]; | - | ||||||||||||||||||||||||
| 2237 | int distx = (fracX & 0x0000ffff) >> 8; | - | ||||||||||||||||||||||||
| 2238 | b[i] = interpolate_4_pixels(tl, tr, bl, br, distx, disty); | - | ||||||||||||||||||||||||
| 2239 | fracX += fdx; | - | ||||||||||||||||||||||||
| 2240 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2241 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2242 | int disty = (fy & 0x0000ffff) >> 12; | - | ||||||||||||||||||||||||
| 2243 | for (int i = 0; i < len
| 0 | ||||||||||||||||||||||||
| 2244 | uint tl = buf1[i * 2 + 0]; | - | ||||||||||||||||||||||||
| 2245 | uint tr = buf1[i * 2 + 1]; | - | ||||||||||||||||||||||||
| 2246 | uint bl = buf2[i * 2 + 0]; | - | ||||||||||||||||||||||||
| 2247 | uint br = buf2[i * 2 + 1]; | - | ||||||||||||||||||||||||
| 2248 | int distx = (fracX & 0x0000ffff) >> 12; | - | ||||||||||||||||||||||||
| 2249 | b[i] = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty); | - | ||||||||||||||||||||||||
| 2250 | fracX += fdx; | - | ||||||||||||||||||||||||
| 2251 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2252 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2253 | length -= len; | - | ||||||||||||||||||||||||
| 2254 | b += len; | - | ||||||||||||||||||||||||
| 2255 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2256 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2257 | } else { | - | ||||||||||||||||||||||||
| 2258 | FetchPixelFunc fetch = qFetchPixel[layout->bpp]; | - | ||||||||||||||||||||||||
| 2259 | uint buf1[buffer_size]; | - | ||||||||||||||||||||||||
| 2260 | uint buf2[buffer_size]; | - | ||||||||||||||||||||||||
| 2261 | uint *b = buffer; | - | ||||||||||||||||||||||||
| 2262 | - | |||||||||||||||||||||||||
| 2263 | while (length
| 0 | ||||||||||||||||||||||||
| 2264 | int len = qMin(length, buffer_size / 2); | - | ||||||||||||||||||||||||
| 2265 | int fracX = fx; | - | ||||||||||||||||||||||||
| 2266 | int fracY = fy; | - | ||||||||||||||||||||||||
| 2267 | for (int i = 0; i < len
| 0 | ||||||||||||||||||||||||
| 2268 | int x1 = (fx >> 16); | - | ||||||||||||||||||||||||
| 2269 | int x2; | - | ||||||||||||||||||||||||
| 2270 | int y1 = (fy >> 16); | - | ||||||||||||||||||||||||
| 2271 | int y2; | - | ||||||||||||||||||||||||
| 2272 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - | ||||||||||||||||||||||||
| 2273 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - | ||||||||||||||||||||||||
| 2274 | - | |||||||||||||||||||||||||
| 2275 | const uchar *s1 = data->texture.scanLine(y1); | - | ||||||||||||||||||||||||
| 2276 | const uchar *s2 = data->texture.scanLine(y2); | - | ||||||||||||||||||||||||
| 2277 | - | |||||||||||||||||||||||||
| 2278 | if (layout->bpp == QPixelLayout::BPP32
| 0 | ||||||||||||||||||||||||
| 2279 | buf1[i * 2 + 0] = ((const uint*)s1)[x1]; | - | ||||||||||||||||||||||||
| 2280 | buf1[i * 2 + 1] = ((const uint*)s1)[x2]; | - | ||||||||||||||||||||||||
| 2281 | buf2[i * 2 + 0] = ((const uint*)s2)[x1]; | - | ||||||||||||||||||||||||
| 2282 | buf2[i * 2 + 1] = ((const uint*)s2)[x2]; | - | ||||||||||||||||||||||||
| 2283 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2284 | buf1[i * 2 + 0] = fetch(s1, x1); | - | ||||||||||||||||||||||||
| 2285 | buf1[i * 2 + 1] = fetch(s1, x2); | - | ||||||||||||||||||||||||
| 2286 | buf2[i * 2 + 0] = fetch(s2, x1); | - | ||||||||||||||||||||||||
| 2287 | buf2[i * 2 + 1] = fetch(s2, x2); | - | ||||||||||||||||||||||||
| 2288 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2289 | - | |||||||||||||||||||||||||
| 2290 | fx += fdx; | - | ||||||||||||||||||||||||
| 2291 | fy += fdy; | - | ||||||||||||||||||||||||
| 2292 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2293 | layout->convertToARGB32PM(buf1, buf1, len * 2, layout, clut); | - | ||||||||||||||||||||||||
| 2294 | layout->convertToARGB32PM(buf2, buf2, len * 2, layout, clut); | - | ||||||||||||||||||||||||
| 2295 | - | |||||||||||||||||||||||||
| 2296 | if (std::abs(data->m11) > 8
| 0 | ||||||||||||||||||||||||
| 2297 | - | |||||||||||||||||||||||||
| 2298 | for (int i = 0; i < len
| 0 | ||||||||||||||||||||||||
| 2299 | uint tl = buf1[i * 2 + 0]; | - | ||||||||||||||||||||||||
| 2300 | uint tr = buf1[i * 2 + 1]; | - | ||||||||||||||||||||||||
| 2301 | uint bl = buf2[i * 2 + 0]; | - | ||||||||||||||||||||||||
| 2302 | uint br = buf2[i * 2 + 1]; | - | ||||||||||||||||||||||||
| 2303 | - | |||||||||||||||||||||||||
| 2304 | int distx = (fracX & 0x0000ffff) >> 8; | - | ||||||||||||||||||||||||
| 2305 | int disty = (fracY & 0x0000ffff) >> 8; | - | ||||||||||||||||||||||||
| 2306 | - | |||||||||||||||||||||||||
| 2307 | b[i] = interpolate_4_pixels(tl, tr, bl, br, distx, disty); | - | ||||||||||||||||||||||||
| 2308 | fracX += fdx; | - | ||||||||||||||||||||||||
| 2309 | fracY += fdy; | - | ||||||||||||||||||||||||
| 2310 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2311 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2312 | - | |||||||||||||||||||||||||
| 2313 | for (int i = 0; i < len
| 0 | ||||||||||||||||||||||||
| 2314 | uint tl = buf1[i * 2 + 0]; | - | ||||||||||||||||||||||||
| 2315 | uint tr = buf1[i * 2 + 1]; | - | ||||||||||||||||||||||||
| 2316 | uint bl = buf2[i * 2 + 0]; | - | ||||||||||||||||||||||||
| 2317 | uint br = buf2[i * 2 + 1]; | - | ||||||||||||||||||||||||
| 2318 | - | |||||||||||||||||||||||||
| 2319 | int distx = (fracX & 0x0000ffff) >> 12; | - | ||||||||||||||||||||||||
| 2320 | int disty = (fracY & 0x0000ffff) >> 12; | - | ||||||||||||||||||||||||
| 2321 | - | |||||||||||||||||||||||||
| 2322 | b[i] = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty); | - | ||||||||||||||||||||||||
| 2323 | fracX += fdx; | - | ||||||||||||||||||||||||
| 2324 | fracY += fdy; | - | ||||||||||||||||||||||||
| 2325 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2326 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2327 | - | |||||||||||||||||||||||||
| 2328 | length -= len; | - | ||||||||||||||||||||||||
| 2329 | b += len; | - | ||||||||||||||||||||||||
| 2330 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2331 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2332 | } else { | - | ||||||||||||||||||||||||
| 2333 | const qreal fdx = data->m11; | - | ||||||||||||||||||||||||
| 2334 | const qreal fdy = data->m12; | - | ||||||||||||||||||||||||
| 2335 | const qreal fdw = data->m13; | - | ||||||||||||||||||||||||
| 2336 | - | |||||||||||||||||||||||||
| 2337 | qreal fx = data->m21 * cy + data->m11 * cx + data->dx; | - | ||||||||||||||||||||||||
| 2338 | qreal fy = data->m22 * cy + data->m12 * cx + data->dy; | - | ||||||||||||||||||||||||
| 2339 | qreal fw = data->m23 * cy + data->m13 * cx + data->m33; | - | ||||||||||||||||||||||||
| 2340 | - | |||||||||||||||||||||||||
| 2341 | FetchPixelFunc fetch = qFetchPixel[layout->bpp]; | - | ||||||||||||||||||||||||
| 2342 | uint buf1[buffer_size]; | - | ||||||||||||||||||||||||
| 2343 | uint buf2[buffer_size]; | - | ||||||||||||||||||||||||
| 2344 | uint *b = buffer; | - | ||||||||||||||||||||||||
| 2345 | - | |||||||||||||||||||||||||
| 2346 | int distxs[buffer_size / 2]; | - | ||||||||||||||||||||||||
| 2347 | int distys[buffer_size / 2]; | - | ||||||||||||||||||||||||
| 2348 | - | |||||||||||||||||||||||||
| 2349 | while (length
| 0 | ||||||||||||||||||||||||
| 2350 | int len = qMin(length, buffer_size / 2); | - | ||||||||||||||||||||||||
| 2351 | for (int i = 0; i < len
| 0 | ||||||||||||||||||||||||
| 2352 | const qreal iw = fw == 0 ? 1 : 1 / fw; | - | ||||||||||||||||||||||||
| 2353 | const qreal px = fx * iw - qreal(0.5); | - | ||||||||||||||||||||||||
| 2354 | const qreal py = fy * iw - qreal(0.5); | - | ||||||||||||||||||||||||
| 2355 | - | |||||||||||||||||||||||||
| 2356 | int x1 = int(px) - (px < 0); | - | ||||||||||||||||||||||||
| 2357 | int x2; | - | ||||||||||||||||||||||||
| 2358 | int y1 = int(py) - (py < 0); | - | ||||||||||||||||||||||||
| 2359 | int y2; | - | ||||||||||||||||||||||||
| 2360 | - | |||||||||||||||||||||||||
| 2361 | distxs[i] = int((px - x1) * 256); | - | ||||||||||||||||||||||||
| 2362 | distys[i] = int((py - y1) * 256); | - | ||||||||||||||||||||||||
| 2363 | - | |||||||||||||||||||||||||
| 2364 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - | ||||||||||||||||||||||||
| 2365 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - | ||||||||||||||||||||||||
| 2366 | - | |||||||||||||||||||||||||
| 2367 | const uchar *s1 = data->texture.scanLine(y1); | - | ||||||||||||||||||||||||
| 2368 | const uchar *s2 = data->texture.scanLine(y2); | - | ||||||||||||||||||||||||
| 2369 | - | |||||||||||||||||||||||||
| 2370 | if (layout->bpp == QPixelLayout::BPP32
| 0 | ||||||||||||||||||||||||
| 2371 | buf1[i * 2 + 0] = ((const uint*)s1)[x1]; | - | ||||||||||||||||||||||||
| 2372 | buf1[i * 2 + 1] = ((const uint*)s1)[x2]; | - | ||||||||||||||||||||||||
| 2373 | buf2[i * 2 + 0] = ((const uint*)s2)[x1]; | - | ||||||||||||||||||||||||
| 2374 | buf2[i * 2 + 1] = ((const uint*)s2)[x2]; | - | ||||||||||||||||||||||||
| 2375 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2376 | buf1[i * 2 + 0] = fetch(s1, x1); | - | ||||||||||||||||||||||||
| 2377 | buf1[i * 2 + 1] = fetch(s1, x2); | - | ||||||||||||||||||||||||
| 2378 | buf2[i * 2 + 0] = fetch(s2, x1); | - | ||||||||||||||||||||||||
| 2379 | buf2[i * 2 + 1] = fetch(s2, x2); | - | ||||||||||||||||||||||||
| 2380 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2381 | - | |||||||||||||||||||||||||
| 2382 | fx += fdx; | - | ||||||||||||||||||||||||
| 2383 | fy += fdy; | - | ||||||||||||||||||||||||
| 2384 | fw += fdw; | - | ||||||||||||||||||||||||
| 2385 | - | |||||||||||||||||||||||||
| 2386 | if (!fw
| 0 | ||||||||||||||||||||||||
| 2387 | fw += fdw; never executed: fw += fdw; | 0 | ||||||||||||||||||||||||
| 2388 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2389 | - | |||||||||||||||||||||||||
| 2390 | layout->convertToARGB32PM(buf1, buf1, len * 2, layout, clut); | - | ||||||||||||||||||||||||
| 2391 | layout->convertToARGB32PM(buf2, buf2, len * 2, layout, clut); | - | ||||||||||||||||||||||||
| 2392 | - | |||||||||||||||||||||||||
| 2393 | for (int i = 0; i < len
| 0 | ||||||||||||||||||||||||
| 2394 | int distx = distxs[i]; | - | ||||||||||||||||||||||||
| 2395 | int disty = distys[i]; | - | ||||||||||||||||||||||||
| 2396 | - | |||||||||||||||||||||||||
| 2397 | uint tl = buf1[i * 2 + 0]; | - | ||||||||||||||||||||||||
| 2398 | uint tr = buf1[i * 2 + 1]; | - | ||||||||||||||||||||||||
| 2399 | uint bl = buf2[i * 2 + 0]; | - | ||||||||||||||||||||||||
| 2400 | uint br = buf2[i * 2 + 1]; | - | ||||||||||||||||||||||||
| 2401 | - | |||||||||||||||||||||||||
| 2402 | b[i] = interpolate_4_pixels(tl, tr, bl, br, distx, disty); | - | ||||||||||||||||||||||||
| 2403 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2404 | length -= len; | - | ||||||||||||||||||||||||
| 2405 | b += len; | - | ||||||||||||||||||||||||
| 2406 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2407 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2408 | - | |||||||||||||||||||||||||
| 2409 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 2410 | } | - | ||||||||||||||||||||||||
| 2411 | - | |||||||||||||||||||||||||
| 2412 | template<TextureBlendType blendType> | - | ||||||||||||||||||||||||
| 2413 | static const QRgba64 * fetchTransformedBilinear64(QRgba64 *buffer, const Operator *, | - | ||||||||||||||||||||||||
| 2414 | const QSpanData *data, int y, int x, int length) | - | ||||||||||||||||||||||||
| 2415 | { | - | ||||||||||||||||||||||||
| 2416 | const QPixelLayout *layout = &qPixelLayouts[data->texture.format]; | - | ||||||||||||||||||||||||
| 2417 | const QRgb *clut = data->texture.colorTable ? data->texture.colorTable->constData() : 0; | - | ||||||||||||||||||||||||
| 2418 | - | |||||||||||||||||||||||||
| 2419 | int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 2420 | int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 2421 | - | |||||||||||||||||||||||||
| 2422 | int image_x1 = data->texture.x1; | - | ||||||||||||||||||||||||
| 2423 | int image_y1 = data->texture.y1; | - | ||||||||||||||||||||||||
| 2424 | int image_x2 = data->texture.x2 - 1; | - | ||||||||||||||||||||||||
| 2425 | int image_y2 = data->texture.y2 - 1; | - | ||||||||||||||||||||||||
| 2426 | - | |||||||||||||||||||||||||
| 2427 | const qreal cx = x + qreal(0.5); | - | ||||||||||||||||||||||||
| 2428 | const qreal cy = y + qreal(0.5); | - | ||||||||||||||||||||||||
| 2429 | - | |||||||||||||||||||||||||
| 2430 | const qreal fdx = data->m11; | - | ||||||||||||||||||||||||
| 2431 | const qreal fdy = data->m12; | - | ||||||||||||||||||||||||
| 2432 | const qreal fdw = data->m13; | - | ||||||||||||||||||||||||
| 2433 | - | |||||||||||||||||||||||||
| 2434 | if (data->fast_matrix
| 0 | ||||||||||||||||||||||||
| 2435 | - | |||||||||||||||||||||||||
| 2436 | int fdx = (int)(data->m11 * fixed_scale); | - | ||||||||||||||||||||||||
| 2437 | int fdy = (int)(data->m12 * fixed_scale); | - | ||||||||||||||||||||||||
| 2438 | - | |||||||||||||||||||||||||
| 2439 | int fx = int((data->m21 * cy + data->m11 * cx + data->dx) * fixed_scale); | - | ||||||||||||||||||||||||
| 2440 | int fy = int((data->m22 * cy + data->m12 * cx + data->dy) * fixed_scale); | - | ||||||||||||||||||||||||
| 2441 | - | |||||||||||||||||||||||||
| 2442 | fx -= half_point; | - | ||||||||||||||||||||||||
| 2443 | fy -= half_point; | - | ||||||||||||||||||||||||
| 2444 | - | |||||||||||||||||||||||||
| 2445 | if (fdy == 0
| 0 | ||||||||||||||||||||||||
| 2446 | int y1 = (fy >> 16); | - | ||||||||||||||||||||||||
| 2447 | int y2; | - | ||||||||||||||||||||||||
| 2448 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - | ||||||||||||||||||||||||
| 2449 | const uchar *s1 = data->texture.scanLine(y1); | - | ||||||||||||||||||||||||
| 2450 | const uchar *s2 = data->texture.scanLine(y2); | - | ||||||||||||||||||||||||
| 2451 | - | |||||||||||||||||||||||||
| 2452 | FetchPixelFunc fetch = qFetchPixel[layout->bpp]; | - | ||||||||||||||||||||||||
| 2453 | uint sbuf1[buffer_size]; | - | ||||||||||||||||||||||||
| 2454 | uint sbuf2[buffer_size]; | - | ||||||||||||||||||||||||
| 2455 | QRgba64 buf1[buffer_size]; | - | ||||||||||||||||||||||||
| 2456 | QRgba64 buf2[buffer_size]; | - | ||||||||||||||||||||||||
| 2457 | QRgba64 *b = buffer; | - | ||||||||||||||||||||||||
| 2458 | while (length
| 0 | ||||||||||||||||||||||||
| 2459 | int len = qMin(length, buffer_size / 2); | - | ||||||||||||||||||||||||
| 2460 | int fracX = fx; | - | ||||||||||||||||||||||||
| 2461 | int i = 0; | - | ||||||||||||||||||||||||
| 2462 | int disty = (fy & 0x0000ffff); | - | ||||||||||||||||||||||||
| 2463 | - | |||||||||||||||||||||||||
| 2464 | const __m128i vdy = _mm_set1_epi16(disty); | - | ||||||||||||||||||||||||
| 2465 | const __m128i vidy = _mm_set1_epi16(0x10000 - disty); | - | ||||||||||||||||||||||||
| 2466 | if (blendType != BlendTransformedBilinearTiled
| 0 | ||||||||||||||||||||||||
| 2467 | for (; i < len
| 0 | ||||||||||||||||||||||||
| 2468 | int x1 = (fx >> 16); | - | ||||||||||||||||||||||||
| 2469 | int x2; | - | ||||||||||||||||||||||||
| 2470 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - | ||||||||||||||||||||||||
| 2471 | if (x1 != x2
| 0 | ||||||||||||||||||||||||
| 2472 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2473 | sbuf1[i * 2 + 0] = ((const uint*)s1)[x1]; | - | ||||||||||||||||||||||||
| 2474 | sbuf1[i * 2 + 1] = ((const uint*)s1)[x2]; | - | ||||||||||||||||||||||||
| 2475 | sbuf2[i * 2 + 0] = ((const uint*)s2)[x1]; | - | ||||||||||||||||||||||||
| 2476 | sbuf2[i * 2 + 1] = ((const uint*)s2)[x2]; | - | ||||||||||||||||||||||||
| 2477 | fx += fdx; | - | ||||||||||||||||||||||||
| 2478 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2479 | int fastLen; | - | ||||||||||||||||||||||||
| 2480 | if (fdx > 0
| 0 | ||||||||||||||||||||||||
| 2481 | fastLen = qMin(len, int((image_x2 - (fx >> 16)) / data->m11)); never executed: fastLen = qMin(len, int((image_x2 - (fx >> 16)) / data->m11)); | 0 | ||||||||||||||||||||||||
| 2482 | else | - | ||||||||||||||||||||||||
| 2483 | fastLen = qMin(len, int((image_x1 - (fx >> 16)) / data->m11)); never executed: fastLen = qMin(len, int((image_x1 - (fx >> 16)) / data->m11)); | 0 | ||||||||||||||||||||||||
| 2484 | fastLen -= 3; | - | ||||||||||||||||||||||||
| 2485 | - | |||||||||||||||||||||||||
| 2486 | const __m128i v_fdx = _mm_set1_epi32(fdx*4); | - | ||||||||||||||||||||||||
| 2487 | __m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx); | - | ||||||||||||||||||||||||
| 2488 | for (; i < fastLen
| 0 | ||||||||||||||||||||||||
| 2489 | int offset = ((int) (unsigned short) __builtin_ia32_vec_ext_v8hi ((__v8hi)(__m128i)(v_fx), (int)(1))); | - | ||||||||||||||||||||||||
| 2490 | sbuf1[i * 2 + 0] = ((const uint*)s1)[offset]; | - | ||||||||||||||||||||||||
| 2491 | sbuf1[i * 2 + 1] = ((const uint*)s1)[offset + 1]; | - | ||||||||||||||||||||||||
| 2492 | sbuf2[i * 2 + 0] = ((const uint*)s2)[offset]; | - | ||||||||||||||||||||||||
| 2493 | sbuf2[i * 2 + 1] = ((const uint*)s2)[offset + 1]; | - | ||||||||||||||||||||||||
| 2494 | offset = ((int) (unsigned short) __builtin_ia32_vec_ext_v8hi ((__v8hi)(__m128i)(v_fx), (int)(3))); | - | ||||||||||||||||||||||||
| 2495 | sbuf1[i * 2 + 2] = ((const uint*)s1)[offset]; | - | ||||||||||||||||||||||||
| 2496 | sbuf1[i * 2 + 3] = ((const uint*)s1)[offset + 1]; | - | ||||||||||||||||||||||||
| 2497 | sbuf2[i * 2 + 2] = ((const uint*)s2)[offset]; | - | ||||||||||||||||||||||||
| 2498 | sbuf2[i * 2 + 3] = ((const uint*)s2)[offset + 1]; | - | ||||||||||||||||||||||||
| 2499 | offset = ((int) (unsigned short) __builtin_ia32_vec_ext_v8hi ((__v8hi)(__m128i)(v_fx), (int)(5))); | - | ||||||||||||||||||||||||
| 2500 | sbuf1[i * 2 + 4] = ((const uint*)s1)[offset]; | - | ||||||||||||||||||||||||
| 2501 | sbuf1[i * 2 + 5] = ((const uint*)s1)[offset + 1]; | - | ||||||||||||||||||||||||
| 2502 | sbuf2[i * 2 + 4] = ((const uint*)s2)[offset]; | - | ||||||||||||||||||||||||
| 2503 | sbuf2[i * 2 + 5] = ((const uint*)s2)[offset + 1]; | - | ||||||||||||||||||||||||
| 2504 | offset = ((int) (unsigned short) __builtin_ia32_vec_ext_v8hi ((__v8hi)(__m128i)(v_fx), (int)(7))); | - | ||||||||||||||||||||||||
| 2505 | sbuf1[i * 2 + 6] = ((const uint*)s1)[offset]; | - | ||||||||||||||||||||||||
| 2506 | sbuf1[i * 2 + 7] = ((const uint*)s1)[offset + 1]; | - | ||||||||||||||||||||||||
| 2507 | sbuf2[i * 2 + 6] = ((const uint*)s2)[offset]; | - | ||||||||||||||||||||||||
| 2508 | sbuf2[i * 2 + 7] = ((const uint*)s2)[offset + 1]; | - | ||||||||||||||||||||||||
| 2509 | v_fx = _mm_add_epi32(v_fx, v_fdx); | - | ||||||||||||||||||||||||
| 2510 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2511 | fx = _mm_cvtsi128_si32(v_fx); | - | ||||||||||||||||||||||||
| 2512 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2513 | - | |||||||||||||||||||||||||
| 2514 | for (; i < len
| 0 | ||||||||||||||||||||||||
| 2515 | int x1 = (fx >> 16); | - | ||||||||||||||||||||||||
| 2516 | int x2; | - | ||||||||||||||||||||||||
| 2517 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - | ||||||||||||||||||||||||
| 2518 | - | |||||||||||||||||||||||||
| 2519 | if (layout->bpp == QPixelLayout::BPP32
| 0 | ||||||||||||||||||||||||
| 2520 | sbuf1[i * 2 + 0] = ((const uint*)s1)[x1]; | - | ||||||||||||||||||||||||
| 2521 | sbuf1[i * 2 + 1] = ((const uint*)s1)[x2]; | - | ||||||||||||||||||||||||
| 2522 | sbuf2[i * 2 + 0] = ((const uint*)s2)[x1]; | - | ||||||||||||||||||||||||
| 2523 | sbuf2[i * 2 + 1] = ((const uint*)s2)[x2]; | - | ||||||||||||||||||||||||
| 2524 | - | |||||||||||||||||||||||||
| 2525 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2526 | sbuf1[i * 2 + 0] = fetch(s1, x1); | - | ||||||||||||||||||||||||
| 2527 | sbuf1[i * 2 + 1] = fetch(s1, x2); | - | ||||||||||||||||||||||||
| 2528 | sbuf2[i * 2 + 0] = fetch(s2, x1); | - | ||||||||||||||||||||||||
| 2529 | sbuf2[i * 2 + 1] = fetch(s2, x2); | - | ||||||||||||||||||||||||
| 2530 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2531 | - | |||||||||||||||||||||||||
| 2532 | fx += fdx; | - | ||||||||||||||||||||||||
| 2533 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2534 | layout->convertToARGB64PM(buf1, sbuf1, len * 2, layout, clut); | - | ||||||||||||||||||||||||
| 2535 | if (disty
| 0 | ||||||||||||||||||||||||
| 2536 | layout->convertToARGB64PM(buf2, sbuf2, len * 2, layout, clut); never executed: layout->convertToARGB64PM(buf2, sbuf2, len * 2, layout, clut); | 0 | ||||||||||||||||||||||||
| 2537 | - | |||||||||||||||||||||||||
| 2538 | for (int i = 0; i < len
| 0 | ||||||||||||||||||||||||
| 2539 | int distx = (fracX & 0x0000ffff); | - | ||||||||||||||||||||||||
| 2540 | - | |||||||||||||||||||||||||
| 2541 | const __m128i vdistx = ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(_mm_cvtsi32_si128(distx)), (int)((((0) << 6) | ((0) << 4) | ((0) << 2) | (0))))); | - | ||||||||||||||||||||||||
| 2542 | const __m128i vidistx = ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(_mm_cvtsi32_si128(0x10000 - distx)), (int)((((0) << 6) | ((0) << 4) | ((0) << 2) | (0))))); | - | ||||||||||||||||||||||||
| 2543 | __m128i vt = _mm_loadu_si128((const __m128i*)(buf1 + i*2)); | - | ||||||||||||||||||||||||
| 2544 | if (disty
| 0 | ||||||||||||||||||||||||
| 2545 | __m128i vb = _mm_loadu_si128((const __m128i*)(buf2 + i*2)); | - | ||||||||||||||||||||||||
| 2546 | vt = _mm_mulhi_epu16(vt, vidy); | - | ||||||||||||||||||||||||
| 2547 | vb = _mm_mulhi_epu16(vb, vdy); | - | ||||||||||||||||||||||||
| 2548 | vt = _mm_add_epi16(vt, vb); | - | ||||||||||||||||||||||||
| 2549 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2550 | vt = _mm_mulhi_epu16(vt, _mm_unpacklo_epi64(vidistx, vdistx)); | - | ||||||||||||||||||||||||
| 2551 | vt = _mm_add_epi16(vt, ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(vt), (int)(8) * 8))); | - | ||||||||||||||||||||||||
| 2552 | _mm_storel_epi64((__m128i*)(b+i), vt); | - | ||||||||||||||||||||||||
| 2553 | - | |||||||||||||||||||||||||
| 2554 | - | |||||||||||||||||||||||||
| 2555 | - | |||||||||||||||||||||||||
| 2556 | fracX += fdx; | - | ||||||||||||||||||||||||
| 2557 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2558 | length -= len; | - | ||||||||||||||||||||||||
| 2559 | b += len; | - | ||||||||||||||||||||||||
| 2560 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2561 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2562 | FetchPixelFunc fetch = qFetchPixel[layout->bpp]; | - | ||||||||||||||||||||||||
| 2563 | uint sbuf1[buffer_size]; | - | ||||||||||||||||||||||||
| 2564 | uint sbuf2[buffer_size]; | - | ||||||||||||||||||||||||
| 2565 | QRgba64 buf1[buffer_size]; | - | ||||||||||||||||||||||||
| 2566 | QRgba64 buf2[buffer_size]; | - | ||||||||||||||||||||||||
| 2567 | QRgba64 *end = buffer + length; | - | ||||||||||||||||||||||||
| 2568 | QRgba64 *b = buffer; | - | ||||||||||||||||||||||||
| 2569 | - | |||||||||||||||||||||||||
| 2570 | while (b < end
| 0 | ||||||||||||||||||||||||
| 2571 | int len = qMin(length, buffer_size / 2); | - | ||||||||||||||||||||||||
| 2572 | int fracX = fx; | - | ||||||||||||||||||||||||
| 2573 | int fracY = fy; | - | ||||||||||||||||||||||||
| 2574 | int i = 0; | - | ||||||||||||||||||||||||
| 2575 | - | |||||||||||||||||||||||||
| 2576 | if (blendType != BlendTransformedBilinearTiled
| 0 | ||||||||||||||||||||||||
| 2577 | for (; i < len
| 0 | ||||||||||||||||||||||||
| 2578 | int x1 = (fx >> 16); | - | ||||||||||||||||||||||||
| 2579 | int x2; | - | ||||||||||||||||||||||||
| 2580 | int y1 = (fy >> 16); | - | ||||||||||||||||||||||||
| 2581 | int y2; | - | ||||||||||||||||||||||||
| 2582 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - | ||||||||||||||||||||||||
| 2583 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - | ||||||||||||||||||||||||
| 2584 | if (x1 != x2
| 0 | ||||||||||||||||||||||||
| 2585 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2586 | const uchar *s1 = data->texture.scanLine(y1); | - | ||||||||||||||||||||||||
| 2587 | const uchar *s2 = data->texture.scanLine(y2); | - | ||||||||||||||||||||||||
| 2588 | sbuf1[i * 2 + 0] = ((const uint*)s1)[x1]; | - | ||||||||||||||||||||||||
| 2589 | sbuf1[i * 2 + 1] = ((const uint*)s1)[x2]; | - | ||||||||||||||||||||||||
| 2590 | sbuf2[i * 2 + 0] = ((const uint*)s2)[x1]; | - | ||||||||||||||||||||||||
| 2591 | sbuf2[i * 2 + 1] = ((const uint*)s2)[x2]; | - | ||||||||||||||||||||||||
| 2592 | fx += fdx; | - | ||||||||||||||||||||||||
| 2593 | fy += fdy; | - | ||||||||||||||||||||||||
| 2594 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2595 | - | |||||||||||||||||||||||||
| 2596 | const __m128i v_fdx = _mm_set1_epi32(fdx*4); | - | ||||||||||||||||||||||||
| 2597 | const __m128i v_fdy = _mm_set1_epi32(fdy*4); | - | ||||||||||||||||||||||||
| 2598 | __m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx); | - | ||||||||||||||||||||||||
| 2599 | __m128i v_fy = _mm_setr_epi32(fy, fy + fdy, fy + fdy + fdy, fy + fdy + fdy + fdy); | - | ||||||||||||||||||||||||
| 2600 | const int bytesPerLine = data->texture.bytesPerLine; | - | ||||||||||||||||||||||||
| 2601 | const uchar *s1 = data->texture.imageData; | - | ||||||||||||||||||||||||
| 2602 | const uchar *s2 = s1 + bytesPerLine; | - | ||||||||||||||||||||||||
| 2603 | const __m128i vbpl = ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(_mm_cvtsi32_si128(bytesPerLine/4)), (int)((((0) << 6) | ((0) << 4) | ((0) << 2) | (0))))); | - | ||||||||||||||||||||||||
| 2604 | for (; i < len-3
| 0 | ||||||||||||||||||||||||
| 2605 | if (fdx > 0
| 0 | ||||||||||||||||||||||||
| 2606 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2607 | if (fdx < 0
| 0 | ||||||||||||||||||||||||
| 2608 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2609 | if (fdy > 0
| 0 | ||||||||||||||||||||||||
| 2610 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2611 | if (fdy < 0
| 0 | ||||||||||||||||||||||||
| 2612 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2613 | const __m128i vy = _mm_packs_epi32(_mm_srai_epi32(v_fy, 16), _mm_setzero_si128()); | - | ||||||||||||||||||||||||
| 2614 | __m128i voffset = _mm_unpacklo_epi16(_mm_mullo_epi16(vy, vbpl), _mm_mulhi_epu16(vy, vbpl)); | - | ||||||||||||||||||||||||
| 2615 | voffset = _mm_add_epi32(voffset, _mm_srli_epi32(v_fx, 16)); | - | ||||||||||||||||||||||||
| 2616 | - | |||||||||||||||||||||||||
| 2617 | int offset = _mm_cvtsi128_si32(voffset); voffset = ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(voffset), (int)(4) * 8)); | - | ||||||||||||||||||||||||
| 2618 | sbuf1[i * 2 + 0] = ((const uint*)s1)[offset]; | - | ||||||||||||||||||||||||
| 2619 | sbuf1[i * 2 + 1] = ((const uint*)s1)[offset + 1]; | - | ||||||||||||||||||||||||
| 2620 | sbuf2[i * 2 + 0] = ((const uint*)s2)[offset]; | - | ||||||||||||||||||||||||
| 2621 | sbuf2[i * 2 + 1] = ((const uint*)s2)[offset + 1]; | - | ||||||||||||||||||||||||
| 2622 | offset = _mm_cvtsi128_si32(voffset); voffset = ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(voffset), (int)(4) * 8)); | - | ||||||||||||||||||||||||
| 2623 | sbuf1[i * 2 + 2] = ((const uint*)s1)[offset]; | - | ||||||||||||||||||||||||
| 2624 | sbuf1[i * 2 + 3] = ((const uint*)s1)[offset + 1]; | - | ||||||||||||||||||||||||
| 2625 | sbuf2[i * 2 + 2] = ((const uint*)s2)[offset]; | - | ||||||||||||||||||||||||
| 2626 | sbuf2[i * 2 + 3] = ((const uint*)s2)[offset + 1]; | - | ||||||||||||||||||||||||
| 2627 | offset = _mm_cvtsi128_si32(voffset); voffset = ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(voffset), (int)(4) * 8)); | - | ||||||||||||||||||||||||
| 2628 | sbuf1[i * 2 + 4] = ((const uint*)s1)[offset]; | - | ||||||||||||||||||||||||
| 2629 | sbuf1[i * 2 + 5] = ((const uint*)s1)[offset + 1]; | - | ||||||||||||||||||||||||
| 2630 | sbuf2[i * 2 + 4] = ((const uint*)s2)[offset]; | - | ||||||||||||||||||||||||
| 2631 | sbuf2[i * 2 + 5] = ((const uint*)s2)[offset + 1]; | - | ||||||||||||||||||||||||
| 2632 | offset = _mm_cvtsi128_si32(voffset); | - | ||||||||||||||||||||||||
| 2633 | sbuf1[i * 2 + 6] = ((const uint*)s1)[offset]; | - | ||||||||||||||||||||||||
| 2634 | sbuf1[i * 2 + 7] = ((const uint*)s1)[offset + 1]; | - | ||||||||||||||||||||||||
| 2635 | sbuf2[i * 2 + 6] = ((const uint*)s2)[offset]; | - | ||||||||||||||||||||||||
| 2636 | sbuf2[i * 2 + 7] = ((const uint*)s2)[offset + 1]; | - | ||||||||||||||||||||||||
| 2637 | - | |||||||||||||||||||||||||
| 2638 | v_fx = _mm_add_epi32(v_fx, v_fdx); | - | ||||||||||||||||||||||||
| 2639 | v_fy = _mm_add_epi32(v_fy, v_fdy); | - | ||||||||||||||||||||||||
| 2640 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2641 | fx = _mm_cvtsi128_si32(v_fx); | - | ||||||||||||||||||||||||
| 2642 | fy = _mm_cvtsi128_si32(v_fy); | - | ||||||||||||||||||||||||
| 2643 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2644 | - | |||||||||||||||||||||||||
| 2645 | for (; i < len
| 0 | ||||||||||||||||||||||||
| 2646 | int x1 = (fx >> 16); | - | ||||||||||||||||||||||||
| 2647 | int x2; | - | ||||||||||||||||||||||||
| 2648 | int y1 = (fy >> 16); | - | ||||||||||||||||||||||||
| 2649 | int y2; | - | ||||||||||||||||||||||||
| 2650 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - | ||||||||||||||||||||||||
| 2651 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - | ||||||||||||||||||||||||
| 2652 | - | |||||||||||||||||||||||||
| 2653 | const uchar *s1 = data->texture.scanLine(y1); | - | ||||||||||||||||||||||||
| 2654 | const uchar *s2 = data->texture.scanLine(y2); | - | ||||||||||||||||||||||||
| 2655 | - | |||||||||||||||||||||||||
| 2656 | if (layout->bpp == QPixelLayout::BPP32
| 0 | ||||||||||||||||||||||||
| 2657 | sbuf1[i * 2 + 0] = ((const uint*)s1)[x1]; | - | ||||||||||||||||||||||||
| 2658 | sbuf1[i * 2 + 1] = ((const uint*)s1)[x2]; | - | ||||||||||||||||||||||||
| 2659 | sbuf2[i * 2 + 0] = ((const uint*)s2)[x1]; | - | ||||||||||||||||||||||||
| 2660 | sbuf2[i * 2 + 1] = ((const uint*)s2)[x2]; | - | ||||||||||||||||||||||||
| 2661 | - | |||||||||||||||||||||||||
| 2662 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2663 | sbuf1[i * 2 + 0] = fetch(s1, x1); | - | ||||||||||||||||||||||||
| 2664 | sbuf1[i * 2 + 1] = fetch(s1, x2); | - | ||||||||||||||||||||||||
| 2665 | sbuf2[i * 2 + 0] = fetch(s2, x1); | - | ||||||||||||||||||||||||
| 2666 | sbuf2[i * 2 + 1] = fetch(s2, x2); | - | ||||||||||||||||||||||||
| 2667 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2668 | - | |||||||||||||||||||||||||
| 2669 | fx += fdx; | - | ||||||||||||||||||||||||
| 2670 | fy += fdy; | - | ||||||||||||||||||||||||
| 2671 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2672 | layout->convertToARGB64PM(buf1, sbuf1, len * 2, layout, clut); | - | ||||||||||||||||||||||||
| 2673 | layout->convertToARGB64PM(buf2, sbuf2, len * 2, layout, clut); | - | ||||||||||||||||||||||||
| 2674 | - | |||||||||||||||||||||||||
| 2675 | for (int i = 0; i < len
| 0 | ||||||||||||||||||||||||
| 2676 | int distx = (fracX & 0x0000ffff); | - | ||||||||||||||||||||||||
| 2677 | int disty = (fracY & 0x0000ffff); | - | ||||||||||||||||||||||||
| 2678 | b[i] = interpolate_4_pixels_rgb64(buf1 + i*2, buf2 + i*2, distx, disty); | - | ||||||||||||||||||||||||
| 2679 | fracX += fdx; | - | ||||||||||||||||||||||||
| 2680 | fracY += fdy; | - | ||||||||||||||||||||||||
| 2681 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2682 | - | |||||||||||||||||||||||||
| 2683 | length -= len; | - | ||||||||||||||||||||||||
| 2684 | b += len; | - | ||||||||||||||||||||||||
| 2685 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2686 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2687 | } else { | - | ||||||||||||||||||||||||
| 2688 | qreal fx = data->m21 * cy + data->m11 * cx + data->dx; | - | ||||||||||||||||||||||||
| 2689 | qreal fy = data->m22 * cy + data->m12 * cx + data->dy; | - | ||||||||||||||||||||||||
| 2690 | qreal fw = data->m23 * cy + data->m13 * cx + data->m33; | - | ||||||||||||||||||||||||
| 2691 | - | |||||||||||||||||||||||||
| 2692 | FetchPixelFunc fetch = qFetchPixel[layout->bpp]; | - | ||||||||||||||||||||||||
| 2693 | uint sbuf1[buffer_size]; | - | ||||||||||||||||||||||||
| 2694 | uint sbuf2[buffer_size]; | - | ||||||||||||||||||||||||
| 2695 | QRgba64 buf1[buffer_size]; | - | ||||||||||||||||||||||||
| 2696 | QRgba64 buf2[buffer_size]; | - | ||||||||||||||||||||||||
| 2697 | QRgba64 *b = buffer; | - | ||||||||||||||||||||||||
| 2698 | - | |||||||||||||||||||||||||
| 2699 | int distxs[buffer_size / 2]; | - | ||||||||||||||||||||||||
| 2700 | int distys[buffer_size / 2]; | - | ||||||||||||||||||||||||
| 2701 | - | |||||||||||||||||||||||||
| 2702 | while (length
| 0 | ||||||||||||||||||||||||
| 2703 | int len = qMin(length, buffer_size / 2); | - | ||||||||||||||||||||||||
| 2704 | for (int i = 0; i < len
| 0 | ||||||||||||||||||||||||
| 2705 | const qreal iw = fw == 0 ? 1 : 1 / fw; | - | ||||||||||||||||||||||||
| 2706 | const qreal px = fx * iw - qreal(0.5); | - | ||||||||||||||||||||||||
| 2707 | const qreal py = fy * iw - qreal(0.5); | - | ||||||||||||||||||||||||
| 2708 | - | |||||||||||||||||||||||||
| 2709 | int x1 = int(px) - (px < 0); | - | ||||||||||||||||||||||||
| 2710 | int x2; | - | ||||||||||||||||||||||||
| 2711 | int y1 = int(py) - (py < 0); | - | ||||||||||||||||||||||||
| 2712 | int y2; | - | ||||||||||||||||||||||||
| 2713 | - | |||||||||||||||||||||||||
| 2714 | distxs[i] = int((px - x1) * (1<<16)); | - | ||||||||||||||||||||||||
| 2715 | distys[i] = int((py - y1) * (1<<16)); | - | ||||||||||||||||||||||||
| 2716 | - | |||||||||||||||||||||||||
| 2717 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - | ||||||||||||||||||||||||
| 2718 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - | ||||||||||||||||||||||||
| 2719 | - | |||||||||||||||||||||||||
| 2720 | const uchar *s1 = data->texture.scanLine(y1); | - | ||||||||||||||||||||||||
| 2721 | const uchar *s2 = data->texture.scanLine(y2); | - | ||||||||||||||||||||||||
| 2722 | - | |||||||||||||||||||||||||
| 2723 | if (layout->bpp == QPixelLayout::BPP32
| 0 | ||||||||||||||||||||||||
| 2724 | sbuf1[i * 2 + 0] = ((const uint*)s1)[x1]; | - | ||||||||||||||||||||||||
| 2725 | sbuf1[i * 2 + 1] = ((const uint*)s1)[x2]; | - | ||||||||||||||||||||||||
| 2726 | sbuf2[i * 2 + 0] = ((const uint*)s2)[x1]; | - | ||||||||||||||||||||||||
| 2727 | sbuf2[i * 2 + 1] = ((const uint*)s2)[x2]; | - | ||||||||||||||||||||||||
| 2728 | - | |||||||||||||||||||||||||
| 2729 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2730 | sbuf1[i * 2 + 0] = fetch(s1, x1); | - | ||||||||||||||||||||||||
| 2731 | sbuf1[i * 2 + 1] = fetch(s1, x2); | - | ||||||||||||||||||||||||
| 2732 | sbuf2[i * 2 + 0] = fetch(s2, x1); | - | ||||||||||||||||||||||||
| 2733 | sbuf2[i * 2 + 1] = fetch(s2, x2); | - | ||||||||||||||||||||||||
| 2734 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2735 | - | |||||||||||||||||||||||||
| 2736 | fx += fdx; | - | ||||||||||||||||||||||||
| 2737 | fy += fdy; | - | ||||||||||||||||||||||||
| 2738 | fw += fdw; | - | ||||||||||||||||||||||||
| 2739 | - | |||||||||||||||||||||||||
| 2740 | if (!fw
| 0 | ||||||||||||||||||||||||
| 2741 | fw += fdw; never executed: fw += fdw; | 0 | ||||||||||||||||||||||||
| 2742 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2743 | - | |||||||||||||||||||||||||
| 2744 | layout->convertToARGB64PM(buf1, sbuf1, len * 2, layout, clut); | - | ||||||||||||||||||||||||
| 2745 | layout->convertToARGB64PM(buf2, sbuf2, len * 2, layout, clut); | - | ||||||||||||||||||||||||
| 2746 | - | |||||||||||||||||||||||||
| 2747 | for (int i = 0; i < len
| 0 | ||||||||||||||||||||||||
| 2748 | int distx = distxs[i]; | - | ||||||||||||||||||||||||
| 2749 | int disty = distys[i]; | - | ||||||||||||||||||||||||
| 2750 | b[i] = interpolate_4_pixels_rgb64(buf1 + i*2, buf2 + i*2, distx, disty); | - | ||||||||||||||||||||||||
| 2751 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2752 | - | |||||||||||||||||||||||||
| 2753 | length -= len; | - | ||||||||||||||||||||||||
| 2754 | b += len; | - | ||||||||||||||||||||||||
| 2755 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2756 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2757 | - | |||||||||||||||||||||||||
| 2758 | return never executed: buffer;return buffer;never executed: return buffer; | 0 | ||||||||||||||||||||||||
| 2759 | } | - | ||||||||||||||||||||||||
| 2760 | - | |||||||||||||||||||||||||
| 2761 | static SourceFetchProc sourceFetch[NBlendTypes][QImage::NImageFormats] = { | - | ||||||||||||||||||||||||
| 2762 | - | |||||||||||||||||||||||||
| 2763 | { | - | ||||||||||||||||||||||||
| 2764 | 0, | - | ||||||||||||||||||||||||
| 2765 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2766 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2767 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2768 | fetchUntransformedARGB32PM, | - | ||||||||||||||||||||||||
| 2769 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2770 | fetchUntransformedARGB32PM, | - | ||||||||||||||||||||||||
| 2771 | fetchUntransformedRGB16, | - | ||||||||||||||||||||||||
| 2772 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2773 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2774 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2775 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2776 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2777 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2778 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2779 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2780 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2781 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2782 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2783 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2784 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2785 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2786 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2787 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2788 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2789 | }, | - | ||||||||||||||||||||||||
| 2790 | - | |||||||||||||||||||||||||
| 2791 | { | - | ||||||||||||||||||||||||
| 2792 | 0, | - | ||||||||||||||||||||||||
| 2793 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2794 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2795 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2796 | fetchUntransformedARGB32PM, | - | ||||||||||||||||||||||||
| 2797 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2798 | fetchUntransformedARGB32PM, | - | ||||||||||||||||||||||||
| 2799 | fetchUntransformedRGB16, | - | ||||||||||||||||||||||||
| 2800 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2801 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2802 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2803 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2804 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2805 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2806 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2807 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2808 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2809 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2810 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2811 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2812 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2813 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2814 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2815 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2816 | fetchUntransformed, | - | ||||||||||||||||||||||||
| 2817 | }, | - | ||||||||||||||||||||||||
| 2818 | - | |||||||||||||||||||||||||
| 2819 | { | - | ||||||||||||||||||||||||
| 2820 | 0, | - | ||||||||||||||||||||||||
| 2821 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2822 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2823 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2824 | fetchTransformedARGB32PM<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2825 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2826 | fetchTransformedARGB32PM<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2827 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2828 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2829 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2830 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2831 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2832 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2833 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2834 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2835 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2836 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2837 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2838 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2839 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2840 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2841 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2842 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2843 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2844 | fetchTransformed<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2845 | }, | - | ||||||||||||||||||||||||
| 2846 | { | - | ||||||||||||||||||||||||
| 2847 | 0, | - | ||||||||||||||||||||||||
| 2848 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2849 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2850 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2851 | fetchTransformedARGB32PM<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2852 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2853 | fetchTransformedARGB32PM<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2854 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2855 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2856 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2857 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2858 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2859 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2860 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2861 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2862 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2863 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2864 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2865 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2866 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2867 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2868 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2869 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2870 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2871 | fetchTransformed<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 2872 | }, | - | ||||||||||||||||||||||||
| 2873 | { | - | ||||||||||||||||||||||||
| 2874 | 0, | - | ||||||||||||||||||||||||
| 2875 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2876 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2877 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2878 | fetchTransformedBilinearARGB32PM<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2879 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2880 | fetchTransformedBilinearARGB32PM<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2881 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2882 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2883 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2884 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2885 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2886 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2887 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2888 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2889 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2890 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2891 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2892 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2893 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2894 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2895 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2896 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2897 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2898 | fetchTransformedBilinear<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 2899 | }, | - | ||||||||||||||||||||||||
| 2900 | { | - | ||||||||||||||||||||||||
| 2901 | 0, | - | ||||||||||||||||||||||||
| 2902 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2903 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2904 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2905 | fetchTransformedBilinearARGB32PM<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2906 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2907 | fetchTransformedBilinearARGB32PM<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2908 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2909 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2910 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2911 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2912 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2913 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2914 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2915 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2916 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2917 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2918 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2919 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2920 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2921 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2922 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2923 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2924 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2925 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 2926 | }, | - | ||||||||||||||||||||||||
| 2927 | }; | - | ||||||||||||||||||||||||
| 2928 | - | |||||||||||||||||||||||||
| 2929 | static SourceFetchProc64 sourceFetch64[NBlendTypes][QImage::NImageFormats] = { | - | ||||||||||||||||||||||||
| 2930 | - | |||||||||||||||||||||||||
| 2931 | { | - | ||||||||||||||||||||||||
| 2932 | 0, | - | ||||||||||||||||||||||||
| 2933 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2934 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2935 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2936 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2937 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2938 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2939 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2940 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2941 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2942 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2943 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2944 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2945 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2946 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2947 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2948 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2949 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2950 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2951 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2952 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2953 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2954 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2955 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2956 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2957 | }, | - | ||||||||||||||||||||||||
| 2958 | - | |||||||||||||||||||||||||
| 2959 | { | - | ||||||||||||||||||||||||
| 2960 | 0, | - | ||||||||||||||||||||||||
| 2961 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2962 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2963 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2964 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2965 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2966 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2967 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2968 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2969 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2970 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2971 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2972 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2973 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2974 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2975 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2976 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2977 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2978 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2979 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2980 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2981 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2982 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2983 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2984 | fetchUntransformed64, | - | ||||||||||||||||||||||||
| 2985 | }, | - | ||||||||||||||||||||||||
| 2986 | - | |||||||||||||||||||||||||
| 2987 | { | - | ||||||||||||||||||||||||
| 2988 | 0, | - | ||||||||||||||||||||||||
| 2989 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2990 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2991 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2992 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2993 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2994 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2995 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2996 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2997 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2998 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 2999 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 3000 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 3001 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 3002 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 3003 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 3004 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 3005 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 3006 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 3007 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 3008 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 3009 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 3010 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 3011 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 3012 | fetchTransformed64<BlendTransformed>, | - | ||||||||||||||||||||||||
| 3013 | }, | - | ||||||||||||||||||||||||
| 3014 | { | - | ||||||||||||||||||||||||
| 3015 | 0, | - | ||||||||||||||||||||||||
| 3016 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3017 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3018 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3019 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3020 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3021 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3022 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3023 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3024 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3025 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3026 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3027 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3028 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3029 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3030 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3031 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3032 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3033 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3034 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3035 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3036 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3037 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3038 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3039 | fetchTransformed64<BlendTransformedTiled>, | - | ||||||||||||||||||||||||
| 3040 | }, | - | ||||||||||||||||||||||||
| 3041 | { | - | ||||||||||||||||||||||||
| 3042 | 0, | - | ||||||||||||||||||||||||
| 3043 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3044 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3045 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3046 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3047 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3048 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3049 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3050 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3051 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3052 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3053 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3054 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3055 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3056 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3057 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3058 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3059 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3060 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3061 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3062 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3063 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3064 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3065 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3066 | fetchTransformedBilinear64<BlendTransformedBilinear>, | - | ||||||||||||||||||||||||
| 3067 | }, | - | ||||||||||||||||||||||||
| 3068 | { | - | ||||||||||||||||||||||||
| 3069 | 0, | - | ||||||||||||||||||||||||
| 3070 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3071 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3072 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3073 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3074 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3075 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3076 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3077 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3078 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3079 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3080 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3081 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3082 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3083 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3084 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3085 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3086 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3087 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3088 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3089 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3090 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3091 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3092 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3093 | fetchTransformedBilinear64<BlendTransformedBilinearTiled>, | - | ||||||||||||||||||||||||
| 3094 | }, | - | ||||||||||||||||||||||||
| 3095 | }; | - | ||||||||||||||||||||||||
| 3096 | - | |||||||||||||||||||||||||
| 3097 | - | |||||||||||||||||||||||||
| 3098 | - | |||||||||||||||||||||||||
| 3099 | - | |||||||||||||||||||||||||
| 3100 | static uint qt_gradient_pixel_fixed(const QGradientData *data, int fixed_pos) | - | ||||||||||||||||||||||||
| 3101 | { | - | ||||||||||||||||||||||||
| 3102 | int ipos = (fixed_pos + ((1<<8) / 2)) >> 8; | - | ||||||||||||||||||||||||
| 3103 | return never executed: data->colorTable32[qt_gradient_clamp(data, ipos)];return data->colorTable32[qt_gradient_clamp(data, ipos)];never executed: return data->colorTable32[qt_gradient_clamp(data, ipos)]; | 0 | ||||||||||||||||||||||||
| 3104 | } | - | ||||||||||||||||||||||||
| 3105 | - | |||||||||||||||||||||||||
| 3106 | static const QRgba64& qt_gradient_pixel64_fixed(const QGradientData *data, int fixed_pos) | - | ||||||||||||||||||||||||
| 3107 | { | - | ||||||||||||||||||||||||
| 3108 | int ipos = (fixed_pos + ((1<<8) / 2)) >> 8; | - | ||||||||||||||||||||||||
| 3109 | return never executed: data->colorTable64[qt_gradient_clamp(data, ipos)];return data->colorTable64[qt_gradient_clamp(data, ipos)];never executed: return data->colorTable64[qt_gradient_clamp(data, ipos)]; | 0 | ||||||||||||||||||||||||
| 3110 | } | - | ||||||||||||||||||||||||
| 3111 | - | |||||||||||||||||||||||||
| 3112 | static void getLinearGradientValues(LinearGradientValues *v, const QSpanData *data) | - | ||||||||||||||||||||||||
| 3113 | { | - | ||||||||||||||||||||||||
| 3114 | v->dx = data->gradient.linear.end.x - data->gradient.linear.origin.x; | - | ||||||||||||||||||||||||
| 3115 | v->dy = data->gradient.linear.end.y - data->gradient.linear.origin.y; | - | ||||||||||||||||||||||||
| 3116 | v->l = v->dx * v->dx + v->dy * v->dy; | - | ||||||||||||||||||||||||
| 3117 | v->off = 0; | - | ||||||||||||||||||||||||
| 3118 | if (v->l != 0
| 0 | ||||||||||||||||||||||||
| 3119 | v->dx /= v->l; | - | ||||||||||||||||||||||||
| 3120 | v->dy /= v->l; | - | ||||||||||||||||||||||||
| 3121 | v->off = -v->dx * data->gradient.linear.origin.x - v->dy * data->gradient.linear.origin.y; | - | ||||||||||||||||||||||||
| 3122 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3123 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3124 | - | |||||||||||||||||||||||||
| 3125 | class GradientBase32 | - | ||||||||||||||||||||||||
| 3126 | { | - | ||||||||||||||||||||||||
| 3127 | public: | - | ||||||||||||||||||||||||
| 3128 | typedef uint Type; | - | ||||||||||||||||||||||||
| 3129 | static Type null() { return never executed: 0;return 0;never executed: }return 0; | 0 | ||||||||||||||||||||||||
| 3130 | static Type fetchSingle(const QGradientData& gradient, qreal v) | - | ||||||||||||||||||||||||
| 3131 | { | - | ||||||||||||||||||||||||
| 3132 | return never executed: qt_gradient_pixel(&gradient, v);return qt_gradient_pixel(&gradient, v);never executed: return qt_gradient_pixel(&gradient, v); | 0 | ||||||||||||||||||||||||
| 3133 | } | - | ||||||||||||||||||||||||
| 3134 | static Type fetchSingle(const QGradientData& gradient, int v) | - | ||||||||||||||||||||||||
| 3135 | { | - | ||||||||||||||||||||||||
| 3136 | return never executed: qt_gradient_pixel_fixed(&gradient, v);return qt_gradient_pixel_fixed(&gradient, v);never executed: return qt_gradient_pixel_fixed(&gradient, v); | 0 | ||||||||||||||||||||||||
| 3137 | } | - | ||||||||||||||||||||||||
| 3138 | static void memfill(Type *buffer, Type fill, int length) | - | ||||||||||||||||||||||||
| 3139 | { | - | ||||||||||||||||||||||||
| 3140 | qt_memfill32(buffer, fill, length); | - | ||||||||||||||||||||||||
| 3141 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3142 | }; | - | ||||||||||||||||||||||||
| 3143 | - | |||||||||||||||||||||||||
| 3144 | class GradientBase64 | - | ||||||||||||||||||||||||
| 3145 | { | - | ||||||||||||||||||||||||
| 3146 | public: | - | ||||||||||||||||||||||||
| 3147 | typedef QRgba64 Type; | - | ||||||||||||||||||||||||
| 3148 | static Type null() { return never executed: QRgba64::fromRgba64(0);return QRgba64::fromRgba64(0);never executed: }return QRgba64::fromRgba64(0); | 0 | ||||||||||||||||||||||||
| 3149 | static Type fetchSingle(const QGradientData& gradient, qreal v) | - | ||||||||||||||||||||||||
| 3150 | { | - | ||||||||||||||||||||||||
| 3151 | return never executed: qt_gradient_pixel64(&gradient, v);return qt_gradient_pixel64(&gradient, v);never executed: return qt_gradient_pixel64(&gradient, v); | 0 | ||||||||||||||||||||||||
| 3152 | } | - | ||||||||||||||||||||||||
| 3153 | static Type fetchSingle(const QGradientData& gradient, int v) | - | ||||||||||||||||||||||||
| 3154 | { | - | ||||||||||||||||||||||||
| 3155 | return never executed: qt_gradient_pixel64_fixed(&gradient, v);return qt_gradient_pixel64_fixed(&gradient, v);never executed: return qt_gradient_pixel64_fixed(&gradient, v); | 0 | ||||||||||||||||||||||||
| 3156 | } | - | ||||||||||||||||||||||||
| 3157 | static void memfill(Type *buffer, Type fill, int length) | - | ||||||||||||||||||||||||
| 3158 | { | - | ||||||||||||||||||||||||
| 3159 | qt_memfill64((quint64*)buffer, fill, length); | - | ||||||||||||||||||||||||
| 3160 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3161 | }; | - | ||||||||||||||||||||||||
| 3162 | - | |||||||||||||||||||||||||
| 3163 | template<class GradientBase, typename BlendType> | - | ||||||||||||||||||||||||
| 3164 | static inline const BlendType * qt_fetch_linear_gradient_template( | - | ||||||||||||||||||||||||
| 3165 | BlendType *buffer, const Operator *op, const QSpanData *data, | - | ||||||||||||||||||||||||
| 3166 | int y, int x, int length) | - | ||||||||||||||||||||||||
| 3167 | { | - | ||||||||||||||||||||||||
| 3168 | const BlendType *b = buffer; | - | ||||||||||||||||||||||||
| 3169 | qreal t, inc; | - | ||||||||||||||||||||||||
| 3170 | - | |||||||||||||||||||||||||
| 3171 | bool affine = true; | - | ||||||||||||||||||||||||
| 3172 | qreal rx=0, ry=0; | - | ||||||||||||||||||||||||
| 3173 | if (op->linear.l == 0
| 0 | ||||||||||||||||||||||||
| 3174 | t = inc = 0; | - | ||||||||||||||||||||||||
| 3175 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 3176 | rx = data->m21 * (y + qreal(0.5)) + data->m11 * (x + qreal(0.5)) + data->dx; | - | ||||||||||||||||||||||||
| 3177 | ry = data->m22 * (y + qreal(0.5)) + data->m12 * (x + qreal(0.5)) + data->dy; | - | ||||||||||||||||||||||||
| 3178 | t = op->linear.dx*rx + op->linear.dy*ry + op->linear.off; | - | ||||||||||||||||||||||||
| 3179 | inc = op->linear.dx * data->m11 + op->linear.dy * data->m12; | - | ||||||||||||||||||||||||
| 3180 | affine = !data->m13
| 0 | ||||||||||||||||||||||||
| 3181 | - | |||||||||||||||||||||||||
| 3182 | if (affine
| 0 | ||||||||||||||||||||||||
| 3183 | t *= (1024 - 1); | - | ||||||||||||||||||||||||
| 3184 | inc *= (1024 - 1); | - | ||||||||||||||||||||||||
| 3185 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3186 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3187 | - | |||||||||||||||||||||||||
| 3188 | const BlendType *end = buffer + length; | - | ||||||||||||||||||||||||
| 3189 | if (affine
| 0 | ||||||||||||||||||||||||
| 3190 | if (inc > qreal(-1e-5)
| 0 | ||||||||||||||||||||||||
| 3191 | GradientBase::memfill(buffer, GradientBase::fetchSingle(data->gradient, int(t * (1<<8))), length); | - | ||||||||||||||||||||||||
| 3192 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 3193 | if (t+inc*length < qreal(2147483647 >> (8 + 1))
| 0 | ||||||||||||||||||||||||
| 3194 | t+inc*length > qreal((-2147483647 - 1) >> (8 + 1))
| 0 | ||||||||||||||||||||||||
| 3195 | - | |||||||||||||||||||||||||
| 3196 | int t_fixed = int(t * (1<<8)); | - | ||||||||||||||||||||||||
| 3197 | int inc_fixed = int(inc * (1<<8)); | - | ||||||||||||||||||||||||
| 3198 | while (buffer < end
| 0 | ||||||||||||||||||||||||
| 3199 | *buffer = GradientBase::fetchSingle(data->gradient, t_fixed); | - | ||||||||||||||||||||||||
| 3200 | t_fixed += inc_fixed; | - | ||||||||||||||||||||||||
| 3201 | ++buffer; | - | ||||||||||||||||||||||||
| 3202 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3203 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 3204 | - | |||||||||||||||||||||||||
| 3205 | while (buffer < end
| 0 | ||||||||||||||||||||||||
| 3206 | *buffer = GradientBase::fetchSingle(data->gradient, t/1024); | - | ||||||||||||||||||||||||
| 3207 | t += inc; | - | ||||||||||||||||||||||||
| 3208 | ++buffer; | - | ||||||||||||||||||||||||
| 3209 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3210 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3211 | } | - | ||||||||||||||||||||||||
| 3212 | } else { | - | ||||||||||||||||||||||||
| 3213 | qreal rw = data->m23 * (y + qreal(0.5)) + data->m13 * (x + qreal(0.5)) + data->m33; | - | ||||||||||||||||||||||||
| 3214 | while (buffer < end
| 0 | ||||||||||||||||||||||||
| 3215 | qreal x = rx/rw; | - | ||||||||||||||||||||||||
| 3216 | qreal y = ry/rw; | - | ||||||||||||||||||||||||
| 3217 | t = (op->linear.dx*x + op->linear.dy *y) + op->linear.off; | - | ||||||||||||||||||||||||
| 3218 | - | |||||||||||||||||||||||||
| 3219 | *buffer = GradientBase::fetchSingle(data->gradient, t); | - | ||||||||||||||||||||||||
| 3220 | rx += data->m11; | - | ||||||||||||||||||||||||
| 3221 | ry += data->m12; | - | ||||||||||||||||||||||||
| 3222 | rw += data->m13; | - | ||||||||||||||||||||||||
| 3223 | if (!rw
| 0 | ||||||||||||||||||||||||
| 3224 | rw += data->m13; | - | ||||||||||||||||||||||||
| 3225 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3226 | ++buffer; | - | ||||||||||||||||||||||||
| 3227 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3228 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3229 | - | |||||||||||||||||||||||||
| 3230 | return never executed: b;return b;never executed: return b; | 0 | ||||||||||||||||||||||||
| 3231 | } | - | ||||||||||||||||||||||||
| 3232 | - | |||||||||||||||||||||||||
| 3233 | static const uint * qt_fetch_linear_gradient(uint *buffer, const Operator *op, const QSpanData *data, | - | ||||||||||||||||||||||||
| 3234 | int y, int x, int length) | - | ||||||||||||||||||||||||
| 3235 | { | - | ||||||||||||||||||||||||
| 3236 | return never executed: qt_fetch_linear_gradient_template<GradientBase32, uint>(buffer, op, data, y, x, length);return qt_fetch_linear_gradient_template<GradientBase32, uint>(buffer, op, data, y, x, length);never executed: return qt_fetch_linear_gradient_template<GradientBase32, uint>(buffer, op, data, y, x, length); | 0 | ||||||||||||||||||||||||
| 3237 | } | - | ||||||||||||||||||||||||
| 3238 | - | |||||||||||||||||||||||||
| 3239 | static const QRgba64 * qt_fetch_linear_gradient_rgb64(QRgba64 *buffer, const Operator *op, const QSpanData *data, | - | ||||||||||||||||||||||||
| 3240 | int y, int x, int length) | - | ||||||||||||||||||||||||
| 3241 | { | - | ||||||||||||||||||||||||
| 3242 | return never executed: qt_fetch_linear_gradient_template<GradientBase64, QRgba64>(buffer, op, data, y, x, length);return qt_fetch_linear_gradient_template<GradientBase64, QRgba64>(buffer, op, data, y, x, length);never executed: return qt_fetch_linear_gradient_template<GradientBase64, QRgba64>(buffer, op, data, y, x, length); | 0 | ||||||||||||||||||||||||
| 3243 | } | - | ||||||||||||||||||||||||
| 3244 | - | |||||||||||||||||||||||||
| 3245 | static void getRadialGradientValues(RadialGradientValues *v, const QSpanData *data) | - | ||||||||||||||||||||||||
| 3246 | { | - | ||||||||||||||||||||||||
| 3247 | v->dx = data->gradient.radial.center.x - data->gradient.radial.focal.x; | - | ||||||||||||||||||||||||
| 3248 | v->dy = data->gradient.radial.center.y - data->gradient.radial.focal.y; | - | ||||||||||||||||||||||||
| 3249 | - | |||||||||||||||||||||||||
| 3250 | v->dr = data->gradient.radial.center.radius - data->gradient.radial.focal.radius; | - | ||||||||||||||||||||||||
| 3251 | v->sqrfr = data->gradient.radial.focal.radius * data->gradient.radial.focal.radius; | - | ||||||||||||||||||||||||
| 3252 | - | |||||||||||||||||||||||||
| 3253 | v->a = v->dr * v->dr - v->dx*v->dx - v->dy*v->dy; | - | ||||||||||||||||||||||||
| 3254 | v->inv2a = 1 / (2 * v->a); | - | ||||||||||||||||||||||||
| 3255 | - | |||||||||||||||||||||||||
| 3256 | v->extended = !qFuzzyIsNull(data->gradient.radial.focal.radius)
| 0 | ||||||||||||||||||||||||
| 3257 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3258 | - | |||||||||||||||||||||||||
| 3259 | template <class GradientBase> | - | ||||||||||||||||||||||||
| 3260 | class RadialFetchPlain : public GradientBase | - | ||||||||||||||||||||||||
| 3261 | { | - | ||||||||||||||||||||||||
| 3262 | public: | - | ||||||||||||||||||||||||
| 3263 | typedef typename GradientBase::Type BlendType; | - | ||||||||||||||||||||||||
| 3264 | static void fetch(BlendType *buffer, BlendType *end, | - | ||||||||||||||||||||||||
| 3265 | const Operator *op, const QSpanData *data, qreal det, | - | ||||||||||||||||||||||||
| 3266 | qreal delta_det, qreal delta_delta_det, qreal b, qreal delta_b) | - | ||||||||||||||||||||||||
| 3267 | { | - | ||||||||||||||||||||||||
| 3268 | if (op->radial.extended
| 0 | ||||||||||||||||||||||||
| 3269 | while (buffer < end
| 0 | ||||||||||||||||||||||||
| 3270 | BlendType result = GradientBase::null(); | - | ||||||||||||||||||||||||
| 3271 | if (det >= 0
| 0 | ||||||||||||||||||||||||
| 3272 | qreal w = qSqrt(det) - b; | - | ||||||||||||||||||||||||
| 3273 | if (data->gradient.radial.focal.radius + op->radial.dr * w >= 0
| 0 | ||||||||||||||||||||||||
| 3274 | result = GradientBase::fetchSingle(data->gradient, w); never executed: result = GradientBase::fetchSingle(data->gradient, w); | 0 | ||||||||||||||||||||||||
| 3275 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3276 | - | |||||||||||||||||||||||||
| 3277 | *buffer = result; | - | ||||||||||||||||||||||||
| 3278 | - | |||||||||||||||||||||||||
| 3279 | det += delta_det; | - | ||||||||||||||||||||||||
| 3280 | delta_det += delta_delta_det; | - | ||||||||||||||||||||||||
| 3281 | b += delta_b; | - | ||||||||||||||||||||||||
| 3282 | - | |||||||||||||||||||||||||
| 3283 | ++buffer; | - | ||||||||||||||||||||||||
| 3284 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3285 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 3286 | while (buffer < end
| 0 | ||||||||||||||||||||||||
| 3287 | *buffer++ = GradientBase::fetchSingle(data->gradient, qSqrt(det) - b); | - | ||||||||||||||||||||||||
| 3288 | - | |||||||||||||||||||||||||
| 3289 | det += delta_det; | - | ||||||||||||||||||||||||
| 3290 | delta_det += delta_delta_det; | - | ||||||||||||||||||||||||
| 3291 | b += delta_b; | - | ||||||||||||||||||||||||
| 3292 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3293 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3294 | } | - | ||||||||||||||||||||||||
| 3295 | }; | - | ||||||||||||||||||||||||
| 3296 | - | |||||||||||||||||||||||||
| 3297 | const uint * qt_fetch_radial_gradient_plain(uint *buffer, const Operator *op, const QSpanData *data, | - | ||||||||||||||||||||||||
| 3298 | int y, int x, int length) | - | ||||||||||||||||||||||||
| 3299 | { | - | ||||||||||||||||||||||||
| 3300 | return never executed: qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase32>, uint>(buffer, op, data, y, x, length);return qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase32>, uint>(buffer, op, data, y, x, length);never executed: return qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase32>, uint>(buffer, op, data, y, x, length); | 0 | ||||||||||||||||||||||||
| 3301 | } | - | ||||||||||||||||||||||||
| 3302 | - | |||||||||||||||||||||||||
| 3303 | static SourceFetchProc qt_fetch_radial_gradient = qt_fetch_radial_gradient_plain; | - | ||||||||||||||||||||||||
| 3304 | - | |||||||||||||||||||||||||
| 3305 | const QRgba64 * qt_fetch_radial_gradient_rgb64(QRgba64 *buffer, const Operator *op, const QSpanData *data, | - | ||||||||||||||||||||||||
| 3306 | int y, int x, int length) | - | ||||||||||||||||||||||||
| 3307 | { | - | ||||||||||||||||||||||||
| 3308 | return never executed: qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase64>, QRgba64>(buffer, op, data, y, x, length);return qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase64>, QRgba64>(buffer, op, data, y, x, length);never executed: return qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase64>, QRgba64>(buffer, op, data, y, x, length); | 0 | ||||||||||||||||||||||||
| 3309 | } | - | ||||||||||||||||||||||||
| 3310 | - | |||||||||||||||||||||||||
| 3311 | template <class GradientBase, typename BlendType> | - | ||||||||||||||||||||||||
| 3312 | static inline const BlendType * qt_fetch_conical_gradient_template( | - | ||||||||||||||||||||||||
| 3313 | BlendType *buffer, const QSpanData *data, | - | ||||||||||||||||||||||||
| 3314 | int y, int x, int length) | - | ||||||||||||||||||||||||
| 3315 | { | - | ||||||||||||||||||||||||
| 3316 | const BlendType *b = buffer; | - | ||||||||||||||||||||||||
| 3317 | qreal rx = data->m21 * (y + qreal(0.5)) | - | ||||||||||||||||||||||||
| 3318 | + data->dx + data->m11 * (x + qreal(0.5)); | - | ||||||||||||||||||||||||
| 3319 | qreal ry = data->m22 * (y + qreal(0.5)) | - | ||||||||||||||||||||||||
| 3320 | + data->dy + data->m12 * (x + qreal(0.5)); | - | ||||||||||||||||||||||||
| 3321 | bool affine = !data->m13
| 0 | ||||||||||||||||||||||||
| 3322 | - | |||||||||||||||||||||||||
| 3323 | const qreal inv2pi = 0.31830988618379067154 / 2.0; | - | ||||||||||||||||||||||||
| 3324 | - | |||||||||||||||||||||||||
| 3325 | const BlendType *end = buffer + length; | - | ||||||||||||||||||||||||
| 3326 | if (affine
| 0 | ||||||||||||||||||||||||
| 3327 | rx -= data->gradient.conical.center.x; | - | ||||||||||||||||||||||||
| 3328 | ry -= data->gradient.conical.center.y; | - | ||||||||||||||||||||||||
| 3329 | while (buffer < end
| 0 | ||||||||||||||||||||||||
| 3330 | qreal angle = qAtan2(ry, rx) + data->gradient.conical.angle; | - | ||||||||||||||||||||||||
| 3331 | - | |||||||||||||||||||||||||
| 3332 | *buffer = GradientBase::fetchSingle(data->gradient, 1 - angle * inv2pi); | - | ||||||||||||||||||||||||
| 3333 | - | |||||||||||||||||||||||||
| 3334 | rx += data->m11; | - | ||||||||||||||||||||||||
| 3335 | ry += data->m12; | - | ||||||||||||||||||||||||
| 3336 | ++buffer; | - | ||||||||||||||||||||||||
| 3337 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3338 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 3339 | qreal rw = data->m23 * (y + qreal(0.5)) | - | ||||||||||||||||||||||||
| 3340 | + data->m33 + data->m13 * (x + qreal(0.5)); | - | ||||||||||||||||||||||||
| 3341 | if (!rw
| 0 | ||||||||||||||||||||||||
| 3342 | rw = 1; never executed: rw = 1; | 0 | ||||||||||||||||||||||||
| 3343 | while (buffer < end
| 0 | ||||||||||||||||||||||||
| 3344 | qreal angle = qAtan2(ry/rw - data->gradient.conical.center.x, | - | ||||||||||||||||||||||||
| 3345 | rx/rw - data->gradient.conical.center.y) | - | ||||||||||||||||||||||||
| 3346 | + data->gradient.conical.angle; | - | ||||||||||||||||||||||||
| 3347 | - | |||||||||||||||||||||||||
| 3348 | *buffer = GradientBase::fetchSingle(data->gradient, 1 - angle * inv2pi); | - | ||||||||||||||||||||||||
| 3349 | - | |||||||||||||||||||||||||
| 3350 | rx += data->m11; | - | ||||||||||||||||||||||||
| 3351 | ry += data->m12; | - | ||||||||||||||||||||||||
| 3352 | rw += data->m13; | - | ||||||||||||||||||||||||
| 3353 | if (!rw
| 0 | ||||||||||||||||||||||||
| 3354 | rw += data->m13; | - | ||||||||||||||||||||||||
| 3355 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3356 | ++buffer; | - | ||||||||||||||||||||||||
| 3357 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3358 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3359 | return never executed: b;return b;never executed: return b; | 0 | ||||||||||||||||||||||||
| 3360 | } | - | ||||||||||||||||||||||||
| 3361 | - | |||||||||||||||||||||||||
| 3362 | static const uint * qt_fetch_conical_gradient(uint *buffer, const Operator *, const QSpanData *data, | - | ||||||||||||||||||||||||
| 3363 | int y, int x, int length) | - | ||||||||||||||||||||||||
| 3364 | { | - | ||||||||||||||||||||||||
| 3365 | return never executed: qt_fetch_conical_gradient_template<GradientBase32, uint>(buffer, data, y, x, length);return qt_fetch_conical_gradient_template<GradientBase32, uint>(buffer, data, y, x, length);never executed: return qt_fetch_conical_gradient_template<GradientBase32, uint>(buffer, data, y, x, length); | 0 | ||||||||||||||||||||||||
| 3366 | } | - | ||||||||||||||||||||||||
| 3367 | - | |||||||||||||||||||||||||
| 3368 | static const QRgba64 * qt_fetch_conical_gradient_rgb64(QRgba64 *buffer, const Operator *, const QSpanData *data, | - | ||||||||||||||||||||||||
| 3369 | int y, int x, int length) | - | ||||||||||||||||||||||||
| 3370 | { | - | ||||||||||||||||||||||||
| 3371 | return never executed: qt_fetch_conical_gradient_template<GradientBase64, QRgba64>(buffer, data, y, x, length);return qt_fetch_conical_gradient_template<GradientBase64, QRgba64>(buffer, data, y, x, length);never executed: return qt_fetch_conical_gradient_template<GradientBase64, QRgba64>(buffer, data, y, x, length); | 0 | ||||||||||||||||||||||||
| 3372 | } | - | ||||||||||||||||||||||||
| 3373 | - | |||||||||||||||||||||||||
| 3374 | extern CompositionFunctionSolid qt_functionForModeSolid_C[]; | - | ||||||||||||||||||||||||
| 3375 | extern CompositionFunctionSolid64 qt_functionForModeSolid64_C[]; | - | ||||||||||||||||||||||||
| 3376 | - | |||||||||||||||||||||||||
| 3377 | static const CompositionFunctionSolid *functionForModeSolid = qt_functionForModeSolid_C; | - | ||||||||||||||||||||||||
| 3378 | static const CompositionFunctionSolid64 *functionForModeSolid64 = qt_functionForModeSolid64_C; | - | ||||||||||||||||||||||||
| 3379 | - | |||||||||||||||||||||||||
| 3380 | extern CompositionFunction qt_functionForMode_C[]; | - | ||||||||||||||||||||||||
| 3381 | extern CompositionFunction64 qt_functionForMode64_C[]; | - | ||||||||||||||||||||||||
| 3382 | - | |||||||||||||||||||||||||
| 3383 | static const CompositionFunction *functionForMode = qt_functionForMode_C; | - | ||||||||||||||||||||||||
| 3384 | static const CompositionFunction64 *functionForMode64 = qt_functionForMode64_C; | - | ||||||||||||||||||||||||
| 3385 | - | |||||||||||||||||||||||||
| 3386 | static TextureBlendType getBlendType(const QSpanData *data) | - | ||||||||||||||||||||||||
| 3387 | { | - | ||||||||||||||||||||||||
| 3388 | TextureBlendType ft; | - | ||||||||||||||||||||||||
| 3389 | if (data->txop <= QTransform::TxTranslate
| 0 | ||||||||||||||||||||||||
| 3390 | if (data->texture.type == QTextureData::Tiled
| 0 | ||||||||||||||||||||||||
| 3391 | ft = BlendTiled; never executed: ft = BlendTiled; | 0 | ||||||||||||||||||||||||
| 3392 | else | - | ||||||||||||||||||||||||
| 3393 | ft = BlendUntransformed; never executed: ft = BlendUntransformed; | 0 | ||||||||||||||||||||||||
| 3394 | else if (data->bilinear
| 0 | ||||||||||||||||||||||||
| 3395 | if (data->texture.type == QTextureData::Tiled
| 0 | ||||||||||||||||||||||||
| 3396 | ft = BlendTransformedBilinearTiled; never executed: ft = BlendTransformedBilinearTiled; | 0 | ||||||||||||||||||||||||
| 3397 | else | - | ||||||||||||||||||||||||
| 3398 | ft = BlendTransformedBilinear; never executed: ft = BlendTransformedBilinear; | 0 | ||||||||||||||||||||||||
| 3399 | else | - | ||||||||||||||||||||||||
| 3400 | if (data->texture.type == QTextureData::Tiled
| 0 | ||||||||||||||||||||||||
| 3401 | ft = BlendTransformedTiled; never executed: ft = BlendTransformedTiled; | 0 | ||||||||||||||||||||||||
| 3402 | else | - | ||||||||||||||||||||||||
| 3403 | ft = BlendTransformed; never executed: ft = BlendTransformed; | 0 | ||||||||||||||||||||||||
| 3404 | return never executed: ft;return ft;never executed: return ft; | 0 | ||||||||||||||||||||||||
| 3405 | } | - | ||||||||||||||||||||||||
| 3406 | - | |||||||||||||||||||||||||
| 3407 | static inline Operator getOperator(const QSpanData *data, const QSpan *spans, int spanCount) | - | ||||||||||||||||||||||||
| 3408 | { | - | ||||||||||||||||||||||||
| 3409 | Operator op; | - | ||||||||||||||||||||||||
| 3410 | bool solidSource = false; | - | ||||||||||||||||||||||||
| 3411 | - | |||||||||||||||||||||||||
| 3412 | switch(data->type) { | - | ||||||||||||||||||||||||
| 3413 | case never executed: QSpanData::Solid:case QSpanData::Solid:never executed: case QSpanData::Solid: | 0 | ||||||||||||||||||||||||
| 3414 | solidSource = data->solid.color.isOpaque(); | - | ||||||||||||||||||||||||
| 3415 | op.srcFetch = 0; | - | ||||||||||||||||||||||||
| 3416 | op.srcFetch64 = 0; | - | ||||||||||||||||||||||||
| 3417 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3418 | case never executed: QSpanData::LinearGradient:case QSpanData::LinearGradient:never executed: case QSpanData::LinearGradient: | 0 | ||||||||||||||||||||||||
| 3419 | solidSource = !data->gradient.alphaColor; | - | ||||||||||||||||||||||||
| 3420 | getLinearGradientValues(&op.linear, data); | - | ||||||||||||||||||||||||
| 3421 | op.srcFetch = qt_fetch_linear_gradient; | - | ||||||||||||||||||||||||
| 3422 | op.srcFetch64 = qt_fetch_linear_gradient_rgb64; | - | ||||||||||||||||||||||||
| 3423 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3424 | case never executed: QSpanData::RadialGradient:case QSpanData::RadialGradient:never executed: case QSpanData::RadialGradient: | 0 | ||||||||||||||||||||||||
| 3425 | solidSource = !data->gradient.alphaColor; | - | ||||||||||||||||||||||||
| 3426 | getRadialGradientValues(&op.radial, data); | - | ||||||||||||||||||||||||
| 3427 | op.srcFetch = qt_fetch_radial_gradient; | - | ||||||||||||||||||||||||
| 3428 | op.srcFetch64 = qt_fetch_radial_gradient_rgb64; | - | ||||||||||||||||||||||||
| 3429 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3430 | case never executed: QSpanData::ConicalGradient:case QSpanData::ConicalGradient:never executed: case QSpanData::ConicalGradient: | 0 | ||||||||||||||||||||||||
| 3431 | solidSource = !data->gradient.alphaColor; | - | ||||||||||||||||||||||||
| 3432 | op.srcFetch = qt_fetch_conical_gradient; | - | ||||||||||||||||||||||||
| 3433 | op.srcFetch64 = qt_fetch_conical_gradient_rgb64; | - | ||||||||||||||||||||||||
| 3434 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3435 | case never executed: QSpanData::Texture:case QSpanData::Texture:never executed: case QSpanData::Texture: | 0 | ||||||||||||||||||||||||
| 3436 | solidSource = !data->texture.hasAlpha; | - | ||||||||||||||||||||||||
| 3437 | op.srcFetch = sourceFetch[getBlendType(data)][data->texture.format]; | - | ||||||||||||||||||||||||
| 3438 | op.srcFetch64 = sourceFetch64[getBlendType(data)][data->texture.format]; | - | ||||||||||||||||||||||||
| 3439 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3440 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 3441 | do { ((!(false)) ? qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached",__FILE__,3780) : qt_noop()); __builtin_unreachable(); } while (0); | - | ||||||||||||||||||||||||
| 3442 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3443 | } | - | ||||||||||||||||||||||||
| 3444 | - | |||||||||||||||||||||||||
| 3445 | op.mode = data->rasterBuffer->compositionMode; | - | ||||||||||||||||||||||||
| 3446 | if (op.mode == QPainter::CompositionMode_SourceOver
| 0 | ||||||||||||||||||||||||
| 3447 | op.mode = QPainter::CompositionMode_Source; never executed: op.mode = QPainter::CompositionMode_Source; | 0 | ||||||||||||||||||||||||
| 3448 | - | |||||||||||||||||||||||||
| 3449 | op.destFetch = destFetchProc[data->rasterBuffer->format]; | - | ||||||||||||||||||||||||
| 3450 | op.destFetch64 = destFetchProc64[data->rasterBuffer->format]; | - | ||||||||||||||||||||||||
| 3451 | if (op.mode == QPainter::CompositionMode_Source
| 0 | ||||||||||||||||||||||||
| 3452 | switch (data->rasterBuffer->format) { | - | ||||||||||||||||||||||||
| 3453 | case never executed: QImage::Format_RGB32:case QImage::Format_RGB32:never executed: case QImage::Format_RGB32: | 0 | ||||||||||||||||||||||||
| 3454 | case never executed: QImage::Format_ARGB32_Premultiplied:case QImage::Format_ARGB32_Premultiplied:never executed: case QImage::Format_ARGB32_Premultiplied: | 0 | ||||||||||||||||||||||||
| 3455 | - | |||||||||||||||||||||||||
| 3456 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3457 | default never executed: :default:never executed: {default: | 0 | ||||||||||||||||||||||||
| 3458 | if (data->type == QSpanData::Texture
| 0 | ||||||||||||||||||||||||
| 3459 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3460 | const QSpan *lastSpan = spans + spanCount; | - | ||||||||||||||||||||||||
| 3461 | bool alphaSpans = false; | - | ||||||||||||||||||||||||
| 3462 | while (spans < lastSpan
| 0 | ||||||||||||||||||||||||
| 3463 | if (spans->coverage != 255
| 0 | ||||||||||||||||||||||||
| 3464 | alphaSpans = true; | - | ||||||||||||||||||||||||
| 3465 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3466 | } | - | ||||||||||||||||||||||||
| 3467 | ++spans; | - | ||||||||||||||||||||||||
| 3468 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3469 | if (!alphaSpans
| 0 | ||||||||||||||||||||||||
| 3470 | op.destFetch = 0; never executed: op.destFetch = 0; | 0 | ||||||||||||||||||||||||
| 3471 | } | - | ||||||||||||||||||||||||
| 3472 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3473 | } | - | ||||||||||||||||||||||||
| 3474 | - | |||||||||||||||||||||||||
| 3475 | op.destStore = destStoreProc[data->rasterBuffer->format]; | - | ||||||||||||||||||||||||
| 3476 | op.destStore64 = destStoreProc64[data->rasterBuffer->format]; | - | ||||||||||||||||||||||||
| 3477 | - | |||||||||||||||||||||||||
| 3478 | op.funcSolid = functionForModeSolid[op.mode]; | - | ||||||||||||||||||||||||
| 3479 | op.funcSolid64 = functionForModeSolid64[op.mode]; | - | ||||||||||||||||||||||||
| 3480 | op.func = functionForMode[op.mode]; | - | ||||||||||||||||||||||||
| 3481 | op.func64 = functionForMode64[op.mode]; | - | ||||||||||||||||||||||||
| 3482 | - | |||||||||||||||||||||||||
| 3483 | return never executed: op;return op;never executed: return op; | 0 | ||||||||||||||||||||||||
| 3484 | } | - | ||||||||||||||||||||||||
| 3485 | - | |||||||||||||||||||||||||
| 3486 | - | |||||||||||||||||||||||||
| 3487 | - | |||||||||||||||||||||||||
| 3488 | - | |||||||||||||||||||||||||
| 3489 | - | |||||||||||||||||||||||||
| 3490 | - | |||||||||||||||||||||||||
| 3491 | static | - | ||||||||||||||||||||||||
| 3492 | - | |||||||||||||||||||||||||
| 3493 | void blend_color_generic(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 3494 | { | - | ||||||||||||||||||||||||
| 3495 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 3496 | uint buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 3497 | Operator op = getOperator(data, spans, count); | - | ||||||||||||||||||||||||
| 3498 | const uint color = data->solid.color.toArgb32(); | - | ||||||||||||||||||||||||
| 3499 | - | |||||||||||||||||||||||||
| 3500 | while (count--
| 0 | ||||||||||||||||||||||||
| 3501 | int x = spans->x; | - | ||||||||||||||||||||||||
| 3502 | int length = spans->len; | - | ||||||||||||||||||||||||
| 3503 | while (length
| 0 | ||||||||||||||||||||||||
| 3504 | int l = qMin(buffer_size, length); | - | ||||||||||||||||||||||||
| 3505 | uint *dest = op.destFetch
| 0 | ||||||||||||||||||||||||
| 3506 | op.funcSolid(dest, l, color, spans->coverage); | - | ||||||||||||||||||||||||
| 3507 | if (op.destStore
| 0 | ||||||||||||||||||||||||
| 3508 | op.destStore(data->rasterBuffer, x, spans->y, dest, l); never executed: op.destStore(data->rasterBuffer, x, spans->y, dest, l); | 0 | ||||||||||||||||||||||||
| 3509 | length -= l; | - | ||||||||||||||||||||||||
| 3510 | x += l; | - | ||||||||||||||||||||||||
| 3511 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3512 | ++spans; | - | ||||||||||||||||||||||||
| 3513 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3514 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3515 | - | |||||||||||||||||||||||||
| 3516 | static void blend_color_argb(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 3517 | { | - | ||||||||||||||||||||||||
| 3518 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 3519 | - | |||||||||||||||||||||||||
| 3520 | Operator op = getOperator(data, spans, count); | - | ||||||||||||||||||||||||
| 3521 | const uint color = data->solid.color.toArgb32(); | - | ||||||||||||||||||||||||
| 3522 | - | |||||||||||||||||||||||||
| 3523 | if (op.mode == QPainter::CompositionMode_Source
| 0 | ||||||||||||||||||||||||
| 3524 | - | |||||||||||||||||||||||||
| 3525 | while (count--
| 0 | ||||||||||||||||||||||||
| 3526 | uint *target = ((uint *)data->rasterBuffer->scanLine(spans->y)) + spans->x; | - | ||||||||||||||||||||||||
| 3527 | if (spans->coverage == 255
| 0 | ||||||||||||||||||||||||
| 3528 | qt_memfill<quint32>(target, color, spans->len);; | - | ||||||||||||||||||||||||
| 3529 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 3530 | uint c = BYTE_MUL(color, spans->coverage); | - | ||||||||||||||||||||||||
| 3531 | int ialpha = 255 - spans->coverage; | - | ||||||||||||||||||||||||
| 3532 | for (int i = 0; i < spans->len
| 0 | ||||||||||||||||||||||||
| 3533 | target[i] = c + BYTE_MUL(target[i], ialpha); never executed: target[i] = c + BYTE_MUL(target[i], ialpha); | 0 | ||||||||||||||||||||||||
| 3534 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3535 | ++spans; | - | ||||||||||||||||||||||||
| 3536 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3537 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 3538 | } | - | ||||||||||||||||||||||||
| 3539 | - | |||||||||||||||||||||||||
| 3540 | while (count--
| 0 | ||||||||||||||||||||||||
| 3541 | uint *target = ((uint *)data->rasterBuffer->scanLine(spans->y)) + spans->x; | - | ||||||||||||||||||||||||
| 3542 | op.funcSolid(target, spans->len, color, spans->coverage); | - | ||||||||||||||||||||||||
| 3543 | ++spans; | - | ||||||||||||||||||||||||
| 3544 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3545 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3546 | - | |||||||||||||||||||||||||
| 3547 | void blend_color_generic_rgb64(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 3548 | { | - | ||||||||||||||||||||||||
| 3549 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 3550 | Operator op = getOperator(data, spans, count); | - | ||||||||||||||||||||||||
| 3551 | if (!op.funcSolid64
| 0 | ||||||||||||||||||||||||
| 3552 | QMessageLogger(__FILE__, 3891, __PRETTY_FUNCTION__).debug("unsupported 64bit blend attempted"); | - | ||||||||||||||||||||||||
| 3553 | return never executed: blend_color_generic(count, spans, userData);return blend_color_generic(count, spans, userData);never executed: return blend_color_generic(count, spans, userData); | 0 | ||||||||||||||||||||||||
| 3554 | } | - | ||||||||||||||||||||||||
| 3555 | - | |||||||||||||||||||||||||
| 3556 | QRgba64 buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 3557 | const QRgba64 color = data->solid.color; | - | ||||||||||||||||||||||||
| 3558 | - | |||||||||||||||||||||||||
| 3559 | while (count--
| 0 | ||||||||||||||||||||||||
| 3560 | int x = spans->x; | - | ||||||||||||||||||||||||
| 3561 | int length = spans->len; | - | ||||||||||||||||||||||||
| 3562 | while (length
| 0 | ||||||||||||||||||||||||
| 3563 | int l = qMin(buffer_size, length); | - | ||||||||||||||||||||||||
| 3564 | QRgba64 *dest = op.destFetch64(buffer, data->rasterBuffer, x, spans->y, l); | - | ||||||||||||||||||||||||
| 3565 | op.funcSolid64(dest, l, color, spans->coverage); | - | ||||||||||||||||||||||||
| 3566 | op.destStore64(data->rasterBuffer, x, spans->y, dest, l); | - | ||||||||||||||||||||||||
| 3567 | length -= l; | - | ||||||||||||||||||||||||
| 3568 | x += l; | - | ||||||||||||||||||||||||
| 3569 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3570 | ++spans; | - | ||||||||||||||||||||||||
| 3571 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3572 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3573 | - | |||||||||||||||||||||||||
| 3574 | static void blend_color_rgb16(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 3575 | { | - | ||||||||||||||||||||||||
| 3576 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 3577 | - | |||||||||||||||||||||||||
| 3578 | - | |||||||||||||||||||||||||
| 3579 | - | |||||||||||||||||||||||||
| 3580 | - | |||||||||||||||||||||||||
| 3581 | - | |||||||||||||||||||||||||
| 3582 | - | |||||||||||||||||||||||||
| 3583 | QPainter::CompositionMode mode = data->rasterBuffer->compositionMode; | - | ||||||||||||||||||||||||
| 3584 | if (mode == QPainter::CompositionMode_SourceOver
| 0 | ||||||||||||||||||||||||
| 3585 | mode = QPainter::CompositionMode_Source; never executed: mode = QPainter::CompositionMode_Source; | 0 | ||||||||||||||||||||||||
| 3586 | - | |||||||||||||||||||||||||
| 3587 | if (mode == QPainter::CompositionMode_Source
| 0 | ||||||||||||||||||||||||
| 3588 | - | |||||||||||||||||||||||||
| 3589 | ushort c = data->solid.color.toRgb16(); | - | ||||||||||||||||||||||||
| 3590 | while (count--
| 0 | ||||||||||||||||||||||||
| 3591 | ushort *target = ((ushort *)data->rasterBuffer->scanLine(spans->y)) + spans->x; | - | ||||||||||||||||||||||||
| 3592 | if (spans->coverage == 255
| 0 | ||||||||||||||||||||||||
| 3593 | qt_memfill<quint16>(target, c, spans->len);; | - | ||||||||||||||||||||||||
| 3594 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 3595 | ushort color = BYTE_MUL_RGB16(c, spans->coverage); | - | ||||||||||||||||||||||||
| 3596 | int ialpha = 255 - spans->coverage; | - | ||||||||||||||||||||||||
| 3597 | const ushort *end = target + spans->len; | - | ||||||||||||||||||||||||
| 3598 | while (target < end
| 0 | ||||||||||||||||||||||||
| 3599 | *target = color + BYTE_MUL_RGB16(*target, ialpha); | - | ||||||||||||||||||||||||
| 3600 | ++target; | - | ||||||||||||||||||||||||
| 3601 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3602 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3603 | ++spans; | - | ||||||||||||||||||||||||
| 3604 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3605 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 3606 | } | - | ||||||||||||||||||||||||
| 3607 | - | |||||||||||||||||||||||||
| 3608 | if (mode == QPainter::CompositionMode_SourceOver
| 0 | ||||||||||||||||||||||||
| 3609 | while (count--
| 0 | ||||||||||||||||||||||||
| 3610 | uint color = BYTE_MUL(data->solid.color.toArgb32(), spans->coverage); | - | ||||||||||||||||||||||||
| 3611 | int ialpha = qAlpha(~color); | - | ||||||||||||||||||||||||
| 3612 | ushort c = qConvertRgb32To16(color); | - | ||||||||||||||||||||||||
| 3613 | ushort *target = ((ushort *)data->rasterBuffer->scanLine(spans->y)) + spans->x; | - | ||||||||||||||||||||||||
| 3614 | int len = spans->len; | - | ||||||||||||||||||||||||
| 3615 | bool pre = (((quintptr)target) & 0x3) != 0; | - | ||||||||||||||||||||||||
| 3616 | bool post = false; | - | ||||||||||||||||||||||||
| 3617 | if (pre
| 0 | ||||||||||||||||||||||||
| 3618 | - | |||||||||||||||||||||||||
| 3619 | *target = c + BYTE_MUL_RGB16(*target, ialpha); | - | ||||||||||||||||||||||||
| 3620 | ++target; | - | ||||||||||||||||||||||||
| 3621 | --len; | - | ||||||||||||||||||||||||
| 3622 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3623 | if (len & 0x1
| 0 | ||||||||||||||||||||||||
| 3624 | post = true; | - | ||||||||||||||||||||||||
| 3625 | --len; | - | ||||||||||||||||||||||||
| 3626 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3627 | uint *target32 = (uint*)target; | - | ||||||||||||||||||||||||
| 3628 | uint c32 = c | (c<<16); | - | ||||||||||||||||||||||||
| 3629 | len >>= 1; | - | ||||||||||||||||||||||||
| 3630 | uint salpha = (ialpha+1) >> 3; | - | ||||||||||||||||||||||||
| 3631 | while (len--
| 0 | ||||||||||||||||||||||||
| 3632 | - | |||||||||||||||||||||||||
| 3633 | *target32 = c32 + BYTE_MUL_RGB16_32(*target32, salpha); | - | ||||||||||||||||||||||||
| 3634 | ++target32; | - | ||||||||||||||||||||||||
| 3635 | target += 2; | - | ||||||||||||||||||||||||
| 3636 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3637 | if (post
| 0 | ||||||||||||||||||||||||
| 3638 | - | |||||||||||||||||||||||||
| 3639 | *target = c + BYTE_MUL_RGB16(*target, ialpha); | - | ||||||||||||||||||||||||
| 3640 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3641 | ++spans; | - | ||||||||||||||||||||||||
| 3642 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3643 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 3644 | } | - | ||||||||||||||||||||||||
| 3645 | - | |||||||||||||||||||||||||
| 3646 | blend_color_generic(count, spans, userData); | - | ||||||||||||||||||||||||
| 3647 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3648 | - | |||||||||||||||||||||||||
| 3649 | template <typename T> | - | ||||||||||||||||||||||||
| 3650 | void handleSpans(int count, const QSpan *spans, const QSpanData *data, T &handler) | - | ||||||||||||||||||||||||
| 3651 | { | - | ||||||||||||||||||||||||
| 3652 | uint const_alpha = 256; | - | ||||||||||||||||||||||||
| 3653 | if (data->type == QSpanData::Texture
| 0 | ||||||||||||||||||||||||
| 3654 | const_alpha = data->texture.const_alpha; never executed: const_alpha = data->texture.const_alpha; | 0 | ||||||||||||||||||||||||
| 3655 | - | |||||||||||||||||||||||||
| 3656 | int coverage = 0; | - | ||||||||||||||||||||||||
| 3657 | while (count
| 0 | ||||||||||||||||||||||||
| 3658 | int x = spans->x; | - | ||||||||||||||||||||||||
| 3659 | const int y = spans->y; | - | ||||||||||||||||||||||||
| 3660 | int right = x + spans->len; | - | ||||||||||||||||||||||||
| 3661 | - | |||||||||||||||||||||||||
| 3662 | - | |||||||||||||||||||||||||
| 3663 | for (int i = 1; i < count
| 0 | ||||||||||||||||||||||||
| 3664 | right += spans[i].len; never executed: right += spans[i].len; | 0 | ||||||||||||||||||||||||
| 3665 | int length = right - x; | - | ||||||||||||||||||||||||
| 3666 | - | |||||||||||||||||||||||||
| 3667 | while (length
| 0 | ||||||||||||||||||||||||
| 3668 | int l = qMin(buffer_size, length); | - | ||||||||||||||||||||||||
| 3669 | length -= l; | - | ||||||||||||||||||||||||
| 3670 | - | |||||||||||||||||||||||||
| 3671 | int process_length = l; | - | ||||||||||||||||||||||||
| 3672 | int process_x = x; | - | ||||||||||||||||||||||||
| 3673 | - | |||||||||||||||||||||||||
| 3674 | const typename T::BlendType *src = handler.fetch(process_x, y, process_length); | - | ||||||||||||||||||||||||
| 3675 | int offset = 0; | - | ||||||||||||||||||||||||
| 3676 | while (l > 0
| 0 | ||||||||||||||||||||||||
| 3677 | if (x == spans->x
| 0 | ||||||||||||||||||||||||
| 3678 | coverage = (spans->coverage * const_alpha) >> 8; never executed: coverage = (spans->coverage * const_alpha) >> 8; | 0 | ||||||||||||||||||||||||
| 3679 | - | |||||||||||||||||||||||||
| 3680 | int right = spans->x + spans->len; | - | ||||||||||||||||||||||||
| 3681 | int len = qMin(l, right - x); | - | ||||||||||||||||||||||||
| 3682 | - | |||||||||||||||||||||||||
| 3683 | handler.process(x, y, len, coverage, src, offset); | - | ||||||||||||||||||||||||
| 3684 | - | |||||||||||||||||||||||||
| 3685 | l -= len; | - | ||||||||||||||||||||||||
| 3686 | x += len; | - | ||||||||||||||||||||||||
| 3687 | offset += len; | - | ||||||||||||||||||||||||
| 3688 | - | |||||||||||||||||||||||||
| 3689 | if (x == right
| 0 | ||||||||||||||||||||||||
| 3690 | ++spans; | - | ||||||||||||||||||||||||
| 3691 | --count; | - | ||||||||||||||||||||||||
| 3692 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3693 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3694 | handler.store(process_x, y, process_length); | - | ||||||||||||||||||||||||
| 3695 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3696 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3697 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3698 | - | |||||||||||||||||||||||||
| 3699 | template<typename T> | - | ||||||||||||||||||||||||
| 3700 | struct QBlendBase | - | ||||||||||||||||||||||||
| 3701 | { | - | ||||||||||||||||||||||||
| 3702 | typedef T BlendType; | - | ||||||||||||||||||||||||
| 3703 | QBlendBase(QSpanData *d, Operator o) | - | ||||||||||||||||||||||||
| 3704 | : data(d) | - | ||||||||||||||||||||||||
| 3705 | , op(o) | - | ||||||||||||||||||||||||
| 3706 | , dest(0) | - | ||||||||||||||||||||||||
| 3707 | { | - | ||||||||||||||||||||||||
| 3708 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3709 | - | |||||||||||||||||||||||||
| 3710 | QSpanData *data; | - | ||||||||||||||||||||||||
| 3711 | Operator op; | - | ||||||||||||||||||||||||
| 3712 | - | |||||||||||||||||||||||||
| 3713 | BlendType *dest; | - | ||||||||||||||||||||||||
| 3714 | - | |||||||||||||||||||||||||
| 3715 | BlendType buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 3716 | BlendType src_buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 3717 | }; | - | ||||||||||||||||||||||||
| 3718 | - | |||||||||||||||||||||||||
| 3719 | class BlendSrcGeneric : public QBlendBase<uint> | - | ||||||||||||||||||||||||
| 3720 | { | - | ||||||||||||||||||||||||
| 3721 | public: | - | ||||||||||||||||||||||||
| 3722 | BlendSrcGeneric(QSpanData *d, Operator o) | - | ||||||||||||||||||||||||
| 3723 | : QBlendBase<uint>(d, o) | - | ||||||||||||||||||||||||
| 3724 | { | - | ||||||||||||||||||||||||
| 3725 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3726 | - | |||||||||||||||||||||||||
| 3727 | const uint *fetch(int x, int y, int len) | - | ||||||||||||||||||||||||
| 3728 | { | - | ||||||||||||||||||||||||
| 3729 | dest = op.destFetch
| 0 | ||||||||||||||||||||||||
| 3730 | return never executed: op.srcFetch(src_buffer, &op, data, y, x, len);return op.srcFetch(src_buffer, &op, data, y, x, len);never executed: return op.srcFetch(src_buffer, &op, data, y, x, len); | 0 | ||||||||||||||||||||||||
| 3731 | } | - | ||||||||||||||||||||||||
| 3732 | - | |||||||||||||||||||||||||
| 3733 | void process(int, int, int len, int coverage, const uint *src, int offset) | - | ||||||||||||||||||||||||
| 3734 | { | - | ||||||||||||||||||||||||
| 3735 | op.func(dest + offset, src + offset, len, coverage); | - | ||||||||||||||||||||||||
| 3736 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3737 | - | |||||||||||||||||||||||||
| 3738 | void store(int x, int y, int len) | - | ||||||||||||||||||||||||
| 3739 | { | - | ||||||||||||||||||||||||
| 3740 | if (op.destStore
| 0 | ||||||||||||||||||||||||
| 3741 | op.destStore(data->rasterBuffer, x, y, dest, len); never executed: op.destStore(data->rasterBuffer, x, y, dest, len); | 0 | ||||||||||||||||||||||||
| 3742 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3743 | }; | - | ||||||||||||||||||||||||
| 3744 | - | |||||||||||||||||||||||||
| 3745 | class BlendSrcGenericRGB64 : public QBlendBase<QRgba64> | - | ||||||||||||||||||||||||
| 3746 | { | - | ||||||||||||||||||||||||
| 3747 | public: | - | ||||||||||||||||||||||||
| 3748 | BlendSrcGenericRGB64(QSpanData *d, Operator o) | - | ||||||||||||||||||||||||
| 3749 | : QBlendBase<QRgba64>(d, o) | - | ||||||||||||||||||||||||
| 3750 | { | - | ||||||||||||||||||||||||
| 3751 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3752 | - | |||||||||||||||||||||||||
| 3753 | bool isSupported() const | - | ||||||||||||||||||||||||
| 3754 | { | - | ||||||||||||||||||||||||
| 3755 | return never executed: op.func64return op.func64 && op.destFetch64 && op.destStore64;
never executed: return op.func64 && op.destFetch64 && op.destStore64; | 0 | ||||||||||||||||||||||||
| 3756 | } | - | ||||||||||||||||||||||||
| 3757 | - | |||||||||||||||||||||||||
| 3758 | const QRgba64 *fetch(int x, int y, int len) | - | ||||||||||||||||||||||||
| 3759 | { | - | ||||||||||||||||||||||||
| 3760 | dest = op.destFetch64(buffer, data->rasterBuffer, x, y, len); | - | ||||||||||||||||||||||||
| 3761 | return never executed: op.srcFetch64(src_buffer, &op, data, y, x, len);return op.srcFetch64(src_buffer, &op, data, y, x, len);never executed: return op.srcFetch64(src_buffer, &op, data, y, x, len); | 0 | ||||||||||||||||||||||||
| 3762 | } | - | ||||||||||||||||||||||||
| 3763 | - | |||||||||||||||||||||||||
| 3764 | void process(int, int, int len, int coverage, const QRgba64 *src, int offset) | - | ||||||||||||||||||||||||
| 3765 | { | - | ||||||||||||||||||||||||
| 3766 | op.func64(dest + offset, src + offset, len, coverage); | - | ||||||||||||||||||||||||
| 3767 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3768 | - | |||||||||||||||||||||||||
| 3769 | void store(int x, int y, int len) | - | ||||||||||||||||||||||||
| 3770 | { | - | ||||||||||||||||||||||||
| 3771 | op.destStore64(data->rasterBuffer, x, y, dest, len); | - | ||||||||||||||||||||||||
| 3772 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3773 | }; | - | ||||||||||||||||||||||||
| 3774 | - | |||||||||||||||||||||||||
| 3775 | static void blend_src_generic(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 3776 | { | - | ||||||||||||||||||||||||
| 3777 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 3778 | BlendSrcGeneric blend(data, getOperator(data, spans, count)); | - | ||||||||||||||||||||||||
| 3779 | handleSpans(count, spans, data, blend); | - | ||||||||||||||||||||||||
| 3780 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3781 | - | |||||||||||||||||||||||||
| 3782 | static void blend_src_generic_rgb64(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 3783 | { | - | ||||||||||||||||||||||||
| 3784 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 3785 | Operator op = getOperator(data, spans, count); | - | ||||||||||||||||||||||||
| 3786 | BlendSrcGenericRGB64 blend64(data, op); | - | ||||||||||||||||||||||||
| 3787 | if (blend64.isSupported()
| 0 | ||||||||||||||||||||||||
| 3788 | handleSpans(count, spans, data, blend64); never executed: handleSpans(count, spans, data, blend64); | 0 | ||||||||||||||||||||||||
| 3789 | else { | - | ||||||||||||||||||||||||
| 3790 | QMessageLogger(__FILE__, 4129, __PRETTY_FUNCTION__).debug("blend_src_generic_rgb64: unsupported 64-bit blend attempted"); | - | ||||||||||||||||||||||||
| 3791 | BlendSrcGeneric blend32(data, op); | - | ||||||||||||||||||||||||
| 3792 | handleSpans(count, spans, data, blend32); | - | ||||||||||||||||||||||||
| 3793 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3794 | } | - | ||||||||||||||||||||||||
| 3795 | - | |||||||||||||||||||||||||
| 3796 | static void blend_untransformed_generic(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 3797 | { | - | ||||||||||||||||||||||||
| 3798 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 3799 | - | |||||||||||||||||||||||||
| 3800 | uint buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 3801 | uint src_buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 3802 | Operator op = getOperator(data, spans, count); | - | ||||||||||||||||||||||||
| 3803 | - | |||||||||||||||||||||||||
| 3804 | const int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 3805 | const int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 3806 | int xoff = -qRound(-data->dx); | - | ||||||||||||||||||||||||
| 3807 | int yoff = -qRound(-data->dy); | - | ||||||||||||||||||||||||
| 3808 | - | |||||||||||||||||||||||||
| 3809 | while (count--
| 0 | ||||||||||||||||||||||||
| 3810 | int x = spans->x; | - | ||||||||||||||||||||||||
| 3811 | int length = spans->len; | - | ||||||||||||||||||||||||
| 3812 | int sx = xoff + x; | - | ||||||||||||||||||||||||
| 3813 | int sy = yoff + spans->y; | - | ||||||||||||||||||||||||
| 3814 | if (sy >= 0
| 0 | ||||||||||||||||||||||||
| 3815 | if (sx < 0
| 0 | ||||||||||||||||||||||||
| 3816 | x -= sx; | - | ||||||||||||||||||||||||
| 3817 | length += sx; | - | ||||||||||||||||||||||||
| 3818 | sx = 0; | - | ||||||||||||||||||||||||
| 3819 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3820 | if (sx + length > image_width
| 0 | ||||||||||||||||||||||||
| 3821 | length = image_width - sx; never executed: length = image_width - sx; | 0 | ||||||||||||||||||||||||
| 3822 | if (length > 0
| 0 | ||||||||||||||||||||||||
| 3823 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - | ||||||||||||||||||||||||
| 3824 | while (length
| 0 | ||||||||||||||||||||||||
| 3825 | int l = qMin(buffer_size, length); | - | ||||||||||||||||||||||||
| 3826 | const uint *src = op.srcFetch(src_buffer, &op, data, sy, sx, l); | - | ||||||||||||||||||||||||
| 3827 | uint *dest = op.destFetch
| 0 | ||||||||||||||||||||||||
| 3828 | op.func(dest, src, l, coverage); | - | ||||||||||||||||||||||||
| 3829 | if (op.destStore
| 0 | ||||||||||||||||||||||||
| 3830 | op.destStore(data->rasterBuffer, x, spans->y, dest, l); never executed: op.destStore(data->rasterBuffer, x, spans->y, dest, l); | 0 | ||||||||||||||||||||||||
| 3831 | x += l; | - | ||||||||||||||||||||||||
| 3832 | sx += l; | - | ||||||||||||||||||||||||
| 3833 | length -= l; | - | ||||||||||||||||||||||||
| 3834 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3835 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3836 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3837 | ++spans; | - | ||||||||||||||||||||||||
| 3838 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3839 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3840 | - | |||||||||||||||||||||||||
| 3841 | static void blend_untransformed_generic_rgb64(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 3842 | { | - | ||||||||||||||||||||||||
| 3843 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 3844 | - | |||||||||||||||||||||||||
| 3845 | Operator op = getOperator(data, spans, count); | - | ||||||||||||||||||||||||
| 3846 | if (!op.func64
| 0 | ||||||||||||||||||||||||
| 3847 | QMessageLogger(__FILE__, 4186, __PRETTY_FUNCTION__).warning("Unsupported blend"); | - | ||||||||||||||||||||||||
| 3848 | return never executed: blend_untransformed_generic(count, spans, userData);return blend_untransformed_generic(count, spans, userData);never executed: return blend_untransformed_generic(count, spans, userData); | 0 | ||||||||||||||||||||||||
| 3849 | } | - | ||||||||||||||||||||||||
| 3850 | QRgba64 buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 3851 | QRgba64 src_buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 3852 | - | |||||||||||||||||||||||||
| 3853 | const int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 3854 | const int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 3855 | int xoff = -qRound(-data->dx); | - | ||||||||||||||||||||||||
| 3856 | int yoff = -qRound(-data->dy); | - | ||||||||||||||||||||||||
| 3857 | - | |||||||||||||||||||||||||
| 3858 | while (count--
| 0 | ||||||||||||||||||||||||
| 3859 | int x = spans->x; | - | ||||||||||||||||||||||||
| 3860 | int length = spans->len; | - | ||||||||||||||||||||||||
| 3861 | int sx = xoff + x; | - | ||||||||||||||||||||||||
| 3862 | int sy = yoff + spans->y; | - | ||||||||||||||||||||||||
| 3863 | if (sy >= 0
| 0 | ||||||||||||||||||||||||
| 3864 | if (sx < 0
| 0 | ||||||||||||||||||||||||
| 3865 | x -= sx; | - | ||||||||||||||||||||||||
| 3866 | length += sx; | - | ||||||||||||||||||||||||
| 3867 | sx = 0; | - | ||||||||||||||||||||||||
| 3868 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3869 | if (sx + length > image_width
| 0 | ||||||||||||||||||||||||
| 3870 | length = image_width - sx; never executed: length = image_width - sx; | 0 | ||||||||||||||||||||||||
| 3871 | if (length > 0
| 0 | ||||||||||||||||||||||||
| 3872 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - | ||||||||||||||||||||||||
| 3873 | while (length
| 0 | ||||||||||||||||||||||||
| 3874 | int l = qMin(buffer_size, length); | - | ||||||||||||||||||||||||
| 3875 | const QRgba64 *src = op.srcFetch64(src_buffer, &op, data, sy, sx, l); | - | ||||||||||||||||||||||||
| 3876 | QRgba64 *dest = op.destFetch64(buffer, data->rasterBuffer, x, spans->y, l); | - | ||||||||||||||||||||||||
| 3877 | op.func64(dest, src, l, coverage); | - | ||||||||||||||||||||||||
| 3878 | op.destStore64(data->rasterBuffer, x, spans->y, dest, l); | - | ||||||||||||||||||||||||
| 3879 | x += l; | - | ||||||||||||||||||||||||
| 3880 | sx += l; | - | ||||||||||||||||||||||||
| 3881 | length -= l; | - | ||||||||||||||||||||||||
| 3882 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3883 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3884 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3885 | ++spans; | - | ||||||||||||||||||||||||
| 3886 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3887 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3888 | - | |||||||||||||||||||||||||
| 3889 | static void blend_untransformed_argb(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 3890 | { | - | ||||||||||||||||||||||||
| 3891 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 3892 | if (data->texture.format != QImage::Format_ARGB32_Premultiplied
| 0 | ||||||||||||||||||||||||
| 3893 | && data->texture.format != QImage::Format_RGB32
| 0 | ||||||||||||||||||||||||
| 3894 | blend_untransformed_generic(count, spans, userData); | - | ||||||||||||||||||||||||
| 3895 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 3896 | } | - | ||||||||||||||||||||||||
| 3897 | - | |||||||||||||||||||||||||
| 3898 | Operator op = getOperator(data, spans, count); | - | ||||||||||||||||||||||||
| 3899 | - | |||||||||||||||||||||||||
| 3900 | const int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 3901 | const int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 3902 | int xoff = -qRound(-data->dx); | - | ||||||||||||||||||||||||
| 3903 | int yoff = -qRound(-data->dy); | - | ||||||||||||||||||||||||
| 3904 | - | |||||||||||||||||||||||||
| 3905 | while (count--
| 0 | ||||||||||||||||||||||||
| 3906 | int x = spans->x; | - | ||||||||||||||||||||||||
| 3907 | int length = spans->len; | - | ||||||||||||||||||||||||
| 3908 | int sx = xoff + x; | - | ||||||||||||||||||||||||
| 3909 | int sy = yoff + spans->y; | - | ||||||||||||||||||||||||
| 3910 | if (sy >= 0
| 0 | ||||||||||||||||||||||||
| 3911 | if (sx < 0
| 0 | ||||||||||||||||||||||||
| 3912 | x -= sx; | - | ||||||||||||||||||||||||
| 3913 | length += sx; | - | ||||||||||||||||||||||||
| 3914 | sx = 0; | - | ||||||||||||||||||||||||
| 3915 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3916 | if (sx + length > image_width
| 0 | ||||||||||||||||||||||||
| 3917 | length = image_width - sx; never executed: length = image_width - sx; | 0 | ||||||||||||||||||||||||
| 3918 | if (length > 0
| 0 | ||||||||||||||||||||||||
| 3919 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - | ||||||||||||||||||||||||
| 3920 | const uint *src = (const uint *)data->texture.scanLine(sy) + sx; | - | ||||||||||||||||||||||||
| 3921 | uint *dest = ((uint *)data->rasterBuffer->scanLine(spans->y)) + x; | - | ||||||||||||||||||||||||
| 3922 | op.func(dest, src, length, coverage); | - | ||||||||||||||||||||||||
| 3923 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3924 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3925 | ++spans; | - | ||||||||||||||||||||||||
| 3926 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3927 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3928 | - | |||||||||||||||||||||||||
| 3929 | static inline quint16 interpolate_pixel_rgb16_255(quint16 x, quint8 a, | - | ||||||||||||||||||||||||
| 3930 | quint16 y, quint8 b) | - | ||||||||||||||||||||||||
| 3931 | { | - | ||||||||||||||||||||||||
| 3932 | quint16 t = ((((x & 0x07e0) * a) + ((y & 0x07e0) * b)) >> 5) & 0x07e0; | - | ||||||||||||||||||||||||
| 3933 | t |= ((((x & 0xf81f) * a) + ((y & 0xf81f) * b)) >> 5) & 0xf81f; | - | ||||||||||||||||||||||||
| 3934 | - | |||||||||||||||||||||||||
| 3935 | return never executed: t;return t;never executed: return t; | 0 | ||||||||||||||||||||||||
| 3936 | } | - | ||||||||||||||||||||||||
| 3937 | - | |||||||||||||||||||||||||
| 3938 | static inline quint32 interpolate_pixel_rgb16x2_255(quint32 x, quint8 a, | - | ||||||||||||||||||||||||
| 3939 | quint32 y, quint8 b) | - | ||||||||||||||||||||||||
| 3940 | { | - | ||||||||||||||||||||||||
| 3941 | uint t; | - | ||||||||||||||||||||||||
| 3942 | t = ((((x & 0xf81f07e0) >> 5) * a) + (((y & 0xf81f07e0) >> 5) * b)) & 0xf81f07e0; | - | ||||||||||||||||||||||||
| 3943 | t |= ((((x & 0x07e0f81f) * a) + ((y & 0x07e0f81f) * b)) >> 5) & 0x07e0f81f; | - | ||||||||||||||||||||||||
| 3944 | return never executed: t;return t;never executed: return t; | 0 | ||||||||||||||||||||||||
| 3945 | } | - | ||||||||||||||||||||||||
| 3946 | - | |||||||||||||||||||||||||
| 3947 | static inline void blend_sourceOver_rgb16_rgb16(quint16 *__restrict__ dest, | - | ||||||||||||||||||||||||
| 3948 | const quint16 *__restrict__ src, | - | ||||||||||||||||||||||||
| 3949 | int length, | - | ||||||||||||||||||||||||
| 3950 | const quint8 alpha, | - | ||||||||||||||||||||||||
| 3951 | const quint8 ialpha) | - | ||||||||||||||||||||||||
| 3952 | { | - | ||||||||||||||||||||||||
| 3953 | const int dstAlign = ((quintptr)dest) & 0x3; | - | ||||||||||||||||||||||||
| 3954 | if (dstAlign
| 0 | ||||||||||||||||||||||||
| 3955 | *dest = interpolate_pixel_rgb16_255(*src, alpha, *dest, ialpha); | - | ||||||||||||||||||||||||
| 3956 | ++dest; | - | ||||||||||||||||||||||||
| 3957 | ++src; | - | ||||||||||||||||||||||||
| 3958 | --length; | - | ||||||||||||||||||||||||
| 3959 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3960 | const int srcAlign = ((quintptr)src) & 0x3; | - | ||||||||||||||||||||||||
| 3961 | int length32 = length >> 1; | - | ||||||||||||||||||||||||
| 3962 | if (length32
| 0 | ||||||||||||||||||||||||
| 3963 | while (length32--
| 0 | ||||||||||||||||||||||||
| 3964 | const quint32 *src32 = reinterpret_cast<const quint32*>(src); | - | ||||||||||||||||||||||||
| 3965 | quint32 *dest32 = reinterpret_cast<quint32*>(dest); | - | ||||||||||||||||||||||||
| 3966 | *dest32 = interpolate_pixel_rgb16x2_255(*src32, alpha, | - | ||||||||||||||||||||||||
| 3967 | *dest32, ialpha); | - | ||||||||||||||||||||||||
| 3968 | dest += 2; | - | ||||||||||||||||||||||||
| 3969 | src += 2; | - | ||||||||||||||||||||||||
| 3970 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3971 | length &= 0x1; | - | ||||||||||||||||||||||||
| 3972 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3973 | while (length--
| 0 | ||||||||||||||||||||||||
| 3974 | *dest = interpolate_pixel_rgb16_255(*src, alpha, *dest, ialpha); | - | ||||||||||||||||||||||||
| 3975 | ++dest; | - | ||||||||||||||||||||||||
| 3976 | ++src; | - | ||||||||||||||||||||||||
| 3977 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3978 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3979 | - | |||||||||||||||||||||||||
| 3980 | static void blend_untransformed_rgb565(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 3981 | { | - | ||||||||||||||||||||||||
| 3982 | QSpanData *data = reinterpret_cast<QSpanData*>(userData); | - | ||||||||||||||||||||||||
| 3983 | QPainter::CompositionMode mode = data->rasterBuffer->compositionMode; | - | ||||||||||||||||||||||||
| 3984 | - | |||||||||||||||||||||||||
| 3985 | if (data->texture.format != QImage::Format_RGB16
| 0 | ||||||||||||||||||||||||
| 3986 | || (mode != QPainter::CompositionMode_SourceOver
| 0 | ||||||||||||||||||||||||
| 3987 | && mode != QPainter::CompositionMode_Source
| 0 | ||||||||||||||||||||||||
| 3988 | { | - | ||||||||||||||||||||||||
| 3989 | blend_untransformed_generic(count, spans, userData); | - | ||||||||||||||||||||||||
| 3990 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 3991 | } | - | ||||||||||||||||||||||||
| 3992 | - | |||||||||||||||||||||||||
| 3993 | const int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 3994 | const int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 3995 | int xoff = -qRound(-data->dx); | - | ||||||||||||||||||||||||
| 3996 | int yoff = -qRound(-data->dy); | - | ||||||||||||||||||||||||
| 3997 | - | |||||||||||||||||||||||||
| 3998 | while (count--
| 0 | ||||||||||||||||||||||||
| 3999 | const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8; | - | ||||||||||||||||||||||||
| 4000 | if (coverage == 0
| 0 | ||||||||||||||||||||||||
| 4001 | ++spans; | - | ||||||||||||||||||||||||
| 4002 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 4003 | } | - | ||||||||||||||||||||||||
| 4004 | - | |||||||||||||||||||||||||
| 4005 | int x = spans->x; | - | ||||||||||||||||||||||||
| 4006 | int length = spans->len; | - | ||||||||||||||||||||||||
| 4007 | int sx = xoff + x; | - | ||||||||||||||||||||||||
| 4008 | int sy = yoff + spans->y; | - | ||||||||||||||||||||||||
| 4009 | if (sy >= 0
| 0 | ||||||||||||||||||||||||
| 4010 | if (sx < 0
| 0 | ||||||||||||||||||||||||
| 4011 | x -= sx; | - | ||||||||||||||||||||||||
| 4012 | length += sx; | - | ||||||||||||||||||||||||
| 4013 | sx = 0; | - | ||||||||||||||||||||||||
| 4014 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4015 | if (sx + length > image_width
| 0 | ||||||||||||||||||||||||
| 4016 | length = image_width - sx; never executed: length = image_width - sx; | 0 | ||||||||||||||||||||||||
| 4017 | if (length > 0
| 0 | ||||||||||||||||||||||||
| 4018 | quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + x; | - | ||||||||||||||||||||||||
| 4019 | const quint16 *src = (const quint16 *)data->texture.scanLine(sy) + sx; | - | ||||||||||||||||||||||||
| 4020 | if (coverage == 255
| 0 | ||||||||||||||||||||||||
| 4021 | memcpy(dest, src, length * sizeof(quint16)); | - | ||||||||||||||||||||||||
| 4022 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 4023 | const quint8 alpha = (coverage + 1) >> 3; | - | ||||||||||||||||||||||||
| 4024 | const quint8 ialpha = 0x20 - alpha; | - | ||||||||||||||||||||||||
| 4025 | if (alpha > 0
| 0 | ||||||||||||||||||||||||
| 4026 | blend_sourceOver_rgb16_rgb16(dest, src, length, alpha, ialpha); never executed: blend_sourceOver_rgb16_rgb16(dest, src, length, alpha, ialpha); | 0 | ||||||||||||||||||||||||
| 4027 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4028 | } | - | ||||||||||||||||||||||||
| 4029 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4030 | ++spans; | - | ||||||||||||||||||||||||
| 4031 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4032 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4033 | - | |||||||||||||||||||||||||
| 4034 | static void blend_tiled_generic(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 4035 | { | - | ||||||||||||||||||||||||
| 4036 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 4037 | - | |||||||||||||||||||||||||
| 4038 | uint buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 4039 | uint src_buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 4040 | Operator op = getOperator(data, spans, count); | - | ||||||||||||||||||||||||
| 4041 | - | |||||||||||||||||||||||||
| 4042 | const int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 4043 | const int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 4044 | int xoff = -qRound(-data->dx) % image_width; | - | ||||||||||||||||||||||||
| 4045 | int yoff = -qRound(-data->dy) % image_height; | - | ||||||||||||||||||||||||
| 4046 | - | |||||||||||||||||||||||||
| 4047 | if (xoff < 0
| 0 | ||||||||||||||||||||||||
| 4048 | xoff += image_width; never executed: xoff += image_width; | 0 | ||||||||||||||||||||||||
| 4049 | if (yoff < 0
| 0 | ||||||||||||||||||||||||
| 4050 | yoff += image_height; never executed: yoff += image_height; | 0 | ||||||||||||||||||||||||
| 4051 | - | |||||||||||||||||||||||||
| 4052 | while (count--
| 0 | ||||||||||||||||||||||||
| 4053 | int x = spans->x; | - | ||||||||||||||||||||||||
| 4054 | int length = spans->len; | - | ||||||||||||||||||||||||
| 4055 | int sx = (xoff + spans->x) % image_width; | - | ||||||||||||||||||||||||
| 4056 | int sy = (spans->y + yoff) % image_height; | - | ||||||||||||||||||||||||
| 4057 | if (sx < 0
| 0 | ||||||||||||||||||||||||
| 4058 | sx += image_width; never executed: sx += image_width; | 0 | ||||||||||||||||||||||||
| 4059 | if (sy < 0
| 0 | ||||||||||||||||||||||||
| 4060 | sy += image_height; never executed: sy += image_height; | 0 | ||||||||||||||||||||||||
| 4061 | - | |||||||||||||||||||||||||
| 4062 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - | ||||||||||||||||||||||||
| 4063 | while (length
| 0 | ||||||||||||||||||||||||
| 4064 | int l = qMin(image_width - sx, length); | - | ||||||||||||||||||||||||
| 4065 | if (buffer_size < l
| 0 | ||||||||||||||||||||||||
| 4066 | l = buffer_size; never executed: l = buffer_size; | 0 | ||||||||||||||||||||||||
| 4067 | const uint *src = op.srcFetch(src_buffer, &op, data, sy, sx, l); | - | ||||||||||||||||||||||||
| 4068 | uint *dest = op.destFetch
| 0 | ||||||||||||||||||||||||
| 4069 | op.func(dest, src, l, coverage); | - | ||||||||||||||||||||||||
| 4070 | if (op.destStore
| 0 | ||||||||||||||||||||||||
| 4071 | op.destStore(data->rasterBuffer, x, spans->y, dest, l); never executed: op.destStore(data->rasterBuffer, x, spans->y, dest, l); | 0 | ||||||||||||||||||||||||
| 4072 | x += l; | - | ||||||||||||||||||||||||
| 4073 | sx += l; | - | ||||||||||||||||||||||||
| 4074 | length -= l; | - | ||||||||||||||||||||||||
| 4075 | if (sx >= image_width
| 0 | ||||||||||||||||||||||||
| 4076 | sx = 0; never executed: sx = 0; | 0 | ||||||||||||||||||||||||
| 4077 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4078 | ++spans; | - | ||||||||||||||||||||||||
| 4079 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4080 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4081 | - | |||||||||||||||||||||||||
| 4082 | static void blend_tiled_generic_rgb64(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 4083 | { | - | ||||||||||||||||||||||||
| 4084 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 4085 | - | |||||||||||||||||||||||||
| 4086 | Operator op = getOperator(data, spans, count); | - | ||||||||||||||||||||||||
| 4087 | if (!op.func64
| 0 | ||||||||||||||||||||||||
| 4088 | QMessageLogger(__FILE__, 4427, __PRETTY_FUNCTION__).debug("unsupported rgb64 blend"); | - | ||||||||||||||||||||||||
| 4089 | return never executed: blend_tiled_generic(count, spans, userData);return blend_tiled_generic(count, spans, userData);never executed: return blend_tiled_generic(count, spans, userData); | 0 | ||||||||||||||||||||||||
| 4090 | } | - | ||||||||||||||||||||||||
| 4091 | QRgba64 buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 4092 | QRgba64 src_buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 4093 | - | |||||||||||||||||||||||||
| 4094 | const int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 4095 | const int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 4096 | int xoff = -qRound(-data->dx) % image_width; | - | ||||||||||||||||||||||||
| 4097 | int yoff = -qRound(-data->dy) % image_height; | - | ||||||||||||||||||||||||
| 4098 | - | |||||||||||||||||||||||||
| 4099 | if (xoff < 0
| 0 | ||||||||||||||||||||||||
| 4100 | xoff += image_width; never executed: xoff += image_width; | 0 | ||||||||||||||||||||||||
| 4101 | if (yoff < 0
| 0 | ||||||||||||||||||||||||
| 4102 | yoff += image_height; never executed: yoff += image_height; | 0 | ||||||||||||||||||||||||
| 4103 | - | |||||||||||||||||||||||||
| 4104 | while (count--
| 0 | ||||||||||||||||||||||||
| 4105 | int x = spans->x; | - | ||||||||||||||||||||||||
| 4106 | int length = spans->len; | - | ||||||||||||||||||||||||
| 4107 | int sx = (xoff + spans->x) % image_width; | - | ||||||||||||||||||||||||
| 4108 | int sy = (spans->y + yoff) % image_height; | - | ||||||||||||||||||||||||
| 4109 | if (sx < 0
| 0 | ||||||||||||||||||||||||
| 4110 | sx += image_width; never executed: sx += image_width; | 0 | ||||||||||||||||||||||||
| 4111 | if (sy < 0
| 0 | ||||||||||||||||||||||||
| 4112 | sy += image_height; never executed: sy += image_height; | 0 | ||||||||||||||||||||||||
| 4113 | - | |||||||||||||||||||||||||
| 4114 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - | ||||||||||||||||||||||||
| 4115 | while (length
| 0 | ||||||||||||||||||||||||
| 4116 | int l = qMin(image_width - sx, length); | - | ||||||||||||||||||||||||
| 4117 | if (buffer_size < l
| 0 | ||||||||||||||||||||||||
| 4118 | l = buffer_size; never executed: l = buffer_size; | 0 | ||||||||||||||||||||||||
| 4119 | const QRgba64 *src = op.srcFetch64(src_buffer, &op, data, sy, sx, l); | - | ||||||||||||||||||||||||
| 4120 | QRgba64 *dest = op.destFetch64(buffer, data->rasterBuffer, x, spans->y, l); | - | ||||||||||||||||||||||||
| 4121 | op.func64(dest, src, l, coverage); | - | ||||||||||||||||||||||||
| 4122 | op.destStore64(data->rasterBuffer, x, spans->y, dest, l); | - | ||||||||||||||||||||||||
| 4123 | x += l; | - | ||||||||||||||||||||||||
| 4124 | sx += l; | - | ||||||||||||||||||||||||
| 4125 | length -= l; | - | ||||||||||||||||||||||||
| 4126 | if (sx >= image_width
| 0 | ||||||||||||||||||||||||
| 4127 | sx = 0; never executed: sx = 0; | 0 | ||||||||||||||||||||||||
| 4128 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4129 | ++spans; | - | ||||||||||||||||||||||||
| 4130 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4131 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4132 | - | |||||||||||||||||||||||||
| 4133 | static void blend_tiled_argb(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 4134 | { | - | ||||||||||||||||||||||||
| 4135 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 4136 | if (data->texture.format != QImage::Format_ARGB32_Premultiplied
| 0 | ||||||||||||||||||||||||
| 4137 | && data->texture.format != QImage::Format_RGB32
| 0 | ||||||||||||||||||||||||
| 4138 | blend_tiled_generic(count, spans, userData); | - | ||||||||||||||||||||||||
| 4139 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 4140 | } | - | ||||||||||||||||||||||||
| 4141 | - | |||||||||||||||||||||||||
| 4142 | Operator op = getOperator(data, spans, count); | - | ||||||||||||||||||||||||
| 4143 | - | |||||||||||||||||||||||||
| 4144 | int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 4145 | int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 4146 | int xoff = -qRound(-data->dx) % image_width; | - | ||||||||||||||||||||||||
| 4147 | int yoff = -qRound(-data->dy) % image_height; | - | ||||||||||||||||||||||||
| 4148 | - | |||||||||||||||||||||||||
| 4149 | if (xoff < 0
| 0 | ||||||||||||||||||||||||
| 4150 | xoff += image_width; never executed: xoff += image_width; | 0 | ||||||||||||||||||||||||
| 4151 | if (yoff < 0
| 0 | ||||||||||||||||||||||||
| 4152 | yoff += image_height; never executed: yoff += image_height; | 0 | ||||||||||||||||||||||||
| 4153 | - | |||||||||||||||||||||||||
| 4154 | while (count--
| 0 | ||||||||||||||||||||||||
| 4155 | int x = spans->x; | - | ||||||||||||||||||||||||
| 4156 | int length = spans->len; | - | ||||||||||||||||||||||||
| 4157 | int sx = (xoff + spans->x) % image_width; | - | ||||||||||||||||||||||||
| 4158 | int sy = (spans->y + yoff) % image_height; | - | ||||||||||||||||||||||||
| 4159 | if (sx < 0
| 0 | ||||||||||||||||||||||||
| 4160 | sx += image_width; never executed: sx += image_width; | 0 | ||||||||||||||||||||||||
| 4161 | if (sy < 0
| 0 | ||||||||||||||||||||||||
| 4162 | sy += image_height; never executed: sy += image_height; | 0 | ||||||||||||||||||||||||
| 4163 | - | |||||||||||||||||||||||||
| 4164 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - | ||||||||||||||||||||||||
| 4165 | while (length
| 0 | ||||||||||||||||||||||||
| 4166 | int l = qMin(image_width - sx, length); | - | ||||||||||||||||||||||||
| 4167 | if (buffer_size < l
| 0 | ||||||||||||||||||||||||
| 4168 | l = buffer_size; never executed: l = buffer_size; | 0 | ||||||||||||||||||||||||
| 4169 | const uint *src = (const uint *)data->texture.scanLine(sy) + sx; | - | ||||||||||||||||||||||||
| 4170 | uint *dest = ((uint *)data->rasterBuffer->scanLine(spans->y)) + x; | - | ||||||||||||||||||||||||
| 4171 | op.func(dest, src, l, coverage); | - | ||||||||||||||||||||||||
| 4172 | x += l; | - | ||||||||||||||||||||||||
| 4173 | sx += l; | - | ||||||||||||||||||||||||
| 4174 | length -= l; | - | ||||||||||||||||||||||||
| 4175 | if (sx >= image_width
| 0 | ||||||||||||||||||||||||
| 4176 | sx = 0; never executed: sx = 0; | 0 | ||||||||||||||||||||||||
| 4177 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4178 | ++spans; | - | ||||||||||||||||||||||||
| 4179 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4180 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4181 | - | |||||||||||||||||||||||||
| 4182 | static void blend_tiled_rgb565(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 4183 | { | - | ||||||||||||||||||||||||
| 4184 | QSpanData *data = reinterpret_cast<QSpanData*>(userData); | - | ||||||||||||||||||||||||
| 4185 | QPainter::CompositionMode mode = data->rasterBuffer->compositionMode; | - | ||||||||||||||||||||||||
| 4186 | - | |||||||||||||||||||||||||
| 4187 | if (data->texture.format != QImage::Format_RGB16
| 0 | ||||||||||||||||||||||||
| 4188 | || (mode != QPainter::CompositionMode_SourceOver
| 0 | ||||||||||||||||||||||||
| 4189 | && mode != QPainter::CompositionMode_Source
| 0 | ||||||||||||||||||||||||
| 4190 | { | - | ||||||||||||||||||||||||
| 4191 | blend_tiled_generic(count, spans, userData); | - | ||||||||||||||||||||||||
| 4192 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 4193 | } | - | ||||||||||||||||||||||||
| 4194 | - | |||||||||||||||||||||||||
| 4195 | const int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 4196 | const int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 4197 | int xoff = -qRound(-data->dx) % image_width; | - | ||||||||||||||||||||||||
| 4198 | int yoff = -qRound(-data->dy) % image_height; | - | ||||||||||||||||||||||||
| 4199 | - | |||||||||||||||||||||||||
| 4200 | if (xoff < 0
| 0 | ||||||||||||||||||||||||
| 4201 | xoff += image_width; never executed: xoff += image_width; | 0 | ||||||||||||||||||||||||
| 4202 | if (yoff < 0
| 0 | ||||||||||||||||||||||||
| 4203 | yoff += image_height; never executed: yoff += image_height; | 0 | ||||||||||||||||||||||||
| 4204 | - | |||||||||||||||||||||||||
| 4205 | while (count--
| 0 | ||||||||||||||||||||||||
| 4206 | const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8; | - | ||||||||||||||||||||||||
| 4207 | if (coverage == 0
| 0 | ||||||||||||||||||||||||
| 4208 | ++spans; | - | ||||||||||||||||||||||||
| 4209 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 4210 | } | - | ||||||||||||||||||||||||
| 4211 | - | |||||||||||||||||||||||||
| 4212 | int x = spans->x; | - | ||||||||||||||||||||||||
| 4213 | int length = spans->len; | - | ||||||||||||||||||||||||
| 4214 | int sx = (xoff + spans->x) % image_width; | - | ||||||||||||||||||||||||
| 4215 | int sy = (spans->y + yoff) % image_height; | - | ||||||||||||||||||||||||
| 4216 | if (sx < 0
| 0 | ||||||||||||||||||||||||
| 4217 | sx += image_width; never executed: sx += image_width; | 0 | ||||||||||||||||||||||||
| 4218 | if (sy < 0
| 0 | ||||||||||||||||||||||||
| 4219 | sy += image_height; never executed: sy += image_height; | 0 | ||||||||||||||||||||||||
| 4220 | - | |||||||||||||||||||||||||
| 4221 | if (coverage == 255
| 0 | ||||||||||||||||||||||||
| 4222 | - | |||||||||||||||||||||||||
| 4223 | length = qMin(image_width,length); | - | ||||||||||||||||||||||||
| 4224 | int tx = x; | - | ||||||||||||||||||||||||
| 4225 | while (length
| 0 | ||||||||||||||||||||||||
| 4226 | int l = qMin(image_width - sx, length); | - | ||||||||||||||||||||||||
| 4227 | if (buffer_size < l
| 0 | ||||||||||||||||||||||||
| 4228 | l = buffer_size; never executed: l = buffer_size; | 0 | ||||||||||||||||||||||||
| 4229 | quint16 *dest = ((quint16 *)data->rasterBuffer->scanLine(spans->y)) + tx; | - | ||||||||||||||||||||||||
| 4230 | const quint16 *src = (const quint16 *)data->texture.scanLine(sy) + sx; | - | ||||||||||||||||||||||||
| 4231 | memcpy(dest, src, l * sizeof(quint16)); | - | ||||||||||||||||||||||||
| 4232 | length -= l; | - | ||||||||||||||||||||||||
| 4233 | tx += l; | - | ||||||||||||||||||||||||
| 4234 | sx += l; | - | ||||||||||||||||||||||||
| 4235 | if (sx >= image_width
| 0 | ||||||||||||||||||||||||
| 4236 | sx = 0; never executed: sx = 0; | 0 | ||||||||||||||||||||||||
| 4237 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4238 | - | |||||||||||||||||||||||||
| 4239 | - | |||||||||||||||||||||||||
| 4240 | - | |||||||||||||||||||||||||
| 4241 | - | |||||||||||||||||||||||||
| 4242 | - | |||||||||||||||||||||||||
| 4243 | - | |||||||||||||||||||||||||
| 4244 | - | |||||||||||||||||||||||||
| 4245 | int copy_image_width = qMin(image_width, int(spans->len)); | - | ||||||||||||||||||||||||
| 4246 | length = spans->len - copy_image_width; | - | ||||||||||||||||||||||||
| 4247 | quint16 *src = ((quint16 *)data->rasterBuffer->scanLine(spans->y)) + x; | - | ||||||||||||||||||||||||
| 4248 | quint16 *dest = src + copy_image_width; | - | ||||||||||||||||||||||||
| 4249 | while (copy_image_width < length
| 0 | ||||||||||||||||||||||||
| 4250 | memcpy(dest, src, copy_image_width * sizeof(quint16)); | - | ||||||||||||||||||||||||
| 4251 | dest += copy_image_width; | - | ||||||||||||||||||||||||
| 4252 | length -= copy_image_width; | - | ||||||||||||||||||||||||
| 4253 | copy_image_width *= 2; | - | ||||||||||||||||||||||||
| 4254 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4255 | if (length > 0
| 0 | ||||||||||||||||||||||||
| 4256 | memcpy(dest, src, length * sizeof(quint16)); never executed: memcpy(dest, src, length * sizeof(quint16)); | 0 | ||||||||||||||||||||||||
| 4257 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 4258 | const quint8 alpha = (coverage + 1) >> 3; | - | ||||||||||||||||||||||||
| 4259 | const quint8 ialpha = 0x20 - alpha; | - | ||||||||||||||||||||||||
| 4260 | if (alpha > 0
| 0 | ||||||||||||||||||||||||
| 4261 | while (length
| 0 | ||||||||||||||||||||||||
| 4262 | int l = qMin(image_width - sx, length); | - | ||||||||||||||||||||||||
| 4263 | if (buffer_size < l
| 0 | ||||||||||||||||||||||||
| 4264 | l = buffer_size; never executed: l = buffer_size; | 0 | ||||||||||||||||||||||||
| 4265 | quint16 *dest = ((quint16 *)data->rasterBuffer->scanLine(spans->y)) + x; | - | ||||||||||||||||||||||||
| 4266 | const quint16 *src = (const quint16 *)data->texture.scanLine(sy) + sx; | - | ||||||||||||||||||||||||
| 4267 | blend_sourceOver_rgb16_rgb16(dest, src, l, alpha, ialpha); | - | ||||||||||||||||||||||||
| 4268 | x += l; | - | ||||||||||||||||||||||||
| 4269 | sx += l; | - | ||||||||||||||||||||||||
| 4270 | length -= l; | - | ||||||||||||||||||||||||
| 4271 | if (sx >= image_width
| 0 | ||||||||||||||||||||||||
| 4272 | sx = 0; never executed: sx = 0; | 0 | ||||||||||||||||||||||||
| 4273 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4274 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4275 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4276 | ++spans; | - | ||||||||||||||||||||||||
| 4277 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4278 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4279 | - | |||||||||||||||||||||||||
| 4280 | static void blend_transformed_bilinear_rgb565(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 4281 | { | - | ||||||||||||||||||||||||
| 4282 | QSpanData *data = reinterpret_cast<QSpanData*>(userData); | - | ||||||||||||||||||||||||
| 4283 | QPainter::CompositionMode mode = data->rasterBuffer->compositionMode; | - | ||||||||||||||||||||||||
| 4284 | - | |||||||||||||||||||||||||
| 4285 | if (data->texture.format != QImage::Format_RGB16
| 0 | ||||||||||||||||||||||||
| 4286 | || (mode != QPainter::CompositionMode_SourceOver
| 0 | ||||||||||||||||||||||||
| 4287 | && mode != QPainter::CompositionMode_Source
| 0 | ||||||||||||||||||||||||
| 4288 | { | - | ||||||||||||||||||||||||
| 4289 | blend_src_generic(count, spans, userData); | - | ||||||||||||||||||||||||
| 4290 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 4291 | } | - | ||||||||||||||||||||||||
| 4292 | - | |||||||||||||||||||||||||
| 4293 | quint16 buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 4294 | - | |||||||||||||||||||||||||
| 4295 | const int src_minx = data->texture.x1; | - | ||||||||||||||||||||||||
| 4296 | const int src_miny = data->texture.y1; | - | ||||||||||||||||||||||||
| 4297 | const int src_maxx = data->texture.x2 - 1; | - | ||||||||||||||||||||||||
| 4298 | const int src_maxy = data->texture.y2 - 1; | - | ||||||||||||||||||||||||
| 4299 | - | |||||||||||||||||||||||||
| 4300 | if (data->fast_matrix
| 0 | ||||||||||||||||||||||||
| 4301 | - | |||||||||||||||||||||||||
| 4302 | const int fdx = (int)(data->m11 * fixed_scale); | - | ||||||||||||||||||||||||
| 4303 | const int fdy = (int)(data->m12 * fixed_scale); | - | ||||||||||||||||||||||||
| 4304 | - | |||||||||||||||||||||||||
| 4305 | while (count--
| 0 | ||||||||||||||||||||||||
| 4306 | const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8; | - | ||||||||||||||||||||||||
| 4307 | const quint8 alpha = (coverage + 1) >> 3; | - | ||||||||||||||||||||||||
| 4308 | const quint8 ialpha = 0x20 - alpha; | - | ||||||||||||||||||||||||
| 4309 | if (alpha == 0
| 0 | ||||||||||||||||||||||||
| 4310 | ++spans; | - | ||||||||||||||||||||||||
| 4311 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 4312 | } | - | ||||||||||||||||||||||||
| 4313 | - | |||||||||||||||||||||||||
| 4314 | quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x; | - | ||||||||||||||||||||||||
| 4315 | const qreal cx = spans->x + qreal(0.5); | - | ||||||||||||||||||||||||
| 4316 | const qreal cy = spans->y + qreal(0.5); | - | ||||||||||||||||||||||||
| 4317 | int x = int((data->m21 * cy | - | ||||||||||||||||||||||||
| 4318 | + data->m11 * cx + data->dx) * fixed_scale) - half_point; | - | ||||||||||||||||||||||||
| 4319 | int y = int((data->m22 * cy | - | ||||||||||||||||||||||||
| 4320 | + data->m12 * cx + data->dy) * fixed_scale) - half_point; | - | ||||||||||||||||||||||||
| 4321 | int length = spans->len; | - | ||||||||||||||||||||||||
| 4322 | - | |||||||||||||||||||||||||
| 4323 | while (length
| 0 | ||||||||||||||||||||||||
| 4324 | int l; | - | ||||||||||||||||||||||||
| 4325 | quint16 *b; | - | ||||||||||||||||||||||||
| 4326 | if (ialpha == 0
| 0 | ||||||||||||||||||||||||
| 4327 | l = length; | - | ||||||||||||||||||||||||
| 4328 | b = dest; | - | ||||||||||||||||||||||||
| 4329 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 4330 | l = qMin(length, buffer_size); | - | ||||||||||||||||||||||||
| 4331 | b = buffer; | - | ||||||||||||||||||||||||
| 4332 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4333 | const quint16 *end = b + l; | - | ||||||||||||||||||||||||
| 4334 | - | |||||||||||||||||||||||||
| 4335 | while (b < end
| 0 | ||||||||||||||||||||||||
| 4336 | int x1 = (x >> 16); | - | ||||||||||||||||||||||||
| 4337 | int x2; | - | ||||||||||||||||||||||||
| 4338 | int y1 = (y >> 16); | - | ||||||||||||||||||||||||
| 4339 | int y2; | - | ||||||||||||||||||||||||
| 4340 | - | |||||||||||||||||||||||||
| 4341 | fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(0, src_minx, src_maxx, x1, x2); | - | ||||||||||||||||||||||||
| 4342 | fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(0, src_miny, src_maxy, y1, y2); | - | ||||||||||||||||||||||||
| 4343 | - | |||||||||||||||||||||||||
| 4344 | const quint16 *src1 = (const quint16*)data->texture.scanLine(y1); | - | ||||||||||||||||||||||||
| 4345 | const quint16 *src2 = (const quint16*)data->texture.scanLine(y2); | - | ||||||||||||||||||||||||
| 4346 | quint16 tl = src1[x1]; | - | ||||||||||||||||||||||||
| 4347 | const quint16 tr = src1[x2]; | - | ||||||||||||||||||||||||
| 4348 | quint16 bl = src2[x1]; | - | ||||||||||||||||||||||||
| 4349 | const quint16 br = src2[x2]; | - | ||||||||||||||||||||||||
| 4350 | - | |||||||||||||||||||||||||
| 4351 | const uint distxsl8 = x & 0xff00; | - | ||||||||||||||||||||||||
| 4352 | const uint distysl8 = y & 0xff00; | - | ||||||||||||||||||||||||
| 4353 | const uint distx = distxsl8 >> 8; | - | ||||||||||||||||||||||||
| 4354 | const uint disty = distysl8 >> 8; | - | ||||||||||||||||||||||||
| 4355 | const uint distxy = distx * disty; | - | ||||||||||||||||||||||||
| 4356 | - | |||||||||||||||||||||||||
| 4357 | const uint tlw = 0x10000 - distxsl8 - distysl8 + distxy; | - | ||||||||||||||||||||||||
| 4358 | const uint trw = distxsl8 - distxy; | - | ||||||||||||||||||||||||
| 4359 | const uint blw = distysl8 - distxy; | - | ||||||||||||||||||||||||
| 4360 | const uint brw = distxy; | - | ||||||||||||||||||||||||
| 4361 | uint red = ((tl & 0xf800) * tlw + (tr & 0xf800) * trw | - | ||||||||||||||||||||||||
| 4362 | + (bl & 0xf800) * blw + (br & 0xf800) * brw) & 0xf8000000; | - | ||||||||||||||||||||||||
| 4363 | uint green = ((tl & 0x07e0) * tlw + (tr & 0x07e0) * trw | - | ||||||||||||||||||||||||
| 4364 | + (bl & 0x07e0) * blw + (br & 0x07e0) * brw) & 0x07e00000; | - | ||||||||||||||||||||||||
| 4365 | uint blue = ((tl & 0x001f) * tlw + (tr & 0x001f) * trw | - | ||||||||||||||||||||||||
| 4366 | + (bl & 0x001f) * blw + (br & 0x001f) * brw); | - | ||||||||||||||||||||||||
| 4367 | *b = quint16((red | green | blue) >> 16); | - | ||||||||||||||||||||||||
| 4368 | - | |||||||||||||||||||||||||
| 4369 | ++b; | - | ||||||||||||||||||||||||
| 4370 | x += fdx; | - | ||||||||||||||||||||||||
| 4371 | y += fdy; | - | ||||||||||||||||||||||||
| 4372 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4373 | - | |||||||||||||||||||||||||
| 4374 | if (ialpha != 0
| 0 | ||||||||||||||||||||||||
| 4375 | blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); | 0 | ||||||||||||||||||||||||
| 4376 | - | |||||||||||||||||||||||||
| 4377 | dest += l; | - | ||||||||||||||||||||||||
| 4378 | length -= l; | - | ||||||||||||||||||||||||
| 4379 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4380 | ++spans; | - | ||||||||||||||||||||||||
| 4381 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4382 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 4383 | const qreal fdx = data->m11; | - | ||||||||||||||||||||||||
| 4384 | const qreal fdy = data->m12; | - | ||||||||||||||||||||||||
| 4385 | const qreal fdw = data->m13; | - | ||||||||||||||||||||||||
| 4386 | - | |||||||||||||||||||||||||
| 4387 | while (count--
| 0 | ||||||||||||||||||||||||
| 4388 | const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8; | - | ||||||||||||||||||||||||
| 4389 | const quint8 alpha = (coverage + 1) >> 3; | - | ||||||||||||||||||||||||
| 4390 | const quint8 ialpha = 0x20 - alpha; | - | ||||||||||||||||||||||||
| 4391 | if (alpha == 0
| 0 | ||||||||||||||||||||||||
| 4392 | ++spans; | - | ||||||||||||||||||||||||
| 4393 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 4394 | } | - | ||||||||||||||||||||||||
| 4395 | - | |||||||||||||||||||||||||
| 4396 | quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x; | - | ||||||||||||||||||||||||
| 4397 | - | |||||||||||||||||||||||||
| 4398 | const qreal cx = spans->x + qreal(0.5); | - | ||||||||||||||||||||||||
| 4399 | const qreal cy = spans->y + qreal(0.5); | - | ||||||||||||||||||||||||
| 4400 | - | |||||||||||||||||||||||||
| 4401 | qreal x = data->m21 * cy + data->m11 * cx + data->dx; | - | ||||||||||||||||||||||||
| 4402 | qreal y = data->m22 * cy + data->m12 * cx + data->dy; | - | ||||||||||||||||||||||||
| 4403 | qreal w = data->m23 * cy + data->m13 * cx + data->m33; | - | ||||||||||||||||||||||||
| 4404 | - | |||||||||||||||||||||||||
| 4405 | int length = spans->len; | - | ||||||||||||||||||||||||
| 4406 | while (length
| 0 | ||||||||||||||||||||||||
| 4407 | int l; | - | ||||||||||||||||||||||||
| 4408 | quint16 *b; | - | ||||||||||||||||||||||||
| 4409 | if (ialpha == 0
| 0 | ||||||||||||||||||||||||
| 4410 | l = length; | - | ||||||||||||||||||||||||
| 4411 | b = dest; | - | ||||||||||||||||||||||||
| 4412 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 4413 | l = qMin(length, buffer_size); | - | ||||||||||||||||||||||||
| 4414 | b = buffer; | - | ||||||||||||||||||||||||
| 4415 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4416 | const quint16 *end = b + l; | - | ||||||||||||||||||||||||
| 4417 | - | |||||||||||||||||||||||||
| 4418 | while (b < end
| 0 | ||||||||||||||||||||||||
| 4419 | const qreal iw = w == 0
| 0 | ||||||||||||||||||||||||
| 4420 | const qreal px = x * iw - qreal(0.5); | - | ||||||||||||||||||||||||
| 4421 | const qreal py = y * iw - qreal(0.5); | - | ||||||||||||||||||||||||
| 4422 | - | |||||||||||||||||||||||||
| 4423 | int x1 = int(px) - (px < 0); | - | ||||||||||||||||||||||||
| 4424 | int x2; | - | ||||||||||||||||||||||||
| 4425 | int y1 = int(py) - (py < 0); | - | ||||||||||||||||||||||||
| 4426 | int y2; | - | ||||||||||||||||||||||||
| 4427 | - | |||||||||||||||||||||||||
| 4428 | fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(0, src_minx, src_maxx, x1, x2); | - | ||||||||||||||||||||||||
| 4429 | fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(0, src_miny, src_maxy, y1, y2); | - | ||||||||||||||||||||||||
| 4430 | - | |||||||||||||||||||||||||
| 4431 | const quint16 *src1 = (const quint16 *)data->texture.scanLine(y1); | - | ||||||||||||||||||||||||
| 4432 | const quint16 *src2 = (const quint16 *)data->texture.scanLine(y2); | - | ||||||||||||||||||||||||
| 4433 | quint16 tl = src1[x1]; | - | ||||||||||||||||||||||||
| 4434 | const quint16 tr = src1[x2]; | - | ||||||||||||||||||||||||
| 4435 | quint16 bl = src2[x1]; | - | ||||||||||||||||||||||||
| 4436 | const quint16 br = src2[x2]; | - | ||||||||||||||||||||||||
| 4437 | - | |||||||||||||||||||||||||
| 4438 | const uint distx = uint((px - x1) * 256); | - | ||||||||||||||||||||||||
| 4439 | const uint disty = uint((py - y1) * 256); | - | ||||||||||||||||||||||||
| 4440 | const uint distxsl8 = distx << 8; | - | ||||||||||||||||||||||||
| 4441 | const uint distysl8 = disty << 8; | - | ||||||||||||||||||||||||
| 4442 | const uint distxy = distx * disty; | - | ||||||||||||||||||||||||
| 4443 | - | |||||||||||||||||||||||||
| 4444 | const uint tlw = 0x10000 - distxsl8 - distysl8 + distxy; | - | ||||||||||||||||||||||||
| 4445 | const uint trw = distxsl8 - distxy; | - | ||||||||||||||||||||||||
| 4446 | const uint blw = distysl8 - distxy; | - | ||||||||||||||||||||||||
| 4447 | const uint brw = distxy; | - | ||||||||||||||||||||||||
| 4448 | uint red = ((tl & 0xf800) * tlw + (tr & 0xf800) * trw | - | ||||||||||||||||||||||||
| 4449 | + (bl & 0xf800) * blw + (br & 0xf800) * brw) & 0xf8000000; | - | ||||||||||||||||||||||||
| 4450 | uint green = ((tl & 0x07e0) * tlw + (tr & 0x07e0) * trw | - | ||||||||||||||||||||||||
| 4451 | + (bl & 0x07e0) * blw + (br & 0x07e0) * brw) & 0x07e00000; | - | ||||||||||||||||||||||||
| 4452 | uint blue = ((tl & 0x001f) * tlw + (tr & 0x001f) * trw | - | ||||||||||||||||||||||||
| 4453 | + (bl & 0x001f) * blw + (br & 0x001f) * brw); | - | ||||||||||||||||||||||||
| 4454 | *b = quint16((red | green | blue) >> 16); | - | ||||||||||||||||||||||||
| 4455 | - | |||||||||||||||||||||||||
| 4456 | ++b; | - | ||||||||||||||||||||||||
| 4457 | x += fdx; | - | ||||||||||||||||||||||||
| 4458 | y += fdy; | - | ||||||||||||||||||||||||
| 4459 | w += fdw; | - | ||||||||||||||||||||||||
| 4460 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4461 | - | |||||||||||||||||||||||||
| 4462 | if (ialpha != 0
| 0 | ||||||||||||||||||||||||
| 4463 | blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); | 0 | ||||||||||||||||||||||||
| 4464 | - | |||||||||||||||||||||||||
| 4465 | dest += l; | - | ||||||||||||||||||||||||
| 4466 | length -= l; | - | ||||||||||||||||||||||||
| 4467 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4468 | ++spans; | - | ||||||||||||||||||||||||
| 4469 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4470 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4471 | } | - | ||||||||||||||||||||||||
| 4472 | - | |||||||||||||||||||||||||
| 4473 | static void blend_transformed_argb(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 4474 | { | - | ||||||||||||||||||||||||
| 4475 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 4476 | if (data->texture.format != QImage::Format_ARGB32_Premultiplied
| 0 | ||||||||||||||||||||||||
| 4477 | && data->texture.format != QImage::Format_RGB32
| 0 | ||||||||||||||||||||||||
| 4478 | blend_src_generic(count, spans, userData); | - | ||||||||||||||||||||||||
| 4479 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 4480 | } | - | ||||||||||||||||||||||||
| 4481 | - | |||||||||||||||||||||||||
| 4482 | CompositionFunction func = functionForMode[data->rasterBuffer->compositionMode]; | - | ||||||||||||||||||||||||
| 4483 | uint buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 4484 | - | |||||||||||||||||||||||||
| 4485 | int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 4486 | int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 4487 | - | |||||||||||||||||||||||||
| 4488 | if (data->fast_matrix
| 0 | ||||||||||||||||||||||||
| 4489 | - | |||||||||||||||||||||||||
| 4490 | int fdx = (int)(data->m11 * fixed_scale); | - | ||||||||||||||||||||||||
| 4491 | int fdy = (int)(data->m12 * fixed_scale); | - | ||||||||||||||||||||||||
| 4492 | - | |||||||||||||||||||||||||
| 4493 | while (count--
| 0 | ||||||||||||||||||||||||
| 4494 | void *t = data->rasterBuffer->scanLine(spans->y); | - | ||||||||||||||||||||||||
| 4495 | - | |||||||||||||||||||||||||
| 4496 | uint *target = ((uint *)t) + spans->x; | - | ||||||||||||||||||||||||
| 4497 | - | |||||||||||||||||||||||||
| 4498 | const qreal cx = spans->x + qreal(0.5); | - | ||||||||||||||||||||||||
| 4499 | const qreal cy = spans->y + qreal(0.5); | - | ||||||||||||||||||||||||
| 4500 | - | |||||||||||||||||||||||||
| 4501 | int x = int((data->m21 * cy | - | ||||||||||||||||||||||||
| 4502 | + data->m11 * cx + data->dx) * fixed_scale); | - | ||||||||||||||||||||||||
| 4503 | int y = int((data->m22 * cy | - | ||||||||||||||||||||||||
| 4504 | + data->m12 * cx + data->dy) * fixed_scale); | - | ||||||||||||||||||||||||
| 4505 | - | |||||||||||||||||||||||||
| 4506 | int length = spans->len; | - | ||||||||||||||||||||||||
| 4507 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - | ||||||||||||||||||||||||
| 4508 | while (length
| 0 | ||||||||||||||||||||||||
| 4509 | int l = qMin(length, buffer_size); | - | ||||||||||||||||||||||||
| 4510 | const uint *end = buffer + l; | - | ||||||||||||||||||||||||
| 4511 | uint *b = buffer; | - | ||||||||||||||||||||||||
| 4512 | while (b < end
| 0 | ||||||||||||||||||||||||
| 4513 | int px = qBound(0, x >> 16, image_width - 1); | - | ||||||||||||||||||||||||
| 4514 | int py = qBound(0, y >> 16, image_height - 1); | - | ||||||||||||||||||||||||
| 4515 | *b = reinterpret_cast<const uint *>(data->texture.scanLine(py))[px]; | - | ||||||||||||||||||||||||
| 4516 | - | |||||||||||||||||||||||||
| 4517 | x += fdx; | - | ||||||||||||||||||||||||
| 4518 | y += fdy; | - | ||||||||||||||||||||||||
| 4519 | ++b; | - | ||||||||||||||||||||||||
| 4520 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4521 | func(target, buffer, l, coverage); | - | ||||||||||||||||||||||||
| 4522 | target += l; | - | ||||||||||||||||||||||||
| 4523 | length -= l; | - | ||||||||||||||||||||||||
| 4524 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4525 | ++spans; | - | ||||||||||||||||||||||||
| 4526 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4527 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 4528 | const qreal fdx = data->m11; | - | ||||||||||||||||||||||||
| 4529 | const qreal fdy = data->m12; | - | ||||||||||||||||||||||||
| 4530 | const qreal fdw = data->m13; | - | ||||||||||||||||||||||||
| 4531 | while (count--
| 0 | ||||||||||||||||||||||||
| 4532 | void *t = data->rasterBuffer->scanLine(spans->y); | - | ||||||||||||||||||||||||
| 4533 | - | |||||||||||||||||||||||||
| 4534 | uint *target = ((uint *)t) + spans->x; | - | ||||||||||||||||||||||||
| 4535 | - | |||||||||||||||||||||||||
| 4536 | const qreal cx = spans->x + qreal(0.5); | - | ||||||||||||||||||||||||
| 4537 | const qreal cy = spans->y + qreal(0.5); | - | ||||||||||||||||||||||||
| 4538 | - | |||||||||||||||||||||||||
| 4539 | qreal x = data->m21 * cy + data->m11 * cx + data->dx; | - | ||||||||||||||||||||||||
| 4540 | qreal y = data->m22 * cy + data->m12 * cx + data->dy; | - | ||||||||||||||||||||||||
| 4541 | qreal w = data->m23 * cy + data->m13 * cx + data->m33; | - | ||||||||||||||||||||||||
| 4542 | - | |||||||||||||||||||||||||
| 4543 | int length = spans->len; | - | ||||||||||||||||||||||||
| 4544 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - | ||||||||||||||||||||||||
| 4545 | while (length
| 0 | ||||||||||||||||||||||||
| 4546 | int l = qMin(length, buffer_size); | - | ||||||||||||||||||||||||
| 4547 | const uint *end = buffer + l; | - | ||||||||||||||||||||||||
| 4548 | uint *b = buffer; | - | ||||||||||||||||||||||||
| 4549 | while (b < end
| 0 | ||||||||||||||||||||||||
| 4550 | const qreal iw = w == 0
| 0 | ||||||||||||||||||||||||
| 4551 | const qreal tx = x * iw; | - | ||||||||||||||||||||||||
| 4552 | const qreal ty = y * iw; | - | ||||||||||||||||||||||||
| 4553 | const int px = qBound(0, int(tx) - (tx < 0), image_width - 1); | - | ||||||||||||||||||||||||
| 4554 | const int py = qBound(0, int(ty) - (ty < 0), image_height - 1); | - | ||||||||||||||||||||||||
| 4555 | - | |||||||||||||||||||||||||
| 4556 | *b = reinterpret_cast<const uint *>(data->texture.scanLine(py))[px]; | - | ||||||||||||||||||||||||
| 4557 | x += fdx; | - | ||||||||||||||||||||||||
| 4558 | y += fdy; | - | ||||||||||||||||||||||||
| 4559 | w += fdw; | - | ||||||||||||||||||||||||
| 4560 | - | |||||||||||||||||||||||||
| 4561 | ++b; | - | ||||||||||||||||||||||||
| 4562 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4563 | func(target, buffer, l, coverage); | - | ||||||||||||||||||||||||
| 4564 | target += l; | - | ||||||||||||||||||||||||
| 4565 | length -= l; | - | ||||||||||||||||||||||||
| 4566 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4567 | ++spans; | - | ||||||||||||||||||||||||
| 4568 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4569 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4570 | } | - | ||||||||||||||||||||||||
| 4571 | - | |||||||||||||||||||||||||
| 4572 | static void blend_transformed_rgb565(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 4573 | { | - | ||||||||||||||||||||||||
| 4574 | QSpanData *data = reinterpret_cast<QSpanData*>(userData); | - | ||||||||||||||||||||||||
| 4575 | QPainter::CompositionMode mode = data->rasterBuffer->compositionMode; | - | ||||||||||||||||||||||||
| 4576 | - | |||||||||||||||||||||||||
| 4577 | if (data->texture.format != QImage::Format_RGB16
| 0 | ||||||||||||||||||||||||
| 4578 | || (mode != QPainter::CompositionMode_SourceOver
| 0 | ||||||||||||||||||||||||
| 4579 | && mode != QPainter::CompositionMode_Source
| 0 | ||||||||||||||||||||||||
| 4580 | { | - | ||||||||||||||||||||||||
| 4581 | blend_src_generic(count, spans, userData); | - | ||||||||||||||||||||||||
| 4582 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 4583 | } | - | ||||||||||||||||||||||||
| 4584 | - | |||||||||||||||||||||||||
| 4585 | quint16 buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 4586 | const int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 4587 | const int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 4588 | - | |||||||||||||||||||||||||
| 4589 | if (data->fast_matrix
| 0 | ||||||||||||||||||||||||
| 4590 | - | |||||||||||||||||||||||||
| 4591 | const int fdx = (int)(data->m11 * fixed_scale); | - | ||||||||||||||||||||||||
| 4592 | const int fdy = (int)(data->m12 * fixed_scale); | - | ||||||||||||||||||||||||
| 4593 | - | |||||||||||||||||||||||||
| 4594 | while (count--
| 0 | ||||||||||||||||||||||||
| 4595 | const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8; | - | ||||||||||||||||||||||||
| 4596 | const quint8 alpha = (coverage + 1) >> 3; | - | ||||||||||||||||||||||||
| 4597 | const quint8 ialpha = 0x20 - alpha; | - | ||||||||||||||||||||||||
| 4598 | if (alpha == 0
| 0 | ||||||||||||||||||||||||
| 4599 | ++spans; | - | ||||||||||||||||||||||||
| 4600 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 4601 | } | - | ||||||||||||||||||||||||
| 4602 | - | |||||||||||||||||||||||||
| 4603 | quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x; | - | ||||||||||||||||||||||||
| 4604 | const qreal cx = spans->x + qreal(0.5); | - | ||||||||||||||||||||||||
| 4605 | const qreal cy = spans->y + qreal(0.5); | - | ||||||||||||||||||||||||
| 4606 | int x = int((data->m21 * cy | - | ||||||||||||||||||||||||
| 4607 | + data->m11 * cx + data->dx) * fixed_scale); | - | ||||||||||||||||||||||||
| 4608 | int y = int((data->m22 * cy | - | ||||||||||||||||||||||||
| 4609 | + data->m12 * cx + data->dy) * fixed_scale); | - | ||||||||||||||||||||||||
| 4610 | int length = spans->len; | - | ||||||||||||||||||||||||
| 4611 | - | |||||||||||||||||||||||||
| 4612 | while (length
| 0 | ||||||||||||||||||||||||
| 4613 | int l; | - | ||||||||||||||||||||||||
| 4614 | quint16 *b; | - | ||||||||||||||||||||||||
| 4615 | if (ialpha == 0
| 0 | ||||||||||||||||||||||||
| 4616 | l = length; | - | ||||||||||||||||||||||||
| 4617 | b = dest; | - | ||||||||||||||||||||||||
| 4618 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 4619 | l = qMin(length, buffer_size); | - | ||||||||||||||||||||||||
| 4620 | b = buffer; | - | ||||||||||||||||||||||||
| 4621 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4622 | const quint16 *end = b + l; | - | ||||||||||||||||||||||||
| 4623 | - | |||||||||||||||||||||||||
| 4624 | while (b < end
| 0 | ||||||||||||||||||||||||
| 4625 | const int px = qBound(0, x >> 16, image_width - 1); | - | ||||||||||||||||||||||||
| 4626 | const int py = qBound(0, y >> 16, image_height - 1); | - | ||||||||||||||||||||||||
| 4627 | - | |||||||||||||||||||||||||
| 4628 | *b = ((const quint16 *)data->texture.scanLine(py))[px]; | - | ||||||||||||||||||||||||
| 4629 | ++b; | - | ||||||||||||||||||||||||
| 4630 | - | |||||||||||||||||||||||||
| 4631 | x += fdx; | - | ||||||||||||||||||||||||
| 4632 | y += fdy; | - | ||||||||||||||||||||||||
| 4633 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4634 | - | |||||||||||||||||||||||||
| 4635 | if (ialpha != 0
| 0 | ||||||||||||||||||||||||
| 4636 | blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); | 0 | ||||||||||||||||||||||||
| 4637 | - | |||||||||||||||||||||||||
| 4638 | dest += l; | - | ||||||||||||||||||||||||
| 4639 | length -= l; | - | ||||||||||||||||||||||||
| 4640 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4641 | ++spans; | - | ||||||||||||||||||||||||
| 4642 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4643 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 4644 | const qreal fdx = data->m11; | - | ||||||||||||||||||||||||
| 4645 | const qreal fdy = data->m12; | - | ||||||||||||||||||||||||
| 4646 | const qreal fdw = data->m13; | - | ||||||||||||||||||||||||
| 4647 | - | |||||||||||||||||||||||||
| 4648 | while (count--
| 0 | ||||||||||||||||||||||||
| 4649 | const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8; | - | ||||||||||||||||||||||||
| 4650 | const quint8 alpha = (coverage + 1) >> 3; | - | ||||||||||||||||||||||||
| 4651 | const quint8 ialpha = 0x20 - alpha; | - | ||||||||||||||||||||||||
| 4652 | if (alpha == 0
| 0 | ||||||||||||||||||||||||
| 4653 | ++spans; | - | ||||||||||||||||||||||||
| 4654 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 4655 | } | - | ||||||||||||||||||||||||
| 4656 | - | |||||||||||||||||||||||||
| 4657 | quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x; | - | ||||||||||||||||||||||||
| 4658 | - | |||||||||||||||||||||||||
| 4659 | const qreal cx = spans->x + qreal(0.5); | - | ||||||||||||||||||||||||
| 4660 | const qreal cy = spans->y + qreal(0.5); | - | ||||||||||||||||||||||||
| 4661 | - | |||||||||||||||||||||||||
| 4662 | qreal x = data->m21 * cy + data->m11 * cx + data->dx; | - | ||||||||||||||||||||||||
| 4663 | qreal y = data->m22 * cy + data->m12 * cx + data->dy; | - | ||||||||||||||||||||||||
| 4664 | qreal w = data->m23 * cy + data->m13 * cx + data->m33; | - | ||||||||||||||||||||||||
| 4665 | - | |||||||||||||||||||||||||
| 4666 | int length = spans->len; | - | ||||||||||||||||||||||||
| 4667 | while (length
| 0 | ||||||||||||||||||||||||
| 4668 | int l; | - | ||||||||||||||||||||||||
| 4669 | quint16 *b; | - | ||||||||||||||||||||||||
| 4670 | if (ialpha == 0
| 0 | ||||||||||||||||||||||||
| 4671 | l = length; | - | ||||||||||||||||||||||||
| 4672 | b = dest; | - | ||||||||||||||||||||||||
| 4673 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 4674 | l = qMin(length, buffer_size); | - | ||||||||||||||||||||||||
| 4675 | b = buffer; | - | ||||||||||||||||||||||||
| 4676 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4677 | const quint16 *end = b + l; | - | ||||||||||||||||||||||||
| 4678 | - | |||||||||||||||||||||||||
| 4679 | while (b < end
| 0 | ||||||||||||||||||||||||
| 4680 | const qreal iw = w == 0
| 0 | ||||||||||||||||||||||||
| 4681 | const qreal tx = x * iw; | - | ||||||||||||||||||||||||
| 4682 | const qreal ty = y * iw; | - | ||||||||||||||||||||||||
| 4683 | - | |||||||||||||||||||||||||
| 4684 | const int px = qBound(0, int(tx) - (tx < 0), image_width - 1); | - | ||||||||||||||||||||||||
| 4685 | const int py = qBound(0, int(ty) - (ty < 0), image_height - 1); | - | ||||||||||||||||||||||||
| 4686 | - | |||||||||||||||||||||||||
| 4687 | *b = ((const quint16 *)data->texture.scanLine(py))[px]; | - | ||||||||||||||||||||||||
| 4688 | ++b; | - | ||||||||||||||||||||||||
| 4689 | - | |||||||||||||||||||||||||
| 4690 | x += fdx; | - | ||||||||||||||||||||||||
| 4691 | y += fdy; | - | ||||||||||||||||||||||||
| 4692 | w += fdw; | - | ||||||||||||||||||||||||
| 4693 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4694 | - | |||||||||||||||||||||||||
| 4695 | if (ialpha != 0
| 0 | ||||||||||||||||||||||||
| 4696 | blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); | 0 | ||||||||||||||||||||||||
| 4697 | - | |||||||||||||||||||||||||
| 4698 | dest += l; | - | ||||||||||||||||||||||||
| 4699 | length -= l; | - | ||||||||||||||||||||||||
| 4700 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4701 | ++spans; | - | ||||||||||||||||||||||||
| 4702 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4703 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4704 | } | - | ||||||||||||||||||||||||
| 4705 | - | |||||||||||||||||||||||||
| 4706 | static void blend_transformed_tiled_argb(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 4707 | { | - | ||||||||||||||||||||||||
| 4708 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 4709 | if (data->texture.format != QImage::Format_ARGB32_Premultiplied
| 0 | ||||||||||||||||||||||||
| 4710 | && data->texture.format != QImage::Format_RGB32
| 0 | ||||||||||||||||||||||||
| 4711 | blend_src_generic(count, spans, userData); | - | ||||||||||||||||||||||||
| 4712 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 4713 | } | - | ||||||||||||||||||||||||
| 4714 | - | |||||||||||||||||||||||||
| 4715 | CompositionFunction func = functionForMode[data->rasterBuffer->compositionMode]; | - | ||||||||||||||||||||||||
| 4716 | uint buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 4717 | - | |||||||||||||||||||||||||
| 4718 | int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 4719 | int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 4720 | const int scanline_offset = data->texture.bytesPerLine / 4; | - | ||||||||||||||||||||||||
| 4721 | - | |||||||||||||||||||||||||
| 4722 | if (data->fast_matrix
| 0 | ||||||||||||||||||||||||
| 4723 | - | |||||||||||||||||||||||||
| 4724 | int fdx = (int)(data->m11 * fixed_scale); | - | ||||||||||||||||||||||||
| 4725 | int fdy = (int)(data->m12 * fixed_scale); | - | ||||||||||||||||||||||||
| 4726 | - | |||||||||||||||||||||||||
| 4727 | while (count--
| 0 | ||||||||||||||||||||||||
| 4728 | void *t = data->rasterBuffer->scanLine(spans->y); | - | ||||||||||||||||||||||||
| 4729 | - | |||||||||||||||||||||||||
| 4730 | uint *target = ((uint *)t) + spans->x; | - | ||||||||||||||||||||||||
| 4731 | const uint *image_bits = (const uint *)data->texture.imageData; | - | ||||||||||||||||||||||||
| 4732 | - | |||||||||||||||||||||||||
| 4733 | const qreal cx = spans->x + qreal(0.5); | - | ||||||||||||||||||||||||
| 4734 | const qreal cy = spans->y + qreal(0.5); | - | ||||||||||||||||||||||||
| 4735 | - | |||||||||||||||||||||||||
| 4736 | int x = int((data->m21 * cy | - | ||||||||||||||||||||||||
| 4737 | + data->m11 * cx + data->dx) * fixed_scale); | - | ||||||||||||||||||||||||
| 4738 | int y = int((data->m22 * cy | - | ||||||||||||||||||||||||
| 4739 | + data->m12 * cx + data->dy) * fixed_scale); | - | ||||||||||||||||||||||||
| 4740 | - | |||||||||||||||||||||||||
| 4741 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - | ||||||||||||||||||||||||
| 4742 | int length = spans->len; | - | ||||||||||||||||||||||||
| 4743 | while (length
| 0 | ||||||||||||||||||||||||
| 4744 | int l = qMin(length, buffer_size); | - | ||||||||||||||||||||||||
| 4745 | const uint *end = buffer + l; | - | ||||||||||||||||||||||||
| 4746 | uint *b = buffer; | - | ||||||||||||||||||||||||
| 4747 | int px16 = x % (image_width << 16); | - | ||||||||||||||||||||||||
| 4748 | int py16 = y % (image_height << 16); | - | ||||||||||||||||||||||||
| 4749 | int px_delta = fdx % (image_width << 16); | - | ||||||||||||||||||||||||
| 4750 | int py_delta = fdy % (image_height << 16); | - | ||||||||||||||||||||||||
| 4751 | while (b < end
| 0 | ||||||||||||||||||||||||
| 4752 | if (px16 < 0
never executed: px16 += image_width << 16; | 0 | ||||||||||||||||||||||||
| 4753 | if (py16 < 0
never executed: py16 += image_height << 16; | 0 | ||||||||||||||||||||||||
| 4754 | int px = px16 >> 16; | - | ||||||||||||||||||||||||
| 4755 | int py = py16 >> 16; | - | ||||||||||||||||||||||||
| 4756 | int y_offset = py * scanline_offset; | - | ||||||||||||||||||||||||
| 4757 | - | |||||||||||||||||||||||||
| 4758 | ((!(px >= 0 && px < image_width)) ? qt_assert("px >= 0 && px < image_width",__FILE__,5097) : qt_noop()); | - | ||||||||||||||||||||||||
| 4759 | ((!(py >= 0 && py < image_height)) ? qt_assert("py >= 0 && py < image_height",__FILE__,5098) : qt_noop()); | - | ||||||||||||||||||||||||
| 4760 | - | |||||||||||||||||||||||||
| 4761 | *b = image_bits[y_offset + px]; | - | ||||||||||||||||||||||||
| 4762 | x += fdx; | - | ||||||||||||||||||||||||
| 4763 | y += fdy; | - | ||||||||||||||||||||||||
| 4764 | px16 += px_delta; | - | ||||||||||||||||||||||||
| 4765 | if (px16 >= image_width << 16
| 0 | ||||||||||||||||||||||||
| 4766 | px16 -= image_width << 16; never executed: px16 -= image_width << 16; | 0 | ||||||||||||||||||||||||
| 4767 | py16 += py_delta; | - | ||||||||||||||||||||||||
| 4768 | if (py16 >= image_height << 16
| 0 | ||||||||||||||||||||||||
| 4769 | py16 -= image_height << 16; never executed: py16 -= image_height << 16; | 0 | ||||||||||||||||||||||||
| 4770 | ++b; | - | ||||||||||||||||||||||||
| 4771 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4772 | func(target, buffer, l, coverage); | - | ||||||||||||||||||||||||
| 4773 | target += l; | - | ||||||||||||||||||||||||
| 4774 | length -= l; | - | ||||||||||||||||||||||||
| 4775 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4776 | ++spans; | - | ||||||||||||||||||||||||
| 4777 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4778 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 4779 | const qreal fdx = data->m11; | - | ||||||||||||||||||||||||
| 4780 | const qreal fdy = data->m12; | - | ||||||||||||||||||||||||
| 4781 | const qreal fdw = data->m13; | - | ||||||||||||||||||||||||
| 4782 | while (count--
| 0 | ||||||||||||||||||||||||
| 4783 | void *t = data->rasterBuffer->scanLine(spans->y); | - | ||||||||||||||||||||||||
| 4784 | - | |||||||||||||||||||||||||
| 4785 | uint *target = ((uint *)t) + spans->x; | - | ||||||||||||||||||||||||
| 4786 | const uint *image_bits = (const uint *)data->texture.imageData; | - | ||||||||||||||||||||||||
| 4787 | - | |||||||||||||||||||||||||
| 4788 | const qreal cx = spans->x + qreal(0.5); | - | ||||||||||||||||||||||||
| 4789 | const qreal cy = spans->y + qreal(0.5); | - | ||||||||||||||||||||||||
| 4790 | - | |||||||||||||||||||||||||
| 4791 | qreal x = data->m21 * cy + data->m11 * cx + data->dx; | - | ||||||||||||||||||||||||
| 4792 | qreal y = data->m22 * cy + data->m12 * cx + data->dy; | - | ||||||||||||||||||||||||
| 4793 | qreal w = data->m23 * cy + data->m13 * cx + data->m33; | - | ||||||||||||||||||||||||
| 4794 | - | |||||||||||||||||||||||||
| 4795 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - | ||||||||||||||||||||||||
| 4796 | int length = spans->len; | - | ||||||||||||||||||||||||
| 4797 | while (length
| 0 | ||||||||||||||||||||||||
| 4798 | int l = qMin(length, buffer_size); | - | ||||||||||||||||||||||||
| 4799 | const uint *end = buffer + l; | - | ||||||||||||||||||||||||
| 4800 | uint *b = buffer; | - | ||||||||||||||||||||||||
| 4801 | while (b < end
| 0 | ||||||||||||||||||||||||
| 4802 | const qreal iw = w == 0
| 0 | ||||||||||||||||||||||||
| 4803 | const qreal tx = x * iw; | - | ||||||||||||||||||||||||
| 4804 | const qreal ty = y * iw; | - | ||||||||||||||||||||||||
| 4805 | int px = int(tx) - (tx < 0); | - | ||||||||||||||||||||||||
| 4806 | int py = int(ty) - (ty < 0); | - | ||||||||||||||||||||||||
| 4807 | - | |||||||||||||||||||||||||
| 4808 | px %= image_width; | - | ||||||||||||||||||||||||
| 4809 | py %= image_height; | - | ||||||||||||||||||||||||
| 4810 | if (px < 0
never executed: px += image_width; | 0 | ||||||||||||||||||||||||
| 4811 | if (py < 0
never executed: py += image_height; | 0 | ||||||||||||||||||||||||
| 4812 | int y_offset = py * scanline_offset; | - | ||||||||||||||||||||||||
| 4813 | - | |||||||||||||||||||||||||
| 4814 | ((!(px >= 0 && px < image_width)) ? qt_assert("px >= 0 && px < image_width",__FILE__,5153) : qt_noop()); | - | ||||||||||||||||||||||||
| 4815 | ((!(py >= 0 && py < image_height)) ? qt_assert("py >= 0 && py < image_height",__FILE__,5154) : qt_noop()); | - | ||||||||||||||||||||||||
| 4816 | - | |||||||||||||||||||||||||
| 4817 | *b = image_bits[y_offset + px]; | - | ||||||||||||||||||||||||
| 4818 | x += fdx; | - | ||||||||||||||||||||||||
| 4819 | y += fdy; | - | ||||||||||||||||||||||||
| 4820 | w += fdw; | - | ||||||||||||||||||||||||
| 4821 | - | |||||||||||||||||||||||||
| 4822 | if (!w
| 0 | ||||||||||||||||||||||||
| 4823 | w += fdw; | - | ||||||||||||||||||||||||
| 4824 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4825 | ++b; | - | ||||||||||||||||||||||||
| 4826 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4827 | func(target, buffer, l, coverage); | - | ||||||||||||||||||||||||
| 4828 | target += l; | - | ||||||||||||||||||||||||
| 4829 | length -= l; | - | ||||||||||||||||||||||||
| 4830 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4831 | ++spans; | - | ||||||||||||||||||||||||
| 4832 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4833 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4834 | } | - | ||||||||||||||||||||||||
| 4835 | - | |||||||||||||||||||||||||
| 4836 | static void blend_transformed_tiled_rgb565(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 4837 | { | - | ||||||||||||||||||||||||
| 4838 | QSpanData *data = reinterpret_cast<QSpanData*>(userData); | - | ||||||||||||||||||||||||
| 4839 | QPainter::CompositionMode mode = data->rasterBuffer->compositionMode; | - | ||||||||||||||||||||||||
| 4840 | - | |||||||||||||||||||||||||
| 4841 | if (data->texture.format != QImage::Format_RGB16
| 0 | ||||||||||||||||||||||||
| 4842 | || (mode != QPainter::CompositionMode_SourceOver
| 0 | ||||||||||||||||||||||||
| 4843 | && mode != QPainter::CompositionMode_Source
| 0 | ||||||||||||||||||||||||
| 4844 | { | - | ||||||||||||||||||||||||
| 4845 | blend_src_generic(count, spans, userData); | - | ||||||||||||||||||||||||
| 4846 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 4847 | } | - | ||||||||||||||||||||||||
| 4848 | - | |||||||||||||||||||||||||
| 4849 | quint16 buffer[buffer_size]; | - | ||||||||||||||||||||||||
| 4850 | const int image_width = data->texture.width; | - | ||||||||||||||||||||||||
| 4851 | const int image_height = data->texture.height; | - | ||||||||||||||||||||||||
| 4852 | - | |||||||||||||||||||||||||
| 4853 | if (data->fast_matrix
| 0 | ||||||||||||||||||||||||
| 4854 | - | |||||||||||||||||||||||||
| 4855 | const int fdx = (int)(data->m11 * fixed_scale); | - | ||||||||||||||||||||||||
| 4856 | const int fdy = (int)(data->m12 * fixed_scale); | - | ||||||||||||||||||||||||
| 4857 | - | |||||||||||||||||||||||||
| 4858 | while (count--
| 0 | ||||||||||||||||||||||||
| 4859 | const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8; | - | ||||||||||||||||||||||||
| 4860 | const quint8 alpha = (coverage + 1) >> 3; | - | ||||||||||||||||||||||||
| 4861 | const quint8 ialpha = 0x20 - alpha; | - | ||||||||||||||||||||||||
| 4862 | if (alpha == 0
| 0 | ||||||||||||||||||||||||
| 4863 | ++spans; | - | ||||||||||||||||||||||||
| 4864 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 4865 | } | - | ||||||||||||||||||||||||
| 4866 | - | |||||||||||||||||||||||||
| 4867 | quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x; | - | ||||||||||||||||||||||||
| 4868 | const qreal cx = spans->x + qreal(0.5); | - | ||||||||||||||||||||||||
| 4869 | const qreal cy = spans->y + qreal(0.5); | - | ||||||||||||||||||||||||
| 4870 | int x = int((data->m21 * cy | - | ||||||||||||||||||||||||
| 4871 | + data->m11 * cx + data->dx) * fixed_scale); | - | ||||||||||||||||||||||||
| 4872 | int y = int((data->m22 * cy | - | ||||||||||||||||||||||||
| 4873 | + data->m12 * cx + data->dy) * fixed_scale); | - | ||||||||||||||||||||||||
| 4874 | int length = spans->len; | - | ||||||||||||||||||||||||
| 4875 | - | |||||||||||||||||||||||||
| 4876 | while (length
| 0 | ||||||||||||||||||||||||
| 4877 | int l; | - | ||||||||||||||||||||||||
| 4878 | quint16 *b; | - | ||||||||||||||||||||||||
| 4879 | if (ialpha == 0
| 0 | ||||||||||||||||||||||||
| 4880 | l = length; | - | ||||||||||||||||||||||||
| 4881 | b = dest; | - | ||||||||||||||||||||||||
| 4882 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 4883 | l = qMin(length, buffer_size); | - | ||||||||||||||||||||||||
| 4884 | b = buffer; | - | ||||||||||||||||||||||||
| 4885 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4886 | const quint16 *end = b + l; | - | ||||||||||||||||||||||||
| 4887 | - | |||||||||||||||||||||||||
| 4888 | while (b < end
| 0 | ||||||||||||||||||||||||
| 4889 | int px = (x >> 16) % image_width; | - | ||||||||||||||||||||||||
| 4890 | int py = (y >> 16) % image_height; | - | ||||||||||||||||||||||||
| 4891 | - | |||||||||||||||||||||||||
| 4892 | if (px < 0
| 0 | ||||||||||||||||||||||||
| 4893 | px += image_width; never executed: px += image_width; | 0 | ||||||||||||||||||||||||
| 4894 | if (py < 0
| 0 | ||||||||||||||||||||||||
| 4895 | py += image_height; never executed: py += image_height; | 0 | ||||||||||||||||||||||||
| 4896 | - | |||||||||||||||||||||||||
| 4897 | *b = ((const quint16 *)data->texture.scanLine(py))[px]; | - | ||||||||||||||||||||||||
| 4898 | ++b; | - | ||||||||||||||||||||||||
| 4899 | - | |||||||||||||||||||||||||
| 4900 | x += fdx; | - | ||||||||||||||||||||||||
| 4901 | y += fdy; | - | ||||||||||||||||||||||||
| 4902 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4903 | - | |||||||||||||||||||||||||
| 4904 | if (ialpha != 0
| 0 | ||||||||||||||||||||||||
| 4905 | blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); | 0 | ||||||||||||||||||||||||
| 4906 | - | |||||||||||||||||||||||||
| 4907 | dest += l; | - | ||||||||||||||||||||||||
| 4908 | length -= l; | - | ||||||||||||||||||||||||
| 4909 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4910 | ++spans; | - | ||||||||||||||||||||||||
| 4911 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4912 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 4913 | const qreal fdx = data->m11; | - | ||||||||||||||||||||||||
| 4914 | const qreal fdy = data->m12; | - | ||||||||||||||||||||||||
| 4915 | const qreal fdw = data->m13; | - | ||||||||||||||||||||||||
| 4916 | - | |||||||||||||||||||||||||
| 4917 | while (count--
| 0 | ||||||||||||||||||||||||
| 4918 | const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8; | - | ||||||||||||||||||||||||
| 4919 | const quint8 alpha = (coverage + 1) >> 3; | - | ||||||||||||||||||||||||
| 4920 | const quint8 ialpha = 0x20 - alpha; | - | ||||||||||||||||||||||||
| 4921 | if (alpha == 0
| 0 | ||||||||||||||||||||||||
| 4922 | ++spans; | - | ||||||||||||||||||||||||
| 4923 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 4924 | } | - | ||||||||||||||||||||||||
| 4925 | - | |||||||||||||||||||||||||
| 4926 | quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x; | - | ||||||||||||||||||||||||
| 4927 | - | |||||||||||||||||||||||||
| 4928 | const qreal cx = spans->x + qreal(0.5); | - | ||||||||||||||||||||||||
| 4929 | const qreal cy = spans->y + qreal(0.5); | - | ||||||||||||||||||||||||
| 4930 | - | |||||||||||||||||||||||||
| 4931 | qreal x = data->m21 * cy + data->m11 * cx + data->dx; | - | ||||||||||||||||||||||||
| 4932 | qreal y = data->m22 * cy + data->m12 * cx + data->dy; | - | ||||||||||||||||||||||||
| 4933 | qreal w = data->m23 * cy + data->m13 * cx + data->m33; | - | ||||||||||||||||||||||||
| 4934 | - | |||||||||||||||||||||||||
| 4935 | int length = spans->len; | - | ||||||||||||||||||||||||
| 4936 | while (length
| 0 | ||||||||||||||||||||||||
| 4937 | int l; | - | ||||||||||||||||||||||||
| 4938 | quint16 *b; | - | ||||||||||||||||||||||||
| 4939 | if (ialpha == 0
| 0 | ||||||||||||||||||||||||
| 4940 | l = length; | - | ||||||||||||||||||||||||
| 4941 | b = dest; | - | ||||||||||||||||||||||||
| 4942 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 4943 | l = qMin(length, buffer_size); | - | ||||||||||||||||||||||||
| 4944 | b = buffer; | - | ||||||||||||||||||||||||
| 4945 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4946 | const quint16 *end = b + l; | - | ||||||||||||||||||||||||
| 4947 | - | |||||||||||||||||||||||||
| 4948 | while (b < end
| 0 | ||||||||||||||||||||||||
| 4949 | const qreal iw = w == 0
| 0 | ||||||||||||||||||||||||
| 4950 | const qreal tx = x * iw; | - | ||||||||||||||||||||||||
| 4951 | const qreal ty = y * iw; | - | ||||||||||||||||||||||||
| 4952 | - | |||||||||||||||||||||||||
| 4953 | int px = int(tx) - (tx < 0); | - | ||||||||||||||||||||||||
| 4954 | int py = int(ty) - (ty < 0); | - | ||||||||||||||||||||||||
| 4955 | - | |||||||||||||||||||||||||
| 4956 | px %= image_width; | - | ||||||||||||||||||||||||
| 4957 | py %= image_height; | - | ||||||||||||||||||||||||
| 4958 | if (px < 0
| 0 | ||||||||||||||||||||||||
| 4959 | px += image_width; never executed: px += image_width; | 0 | ||||||||||||||||||||||||
| 4960 | if (py < 0
| 0 | ||||||||||||||||||||||||
| 4961 | py += image_height; never executed: py += image_height; | 0 | ||||||||||||||||||||||||
| 4962 | - | |||||||||||||||||||||||||
| 4963 | *b = ((const quint16 *)data->texture.scanLine(py))[px]; | - | ||||||||||||||||||||||||
| 4964 | ++b; | - | ||||||||||||||||||||||||
| 4965 | - | |||||||||||||||||||||||||
| 4966 | x += fdx; | - | ||||||||||||||||||||||||
| 4967 | y += fdy; | - | ||||||||||||||||||||||||
| 4968 | w += fdw; | - | ||||||||||||||||||||||||
| 4969 | - | |||||||||||||||||||||||||
| 4970 | if (!w
| 0 | ||||||||||||||||||||||||
| 4971 | w += fdw; never executed: w += fdw; | 0 | ||||||||||||||||||||||||
| 4972 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4973 | - | |||||||||||||||||||||||||
| 4974 | if (ialpha != 0
| 0 | ||||||||||||||||||||||||
| 4975 | blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); | 0 | ||||||||||||||||||||||||
| 4976 | - | |||||||||||||||||||||||||
| 4977 | dest += l; | - | ||||||||||||||||||||||||
| 4978 | length -= l; | - | ||||||||||||||||||||||||
| 4979 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4980 | ++spans; | - | ||||||||||||||||||||||||
| 4981 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4982 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4983 | } | - | ||||||||||||||||||||||||
| 4984 | - | |||||||||||||||||||||||||
| 4985 | - | |||||||||||||||||||||||||
| 4986 | - | |||||||||||||||||||||||||
| 4987 | static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats] = { | - | ||||||||||||||||||||||||
| 4988 | - | |||||||||||||||||||||||||
| 4989 | { | - | ||||||||||||||||||||||||
| 4990 | 0, | - | ||||||||||||||||||||||||
| 4991 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 4992 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 4993 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 4994 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 4995 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 4996 | blend_untransformed_argb, | - | ||||||||||||||||||||||||
| 4997 | blend_untransformed_rgb565, | - | ||||||||||||||||||||||||
| 4998 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 4999 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 5000 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 5001 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 5002 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 5003 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 5004 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 5005 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 5006 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 5007 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 5008 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 5009 | blend_untransformed_generic_rgb64, | - | ||||||||||||||||||||||||
| 5010 | blend_untransformed_generic_rgb64, | - | ||||||||||||||||||||||||
| 5011 | blend_untransformed_generic_rgb64, | - | ||||||||||||||||||||||||
| 5012 | blend_untransformed_generic_rgb64, | - | ||||||||||||||||||||||||
| 5013 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 5014 | blend_untransformed_generic, | - | ||||||||||||||||||||||||
| 5015 | }, | - | ||||||||||||||||||||||||
| 5016 | - | |||||||||||||||||||||||||
| 5017 | { | - | ||||||||||||||||||||||||
| 5018 | 0, | - | ||||||||||||||||||||||||
| 5019 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5020 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5021 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5022 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5023 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5024 | blend_tiled_argb, | - | ||||||||||||||||||||||||
| 5025 | blend_tiled_rgb565, | - | ||||||||||||||||||||||||
| 5026 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5027 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5028 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5029 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5030 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5031 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5032 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5033 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5034 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5035 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5036 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5037 | blend_tiled_generic_rgb64, | - | ||||||||||||||||||||||||
| 5038 | blend_tiled_generic_rgb64, | - | ||||||||||||||||||||||||
| 5039 | blend_tiled_generic_rgb64, | - | ||||||||||||||||||||||||
| 5040 | blend_tiled_generic_rgb64, | - | ||||||||||||||||||||||||
| 5041 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5042 | blend_tiled_generic, | - | ||||||||||||||||||||||||
| 5043 | }, | - | ||||||||||||||||||||||||
| 5044 | - | |||||||||||||||||||||||||
| 5045 | { | - | ||||||||||||||||||||||||
| 5046 | 0, | - | ||||||||||||||||||||||||
| 5047 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5048 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5049 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5050 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5051 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5052 | blend_transformed_argb, | - | ||||||||||||||||||||||||
| 5053 | blend_transformed_rgb565, | - | ||||||||||||||||||||||||
| 5054 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5055 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5056 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5057 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5058 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5059 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5060 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5061 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5062 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5063 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5064 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5065 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5066 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5067 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5068 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5069 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5070 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5071 | }, | - | ||||||||||||||||||||||||
| 5072 | - | |||||||||||||||||||||||||
| 5073 | { | - | ||||||||||||||||||||||||
| 5074 | 0, | - | ||||||||||||||||||||||||
| 5075 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5076 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5077 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5078 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5079 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5080 | blend_transformed_tiled_argb, | - | ||||||||||||||||||||||||
| 5081 | blend_transformed_tiled_rgb565, | - | ||||||||||||||||||||||||
| 5082 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5083 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5084 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5085 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5086 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5087 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5088 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5089 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5090 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5091 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5092 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5093 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5094 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5095 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5096 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5097 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5098 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5099 | }, | - | ||||||||||||||||||||||||
| 5100 | - | |||||||||||||||||||||||||
| 5101 | { | - | ||||||||||||||||||||||||
| 5102 | 0, | - | ||||||||||||||||||||||||
| 5103 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5104 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5105 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5106 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5107 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5108 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5109 | blend_transformed_bilinear_rgb565, | - | ||||||||||||||||||||||||
| 5110 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5111 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5112 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5113 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5114 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5115 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5116 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5117 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5118 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5119 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5120 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5121 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5122 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5123 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5124 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5125 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5126 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5127 | }, | - | ||||||||||||||||||||||||
| 5128 | - | |||||||||||||||||||||||||
| 5129 | { | - | ||||||||||||||||||||||||
| 5130 | 0, | - | ||||||||||||||||||||||||
| 5131 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5132 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5133 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5134 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5135 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5136 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5137 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5138 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5139 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5140 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5141 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5142 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5143 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5144 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5145 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5146 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5147 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5148 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5149 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5150 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5151 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5152 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5153 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5154 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5155 | } | - | ||||||||||||||||||||||||
| 5156 | }; | - | ||||||||||||||||||||||||
| 5157 | - | |||||||||||||||||||||||||
| 5158 | void qBlendTexture(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 5159 | { | - | ||||||||||||||||||||||||
| 5160 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 5161 | ProcessSpans proc = processTextureSpans[getBlendType(data)][data->rasterBuffer->format]; | - | ||||||||||||||||||||||||
| 5162 | proc(count, spans, userData); | - | ||||||||||||||||||||||||
| 5163 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5164 | - | |||||||||||||||||||||||||
| 5165 | template <class DST> static | - | ||||||||||||||||||||||||
| 5166 | inline void qt_bitmapblit_template(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5167 | int x, int y, DST color, | - | ||||||||||||||||||||||||
| 5168 | const uchar *map, | - | ||||||||||||||||||||||||
| 5169 | int mapWidth, int mapHeight, int mapStride) | - | ||||||||||||||||||||||||
| 5170 | { | - | ||||||||||||||||||||||||
| 5171 | DST *dest = reinterpret_cast<DST *>(rasterBuffer->scanLine(y)) + x; | - | ||||||||||||||||||||||||
| 5172 | const int destStride = rasterBuffer->bytesPerLine() / sizeof(DST); | - | ||||||||||||||||||||||||
| 5173 | - | |||||||||||||||||||||||||
| 5174 | if (mapWidth > 8
| 0 | ||||||||||||||||||||||||
| 5175 | while (mapHeight--
| 0 | ||||||||||||||||||||||||
| 5176 | int x0 = 0; | - | ||||||||||||||||||||||||
| 5177 | int n = 0; | - | ||||||||||||||||||||||||
| 5178 | for (int x = 0; x < mapWidth
| 0 | ||||||||||||||||||||||||
| 5179 | uchar s = map[x >> 3]; | - | ||||||||||||||||||||||||
| 5180 | for (int i = 0; i < 8
| 0 | ||||||||||||||||||||||||
| 5181 | if (s & 0x80
| 0 | ||||||||||||||||||||||||
| 5182 | ++n; | - | ||||||||||||||||||||||||
| 5183 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 5184 | if (n
| 0 | ||||||||||||||||||||||||
| 5185 | qt_memfill(dest + x0, color, n); | - | ||||||||||||||||||||||||
| 5186 | x0 += n + 1; | - | ||||||||||||||||||||||||
| 5187 | n = 0; | - | ||||||||||||||||||||||||
| 5188 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 5189 | ++x0; | - | ||||||||||||||||||||||||
| 5190 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5191 | if (!s
| 0 | ||||||||||||||||||||||||
| 5192 | x0 += 8 - 1 - i; | - | ||||||||||||||||||||||||
| 5193 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 5194 | } | - | ||||||||||||||||||||||||
| 5195 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5196 | s <<= 1; | - | ||||||||||||||||||||||||
| 5197 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5198 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5199 | if (n
| 0 | ||||||||||||||||||||||||
| 5200 | qt_memfill(dest + x0, color, n); never executed: qt_memfill(dest + x0, color, n); | 0 | ||||||||||||||||||||||||
| 5201 | dest += destStride; | - | ||||||||||||||||||||||||
| 5202 | map += mapStride; | - | ||||||||||||||||||||||||
| 5203 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5204 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 5205 | while (mapHeight--
| 0 | ||||||||||||||||||||||||
| 5206 | int x0 = 0; | - | ||||||||||||||||||||||||
| 5207 | int n = 0; | - | ||||||||||||||||||||||||
| 5208 | for (uchar s = *map; s
| 0 | ||||||||||||||||||||||||
| 5209 | if (s & 0x80
| 0 | ||||||||||||||||||||||||
| 5210 | ++n; | - | ||||||||||||||||||||||||
| 5211 | } never executed: else if (nend of block
| 0 | ||||||||||||||||||||||||
| 5212 | qt_memfill(dest + x0, color, n); | - | ||||||||||||||||||||||||
| 5213 | x0 += n + 1; | - | ||||||||||||||||||||||||
| 5214 | n = 0; | - | ||||||||||||||||||||||||
| 5215 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 5216 | ++x0; | - | ||||||||||||||||||||||||
| 5217 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5218 | } | - | ||||||||||||||||||||||||
| 5219 | if (n
| 0 | ||||||||||||||||||||||||
| 5220 | qt_memfill(dest + x0, color, n); never executed: qt_memfill(dest + x0, color, n); | 0 | ||||||||||||||||||||||||
| 5221 | dest += destStride; | - | ||||||||||||||||||||||||
| 5222 | map += mapStride; | - | ||||||||||||||||||||||||
| 5223 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5224 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5225 | } | - | ||||||||||||||||||||||||
| 5226 | - | |||||||||||||||||||||||||
| 5227 | static void qt_gradient_argb32(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 5228 | { | - | ||||||||||||||||||||||||
| 5229 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 5230 | - | |||||||||||||||||||||||||
| 5231 | bool isVerticalGradient = | - | ||||||||||||||||||||||||
| 5232 | data->txop <= QTransform::TxScale
| 0 | ||||||||||||||||||||||||
| 5233 | data->type == QSpanData::LinearGradient
| 0 | ||||||||||||||||||||||||
| 5234 | data->gradient.linear.end.x == data->gradient.linear.origin.x
| 0 | ||||||||||||||||||||||||
| 5235 | - | |||||||||||||||||||||||||
| 5236 | if (isVerticalGradient
| 0 | ||||||||||||||||||||||||
| 5237 | LinearGradientValues linear; | - | ||||||||||||||||||||||||
| 5238 | getLinearGradientValues(&linear, data); | - | ||||||||||||||||||||||||
| 5239 | - | |||||||||||||||||||||||||
| 5240 | CompositionFunctionSolid funcSolid = | - | ||||||||||||||||||||||||
| 5241 | functionForModeSolid[data->rasterBuffer->compositionMode]; | - | ||||||||||||||||||||||||
| 5242 | const int gss = 1024 - 1; | - | ||||||||||||||||||||||||
| 5243 | int yinc = int((linear.dy * data->m22 * gss) * (1<<8)); | - | ||||||||||||||||||||||||
| 5244 | int off = int((((linear.dy * (data->m22 * qreal(0.5) + data->dy) + linear.off) * gss) * (1<<8))); | - | ||||||||||||||||||||||||
| 5245 | - | |||||||||||||||||||||||||
| 5246 | while (count--
| 0 | ||||||||||||||||||||||||
| 5247 | int y = spans->y; | - | ||||||||||||||||||||||||
| 5248 | int x = spans->x; | - | ||||||||||||||||||||||||
| 5249 | - | |||||||||||||||||||||||||
| 5250 | quint32 *dst = (quint32 *)(data->rasterBuffer->scanLine(y)) + x; | - | ||||||||||||||||||||||||
| 5251 | quint32 color = | - | ||||||||||||||||||||||||
| 5252 | qt_gradient_pixel_fixed(&data->gradient, yinc * y + off); | - | ||||||||||||||||||||||||
| 5253 | - | |||||||||||||||||||||||||
| 5254 | funcSolid(dst, spans->len, color, spans->coverage); | - | ||||||||||||||||||||||||
| 5255 | ++spans; | - | ||||||||||||||||||||||||
| 5256 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5257 | - | |||||||||||||||||||||||||
| 5258 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 5259 | blend_src_generic(count, spans, userData); | - | ||||||||||||||||||||||||
| 5260 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5261 | } | - | ||||||||||||||||||||||||
| 5262 | - | |||||||||||||||||||||||||
| 5263 | static void qt_gradient_quint16(int count, const QSpan *spans, void *userData) | - | ||||||||||||||||||||||||
| 5264 | { | - | ||||||||||||||||||||||||
| 5265 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - | ||||||||||||||||||||||||
| 5266 | - | |||||||||||||||||||||||||
| 5267 | bool isVerticalGradient = | - | ||||||||||||||||||||||||
| 5268 | data->txop <= QTransform::TxScale
| 0 | ||||||||||||||||||||||||
| 5269 | data->type == QSpanData::LinearGradient
| 0 | ||||||||||||||||||||||||
| 5270 | data->gradient.linear.end.x == data->gradient.linear.origin.x
| 0 | ||||||||||||||||||||||||
| 5271 | - | |||||||||||||||||||||||||
| 5272 | if (isVerticalGradient
| 0 | ||||||||||||||||||||||||
| 5273 | - | |||||||||||||||||||||||||
| 5274 | LinearGradientValues linear; | - | ||||||||||||||||||||||||
| 5275 | getLinearGradientValues(&linear, data); | - | ||||||||||||||||||||||||
| 5276 | const int gss = 1024 - 1; | - | ||||||||||||||||||||||||
| 5277 | int yinc = int((linear.dy * data->m22 * gss) * (1<<8)); | - | ||||||||||||||||||||||||
| 5278 | int off = int((((linear.dy * (data->m22 * qreal(0.5) + data->dy) + linear.off) * gss) * (1<<8))); | - | ||||||||||||||||||||||||
| 5279 | - | |||||||||||||||||||||||||
| 5280 | - | |||||||||||||||||||||||||
| 5281 | QGradientData gradient = data->gradient; | - | ||||||||||||||||||||||||
| 5282 | while (count--
| 0 | ||||||||||||||||||||||||
| 5283 | int y = spans->y; | - | ||||||||||||||||||||||||
| 5284 | - | |||||||||||||||||||||||||
| 5285 | data->solid.color = QRgba64::fromArgb32(qt_gradient_pixel_fixed(&gradient, yinc * y + off)); | - | ||||||||||||||||||||||||
| 5286 | blend_color_rgb16(1, spans, userData); | - | ||||||||||||||||||||||||
| 5287 | ++spans; | - | ||||||||||||||||||||||||
| 5288 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5289 | data->gradient = gradient; | - | ||||||||||||||||||||||||
| 5290 | - | |||||||||||||||||||||||||
| 5291 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 5292 | blend_src_generic(count, spans, userData); | - | ||||||||||||||||||||||||
| 5293 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5294 | } | - | ||||||||||||||||||||||||
| 5295 | - | |||||||||||||||||||||||||
| 5296 | inline static void qt_bitmapblit_argb32(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5297 | int x, int y, const QRgba64 &color, | - | ||||||||||||||||||||||||
| 5298 | const uchar *map, | - | ||||||||||||||||||||||||
| 5299 | int mapWidth, int mapHeight, int mapStride) | - | ||||||||||||||||||||||||
| 5300 | { | - | ||||||||||||||||||||||||
| 5301 | qt_bitmapblit_template<quint32>(rasterBuffer, x, y, color.toArgb32(), | - | ||||||||||||||||||||||||
| 5302 | map, mapWidth, mapHeight, mapStride); | - | ||||||||||||||||||||||||
| 5303 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5304 | - | |||||||||||||||||||||||||
| 5305 | inline static void qt_bitmapblit_rgba8888(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5306 | int x, int y, const QRgba64 &color, | - | ||||||||||||||||||||||||
| 5307 | const uchar *map, | - | ||||||||||||||||||||||||
| 5308 | int mapWidth, int mapHeight, int mapStride) | - | ||||||||||||||||||||||||
| 5309 | { | - | ||||||||||||||||||||||||
| 5310 | qt_bitmapblit_template<quint32>(rasterBuffer, x, y, ARGB2RGBA(color.toArgb32()), | - | ||||||||||||||||||||||||
| 5311 | map, mapWidth, mapHeight, mapStride); | - | ||||||||||||||||||||||||
| 5312 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5313 | - | |||||||||||||||||||||||||
| 5314 | template<QtPixelOrder PixelOrder> | - | ||||||||||||||||||||||||
| 5315 | inline static void qt_bitmapblit_rgb30(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5316 | int x, int y, const QRgba64 &color, | - | ||||||||||||||||||||||||
| 5317 | const uchar *map, | - | ||||||||||||||||||||||||
| 5318 | int mapWidth, int mapHeight, int mapStride) | - | ||||||||||||||||||||||||
| 5319 | { | - | ||||||||||||||||||||||||
| 5320 | qt_bitmapblit_template<quint32>(rasterBuffer, x, y, qConvertRgb64ToRgb30<PixelOrder>(color), | - | ||||||||||||||||||||||||
| 5321 | map, mapWidth, mapHeight, mapStride); | - | ||||||||||||||||||||||||
| 5322 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5323 | - | |||||||||||||||||||||||||
| 5324 | inline static void qt_bitmapblit_quint16(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5325 | int x, int y, const QRgba64 &color, | - | ||||||||||||||||||||||||
| 5326 | const uchar *map, | - | ||||||||||||||||||||||||
| 5327 | int mapWidth, int mapHeight, int mapStride) | - | ||||||||||||||||||||||||
| 5328 | { | - | ||||||||||||||||||||||||
| 5329 | qt_bitmapblit_template<quint16>(rasterBuffer, x, y, color.toRgb16(), | - | ||||||||||||||||||||||||
| 5330 | map, mapWidth, mapHeight, mapStride); | - | ||||||||||||||||||||||||
| 5331 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5332 | - | |||||||||||||||||||||||||
| 5333 | static void qt_alphamapblit_quint16(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5334 | int x, int y, const QRgba64 &color, | - | ||||||||||||||||||||||||
| 5335 | const uchar *map, | - | ||||||||||||||||||||||||
| 5336 | int mapWidth, int mapHeight, int mapStride, | - | ||||||||||||||||||||||||
| 5337 | const QClipData *) | - | ||||||||||||||||||||||||
| 5338 | { | - | ||||||||||||||||||||||||
| 5339 | const quint16 c = color.toRgb16(); | - | ||||||||||||||||||||||||
| 5340 | quint16 *dest = reinterpret_cast<quint16*>(rasterBuffer->scanLine(y)) + x; | - | ||||||||||||||||||||||||
| 5341 | const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint16); | - | ||||||||||||||||||||||||
| 5342 | - | |||||||||||||||||||||||||
| 5343 | while (mapHeight--
| 0 | ||||||||||||||||||||||||
| 5344 | for (int i = 0; i < mapWidth
| 0 | ||||||||||||||||||||||||
| 5345 | const int coverage = map[i]; | - | ||||||||||||||||||||||||
| 5346 | - | |||||||||||||||||||||||||
| 5347 | if (coverage == 0
| 0 | ||||||||||||||||||||||||
| 5348 | - | |||||||||||||||||||||||||
| 5349 | } never executed: else if (coverage == 255end of block
| 0 | ||||||||||||||||||||||||
| 5350 | dest[i] = c; | - | ||||||||||||||||||||||||
| 5351 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 5352 | int ialpha = 255 - coverage; | - | ||||||||||||||||||||||||
| 5353 | dest[i] = BYTE_MUL_RGB16(c, coverage) | - | ||||||||||||||||||||||||
| 5354 | + BYTE_MUL_RGB16(dest[i], ialpha); | - | ||||||||||||||||||||||||
| 5355 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5356 | } | - | ||||||||||||||||||||||||
| 5357 | dest += destStride; | - | ||||||||||||||||||||||||
| 5358 | map += mapStride; | - | ||||||||||||||||||||||||
| 5359 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5360 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5361 | - | |||||||||||||||||||||||||
| 5362 | static inline void rgbBlendPixel(quint32 *dst, int coverage, int sr, int sg, int sb, const uchar *gamma, const uchar *invgamma) | - | ||||||||||||||||||||||||
| 5363 | { | - | ||||||||||||||||||||||||
| 5364 | - | |||||||||||||||||||||||||
| 5365 | int da = qAlpha(*dst); | - | ||||||||||||||||||||||||
| 5366 | int dr = qRed(*dst); | - | ||||||||||||||||||||||||
| 5367 | int dg = qGreen(*dst); | - | ||||||||||||||||||||||||
| 5368 | int db = qBlue(*dst); | - | ||||||||||||||||||||||||
| 5369 | - | |||||||||||||||||||||||||
| 5370 | if (da != 255
| 0 | ||||||||||||||||||||||||
| 5371 | ) { | - | ||||||||||||||||||||||||
| 5372 | - | |||||||||||||||||||||||||
| 5373 | int a = qGray(coverage); | - | ||||||||||||||||||||||||
| 5374 | sr = qt_div_255(invgamma[sr] * a); | - | ||||||||||||||||||||||||
| 5375 | sg = qt_div_255(invgamma[sg] * a); | - | ||||||||||||||||||||||||
| 5376 | sb = qt_div_255(invgamma[sb] * a); | - | ||||||||||||||||||||||||
| 5377 | - | |||||||||||||||||||||||||
| 5378 | int ia = 255 - a; | - | ||||||||||||||||||||||||
| 5379 | dr = qt_div_255(dr * ia); | - | ||||||||||||||||||||||||
| 5380 | dg = qt_div_255(dg * ia); | - | ||||||||||||||||||||||||
| 5381 | db = qt_div_255(db * ia); | - | ||||||||||||||||||||||||
| 5382 | - | |||||||||||||||||||||||||
| 5383 | *dst = ((a + qt_div_255((255 - a) * da)) << 24) | - | ||||||||||||||||||||||||
| 5384 | | ((sr + dr) << 16) | - | ||||||||||||||||||||||||
| 5385 | | ((sg + dg) << 8) | - | ||||||||||||||||||||||||
| 5386 | | ((sb + db)); | - | ||||||||||||||||||||||||
| 5387 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 5388 | } | - | ||||||||||||||||||||||||
| 5389 | - | |||||||||||||||||||||||||
| 5390 | int mr = qRed(coverage); | - | ||||||||||||||||||||||||
| 5391 | int mg = qGreen(coverage); | - | ||||||||||||||||||||||||
| 5392 | int mb = qBlue(coverage); | - | ||||||||||||||||||||||||
| 5393 | - | |||||||||||||||||||||||||
| 5394 | dr = gamma[dr]; | - | ||||||||||||||||||||||||
| 5395 | dg = gamma[dg]; | - | ||||||||||||||||||||||||
| 5396 | db = gamma[db]; | - | ||||||||||||||||||||||||
| 5397 | - | |||||||||||||||||||||||||
| 5398 | int nr = qt_div_255(sr * mr + dr * (255 - mr)); | - | ||||||||||||||||||||||||
| 5399 | int ng = qt_div_255(sg * mg + dg * (255 - mg)); | - | ||||||||||||||||||||||||
| 5400 | int nb = qt_div_255(sb * mb + db * (255 - mb)); | - | ||||||||||||||||||||||||
| 5401 | - | |||||||||||||||||||||||||
| 5402 | nr = invgamma[nr]; | - | ||||||||||||||||||||||||
| 5403 | ng = invgamma[ng]; | - | ||||||||||||||||||||||||
| 5404 | nb = invgamma[nb]; | - | ||||||||||||||||||||||||
| 5405 | - | |||||||||||||||||||||||||
| 5406 | *dst = qRgb(nr, ng, nb); | - | ||||||||||||||||||||||||
| 5407 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5408 | static void qt_alphamapblit_uint32(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5409 | int x, int y, quint32 color, | - | ||||||||||||||||||||||||
| 5410 | const uchar *map, | - | ||||||||||||||||||||||||
| 5411 | int mapWidth, int mapHeight, int mapStride, | - | ||||||||||||||||||||||||
| 5412 | const QClipData *clip) | - | ||||||||||||||||||||||||
| 5413 | { | - | ||||||||||||||||||||||||
| 5414 | const quint32 c = color; | - | ||||||||||||||||||||||||
| 5415 | const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint32); | - | ||||||||||||||||||||||||
| 5416 | if (!clip
| 0 | ||||||||||||||||||||||||
| 5417 | quint32 *dest = reinterpret_cast<quint32*>(rasterBuffer->scanLine(y)) + x; | - | ||||||||||||||||||||||||
| 5418 | while (mapHeight--
| 0 | ||||||||||||||||||||||||
| 5419 | for (int i = 0; i < mapWidth
| 0 | ||||||||||||||||||||||||
| 5420 | const int coverage = map[i]; | - | ||||||||||||||||||||||||
| 5421 | - | |||||||||||||||||||||||||
| 5422 | if (coverage == 0
| 0 | ||||||||||||||||||||||||
| 5423 | - | |||||||||||||||||||||||||
| 5424 | } never executed: else if (coverage == 255end of block
| 0 | ||||||||||||||||||||||||
| 5425 | dest[i] = c; | - | ||||||||||||||||||||||||
| 5426 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 5427 | - | |||||||||||||||||||||||||
| 5428 | - | |||||||||||||||||||||||||
| 5429 | - | |||||||||||||||||||||||||
| 5430 | - | |||||||||||||||||||||||||
| 5431 | - | |||||||||||||||||||||||||
| 5432 | - | |||||||||||||||||||||||||
| 5433 | { | - | ||||||||||||||||||||||||
| 5434 | int ialpha = 255 - coverage; | - | ||||||||||||||||||||||||
| 5435 | dest[i] = INTERPOLATE_PIXEL_255(c, coverage, dest[i], ialpha); | - | ||||||||||||||||||||||||
| 5436 | } | - | ||||||||||||||||||||||||
| 5437 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5438 | } | - | ||||||||||||||||||||||||
| 5439 | dest += destStride; | - | ||||||||||||||||||||||||
| 5440 | map += mapStride; | - | ||||||||||||||||||||||||
| 5441 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5442 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 5443 | int bottom = qMin(y + mapHeight, rasterBuffer->height()); | - | ||||||||||||||||||||||||
| 5444 | - | |||||||||||||||||||||||||
| 5445 | int top = qMax(y, 0); | - | ||||||||||||||||||||||||
| 5446 | map += (top - y) * mapStride; | - | ||||||||||||||||||||||||
| 5447 | - | |||||||||||||||||||||||||
| 5448 | const_cast<QClipData *>(clip)->initialize(); | - | ||||||||||||||||||||||||
| 5449 | for (int yp = top; yp<bottom
| 0 | ||||||||||||||||||||||||
| 5450 | const QClipData::ClipLine &line = clip->m_clipLines[yp]; | - | ||||||||||||||||||||||||
| 5451 | - | |||||||||||||||||||||||||
| 5452 | quint32 *dest = reinterpret_cast<quint32 *>(rasterBuffer->scanLine(yp)); | - | ||||||||||||||||||||||||
| 5453 | - | |||||||||||||||||||||||||
| 5454 | for (int i=0; i<line.count
| 0 | ||||||||||||||||||||||||
| 5455 | const QSpan &clip = line.spans[i]; | - | ||||||||||||||||||||||||
| 5456 | - | |||||||||||||||||||||||||
| 5457 | int start = qMax<int>(x, clip.x); | - | ||||||||||||||||||||||||
| 5458 | int end = qMin<int>(x + mapWidth, clip.x + clip.len); | - | ||||||||||||||||||||||||
| 5459 | - | |||||||||||||||||||||||||
| 5460 | for (int xp=start; xp<end
| 0 | ||||||||||||||||||||||||
| 5461 | const int coverage = map[xp - x]; | - | ||||||||||||||||||||||||
| 5462 | - | |||||||||||||||||||||||||
| 5463 | if (coverage == 0
| 0 | ||||||||||||||||||||||||
| 5464 | - | |||||||||||||||||||||||||
| 5465 | } never executed: else if (coverage == 255end of block
| 0 | ||||||||||||||||||||||||
| 5466 | dest[xp] = c; | - | ||||||||||||||||||||||||
| 5467 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 5468 | - | |||||||||||||||||||||||||
| 5469 | - | |||||||||||||||||||||||||
| 5470 | - | |||||||||||||||||||||||||
| 5471 | - | |||||||||||||||||||||||||
| 5472 | - | |||||||||||||||||||||||||
| 5473 | - | |||||||||||||||||||||||||
| 5474 | { | - | ||||||||||||||||||||||||
| 5475 | int ialpha = 255 - coverage; | - | ||||||||||||||||||||||||
| 5476 | dest[xp] = INTERPOLATE_PIXEL_255(c, coverage, dest[xp], ialpha); | - | ||||||||||||||||||||||||
| 5477 | } | - | ||||||||||||||||||||||||
| 5478 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5479 | - | |||||||||||||||||||||||||
| 5480 | } | - | ||||||||||||||||||||||||
| 5481 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5482 | map += mapStride; | - | ||||||||||||||||||||||||
| 5483 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5484 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5485 | } | - | ||||||||||||||||||||||||
| 5486 | - | |||||||||||||||||||||||||
| 5487 | - | |||||||||||||||||||||||||
| 5488 | static void qt_alphamapblit_argb32(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5489 | int x, int y, const QRgba64 &color, | - | ||||||||||||||||||||||||
| 5490 | const uchar *map, | - | ||||||||||||||||||||||||
| 5491 | int mapWidth, int mapHeight, int mapStride, | - | ||||||||||||||||||||||||
| 5492 | const QClipData *clip) | - | ||||||||||||||||||||||||
| 5493 | { | - | ||||||||||||||||||||||||
| 5494 | qt_alphamapblit_uint32(rasterBuffer, x, y, color.toArgb32(), map, mapWidth, mapHeight, mapStride, clip); | - | ||||||||||||||||||||||||
| 5495 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5496 | - | |||||||||||||||||||||||||
| 5497 | - | |||||||||||||||||||||||||
| 5498 | static void qt_alphamapblit_rgba8888(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5499 | int x, int y, const QRgba64 &color, | - | ||||||||||||||||||||||||
| 5500 | const uchar *map, | - | ||||||||||||||||||||||||
| 5501 | int mapWidth, int mapHeight, int mapStride, | - | ||||||||||||||||||||||||
| 5502 | const QClipData *clip) | - | ||||||||||||||||||||||||
| 5503 | { | - | ||||||||||||||||||||||||
| 5504 | qt_alphamapblit_uint32(rasterBuffer, x, y, ARGB2RGBA(color.toArgb32()), map, mapWidth, mapHeight, mapStride, clip); | - | ||||||||||||||||||||||||
| 5505 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5506 | - | |||||||||||||||||||||||||
| 5507 | - | |||||||||||||||||||||||||
| 5508 | static void qt_alphargbblit_argb32(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5509 | int x, int y, const QRgba64 &color, | - | ||||||||||||||||||||||||
| 5510 | const uint *src, int mapWidth, int mapHeight, int srcStride, | - | ||||||||||||||||||||||||
| 5511 | const QClipData *clip) | - | ||||||||||||||||||||||||
| 5512 | { | - | ||||||||||||||||||||||||
| 5513 | const quint32 c = color.toArgb32(); | - | ||||||||||||||||||||||||
| 5514 | - | |||||||||||||||||||||||||
| 5515 | int sr = qRed(c); | - | ||||||||||||||||||||||||
| 5516 | int sg = qGreen(c); | - | ||||||||||||||||||||||||
| 5517 | int sb = qBlue(c); | - | ||||||||||||||||||||||||
| 5518 | int sa = qAlpha(c); | - | ||||||||||||||||||||||||
| 5519 | - | |||||||||||||||||||||||||
| 5520 | const QDrawHelperGammaTables *tables = QGuiApplicationPrivate::instance()->gammaTables(); | - | ||||||||||||||||||||||||
| 5521 | if (!tables
| 0 | ||||||||||||||||||||||||
| 5522 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 5523 | - | |||||||||||||||||||||||||
| 5524 | const uchar *gamma = tables->qt_pow_rgb_gamma; | - | ||||||||||||||||||||||||
| 5525 | const uchar *invgamma = tables->qt_pow_rgb_invgamma; | - | ||||||||||||||||||||||||
| 5526 | - | |||||||||||||||||||||||||
| 5527 | sr = gamma[sr]; | - | ||||||||||||||||||||||||
| 5528 | sg = gamma[sg]; | - | ||||||||||||||||||||||||
| 5529 | sb = gamma[sb]; | - | ||||||||||||||||||||||||
| 5530 | - | |||||||||||||||||||||||||
| 5531 | if (sa == 0
| 0 | ||||||||||||||||||||||||
| 5532 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 5533 | - | |||||||||||||||||||||||||
| 5534 | if (!clip
| 0 | ||||||||||||||||||||||||
| 5535 | quint32 *dst = reinterpret_cast<quint32*>(rasterBuffer->scanLine(y)) + x; | - | ||||||||||||||||||||||||
| 5536 | const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint32); | - | ||||||||||||||||||||||||
| 5537 | while (mapHeight--
| 0 | ||||||||||||||||||||||||
| 5538 | for (int i = 0; i < mapWidth
| 0 | ||||||||||||||||||||||||
| 5539 | const uint coverage = src[i]; | - | ||||||||||||||||||||||||
| 5540 | if (coverage == 0xffffffff
| 0 | ||||||||||||||||||||||||
| 5541 | dst[i] = c; | - | ||||||||||||||||||||||||
| 5542 | } never executed: else if (coverage != 0xff000000end of block
| 0 | ||||||||||||||||||||||||
| 5543 | rgbBlendPixel(dst+i, coverage, sr, sg, sb, gamma, invgamma); | - | ||||||||||||||||||||||||
| 5544 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5545 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5546 | - | |||||||||||||||||||||||||
| 5547 | dst += destStride; | - | ||||||||||||||||||||||||
| 5548 | src += srcStride; | - | ||||||||||||||||||||||||
| 5549 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5550 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 5551 | int bottom = qMin(y + mapHeight, rasterBuffer->height()); | - | ||||||||||||||||||||||||
| 5552 | - | |||||||||||||||||||||||||
| 5553 | int top = qMax(y, 0); | - | ||||||||||||||||||||||||
| 5554 | src += (top - y) * srcStride; | - | ||||||||||||||||||||||||
| 5555 | - | |||||||||||||||||||||||||
| 5556 | const_cast<QClipData *>(clip)->initialize(); | - | ||||||||||||||||||||||||
| 5557 | for (int yp = top; yp<bottom
| 0 | ||||||||||||||||||||||||
| 5558 | const QClipData::ClipLine &line = clip->m_clipLines[yp]; | - | ||||||||||||||||||||||||
| 5559 | - | |||||||||||||||||||||||||
| 5560 | quint32 *dst = reinterpret_cast<quint32 *>(rasterBuffer->scanLine(yp)); | - | ||||||||||||||||||||||||
| 5561 | - | |||||||||||||||||||||||||
| 5562 | for (int i=0; i<line.count
| 0 | ||||||||||||||||||||||||
| 5563 | const QSpan &clip = line.spans[i]; | - | ||||||||||||||||||||||||
| 5564 | - | |||||||||||||||||||||||||
| 5565 | int start = qMax<int>(x, clip.x); | - | ||||||||||||||||||||||||
| 5566 | int end = qMin<int>(x + mapWidth, clip.x + clip.len); | - | ||||||||||||||||||||||||
| 5567 | - | |||||||||||||||||||||||||
| 5568 | for (int xp=start; xp<end
| 0 | ||||||||||||||||||||||||
| 5569 | const uint coverage = src[xp - x]; | - | ||||||||||||||||||||||||
| 5570 | if (coverage == 0xffffffff
| 0 | ||||||||||||||||||||||||
| 5571 | dst[xp] = c; | - | ||||||||||||||||||||||||
| 5572 | } never executed: else if (coverage != 0xff000000end of block
| 0 | ||||||||||||||||||||||||
| 5573 | rgbBlendPixel(dst+xp, coverage, sr, sg, sb, gamma, invgamma); | - | ||||||||||||||||||||||||
| 5574 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5575 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5576 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5577 | src += srcStride; | - | ||||||||||||||||||||||||
| 5578 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5579 | - | |||||||||||||||||||||||||
| 5580 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5581 | } | - | ||||||||||||||||||||||||
| 5582 | - | |||||||||||||||||||||||||
| 5583 | static void qt_rectfill_argb32(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5584 | int x, int y, int width, int height, | - | ||||||||||||||||||||||||
| 5585 | const QRgba64 &color) | - | ||||||||||||||||||||||||
| 5586 | { | - | ||||||||||||||||||||||||
| 5587 | qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()), | - | ||||||||||||||||||||||||
| 5588 | color.toArgb32(), x, y, width, height, rasterBuffer->bytesPerLine()); | - | ||||||||||||||||||||||||
| 5589 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5590 | - | |||||||||||||||||||||||||
| 5591 | static void qt_rectfill_quint16(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5592 | int x, int y, int width, int height, | - | ||||||||||||||||||||||||
| 5593 | const QRgba64 &color) | - | ||||||||||||||||||||||||
| 5594 | { | - | ||||||||||||||||||||||||
| 5595 | qt_rectfill<quint16>(reinterpret_cast<quint16 *>(rasterBuffer->buffer()), | - | ||||||||||||||||||||||||
| 5596 | color.toRgb16(), x, y, width, height, rasterBuffer->bytesPerLine()); | - | ||||||||||||||||||||||||
| 5597 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5598 | - | |||||||||||||||||||||||||
| 5599 | static void qt_rectfill_nonpremul_argb32(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5600 | int x, int y, int width, int height, | - | ||||||||||||||||||||||||
| 5601 | const QRgba64 &color) | - | ||||||||||||||||||||||||
| 5602 | { | - | ||||||||||||||||||||||||
| 5603 | qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()), | - | ||||||||||||||||||||||||
| 5604 | color.unpremultiplied().toArgb32(), x, y, width, height, rasterBuffer->bytesPerLine()); | - | ||||||||||||||||||||||||
| 5605 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5606 | - | |||||||||||||||||||||||||
| 5607 | static void qt_rectfill_rgba(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5608 | int x, int y, int width, int height, | - | ||||||||||||||||||||||||
| 5609 | const QRgba64 &color) | - | ||||||||||||||||||||||||
| 5610 | { | - | ||||||||||||||||||||||||
| 5611 | qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()), | - | ||||||||||||||||||||||||
| 5612 | ARGB2RGBA(color.toArgb32()), x, y, width, height, rasterBuffer->bytesPerLine()); | - | ||||||||||||||||||||||||
| 5613 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5614 | - | |||||||||||||||||||||||||
| 5615 | static void qt_rectfill_nonpremul_rgba(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5616 | int x, int y, int width, int height, | - | ||||||||||||||||||||||||
| 5617 | const QRgba64 &color) | - | ||||||||||||||||||||||||
| 5618 | { | - | ||||||||||||||||||||||||
| 5619 | qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()), | - | ||||||||||||||||||||||||
| 5620 | ARGB2RGBA(color.unpremultiplied().toArgb32()), x, y, width, height, rasterBuffer->bytesPerLine()); | - | ||||||||||||||||||||||||
| 5621 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5622 | - | |||||||||||||||||||||||||
| 5623 | template<QtPixelOrder PixelOrder> | - | ||||||||||||||||||||||||
| 5624 | static void qt_rectfill_rgb30(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5625 | int x, int y, int width, int height, | - | ||||||||||||||||||||||||
| 5626 | const QRgba64 &color) | - | ||||||||||||||||||||||||
| 5627 | { | - | ||||||||||||||||||||||||
| 5628 | qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()), | - | ||||||||||||||||||||||||
| 5629 | qConvertRgb64ToRgb30<PixelOrder>(color), x, y, width, height, rasterBuffer->bytesPerLine()); | - | ||||||||||||||||||||||||
| 5630 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5631 | - | |||||||||||||||||||||||||
| 5632 | static void qt_rectfill_alpha(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5633 | int x, int y, int width, int height, | - | ||||||||||||||||||||||||
| 5634 | const QRgba64 &color) | - | ||||||||||||||||||||||||
| 5635 | { | - | ||||||||||||||||||||||||
| 5636 | qt_rectfill<quint8>(reinterpret_cast<quint8 *>(rasterBuffer->buffer()), | - | ||||||||||||||||||||||||
| 5637 | color.alpha() >> 8, x, y, width, height, rasterBuffer->bytesPerLine()); | - | ||||||||||||||||||||||||
| 5638 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5639 | - | |||||||||||||||||||||||||
| 5640 | static void qt_rectfill_gray(QRasterBuffer *rasterBuffer, | - | ||||||||||||||||||||||||
| 5641 | int x, int y, int width, int height, | - | ||||||||||||||||||||||||
| 5642 | const QRgba64 &color) | - | ||||||||||||||||||||||||
| 5643 | { | - | ||||||||||||||||||||||||
| 5644 | qt_rectfill<quint8>(reinterpret_cast<quint8 *>(rasterBuffer->buffer()), | - | ||||||||||||||||||||||||
| 5645 | qGray(color.toArgb32()), x, y, width, height, rasterBuffer->bytesPerLine()); | - | ||||||||||||||||||||||||
| 5646 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5647 | - | |||||||||||||||||||||||||
| 5648 | - | |||||||||||||||||||||||||
| 5649 | - | |||||||||||||||||||||||||
| 5650 | - | |||||||||||||||||||||||||
| 5651 | DrawHelper qDrawHelper[QImage::NImageFormats] = | - | ||||||||||||||||||||||||
| 5652 | { | - | ||||||||||||||||||||||||
| 5653 | - | |||||||||||||||||||||||||
| 5654 | { 0, 0, 0, 0, 0, 0 }, | - | ||||||||||||||||||||||||
| 5655 | - | |||||||||||||||||||||||||
| 5656 | { | - | ||||||||||||||||||||||||
| 5657 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5658 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5659 | 0, 0, 0, 0 | - | ||||||||||||||||||||||||
| 5660 | }, | - | ||||||||||||||||||||||||
| 5661 | - | |||||||||||||||||||||||||
| 5662 | { | - | ||||||||||||||||||||||||
| 5663 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5664 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5665 | 0, 0, 0, 0 | - | ||||||||||||||||||||||||
| 5666 | }, | - | ||||||||||||||||||||||||
| 5667 | - | |||||||||||||||||||||||||
| 5668 | { | - | ||||||||||||||||||||||||
| 5669 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5670 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5671 | 0, 0, 0, 0 | - | ||||||||||||||||||||||||
| 5672 | }, | - | ||||||||||||||||||||||||
| 5673 | - | |||||||||||||||||||||||||
| 5674 | { | - | ||||||||||||||||||||||||
| 5675 | blend_color_argb, | - | ||||||||||||||||||||||||
| 5676 | qt_gradient_argb32, | - | ||||||||||||||||||||||||
| 5677 | qt_bitmapblit_argb32, | - | ||||||||||||||||||||||||
| 5678 | qt_alphamapblit_argb32, | - | ||||||||||||||||||||||||
| 5679 | qt_alphargbblit_argb32, | - | ||||||||||||||||||||||||
| 5680 | qt_rectfill_argb32 | - | ||||||||||||||||||||||||
| 5681 | }, | - | ||||||||||||||||||||||||
| 5682 | - | |||||||||||||||||||||||||
| 5683 | { | - | ||||||||||||||||||||||||
| 5684 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5685 | qt_gradient_argb32, | - | ||||||||||||||||||||||||
| 5686 | qt_bitmapblit_argb32, | - | ||||||||||||||||||||||||
| 5687 | qt_alphamapblit_argb32, | - | ||||||||||||||||||||||||
| 5688 | qt_alphargbblit_argb32, | - | ||||||||||||||||||||||||
| 5689 | qt_rectfill_nonpremul_argb32 | - | ||||||||||||||||||||||||
| 5690 | }, | - | ||||||||||||||||||||||||
| 5691 | - | |||||||||||||||||||||||||
| 5692 | { | - | ||||||||||||||||||||||||
| 5693 | blend_color_argb, | - | ||||||||||||||||||||||||
| 5694 | qt_gradient_argb32, | - | ||||||||||||||||||||||||
| 5695 | qt_bitmapblit_argb32, | - | ||||||||||||||||||||||||
| 5696 | qt_alphamapblit_argb32, | - | ||||||||||||||||||||||||
| 5697 | qt_alphargbblit_argb32, | - | ||||||||||||||||||||||||
| 5698 | qt_rectfill_argb32 | - | ||||||||||||||||||||||||
| 5699 | }, | - | ||||||||||||||||||||||||
| 5700 | - | |||||||||||||||||||||||||
| 5701 | { | - | ||||||||||||||||||||||||
| 5702 | blend_color_rgb16, | - | ||||||||||||||||||||||||
| 5703 | qt_gradient_quint16, | - | ||||||||||||||||||||||||
| 5704 | qt_bitmapblit_quint16, | - | ||||||||||||||||||||||||
| 5705 | qt_alphamapblit_quint16, | - | ||||||||||||||||||||||||
| 5706 | 0, | - | ||||||||||||||||||||||||
| 5707 | qt_rectfill_quint16 | - | ||||||||||||||||||||||||
| 5708 | }, | - | ||||||||||||||||||||||||
| 5709 | - | |||||||||||||||||||||||||
| 5710 | { | - | ||||||||||||||||||||||||
| 5711 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5712 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5713 | 0, 0, 0, 0 | - | ||||||||||||||||||||||||
| 5714 | }, | - | ||||||||||||||||||||||||
| 5715 | - | |||||||||||||||||||||||||
| 5716 | { | - | ||||||||||||||||||||||||
| 5717 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5718 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5719 | 0, 0, 0, 0 | - | ||||||||||||||||||||||||
| 5720 | }, | - | ||||||||||||||||||||||||
| 5721 | - | |||||||||||||||||||||||||
| 5722 | { | - | ||||||||||||||||||||||||
| 5723 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5724 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5725 | 0, 0, 0, 0 | - | ||||||||||||||||||||||||
| 5726 | }, | - | ||||||||||||||||||||||||
| 5727 | - | |||||||||||||||||||||||||
| 5728 | { | - | ||||||||||||||||||||||||
| 5729 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5730 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5731 | 0, 0, 0, 0 | - | ||||||||||||||||||||||||
| 5732 | }, | - | ||||||||||||||||||||||||
| 5733 | - | |||||||||||||||||||||||||
| 5734 | { | - | ||||||||||||||||||||||||
| 5735 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5736 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5737 | 0, 0, 0, 0 | - | ||||||||||||||||||||||||
| 5738 | }, | - | ||||||||||||||||||||||||
| 5739 | - | |||||||||||||||||||||||||
| 5740 | { | - | ||||||||||||||||||||||||
| 5741 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5742 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5743 | 0, 0, 0, 0 | - | ||||||||||||||||||||||||
| 5744 | }, | - | ||||||||||||||||||||||||
| 5745 | - | |||||||||||||||||||||||||
| 5746 | { | - | ||||||||||||||||||||||||
| 5747 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5748 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5749 | 0, 0, 0, 0 | - | ||||||||||||||||||||||||
| 5750 | }, | - | ||||||||||||||||||||||||
| 5751 | - | |||||||||||||||||||||||||
| 5752 | { | - | ||||||||||||||||||||||||
| 5753 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5754 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5755 | 0, 0, 0, 0 | - | ||||||||||||||||||||||||
| 5756 | }, | - | ||||||||||||||||||||||||
| 5757 | - | |||||||||||||||||||||||||
| 5758 | { | - | ||||||||||||||||||||||||
| 5759 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5760 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5761 | qt_bitmapblit_rgba8888, | - | ||||||||||||||||||||||||
| 5762 | - | |||||||||||||||||||||||||
| 5763 | qt_alphamapblit_rgba8888, | - | ||||||||||||||||||||||||
| 5764 | - | |||||||||||||||||||||||||
| 5765 | - | |||||||||||||||||||||||||
| 5766 | - | |||||||||||||||||||||||||
| 5767 | 0, | - | ||||||||||||||||||||||||
| 5768 | qt_rectfill_rgba | - | ||||||||||||||||||||||||
| 5769 | }, | - | ||||||||||||||||||||||||
| 5770 | - | |||||||||||||||||||||||||
| 5771 | { | - | ||||||||||||||||||||||||
| 5772 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5773 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5774 | qt_bitmapblit_rgba8888, | - | ||||||||||||||||||||||||
| 5775 | - | |||||||||||||||||||||||||
| 5776 | qt_alphamapblit_rgba8888, | - | ||||||||||||||||||||||||
| 5777 | - | |||||||||||||||||||||||||
| 5778 | - | |||||||||||||||||||||||||
| 5779 | - | |||||||||||||||||||||||||
| 5780 | 0, | - | ||||||||||||||||||||||||
| 5781 | qt_rectfill_nonpremul_rgba | - | ||||||||||||||||||||||||
| 5782 | }, | - | ||||||||||||||||||||||||
| 5783 | - | |||||||||||||||||||||||||
| 5784 | { | - | ||||||||||||||||||||||||
| 5785 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5786 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5787 | qt_bitmapblit_rgba8888, | - | ||||||||||||||||||||||||
| 5788 | - | |||||||||||||||||||||||||
| 5789 | qt_alphamapblit_rgba8888, | - | ||||||||||||||||||||||||
| 5790 | - | |||||||||||||||||||||||||
| 5791 | - | |||||||||||||||||||||||||
| 5792 | - | |||||||||||||||||||||||||
| 5793 | 0, | - | ||||||||||||||||||||||||
| 5794 | qt_rectfill_rgba | - | ||||||||||||||||||||||||
| 5795 | }, | - | ||||||||||||||||||||||||
| 5796 | - | |||||||||||||||||||||||||
| 5797 | { | - | ||||||||||||||||||||||||
| 5798 | blend_color_generic_rgb64, | - | ||||||||||||||||||||||||
| 5799 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5800 | qt_bitmapblit_rgb30<PixelOrderBGR>, | - | ||||||||||||||||||||||||
| 5801 | 0, | - | ||||||||||||||||||||||||
| 5802 | 0, | - | ||||||||||||||||||||||||
| 5803 | qt_rectfill_rgb30<PixelOrderBGR> | - | ||||||||||||||||||||||||
| 5804 | }, | - | ||||||||||||||||||||||||
| 5805 | - | |||||||||||||||||||||||||
| 5806 | { | - | ||||||||||||||||||||||||
| 5807 | blend_color_generic_rgb64, | - | ||||||||||||||||||||||||
| 5808 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5809 | qt_bitmapblit_rgb30<PixelOrderBGR>, | - | ||||||||||||||||||||||||
| 5810 | 0, | - | ||||||||||||||||||||||||
| 5811 | 0, | - | ||||||||||||||||||||||||
| 5812 | qt_rectfill_rgb30<PixelOrderBGR> | - | ||||||||||||||||||||||||
| 5813 | }, | - | ||||||||||||||||||||||||
| 5814 | - | |||||||||||||||||||||||||
| 5815 | { | - | ||||||||||||||||||||||||
| 5816 | blend_color_generic_rgb64, | - | ||||||||||||||||||||||||
| 5817 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5818 | qt_bitmapblit_rgb30<PixelOrderRGB>, | - | ||||||||||||||||||||||||
| 5819 | 0, | - | ||||||||||||||||||||||||
| 5820 | 0, | - | ||||||||||||||||||||||||
| 5821 | qt_rectfill_rgb30<PixelOrderRGB> | - | ||||||||||||||||||||||||
| 5822 | }, | - | ||||||||||||||||||||||||
| 5823 | - | |||||||||||||||||||||||||
| 5824 | { | - | ||||||||||||||||||||||||
| 5825 | blend_color_generic_rgb64, | - | ||||||||||||||||||||||||
| 5826 | blend_src_generic_rgb64, | - | ||||||||||||||||||||||||
| 5827 | qt_bitmapblit_rgb30<PixelOrderRGB>, | - | ||||||||||||||||||||||||
| 5828 | 0, | - | ||||||||||||||||||||||||
| 5829 | 0, | - | ||||||||||||||||||||||||
| 5830 | qt_rectfill_rgb30<PixelOrderRGB> | - | ||||||||||||||||||||||||
| 5831 | }, | - | ||||||||||||||||||||||||
| 5832 | - | |||||||||||||||||||||||||
| 5833 | { | - | ||||||||||||||||||||||||
| 5834 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5835 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5836 | 0, 0, 0, | - | ||||||||||||||||||||||||
| 5837 | qt_rectfill_alpha | - | ||||||||||||||||||||||||
| 5838 | }, | - | ||||||||||||||||||||||||
| 5839 | - | |||||||||||||||||||||||||
| 5840 | { | - | ||||||||||||||||||||||||
| 5841 | blend_color_generic, | - | ||||||||||||||||||||||||
| 5842 | blend_src_generic, | - | ||||||||||||||||||||||||
| 5843 | 0, 0, 0, | - | ||||||||||||||||||||||||
| 5844 | qt_rectfill_gray | - | ||||||||||||||||||||||||
| 5845 | }, | - | ||||||||||||||||||||||||
| 5846 | }; | - | ||||||||||||||||||||||||
| 5847 | template <class T> | - | ||||||||||||||||||||||||
| 5848 | inline void qt_memfill_template(T *dest, T color, int count) | - | ||||||||||||||||||||||||
| 5849 | { | - | ||||||||||||||||||||||||
| 5850 | int n = (count + 7) / 8; | - | ||||||||||||||||||||||||
| 5851 | switch (count & 0x07) | - | ||||||||||||||||||||||||
| 5852 | { | - | ||||||||||||||||||||||||
| 5853 | case never executed: 0:case 0:never executed: do { *dest++ = color;case 0: | 0 | ||||||||||||||||||||||||
| 5854 | case never executed: 7:case 7:never executed: case 7:code before this statement never executed: *dest++ = color;case 7: | 0 | ||||||||||||||||||||||||
| 5855 | case never executed: 6:case 6:never executed: case 6:code before this statement never executed: *dest++ = color;case 6: | 0 | ||||||||||||||||||||||||
| 5856 | case never executed: 5:case 5:never executed: case 5:code before this statement never executed: *dest++ = color;case 5: | 0 | ||||||||||||||||||||||||
| 5857 | case never executed: 4:case 4:never executed: case 4:code before this statement never executed: *dest++ = color;case 4: | 0 | ||||||||||||||||||||||||
| 5858 | case never executed: 3:case 3:never executed: case 3:code before this statement never executed: *dest++ = color;case 3: | 0 | ||||||||||||||||||||||||
| 5859 | case never executed: 2:case 2:never executed: case 2:code before this statement never executed: *dest++ = color;case 2: | 0 | ||||||||||||||||||||||||
| 5860 | case never executed: 1:case 1:never executed: case 1:code before this statement never executed: *dest++ = color;case 1: | 0 | ||||||||||||||||||||||||
| 5861 | } never executed: while (--end of block
| 0 | ||||||||||||||||||||||||
| 5862 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5863 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5864 | - | |||||||||||||||||||||||||
| 5865 | template <> | - | ||||||||||||||||||||||||
| 5866 | inline void qt_memfill_template(quint16 *dest, quint16 value, int count) | - | ||||||||||||||||||||||||
| 5867 | { | - | ||||||||||||||||||||||||
| 5868 | if (count < 3
| 0 | ||||||||||||||||||||||||
| 5869 | switch (count) { | - | ||||||||||||||||||||||||
| 5870 | case never executed: 2:case 2:never executed: *dest++ = value;case 2: | 0 | ||||||||||||||||||||||||
| 5871 | case never executed: 1:case 1:never executed: case 1:code before this statement never executed: *dest = value;case 1: | 0 | ||||||||||||||||||||||||
| 5872 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5873 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 5874 | } | - | ||||||||||||||||||||||||
| 5875 | - | |||||||||||||||||||||||||
| 5876 | const int align = (quintptr)(dest) & 0x3; | - | ||||||||||||||||||||||||
| 5877 | switch (align) { | - | ||||||||||||||||||||||||
| 5878 | case never executed: 2:case 2:never executed: *dest++ = value; --count;case 2: | 0 | ||||||||||||||||||||||||
| 5879 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5880 | - | |||||||||||||||||||||||||
| 5881 | const quint32 value32 = (value << 16) | value; | - | ||||||||||||||||||||||||
| 5882 | qt_memfill(reinterpret_cast<quint32*>(dest), value32, count / 2); | - | ||||||||||||||||||||||||
| 5883 | if (count & 0x1
| 0 | ||||||||||||||||||||||||
| 5884 | dest[count - 1] = value; never executed: dest[count - 1] = value; | 0 | ||||||||||||||||||||||||
| 5885 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5886 | - | |||||||||||||||||||||||||
| 5887 | - | |||||||||||||||||||||||||
| 5888 | void qt_memfill64(quint64 *dest, quint64 color, int count) | - | ||||||||||||||||||||||||
| 5889 | { | - | ||||||||||||||||||||||||
| 5890 | qt_memfill_template<quint64>(dest, color, count); | - | ||||||||||||||||||||||||
| 5891 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5892 | template<QtPixelOrder> const uint * convertA2RGB30PMFromARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *); | - | ||||||||||||||||||||||||
| 5893 | - | |||||||||||||||||||||||||
| 5894 | - | |||||||||||||||||||||||||
| 5895 | extern void qInitBlendFunctions(); | - | ||||||||||||||||||||||||
| 5896 | - | |||||||||||||||||||||||||
| 5897 | static void qInitDrawhelperFunctions() | - | ||||||||||||||||||||||||
| 5898 | { | - | ||||||||||||||||||||||||
| 5899 | - | |||||||||||||||||||||||||
| 5900 | qInitBlendFunctions(); | - | ||||||||||||||||||||||||
| 5901 | - | |||||||||||||||||||||||||
| 5902 | - | |||||||||||||||||||||||||
| 5903 | qDrawHelper[QImage::Format_RGB32].bitmapBlit = qt_bitmapblit32_sse2; | - | ||||||||||||||||||||||||
| 5904 | qDrawHelper[QImage::Format_ARGB32].bitmapBlit = qt_bitmapblit32_sse2; | - | ||||||||||||||||||||||||
| 5905 | qDrawHelper[QImage::Format_ARGB32_Premultiplied].bitmapBlit = qt_bitmapblit32_sse2; | - | ||||||||||||||||||||||||
| 5906 | qDrawHelper[QImage::Format_RGB16].bitmapBlit = qt_bitmapblit16_sse2; | - | ||||||||||||||||||||||||
| 5907 | qDrawHelper[QImage::Format_RGBX8888].bitmapBlit = qt_bitmapblit8888_sse2; | - | ||||||||||||||||||||||||
| 5908 | qDrawHelper[QImage::Format_RGBA8888].bitmapBlit = qt_bitmapblit8888_sse2; | - | ||||||||||||||||||||||||
| 5909 | qDrawHelper[QImage::Format_RGBA8888_Premultiplied].bitmapBlit = qt_bitmapblit8888_sse2; | - | ||||||||||||||||||||||||
| 5910 | - | |||||||||||||||||||||||||
| 5911 | extern void qt_scale_image_argb32_on_argb32_sse2(uchar *destPixels, int dbpl, | - | ||||||||||||||||||||||||
| 5912 | const uchar *srcPixels, int sbpl, int srch, | - | ||||||||||||||||||||||||
| 5913 | const QRectF &targetRect, | - | ||||||||||||||||||||||||
| 5914 | const QRectF &sourceRect, | - | ||||||||||||||||||||||||
| 5915 | const QRect &clip, | - | ||||||||||||||||||||||||
| 5916 | int const_alpha); | - | ||||||||||||||||||||||||
| 5917 | qScaleFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_argb32_sse2; | - | ||||||||||||||||||||||||
| 5918 | qScaleFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_argb32_sse2; | - | ||||||||||||||||||||||||
| 5919 | qScaleFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_scale_image_argb32_on_argb32_sse2; | - | ||||||||||||||||||||||||
| 5920 | qScaleFunctions[QImage::Format_RGBX8888][QImage::Format_RGBA8888_Premultiplied] = qt_scale_image_argb32_on_argb32_sse2; | - | ||||||||||||||||||||||||
| 5921 | - | |||||||||||||||||||||||||
| 5922 | extern void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl, | - | ||||||||||||||||||||||||
| 5923 | const uchar *srcPixels, int sbpl, | - | ||||||||||||||||||||||||
| 5924 | int w, int h, | - | ||||||||||||||||||||||||
| 5925 | int const_alpha); | - | ||||||||||||||||||||||||
| 5926 | extern void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl, | - | ||||||||||||||||||||||||
| 5927 | const uchar *srcPixels, int sbpl, | - | ||||||||||||||||||||||||
| 5928 | int w, int h, | - | ||||||||||||||||||||||||
| 5929 | int const_alpha); | - | ||||||||||||||||||||||||
| 5930 | - | |||||||||||||||||||||||||
| 5931 | qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2; | - | ||||||||||||||||||||||||
| 5932 | qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2; | - | ||||||||||||||||||||||||
| 5933 | qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2; | - | ||||||||||||||||||||||||
| 5934 | qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2; | - | ||||||||||||||||||||||||
| 5935 | qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32_sse2; | - | ||||||||||||||||||||||||
| 5936 | qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32_sse2; | - | ||||||||||||||||||||||||
| 5937 | qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_sse2; | - | ||||||||||||||||||||||||
| 5938 | qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_sse2; | - | ||||||||||||||||||||||||
| 5939 | - | |||||||||||||||||||||||||
| 5940 | extern const uint * qt_fetch_radial_gradient_sse2(uint *buffer, const Operator *op, const QSpanData *data, | - | ||||||||||||||||||||||||
| 5941 | int y, int x, int length); | - | ||||||||||||||||||||||||
| 5942 | - | |||||||||||||||||||||||||
| 5943 | qt_fetch_radial_gradient = qt_fetch_radial_gradient_sse2; | - | ||||||||||||||||||||||||
| 5944 | - | |||||||||||||||||||||||||
| 5945 | - | |||||||||||||||||||||||||
| 5946 | if (((
| 0 | ||||||||||||||||||||||||
| 5947 | extern void qt_blend_argb32_on_argb32_ssse3(uchar *destPixels, int dbpl, | - | ||||||||||||||||||||||||
| 5948 | const uchar *srcPixels, int sbpl, | - | ||||||||||||||||||||||||
| 5949 | int w, int h, | - | ||||||||||||||||||||||||
| 5950 | int const_alpha); | - | ||||||||||||||||||||||||
| 5951 | - | |||||||||||||||||||||||||
| 5952 | qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_ssse3; | - | ||||||||||||||||||||||||
| 5953 | qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_ssse3; | - | ||||||||||||||||||||||||
| 5954 | qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_ssse3; | - | ||||||||||||||||||||||||
| 5955 | qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_ssse3; | - | ||||||||||||||||||||||||
| 5956 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5957 | - | |||||||||||||||||||||||||
| 5958 | - | |||||||||||||||||||||||||
| 5959 | - | |||||||||||||||||||||||||
| 5960 | if (((
| 0 | ||||||||||||||||||||||||
| 5961 | - | |||||||||||||||||||||||||
| 5962 | extern const uint * convertARGB32ToARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *); | - | ||||||||||||||||||||||||
| 5963 | extern const uint * convertRGBA8888ToARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *); | - | ||||||||||||||||||||||||
| 5964 | qPixelLayouts[QImage::Format_ARGB32].convertToARGB32PM = convertARGB32ToARGB32PM_sse4; | - | ||||||||||||||||||||||||
| 5965 | qPixelLayouts[QImage::Format_RGBA8888].convertToARGB32PM = convertRGBA8888ToARGB32PM_sse4; | - | ||||||||||||||||||||||||
| 5966 | - | |||||||||||||||||||||||||
| 5967 | extern const uint * convertARGB32FromARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *); | - | ||||||||||||||||||||||||
| 5968 | extern const uint * convertRGBA8888FromARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *); | - | ||||||||||||||||||||||||
| 5969 | extern const uint * convertRGBXFromARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *); | - | ||||||||||||||||||||||||
| 5970 | qPixelLayouts[QImage::Format_ARGB32].convertFromARGB32PM = convertARGB32FromARGB32PM_sse4; | - | ||||||||||||||||||||||||
| 5971 | qPixelLayouts[QImage::Format_RGBA8888].convertFromARGB32PM = convertRGBA8888FromARGB32PM_sse4; | - | ||||||||||||||||||||||||
| 5972 | qPixelLayouts[QImage::Format_RGBX8888].convertFromARGB32PM = convertRGBXFromARGB32PM_sse4; | - | ||||||||||||||||||||||||
| 5973 | qPixelLayouts[QImage::Format_A2BGR30_Premultiplied].convertFromARGB32PM = convertA2RGB30PMFromARGB32PM_sse4<PixelOrderBGR>; | - | ||||||||||||||||||||||||
| 5974 | qPixelLayouts[QImage::Format_A2RGB30_Premultiplied].convertFromARGB32PM = convertA2RGB30PMFromARGB32PM_sse4<PixelOrderRGB>; | - | ||||||||||||||||||||||||
| 5975 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5976 | - | |||||||||||||||||||||||||
| 5977 | - | |||||||||||||||||||||||||
| 5978 | - | |||||||||||||||||||||||||
| 5979 | if (((
| 0 | ||||||||||||||||||||||||
| 5980 | extern const uint * convertARGB32ToARGB32PM_avx2(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *); | - | ||||||||||||||||||||||||
| 5981 | extern const uint * convertRGBA8888ToARGB32PM_avx2(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *); | - | ||||||||||||||||||||||||
| 5982 | qPixelLayouts[QImage::Format_ARGB32].convertToARGB32PM = convertARGB32ToARGB32PM_avx2; | - | ||||||||||||||||||||||||
| 5983 | qPixelLayouts[QImage::Format_RGBA8888].convertToARGB32PM = convertRGBA8888ToARGB32PM_avx2; | - | ||||||||||||||||||||||||
| 5984 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5985 | - | |||||||||||||||||||||||||
| 5986 | extern void comp_func_SourceOver_sse2(uint *destPixels, const uint *srcPixels, int length, uint const_alpha); | - | ||||||||||||||||||||||||
| 5987 | extern void comp_func_solid_SourceOver_sse2(uint *destPixels, int length, uint color, uint const_alpha); | - | ||||||||||||||||||||||||
| 5988 | extern void comp_func_Source_sse2(uint *destPixels, const uint *srcPixels, int length, uint const_alpha); | - | ||||||||||||||||||||||||
| 5989 | extern void comp_func_Plus_sse2(uint *destPixels, const uint *srcPixels, int length, uint const_alpha); | - | ||||||||||||||||||||||||
| 5990 | qt_functionForMode_C[QPainter::CompositionMode_SourceOver] = comp_func_SourceOver_sse2; | - | ||||||||||||||||||||||||
| 5991 | qt_functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_sse2; | - | ||||||||||||||||||||||||
| 5992 | qt_functionForMode_C[QPainter::CompositionMode_Source] = comp_func_Source_sse2; | - | ||||||||||||||||||||||||
| 5993 | qt_functionForMode_C[QPainter::CompositionMode_Plus] = comp_func_Plus_sse2; | - | ||||||||||||||||||||||||
| 5994 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5995 | - | |||||||||||||||||||||||||
| 5996 | - | |||||||||||||||||||||||||
| 5997 | namespace { static const struct qInitDrawhelperFunctions_ctor_class_ { inline qInitDrawhelperFunctions_ctor_class_() { qInitDrawhelperFunctions(); } never executed: } qInitDrawhelperFunctions_ctor_instance_; };end of block | 0 | ||||||||||||||||||||||||
| 5998 | - | |||||||||||||||||||||||||
| 5999 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |