Line | Source Code | Coverage |
---|
1 | #pragma GCC optimize "O3" | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | enum { | - |
22 | fixed_scale = 1 << 16, | - |
23 | half_point = 1 << 15 | - |
24 | }; | - |
25 | | - |
26 | | - |
27 | static const int buffer_size = 2048; | - |
28 | | - |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
33 | static const uint * convertIndexedToARGB32PM(uint *buffer, const uint *src, int count, | - |
34 | const QPixelLayout *, const QRgb *clut) | - |
35 | { | - |
36 | for (int i = 0; i < count; ++i) evaluated: i < count yes Evaluation Count:69009 | yes Evaluation Count:3393 |
| 3393-69009 |
37 | buffer[i] = PREMUL(clut[src[i]]); executed: buffer[i] = PREMUL(clut[src[i]]); Execution Count:69009 | 69009 |
38 | return buffer; executed: return buffer; Execution Count:3393 | 3393 |
39 | } | - |
40 | | - |
41 | static const uint * convertPassThrough(uint *, const uint *src, int, | - |
42 | const QPixelLayout *, const QRgb *) | - |
43 | { | - |
44 | return src; executed: return src; Execution Count:45567 | 45567 |
45 | } | - |
46 | | - |
47 | static const uint * convertRGB16ToARGB32PM(uint *buffer, const uint *src, int count, | - |
48 | const QPixelLayout *, const QRgb *) | - |
49 | { | - |
50 | for (int i = 0; i < count; ++i) evaluated: i < count yes Evaluation Count:934240 | yes Evaluation Count:5603 |
| 5603-934240 |
51 | buffer[i] = qConvertRgb16To32(src[i]); executed: buffer[i] = qConvertRgb16To32(src[i]); Execution Count:934240 | 934240 |
52 | return buffer; executed: return buffer; Execution Count:5603 | 5603 |
53 | } | - |
54 | | - |
55 | static const uint * convertARGB32ToARGB32PM(uint *buffer, const uint *src, int count, | - |
56 | const QPixelLayout *, const QRgb *) | - |
57 | { | - |
58 | for (int i = 0; i < count; ++i) evaluated: i < count yes Evaluation Count:1431100 | yes Evaluation Count:16167 |
| 16167-1431100 |
59 | buffer[i] = PREMUL(src[i]); executed: buffer[i] = PREMUL(src[i]); Execution Count:1431100 | 1431100 |
60 | return buffer; executed: return buffer; Execution Count:16167 | 16167 |
61 | } | - |
62 | | - |
63 | static const uint * convertToRGB32(uint *buffer, const uint *src, int count, | - |
64 | const QPixelLayout *layout, const QRgb *) | - |
65 | { | - |
66 | qt_noop(); | - |
67 | qt_noop(); | - |
68 | qt_noop(); | - |
69 | qt_noop(); | - |
70 | | - |
71 | const uint redMask = ((1 << layout->redWidth) - 1); | - |
72 | const uint greenMask = ((1 << layout->greenWidth) - 1); | - |
73 | const uint blueMask = ((1 << layout->blueWidth) - 1); | - |
74 | | - |
75 | const uchar redLeftShift = 8 - layout->redWidth; | - |
76 | const uchar greenLeftShift = 8 - layout->greenWidth; | - |
77 | const uchar blueLeftShift = 8 - layout->blueWidth; | - |
78 | | - |
79 | const uchar redRightShift = 2 * layout->redWidth - 8; | - |
80 | const uchar greenRightShift = 2 * layout->greenWidth - 8; | - |
81 | const uchar blueRightShift = 2 * layout->blueWidth - 8; | - |
82 | | - |
83 | for (int i = 0; i < count; ++i) { evaluated: i < count yes Evaluation Count:6092321 | yes Evaluation Count:1088066 |
| 1088066-6092321 |
84 | uint red = (src[i] >> layout->redShift) & redMask; | - |
85 | uint green = (src[i] >> layout->greenShift) & greenMask; | - |
86 | uint blue = (src[i] >> layout->blueShift) & blueMask; | - |
87 | | - |
88 | red = ((red << redLeftShift) | (red >> redRightShift)) << 16; | - |
89 | green = ((green << greenLeftShift) | (green >> greenRightShift)) << 8; | - |
90 | blue = (blue << blueLeftShift) | (blue >> blueRightShift); | - |
91 | buffer[i] = 0xff000000 | red | green | blue; | - |
92 | } executed: } Execution Count:6092321 | 6092321 |
93 | | - |
94 | return buffer; executed: return buffer; Execution Count:1088066 | 1088066 |
95 | } | - |
96 | | - |
97 | static const uint * convertToARGB32PM(uint *buffer, const uint *src, int count, | - |
98 | const QPixelLayout *layout, const QRgb *) | - |
99 | { | - |
100 | qt_noop(); | - |
101 | qt_noop(); | - |
102 | qt_noop(); | - |
103 | qt_noop(); | - |
104 | | - |
105 | const uint redMask = ((1 << layout->redWidth) - 1); | - |
106 | const uint greenMask = ((1 << layout->greenWidth) - 1); | - |
107 | const uint blueMask = ((1 << layout->blueWidth) - 1); | - |
108 | | - |
109 | const uchar redLeftShift = 8 - layout->redWidth; | - |
110 | const uchar greenLeftShift = 8 - layout->greenWidth; | - |
111 | const uchar blueLeftShift = 8 - layout->blueWidth; | - |
112 | | - |
113 | const uchar redRightShift = 2 * layout->redWidth - 8; | - |
114 | const uchar greenRightShift = 2 * layout->greenWidth - 8; | - |
115 | const uchar blueRightShift = 2 * layout->blueWidth - 8; | - |
116 | | - |
117 | const uint alphaMask = ((1 << layout->alphaWidth) - 1); | - |
118 | const uchar alphaLeftShift = 8 - layout->alphaWidth; | - |
119 | const uchar alphaRightShift = 2 * layout->alphaWidth - 8; | - |
120 | | - |
121 | if (layout->premultiplied) { partially evaluated: layout->premultiplied yes Evaluation Count:449773 | no Evaluation Count:0 |
| 0-449773 |
122 | for (int i = 0; i < count; ++i) { evaluated: i < count yes Evaluation Count:3279420 | yes Evaluation Count:449773 |
| 449773-3279420 |
123 | uint alpha = (src[i] >> layout->alphaShift) & alphaMask; | - |
124 | uint red = (src[i] >> layout->redShift) & redMask; | - |
125 | uint green = (src[i] >> layout->greenShift) & greenMask; | - |
126 | uint blue = (src[i] >> layout->blueShift) & blueMask; | - |
127 | | - |
128 | alpha = (alpha << alphaLeftShift) | (alpha >> alphaRightShift); | - |
129 | red = qMin(alpha, (red << redLeftShift) | (red >> redRightShift)); | - |
130 | green = qMin(alpha, (green << greenLeftShift) | (green >> greenRightShift)); | - |
131 | blue = qMin(alpha, (blue << blueLeftShift) | (blue >> blueRightShift)); | - |
132 | buffer[i] = (alpha << 24) | (red << 16) | (green << 8) | blue; | - |
133 | } executed: } Execution Count:3279420 | 3279420 |
134 | } else { executed: } Execution Count:449773 | 449773 |
135 | for (int i = 0; i < count; ++i) { never evaluated: i < count | 0 |
136 | uint alpha = (src[i] >> layout->alphaShift) & alphaMask; | - |
137 | uint red = (src[i] >> layout->redShift) & redMask; | - |
138 | uint green = (src[i] >> layout->greenShift) & greenMask; | - |
139 | uint blue = (src[i] >> layout->blueShift) & blueMask; | - |
140 | | - |
141 | alpha = (alpha << alphaLeftShift) | (alpha >> alphaRightShift); | - |
142 | red = (red << redLeftShift) | (red >> redRightShift); | - |
143 | green = (green << greenLeftShift) | (green >> greenRightShift); | - |
144 | blue = (blue << blueLeftShift) | (blue >> blueRightShift); | - |
145 | buffer[i] = PREMUL((alpha << 24) | (red << 16) | (green << 8) | blue); | - |
146 | } | 0 |
147 | } | 0 |
148 | return buffer; executed: return buffer; Execution Count:449773 | 449773 |
149 | } | - |
150 | | - |
151 | static const uint * convertRGB16FromARGB32PM(uint *buffer, const uint *src, int count, | - |
152 | const QPixelLayout *, const QRgb *) | - |
153 | { | - |
154 | for (int i = 0; i < count; ++i) evaluated: i < count yes Evaluation Count:242710 | yes Evaluation Count:5005 |
| 5005-242710 |
155 | buffer[i] = qConvertRgb32To16((qAlpha(src[i]) == 0 ? 0 : ((qAlpha(src[i]) << 24) | (((255*qRed(src[i]))/ qAlpha(src[i])) << 16) | (((255*qGreen(src[i])) / qAlpha(src[i])) << 8) | ((255*qBlue(src[i])) / qAlpha(src[i]))))); executed: buffer[i] = qConvertRgb32To16((qAlpha(src[i]) == 0 ? 0 : ((qAlpha(src[i]) << 24) | (((255*qRed(src[i]))/ qAlpha(src[i])) << 16) | (((255*qGreen(src[i])) / qAlpha(src[i])) << 8) | ((255*qBlue(src[i])) / qAlpha(src[i]))))); Execution Count:242710 | 242710 |
156 | return buffer; executed: return buffer; Execution Count:5005 | 5005 |
157 | } | - |
158 | | - |
159 | static const uint * convertARGB32FromARGB32PM(uint *buffer, const uint *src, int count, | - |
160 | const QPixelLayout *, const QRgb *) | - |
161 | { | - |
162 | for (int i = 0; i < count; ++i) evaluated: i < count yes Evaluation Count:1885106 | yes Evaluation Count:45857 |
| 45857-1885106 |
163 | buffer[i] = (qAlpha(src[i]) == 0 ? 0 : ((qAlpha(src[i]) << 24) | (((255*qRed(src[i]))/ qAlpha(src[i])) << 16) | (((255*qGreen(src[i])) / qAlpha(src[i])) << 8) | ((255*qBlue(src[i])) / qAlpha(src[i])))); evaluated: qAlpha(src[i]) == 0 yes Evaluation Count:422700 | yes Evaluation Count:1462406 |
executed: buffer[i] = (qAlpha(src[i]) == 0 ? 0 : ((qAlpha(src[i]) << 24) | (((255*qRed(src[i]))/ qAlpha(src[i])) << 16) | (((255*qGreen(src[i])) / qAlpha(src[i])) << 8) | ((255*qBlue(src[i])) / qAlpha(src[i])))); Execution Count:1885106 | 422700-1885106 |
164 | return buffer; executed: return buffer; Execution Count:45857 | 45857 |
165 | } | - |
166 | | - |
167 | static const uint * convertFromARGB32PM(uint *buffer, const uint *src, int count, | - |
168 | const QPixelLayout *layout, const QRgb *) | - |
169 | { | - |
170 | qt_noop(); | - |
171 | qt_noop(); | - |
172 | qt_noop(); | - |
173 | qt_noop(); | - |
174 | | - |
175 | const uint redMask = (1 << layout->redWidth) - 1; | - |
176 | const uint greenMask = (1 << layout->greenWidth) - 1; | - |
177 | const uint blueMask = (1 << layout->blueWidth) - 1; | - |
178 | const uint alphaMask = (1 << layout->alphaWidth) - 1; | - |
179 | | - |
180 | const uchar redRightShift = 24 - layout->redWidth; | - |
181 | const uchar greenRightShift = 16 - layout->greenWidth; | - |
182 | const uchar blueRightShift = 8 - layout->blueWidth; | - |
183 | const uchar alphaRightShift = 32 - layout->alphaWidth; | - |
184 | | - |
185 | if (!layout->premultiplied) { evaluated: !layout->premultiplied yes Evaluation Count:104293 | yes Evaluation Count:62937 |
| 62937-104293 |
186 | for (int i = 0; i < count; ++i) evaluated: i < count yes Evaluation Count:8235233 | yes Evaluation Count:104293 |
| 104293-8235233 |
187 | buffer[i] = qAlpha(src[i]) == 255 ? src[i] : (qAlpha(src[i]) == 0 ? 0 : ((qAlpha(src[i]) << 24) | (((255*qRed(src[i]))/ qAlpha(src[i])) << 16) | (((255*qGreen(src[i])) / qAlpha(src[i])) << 8) | ((255*qBlue(src[i])) / qAlpha(src[i])))); evaluated: qAlpha(src[i]) == 255 yes Evaluation Count:7952693 | yes Evaluation Count:282540 |
executed: buffer[i] = qAlpha(src[i]) == 255 ? src[i] : (qAlpha(src[i]) == 0 ? 0 : ((qAlpha(src[i]) << 24) | (((255*qRed(src[i]))/ qAlpha(src[i])) << 16) | (((255*qGreen(src[i])) / qAlpha(src[i])) << 8) | ((255*qBlue(src[i])) / qAlpha(src[i])))); Execution Count:8235233 | 282540-8235233 |
188 | src = buffer; | - |
189 | } executed: } Execution Count:104293 | 104293 |
190 | for (int i = 0; i < count; ++i) { evaluated: i < count yes Evaluation Count:12486467 | yes Evaluation Count:167230 |
| 167230-12486467 |
191 | uint red = ((src[i] >> redRightShift) & redMask) << layout->redShift; | - |
192 | uint green = ((src[i] >> greenRightShift) & greenMask) << layout->greenShift; | - |
193 | uint blue = ((src[i] >> blueRightShift) & blueMask) << layout->blueShift; | - |
194 | uint alpha = ((src[i] >> alphaRightShift) & alphaMask) << layout->alphaShift; | - |
195 | buffer[i] = red | green | blue | alpha; | - |
196 | } executed: } Execution Count:12486467 | 12486467 |
197 | return buffer; executed: return buffer; Execution Count:167230 | 167230 |
198 | } | - |
199 | | - |
200 | template <QPixelLayout::BPP bpp> static | - |
201 | uint fetchPixel(const uchar *src, int index); | - |
202 | | - |
203 | template <> | - |
204 | inline uint fetchPixel<QPixelLayout::BPP1LSB>(const uchar *src, int index) | - |
205 | { | - |
206 | return (src[index >> 3] >> (index & 7)) & 1; executed: return (src[index >> 3] >> (index & 7)) & 1; Execution Count:22984 | 22984 |
207 | } | - |
208 | | - |
209 | template <> | - |
210 | inline uint fetchPixel<QPixelLayout::BPP1MSB>(const uchar *src, int index) | - |
211 | { | - |
212 | return (src[index >> 3] >> (~index & 7)) & 1; executed: return (src[index >> 3] >> (~index & 7)) & 1; Execution Count:23065 | 23065 |
213 | } | - |
214 | | - |
215 | template <> | - |
216 | inline uint fetchPixel<QPixelLayout::BPP8>(const uchar *src, int index) | - |
217 | { | - |
218 | return src[index]; executed: return src[index]; Execution Count:22960 | 22960 |
219 | } | - |
220 | | - |
221 | template <> | - |
222 | inline uint fetchPixel<QPixelLayout::BPP16>(const uchar *src, int index) | - |
223 | { | - |
224 | return reinterpret_cast<const quint16 *>(src)[index]; executed: return reinterpret_cast<const quint16 *>(src)[index]; Execution Count:3572749 | 3572749 |
225 | } | - |
226 | | - |
227 | template <> | - |
228 | inline uint fetchPixel<QPixelLayout::BPP24>(const uchar *src, int index) | - |
229 | { | - |
230 | return reinterpret_cast<const quint24 *>(src)[index]; executed: return reinterpret_cast<const quint24 *>(src)[index]; Execution Count:6734832 | 6734832 |
231 | } | - |
232 | | - |
233 | template <> | - |
234 | inline uint fetchPixel<QPixelLayout::BPP32>(const uchar *src, int index) | - |
235 | { | - |
236 | return reinterpret_cast<const uint *>(src)[index]; never executed: return reinterpret_cast<const uint *>(src)[index]; | 0 |
237 | } | - |
238 | | - |
239 | template <QPixelLayout::BPP bpp> | - |
240 | inline const uint * fetchPixels(uint *buffer, const uchar *src, int index, int count) | - |
241 | { | - |
242 | for (int i = 0; i < count; ++i) evaluated: i < count yes Evaluation Count:10374461 | yes Evaluation Count:1546778 |
| 1546778-10374461 |
243 | buffer[i] = fetchPixel<bpp>(src, index + i); executed: buffer[i] = fetchPixel<bpp>(src, index + i); Execution Count:10374461 | 10374461 |
244 | return buffer; executed: return buffer; Execution Count:1546778 | 1546778 |
245 | } | - |
246 | | - |
247 | template <> | - |
248 | inline const uint * fetchPixels<QPixelLayout::BPP32>(uint *, const uchar *src, int index, int) | - |
249 | { | - |
250 | return reinterpret_cast<const uint *>(src) + index; executed: return reinterpret_cast<const uint *>(src) + index; Execution Count:50906 | 50906 |
251 | } | - |
252 | | - |
253 | template <QPixelLayout::BPP width> static | - |
254 | void storePixel(uchar *dest, int index, uint pixel); | - |
255 | | - |
256 | template <> | - |
257 | inline void storePixel<QPixelLayout::BPP1LSB>(uchar *dest, int index, uint pixel) | - |
258 | { | - |
259 | if (pixel) | 0 |
260 | dest[index >> 3] |= 1 << (index & 7); never executed: dest[index >> 3] |= 1 << (index & 7); | 0 |
261 | else | - |
262 | dest[index >> 3] &= ~(1 << (index & 7)); never executed: dest[index >> 3] &= ~(1 << (index & 7)); | 0 |
263 | } | - |
264 | | - |
265 | template <> | - |
266 | inline void storePixel<QPixelLayout::BPP1MSB>(uchar *dest, int index, uint pixel) | - |
267 | { | - |
268 | if (pixel) | 0 |
269 | dest[index >> 3] |= 1 << (~index & 7); never executed: dest[index >> 3] |= 1 << (~index & 7); | 0 |
270 | else | - |
271 | dest[index >> 3] &= ~(1 << (~index & 7)); never executed: dest[index >> 3] &= ~(1 << (~index & 7)); | 0 |
272 | } | - |
273 | | - |
274 | template <> | - |
275 | inline void storePixel<QPixelLayout::BPP8>(uchar *dest, int index, uint pixel) | - |
276 | { | - |
277 | dest[index] = uchar(pixel); | - |
278 | } | 0 |
279 | | - |
280 | template <> | - |
281 | inline void storePixel<QPixelLayout::BPP16>(uchar *dest, int index, uint pixel) | - |
282 | { | - |
283 | reinterpret_cast<quint16 *>(dest)[index] = quint16(pixel); | - |
284 | } executed: } Execution Count:3419198 | 3419198 |
285 | | - |
286 | template <> | - |
287 | inline void storePixel<QPixelLayout::BPP24>(uchar *dest, int index, uint pixel) | - |
288 | { | - |
289 | reinterpret_cast<quint24 *>(dest)[index] = quint24(pixel); | - |
290 | } executed: } Execution Count:9311579 | 9311579 |
291 | | - |
292 | template <> | - |
293 | inline void storePixel<QPixelLayout::BPP32>(uchar *dest, int index, uint pixel) | - |
294 | { | - |
295 | reinterpret_cast<uint *>(dest)[index] = pixel; | - |
296 | } | 0 |
297 | | - |
298 | template <QPixelLayout::BPP width> | - |
299 | inline void storePixels(uchar *dest, const uint *src, int index, int count) | - |
300 | { | - |
301 | for (int i = 0; i < count; ++i) evaluated: i < count yes Evaluation Count:12730777 | yes Evaluation Count:172251 |
| 172251-12730777 |
302 | storePixel<width>(dest, index + i, src[i]); executed: storePixel<width>(dest, index + i, src[i]); Execution Count:12730777 | 12730777 |
303 | } executed: } Execution Count:172251 | 172251 |
304 | | - |
305 | template <> | - |
306 | inline void storePixels<QPixelLayout::BPP32>(uchar *dest, const uint *src, int index, int count) | - |
307 | { | - |
308 | memcpy(reinterpret_cast<uint *>(dest) + index, src, count * sizeof(uint)); | - |
309 | } executed: } Execution Count:56276 | 56276 |
310 | | - |
311 | | - |
312 | | - |
313 | | - |
314 | | - |
315 | QPixelLayout qPixelLayouts[QImage::NImageFormats] = { | - |
316 | { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPPNone, 0, 0 }, | - |
317 | { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP1MSB, convertIndexedToARGB32PM, 0 }, | - |
318 | { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP1LSB, convertIndexedToARGB32PM, 0 }, | - |
319 | { 0, 0, 0, 0, 0, 0, 0, 0, false, QPixelLayout::BPP8, convertIndexedToARGB32PM, 0 }, | - |
320 | { 8, 16, 8, 8, 8, 0, 0, 0, false, QPixelLayout::BPP32, convertPassThrough, convertPassThrough }, | - |
321 | { 8, 16, 8, 8, 8, 0, 8, 24, false, QPixelLayout::BPP32, convertARGB32ToARGB32PM, convertARGB32FromARGB32PM }, | - |
322 | { 8, 16, 8, 8, 8, 0, 8, 24, true, QPixelLayout::BPP32, convertPassThrough, convertPassThrough }, | - |
323 | { 5, 11, 6, 5, 5, 0, 0, 0, false, QPixelLayout::BPP16, convertRGB16ToARGB32PM, convertRGB16FromARGB32PM }, | - |
324 | { 5, 19, 6, 13, 5, 8, 8, 0, true, QPixelLayout::BPP24, convertToARGB32PM, convertFromARGB32PM }, | - |
325 | { 6, 12, 6, 6, 6, 0, 0, 0, false, QPixelLayout::BPP24, convertToRGB32, convertFromARGB32PM }, | - |
326 | { 6, 12, 6, 6, 6, 0, 6, 18, true, QPixelLayout::BPP24, convertToARGB32PM, convertFromARGB32PM }, | - |
327 | { 5, 10, 5, 5, 5, 0, 0, 0, false, QPixelLayout::BPP16, convertToRGB32, convertFromARGB32PM }, | - |
328 | { 5, 18, 5, 13, 5, 8, 8, 0, true, QPixelLayout::BPP24, convertToARGB32PM, convertFromARGB32PM }, | - |
329 | { 8, 16, 8, 8, 8, 0, 0, 0, false, QPixelLayout::BPP24, convertToRGB32, convertFromARGB32PM }, | - |
330 | { 4, 8, 4, 4, 4, 0, 0, 0, false, QPixelLayout::BPP16, convertToRGB32, convertFromARGB32PM }, | - |
331 | { 4, 8, 4, 4, 4, 0, 4, 12, true, QPixelLayout::BPP16, convertToARGB32PM, convertFromARGB32PM } | - |
332 | }; | - |
333 | | - |
334 | FetchPixelsFunc qFetchPixels[QPixelLayout::BPPCount] = { | - |
335 | 0, | - |
336 | fetchPixels<QPixelLayout::BPP1MSB>, | - |
337 | fetchPixels<QPixelLayout::BPP1LSB>, | - |
338 | fetchPixels<QPixelLayout::BPP8>, | - |
339 | fetchPixels<QPixelLayout::BPP16>, | - |
340 | fetchPixels<QPixelLayout::BPP24>, | - |
341 | fetchPixels<QPixelLayout::BPP32> | - |
342 | }; | - |
343 | | - |
344 | StorePixelsFunc qStorePixels[QPixelLayout::BPPCount] = { | - |
345 | 0, | - |
346 | storePixels<QPixelLayout::BPP1MSB>, | - |
347 | storePixels<QPixelLayout::BPP1LSB>, | - |
348 | storePixels<QPixelLayout::BPP8>, | - |
349 | storePixels<QPixelLayout::BPP16>, | - |
350 | storePixels<QPixelLayout::BPP24>, | - |
351 | storePixels<QPixelLayout::BPP32> | - |
352 | }; | - |
353 | | - |
354 | typedef uint ( *FetchPixelFunc)(const uchar *src, int index); | - |
355 | | - |
356 | FetchPixelFunc qFetchPixel[QPixelLayout::BPPCount] = { | - |
357 | 0, | - |
358 | fetchPixel<QPixelLayout::BPP1MSB>, | - |
359 | fetchPixel<QPixelLayout::BPP1LSB>, | - |
360 | fetchPixel<QPixelLayout::BPP8>, | - |
361 | fetchPixel<QPixelLayout::BPP16>, | - |
362 | fetchPixel<QPixelLayout::BPP24>, | - |
363 | fetchPixel<QPixelLayout::BPP32> | - |
364 | }; | - |
365 | | - |
366 | | - |
367 | | - |
368 | | - |
369 | | - |
370 | | - |
371 | static uint * destFetchMono(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length) | - |
372 | { | - |
373 | uchar *__restrict__ data = (uchar *)rasterBuffer->scanLine(y); | - |
374 | uint *start = buffer; | - |
375 | const uint *end = buffer + length; | - |
376 | while (buffer < end) { evaluated: buffer < end yes Evaluation Count:9885 | yes Evaluation Count:501 |
| 501-9885 |
377 | *buffer = data[x>>3] & (0x80 >> (x & 7)) ? rasterBuffer->destColor1 : rasterBuffer->destColor0; evaluated: data[x>>3] & (0x80 >> (x & 7)) yes Evaluation Count:27 | yes Evaluation Count:9858 |
| 27-9858 |
378 | ++buffer; | - |
379 | ++x; | - |
380 | } executed: } Execution Count:9885 | 9885 |
381 | return start; executed: return start; Execution Count:501 | 501 |
382 | } | - |
383 | | - |
384 | static uint * destFetchMonoLsb(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length) | - |
385 | { | - |
386 | uchar *__restrict__ data = (uchar *)rasterBuffer->scanLine(y); | - |
387 | uint *start = buffer; | - |
388 | const uint *end = buffer + length; | - |
389 | while (buffer < end) { evaluated: buffer < end yes Evaluation Count:107917 | yes Evaluation Count:98539 |
| 98539-107917 |
390 | *buffer = data[x>>3] & (0x1 << (x & 7)) ? rasterBuffer->destColor1 : rasterBuffer->destColor0; evaluated: data[x>>3] & (0x1 << (x & 7)) yes Evaluation Count:4802 | yes Evaluation Count:103115 |
| 4802-103115 |
391 | ++buffer; | - |
392 | ++x; | - |
393 | } executed: } Execution Count:107917 | 107917 |
394 | return start; executed: return start; Execution Count:98539 | 98539 |
395 | } | - |
396 | | - |
397 | static uint * destFetchARGB32P(uint *, QRasterBuffer *rasterBuffer, int x, int y, int) | - |
398 | { | - |
399 | return (uint *)rasterBuffer->scanLine(y) + x; executed: return (uint *)rasterBuffer->scanLine(y) + x; Execution Count:113961 | 113961 |
400 | } | - |
401 | | - |
402 | static uint * destFetchRGB16(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length) | - |
403 | { | - |
404 | const ushort *__restrict__ data = (const ushort *)rasterBuffer->scanLine(y) + x; | - |
405 | for (int i = 0; i < length; ++i) evaluated: i < length yes Evaluation Count:9273799 | yes Evaluation Count:1045892 |
| 1045892-9273799 |
406 | buffer[i] = qConvertRgb16To32(data[i]); executed: buffer[i] = qConvertRgb16To32(data[i]); Execution Count:9273799 | 9273799 |
407 | return buffer; executed: return buffer; Execution Count:1045892 | 1045892 |
408 | } | - |
409 | | - |
410 | static uint * destFetch(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length) | - |
411 | { | - |
412 | const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format]; | - |
413 | const uint *ptr = qFetchPixels[layout->bpp](buffer, rasterBuffer->scanLine(y), x, length); | - |
414 | return const_cast<uint *>(layout->convertToARGB32PM(buffer, ptr, length, layout, 0)); executed: return const_cast<uint *>(layout->convertToARGB32PM(buffer, ptr, length, layout, 0)); Execution Count:44952 | 44952 |
415 | } | - |
416 | | - |
417 | | - |
418 | static DestFetchProc destFetchProc[QImage::NImageFormats] = | - |
419 | { | - |
420 | 0, | - |
421 | destFetchMono, | - |
422 | destFetchMonoLsb, | - |
423 | 0, | - |
424 | destFetchARGB32P, | - |
425 | destFetch, | - |
426 | destFetchARGB32P, | - |
427 | destFetchRGB16, | - |
428 | destFetch, | - |
429 | destFetch, | - |
430 | destFetch, | - |
431 | destFetch, | - |
432 | destFetch, | - |
433 | destFetch, | - |
434 | destFetch, | - |
435 | destFetch | - |
436 | }; | - |
437 | | - |
438 | | - |
439 | | - |
440 | | - |
441 | | - |
442 | static inline QRgb findNearestColor(QRgb color, QRasterBuffer *rbuf) | - |
443 | { | - |
444 | QRgb color_0 = PREMUL(rbuf->destColor0); | - |
445 | QRgb color_1 = PREMUL(rbuf->destColor1); | - |
446 | color = PREMUL(color); | - |
447 | | - |
448 | int r = qRed(color); | - |
449 | int g = qGreen(color); | - |
450 | int b = qBlue(color); | - |
451 | int rx, gx, bx; | - |
452 | int dist_0, dist_1; | - |
453 | | - |
454 | rx = r - qRed(color_0); | - |
455 | gx = g - qGreen(color_0); | - |
456 | bx = b - qBlue(color_0); | - |
457 | dist_0 = rx*rx + gx*gx + bx*bx; | - |
458 | | - |
459 | rx = r - qRed(color_1); | - |
460 | gx = g - qGreen(color_1); | - |
461 | bx = b - qBlue(color_1); | - |
462 | dist_1 = rx*rx + gx*gx + bx*bx; | - |
463 | | - |
464 | if (dist_0 < dist_1) partially evaluated: dist_0 < dist_1 no Evaluation Count:0 | yes Evaluation Count:4820 |
| 0-4820 |
465 | return color_0; never executed: return color_0; | 0 |
466 | return color_1; executed: return color_1; Execution Count:4820 | 4820 |
467 | } | - |
468 | | - |
469 | | - |
470 | | - |
471 | | - |
472 | | - |
473 | static void destStoreMono(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length) | - |
474 | { | - |
475 | uchar *__restrict__ data = (uchar *)rasterBuffer->scanLine(y); | - |
476 | if (rasterBuffer->monoDestinationWithClut) { partially evaluated: rasterBuffer->monoDestinationWithClut yes Evaluation Count:1288 | no Evaluation Count:0 |
| 0-1288 |
477 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:45095 | yes Evaluation Count:1288 |
| 1288-45095 |
478 | if (buffer[i] == rasterBuffer->destColor0) { evaluated: buffer[i] == rasterBuffer->destColor0 yes Evaluation Count:82 | yes Evaluation Count:45013 |
| 82-45013 |
479 | data[x >> 3] &= ~(0x80 >> (x & 7)); | - |
480 | } else if (buffer[i] == rasterBuffer->destColor1) { executed: } Execution Count:82 evaluated: buffer[i] == rasterBuffer->destColor1 yes Evaluation Count:44977 | yes Evaluation Count:36 |
| 36-44977 |
481 | data[x >> 3] |= 0x80 >> (x & 7); | - |
482 | } else if (findNearestColor(buffer[i], rasterBuffer) == rasterBuffer->destColor0) { executed: } Execution Count:44977 partially evaluated: findNearestColor(buffer[i], rasterBuffer) == rasterBuffer->destColor0 yes Evaluation Count:36 | no Evaluation Count:0 |
| 0-44977 |
483 | data[x >> 3] &= ~(0x80 >> (x & 7)); | - |
484 | } else { executed: } Execution Count:36 | 36 |
485 | data[x >> 3] |= 0x80 >> (x & 7); | - |
486 | } | 0 |
487 | ++x; | - |
488 | } executed: } Execution Count:45095 | 45095 |
489 | } else { executed: } Execution Count:1288 | 1288 |
490 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
491 | if (qGray(buffer[i]) < int(qt_bayer_matrix[y & 15][x & 15])) never evaluated: qGray(buffer[i]) < int(qt_bayer_matrix[y & 15][x & 15]) | 0 |
492 | data[x >> 3] |= 0x80 >> (x & 7); never executed: data[x >> 3] |= 0x80 >> (x & 7); | 0 |
493 | else | - |
494 | data[x >> 3] &= ~(0x80 >> (x & 7)); never executed: data[x >> 3] &= ~(0x80 >> (x & 7)); | 0 |
495 | ++x; | - |
496 | } | 0 |
497 | } | 0 |
498 | } | - |
499 | | - |
500 | static void destStoreMonoLsb(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length) | - |
501 | { | - |
502 | uchar *__restrict__ data = (uchar *)rasterBuffer->scanLine(y); | - |
503 | if (rasterBuffer->monoDestinationWithClut) { partially evaluated: rasterBuffer->monoDestinationWithClut yes Evaluation Count:133696 | no Evaluation Count:0 |
| 0-133696 |
504 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:214899 | yes Evaluation Count:133696 |
| 133696-214899 |
505 | if (buffer[i] == rasterBuffer->destColor0) { evaluated: buffer[i] == rasterBuffer->destColor0 yes Evaluation Count:158833 | yes Evaluation Count:56066 |
| 56066-158833 |
506 | data[x >> 3] &= ~(1 << (x & 7)); | - |
507 | } else if (buffer[i] == rasterBuffer->destColor1) { executed: } Execution Count:158833 evaluated: buffer[i] == rasterBuffer->destColor1 yes Evaluation Count:51282 | yes Evaluation Count:4784 |
| 4784-158833 |
508 | data[x >> 3] |= 1 << (x & 7); | - |
509 | } else if (findNearestColor(buffer[i], rasterBuffer) == rasterBuffer->destColor0) { executed: } Execution Count:51282 partially evaluated: findNearestColor(buffer[i], rasterBuffer) == rasterBuffer->destColor0 no Evaluation Count:0 | yes Evaluation Count:4784 |
| 0-51282 |
510 | data[x >> 3] &= ~(1 << (x & 7)); | - |
511 | } else { | 0 |
512 | data[x >> 3] |= 1 << (x & 7); | - |
513 | } executed: } Execution Count:4784 | 4784 |
514 | ++x; | - |
515 | } executed: } Execution Count:214899 | 214899 |
516 | } else { executed: } Execution Count:133696 | 133696 |
517 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
518 | if (qGray(buffer[i]) < int(qt_bayer_matrix[y & 15][x & 15])) never evaluated: qGray(buffer[i]) < int(qt_bayer_matrix[y & 15][x & 15]) | 0 |
519 | data[x >> 3] |= 1 << (x & 7); never executed: data[x >> 3] |= 1 << (x & 7); | 0 |
520 | else | - |
521 | data[x >> 3] &= ~(1 << (x & 7)); never executed: data[x >> 3] &= ~(1 << (x & 7)); | 0 |
522 | ++x; | - |
523 | } | 0 |
524 | } | 0 |
525 | } | - |
526 | | - |
527 | static void destStoreRGB16(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length) | - |
528 | { | - |
529 | quint16 *data = (quint16*)rasterBuffer->scanLine(y) + x; | - |
530 | for (int i = 0; i < length; ++i) evaluated: i < length yes Evaluation Count:9735058 | yes Evaluation Count:1071868 |
| 1071868-9735058 |
531 | data[i] = qConvertRgb32To16(buffer[i]); executed: data[i] = qConvertRgb32To16(buffer[i]); Execution Count:9735058 | 9735058 |
532 | } executed: } Execution Count:1071868 | 1071868 |
533 | | - |
534 | static void destStore(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length) | - |
535 | { | - |
536 | uint buf[buffer_size]; | - |
537 | const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format]; | - |
538 | StorePixelsFunc store = qStorePixels[layout->bpp]; | - |
539 | uchar *dest = rasterBuffer->scanLine(y); | - |
540 | while (length) { evaluated: length yes Evaluation Count:150341 | yes Evaluation Count:150341 |
| 150341 |
541 | int l = qMin(length, buffer_size); | - |
542 | const uint *ptr = layout->convertFromARGB32PM(buf, buffer, l, layout, 0); | - |
543 | store(dest, ptr, x, l); | - |
544 | length -= l; | - |
545 | buffer += l; | - |
546 | x += l; | - |
547 | } executed: } Execution Count:150341 | 150341 |
548 | } executed: } Execution Count:150341 | 150341 |
549 | | - |
550 | static DestStoreProc destStoreProc[QImage::NImageFormats] = | - |
551 | { | - |
552 | 0, | - |
553 | destStoreMono, | - |
554 | destStoreMonoLsb, | - |
555 | 0, | - |
556 | 0, | - |
557 | destStore, | - |
558 | 0, | - |
559 | destStoreRGB16, | - |
560 | destStore, | - |
561 | destStore, | - |
562 | destStore, | - |
563 | destStore, | - |
564 | destStore, | - |
565 | destStore, | - |
566 | destStore, | - |
567 | destStore | - |
568 | }; | - |
569 | enum TextureBlendType { | - |
570 | BlendUntransformed, | - |
571 | BlendTiled, | - |
572 | BlendTransformed, | - |
573 | BlendTransformedTiled, | - |
574 | BlendTransformedBilinear, | - |
575 | BlendTransformedBilinearTiled, | - |
576 | NBlendTypes | - |
577 | }; | - |
578 | | - |
579 | static const uint * fetchUntransformed(uint *buffer, const Operator *, | - |
580 | const QSpanData *data, int y, int x, int length) | - |
581 | { | - |
582 | const QPixelLayout *layout = &qPixelLayouts[data->texture.format]; | - |
583 | const uint *ptr = qFetchPixels[layout->bpp](buffer, data->texture.scanLine(y), x, length); | - |
584 | const QRgb *clut = data->texture.colorTable ? data->texture.colorTable->constData() : 0; evaluated: data->texture.colorTable yes Evaluation Count:3384 | yes Evaluation Count:53928 |
| 3384-53928 |
585 | return layout->convertToARGB32PM(buffer, ptr, length, layout, clut); executed: return layout->convertToARGB32PM(buffer, ptr, length, layout, clut); Execution Count:57312 | 57312 |
586 | } | - |
587 | | - |
588 | static const uint * fetchUntransformedARGB32PM(uint *, const Operator *, | - |
589 | const QSpanData *data, int y, int x, int) | - |
590 | { | - |
591 | const uchar *scanLine = data->texture.scanLine(y); | - |
592 | return ((const uint *)scanLine) + x; executed: return ((const uint *)scanLine) + x; Execution Count:1108195 | 1108195 |
593 | } | - |
594 | | - |
595 | static const uint * fetchUntransformedRGB16(uint *buffer, const Operator *, | - |
596 | const QSpanData *data, int y, int x, | - |
597 | int length) | - |
598 | { | - |
599 | const quint16 *scanLine = (const quint16 *)data->texture.scanLine(y) + x; | - |
600 | | - |
601 | | - |
602 | | - |
603 | for (int i = 0; i < length; ++i) evaluated: i < length yes Evaluation Count:279512 | yes Evaluation Count:4124 |
| 4124-279512 |
604 | buffer[i] = qConvertRgb16To32(scanLine[i]); executed: buffer[i] = qConvertRgb16To32(scanLine[i]); Execution Count:279512 | 279512 |
605 | | - |
606 | return buffer; executed: return buffer; Execution Count:4124 | 4124 |
607 | } | - |
608 | | - |
609 | | - |
610 | template<TextureBlendType blendType> | - |
611 | static const uint * fetchTransformedARGB32PM(uint *buffer, const Operator *, const QSpanData *data, | - |
612 | int y, int x, int length) | - |
613 | { | - |
614 | int image_width = data->texture.width; | - |
615 | int image_height = data->texture.height; | - |
616 | | - |
617 | const qreal cx = x + qreal(0.5); | - |
618 | const qreal cy = y + qreal(0.5); | - |
619 | | - |
620 | const uint *end = buffer + length; | - |
621 | uint *b = buffer; | - |
622 | if (data->fast_matrix) { never evaluated: data->fast_matrix | 0 |
623 | | - |
624 | int fdx = (int)(data->m11 * fixed_scale); | - |
625 | int fdy = (int)(data->m12 * fixed_scale); | - |
626 | | - |
627 | int fx = int((data->m21 * cy | - |
628 | + data->m11 * cx + data->dx) * fixed_scale); | - |
629 | int fy = int((data->m22 * cy | - |
630 | + data->m12 * cx + data->dy) * fixed_scale); | - |
631 | | - |
632 | while (b < end) { | 0 |
633 | int px = fx >> 16; | - |
634 | int py = fy >> 16; | - |
635 | | - |
636 | if (blendType == BlendTransformedTiled) { never evaluated: blendType == BlendTransformedTiled | 0 |
637 | px %= image_width; | - |
638 | py %= image_height; | - |
639 | if (px < 0) px += image_width; never executed: px += image_width; | 0 |
640 | if (py < 0) py += image_height; never executed: py += image_height; | 0 |
641 | } else { | 0 |
642 | px = qBound(0, px, image_width - 1); | - |
643 | py = qBound(0, py, image_height - 1); | - |
644 | } | 0 |
645 | *b = reinterpret_cast<const uint *>(data->texture.scanLine(py))[px]; | - |
646 | | - |
647 | fx += fdx; | - |
648 | fy += fdy; | - |
649 | ++b; | - |
650 | } | 0 |
651 | } else { | 0 |
652 | const qreal fdx = data->m11; | - |
653 | const qreal fdy = data->m12; | - |
654 | const qreal fdw = data->m13; | - |
655 | | - |
656 | qreal fx = data->m21 * cy + data->m11 * cx + data->dx; | - |
657 | qreal fy = data->m22 * cy + data->m12 * cx + data->dy; | - |
658 | qreal fw = data->m23 * cy + data->m13 * cx + data->m33; | - |
659 | | - |
660 | while (b < end) { | 0 |
661 | const qreal iw = fw == 0 ? 1 : 1 / fw; | 0 |
662 | const qreal tx = fx * iw; | - |
663 | const qreal ty = fy * iw; | - |
664 | int px = int(tx) - (tx < 0); | - |
665 | int py = int(ty) - (ty < 0); | - |
666 | | - |
667 | if (blendType == BlendTransformedTiled) { never evaluated: blendType == BlendTransformedTiled | 0 |
668 | px %= image_width; | - |
669 | py %= image_height; | - |
670 | if (px < 0) px += image_width; never executed: px += image_width; | 0 |
671 | if (py < 0) py += image_height; never executed: py += image_height; | 0 |
672 | } else { | 0 |
673 | px = qBound(0, px, image_width - 1); | - |
674 | py = qBound(0, py, image_height - 1); | - |
675 | } | 0 |
676 | *b = reinterpret_cast<const uint *>(data->texture.scanLine(py))[px]; | - |
677 | | - |
678 | fx += fdx; | - |
679 | fy += fdy; | - |
680 | fw += fdw; | - |
681 | | - |
682 | if (!fw) { | 0 |
683 | fw += fdw; | - |
684 | } | 0 |
685 | ++b; | - |
686 | } | 0 |
687 | } | 0 |
688 | return buffer; never executed: return buffer; | 0 |
689 | } | - |
690 | | - |
691 | template<TextureBlendType blendType> | - |
692 | static const uint * fetchTransformed(uint *buffer, const Operator *, const QSpanData *data, | - |
693 | int y, int x, int length) | - |
694 | { | - |
695 | int image_width = data->texture.width; | - |
696 | int image_height = data->texture.height; | - |
697 | | - |
698 | const qreal cx = x + qreal(0.5); | - |
699 | const qreal cy = y + qreal(0.5); | - |
700 | | - |
701 | const QPixelLayout *layout = &qPixelLayouts[data->texture.format]; | - |
702 | FetchPixelFunc fetch = qFetchPixel[layout->bpp]; | - |
703 | | - |
704 | const uint *end = buffer + length; | - |
705 | uint *b = buffer; | - |
706 | if (data->fast_matrix) { partially evaluated: data->fast_matrix yes Evaluation Count:73 | no Evaluation Count:0 |
| 0-73 |
707 | | - |
708 | int fdx = (int)(data->m11 * fixed_scale); | - |
709 | int fdy = (int)(data->m12 * fixed_scale); | - |
710 | | - |
711 | int fx = int((data->m21 * cy | - |
712 | + data->m11 * cx + data->dx) * fixed_scale); | - |
713 | int fy = int((data->m22 * cy | - |
714 | + data->m12 * cx + data->dy) * fixed_scale); | - |
715 | | - |
716 | while (b < end) { evaluated: b < end yes Evaluation Count:2129 | yes Evaluation Count:73 |
| 73-2129 |
717 | int px = fx >> 16; | - |
718 | int py = fy >> 16; | - |
719 | | - |
720 | if (blendType == BlendTransformedTiled) { partially evaluated: blendType == BlendTransformedTiled no Evaluation Count:0 | yes Evaluation Count:2129 |
| 0-2129 |
721 | px %= image_width; | - |
722 | py %= image_height; | - |
723 | if (px < 0) px += image_width; never executed: px += image_width; | 0 |
724 | if (py < 0) py += image_height; never executed: py += image_height; | 0 |
725 | } else { | 0 |
726 | px = qBound(0, px, image_width - 1); | - |
727 | py = qBound(0, py, image_height - 1); | - |
728 | } executed: } Execution Count:2129 | 2129 |
729 | *b = fetch(data->texture.scanLine(py), px); | - |
730 | | - |
731 | fx += fdx; | - |
732 | fy += fdy; | - |
733 | ++b; | - |
734 | } executed: } Execution Count:2129 | 2129 |
735 | } else { executed: } Execution Count:73 | 73 |
736 | const qreal fdx = data->m11; | - |
737 | const qreal fdy = data->m12; | - |
738 | const qreal fdw = data->m13; | - |
739 | | - |
740 | qreal fx = data->m21 * cy + data->m11 * cx + data->dx; | - |
741 | qreal fy = data->m22 * cy + data->m12 * cx + data->dy; | - |
742 | qreal fw = data->m23 * cy + data->m13 * cx + data->m33; | - |
743 | | - |
744 | while (b < end) { | 0 |
745 | const qreal iw = fw == 0 ? 1 : 1 / fw; | 0 |
746 | const qreal tx = fx * iw; | - |
747 | const qreal ty = fy * iw; | - |
748 | int px = int(tx) - (tx < 0); | - |
749 | int py = int(ty) - (ty < 0); | - |
750 | | - |
751 | if (blendType == BlendTransformedTiled) { never evaluated: blendType == BlendTransformedTiled | 0 |
752 | px %= image_width; | - |
753 | py %= image_height; | - |
754 | if (px < 0) px += image_width; never executed: px += image_width; | 0 |
755 | if (py < 0) py += image_height; never executed: py += image_height; | 0 |
756 | } else { | 0 |
757 | px = qBound(0, px, image_width - 1); | - |
758 | py = qBound(0, py, image_height - 1); | - |
759 | } | 0 |
760 | *b = fetch(data->texture.scanLine(py), px); | - |
761 | | - |
762 | fx += fdx; | - |
763 | fy += fdy; | - |
764 | fw += fdw; | - |
765 | | - |
766 | if (!fw) { | 0 |
767 | fw += fdw; | - |
768 | } | 0 |
769 | ++b; | - |
770 | } | 0 |
771 | } | 0 |
772 | const QRgb *clut = data->texture.colorTable ? data->texture.colorTable->constData() : 0; evaluated: data->texture.colorTable yes Evaluation Count:9 | yes Evaluation Count:64 |
| 9-64 |
773 | return layout->convertToARGB32PM(buffer, buffer, length, layout, clut); executed: return layout->convertToARGB32PM(buffer, buffer, length, layout, clut); Execution Count:73 | 73 |
774 | } | - |
775 | | - |
776 | | - |
777 | | - |
778 | | - |
779 | | - |
780 | static inline uint interpolate_4_pixels_16(uint tl, uint tr, uint bl, uint br, int distx, int disty) | - |
781 | { | - |
782 | uint distxy = distx * disty; | - |
783 | | - |
784 | | - |
785 | uint tlrb = (tl & 0x00ff00ff) * (16*16 - 16*distx - 16*disty + distxy); | - |
786 | uint tlag = ((tl & 0xff00ff00) >> 8) * (16*16 - 16*distx - 16*disty + distxy); | - |
787 | uint trrb = ((tr & 0x00ff00ff) * (distx*16 - distxy)); | - |
788 | uint trag = (((tr & 0xff00ff00) >> 8) * (distx*16 - distxy)); | - |
789 | uint blrb = ((bl & 0x00ff00ff) * (disty*16 - distxy)); | - |
790 | uint blag = (((bl & 0xff00ff00) >> 8) * (disty*16 - distxy)); | - |
791 | uint brrb = ((br & 0x00ff00ff) * (distxy)); | - |
792 | uint brag = (((br & 0xff00ff00) >> 8) * (distxy)); | - |
793 | return (((tlrb + trrb + blrb + brrb) >> 8) & 0x00ff00ff) | ((tlag + trag + blag + brag) & 0xff00ff00); executed: return (((tlrb + trrb + blrb + brrb) >> 8) & 0x00ff00ff) | ((tlag + trag + blag + brag) & 0xff00ff00); Execution Count:66942 | 66942 |
794 | } | - |
795 | template<TextureBlendType blendType> | - |
796 | void fetchTransformedBilinear_pixelBounds(int max, int l1, int l2, int &v1, int &v2); | - |
797 | | - |
798 | template<> | - |
799 | inline void fetchTransformedBilinear_pixelBounds<BlendTransformedBilinearTiled>(int max, int, int, int &v1, int &v2) | - |
800 | { | - |
801 | v1 %= max; | - |
802 | if (v1 < 0) evaluated: v1 < 0 yes Evaluation Count:10780 | yes Evaluation Count:13422 |
| 10780-13422 |
803 | v1 += max; executed: v1 += max; Execution Count:10780 | 10780 |
804 | v2 = v1 + 1; | - |
805 | if (v2 == max) evaluated: v2 == max yes Evaluation Count:3300 | yes Evaluation Count:20902 |
| 3300-20902 |
806 | v2 = 0; executed: v2 = 0; Execution Count:3300 | 3300 |
807 | qt_noop(); | - |
808 | qt_noop(); | - |
809 | } executed: } Execution Count:24202 | 24202 |
810 | | - |
811 | template<> | - |
812 | inline void fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(int, int l1, int l2, int &v1, int &v2) | - |
813 | { | - |
814 | if (v1 < l1) evaluated: v1 < l1 yes Evaluation Count:2219 | yes Evaluation Count:253099 |
| 2219-253099 |
815 | v2 = v1 = l1; executed: v2 = v1 = l1; Execution Count:2219 | 2219 |
816 | else if (v1 >= l2) evaluated: v1 >= l2 yes Evaluation Count:1568 | yes Evaluation Count:251531 |
| 1568-251531 |
817 | v2 = v1 = l2; executed: v2 = v1 = l2; Execution Count:1568 | 1568 |
818 | else | - |
819 | v2 = v1 + 1; executed: v2 = v1 + 1; Execution Count:251531 | 251531 |
820 | qt_noop(); | - |
821 | qt_noop(); | - |
822 | } executed: } Execution Count:255318 | 255318 |
823 | | - |
824 | template<TextureBlendType blendType> | - |
825 | static const uint * fetchTransformedBilinearARGB32PM(uint *buffer, const Operator *, | - |
826 | const QSpanData *data, int y, int x, | - |
827 | int length) | - |
828 | { | - |
829 | int image_width = data->texture.width; | - |
830 | int image_height = data->texture.height; | - |
831 | | - |
832 | int image_x1 = data->texture.x1; | - |
833 | int image_y1 = data->texture.y1; | - |
834 | int image_x2 = data->texture.x2 - 1; | - |
835 | int image_y2 = data->texture.y2 - 1; | - |
836 | | - |
837 | const qreal cx = x + qreal(0.5); | - |
838 | const qreal cy = y + qreal(0.5); | - |
839 | | - |
840 | uint *end = buffer + length; | - |
841 | uint *b = buffer; | - |
842 | if (data->fast_matrix) { evaluated: data->fast_matrix yes Evaluation Count:1606 | yes Evaluation Count:583 |
| 583-1606 |
843 | | - |
844 | int fdx = (int)(data->m11 * fixed_scale); | - |
845 | int fdy = (int)(data->m12 * fixed_scale); | - |
846 | | - |
847 | int fx = int((data->m21 * cy | - |
848 | + data->m11 * cx + data->dx) * fixed_scale); | - |
849 | int fy = int((data->m22 * cy | - |
850 | + data->m12 * cx + data->dy) * fixed_scale); | - |
851 | | - |
852 | fx -= half_point; | - |
853 | fy -= half_point; | - |
854 | | - |
855 | if (fdy == 0) { evaluated: fdy == 0 yes Evaluation Count:994 | yes Evaluation Count:612 |
| 612-994 |
856 | int y1 = (fy >> 16); | - |
857 | int y2; | - |
858 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - |
859 | const uint *s1 = (const uint *)data->texture.scanLine(y1); | - |
860 | const uint *s2 = (const uint *)data->texture.scanLine(y2); | - |
861 | | - |
862 | if (fdx <= fixed_scale && fdx > 0) { evaluated: fdx <= fixed_scale yes Evaluation Count:930 | yes Evaluation Count:64 |
evaluated: fdx > 0 yes Evaluation Count:802 | yes Evaluation Count:128 |
| 64-930 |
863 | int disty = (fy & 0x0000ffff) >> 8; | - |
864 | int idisty = 256 - disty; | - |
865 | int x = fx >> 16; | - |
866 | | - |
867 | | - |
868 | | - |
869 | | - |
870 | | - |
871 | | - |
872 | quint32 intermediate_buffer[2][buffer_size + 2]; | - |
873 | | - |
874 | int count = qCeil(length * data->m11) + 2; | - |
875 | qt_noop(); | - |
876 | int f = 0; | - |
877 | int lim = count; | - |
878 | if (blendType == BlendTransformedBilinearTiled) { partially evaluated: blendType == BlendTransformedBilinearTiled no Evaluation Count:0 | yes Evaluation Count:802 |
| 0-802 |
879 | x %= image_width; | - |
880 | if (x < 0) x += image_width; never executed: x += image_width; | 0 |
881 | } else { | 0 |
882 | lim = qMin(count, image_x2-x+1); | - |
883 | if (x < image_x1) { partially evaluated: x < image_x1 yes Evaluation Count:802 | no Evaluation Count:0 |
| 0-802 |
884 | qt_noop(); | - |
885 | uint t = s1[image_x1]; | - |
886 | uint b = s2[image_x1]; | - |
887 | quint32 rb = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff; | - |
888 | quint32 ag = ((((t>>8) & 0xff00ff) * idisty + ((b>>8) & 0xff00ff) * disty) >> 8) & 0xff00ff; | - |
889 | do { | - |
890 | intermediate_buffer[0][f] = rb; | - |
891 | intermediate_buffer[1][f] = ag; | - |
892 | f++; | - |
893 | x++; | - |
894 | } while (x < image_x1 && f < lim); executed: } Execution Count:802 partially evaluated: x < image_x1 no Evaluation Count:0 | yes Evaluation Count:802 |
| 0-802 |
895 | } executed: } Execution Count:802 | 802 |
896 | } executed: } Execution Count:802 | 802 |
897 | | - |
898 | if (blendType != BlendTransformedBilinearTiled) { partially evaluated: blendType != BlendTransformedBilinearTiled yes Evaluation Count:802 | no Evaluation Count:0 |
| 0-802 |
899 | | - |
900 | const __m128i disty_ = _mm_set1_epi16(disty); | - |
901 | const __m128i idisty_ = _mm_set1_epi16(idisty); | - |
902 | const __m128i colorMask = _mm_set1_epi32(0x00ff00ff); | - |
903 | | - |
904 | lim -= 3; | - |
905 | for (; f < lim; x += 4, f += 4) { evaluated: f < lim yes Evaluation Count:15770 | yes Evaluation Count:802 |
| 802-15770 |
906 | | - |
907 | __m128i top = _mm_loadu_si128((__m128i*)((const uint *)(s1)+x)); | - |
908 | __m128i topAG = _mm_srli_epi16(top, 8); | - |
909 | __m128i topRB = _mm_and_si128(top, colorMask); | - |
910 | | - |
911 | topAG = _mm_mullo_epi16 (topAG, idisty_); | - |
912 | topRB = _mm_mullo_epi16 (topRB, idisty_); | - |
913 | | - |
914 | | - |
915 | __m128i bottom = _mm_loadu_si128((__m128i*)((const uint *)(s2)+x)); | - |
916 | __m128i bottomAG = _mm_srli_epi16(bottom, 8); | - |
917 | __m128i bottomRB = _mm_and_si128(bottom, colorMask); | - |
918 | bottomAG = _mm_mullo_epi16 (bottomAG, disty_); | - |
919 | bottomRB = _mm_mullo_epi16 (bottomRB, disty_); | - |
920 | | - |
921 | | - |
922 | __m128i rAG =_mm_add_epi16(topAG, bottomAG); | - |
923 | rAG = _mm_srli_epi16(rAG, 8); | - |
924 | _mm_storeu_si128((__m128i*)(&intermediate_buffer[1][f]), rAG); | - |
925 | __m128i rRB =_mm_add_epi16(topRB, bottomRB); | - |
926 | rRB = _mm_srli_epi16(rRB, 8); | - |
927 | _mm_storeu_si128((__m128i*)(&intermediate_buffer[0][f]), rRB); | - |
928 | } executed: } Execution Count:15770 | 15770 |
929 | } executed: } Execution Count:802 | 802 |
930 | for (; f < count; f++) { evaluated: f < count yes Evaluation Count:970 | yes Evaluation Count:802 |
| 802-970 |
931 | if (blendType == BlendTransformedBilinearTiled) { partially evaluated: blendType == BlendTransformedBilinearTiled no Evaluation Count:0 | yes Evaluation Count:970 |
| 0-970 |
932 | if (x >= image_width) x -= image_width; never executed: x -= image_width; never evaluated: x >= image_width | 0 |
933 | } else { | 0 |
934 | x = qMin(x, image_x2); | - |
935 | } executed: } Execution Count:970 | 970 |
936 | | - |
937 | uint t = s1[x]; | - |
938 | uint b = s2[x]; | - |
939 | | - |
940 | intermediate_buffer[0][f] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff; | - |
941 | intermediate_buffer[1][f] = ((((t>>8) & 0xff00ff) * idisty + ((b>>8) & 0xff00ff) * disty) >> 8) & 0xff00ff; | - |
942 | x++; | - |
943 | } executed: } Execution Count:970 | 970 |
944 | | - |
945 | fx &= fixed_scale - 1; | - |
946 | qt_noop(); | - |
947 | while (b < end) { evaluated: b < end yes Evaluation Count:138364 | yes Evaluation Count:802 |
| 802-138364 |
948 | register int x1 = (fx >> 16); | - |
949 | register int x2 = x1 + 1; | - |
950 | qt_noop(); | - |
951 | qt_noop(); | - |
952 | | - |
953 | register int distx = (fx & 0x0000ffff) >> 8; | - |
954 | register int idistx = 256 - distx; | - |
955 | int rb = ((intermediate_buffer[0][x1] * idistx + intermediate_buffer[0][x2] * distx) >> 8) & 0xff00ff; | - |
956 | int ag = (intermediate_buffer[1][x1] * idistx + intermediate_buffer[1][x2] * distx) & 0xff00ff00; | - |
957 | *b = rb | ag; | - |
958 | b++; | - |
959 | fx += fdx; | - |
960 | } executed: } Execution Count:138364 | 138364 |
961 | } else if ((fdx < 0 && fdx > -(fixed_scale / 8)) || fabs(data->m22) < (1./8.)) { evaluated: fdx < 0 yes Evaluation Count:128 | yes Evaluation Count:64 |
partially evaluated: fdx > -(fixed_scale / 8) no Evaluation Count:0 | yes Evaluation Count:128 |
partially evaluated: fabs(data->m22) < (1./8.) no Evaluation Count:0 | yes Evaluation Count:192 |
executed: } Execution Count:802 | 0-802 |
962 | int y1 = (fy >> 16); | - |
963 | int y2; | - |
964 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - |
965 | const uint *s1 = (const uint *)data->texture.scanLine(y1); | - |
966 | const uint *s2 = (const uint *)data->texture.scanLine(y2); | - |
967 | int disty = (fy & 0x0000ffff) >> 8; | - |
968 | int idisty = 256 - disty; | - |
969 | while (b < end) { | 0 |
970 | int x1 = (fx >> 16); | - |
971 | int x2; | - |
972 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - |
973 | uint tl = s1[x1]; | - |
974 | uint tr = s1[x2]; | - |
975 | uint bl = s2[x1]; | - |
976 | uint br = s2[x2]; | - |
977 | | - |
978 | int distx = (fx & 0x0000ffff) >> 8; | - |
979 | int idistx = 256 - distx; | - |
980 | | - |
981 | uint xtop = INTERPOLATE_PIXEL_256(tl, idistx, tr, distx); | - |
982 | uint xbot = INTERPOLATE_PIXEL_256(bl, idistx, br, distx); | - |
983 | *b = INTERPOLATE_PIXEL_256(xtop, idisty, xbot, disty); | - |
984 | | - |
985 | fx += fdx; | - |
986 | ++b; | - |
987 | } | 0 |
988 | } else { | 0 |
989 | int y1 = (fy >> 16); | - |
990 | int y2; | - |
991 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - |
992 | const uint *s1 = (const uint *)data->texture.scanLine(y1); | - |
993 | const uint *s2 = (const uint *)data->texture.scanLine(y2); | - |
994 | int disty = (fy & 0x0000ffff) >> 12; | - |
995 | | - |
996 | if (blendType != BlendTransformedBilinearTiled) { partially evaluated: blendType != BlendTransformedBilinearTiled yes Evaluation Count:192 | no Evaluation Count:0 |
| 0-192 |
997 | while (b < end) { int x1 = (fx >> 16); int x2; fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); if (x1 != x2) break; 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; } uint *boundedEnd; if (fdx > 0) boundedEnd = qMin(end, buffer + uint((image_x2 - (fx >> 16)) / data->m11)); else boundedEnd = qMin(end, buffer + uint((image_x1 - (fx >> 16)) / data->m11)); boundedEnd -= 3; partially evaluated: b < end yes Evaluation Count:192 | no Evaluation Count:0 |
executed: break; Execution Count:192 executed: boundedEnd = qMin(end, buffer + uint((image_x2 - (fx >> 16)) / data->m11)); Execution Count:64 executed: boundedEnd = qMin(end, buffer + uint((image_x1 - (fx >> 16)) / data->m11)); Execution Count:128 partially evaluated: x1 != x2 yes Evaluation Count:192 | no Evaluation Count:0 |
evaluated: fdx > 0 yes Evaluation Count:64 | yes Evaluation Count:128 |
| 0-192 |
998 | | - |
999 | const __m128i colorMask = _mm_set1_epi32(0x00ff00ff); | - |
1000 | const __m128i v_256 = _mm_set1_epi16(256); | - |
1001 | const __m128i v_disty = _mm_set1_epi16(disty); | - |
1002 | __m128i v_fdx = _mm_set1_epi32(fdx*4); | - |
1003 | | - |
1004 | ptrdiff_t secondLine = reinterpret_cast<const uint *>(s2) - reinterpret_cast<const uint *>(s1); | - |
1005 | | - |
1006 | union Vect_buffer { __m128i vect; quint32 i[4]; }; | - |
1007 | Vect_buffer v_fx; | - |
1008 | | - |
1009 | for (int i = 0; i < 4; i++) { evaluated: i < 4 yes Evaluation Count:768 | yes Evaluation Count:192 |
| 192-768 |
1010 | v_fx.i[i] = fx; | - |
1011 | fx += fdx; | - |
1012 | } executed: } Execution Count:768 | 768 |
1013 | | - |
1014 | while (b < boundedEnd) { evaluated: b < boundedEnd yes Evaluation Count:4928 | yes Evaluation Count:192 |
| 192-4928 |
1015 | | - |
1016 | Vect_buffer tl, tr, bl, br; | - |
1017 | | - |
1018 | for (int i = 0; i < 4; i++) { evaluated: i < 4 yes Evaluation Count:19712 | yes Evaluation Count:4928 |
| 4928-19712 |
1019 | int x1 = v_fx.i[i] >> 16; | - |
1020 | const uint *addr_tl = reinterpret_cast<const uint *>(s1) + x1; | - |
1021 | const uint *addr_tr = addr_tl + 1; | - |
1022 | tl.i[i] = *addr_tl; | - |
1023 | tr.i[i] = *addr_tr; | - |
1024 | bl.i[i] = *(addr_tl+secondLine); | - |
1025 | br.i[i] = *(addr_tr+secondLine); | - |
1026 | } executed: } Execution Count:19712 | 19712 |
1027 | __m128i v_distx = _mm_srli_epi16(v_fx.vect, 12); | - |
1028 | v_distx = _mm_shufflehi_epi16(v_distx, (((2) << 6) | ((2) << 4) | ((0) << 2) | (0))); | - |
1029 | v_distx = _mm_shufflelo_epi16(v_distx, (((2) << 6) | ((2) << 4) | ((0) << 2) | (0))); | - |
1030 | | - |
1031 | { 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.vect, 8); __m128i tlRB = _mm_and_si128(tl.vect, colorMask); __m128i trAG = _mm_srli_epi16(tr.vect, 8); __m128i trRB = _mm_and_si128(tr.vect, colorMask); __m128i blAG = _mm_srli_epi16(bl.vect, 8); __m128i blRB = _mm_and_si128(bl.vect, colorMask); __m128i brAG = _mm_srli_epi16(br.vect, 8); __m128i brRB = _mm_and_si128(br.vect, 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)); }; | - |
1032 | b+=4; | - |
1033 | v_fx.vect = _mm_add_epi32(v_fx.vect, v_fdx); | - |
1034 | } executed: } Execution Count:4928 | 4928 |
1035 | fx = v_fx.i[0]; | - |
1036 | } executed: } Execution Count:192 | 192 |
1037 | | - |
1038 | while (b < end) { evaluated: b < end yes Evaluation Count:768 | yes Evaluation Count:192 |
| 192-768 |
1039 | int x1 = (fx >> 16); | - |
1040 | int x2; | - |
1041 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - |
1042 | uint tl = s1[x1]; | - |
1043 | uint tr = s1[x2]; | - |
1044 | uint bl = s2[x1]; | - |
1045 | uint br = s2[x2]; | - |
1046 | int distx = (fx & 0x0000ffff) >> 12; | - |
1047 | *b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty); | - |
1048 | fx += fdx; | - |
1049 | ++b; | - |
1050 | } executed: } Execution Count:768 | 768 |
1051 | } executed: } Execution Count:192 | 192 |
1052 | } else { | - |
1053 | if (fabs(data->m11) > 8 || fabs(data->m22) > 8) { partially evaluated: fabs(data->m11) > 8 no Evaluation Count:0 | yes Evaluation Count:612 |
partially evaluated: fabs(data->m22) > 8 no Evaluation Count:0 | yes Evaluation Count:612 |
| 0-612 |
1054 | | - |
1055 | while (b < end) { | 0 |
1056 | int x1 = (fx >> 16); | - |
1057 | int x2; | - |
1058 | int y1 = (fy >> 16); | - |
1059 | int y2; | - |
1060 | | - |
1061 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - |
1062 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - |
1063 | | - |
1064 | const uint *s1 = (const uint *)data->texture.scanLine(y1); | - |
1065 | const uint *s2 = (const uint *)data->texture.scanLine(y2); | - |
1066 | | - |
1067 | uint tl = s1[x1]; | - |
1068 | uint tr = s1[x2]; | - |
1069 | uint bl = s2[x1]; | - |
1070 | uint br = s2[x2]; | - |
1071 | | - |
1072 | int distx = (fx & 0x0000ffff) >> 8; | - |
1073 | int disty = (fy & 0x0000ffff) >> 8; | - |
1074 | int idistx = 256 - distx; | - |
1075 | int idisty = 256 - disty; | - |
1076 | | - |
1077 | uint xtop = INTERPOLATE_PIXEL_256(tl, idistx, tr, distx); | - |
1078 | uint xbot = INTERPOLATE_PIXEL_256(bl, idistx, br, distx); | - |
1079 | *b = INTERPOLATE_PIXEL_256(xtop, idisty, xbot, disty); | - |
1080 | | - |
1081 | fx += fdx; | - |
1082 | fy += fdy; | - |
1083 | ++b; | - |
1084 | } | 0 |
1085 | } else { | 0 |
1086 | | - |
1087 | while (b < end) { evaluated: b < end yes Evaluation Count:66174 | yes Evaluation Count:612 |
| 612-66174 |
1088 | int x1 = (fx >> 16); | - |
1089 | int x2; | - |
1090 | int y1 = (fy >> 16); | - |
1091 | int y2; | - |
1092 | | - |
1093 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - |
1094 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - |
1095 | | - |
1096 | const uint *s1 = (const uint *)data->texture.scanLine(y1); | - |
1097 | const uint *s2 = (const uint *)data->texture.scanLine(y2); | - |
1098 | | - |
1099 | uint tl = s1[x1]; | - |
1100 | uint tr = s1[x2]; | - |
1101 | uint bl = s2[x1]; | - |
1102 | uint br = s2[x2]; | - |
1103 | | - |
1104 | int distx = (fx & 0x0000ffff) >> 12; | - |
1105 | int disty = (fy & 0x0000ffff) >> 12; | - |
1106 | | - |
1107 | *b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty); | - |
1108 | | - |
1109 | fx += fdx; | - |
1110 | fy += fdy; | - |
1111 | ++b; | - |
1112 | } executed: } Execution Count:66174 | 66174 |
1113 | } executed: } Execution Count:612 | 612 |
1114 | } | - |
1115 | } else { | - |
1116 | const qreal fdx = data->m11; | - |
1117 | const qreal fdy = data->m12; | - |
1118 | const qreal fdw = data->m13; | - |
1119 | | - |
1120 | qreal fx = data->m21 * cy + data->m11 * cx + data->dx; | - |
1121 | qreal fy = data->m22 * cy + data->m12 * cx + data->dy; | - |
1122 | qreal fw = data->m23 * cy + data->m13 * cx + data->m33; | - |
1123 | | - |
1124 | while (b < end) { evaluated: b < end yes Evaluation Count:72513 | yes Evaluation Count:583 |
| 583-72513 |
1125 | const qreal iw = fw == 0 ? 1 : 1 / fw; partially evaluated: fw == 0 no Evaluation Count:0 | yes Evaluation Count:72513 |
| 0-72513 |
1126 | const qreal px = fx * iw - qreal(0.5); | - |
1127 | const qreal py = fy * iw - qreal(0.5); | - |
1128 | | - |
1129 | int x1 = int(px) - (px < 0); | - |
1130 | int x2; | - |
1131 | int y1 = int(py) - (py < 0); | - |
1132 | int y2; | - |
1133 | | - |
1134 | int distx = int((px - x1) * 256); | - |
1135 | int disty = int((py - y1) * 256); | - |
1136 | int idistx = 256 - distx; | - |
1137 | int idisty = 256 - disty; | - |
1138 | | - |
1139 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - |
1140 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - |
1141 | | - |
1142 | const uint *s1 = (const uint *)data->texture.scanLine(y1); | - |
1143 | const uint *s2 = (const uint *)data->texture.scanLine(y2); | - |
1144 | | - |
1145 | uint tl = s1[x1]; | - |
1146 | uint tr = s1[x2]; | - |
1147 | uint bl = s2[x1]; | - |
1148 | uint br = s2[x2]; | - |
1149 | | - |
1150 | uint xtop = INTERPOLATE_PIXEL_256(tl, idistx, tr, distx); | - |
1151 | uint xbot = INTERPOLATE_PIXEL_256(bl, idistx, br, distx); | - |
1152 | *b = INTERPOLATE_PIXEL_256(xtop, idisty, xbot, disty); | - |
1153 | | - |
1154 | fx += fdx; | - |
1155 | fy += fdy; | - |
1156 | fw += fdw; | - |
1157 | | - |
1158 | if (!fw) { partially evaluated: !fw no Evaluation Count:0 | yes Evaluation Count:72513 |
| 0-72513 |
1159 | fw += fdw; | - |
1160 | } | 0 |
1161 | ++b; | - |
1162 | } executed: } Execution Count:72513 | 72513 |
1163 | } executed: } Execution Count:583 | 583 |
1164 | | - |
1165 | return buffer; executed: return buffer; Execution Count:2189 | 2189 |
1166 | } | - |
1167 | | - |
1168 | | - |
1169 | template<TextureBlendType blendType> | - |
1170 | static const uint * fetchTransformedBilinear(uint *buffer, const Operator *, | - |
1171 | const QSpanData *data, int y, int x, int length) | - |
1172 | { | - |
1173 | const QPixelLayout *layout = &qPixelLayouts[data->texture.format]; | - |
1174 | const QRgb *clut = data->texture.colorTable ? data->texture.colorTable->constData() : 0; never evaluated: data->texture.colorTable | 0 |
1175 | | - |
1176 | int image_width = data->texture.width; | - |
1177 | int image_height = data->texture.height; | - |
1178 | | - |
1179 | int image_x1 = data->texture.x1; | - |
1180 | int image_y1 = data->texture.y1; | - |
1181 | int image_x2 = data->texture.x2 - 1; | - |
1182 | int image_y2 = data->texture.y2 - 1; | - |
1183 | | - |
1184 | const qreal cx = x + qreal(0.5); | - |
1185 | const qreal cy = y + qreal(0.5); | - |
1186 | | - |
1187 | if (data->fast_matrix) { never evaluated: data->fast_matrix | 0 |
1188 | | - |
1189 | int fdx = (int)(data->m11 * fixed_scale); | - |
1190 | int fdy = (int)(data->m12 * fixed_scale); | - |
1191 | | - |
1192 | int fx = int((data->m21 * cy + data->m11 * cx + data->dx) * fixed_scale); | - |
1193 | int fy = int((data->m22 * cy + data->m12 * cx + data->dy) * fixed_scale); | - |
1194 | | - |
1195 | fx -= half_point; | - |
1196 | fy -= half_point; | - |
1197 | | - |
1198 | if (fdy == 0) { never evaluated: fdy == 0 | 0 |
1199 | int y1 = (fy >> 16); | - |
1200 | int y2; | - |
1201 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - |
1202 | const uchar *s1 = data->texture.scanLine(y1); | - |
1203 | const uchar *s2 = data->texture.scanLine(y2); | - |
1204 | | - |
1205 | if (fdx <= fixed_scale && fdx > 0) { never evaluated: fdx <= fixed_scale | 0 |
1206 | int disty = (fy & 0x0000ffff) >> 8; | - |
1207 | int idisty = 256 - disty; | - |
1208 | int x = fx >> 16; | - |
1209 | | - |
1210 | | - |
1211 | | - |
1212 | FetchPixelsFunc fetch = qFetchPixels[layout->bpp]; | - |
1213 | uint buf1[buffer_size + 2]; | - |
1214 | uint buf2[buffer_size + 2]; | - |
1215 | const uint *ptr1; | - |
1216 | const uint *ptr2; | - |
1217 | | - |
1218 | int count = qCeil(length * data->m11) + 2; | - |
1219 | qt_noop(); | - |
1220 | | - |
1221 | if (blendType == BlendTransformedBilinearTiled) { never evaluated: blendType == BlendTransformedBilinearTiled | 0 |
1222 | x %= image_width; | - |
1223 | if (x < 0) | 0 |
1224 | x += image_width; never executed: x += image_width; | 0 |
1225 | int len1 = qMin(count, image_width - x); | - |
1226 | int len2 = qMin(x, count - len1); | - |
1227 | | - |
1228 | ptr1 = fetch(buf1, s1, x, len1); | - |
1229 | ptr1 = layout->convertToARGB32PM(buf1, ptr1, len1, layout, clut); | - |
1230 | ptr2 = fetch(buf2, s2, x, len1); | - |
1231 | ptr2 = layout->convertToARGB32PM(buf2, ptr2, len1, layout, clut); | - |
1232 | for (int i = 0; i < len1; ++i) { never evaluated: i < len1 | 0 |
1233 | uint t = ptr1[i]; | - |
1234 | uint b = ptr2[i]; | - |
1235 | buf1[i] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff; | - |
1236 | buf2[i] = ((((t >> 8) & 0xff00ff) * idisty + ((b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff; | - |
1237 | } | 0 |
1238 | | - |
1239 | if (len2) { | 0 |
1240 | ptr1 = fetch(buf1 + len1, s1, 0, len2); | - |
1241 | ptr1 = layout->convertToARGB32PM(buf1 + len1, ptr1, len2, layout, clut); | - |
1242 | ptr2 = fetch(buf2 + len1, s2, 0, len2); | - |
1243 | ptr2 = layout->convertToARGB32PM(buf2 + len1, ptr2, len2, layout, clut); | - |
1244 | for (int i = 0; i < len2; ++i) { never evaluated: i < len2 | 0 |
1245 | uint t = ptr1[i]; | - |
1246 | uint b = ptr2[i]; | - |
1247 | buf1[i + len1] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff; | - |
1248 | buf2[i + len1] = ((((t >> 8) & 0xff00ff) * idisty + ((b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff; | - |
1249 | } | 0 |
1250 | } | 0 |
1251 | for (int i = image_width; i < count; ++i) { never evaluated: i < count | 0 |
1252 | buf1[i] = buf1[i - image_width]; | - |
1253 | buf2[i] = buf2[i - image_width]; | - |
1254 | } | 0 |
1255 | } else { | 0 |
1256 | int start = qMax(x, image_x1); | - |
1257 | int end = qMin(x + count, image_x2 + 1); | - |
1258 | int len = qMax(1, end - start); | - |
1259 | int leading = start - x; | - |
1260 | | - |
1261 | ptr1 = fetch(buf1 + leading, s1, start, len); | - |
1262 | ptr1 = layout->convertToARGB32PM(buf1 + leading, ptr1, len, layout, clut); | - |
1263 | ptr2 = fetch(buf2 + leading, s2, start, len); | - |
1264 | ptr2 = layout->convertToARGB32PM(buf2 + leading, ptr2, len, layout, clut); | - |
1265 | | - |
1266 | for (int i = 0; i < len; ++i) { | 0 |
1267 | uint t = ptr1[i]; | - |
1268 | uint b = ptr2[i]; | - |
1269 | buf1[i + leading] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff; | - |
1270 | buf2[i + leading] = ((((t >> 8) & 0xff00ff) * idisty + ((b >> 8) & 0xff00ff) * disty) >> 8) & 0xff00ff; | - |
1271 | } | 0 |
1272 | | - |
1273 | for (int i = 0; i < leading; ++i) { never evaluated: i < leading | 0 |
1274 | buf1[i] = buf1[leading]; | - |
1275 | buf2[i] = buf2[leading]; | - |
1276 | } | 0 |
1277 | for (int i = leading + len; i < count; ++i) { never evaluated: i < count | 0 |
1278 | buf1[i] = buf1[i - 1]; | - |
1279 | buf2[i] = buf2[i - 1]; | - |
1280 | } | 0 |
1281 | } | 0 |
1282 | | - |
1283 | | - |
1284 | fx &= fixed_scale - 1; | - |
1285 | qt_noop(); | - |
1286 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
1287 | register int x1 = (fx >> 16); | - |
1288 | register int x2 = x1 + 1; | - |
1289 | qt_noop(); | - |
1290 | qt_noop(); | - |
1291 | | - |
1292 | register int distx = (fx & 0x0000ffff) >> 8; | - |
1293 | register int idistx = 256 - distx; | - |
1294 | int rb = ((buf1[x1] * idistx + buf1[x2] * distx) >> 8) & 0xff00ff; | - |
1295 | int ag = (buf2[x1] * idistx + buf2[x2] * distx) & 0xff00ff00; | - |
1296 | buffer[i] = rb | ag; | - |
1297 | fx += fdx; | - |
1298 | } | 0 |
1299 | } else { | 0 |
1300 | FetchPixelFunc fetch = qFetchPixel[layout->bpp]; | - |
1301 | uint buf1[buffer_size]; | - |
1302 | uint buf2[buffer_size]; | - |
1303 | uint *b = buffer; | - |
1304 | while (length) { | 0 |
1305 | int len = qMin(length, buffer_size / 2); | - |
1306 | int fracX = fx; | - |
1307 | for (int i = 0; i < len; ++i) { | 0 |
1308 | int x1 = (fx >> 16); | - |
1309 | int x2; | - |
1310 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - |
1311 | | - |
1312 | buf1[i * 2 + 0] = fetch(s1, x1); | - |
1313 | buf1[i * 2 + 1] = fetch(s1, x2); | - |
1314 | buf2[i * 2 + 0] = fetch(s2, x1); | - |
1315 | buf2[i * 2 + 1] = fetch(s2, x2); | - |
1316 | | - |
1317 | fx += fdx; | - |
1318 | } | 0 |
1319 | layout->convertToARGB32PM(buf1, buf1, len * 2, layout, clut); | - |
1320 | layout->convertToARGB32PM(buf2, buf2, len * 2, layout, clut); | - |
1321 | | - |
1322 | if ((fdx < 0 && fdx > -(fixed_scale / 8)) || fabs(data->m22) < (1./8.)) { never evaluated: fdx > -(fixed_scale / 8) never evaluated: fabs(data->m22) < (1./8.) | 0 |
1323 | int disty = (fy & 0x0000ffff) >> 8; | - |
1324 | int idisty = 256 - disty; | - |
1325 | for (int i = 0; i < len; ++i) { | 0 |
1326 | uint tl = buf1[i * 2 + 0]; | - |
1327 | uint tr = buf1[i * 2 + 1]; | - |
1328 | uint bl = buf2[i * 2 + 0]; | - |
1329 | uint br = buf2[i * 2 + 1]; | - |
1330 | int distx = (fracX & 0x0000ffff) >> 8; | - |
1331 | int idistx = 256 - distx; | - |
1332 | uint xtop = INTERPOLATE_PIXEL_256(tl, idistx, tr, distx); | - |
1333 | uint xbot = INTERPOLATE_PIXEL_256(bl, idistx, br, distx); | - |
1334 | b[i] = INTERPOLATE_PIXEL_256(xtop, idisty, xbot, disty); | - |
1335 | fracX += fdx; | - |
1336 | } | 0 |
1337 | } else { | 0 |
1338 | int disty = (fy & 0x0000ffff) >> 12; | - |
1339 | for (int i = 0; i < len; ++i) { | 0 |
1340 | uint tl = buf1[i * 2 + 0]; | - |
1341 | uint tr = buf1[i * 2 + 1]; | - |
1342 | uint bl = buf2[i * 2 + 0]; | - |
1343 | uint br = buf2[i * 2 + 1]; | - |
1344 | int distx = (fracX & 0x0000ffff) >> 12; | - |
1345 | b[i] = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty); | - |
1346 | fracX += fdx; | - |
1347 | } | 0 |
1348 | } | 0 |
1349 | length -= len; | - |
1350 | b += len; | - |
1351 | } | 0 |
1352 | } | 0 |
1353 | } else { | - |
1354 | FetchPixelFunc fetch = qFetchPixel[layout->bpp]; | - |
1355 | uint buf1[buffer_size]; | - |
1356 | uint buf2[buffer_size]; | - |
1357 | uint *b = buffer; | - |
1358 | | - |
1359 | while (length) { | 0 |
1360 | int len = qMin(length, buffer_size / 2); | - |
1361 | int fracX = fx; | - |
1362 | int fracY = fy; | - |
1363 | for (int i = 0; i < len; ++i) { | 0 |
1364 | int x1 = (fx >> 16); | - |
1365 | int x2; | - |
1366 | int y1 = (fy >> 16); | - |
1367 | int y2; | - |
1368 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - |
1369 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - |
1370 | | - |
1371 | const uchar *s1 = data->texture.scanLine(y1); | - |
1372 | const uchar *s2 = data->texture.scanLine(y2); | - |
1373 | | - |
1374 | buf1[i * 2 + 0] = fetch(s1, x1); | - |
1375 | buf1[i * 2 + 1] = fetch(s1, x2); | - |
1376 | buf2[i * 2 + 0] = fetch(s2, x1); | - |
1377 | buf2[i * 2 + 1] = fetch(s2, x2); | - |
1378 | | - |
1379 | fx += fdx; | - |
1380 | fy += fdy; | - |
1381 | } | 0 |
1382 | layout->convertToARGB32PM(buf1, buf1, len * 2, layout, clut); | - |
1383 | layout->convertToARGB32PM(buf2, buf2, len * 2, layout, clut); | - |
1384 | | - |
1385 | if (fabs(data->m11) > 8 || fabs(data->m22) > 8) { never evaluated: fabs(data->m11) > 8 never evaluated: fabs(data->m22) > 8 | 0 |
1386 | | - |
1387 | for (int i = 0; i < len; ++i) { | 0 |
1388 | uint tl = buf1[i * 2 + 0]; | - |
1389 | uint tr = buf1[i * 2 + 1]; | - |
1390 | uint bl = buf2[i * 2 + 0]; | - |
1391 | uint br = buf2[i * 2 + 1]; | - |
1392 | | - |
1393 | int distx = (fracX & 0x0000ffff) >> 8; | - |
1394 | int disty = (fracY & 0x0000ffff) >> 8; | - |
1395 | int idistx = 256 - distx; | - |
1396 | int idisty = 256 - disty; | - |
1397 | | - |
1398 | uint xtop = INTERPOLATE_PIXEL_256(tl, idistx, tr, distx); | - |
1399 | uint xbot = INTERPOLATE_PIXEL_256(bl, idistx, br, distx); | - |
1400 | b[i] = INTERPOLATE_PIXEL_256(xtop, idisty, xbot, disty); | - |
1401 | fracX += fdx; | - |
1402 | fracY += fdy; | - |
1403 | } | 0 |
1404 | } else { | 0 |
1405 | | - |
1406 | for (int i = 0; i < len; ++i) { | 0 |
1407 | uint tl = buf1[i * 2 + 0]; | - |
1408 | uint tr = buf1[i * 2 + 1]; | - |
1409 | uint bl = buf2[i * 2 + 0]; | - |
1410 | uint br = buf2[i * 2 + 1]; | - |
1411 | | - |
1412 | int distx = (fracX & 0x0000ffff) >> 12; | - |
1413 | int disty = (fracY & 0x0000ffff) >> 12; | - |
1414 | | - |
1415 | b[i] = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty); | - |
1416 | fracX += fdx; | - |
1417 | fracY += fdy; | - |
1418 | } | 0 |
1419 | } | 0 |
1420 | | - |
1421 | length -= len; | - |
1422 | b += len; | - |
1423 | } | 0 |
1424 | } | 0 |
1425 | } else { | - |
1426 | const qreal fdx = data->m11; | - |
1427 | const qreal fdy = data->m12; | - |
1428 | const qreal fdw = data->m13; | - |
1429 | | - |
1430 | qreal fx = data->m21 * cy + data->m11 * cx + data->dx; | - |
1431 | qreal fy = data->m22 * cy + data->m12 * cx + data->dy; | - |
1432 | qreal fw = data->m23 * cy + data->m13 * cx + data->m33; | - |
1433 | | - |
1434 | FetchPixelFunc fetch = qFetchPixel[layout->bpp]; | - |
1435 | uint buf1[buffer_size]; | - |
1436 | uint buf2[buffer_size]; | - |
1437 | uint *b = buffer; | - |
1438 | | - |
1439 | int distxs[buffer_size / 2]; | - |
1440 | int distys[buffer_size / 2]; | - |
1441 | | - |
1442 | while (length) { | 0 |
1443 | int len = qMin(length, buffer_size / 2); | - |
1444 | for (int i = 0; i < len; ++i) { | 0 |
1445 | const qreal iw = fw == 0 ? 1 : 1 / fw; | 0 |
1446 | const qreal px = fx * iw - qreal(0.5); | - |
1447 | const qreal py = fy * iw - qreal(0.5); | - |
1448 | | - |
1449 | int x1 = int(px) - (px < 0); | - |
1450 | int x2; | - |
1451 | int y1 = int(py) - (py < 0); | - |
1452 | int y2; | - |
1453 | | - |
1454 | distxs[i] = int((px - x1) * 256); | - |
1455 | distys[i] = int((py - y1) * 256); | - |
1456 | | - |
1457 | fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); | - |
1458 | fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); | - |
1459 | | - |
1460 | const uchar *s1 = data->texture.scanLine(y1); | - |
1461 | const uchar *s2 = data->texture.scanLine(y2); | - |
1462 | | - |
1463 | buf1[i * 2 + 0] = fetch(s1, x1); | - |
1464 | buf1[i * 2 + 1] = fetch(s1, x2); | - |
1465 | buf2[i * 2 + 0] = fetch(s2, x1); | - |
1466 | buf2[i * 2 + 1] = fetch(s2, x2); | - |
1467 | | - |
1468 | fx += fdx; | - |
1469 | fy += fdy; | - |
1470 | fw += fdw; | - |
1471 | | - |
1472 | if (!fw) | 0 |
1473 | fw += fdw; never executed: fw += fdw; | 0 |
1474 | } | 0 |
1475 | | - |
1476 | layout->convertToARGB32PM(buf1, buf1, len * 2, layout, clut); | - |
1477 | layout->convertToARGB32PM(buf2, buf2, len * 2, layout, clut); | - |
1478 | | - |
1479 | for (int i = 0; i < len; ++i) { | 0 |
1480 | int distx = distxs[i]; | - |
1481 | int disty = distys[i]; | - |
1482 | int idistx = 256 - distx; | - |
1483 | int idisty = 256 - disty; | - |
1484 | | - |
1485 | uint tl = buf1[i * 2 + 0]; | - |
1486 | uint tr = buf1[i * 2 + 1]; | - |
1487 | uint bl = buf2[i * 2 + 0]; | - |
1488 | uint br = buf2[i * 2 + 1]; | - |
1489 | | - |
1490 | uint xtop = INTERPOLATE_PIXEL_256(tl, idistx, tr, distx); | - |
1491 | uint xbot = INTERPOLATE_PIXEL_256(bl, idistx, br, distx); | - |
1492 | b[i] = INTERPOLATE_PIXEL_256(xtop, idisty, xbot, disty); | - |
1493 | } | 0 |
1494 | length -= len; | - |
1495 | b += len; | - |
1496 | } | 0 |
1497 | } | 0 |
1498 | | - |
1499 | return buffer; never executed: return buffer; | 0 |
1500 | } | - |
1501 | | - |
1502 | static const SourceFetchProc sourceFetch[NBlendTypes][QImage::NImageFormats] = { | - |
1503 | | - |
1504 | { | - |
1505 | 0, | - |
1506 | fetchUntransformed, | - |
1507 | fetchUntransformed, | - |
1508 | fetchUntransformed, | - |
1509 | fetchUntransformedARGB32PM, | - |
1510 | fetchUntransformed, | - |
1511 | fetchUntransformedARGB32PM, | - |
1512 | fetchUntransformedRGB16, | - |
1513 | fetchUntransformed, | - |
1514 | fetchUntransformed, | - |
1515 | fetchUntransformed, | - |
1516 | fetchUntransformed, | - |
1517 | fetchUntransformed, | - |
1518 | fetchUntransformed, | - |
1519 | fetchUntransformed, | - |
1520 | fetchUntransformed | - |
1521 | }, | - |
1522 | | - |
1523 | { | - |
1524 | 0, | - |
1525 | fetchUntransformed, | - |
1526 | fetchUntransformed, | - |
1527 | fetchUntransformed, | - |
1528 | fetchUntransformedARGB32PM, | - |
1529 | fetchUntransformed, | - |
1530 | fetchUntransformedARGB32PM, | - |
1531 | fetchUntransformedRGB16, | - |
1532 | fetchUntransformed, | - |
1533 | fetchUntransformed, | - |
1534 | fetchUntransformed, | - |
1535 | fetchUntransformed, | - |
1536 | fetchUntransformed, | - |
1537 | fetchUntransformed, | - |
1538 | fetchUntransformed, | - |
1539 | fetchUntransformed | - |
1540 | }, | - |
1541 | | - |
1542 | { | - |
1543 | 0, | - |
1544 | fetchTransformed<BlendTransformed>, | - |
1545 | fetchTransformed<BlendTransformed>, | - |
1546 | fetchTransformed<BlendTransformed>, | - |
1547 | fetchTransformedARGB32PM<BlendTransformed>, | - |
1548 | fetchTransformed<BlendTransformed>, | - |
1549 | fetchTransformedARGB32PM<BlendTransformed>, | - |
1550 | fetchTransformed<BlendTransformed>, | - |
1551 | fetchTransformed<BlendTransformed>, | - |
1552 | fetchTransformed<BlendTransformed>, | - |
1553 | fetchTransformed<BlendTransformed>, | - |
1554 | fetchTransformed<BlendTransformed>, | - |
1555 | fetchTransformed<BlendTransformed>, | - |
1556 | fetchTransformed<BlendTransformed>, | - |
1557 | fetchTransformed<BlendTransformed>, | - |
1558 | fetchTransformed<BlendTransformed>, | - |
1559 | }, | - |
1560 | { | - |
1561 | 0, | - |
1562 | fetchTransformed<BlendTransformedTiled>, | - |
1563 | fetchTransformed<BlendTransformedTiled>, | - |
1564 | fetchTransformed<BlendTransformedTiled>, | - |
1565 | fetchTransformedARGB32PM<BlendTransformedTiled>, | - |
1566 | fetchTransformed<BlendTransformedTiled>, | - |
1567 | fetchTransformedARGB32PM<BlendTransformedTiled>, | - |
1568 | fetchTransformed<BlendTransformedTiled>, | - |
1569 | fetchTransformed<BlendTransformedTiled>, | - |
1570 | fetchTransformed<BlendTransformedTiled>, | - |
1571 | fetchTransformed<BlendTransformedTiled>, | - |
1572 | fetchTransformed<BlendTransformedTiled>, | - |
1573 | fetchTransformed<BlendTransformedTiled>, | - |
1574 | fetchTransformed<BlendTransformedTiled>, | - |
1575 | fetchTransformed<BlendTransformedTiled>, | - |
1576 | fetchTransformed<BlendTransformedTiled>, | - |
1577 | }, | - |
1578 | { | - |
1579 | 0, | - |
1580 | fetchTransformedBilinear<BlendTransformedBilinear>, | - |
1581 | fetchTransformedBilinear<BlendTransformedBilinear>, | - |
1582 | fetchTransformedBilinear<BlendTransformedBilinear>, | - |
1583 | fetchTransformedBilinearARGB32PM<BlendTransformedBilinear>, | - |
1584 | fetchTransformedBilinear<BlendTransformedBilinear>, | - |
1585 | fetchTransformedBilinearARGB32PM<BlendTransformedBilinear>, | - |
1586 | fetchTransformedBilinear<BlendTransformedBilinear>, | - |
1587 | fetchTransformedBilinear<BlendTransformedBilinear>, | - |
1588 | fetchTransformedBilinear<BlendTransformedBilinear>, | - |
1589 | fetchTransformedBilinear<BlendTransformedBilinear>, | - |
1590 | fetchTransformedBilinear<BlendTransformedBilinear>, | - |
1591 | fetchTransformedBilinear<BlendTransformedBilinear>, | - |
1592 | fetchTransformedBilinear<BlendTransformedBilinear>, | - |
1593 | fetchTransformedBilinear<BlendTransformedBilinear>, | - |
1594 | fetchTransformedBilinear<BlendTransformedBilinear> | - |
1595 | }, | - |
1596 | { | - |
1597 | 0, | - |
1598 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - |
1599 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - |
1600 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - |
1601 | fetchTransformedBilinearARGB32PM<BlendTransformedBilinearTiled>, | - |
1602 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - |
1603 | fetchTransformedBilinearARGB32PM<BlendTransformedBilinearTiled>, | - |
1604 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - |
1605 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - |
1606 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - |
1607 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - |
1608 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - |
1609 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - |
1610 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - |
1611 | fetchTransformedBilinear<BlendTransformedBilinearTiled>, | - |
1612 | fetchTransformedBilinear<BlendTransformedBilinearTiled> | - |
1613 | }, | - |
1614 | }; | - |
1615 | | - |
1616 | | - |
1617 | | - |
1618 | | - |
1619 | static uint qt_gradient_pixel_fixed(const QGradientData *data, int fixed_pos) | - |
1620 | { | - |
1621 | int ipos = (fixed_pos + ((1<<8) / 2)) >> 8; | - |
1622 | return data->colorTable[qt_gradient_clamp(data, ipos)]; executed: return data->colorTable[qt_gradient_clamp(data, ipos)]; Execution Count:701430 | 701430 |
1623 | } | - |
1624 | | - |
1625 | static void getLinearGradientValues(LinearGradientValues *v, const QSpanData *data) | - |
1626 | { | - |
1627 | v->dx = data->gradient.linear.end.x - data->gradient.linear.origin.x; | - |
1628 | v->dy = data->gradient.linear.end.y - data->gradient.linear.origin.y; | - |
1629 | v->l = v->dx * v->dx + v->dy * v->dy; | - |
1630 | v->off = 0; | - |
1631 | if (v->l != 0) { partially evaluated: v->l != 0 yes Evaluation Count:17046 | no Evaluation Count:0 |
| 0-17046 |
1632 | v->dx /= v->l; | - |
1633 | v->dy /= v->l; | - |
1634 | v->off = -v->dx * data->gradient.linear.origin.x - v->dy * data->gradient.linear.origin.y; | - |
1635 | } executed: } Execution Count:17044 | 17044 |
1636 | } executed: } Execution Count:17049 | 17049 |
1637 | | - |
1638 | static const uint * qt_fetch_linear_gradient(uint *buffer, const Operator *op, const QSpanData *data, | - |
1639 | int y, int x, int length) | - |
1640 | { | - |
1641 | const uint *b = buffer; | - |
1642 | qreal t, inc; | - |
1643 | | - |
1644 | bool affine = true; | - |
1645 | qreal rx=0, ry=0; | - |
1646 | if (op->linear.l == 0) { partially evaluated: op->linear.l == 0 no Evaluation Count:0 | yes Evaluation Count:43596 |
| 0-43596 |
1647 | t = inc = 0; | - |
1648 | } else { | 0 |
1649 | rx = data->m21 * (y + qreal(0.5)) + data->m11 * (x + qreal(0.5)) + data->dx; | - |
1650 | ry = data->m22 * (y + qreal(0.5)) + data->m12 * (x + qreal(0.5)) + data->dy; | - |
1651 | t = op->linear.dx*rx + op->linear.dy*ry + op->linear.off; | - |
1652 | inc = op->linear.dx * data->m11 + op->linear.dy * data->m12; | - |
1653 | affine = !data->m13 && !data->m23; partially evaluated: !data->m13 yes Evaluation Count:43597 | no Evaluation Count:0 |
partially evaluated: !data->m23 yes Evaluation Count:43601 | no Evaluation Count:0 |
| 0-43601 |
1654 | | - |
1655 | if (affine) { partially evaluated: affine yes Evaluation Count:43601 | no Evaluation Count:0 |
| 0-43601 |
1656 | t *= (1024 - 1); | - |
1657 | inc *= (1024 - 1); | - |
1658 | } executed: } Execution Count:43601 | 43601 |
1659 | } executed: } Execution Count:43603 | 43603 |
1660 | | - |
1661 | const uint *end = buffer + length; | - |
1662 | if (affine) { partially evaluated: affine yes Evaluation Count:43600 | no Evaluation Count:0 |
| 0-43600 |
1663 | if (inc > qreal(-1e-5) && inc < qreal(1e-5)) { partially evaluated: inc > qreal(-1e-5) yes Evaluation Count:43601 | no Evaluation Count:0 |
partially evaluated: inc < qreal(1e-5) no Evaluation Count:0 | yes Evaluation Count:43607 |
| 0-43607 |
1664 | qt_memfill<quint32>(buffer, qt_gradient_pixel_fixed(&data->gradient, int(t * (1<<8))), length);; | - |
1665 | } else { | 0 |
1666 | if (t+inc*length < qreal(2147483647 >> (8 + 1)) && partially evaluated: t+inc*length < qreal(2147483647 >> (8 + 1)) yes Evaluation Count:43607 | no Evaluation Count:0 |
| 0-43607 |
1667 | t+inc*length > qreal((-2147483647 - 1) >> (8 + 1))) { partially evaluated: t+inc*length > qreal((-2147483647 - 1) >> (8 + 1)) yes Evaluation Count:43608 | no Evaluation Count:0 |
| 0-43608 |
1668 | | - |
1669 | int t_fixed = int(t * (1<<8)); | - |
1670 | int inc_fixed = int(inc * (1<<8)); | - |
1671 | while (buffer < end) { evaluated: buffer < end yes Evaluation Count:692097 | yes Evaluation Count:43597 |
| 43597-692097 |
1672 | *buffer = qt_gradient_pixel_fixed(&data->gradient, t_fixed); | - |
1673 | t_fixed += inc_fixed; | - |
1674 | ++buffer; | - |
1675 | } executed: } Execution Count:692089 | 692089 |
1676 | } else { executed: } Execution Count:43601 | 43601 |
1677 | | - |
1678 | while (buffer < end) { never evaluated: buffer < end | 0 |
1679 | *buffer = qt_gradient_pixel(&data->gradient, t/1024); | - |
1680 | t += inc; | - |
1681 | ++buffer; | - |
1682 | } | 0 |
1683 | } | 0 |
1684 | } | - |
1685 | } else { | - |
1686 | qreal rw = data->m23 * (y + qreal(0.5)) + data->m13 * (x + qreal(0.5)) + data->m33; | - |
1687 | while (buffer < end) { never evaluated: buffer < end | 0 |
1688 | qreal x = rx/rw; | - |
1689 | qreal y = ry/rw; | - |
1690 | t = (op->linear.dx*x + op->linear.dy *y) + op->linear.off; | - |
1691 | | - |
1692 | *buffer = qt_gradient_pixel(&data->gradient, t); | - |
1693 | rx += data->m11; | - |
1694 | ry += data->m12; | - |
1695 | rw += data->m13; | - |
1696 | if (!rw) { | 0 |
1697 | rw += data->m13; | - |
1698 | } | 0 |
1699 | ++buffer; | - |
1700 | } | 0 |
1701 | } | 0 |
1702 | | - |
1703 | return b; executed: return b; Execution Count:43601 | 43601 |
1704 | } | - |
1705 | | - |
1706 | static void getRadialGradientValues(RadialGradientValues *v, const QSpanData *data) | - |
1707 | { | - |
1708 | v->dx = data->gradient.radial.center.x - data->gradient.radial.focal.x; | - |
1709 | v->dy = data->gradient.radial.center.y - data->gradient.radial.focal.y; | - |
1710 | | - |
1711 | v->dr = data->gradient.radial.center.radius - data->gradient.radial.focal.radius; | - |
1712 | v->sqrfr = data->gradient.radial.focal.radius * data->gradient.radial.focal.radius; | - |
1713 | | - |
1714 | v->a = v->dr * v->dr - v->dx*v->dx - v->dy*v->dy; | - |
1715 | v->inv2a = 1 / (2 * v->a); | - |
1716 | | - |
1717 | v->extended = !qFuzzyIsNull(data->gradient.radial.focal.radius) || v->a <= 0; partially evaluated: !qFuzzyIsNull(data->gradient.radial.focal.radius) no Evaluation Count:0 | yes Evaluation Count:519 |
partially evaluated: v->a <= 0 no Evaluation Count:0 | yes Evaluation Count:519 |
| 0-519 |
1718 | } executed: } Execution Count:519 | 519 |
1719 | | - |
1720 | class RadialFetchPlain | - |
1721 | { | - |
1722 | public: | - |
1723 | static inline void fetch(uint *buffer, uint *end, const Operator *op, const QSpanData *data, qreal det, | - |
1724 | qreal delta_det, qreal delta_delta_det, qreal b, qreal delta_b) | - |
1725 | { | - |
1726 | if (op->radial.extended) { never evaluated: op->radial.extended | 0 |
1727 | while (buffer < end) { never evaluated: buffer < end | 0 |
1728 | quint32 result = 0; | - |
1729 | if (det >= 0) { never evaluated: det >= 0 | 0 |
1730 | qreal w = qSqrt(det) - b; | - |
1731 | if (data->gradient.radial.focal.radius + op->radial.dr * w >= 0) never evaluated: data->gradient.radial.focal.radius + op->radial.dr * w >= 0 | 0 |
1732 | result = qt_gradient_pixel(&data->gradient, w); never executed: result = qt_gradient_pixel(&data->gradient, w); | 0 |
1733 | } | 0 |
1734 | | - |
1735 | *buffer = result; | - |
1736 | | - |
1737 | det += delta_det; | - |
1738 | delta_det += delta_delta_det; | - |
1739 | b += delta_b; | - |
1740 | | - |
1741 | ++buffer; | - |
1742 | } | 0 |
1743 | } else { | 0 |
1744 | while (buffer < end) { never evaluated: buffer < end | 0 |
1745 | *buffer++ = qt_gradient_pixel(&data->gradient, qSqrt(det) - b); | - |
1746 | | - |
1747 | det += delta_det; | - |
1748 | delta_det += delta_delta_det; | - |
1749 | b += delta_b; | - |
1750 | } | 0 |
1751 | } | 0 |
1752 | } | - |
1753 | }; | - |
1754 | | - |
1755 | const uint * qt_fetch_radial_gradient_plain(uint *buffer, const Operator *op, const QSpanData *data, | - |
1756 | int y, int x, int length) | - |
1757 | { | - |
1758 | return qt_fetch_radial_gradient_template<RadialFetchPlain>(buffer, op, data, y, x, length); never executed: return qt_fetch_radial_gradient_template<RadialFetchPlain>(buffer, op, data, y, x, length); | 0 |
1759 | } | - |
1760 | | - |
1761 | static SourceFetchProc qt_fetch_radial_gradient = qt_fetch_radial_gradient_plain; | - |
1762 | | - |
1763 | static const uint * qt_fetch_conical_gradient(uint *buffer, const Operator *, const QSpanData *data, | - |
1764 | int y, int x, int length) | - |
1765 | { | - |
1766 | const uint *b = buffer; | - |
1767 | qreal rx = data->m21 * (y + qreal(0.5)) | - |
1768 | + data->dx + data->m11 * (x + qreal(0.5)); | - |
1769 | qreal ry = data->m22 * (y + qreal(0.5)) | - |
1770 | + data->dy + data->m12 * (x + qreal(0.5)); | - |
1771 | bool affine = !data->m13 && !data->m23; never evaluated: !data->m13 never evaluated: !data->m23 | 0 |
1772 | | - |
1773 | const uint *end = buffer + length; | - |
1774 | if (affine) { | 0 |
1775 | rx -= data->gradient.conical.center.x; | - |
1776 | ry -= data->gradient.conical.center.y; | - |
1777 | while (buffer < end) { never evaluated: buffer < end | 0 |
1778 | qreal angle = qAtan2(ry, rx) + data->gradient.conical.angle; | - |
1779 | | - |
1780 | *buffer = qt_gradient_pixel(&data->gradient, 1 - angle / (2*Q_PI)); | - |
1781 | | - |
1782 | rx += data->m11; | - |
1783 | ry += data->m12; | - |
1784 | ++buffer; | - |
1785 | } | 0 |
1786 | } else { | 0 |
1787 | qreal rw = data->m23 * (y + qreal(0.5)) | - |
1788 | + data->m33 + data->m13 * (x + qreal(0.5)); | - |
1789 | if (!rw) | 0 |
1790 | rw = 1; | 0 |
1791 | while (buffer < end) { never evaluated: buffer < end | 0 |
1792 | qreal angle = qAtan2(ry/rw - data->gradient.conical.center.x, | - |
1793 | rx/rw - data->gradient.conical.center.y) | - |
1794 | + data->gradient.conical.angle; | - |
1795 | | - |
1796 | *buffer = qt_gradient_pixel(&data->gradient, 1. - angle / (2*Q_PI)); | - |
1797 | | - |
1798 | rx += data->m11; | - |
1799 | ry += data->m12; | - |
1800 | rw += data->m13; | - |
1801 | if (!rw) { | 0 |
1802 | rw += data->m13; | - |
1803 | } | 0 |
1804 | ++buffer; | - |
1805 | } | 0 |
1806 | } | 0 |
1807 | return b; never executed: return b; | 0 |
1808 | } | - |
1809 | void comp_func_solid_Clear(uint *dest, int length, uint, uint const_alpha) | - |
1810 | { | - |
1811 | { if (const_alpha == 255) { qt_memfill<quint32>(dest, 0, length);; } else { int ialpha = 255 - const_alpha; for (int i = 0; i < length; ++i) { dest[i] = BYTE_MUL(dest[i], ialpha); } }}; never evaluated: i < length never evaluated: const_alpha == 255 | 0 |
1812 | } | - |
1813 | | - |
1814 | void comp_func_Clear(uint *dest, const uint *, int length, uint const_alpha) | - |
1815 | { | - |
1816 | { if (const_alpha == 255) { qt_memfill<quint32>(dest, 0, length);; } else { int ialpha = 255 - const_alpha; for (int i = 0; i < length; ++i) { dest[i] = BYTE_MUL(dest[i], ialpha); } }}; never evaluated: i < length never evaluated: const_alpha == 255 | 0 |
1817 | } | - |
1818 | | - |
1819 | | - |
1820 | | - |
1821 | | - |
1822 | | - |
1823 | void comp_func_solid_Source(uint *dest, int length, uint color, uint const_alpha) | - |
1824 | { | - |
1825 | if (const_alpha == 255) { evaluated: const_alpha == 255 yes Evaluation Count:161536 | yes Evaluation Count:65302 |
| 65302-161536 |
1826 | qt_memfill<quint32>(dest, color, length);; | - |
1827 | } else { executed: } Execution Count:161536 | 161536 |
1828 | int ialpha = 255 - const_alpha; | - |
1829 | color = BYTE_MUL(color, const_alpha); | - |
1830 | | - |
1831 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:65302 | yes Evaluation Count:65302 |
| 65302 |
1832 | | - |
1833 | dest[i] = color + BYTE_MUL(dest[i], ialpha); | - |
1834 | } executed: } Execution Count:65302 | 65302 |
1835 | } executed: } Execution Count:65302 | 65302 |
1836 | } | - |
1837 | | - |
1838 | void comp_func_Source(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
1839 | { | - |
1840 | if (const_alpha == 255) { never evaluated: const_alpha == 255 | 0 |
1841 | ::memcpy(dest, src, length * sizeof(uint)); | - |
1842 | } else { | 0 |
1843 | int ialpha = 255 - const_alpha; | - |
1844 | | - |
1845 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
1846 | | - |
1847 | dest[i] = INTERPOLATE_PIXEL_255(src[i], const_alpha, dest[i], ialpha); | - |
1848 | } | 0 |
1849 | } | 0 |
1850 | } | - |
1851 | | - |
1852 | void comp_func_solid_Destination(uint *, int, uint, uint) | - |
1853 | { | - |
1854 | } | - |
1855 | | - |
1856 | void comp_func_Destination(uint *, const uint *, int, uint) | - |
1857 | { | - |
1858 | } | - |
1859 | | - |
1860 | | - |
1861 | | - |
1862 | | - |
1863 | | - |
1864 | | - |
1865 | | - |
1866 | void comp_func_solid_SourceOver(uint *dest, int length, uint color, uint const_alpha) | - |
1867 | { | - |
1868 | if ((const_alpha & qAlpha(color)) == 255) { never evaluated: (const_alpha & qAlpha(color)) == 255 | 0 |
1869 | qt_memfill<quint32>(dest, color, length);; | - |
1870 | } else { | 0 |
1871 | if (const_alpha != 255) never evaluated: const_alpha != 255 | 0 |
1872 | color = BYTE_MUL(color, const_alpha); never executed: color = BYTE_MUL(color, const_alpha); | 0 |
1873 | | - |
1874 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
1875 | | - |
1876 | dest[i] = color + BYTE_MUL(dest[i], qAlpha(~color)); | - |
1877 | } | 0 |
1878 | } | 0 |
1879 | } | - |
1880 | | - |
1881 | void comp_func_SourceOver(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
1882 | { | - |
1883 | | - |
1884 | if (const_alpha == 255) { never evaluated: const_alpha == 255 | 0 |
1885 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
1886 | | - |
1887 | uint s = src[i]; | - |
1888 | if (s >= 0xff000000) never evaluated: s >= 0xff000000 | 0 |
1889 | dest[i] = s; never executed: dest[i] = s; | 0 |
1890 | else if (s != 0) | 0 |
1891 | dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s)); never executed: dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s)); | 0 |
1892 | } | - |
1893 | } else { | 0 |
1894 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
1895 | | - |
1896 | uint s = BYTE_MUL(src[i], const_alpha); | - |
1897 | dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s)); | - |
1898 | } | 0 |
1899 | } | 0 |
1900 | } | - |
1901 | | - |
1902 | | - |
1903 | | - |
1904 | | - |
1905 | | - |
1906 | | - |
1907 | void comp_func_solid_DestinationOver(uint *dest, int length, uint color, uint const_alpha) | - |
1908 | { | - |
1909 | if (const_alpha != 255) never evaluated: const_alpha != 255 | 0 |
1910 | color = BYTE_MUL(color, const_alpha); never executed: color = BYTE_MUL(color, const_alpha); | 0 |
1911 | | - |
1912 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
1913 | | - |
1914 | uint d = dest[i]; | - |
1915 | dest[i] = d + BYTE_MUL(color, qAlpha(~d)); | - |
1916 | } | 0 |
1917 | } | 0 |
1918 | | - |
1919 | void comp_func_DestinationOver(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
1920 | { | - |
1921 | | - |
1922 | if (const_alpha == 255) { never evaluated: const_alpha == 255 | 0 |
1923 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
1924 | | - |
1925 | uint d = dest[i]; | - |
1926 | dest[i] = d + BYTE_MUL(src[i], qAlpha(~d)); | - |
1927 | } | 0 |
1928 | } else { | 0 |
1929 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
1930 | | - |
1931 | uint d = dest[i]; | - |
1932 | uint s = BYTE_MUL(src[i], const_alpha); | - |
1933 | dest[i] = d + BYTE_MUL(s, qAlpha(~d)); | - |
1934 | } | 0 |
1935 | } | 0 |
1936 | } | - |
1937 | | - |
1938 | | - |
1939 | | - |
1940 | | - |
1941 | | - |
1942 | void comp_func_solid_SourceIn(uint *dest, int length, uint color, uint const_alpha) | - |
1943 | { | - |
1944 | | - |
1945 | if (const_alpha == 255) { partially evaluated: const_alpha == 255 yes Evaluation Count:2663 | no Evaluation Count:0 |
| 0-2663 |
1946 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:441657 | yes Evaluation Count:2663 |
| 2663-441657 |
1947 | | - |
1948 | dest[i] = BYTE_MUL(color, qAlpha(dest[i])); | - |
1949 | } executed: } Execution Count:441657 | 441657 |
1950 | } else { executed: } Execution Count:2663 | 2663 |
1951 | color = BYTE_MUL(color, const_alpha); | - |
1952 | uint cia = 255 - const_alpha; | - |
1953 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
1954 | | - |
1955 | uint d = dest[i]; | - |
1956 | dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(d), d, cia); | - |
1957 | } | 0 |
1958 | } | 0 |
1959 | } | - |
1960 | | - |
1961 | void comp_func_SourceIn(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
1962 | { | - |
1963 | | - |
1964 | if (const_alpha == 255) { never evaluated: const_alpha == 255 | 0 |
1965 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
1966 | | - |
1967 | dest[i] = BYTE_MUL(src[i], qAlpha(dest[i])); | - |
1968 | } | 0 |
1969 | } else { | 0 |
1970 | uint cia = 255 - const_alpha; | - |
1971 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
1972 | | - |
1973 | uint d = dest[i]; | - |
1974 | uint s = BYTE_MUL(src[i], const_alpha); | - |
1975 | dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, cia); | - |
1976 | } | 0 |
1977 | } | 0 |
1978 | } | - |
1979 | | - |
1980 | | - |
1981 | | - |
1982 | | - |
1983 | | - |
1984 | | - |
1985 | void comp_func_solid_DestinationIn(uint *dest, int length, uint color, uint const_alpha) | - |
1986 | { | - |
1987 | uint a = qAlpha(color); | - |
1988 | if (const_alpha != 255) { never evaluated: const_alpha != 255 | 0 |
1989 | a = BYTE_MUL(a, const_alpha) + 255 - const_alpha; | - |
1990 | } | 0 |
1991 | | - |
1992 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
1993 | | - |
1994 | dest[i] = BYTE_MUL(dest[i], a); | - |
1995 | } | 0 |
1996 | } | 0 |
1997 | | - |
1998 | void comp_func_DestinationIn(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
1999 | { | - |
2000 | | - |
2001 | if (const_alpha == 255) { never evaluated: const_alpha == 255 | 0 |
2002 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2003 | | - |
2004 | dest[i] = BYTE_MUL(dest[i], qAlpha(src[i])); | - |
2005 | } | 0 |
2006 | } else { | 0 |
2007 | int cia = 255 - const_alpha; | - |
2008 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2009 | | - |
2010 | uint a = BYTE_MUL(qAlpha(src[i]), const_alpha) + cia; | - |
2011 | dest[i] = BYTE_MUL(dest[i], a); | - |
2012 | } | 0 |
2013 | } | 0 |
2014 | } | - |
2015 | | - |
2016 | | - |
2017 | | - |
2018 | | - |
2019 | | - |
2020 | | - |
2021 | void comp_func_solid_SourceOut(uint *dest, int length, uint color, uint const_alpha) | - |
2022 | { | - |
2023 | | - |
2024 | if (const_alpha == 255) { never evaluated: const_alpha == 255 | 0 |
2025 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2026 | | - |
2027 | dest[i] = BYTE_MUL(color, qAlpha(~dest[i])); | - |
2028 | } | 0 |
2029 | } else { | 0 |
2030 | color = BYTE_MUL(color, const_alpha); | - |
2031 | int cia = 255 - const_alpha; | - |
2032 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2033 | | - |
2034 | uint d = dest[i]; | - |
2035 | dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(~d), d, cia); | - |
2036 | } | 0 |
2037 | } | 0 |
2038 | } | - |
2039 | | - |
2040 | void comp_func_SourceOut(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
2041 | { | - |
2042 | | - |
2043 | if (const_alpha == 255) { never evaluated: const_alpha == 255 | 0 |
2044 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2045 | | - |
2046 | dest[i] = BYTE_MUL(src[i], qAlpha(~dest[i])); | - |
2047 | } | 0 |
2048 | } else { | 0 |
2049 | int cia = 255 - const_alpha; | - |
2050 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2051 | | - |
2052 | uint s = BYTE_MUL(src[i], const_alpha); | - |
2053 | uint d = dest[i]; | - |
2054 | dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, cia); | - |
2055 | } | 0 |
2056 | } | 0 |
2057 | } | - |
2058 | | - |
2059 | | - |
2060 | | - |
2061 | | - |
2062 | | - |
2063 | | - |
2064 | void comp_func_solid_DestinationOut(uint *dest, int length, uint color, uint const_alpha) | - |
2065 | { | - |
2066 | uint a = qAlpha(~color); | - |
2067 | if (const_alpha != 255) never evaluated: const_alpha != 255 | 0 |
2068 | a = BYTE_MUL(a, const_alpha) + 255 - const_alpha; never executed: a = BYTE_MUL(a, const_alpha) + 255 - const_alpha; | 0 |
2069 | | - |
2070 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2071 | | - |
2072 | dest[i] = BYTE_MUL(dest[i], a); | - |
2073 | } | 0 |
2074 | } | 0 |
2075 | | - |
2076 | void comp_func_DestinationOut(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
2077 | { | - |
2078 | | - |
2079 | if (const_alpha == 255) { never evaluated: const_alpha == 255 | 0 |
2080 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2081 | | - |
2082 | dest[i] = BYTE_MUL(dest[i], qAlpha(~src[i])); | - |
2083 | } | 0 |
2084 | } else { | 0 |
2085 | int cia = 255 - const_alpha; | - |
2086 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2087 | | - |
2088 | uint sia = BYTE_MUL(qAlpha(~src[i]), const_alpha) + cia; | - |
2089 | dest[i] = BYTE_MUL(dest[i], sia); | - |
2090 | } | 0 |
2091 | } | 0 |
2092 | } | - |
2093 | | - |
2094 | | - |
2095 | | - |
2096 | | - |
2097 | | - |
2098 | | - |
2099 | | - |
2100 | void comp_func_solid_SourceAtop(uint *dest, int length, uint color, uint const_alpha) | - |
2101 | { | - |
2102 | if (const_alpha != 255) { partially evaluated: const_alpha != 255 no Evaluation Count:0 | yes Evaluation Count:243 |
| 0-243 |
2103 | color = BYTE_MUL(color, const_alpha); | - |
2104 | } | 0 |
2105 | uint sia = qAlpha(~color); | - |
2106 | | - |
2107 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:4859 | yes Evaluation Count:243 |
| 243-4859 |
2108 | | - |
2109 | dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(dest[i]), dest[i], sia); | - |
2110 | } executed: } Execution Count:4859 | 4859 |
2111 | } executed: } Execution Count:243 | 243 |
2112 | | - |
2113 | void comp_func_SourceAtop(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
2114 | { | - |
2115 | | - |
2116 | if (const_alpha == 255) { never evaluated: const_alpha == 255 | 0 |
2117 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2118 | | - |
2119 | uint s = src[i]; | - |
2120 | uint d = dest[i]; | - |
2121 | dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, qAlpha(~s)); | - |
2122 | } | 0 |
2123 | } else { | 0 |
2124 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2125 | | - |
2126 | uint s = BYTE_MUL(src[i], const_alpha); | - |
2127 | uint d = dest[i]; | - |
2128 | dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, qAlpha(~s)); | - |
2129 | } | 0 |
2130 | } | 0 |
2131 | } | - |
2132 | | - |
2133 | | - |
2134 | | - |
2135 | | - |
2136 | | - |
2137 | | - |
2138 | void comp_func_solid_DestinationAtop(uint *dest, int length, uint color, uint const_alpha) | - |
2139 | { | - |
2140 | uint a = qAlpha(color); | - |
2141 | if (const_alpha != 255) { never evaluated: const_alpha != 255 | 0 |
2142 | color = BYTE_MUL(color, const_alpha); | - |
2143 | a = qAlpha(color) + 255 - const_alpha; | - |
2144 | } | 0 |
2145 | | - |
2146 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2147 | | - |
2148 | uint d = dest[i]; | - |
2149 | dest[i] = INTERPOLATE_PIXEL_255(d, a, color, qAlpha(~d)); | - |
2150 | } | 0 |
2151 | } | 0 |
2152 | | - |
2153 | void comp_func_DestinationAtop(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
2154 | { | - |
2155 | | - |
2156 | if (const_alpha == 255) { never evaluated: const_alpha == 255 | 0 |
2157 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2158 | | - |
2159 | uint s = src[i]; | - |
2160 | uint d = dest[i]; | - |
2161 | dest[i] = INTERPOLATE_PIXEL_255(d, qAlpha(s), s, qAlpha(~d)); | - |
2162 | } | 0 |
2163 | } else { | 0 |
2164 | int cia = 255 - const_alpha; | - |
2165 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2166 | | - |
2167 | uint s = BYTE_MUL(src[i], const_alpha); | - |
2168 | uint d = dest[i]; | - |
2169 | uint a = qAlpha(s) + cia; | - |
2170 | dest[i] = INTERPOLATE_PIXEL_255(d, a, s, qAlpha(~d)); | - |
2171 | } | 0 |
2172 | } | 0 |
2173 | } | - |
2174 | | - |
2175 | | - |
2176 | | - |
2177 | | - |
2178 | | - |
2179 | | - |
2180 | | - |
2181 | void comp_func_solid_XOR(uint *dest, int length, uint color, uint const_alpha) | - |
2182 | { | - |
2183 | if (const_alpha != 255) never evaluated: const_alpha != 255 | 0 |
2184 | color = BYTE_MUL(color, const_alpha); never executed: color = BYTE_MUL(color, const_alpha); | 0 |
2185 | uint sia = qAlpha(~color); | - |
2186 | | - |
2187 | | - |
2188 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2189 | | - |
2190 | uint d = dest[i]; | - |
2191 | dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(~d), d, sia); | - |
2192 | } | 0 |
2193 | } | 0 |
2194 | | - |
2195 | void comp_func_XOR(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
2196 | { | - |
2197 | | - |
2198 | if (const_alpha == 255) { never evaluated: const_alpha == 255 | 0 |
2199 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2200 | | - |
2201 | uint d = dest[i]; | - |
2202 | uint s = src[i]; | - |
2203 | dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, qAlpha(~s)); | - |
2204 | } | 0 |
2205 | } else { | 0 |
2206 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2207 | | - |
2208 | uint d = dest[i]; | - |
2209 | uint s = BYTE_MUL(src[i], const_alpha); | - |
2210 | dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, qAlpha(~s)); | - |
2211 | } | 0 |
2212 | } | 0 |
2213 | } | - |
2214 | | - |
2215 | struct QFullCoverage { | - |
2216 | inline void store(uint *dest, const uint src) const | - |
2217 | { | - |
2218 | *dest = src; | - |
2219 | } executed: } Execution Count:871472 | 871472 |
2220 | }; | - |
2221 | | - |
2222 | struct QPartialCoverage { | - |
2223 | inline QPartialCoverage(uint const_alpha) | - |
2224 | : ca(const_alpha) | - |
2225 | , ica(255 - const_alpha) | - |
2226 | { | - |
2227 | } | 0 |
2228 | | - |
2229 | inline void store(uint *dest, const uint src) const | - |
2230 | { | - |
2231 | *dest = INTERPOLATE_PIXEL_255(src, ca, *dest, ica); | - |
2232 | } | 0 |
2233 | | - |
2234 | private: | - |
2235 | const uint ca; | - |
2236 | const uint ica; | - |
2237 | }; | - |
2238 | | - |
2239 | static inline int mix_alpha(int da, int sa) | - |
2240 | { | - |
2241 | return 255 - ((255 - sa) * (255 - da) >> 8); executed: return 255 - ((255 - sa) * (255 - da) >> 8); Execution Count:701472 | 701472 |
2242 | } | - |
2243 | | - |
2244 | | - |
2245 | | - |
2246 | | - |
2247 | | - |
2248 | template <typename T> | - |
2249 | static __attribute__((always_inline)) inline void comp_func_solid_Plus_impl(uint *dest, int length, uint color, const T &coverage) | - |
2250 | { | - |
2251 | uint s = color; | - |
2252 | | - |
2253 | | - |
2254 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:170000 | yes Evaluation Count:1700 |
| 1700-170000 |
2255 | | - |
2256 | uint d = dest[i]; | - |
2257 | d = comp_func_Plus_one_pixel(d, s); | - |
2258 | coverage.store(&dest[i], d); | - |
2259 | } executed: } Execution Count:170000 | 170000 |
2260 | } executed: } Execution Count:1700 | 1700 |
2261 | | - |
2262 | void comp_func_solid_Plus(uint *dest, int length, uint color, uint const_alpha) | - |
2263 | { | - |
2264 | if (const_alpha == 255) partially evaluated: const_alpha == 255 yes Evaluation Count:1700 | no Evaluation Count:0 |
| 0-1700 |
2265 | comp_func_solid_Plus_impl(dest, length, color, QFullCoverage()); executed: comp_func_solid_Plus_impl(dest, length, color, QFullCoverage()); Execution Count:1700 | 1700 |
2266 | else | - |
2267 | comp_func_solid_Plus_impl(dest, length, color, QPartialCoverage(const_alpha)); never executed: comp_func_solid_Plus_impl(dest, length, color, QPartialCoverage(const_alpha)); | 0 |
2268 | } | - |
2269 | | - |
2270 | template <typename T> | - |
2271 | static __attribute__((always_inline)) inline void comp_func_Plus_impl(uint *__restrict__ dest, const uint *__restrict__ src, int length, const T &coverage) | - |
2272 | { | - |
2273 | | - |
2274 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2275 | | - |
2276 | uint d = dest[i]; | - |
2277 | uint s = src[i]; | - |
2278 | | - |
2279 | d = comp_func_Plus_one_pixel(d, s); | - |
2280 | | - |
2281 | coverage.store(&dest[i], d); | - |
2282 | } | 0 |
2283 | } | 0 |
2284 | | - |
2285 | void comp_func_Plus(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
2286 | { | - |
2287 | if (const_alpha == 255) never evaluated: const_alpha == 255 | 0 |
2288 | comp_func_Plus_impl(dest, src, length, QFullCoverage()); never executed: comp_func_Plus_impl(dest, src, length, QFullCoverage()); | 0 |
2289 | else | - |
2290 | comp_func_Plus_impl(dest, src, length, QPartialCoverage(const_alpha)); never executed: comp_func_Plus_impl(dest, src, length, QPartialCoverage(const_alpha)); | 0 |
2291 | } | - |
2292 | | - |
2293 | | - |
2294 | | - |
2295 | | - |
2296 | static inline int multiply_op(int dst, int src, int da, int sa) | - |
2297 | { | - |
2298 | return qt_div_255(src * dst + src * (255 - da) + dst * (255 - sa)); executed: return qt_div_255(src * dst + src * (255 - da) + dst * (255 - sa)); Execution Count:210000 | 210000 |
2299 | } | - |
2300 | | - |
2301 | template <typename T> | - |
2302 | static __attribute__((always_inline)) inline void comp_func_solid_Multiply_impl(uint *dest, int length, uint color, const T &coverage) | - |
2303 | { | - |
2304 | int sa = qAlpha(color); | - |
2305 | int sr = qRed(color); | - |
2306 | int sg = qGreen(color); | - |
2307 | int sb = qBlue(color); | - |
2308 | | - |
2309 | | - |
2310 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:70000 | yes Evaluation Count:700 |
| 700-70000 |
2311 | | - |
2312 | uint d = dest[i]; | - |
2313 | int da = qAlpha(d); | - |
2314 | | - |
2315 | | - |
2316 | int r = multiply_op(qRed(d), sr, da, sa); | - |
2317 | int b = multiply_op(qBlue(d), sb, da, sa); | - |
2318 | int g = multiply_op(qGreen(d), sg, da, sa); | - |
2319 | int a = mix_alpha(da, sa); | - |
2320 | | - |
2321 | | - |
2322 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2323 | } executed: } Execution Count:70000 | 70000 |
2324 | } executed: } Execution Count:700 | 700 |
2325 | | - |
2326 | void comp_func_solid_Multiply(uint *dest, int length, uint color, uint const_alpha) | - |
2327 | { | - |
2328 | if (const_alpha == 255) partially evaluated: const_alpha == 255 yes Evaluation Count:700 | no Evaluation Count:0 |
| 0-700 |
2329 | comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage()); executed: comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage()); Execution Count:700 | 700 |
2330 | else | - |
2331 | comp_func_solid_Multiply_impl(dest, length, color, QPartialCoverage(const_alpha)); never executed: comp_func_solid_Multiply_impl(dest, length, color, QPartialCoverage(const_alpha)); | 0 |
2332 | } | - |
2333 | | - |
2334 | template <typename T> | - |
2335 | static __attribute__((always_inline)) inline void comp_func_Multiply_impl(uint *__restrict__ dest, const uint *__restrict__ src, int length, const T &coverage) | - |
2336 | { | - |
2337 | | - |
2338 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2339 | | - |
2340 | uint d = dest[i]; | - |
2341 | uint s = src[i]; | - |
2342 | | - |
2343 | int da = qAlpha(d); | - |
2344 | int sa = qAlpha(s); | - |
2345 | | - |
2346 | | - |
2347 | int r = multiply_op(qRed(d), qRed(s), da, sa); | - |
2348 | int b = multiply_op(qBlue(d), qBlue(s), da, sa); | - |
2349 | int g = multiply_op(qGreen(d), qGreen(s), da, sa); | - |
2350 | int a = mix_alpha(da, sa); | - |
2351 | | - |
2352 | | - |
2353 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2354 | } | 0 |
2355 | } | 0 |
2356 | | - |
2357 | void comp_func_Multiply(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
2358 | { | - |
2359 | if (const_alpha == 255) never evaluated: const_alpha == 255 | 0 |
2360 | comp_func_Multiply_impl(dest, src, length, QFullCoverage()); never executed: comp_func_Multiply_impl(dest, src, length, QFullCoverage()); | 0 |
2361 | else | - |
2362 | comp_func_Multiply_impl(dest, src, length, QPartialCoverage(const_alpha)); never executed: comp_func_Multiply_impl(dest, src, length, QPartialCoverage(const_alpha)); | 0 |
2363 | } | - |
2364 | | - |
2365 | | - |
2366 | | - |
2367 | | - |
2368 | | - |
2369 | template <typename T> | - |
2370 | static __attribute__((always_inline)) inline void comp_func_solid_Screen_impl(uint *dest, int length, uint color, const T &coverage) | - |
2371 | { | - |
2372 | int sa = qAlpha(color); | - |
2373 | int sr = qRed(color); | - |
2374 | int sg = qGreen(color); | - |
2375 | int sb = qBlue(color); | - |
2376 | | - |
2377 | | - |
2378 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:111472 | yes Evaluation Count:988 |
| 988-111472 |
2379 | | - |
2380 | uint d = dest[i]; | - |
2381 | int da = qAlpha(d); | - |
2382 | | - |
2383 | | - |
2384 | int r = 255 - qt_div_255((255-qRed(d)) * (255-sr)); | - |
2385 | int b = 255 - qt_div_255((255-qBlue(d)) * (255-sb)); | - |
2386 | int g = 255 - qt_div_255((255-qGreen(d)) * (255-sg)); | - |
2387 | int a = mix_alpha(da, sa); | - |
2388 | | - |
2389 | | - |
2390 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2391 | } executed: } Execution Count:111472 | 111472 |
2392 | } executed: } Execution Count:988 | 988 |
2393 | | - |
2394 | void comp_func_solid_Screen(uint *dest, int length, uint color, uint const_alpha) | - |
2395 | { | - |
2396 | if (const_alpha == 255) partially evaluated: const_alpha == 255 yes Evaluation Count:988 | no Evaluation Count:0 |
| 0-988 |
2397 | comp_func_solid_Screen_impl(dest, length, color, QFullCoverage()); executed: comp_func_solid_Screen_impl(dest, length, color, QFullCoverage()); Execution Count:988 | 988 |
2398 | else | - |
2399 | comp_func_solid_Screen_impl(dest, length, color, QPartialCoverage(const_alpha)); never executed: comp_func_solid_Screen_impl(dest, length, color, QPartialCoverage(const_alpha)); | 0 |
2400 | } | - |
2401 | | - |
2402 | template <typename T> | - |
2403 | static __attribute__((always_inline)) inline void comp_func_Screen_impl(uint *__restrict__ dest, const uint *__restrict__ src, int length, const T &coverage) | - |
2404 | { | - |
2405 | | - |
2406 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2407 | | - |
2408 | uint d = dest[i]; | - |
2409 | uint s = src[i]; | - |
2410 | | - |
2411 | int da = qAlpha(d); | - |
2412 | int sa = qAlpha(s); | - |
2413 | | - |
2414 | | - |
2415 | int r = 255 - (((255-qRed(d)) * (255-qRed(s))) >> 8); | - |
2416 | int b = 255 - (((255-qBlue(d)) * (255-qBlue(s))) >> 8); | - |
2417 | int g = 255 - (((255-qGreen(d)) * (255-qGreen(s))) >> 8); | - |
2418 | int a = mix_alpha(da, sa); | - |
2419 | | - |
2420 | | - |
2421 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2422 | } | 0 |
2423 | } | 0 |
2424 | | - |
2425 | void comp_func_Screen(uint *dest, const uint *src, int length, uint const_alpha) | - |
2426 | { | - |
2427 | if (const_alpha == 255) never evaluated: const_alpha == 255 | 0 |
2428 | comp_func_Screen_impl(dest, src, length, QFullCoverage()); never executed: comp_func_Screen_impl(dest, src, length, QFullCoverage()); | 0 |
2429 | else | - |
2430 | comp_func_Screen_impl(dest, src, length, QPartialCoverage(const_alpha)); never executed: comp_func_Screen_impl(dest, src, length, QPartialCoverage(const_alpha)); | 0 |
2431 | } | - |
2432 | | - |
2433 | | - |
2434 | | - |
2435 | | - |
2436 | | - |
2437 | | - |
2438 | | - |
2439 | static inline int overlay_op(int dst, int src, int da, int sa) | - |
2440 | { | - |
2441 | const int temp = src * (255 - da) + dst * (255 - sa); | - |
2442 | if (2 * dst < da) evaluated: 2 * dst < da yes Evaluation Count:60000 | yes Evaluation Count:60000 |
| 60000 |
2443 | return qt_div_255(2 * src * dst + temp); executed: return qt_div_255(2 * src * dst + temp); Execution Count:60000 | 60000 |
2444 | else | - |
2445 | return qt_div_255(sa * da - 2 * (da - dst) * (sa - src) + temp); executed: return qt_div_255(sa * da - 2 * (da - dst) * (sa - src) + temp); Execution Count:60000 | 60000 |
2446 | } | - |
2447 | | - |
2448 | template <typename T> | - |
2449 | static __attribute__((always_inline)) inline void comp_func_solid_Overlay_impl(uint *dest, int length, uint color, const T &coverage) | - |
2450 | { | - |
2451 | int sa = qAlpha(color); | - |
2452 | int sr = qRed(color); | - |
2453 | int sg = qGreen(color); | - |
2454 | int sb = qBlue(color); | - |
2455 | | - |
2456 | | - |
2457 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:40000 | yes Evaluation Count:400 |
| 400-40000 |
2458 | | - |
2459 | uint d = dest[i]; | - |
2460 | int da = qAlpha(d); | - |
2461 | | - |
2462 | | - |
2463 | int r = overlay_op(qRed(d), sr, da, sa); | - |
2464 | int b = overlay_op(qBlue(d), sb, da, sa); | - |
2465 | int g = overlay_op(qGreen(d), sg, da, sa); | - |
2466 | int a = mix_alpha(da, sa); | - |
2467 | | - |
2468 | | - |
2469 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2470 | } executed: } Execution Count:40000 | 40000 |
2471 | } executed: } Execution Count:400 | 400 |
2472 | | - |
2473 | void comp_func_solid_Overlay(uint *dest, int length, uint color, uint const_alpha) | - |
2474 | { | - |
2475 | if (const_alpha == 255) partially evaluated: const_alpha == 255 yes Evaluation Count:400 | no Evaluation Count:0 |
| 0-400 |
2476 | comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage()); executed: comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage()); Execution Count:400 | 400 |
2477 | else | - |
2478 | comp_func_solid_Overlay_impl(dest, length, color, QPartialCoverage(const_alpha)); never executed: comp_func_solid_Overlay_impl(dest, length, color, QPartialCoverage(const_alpha)); | 0 |
2479 | } | - |
2480 | | - |
2481 | template <typename T> | - |
2482 | static __attribute__((always_inline)) inline void comp_func_Overlay_impl(uint *__restrict__ dest, const uint *__restrict__ src, int length, const T &coverage) | - |
2483 | { | - |
2484 | | - |
2485 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2486 | | - |
2487 | uint d = dest[i]; | - |
2488 | uint s = src[i]; | - |
2489 | | - |
2490 | int da = qAlpha(d); | - |
2491 | int sa = qAlpha(s); | - |
2492 | | - |
2493 | | - |
2494 | int r = overlay_op(qRed(d), qRed(s), da, sa); | - |
2495 | int b = overlay_op(qBlue(d), qBlue(s), da, sa); | - |
2496 | int g = overlay_op(qGreen(d), qGreen(s), da, sa); | - |
2497 | int a = mix_alpha(da, sa); | - |
2498 | | - |
2499 | | - |
2500 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2501 | } | 0 |
2502 | } | 0 |
2503 | | - |
2504 | void comp_func_Overlay(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
2505 | { | - |
2506 | if (const_alpha == 255) never evaluated: const_alpha == 255 | 0 |
2507 | comp_func_Overlay_impl(dest, src, length, QFullCoverage()); never executed: comp_func_Overlay_impl(dest, src, length, QFullCoverage()); | 0 |
2508 | else | - |
2509 | comp_func_Overlay_impl(dest, src, length, QPartialCoverage(const_alpha)); never executed: comp_func_Overlay_impl(dest, src, length, QPartialCoverage(const_alpha)); | 0 |
2510 | } | - |
2511 | | - |
2512 | | - |
2513 | | - |
2514 | | - |
2515 | | - |
2516 | static inline int darken_op(int dst, int src, int da, int sa) | - |
2517 | { | - |
2518 | return qt_div_255(qMin(src * da, dst * sa) + src * (255 - da) + dst * (255 - sa)); executed: return qt_div_255(qMin(src * da, dst * sa) + src * (255 - da) + dst * (255 - sa)); Execution Count:210000 | 210000 |
2519 | } | - |
2520 | | - |
2521 | template <typename T> | - |
2522 | static __attribute__((always_inline)) inline void comp_func_solid_Darken_impl(uint *dest, int length, uint color, const T &coverage) | - |
2523 | { | - |
2524 | int sa = qAlpha(color); | - |
2525 | int sr = qRed(color); | - |
2526 | int sg = qGreen(color); | - |
2527 | int sb = qBlue(color); | - |
2528 | | - |
2529 | | - |
2530 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:70000 | yes Evaluation Count:700 |
| 700-70000 |
2531 | | - |
2532 | uint d = dest[i]; | - |
2533 | int da = qAlpha(d); | - |
2534 | | - |
2535 | | - |
2536 | int r = darken_op(qRed(d), sr, da, sa); | - |
2537 | int b = darken_op(qBlue(d), sb, da, sa); | - |
2538 | int g = darken_op(qGreen(d), sg, da, sa); | - |
2539 | int a = mix_alpha(da, sa); | - |
2540 | | - |
2541 | | - |
2542 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2543 | } executed: } Execution Count:70000 | 70000 |
2544 | } executed: } Execution Count:700 | 700 |
2545 | | - |
2546 | void comp_func_solid_Darken(uint *dest, int length, uint color, uint const_alpha) | - |
2547 | { | - |
2548 | if (const_alpha == 255) partially evaluated: const_alpha == 255 yes Evaluation Count:700 | no Evaluation Count:0 |
| 0-700 |
2549 | comp_func_solid_Darken_impl(dest, length, color, QFullCoverage()); executed: comp_func_solid_Darken_impl(dest, length, color, QFullCoverage()); Execution Count:700 | 700 |
2550 | else | - |
2551 | comp_func_solid_Darken_impl(dest, length, color, QPartialCoverage(const_alpha)); never executed: comp_func_solid_Darken_impl(dest, length, color, QPartialCoverage(const_alpha)); | 0 |
2552 | } | - |
2553 | | - |
2554 | template <typename T> | - |
2555 | static __attribute__((always_inline)) inline void comp_func_Darken_impl(uint *__restrict__ dest, const uint *__restrict__ src, int length, const T &coverage) | - |
2556 | { | - |
2557 | | - |
2558 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2559 | | - |
2560 | uint d = dest[i]; | - |
2561 | uint s = src[i]; | - |
2562 | | - |
2563 | int da = qAlpha(d); | - |
2564 | int sa = qAlpha(s); | - |
2565 | | - |
2566 | | - |
2567 | int r = darken_op(qRed(d), qRed(s), da, sa); | - |
2568 | int b = darken_op(qBlue(d), qBlue(s), da, sa); | - |
2569 | int g = darken_op(qGreen(d), qGreen(s), da, sa); | - |
2570 | int a = mix_alpha(da, sa); | - |
2571 | | - |
2572 | | - |
2573 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2574 | } | 0 |
2575 | } | 0 |
2576 | | - |
2577 | void comp_func_Darken(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
2578 | { | - |
2579 | if (const_alpha == 255) never evaluated: const_alpha == 255 | 0 |
2580 | comp_func_Darken_impl(dest, src, length, QFullCoverage()); never executed: comp_func_Darken_impl(dest, src, length, QFullCoverage()); | 0 |
2581 | else | - |
2582 | comp_func_Darken_impl(dest, src, length, QPartialCoverage(const_alpha)); never executed: comp_func_Darken_impl(dest, src, length, QPartialCoverage(const_alpha)); | 0 |
2583 | } | - |
2584 | | - |
2585 | | - |
2586 | | - |
2587 | | - |
2588 | | - |
2589 | static inline int lighten_op(int dst, int src, int da, int sa) | - |
2590 | { | - |
2591 | return qt_div_255(qMax(src * da, dst * sa) + src * (255 - da) + dst * (255 - sa)); executed: return qt_div_255(qMax(src * da, dst * sa) + src * (255 - da) + dst * (255 - sa)); Execution Count:210000 | 210000 |
2592 | } | - |
2593 | | - |
2594 | template <typename T> | - |
2595 | static __attribute__((always_inline)) inline void comp_func_solid_Lighten_impl(uint *dest, int length, uint color, const T &coverage) | - |
2596 | { | - |
2597 | int sa = qAlpha(color); | - |
2598 | int sr = qRed(color); | - |
2599 | int sg = qGreen(color); | - |
2600 | int sb = qBlue(color); | - |
2601 | | - |
2602 | | - |
2603 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:70000 | yes Evaluation Count:700 |
| 700-70000 |
2604 | | - |
2605 | uint d = dest[i]; | - |
2606 | int da = qAlpha(d); | - |
2607 | | - |
2608 | | - |
2609 | int r = lighten_op(qRed(d), sr, da, sa); | - |
2610 | int b = lighten_op(qBlue(d), sb, da, sa); | - |
2611 | int g = lighten_op(qGreen(d), sg, da, sa); | - |
2612 | int a = mix_alpha(da, sa); | - |
2613 | | - |
2614 | | - |
2615 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2616 | } executed: } Execution Count:70000 | 70000 |
2617 | } executed: } Execution Count:700 | 700 |
2618 | | - |
2619 | void comp_func_solid_Lighten(uint *dest, int length, uint color, uint const_alpha) | - |
2620 | { | - |
2621 | if (const_alpha == 255) partially evaluated: const_alpha == 255 yes Evaluation Count:700 | no Evaluation Count:0 |
| 0-700 |
2622 | comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage()); executed: comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage()); Execution Count:700 | 700 |
2623 | else | - |
2624 | comp_func_solid_Lighten_impl(dest, length, color, QPartialCoverage(const_alpha)); never executed: comp_func_solid_Lighten_impl(dest, length, color, QPartialCoverage(const_alpha)); | 0 |
2625 | } | - |
2626 | | - |
2627 | template <typename T> | - |
2628 | static __attribute__((always_inline)) inline void comp_func_Lighten_impl(uint *__restrict__ dest, const uint *__restrict__ src, int length, const T &coverage) | - |
2629 | { | - |
2630 | | - |
2631 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2632 | | - |
2633 | uint d = dest[i]; | - |
2634 | uint s = src[i]; | - |
2635 | | - |
2636 | int da = qAlpha(d); | - |
2637 | int sa = qAlpha(s); | - |
2638 | | - |
2639 | | - |
2640 | int r = lighten_op(qRed(d), qRed(s), da, sa); | - |
2641 | int b = lighten_op(qBlue(d), qBlue(s), da, sa); | - |
2642 | int g = lighten_op(qGreen(d), qGreen(s), da, sa); | - |
2643 | int a = mix_alpha(da, sa); | - |
2644 | | - |
2645 | | - |
2646 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2647 | } | 0 |
2648 | } | 0 |
2649 | | - |
2650 | void comp_func_Lighten(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
2651 | { | - |
2652 | if (const_alpha == 255) never evaluated: const_alpha == 255 | 0 |
2653 | comp_func_Lighten_impl(dest, src, length, QFullCoverage()); never executed: comp_func_Lighten_impl(dest, src, length, QFullCoverage()); | 0 |
2654 | else | - |
2655 | comp_func_Lighten_impl(dest, src, length, QPartialCoverage(const_alpha)); never executed: comp_func_Lighten_impl(dest, src, length, QPartialCoverage(const_alpha)); | 0 |
2656 | } | - |
2657 | | - |
2658 | | - |
2659 | | - |
2660 | | - |
2661 | | - |
2662 | | - |
2663 | | - |
2664 | static inline int color_dodge_op(int dst, int src, int da, int sa) | - |
2665 | { | - |
2666 | const int sa_da = sa * da; | - |
2667 | const int dst_sa = dst * sa; | - |
2668 | const int src_da = src * da; | - |
2669 | | - |
2670 | const int temp = src * (255 - da) + dst * (255 - sa); | - |
2671 | if (src_da + dst_sa >= sa_da) evaluated: src_da + dst_sa >= sa_da yes Evaluation Count:90000 | yes Evaluation Count:60000 |
| 60000-90000 |
2672 | return qt_div_255(sa_da + temp); executed: return qt_div_255(sa_da + temp); Execution Count:90000 | 90000 |
2673 | else | - |
2674 | return qt_div_255(255 * dst_sa / (255 - 255 * src / sa) + temp); executed: return qt_div_255(255 * dst_sa / (255 - 255 * src / sa) + temp); Execution Count:60000 | 60000 |
2675 | } | - |
2676 | | - |
2677 | template <typename T> | - |
2678 | static __attribute__((always_inline)) inline void comp_func_solid_ColorDodge_impl(uint *dest, int length, uint color, const T &coverage) | - |
2679 | { | - |
2680 | int sa = qAlpha(color); | - |
2681 | int sr = qRed(color); | - |
2682 | int sg = qGreen(color); | - |
2683 | int sb = qBlue(color); | - |
2684 | | - |
2685 | | - |
2686 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:50000 | yes Evaluation Count:500 |
| 500-50000 |
2687 | | - |
2688 | uint d = dest[i]; | - |
2689 | int da = qAlpha(d); | - |
2690 | | - |
2691 | | - |
2692 | int r = color_dodge_op(qRed(d), sr, da, sa); | - |
2693 | int b = color_dodge_op(qBlue(d), sb, da, sa); | - |
2694 | int g = color_dodge_op(qGreen(d), sg, da, sa); | - |
2695 | int a = mix_alpha(da, sa); | - |
2696 | | - |
2697 | | - |
2698 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2699 | } executed: } Execution Count:50000 | 50000 |
2700 | } executed: } Execution Count:500 | 500 |
2701 | | - |
2702 | void comp_func_solid_ColorDodge(uint *dest, int length, uint color, uint const_alpha) | - |
2703 | { | - |
2704 | if (const_alpha == 255) partially evaluated: const_alpha == 255 yes Evaluation Count:500 | no Evaluation Count:0 |
| 0-500 |
2705 | comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage()); executed: comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage()); Execution Count:500 | 500 |
2706 | else | - |
2707 | comp_func_solid_ColorDodge_impl(dest, length, color, QPartialCoverage(const_alpha)); never executed: comp_func_solid_ColorDodge_impl(dest, length, color, QPartialCoverage(const_alpha)); | 0 |
2708 | } | - |
2709 | | - |
2710 | template <typename T> | - |
2711 | static __attribute__((always_inline)) inline void comp_func_ColorDodge_impl(uint *__restrict__ dest, const uint *__restrict__ src, int length, const T &coverage) | - |
2712 | { | - |
2713 | | - |
2714 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2715 | | - |
2716 | uint d = dest[i]; | - |
2717 | uint s = src[i]; | - |
2718 | | - |
2719 | int da = qAlpha(d); | - |
2720 | int sa = qAlpha(s); | - |
2721 | | - |
2722 | | - |
2723 | int r = color_dodge_op(qRed(d), qRed(s), da, sa); | - |
2724 | int b = color_dodge_op(qBlue(d), qBlue(s), da, sa); | - |
2725 | int g = color_dodge_op(qGreen(d), qGreen(s), da, sa); | - |
2726 | int a = mix_alpha(da, sa); | - |
2727 | | - |
2728 | | - |
2729 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2730 | } | 0 |
2731 | } | 0 |
2732 | | - |
2733 | void comp_func_ColorDodge(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
2734 | { | - |
2735 | if (const_alpha == 255) never evaluated: const_alpha == 255 | 0 |
2736 | comp_func_ColorDodge_impl(dest, src, length, QFullCoverage()); never executed: comp_func_ColorDodge_impl(dest, src, length, QFullCoverage()); | 0 |
2737 | else | - |
2738 | comp_func_ColorDodge_impl(dest, src, length, QPartialCoverage(const_alpha)); never executed: comp_func_ColorDodge_impl(dest, src, length, QPartialCoverage(const_alpha)); | 0 |
2739 | } | - |
2740 | | - |
2741 | | - |
2742 | | - |
2743 | | - |
2744 | | - |
2745 | | - |
2746 | | - |
2747 | static inline int color_burn_op(int dst, int src, int da, int sa) | - |
2748 | { | - |
2749 | const int src_da = src * da; | - |
2750 | const int dst_sa = dst * sa; | - |
2751 | const int sa_da = sa * da; | - |
2752 | | - |
2753 | const int temp = src * (255 - da) + dst * (255 - sa); | - |
2754 | | - |
2755 | if (src == 0 || src_da + dst_sa <= sa_da) evaluated: src == 0 yes Evaluation Count:30000 | yes Evaluation Count:120000 |
evaluated: src_da + dst_sa <= sa_da yes Evaluation Count:30000 | yes Evaluation Count:90000 |
| 30000-120000 |
2756 | return qt_div_255(temp); executed: return qt_div_255(temp); Execution Count:60000 | 60000 |
2757 | return qt_div_255(sa * (src_da + dst_sa - sa_da) / src + temp); executed: return qt_div_255(sa * (src_da + dst_sa - sa_da) / src + temp); Execution Count:90000 | 90000 |
2758 | } | - |
2759 | | - |
2760 | template <typename T> | - |
2761 | static __attribute__((always_inline)) inline void comp_func_solid_ColorBurn_impl(uint *dest, int length, uint color, const T &coverage) | - |
2762 | { | - |
2763 | int sa = qAlpha(color); | - |
2764 | int sr = qRed(color); | - |
2765 | int sg = qGreen(color); | - |
2766 | int sb = qBlue(color); | - |
2767 | | - |
2768 | | - |
2769 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:50000 | yes Evaluation Count:500 |
| 500-50000 |
2770 | | - |
2771 | uint d = dest[i]; | - |
2772 | int da = qAlpha(d); | - |
2773 | | - |
2774 | | - |
2775 | int r = color_burn_op(qRed(d), sr, da, sa); | - |
2776 | int b = color_burn_op(qBlue(d), sb, da, sa); | - |
2777 | int g = color_burn_op(qGreen(d), sg, da, sa); | - |
2778 | int a = mix_alpha(da, sa); | - |
2779 | | - |
2780 | | - |
2781 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2782 | } executed: } Execution Count:50000 | 50000 |
2783 | } executed: } Execution Count:500 | 500 |
2784 | | - |
2785 | void comp_func_solid_ColorBurn(uint *dest, int length, uint color, uint const_alpha) | - |
2786 | { | - |
2787 | if (const_alpha == 255) partially evaluated: const_alpha == 255 yes Evaluation Count:500 | no Evaluation Count:0 |
| 0-500 |
2788 | comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage()); executed: comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage()); Execution Count:500 | 500 |
2789 | else | - |
2790 | comp_func_solid_ColorBurn_impl(dest, length, color, QPartialCoverage(const_alpha)); never executed: comp_func_solid_ColorBurn_impl(dest, length, color, QPartialCoverage(const_alpha)); | 0 |
2791 | } | - |
2792 | | - |
2793 | template <typename T> | - |
2794 | static __attribute__((always_inline)) inline void comp_func_ColorBurn_impl(uint *__restrict__ dest, const uint *__restrict__ src, int length, const T &coverage) | - |
2795 | { | - |
2796 | | - |
2797 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2798 | | - |
2799 | uint d = dest[i]; | - |
2800 | uint s = src[i]; | - |
2801 | | - |
2802 | int da = qAlpha(d); | - |
2803 | int sa = qAlpha(s); | - |
2804 | | - |
2805 | | - |
2806 | int r = color_burn_op(qRed(d), qRed(s), da, sa); | - |
2807 | int b = color_burn_op(qBlue(d), qBlue(s), da, sa); | - |
2808 | int g = color_burn_op(qGreen(d), qGreen(s), da, sa); | - |
2809 | int a = mix_alpha(da, sa); | - |
2810 | | - |
2811 | | - |
2812 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2813 | } | 0 |
2814 | } | 0 |
2815 | | - |
2816 | void comp_func_ColorBurn(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
2817 | { | - |
2818 | if (const_alpha == 255) never evaluated: const_alpha == 255 | 0 |
2819 | comp_func_ColorBurn_impl(dest, src, length, QFullCoverage()); never executed: comp_func_ColorBurn_impl(dest, src, length, QFullCoverage()); | 0 |
2820 | else | - |
2821 | comp_func_ColorBurn_impl(dest, src, length, QPartialCoverage(const_alpha)); never executed: comp_func_ColorBurn_impl(dest, src, length, QPartialCoverage(const_alpha)); | 0 |
2822 | } | - |
2823 | | - |
2824 | | - |
2825 | | - |
2826 | | - |
2827 | | - |
2828 | | - |
2829 | | - |
2830 | static inline uint hardlight_op(int dst, int src, int da, int sa) | - |
2831 | { | - |
2832 | const uint temp = src * (255 - da) + dst * (255 - sa); | - |
2833 | | - |
2834 | if (2 * src < sa) evaluated: 2 * src < sa yes Evaluation Count:120000 | yes Evaluation Count:30000 |
| 30000-120000 |
2835 | return qt_div_255(2 * src * dst + temp); executed: return qt_div_255(2 * src * dst + temp); Execution Count:120000 | 120000 |
2836 | else | - |
2837 | return qt_div_255(sa * da - 2 * (da - dst) * (sa - src) + temp); executed: return qt_div_255(sa * da - 2 * (da - dst) * (sa - src) + temp); Execution Count:30000 | 30000 |
2838 | } | - |
2839 | | - |
2840 | template <typename T> | - |
2841 | static __attribute__((always_inline)) inline void comp_func_solid_HardLight_impl(uint *dest, int length, uint color, const T &coverage) | - |
2842 | { | - |
2843 | int sa = qAlpha(color); | - |
2844 | int sr = qRed(color); | - |
2845 | int sg = qGreen(color); | - |
2846 | int sb = qBlue(color); | - |
2847 | | - |
2848 | | - |
2849 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:50000 | yes Evaluation Count:500 |
| 500-50000 |
2850 | | - |
2851 | uint d = dest[i]; | - |
2852 | int da = qAlpha(d); | - |
2853 | | - |
2854 | | - |
2855 | int r = hardlight_op(qRed(d), sr, da, sa); | - |
2856 | int b = hardlight_op(qBlue(d), sb, da, sa); | - |
2857 | int g = hardlight_op(qGreen(d), sg, da, sa); | - |
2858 | int a = mix_alpha(da, sa); | - |
2859 | | - |
2860 | | - |
2861 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2862 | } executed: } Execution Count:50000 | 50000 |
2863 | } executed: } Execution Count:500 | 500 |
2864 | | - |
2865 | void comp_func_solid_HardLight(uint *dest, int length, uint color, uint const_alpha) | - |
2866 | { | - |
2867 | if (const_alpha == 255) partially evaluated: const_alpha == 255 yes Evaluation Count:500 | no Evaluation Count:0 |
| 0-500 |
2868 | comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage()); executed: comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage()); Execution Count:500 | 500 |
2869 | else | - |
2870 | comp_func_solid_HardLight_impl(dest, length, color, QPartialCoverage(const_alpha)); never executed: comp_func_solid_HardLight_impl(dest, length, color, QPartialCoverage(const_alpha)); | 0 |
2871 | } | - |
2872 | | - |
2873 | template <typename T> | - |
2874 | static __attribute__((always_inline)) inline void comp_func_HardLight_impl(uint *__restrict__ dest, const uint *__restrict__ src, int length, const T &coverage) | - |
2875 | { | - |
2876 | | - |
2877 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2878 | | - |
2879 | uint d = dest[i]; | - |
2880 | uint s = src[i]; | - |
2881 | | - |
2882 | int da = qAlpha(d); | - |
2883 | int sa = qAlpha(s); | - |
2884 | | - |
2885 | | - |
2886 | int r = hardlight_op(qRed(d), qRed(s), da, sa); | - |
2887 | int b = hardlight_op(qBlue(d), qBlue(s), da, sa); | - |
2888 | int g = hardlight_op(qGreen(d), qGreen(s), da, sa); | - |
2889 | int a = mix_alpha(da, sa); | - |
2890 | | - |
2891 | | - |
2892 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2893 | } | 0 |
2894 | } | 0 |
2895 | | - |
2896 | void comp_func_HardLight(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
2897 | { | - |
2898 | if (const_alpha == 255) never evaluated: const_alpha == 255 | 0 |
2899 | comp_func_HardLight_impl(dest, src, length, QFullCoverage()); never executed: comp_func_HardLight_impl(dest, src, length, QFullCoverage()); | 0 |
2900 | else | - |
2901 | comp_func_HardLight_impl(dest, src, length, QPartialCoverage(const_alpha)); never executed: comp_func_HardLight_impl(dest, src, length, QPartialCoverage(const_alpha)); | 0 |
2902 | } | - |
2903 | static inline int soft_light_op(int dst, int src, int da, int sa) | - |
2904 | { | - |
2905 | const int src2 = src << 1; | - |
2906 | const int dst_np = da != 0 ? (255 * dst) / da : 0; partially evaluated: da != 0 yes Evaluation Count:150000 | no Evaluation Count:0 |
| 0-150000 |
2907 | const int temp = (src * (255 - da) + dst * (255 - sa)) * 255; | - |
2908 | | - |
2909 | if (src2 < sa) evaluated: src2 < sa yes Evaluation Count:120000 | yes Evaluation Count:30000 |
| 30000-120000 |
2910 | return (dst * (sa * 255 + (src2 - sa) * (255 - dst_np)) + temp) / 65025; executed: return (dst * (sa * 255 + (src2 - sa) * (255 - dst_np)) + temp) / 65025; Execution Count:120000 | 120000 |
2911 | else if (4 * dst <= da) partially evaluated: 4 * dst <= da no Evaluation Count:0 | yes Evaluation Count:30000 |
| 0-30000 |
2912 | return (dst * sa * 255 + da * (src2 - sa) * ((((16 * dst_np - 12 * 255) * dst_np + 3 * 65025) * dst_np) / 65025) + temp) / 65025; never executed: return (dst * sa * 255 + da * (src2 - sa) * ((((16 * dst_np - 12 * 255) * dst_np + 3 * 65025) * dst_np) / 65025) + temp) / 65025; | 0 |
2913 | else { | - |
2914 | | - |
2915 | | - |
2916 | | - |
2917 | return (dst * sa * 255 + da * (src2 - sa) * (int(qSqrt(qreal(dst_np * 255))) - dst_np) + temp) / 65025; executed: return (dst * sa * 255 + da * (src2 - sa) * (int(qSqrt(qreal(dst_np * 255))) - dst_np) + temp) / 65025; Execution Count:30000 | 30000 |
2918 | | - |
2919 | } | - |
2920 | } | - |
2921 | | - |
2922 | template <typename T> | - |
2923 | static __attribute__((always_inline)) inline void comp_func_solid_SoftLight_impl(uint *dest, int length, uint color, const T &coverage) | - |
2924 | { | - |
2925 | int sa = qAlpha(color); | - |
2926 | int sr = qRed(color); | - |
2927 | int sg = qGreen(color); | - |
2928 | int sb = qBlue(color); | - |
2929 | | - |
2930 | | - |
2931 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:50000 | yes Evaluation Count:500 |
| 500-50000 |
2932 | | - |
2933 | uint d = dest[i]; | - |
2934 | int da = qAlpha(d); | - |
2935 | | - |
2936 | | - |
2937 | int r = soft_light_op(qRed(d), sr, da, sa); | - |
2938 | int b = soft_light_op(qBlue(d), sb, da, sa); | - |
2939 | int g = soft_light_op(qGreen(d), sg, da, sa); | - |
2940 | int a = mix_alpha(da, sa); | - |
2941 | | - |
2942 | | - |
2943 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2944 | } executed: } Execution Count:50000 | 50000 |
2945 | } executed: } Execution Count:500 | 500 |
2946 | | - |
2947 | void comp_func_solid_SoftLight(uint *dest, int length, uint color, uint const_alpha) | - |
2948 | { | - |
2949 | if (const_alpha == 255) partially evaluated: const_alpha == 255 yes Evaluation Count:500 | no Evaluation Count:0 |
| 0-500 |
2950 | comp_func_solid_SoftLight_impl(dest, length, color, QFullCoverage()); executed: comp_func_solid_SoftLight_impl(dest, length, color, QFullCoverage()); Execution Count:500 | 500 |
2951 | else | - |
2952 | comp_func_solid_SoftLight_impl(dest, length, color, QPartialCoverage(const_alpha)); never executed: comp_func_solid_SoftLight_impl(dest, length, color, QPartialCoverage(const_alpha)); | 0 |
2953 | } | - |
2954 | | - |
2955 | template <typename T> | - |
2956 | static __attribute__((always_inline)) inline void comp_func_SoftLight_impl(uint *__restrict__ dest, const uint *__restrict__ src, int length, const T &coverage) | - |
2957 | { | - |
2958 | | - |
2959 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
2960 | | - |
2961 | uint d = dest[i]; | - |
2962 | uint s = src[i]; | - |
2963 | | - |
2964 | int da = qAlpha(d); | - |
2965 | int sa = qAlpha(s); | - |
2966 | | - |
2967 | | - |
2968 | int r = soft_light_op(qRed(d), qRed(s), da, sa); | - |
2969 | int b = soft_light_op(qBlue(d), qBlue(s), da, sa); | - |
2970 | int g = soft_light_op(qGreen(d), qGreen(s), da, sa); | - |
2971 | int a = mix_alpha(da, sa); | - |
2972 | | - |
2973 | | - |
2974 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
2975 | } | 0 |
2976 | } | 0 |
2977 | | - |
2978 | void comp_func_SoftLight(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
2979 | { | - |
2980 | if (const_alpha == 255) never evaluated: const_alpha == 255 | 0 |
2981 | comp_func_SoftLight_impl(dest, src, length, QFullCoverage()); never executed: comp_func_SoftLight_impl(dest, src, length, QFullCoverage()); | 0 |
2982 | else | - |
2983 | comp_func_SoftLight_impl(dest, src, length, QPartialCoverage(const_alpha)); never executed: comp_func_SoftLight_impl(dest, src, length, QPartialCoverage(const_alpha)); | 0 |
2984 | } | - |
2985 | | - |
2986 | | - |
2987 | | - |
2988 | | - |
2989 | | - |
2990 | static inline int difference_op(int dst, int src, int da, int sa) | - |
2991 | { | - |
2992 | return src + dst - qt_div_255(2 * qMin(src * da, dst * sa)); executed: return src + dst - qt_div_255(2 * qMin(src * da, dst * sa)); Execution Count:210000 | 210000 |
2993 | } | - |
2994 | | - |
2995 | template <typename T> | - |
2996 | static __attribute__((always_inline)) inline void comp_func_solid_Difference_impl(uint *dest, int length, uint color, const T &coverage) | - |
2997 | { | - |
2998 | int sa = qAlpha(color); | - |
2999 | int sr = qRed(color); | - |
3000 | int sg = qGreen(color); | - |
3001 | int sb = qBlue(color); | - |
3002 | | - |
3003 | | - |
3004 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:70000 | yes Evaluation Count:700 |
| 700-70000 |
3005 | | - |
3006 | uint d = dest[i]; | - |
3007 | int da = qAlpha(d); | - |
3008 | | - |
3009 | | - |
3010 | int r = difference_op(qRed(d), sr, da, sa); | - |
3011 | int b = difference_op(qBlue(d), sb, da, sa); | - |
3012 | int g = difference_op(qGreen(d), sg, da, sa); | - |
3013 | int a = mix_alpha(da, sa); | - |
3014 | | - |
3015 | | - |
3016 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
3017 | } executed: } Execution Count:70000 | 70000 |
3018 | } executed: } Execution Count:700 | 700 |
3019 | | - |
3020 | void comp_func_solid_Difference(uint *dest, int length, uint color, uint const_alpha) | - |
3021 | { | - |
3022 | if (const_alpha == 255) partially evaluated: const_alpha == 255 yes Evaluation Count:700 | no Evaluation Count:0 |
| 0-700 |
3023 | comp_func_solid_Difference_impl(dest, length, color, QFullCoverage()); executed: comp_func_solid_Difference_impl(dest, length, color, QFullCoverage()); Execution Count:700 | 700 |
3024 | else | - |
3025 | comp_func_solid_Difference_impl(dest, length, color, QPartialCoverage(const_alpha)); never executed: comp_func_solid_Difference_impl(dest, length, color, QPartialCoverage(const_alpha)); | 0 |
3026 | } | - |
3027 | | - |
3028 | template <typename T> | - |
3029 | static __attribute__((always_inline)) inline void comp_func_Difference_impl(uint *__restrict__ dest, const uint *__restrict__ src, int length, const T &coverage) | - |
3030 | { | - |
3031 | | - |
3032 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
3033 | | - |
3034 | uint d = dest[i]; | - |
3035 | uint s = src[i]; | - |
3036 | | - |
3037 | int da = qAlpha(d); | - |
3038 | int sa = qAlpha(s); | - |
3039 | | - |
3040 | | - |
3041 | int r = difference_op(qRed(d), qRed(s), da, sa); | - |
3042 | int b = difference_op(qBlue(d), qBlue(s), da, sa); | - |
3043 | int g = difference_op(qGreen(d), qGreen(s), da, sa); | - |
3044 | int a = mix_alpha(da, sa); | - |
3045 | | - |
3046 | | - |
3047 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
3048 | } | 0 |
3049 | } | 0 |
3050 | | - |
3051 | void comp_func_Difference(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
3052 | { | - |
3053 | if (const_alpha == 255) never evaluated: const_alpha == 255 | 0 |
3054 | comp_func_Difference_impl(dest, src, length, QFullCoverage()); never executed: comp_func_Difference_impl(dest, src, length, QFullCoverage()); | 0 |
3055 | else | - |
3056 | comp_func_Difference_impl(dest, src, length, QPartialCoverage(const_alpha)); never executed: comp_func_Difference_impl(dest, src, length, QPartialCoverage(const_alpha)); | 0 |
3057 | } | - |
3058 | | - |
3059 | | - |
3060 | | - |
3061 | | - |
3062 | template <typename T> | - |
3063 | static __attribute__((always_inline)) inline void comp_func_solid_Exclusion_impl(uint *dest, int length, uint color, const T &coverage) | - |
3064 | { | - |
3065 | int sa = qAlpha(color); | - |
3066 | int sr = qRed(color); | - |
3067 | int sg = qGreen(color); | - |
3068 | int sb = qBlue(color); | - |
3069 | | - |
3070 | | - |
3071 | for (int i = 0; i < length; ++i) { evaluated: i < length yes Evaluation Count:70000 | yes Evaluation Count:700 |
| 700-70000 |
3072 | | - |
3073 | uint d = dest[i]; | - |
3074 | int da = qAlpha(d); | - |
3075 | | - |
3076 | | - |
3077 | int r = (qRed(d) + sr - qt_div_255(2*(qRed(d)*sr))); | - |
3078 | int b = (qBlue(d) + sb - qt_div_255(2*(qBlue(d)*sb))); | - |
3079 | int g = (qGreen(d) + sg - qt_div_255(2*(qGreen(d)*sg))); | - |
3080 | int a = mix_alpha(da, sa); | - |
3081 | | - |
3082 | | - |
3083 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
3084 | } executed: } Execution Count:70000 | 70000 |
3085 | } executed: } Execution Count:700 | 700 |
3086 | | - |
3087 | void comp_func_solid_Exclusion(uint *dest, int length, uint color, uint const_alpha) | - |
3088 | { | - |
3089 | if (const_alpha == 255) partially evaluated: const_alpha == 255 yes Evaluation Count:700 | no Evaluation Count:0 |
| 0-700 |
3090 | comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage()); executed: comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage()); Execution Count:700 | 700 |
3091 | else | - |
3092 | comp_func_solid_Exclusion_impl(dest, length, color, QPartialCoverage(const_alpha)); never executed: comp_func_solid_Exclusion_impl(dest, length, color, QPartialCoverage(const_alpha)); | 0 |
3093 | } | - |
3094 | | - |
3095 | template <typename T> | - |
3096 | static __attribute__((always_inline)) inline void comp_func_Exclusion_impl(uint *__restrict__ dest, const uint *__restrict__ src, int length, const T &coverage) | - |
3097 | { | - |
3098 | | - |
3099 | for (int i = 0; i < length; ++i) { never evaluated: i < length | 0 |
3100 | | - |
3101 | uint d = dest[i]; | - |
3102 | uint s = src[i]; | - |
3103 | | - |
3104 | int da = qAlpha(d); | - |
3105 | int sa = qAlpha(s); | - |
3106 | | - |
3107 | | - |
3108 | int r = (qRed(d) + qRed(s) - ((qRed(d)*qRed(s)) >> 7)); | - |
3109 | int b = (qBlue(d) + qBlue(s) - ((qBlue(d)*qBlue(s)) >> 7)); | - |
3110 | int g = (qGreen(d) + qGreen(s) - ((qGreen(d)*qGreen(s)) >> 7)); | - |
3111 | int a = mix_alpha(da, sa); | - |
3112 | | - |
3113 | | - |
3114 | coverage.store(&dest[i], qRgba(r, g, b, a)); | - |
3115 | } | 0 |
3116 | } | 0 |
3117 | | - |
3118 | void comp_func_Exclusion(uint *__restrict__ dest, const uint *__restrict__ src, int length, uint const_alpha) | - |
3119 | { | - |
3120 | if (const_alpha == 255) never evaluated: const_alpha == 255 | 0 |
3121 | comp_func_Exclusion_impl(dest, src, length, QFullCoverage()); never executed: comp_func_Exclusion_impl(dest, src, length, QFullCoverage()); | 0 |
3122 | else | - |
3123 | comp_func_Exclusion_impl(dest, src, length, QPartialCoverage(const_alpha)); never executed: comp_func_Exclusion_impl(dest, src, length, QPartialCoverage(const_alpha)); | 0 |
3124 | } | - |
3125 | | - |
3126 | | - |
3127 | | - |
3128 | | - |
3129 | | - |
3130 | | - |
3131 | void rasterop_solid_SourceOrDestination(uint *dest, | - |
3132 | int length, | - |
3133 | uint color, | - |
3134 | uint const_alpha) | - |
3135 | { | - |
3136 | (void)const_alpha;; | - |
3137 | while (length--) never evaluated: length-- | 0 |
3138 | *dest++ |= color; never executed: *dest++ |= color; | 0 |
3139 | } | 0 |
3140 | | - |
3141 | void rasterop_SourceOrDestination(uint *__restrict__ dest, | - |
3142 | const uint *__restrict__ src, | - |
3143 | int length, | - |
3144 | uint const_alpha) | - |
3145 | { | - |
3146 | (void)const_alpha;; | - |
3147 | while (length--) never evaluated: length-- | 0 |
3148 | *dest++ |= *src++; never executed: *dest++ |= *src++; | 0 |
3149 | } | 0 |
3150 | | - |
3151 | void rasterop_solid_SourceAndDestination(uint *dest, | - |
3152 | int length, | - |
3153 | uint color, | - |
3154 | uint const_alpha) | - |
3155 | { | - |
3156 | (void)const_alpha;; | - |
3157 | color |= 0xff000000; | - |
3158 | while (length--) never evaluated: length-- | 0 |
3159 | *dest++ &= color; never executed: *dest++ &= color; | 0 |
3160 | } | 0 |
3161 | | - |
3162 | void rasterop_SourceAndDestination(uint *__restrict__ dest, | - |
3163 | const uint *__restrict__ src, | - |
3164 | int length, | - |
3165 | uint const_alpha) | - |
3166 | { | - |
3167 | (void)const_alpha;; | - |
3168 | while (length--) { never evaluated: length-- | 0 |
3169 | *dest = (*src & *dest) | 0xff000000; | - |
3170 | ++dest; ++src; | - |
3171 | } | 0 |
3172 | } | 0 |
3173 | | - |
3174 | void rasterop_solid_SourceXorDestination(uint *dest, | - |
3175 | int length, | - |
3176 | uint color, | - |
3177 | uint const_alpha) | - |
3178 | { | - |
3179 | (void)const_alpha;; | - |
3180 | color &= 0x00ffffff; | - |
3181 | while (length--) never evaluated: length-- | 0 |
3182 | *dest++ ^= color; never executed: *dest++ ^= color; | 0 |
3183 | } | 0 |
3184 | | - |
3185 | void rasterop_SourceXorDestination(uint *__restrict__ dest, | - |
3186 | const uint *__restrict__ src, | - |
3187 | int length, | - |
3188 | uint const_alpha) | - |
3189 | { | - |
3190 | (void)const_alpha;; | - |
3191 | while (length--) { never evaluated: length-- | 0 |
3192 | *dest = (*src ^ *dest) | 0xff000000; | - |
3193 | ++dest; ++src; | - |
3194 | } | 0 |
3195 | } | 0 |
3196 | | - |
3197 | void rasterop_solid_NotSourceAndNotDestination(uint *dest, | - |
3198 | int length, | - |
3199 | uint color, | - |
3200 | uint const_alpha) | - |
3201 | { | - |
3202 | (void)const_alpha;; | - |
3203 | color = ~color; | - |
3204 | while (length--) { never evaluated: length-- | 0 |
3205 | *dest = (color & ~(*dest)) | 0xff000000; | - |
3206 | ++dest; | - |
3207 | } | 0 |
3208 | } | 0 |
3209 | | - |
3210 | void rasterop_NotSourceAndNotDestination(uint *__restrict__ dest, | - |
3211 | const uint *__restrict__ src, | - |
3212 | int length, | - |
3213 | uint const_alpha) | - |
3214 | { | - |
3215 | (void)const_alpha;; | - |
3216 | while (length--) { never evaluated: length-- | 0 |
3217 | *dest = (~(*src) & ~(*dest)) | 0xff000000; | - |
3218 | ++dest; ++src; | - |
3219 | } | 0 |
3220 | } | 0 |
3221 | | - |
3222 | void rasterop_solid_NotSourceOrNotDestination(uint *dest, | - |
3223 | int length, | - |
3224 | uint color, | - |
3225 | uint const_alpha) | - |
3226 | { | - |
3227 | (void)const_alpha;; | - |
3228 | color = ~color | 0xff000000; | - |
3229 | while (length--) { never evaluated: length-- | 0 |
3230 | *dest = color | ~(*dest); | - |
3231 | ++dest; | - |
3232 | } | 0 |
3233 | } | 0 |
3234 | | - |
3235 | void rasterop_NotSourceOrNotDestination(uint *__restrict__ dest, | - |
3236 | const uint *__restrict__ src, | - |
3237 | int length, | - |
3238 | uint const_alpha) | - |
3239 | { | - |
3240 | (void)const_alpha;; | - |
3241 | while (length--) { never evaluated: length-- | 0 |
3242 | *dest = ~(*src) | ~(*dest) | 0xff000000; | - |
3243 | ++dest; ++src; | - |
3244 | } | 0 |
3245 | } | 0 |
3246 | | - |
3247 | void rasterop_solid_NotSourceXorDestination(uint *dest, | - |
3248 | int length, | - |
3249 | uint color, | - |
3250 | uint const_alpha) | - |
3251 | { | - |
3252 | (void)const_alpha;; | - |
3253 | color = ~color & 0x00ffffff; | - |
3254 | while (length--) { never evaluated: length-- | 0 |
3255 | *dest = color ^ (*dest); | - |
3256 | ++dest; | - |
3257 | } | 0 |
3258 | } | 0 |
3259 | | - |
3260 | void rasterop_NotSourceXorDestination(uint *__restrict__ dest, | - |
3261 | const uint *__restrict__ src, | - |
3262 | int length, | - |
3263 | uint const_alpha) | - |
3264 | { | - |
3265 | (void)const_alpha;; | - |
3266 | while (length--) { never evaluated: length-- | 0 |
3267 | *dest = ((~(*src)) ^ (*dest)) | 0xff000000; | - |
3268 | ++dest; ++src; | - |
3269 | } | 0 |
3270 | } | 0 |
3271 | | - |
3272 | void rasterop_solid_NotSource(uint *dest, int length, | - |
3273 | uint color, uint const_alpha) | - |
3274 | { | - |
3275 | (void)const_alpha;; | - |
3276 | qt_memfill(dest, ~color | 0xff000000, length); | - |
3277 | } | 0 |
3278 | | - |
3279 | void rasterop_NotSource(uint *__restrict__ dest, const uint *__restrict__ src, | - |
3280 | int length, uint const_alpha) | - |
3281 | { | - |
3282 | (void)const_alpha;; | - |
3283 | while (length--) never evaluated: length-- | 0 |
3284 | *dest++ = ~(*src++) | 0xff000000; never executed: *dest++ = ~(*src++) | 0xff000000; | 0 |
3285 | } | 0 |
3286 | | - |
3287 | void rasterop_solid_NotSourceAndDestination(uint *dest, | - |
3288 | int length, | - |
3289 | uint color, | - |
3290 | uint const_alpha) | - |
3291 | { | - |
3292 | (void)const_alpha;; | - |
3293 | color = ~color | 0xff000000; | - |
3294 | while (length--) { never evaluated: length-- | 0 |
3295 | *dest = color & *dest; | - |
3296 | ++dest; | - |
3297 | } | 0 |
3298 | } | 0 |
3299 | | - |
3300 | void rasterop_NotSourceAndDestination(uint *__restrict__ dest, | - |
3301 | const uint *__restrict__ src, | - |
3302 | int length, | - |
3303 | uint const_alpha) | - |
3304 | { | - |
3305 | (void)const_alpha;; | - |
3306 | while (length--) { never evaluated: length-- | 0 |
3307 | *dest = (~(*src) & *dest) | 0xff000000; | - |
3308 | ++dest; ++src; | - |
3309 | } | 0 |
3310 | } | 0 |
3311 | | - |
3312 | void rasterop_solid_SourceAndNotDestination(uint *dest, | - |
3313 | int length, | - |
3314 | uint color, | - |
3315 | uint const_alpha) | - |
3316 | { | - |
3317 | (void)const_alpha;; | - |
3318 | while (length--) { never evaluated: length-- | 0 |
3319 | *dest = (color & ~(*dest)) | 0xff000000; | - |
3320 | ++dest; | - |
3321 | } | 0 |
3322 | } | 0 |
3323 | | - |
3324 | void rasterop_SourceAndNotDestination(uint *__restrict__ dest, | - |
3325 | const uint *__restrict__ src, | - |
3326 | int length, | - |
3327 | uint const_alpha) | - |
3328 | { | - |
3329 | (void)const_alpha;; | - |
3330 | while (length--) { never evaluated: length-- | 0 |
3331 | *dest = (*src & ~(*dest)) | 0xff000000; | - |
3332 | ++dest; ++src; | - |
3333 | } | 0 |
3334 | } | 0 |
3335 | | - |
3336 | void rasterop_NotSourceOrDestination(uint *__restrict__ dest, | - |
3337 | const uint *__restrict__ src, | - |
3338 | int length, | - |
3339 | uint const_alpha) | - |
3340 | { | - |
3341 | (void)const_alpha;; | - |
3342 | while (length--) { never evaluated: length-- | 0 |
3343 | *dest = (~(*src) | *dest) | 0xff000000; | - |
3344 | ++dest; ++src; | - |
3345 | } | 0 |
3346 | } | 0 |
3347 | | - |
3348 | void rasterop_solid_NotSourceOrDestination(uint *__restrict__ dest, | - |
3349 | int length, | - |
3350 | uint color, | - |
3351 | uint const_alpha) | - |
3352 | { | - |
3353 | (void)const_alpha;; | - |
3354 | color = ~color | 0xff000000; | - |
3355 | while (length--) never evaluated: length-- | 0 |
3356 | *dest++ |= color; never executed: *dest++ |= color; | 0 |
3357 | } | 0 |
3358 | | - |
3359 | void rasterop_SourceOrNotDestination(uint *__restrict__ dest, | - |
3360 | const uint *__restrict__ src, | - |
3361 | int length, | - |
3362 | uint const_alpha) | - |
3363 | { | - |
3364 | (void)const_alpha;; | - |
3365 | while (length--) { never evaluated: length-- | 0 |
3366 | *dest = (*src | ~(*dest)) | 0xff000000; | - |
3367 | ++dest; ++src; | - |
3368 | } | 0 |
3369 | } | 0 |
3370 | | - |
3371 | void rasterop_solid_SourceOrNotDestination(uint *__restrict__ dest, | - |
3372 | int length, | - |
3373 | uint color, | - |
3374 | uint const_alpha) | - |
3375 | { | - |
3376 | (void)const_alpha;; | - |
3377 | while (length--) { never evaluated: length-- | 0 |
3378 | *dest = (color | ~(*dest)) | 0xff000000; | - |
3379 | ++dest; | - |
3380 | } | 0 |
3381 | } | 0 |
3382 | | - |
3383 | void rasterop_ClearDestination(uint *__restrict__ dest, | - |
3384 | const uint *__restrict__ src, | - |
3385 | int length, | - |
3386 | uint const_alpha) | - |
3387 | { | - |
3388 | (void)src;; | - |
3389 | comp_func_solid_SourceOver (dest, length, 0xff000000, const_alpha); | - |
3390 | } | 0 |
3391 | | - |
3392 | void rasterop_solid_ClearDestination(uint *__restrict__ dest, | - |
3393 | int length, | - |
3394 | uint color, | - |
3395 | uint const_alpha) | - |
3396 | { | - |
3397 | (void)color;; | - |
3398 | comp_func_solid_SourceOver (dest, length, 0xff000000, const_alpha); | - |
3399 | } | 0 |
3400 | | - |
3401 | void rasterop_SetDestination(uint *__restrict__ dest, | - |
3402 | const uint *__restrict__ src, | - |
3403 | int length, | - |
3404 | uint const_alpha) | - |
3405 | { | - |
3406 | (void)src;; | - |
3407 | comp_func_solid_SourceOver (dest, length, 0xffffffff, const_alpha); | - |
3408 | } | 0 |
3409 | | - |
3410 | void rasterop_solid_SetDestination(uint *__restrict__ dest, | - |
3411 | int length, | - |
3412 | uint color, | - |
3413 | uint const_alpha) | - |
3414 | { | - |
3415 | (void)color;; | - |
3416 | comp_func_solid_SourceOver (dest, length, 0xffffffff, const_alpha); | - |
3417 | } | 0 |
3418 | | - |
3419 | void rasterop_NotDestination(uint *__restrict__ dest, | - |
3420 | const uint *__restrict__ src, | - |
3421 | int length, | - |
3422 | uint const_alpha) | - |
3423 | { | - |
3424 | (void)src;; | - |
3425 | rasterop_solid_SourceXorDestination (dest, length, 0x00ffffff, const_alpha); | - |
3426 | } | 0 |
3427 | | - |
3428 | void rasterop_solid_NotDestination(uint *__restrict__ dest, | - |
3429 | int length, | - |
3430 | uint color, | - |
3431 | uint const_alpha) | - |
3432 | { | - |
3433 | (void)color;; | - |
3434 | rasterop_solid_SourceXorDestination (dest, length, 0x00ffffff, const_alpha); | - |
3435 | } | 0 |
3436 | | - |
3437 | static CompositionFunctionSolid functionForModeSolid_C[] = { | - |
3438 | comp_func_solid_SourceOver, | - |
3439 | comp_func_solid_DestinationOver, | - |
3440 | comp_func_solid_Clear, | - |
3441 | comp_func_solid_Source, | - |
3442 | comp_func_solid_Destination, | - |
3443 | comp_func_solid_SourceIn, | - |
3444 | comp_func_solid_DestinationIn, | - |
3445 | comp_func_solid_SourceOut, | - |
3446 | comp_func_solid_DestinationOut, | - |
3447 | comp_func_solid_SourceAtop, | - |
3448 | comp_func_solid_DestinationAtop, | - |
3449 | comp_func_solid_XOR, | - |
3450 | comp_func_solid_Plus, | - |
3451 | comp_func_solid_Multiply, | - |
3452 | comp_func_solid_Screen, | - |
3453 | comp_func_solid_Overlay, | - |
3454 | comp_func_solid_Darken, | - |
3455 | comp_func_solid_Lighten, | - |
3456 | comp_func_solid_ColorDodge, | - |
3457 | comp_func_solid_ColorBurn, | - |
3458 | comp_func_solid_HardLight, | - |
3459 | comp_func_solid_SoftLight, | - |
3460 | comp_func_solid_Difference, | - |
3461 | comp_func_solid_Exclusion, | - |
3462 | rasterop_solid_SourceOrDestination, | - |
3463 | rasterop_solid_SourceAndDestination, | - |
3464 | rasterop_solid_SourceXorDestination, | - |
3465 | rasterop_solid_NotSourceAndNotDestination, | - |
3466 | rasterop_solid_NotSourceOrNotDestination, | - |
3467 | rasterop_solid_NotSourceXorDestination, | - |
3468 | rasterop_solid_NotSource, | - |
3469 | rasterop_solid_NotSourceAndDestination, | - |
3470 | rasterop_solid_SourceAndNotDestination, | - |
3471 | rasterop_solid_SourceAndNotDestination, | - |
3472 | rasterop_solid_NotSourceOrDestination, | - |
3473 | rasterop_solid_SourceOrNotDestination, | - |
3474 | rasterop_solid_ClearDestination, | - |
3475 | rasterop_solid_SetDestination, | - |
3476 | rasterop_solid_NotDestination | - |
3477 | }; | - |
3478 | | - |
3479 | static const CompositionFunctionSolid *functionForModeSolid = functionForModeSolid_C; | - |
3480 | | - |
3481 | static CompositionFunction functionForMode_C[] = { | - |
3482 | comp_func_SourceOver, | - |
3483 | comp_func_DestinationOver, | - |
3484 | comp_func_Clear, | - |
3485 | comp_func_Source, | - |
3486 | comp_func_Destination, | - |
3487 | comp_func_SourceIn, | - |
3488 | comp_func_DestinationIn, | - |
3489 | comp_func_SourceOut, | - |
3490 | comp_func_DestinationOut, | - |
3491 | comp_func_SourceAtop, | - |
3492 | comp_func_DestinationAtop, | - |
3493 | comp_func_XOR, | - |
3494 | comp_func_Plus, | - |
3495 | comp_func_Multiply, | - |
3496 | comp_func_Screen, | - |
3497 | comp_func_Overlay, | - |
3498 | comp_func_Darken, | - |
3499 | comp_func_Lighten, | - |
3500 | comp_func_ColorDodge, | - |
3501 | comp_func_ColorBurn, | - |
3502 | comp_func_HardLight, | - |
3503 | comp_func_SoftLight, | - |
3504 | comp_func_Difference, | - |
3505 | comp_func_Exclusion, | - |
3506 | rasterop_SourceOrDestination, | - |
3507 | rasterop_SourceAndDestination, | - |
3508 | rasterop_SourceXorDestination, | - |
3509 | rasterop_NotSourceAndNotDestination, | - |
3510 | rasterop_NotSourceOrNotDestination, | - |
3511 | rasterop_NotSourceXorDestination, | - |
3512 | rasterop_NotSource, | - |
3513 | rasterop_NotSourceAndDestination, | - |
3514 | rasterop_SourceAndNotDestination, | - |
3515 | rasterop_SourceAndNotDestination, | - |
3516 | rasterop_NotSourceOrDestination, | - |
3517 | rasterop_SourceOrNotDestination, | - |
3518 | rasterop_ClearDestination, | - |
3519 | rasterop_SetDestination, | - |
3520 | rasterop_NotDestination | - |
3521 | }; | - |
3522 | | - |
3523 | static const CompositionFunction *functionForMode = functionForMode_C; | - |
3524 | | - |
3525 | static TextureBlendType getBlendType(const QSpanData *data) | - |
3526 | { | - |
3527 | TextureBlendType ft; | - |
3528 | if (data->txop <= QTransform::TxTranslate) evaluated: data->txop <= QTransform::TxTranslate yes Evaluation Count:37660 | yes Evaluation Count:62 |
| 62-37660 |
3529 | if (data->texture.type == QTextureData::Tiled) evaluated: data->texture.type == QTextureData::Tiled yes Evaluation Count:35174 | yes Evaluation Count:2486 |
| 2486-35174 |
3530 | ft = BlendTiled; executed: ft = BlendTiled; Execution Count:35174 | 35174 |
3531 | else | - |
3532 | ft = BlendUntransformed; executed: ft = BlendUntransformed; Execution Count:2486 | 2486 |
3533 | else if (data->bilinear) evaluated: data->bilinear yes Evaluation Count:54 | yes Evaluation Count:8 |
| 8-54 |
3534 | if (data->texture.type == QTextureData::Tiled) evaluated: data->texture.type == QTextureData::Tiled yes Evaluation Count:4 | yes Evaluation Count:50 |
| 4-50 |
3535 | ft = BlendTransformedBilinearTiled; executed: ft = BlendTransformedBilinearTiled; Execution Count:4 | 4 |
3536 | else | - |
3537 | ft = BlendTransformedBilinear; executed: ft = BlendTransformedBilinear; Execution Count:50 | 50 |
3538 | else | - |
3539 | if (data->texture.type == QTextureData::Tiled) evaluated: data->texture.type == QTextureData::Tiled yes Evaluation Count:2 | yes Evaluation Count:6 |
| 2-6 |
3540 | ft = BlendTransformedTiled; executed: ft = BlendTransformedTiled; Execution Count:2 | 2 |
3541 | else | - |
3542 | ft = BlendTransformed; executed: ft = BlendTransformed; Execution Count:6 | 6 |
3543 | return ft; executed: return ft; Execution Count:37722 | 37722 |
3544 | } | - |
3545 | | - |
3546 | static inline Operator getOperator(const QSpanData *data, const QSpan *spans, int spanCount) | - |
3547 | { | - |
3548 | Operator op; | - |
3549 | bool solidSource = false; | - |
3550 | | - |
3551 | switch(data->type) { | - |
3552 | case QSpanData::Solid: | - |
3553 | solidSource = (qAlpha(data->solid.color) == 255); | - |
3554 | break; executed: break; Execution Count:210123 | 210123 |
3555 | case QSpanData::LinearGradient: | - |
3556 | solidSource = !data->gradient.alphaColor; | - |
3557 | getLinearGradientValues(&op.linear, data); | - |
3558 | op.src_fetch = qt_fetch_linear_gradient; | - |
3559 | break; executed: break; Execution Count:16548 | 16548 |
3560 | case QSpanData::RadialGradient: | - |
3561 | solidSource = !data->gradient.alphaColor; | - |
3562 | getRadialGradientValues(&op.radial, data); | - |
3563 | op.src_fetch = qt_fetch_radial_gradient; | - |
3564 | break; executed: break; Execution Count:519 | 519 |
3565 | case QSpanData::ConicalGradient: | - |
3566 | solidSource = !data->gradient.alphaColor; | - |
3567 | op.src_fetch = qt_fetch_conical_gradient; | - |
3568 | break; | 0 |
3569 | case QSpanData::Texture: | - |
3570 | op.src_fetch = sourceFetch[getBlendType(data)][data->texture.format]; | - |
3571 | solidSource = !data->texture.hasAlpha; | - |
3572 | default: | - |
3573 | break; executed: break; Execution Count:18856 | 18856 |
3574 | } | - |
3575 | | - |
3576 | op.mode = data->rasterBuffer->compositionMode; | - |
3577 | if (op.mode == QPainter::CompositionMode_SourceOver && solidSource) evaluated: op.mode == QPainter::CompositionMode_SourceOver yes Evaluation Count:145114 | yes Evaluation Count:100932 |
evaluated: solidSource yes Evaluation Count:120468 | yes Evaluation Count:24646 |
| 24646-145114 |
3578 | op.mode = QPainter::CompositionMode_Source; executed: op.mode = QPainter::CompositionMode_Source; Execution Count:120468 | 120468 |
3579 | | - |
3580 | op.dest_fetch = destFetchProc[data->rasterBuffer->format]; | - |
3581 | if (op.mode == QPainter::CompositionMode_Source) { evaluated: op.mode == QPainter::CompositionMode_Source yes Evaluation Count:121384 | yes Evaluation Count:124662 |
| 121384-124662 |
3582 | switch (data->rasterBuffer->format) { | - |
3583 | case QImage::Format_RGB32: | - |
3584 | case QImage::Format_ARGB32_Premultiplied: | - |
3585 | | - |
3586 | break; executed: break; Execution Count:118069 | 118069 |
3587 | default: { | - |
3588 | if (data->type == QSpanData::Texture && data->texture.const_alpha != 256) evaluated: data->type == QSpanData::Texture yes Evaluation Count:451 | yes Evaluation Count:2862 |
partially evaluated: data->texture.const_alpha != 256 no Evaluation Count:0 | yes Evaluation Count:451 |
| 0-2862 |
3589 | break; | 0 |
3590 | const QSpan *lastSpan = spans + spanCount; | - |
3591 | bool alphaSpans = false; | - |
3592 | while (spans < lastSpan) { evaluated: spans < lastSpan yes Evaluation Count:166262 | yes Evaluation Count:2930 |
| 2930-166262 |
3593 | if (spans->coverage != 255) { evaluated: spans->coverage != 255 yes Evaluation Count:383 | yes Evaluation Count:165879 |
| 383-165879 |
3594 | alphaSpans = true; | - |
3595 | break; executed: break; Execution Count:383 | 383 |
3596 | } | - |
3597 | ++spans; | - |
3598 | } executed: } Execution Count:165879 | 165879 |
3599 | if (!alphaSpans) evaluated: !alphaSpans yes Evaluation Count:2930 | yes Evaluation Count:383 |
| 383-2930 |
3600 | op.dest_fetch = 0; executed: op.dest_fetch = 0; Execution Count:2930 | 2930 |
3601 | } | - |
3602 | } executed: } Execution Count:3313 | 3313 |
3603 | } executed: } Execution Count:121381 | 121381 |
3604 | | - |
3605 | op.dest_store = destStoreProc[data->rasterBuffer->format]; | - |
3606 | | - |
3607 | op.funcSolid = functionForModeSolid[op.mode]; | - |
3608 | op.func = functionForMode[op.mode]; | - |
3609 | | - |
3610 | return op; executed: return op; Execution Count:246044 | 246044 |
3611 | } | - |
3612 | | - |
3613 | | - |
3614 | | - |
3615 | | - |
3616 | | - |
3617 | | - |
3618 | static | - |
3619 | | - |
3620 | void blend_color_generic(int count, const QSpan *spans, void *userData) | - |
3621 | { | - |
3622 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - |
3623 | uint buffer[buffer_size]; | - |
3624 | Operator op = getOperator(data, spans, count); | - |
3625 | | - |
3626 | while (count--) { evaluated: count-- yes Evaluation Count:226886 | yes Evaluation Count:2367 |
| 2367-226886 |
3627 | int x = spans->x; | - |
3628 | int length = spans->len; | - |
3629 | while (length) { evaluated: length yes Evaluation Count:226886 | yes Evaluation Count:226886 |
| 226886 |
3630 | int l = qMin(buffer_size, length); | - |
3631 | uint *dest = op.dest_fetch ? op.dest_fetch(buffer, data->rasterBuffer, x, spans->y, l) : buffer; evaluated: op.dest_fetch yes Evaluation Count:98089 | yes Evaluation Count:128797 |
| 98089-128797 |
3632 | op.funcSolid(dest, l, data->solid.color, spans->coverage); | - |
3633 | if (op.dest_store) partially evaluated: op.dest_store yes Evaluation Count:226886 | no Evaluation Count:0 |
| 0-226886 |
3634 | op.dest_store(data->rasterBuffer, x, spans->y, dest, l); executed: op.dest_store(data->rasterBuffer, x, spans->y, dest, l); Execution Count:226886 | 226886 |
3635 | length -= l; | - |
3636 | x += l; | - |
3637 | } executed: } Execution Count:226886 | 226886 |
3638 | ++spans; | - |
3639 | } executed: } Execution Count:226886 | 226886 |
3640 | } executed: } Execution Count:2367 | 2367 |
3641 | | - |
3642 | static void blend_color_argb(int count, const QSpan *spans, void *userData) | - |
3643 | { | - |
3644 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - |
3645 | | - |
3646 | Operator op = getOperator(data, spans, count); | - |
3647 | | - |
3648 | if (op.mode == QPainter::CompositionMode_Source) { evaluated: op.mode == QPainter::CompositionMode_Source yes Evaluation Count:101907 | yes Evaluation Count:105849 |
| 101907-105849 |
3649 | | - |
3650 | while (count--) { evaluated: count-- yes Evaluation Count:627915 | yes Evaluation Count:101907 |
| 101907-627915 |
3651 | uint *target = ((uint *)data->rasterBuffer->scanLine(spans->y)) + spans->x; | - |
3652 | if (spans->coverage == 255) { evaluated: spans->coverage == 255 yes Evaluation Count:606370 | yes Evaluation Count:21545 |
| 21545-606370 |
3653 | qt_memfill<quint32>(target, data->solid.color, spans->len);; | - |
3654 | } else { executed: } Execution Count:606370 | 606370 |
3655 | uint c = BYTE_MUL(data->solid.color, spans->coverage); | - |
3656 | int ialpha = 255 - spans->coverage; | - |
3657 | for (int i = 0; i < spans->len; ++i) evaluated: i < spans->len yes Evaluation Count:22533 | yes Evaluation Count:21545 |
| 21545-22533 |
3658 | target[i] = c + BYTE_MUL(target[i], ialpha); executed: target[i] = c + BYTE_MUL(target[i], ialpha); Execution Count:22533 | 22533 |
3659 | } executed: } Execution Count:21545 | 21545 |
3660 | ++spans; | - |
3661 | } executed: } Execution Count:627915 | 627915 |
3662 | return; executed: return; Execution Count:101907 | 101907 |
3663 | } | - |
3664 | | - |
3665 | while (count--) { evaluated: count-- yes Evaluation Count:2597941 | yes Evaluation Count:105849 |
| 105849-2597941 |
3666 | uint *target = ((uint *)data->rasterBuffer->scanLine(spans->y)) + spans->x; | - |
3667 | op.funcSolid(target, spans->len, data->solid.color, spans->coverage); | - |
3668 | ++spans; | - |
3669 | } executed: } Execution Count:2597941 | 2597941 |
3670 | } executed: } Execution Count:105849 | 105849 |
3671 | | - |
3672 | static void blend_color_rgb16(int count, const QSpan *spans, void *userData) | - |
3673 | { | - |
3674 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - |
3675 | | - |
3676 | | - |
3677 | | - |
3678 | | - |
3679 | | - |
3680 | | - |
3681 | QPainter::CompositionMode mode = data->rasterBuffer->compositionMode; | - |
3682 | if (mode == QPainter::CompositionMode_SourceOver && evaluated: mode == QPainter::CompositionMode_SourceOver yes Evaluation Count:163504 | yes Evaluation Count:4 |
| 4-163504 |
3683 | qAlpha(data->solid.color) == 255) evaluated: qAlpha(data->solid.color) == 255 yes Evaluation Count:160161 | yes Evaluation Count:3343 |
| 3343-160161 |
3684 | mode = QPainter::CompositionMode_Source; executed: mode = QPainter::CompositionMode_Source; Execution Count:160161 | 160161 |
3685 | | - |
3686 | if (mode == QPainter::CompositionMode_Source) { evaluated: mode == QPainter::CompositionMode_Source yes Evaluation Count:160165 | yes Evaluation Count:3343 |
| 3343-160165 |
3687 | | - |
3688 | ushort c = qConvertRgb32To16(data->solid.color); | - |
3689 | while (count--) { evaluated: count-- yes Evaluation Count:6836175 | yes Evaluation Count:160165 |
| 160165-6836175 |
3690 | ushort *target = ((ushort *)data->rasterBuffer->scanLine(spans->y)) + spans->x; | - |
3691 | if (spans->coverage == 255) { evaluated: spans->coverage == 255 yes Evaluation Count:6646451 | yes Evaluation Count:189724 |
| 189724-6646451 |
3692 | qt_memfill<quint16>(target, c, spans->len);; | - |
3693 | } else { executed: } Execution Count:6646451 | 6646451 |
3694 | ushort color = BYTE_MUL_RGB16(c, spans->coverage); | - |
3695 | int ialpha = 255 - spans->coverage; | - |
3696 | const ushort *end = target + spans->len; | - |
3697 | while (target < end) { evaluated: target < end yes Evaluation Count:221344 | yes Evaluation Count:189724 |
| 189724-221344 |
3698 | *target = color + BYTE_MUL_RGB16(*target, ialpha); | - |
3699 | ++target; | - |
3700 | } executed: } Execution Count:221344 | 221344 |
3701 | } executed: } Execution Count:189724 | 189724 |
3702 | ++spans; | - |
3703 | } executed: } Execution Count:6836175 | 6836175 |
3704 | return; executed: return; Execution Count:160165 | 160165 |
3705 | } | - |
3706 | | - |
3707 | if (mode == QPainter::CompositionMode_SourceOver) { partially evaluated: mode == QPainter::CompositionMode_SourceOver yes Evaluation Count:3343 | no Evaluation Count:0 |
| 0-3343 |
3708 | while (count--) { evaluated: count-- yes Evaluation Count:108761 | yes Evaluation Count:3343 |
| 3343-108761 |
3709 | uint color = BYTE_MUL(data->solid.color, spans->coverage); | - |
3710 | int ialpha = qAlpha(~color); | - |
3711 | ushort c = qConvertRgb32To16(color); | - |
3712 | ushort *target = ((ushort *)data->rasterBuffer->scanLine(spans->y)) + spans->x; | - |
3713 | int len = spans->len; | - |
3714 | bool pre = (((quintptr)target) & 0x3) != 0; | - |
3715 | bool post = false; | - |
3716 | if (pre) { evaluated: pre yes Evaluation Count:54523 | yes Evaluation Count:54238 |
| 54238-54523 |
3717 | | - |
3718 | *target = c + BYTE_MUL_RGB16(*target, ialpha); | - |
3719 | ++target; | - |
3720 | --len; | - |
3721 | } executed: } Execution Count:54523 | 54523 |
3722 | if (len & 0x1) { evaluated: len & 0x1 yes Evaluation Count:54363 | yes Evaluation Count:54398 |
| 54363-54398 |
3723 | post = true; | - |
3724 | --len; | - |
3725 | } executed: } Execution Count:54363 | 54363 |
3726 | uint *target32 = (uint*)target; | - |
3727 | uint c32 = c | (c<<16); | - |
3728 | len >>= 1; | - |
3729 | uint salpha = (ialpha+1) >> 3; | - |
3730 | while (len--) { evaluated: len-- yes Evaluation Count:84942 | yes Evaluation Count:108761 |
| 84942-108761 |
3731 | | - |
3732 | *target32 = c32 + BYTE_MUL_RGB16_32(*target32, salpha); | - |
3733 | ++target32; | - |
3734 | target += 2; | - |
3735 | } executed: } Execution Count:84942 | 84942 |
3736 | if (post) { evaluated: post yes Evaluation Count:54363 | yes Evaluation Count:54398 |
| 54363-54398 |
3737 | | - |
3738 | *target = c + BYTE_MUL_RGB16(*target, ialpha); | - |
3739 | } executed: } Execution Count:54363 | 54363 |
3740 | ++spans; | - |
3741 | } executed: } Execution Count:108761 | 108761 |
3742 | return; executed: return; Execution Count:3343 | 3343 |
3743 | } | - |
3744 | | - |
3745 | blend_color_generic(count, spans, userData); | - |
3746 | } | 0 |
3747 | | - |
3748 | template <typename T> | - |
3749 | void handleSpans(int count, const QSpan *spans, const QSpanData *data, T &handler) | - |
3750 | { | - |
3751 | uint const_alpha = 256; | - |
3752 | if (data->type == QSpanData::Texture) evaluated: data->type == QSpanData::Texture yes Evaluation Count:30 | yes Evaluation Count:17051 |
| 30-17051 |
3753 | const_alpha = data->texture.const_alpha; executed: const_alpha = data->texture.const_alpha; Execution Count:30 | 30 |
3754 | | - |
3755 | int coverage = 0; | - |
3756 | while (count) { evaluated: count yes Evaluation Count:74634 | yes Evaluation Count:17091 |
| 17091-74634 |
3757 | int x = spans->x; | - |
3758 | const int y = spans->y; | - |
3759 | int right = x + spans->len; | - |
3760 | | - |
3761 | | - |
3762 | for (int i = 1; i < count && spans[i].y == y && spans[i].x == right; ++i) evaluated: i < count yes Evaluation Count:64582 | yes Evaluation Count:17089 |
evaluated: spans[i].y == y yes Evaluation Count:7037 | yes Evaluation Count:57545 |
partially evaluated: spans[i].x == right yes Evaluation Count:7037 | no Evaluation Count:0 |
| 0-64582 |
3763 | right += spans[i].len; executed: right += spans[i].len; Execution Count:7037 | 7037 |
3764 | int length = right - x; | - |
3765 | | - |
3766 | while (length) { evaluated: length yes Evaluation Count:74634 | yes Evaluation Count:74632 |
| 74632-74634 |
3767 | int l = qMin(buffer_size, length); | - |
3768 | length -= l; | - |
3769 | | - |
3770 | int process_length = l; | - |
3771 | int process_x = x; | - |
3772 | | - |
3773 | const uint *src = handler.fetch(process_x, y, process_length); | - |
3774 | int offset = 0; | - |
3775 | while (l > 0) { evaluated: l > 0 yes Evaluation Count:81670 | yes Evaluation Count:74633 |
| 74633-81670 |
3776 | if (x == spans->x) partially evaluated: x == spans->x yes Evaluation Count:81670 | no Evaluation Count:0 |
| 0-81670 |
3777 | coverage = (spans->coverage * const_alpha) >> 8; executed: coverage = (spans->coverage * const_alpha) >> 8; Execution Count:81670 | 81670 |
3778 | | - |
3779 | int right = spans->x + spans->len; | - |
3780 | int len = qMin(l, right - x); | - |
3781 | | - |
3782 | handler.process(x, y, len, coverage, src, offset); | - |
3783 | | - |
3784 | l -= len; | - |
3785 | x += len; | - |
3786 | offset += len; | - |
3787 | | - |
3788 | if (x == right) { partially evaluated: x == right yes Evaluation Count:81667 | no Evaluation Count:0 |
| 0-81667 |
3789 | ++spans; | - |
3790 | --count; | - |
3791 | } executed: } Execution Count:81670 | 81670 |
3792 | } executed: } Execution Count:81670 | 81670 |
3793 | handler.store(process_x, y, process_length); | - |
3794 | } executed: } Execution Count:74631 | 74631 |
3795 | } executed: } Execution Count:74636 | 74636 |
3796 | } executed: } Execution Count:17092 | 17092 |
3797 | | - |
3798 | struct QBlendBase | - |
3799 | { | - |
3800 | QBlendBase(QSpanData *d, Operator o) | - |
3801 | : data(d) | - |
3802 | , op(o) | - |
3803 | , dest(0) | - |
3804 | { | - |
3805 | } executed: } Execution Count:17076 | 17076 |
3806 | | - |
3807 | QSpanData *data; | - |
3808 | Operator op; | - |
3809 | | - |
3810 | uint *dest; | - |
3811 | | - |
3812 | uint buffer[buffer_size]; | - |
3813 | uint src_buffer[buffer_size]; | - |
3814 | }; | - |
3815 | | - |
3816 | class BlendSrcGeneric : public QBlendBase | - |
3817 | { | - |
3818 | public: | - |
3819 | BlendSrcGeneric(QSpanData *d, Operator o) | - |
3820 | : QBlendBase(d, o) | - |
3821 | { | - |
3822 | } executed: } Execution Count:17075 | 17075 |
3823 | | - |
3824 | const uint *fetch(int x, int y, int len) | - |
3825 | { | - |
3826 | dest = op.dest_fetch ? op.dest_fetch(buffer, data->rasterBuffer, x, y, len) : buffer; evaluated: op.dest_fetch yes Evaluation Count:49451 | yes Evaluation Count:25187 |
| 25187-49451 |
3827 | return op.src_fetch(src_buffer, &op, data, y, x, len); executed: return op.src_fetch(src_buffer, &op, data, y, x, len); Execution Count:74637 | 74637 |
3828 | } | - |
3829 | | - |
3830 | void process(int, int, int len, int coverage, const uint *src, int offset) | - |
3831 | { | - |
3832 | op.func(dest + offset, src + offset, len, coverage); | - |
3833 | } executed: } Execution Count:81668 | 81668 |
3834 | | - |
3835 | void store(int x, int y, int len) | - |
3836 | { | - |
3837 | if (op.dest_store) evaluated: op.dest_store yes Evaluation Count:52927 | yes Evaluation Count:21706 |
| 21706-52927 |
3838 | op.dest_store(data->rasterBuffer, x, y, dest, len); executed: op.dest_store(data->rasterBuffer, x, y, dest, len); Execution Count:52927 | 52927 |
3839 | } executed: } Execution Count:74632 | 74632 |
3840 | }; | - |
3841 | | - |
3842 | static void blend_src_generic(int count, const QSpan *spans, void *userData) | - |
3843 | { | - |
3844 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - |
3845 | BlendSrcGeneric blend(data, getOperator(data, spans, count)); | - |
3846 | handleSpans(count, spans, data, blend); | - |
3847 | } executed: } Execution Count:17092 | 17092 |
3848 | | - |
3849 | static void blend_untransformed_generic(int count, const QSpan *spans, void *userData) | - |
3850 | { | - |
3851 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - |
3852 | | - |
3853 | uint buffer[buffer_size]; | - |
3854 | uint src_buffer[buffer_size]; | - |
3855 | Operator op = getOperator(data, spans, count); | - |
3856 | | - |
3857 | const int image_width = data->texture.width; | - |
3858 | const int image_height = data->texture.height; | - |
3859 | int xoff = -qRound(-data->dx); | - |
3860 | int yoff = -qRound(-data->dy); | - |
3861 | | - |
3862 | while (count--) { evaluated: count-- yes Evaluation Count:39944 | yes Evaluation Count:1216 |
| 1216-39944 |
3863 | int x = spans->x; | - |
3864 | int length = spans->len; | - |
3865 | int sx = xoff + x; | - |
3866 | int sy = yoff + spans->y; | - |
3867 | if (sy >= 0 && sy < image_height && sx < image_width) { partially evaluated: sy >= 0 yes Evaluation Count:39944 | no Evaluation Count:0 |
partially evaluated: sy < image_height yes Evaluation Count:39944 | no Evaluation Count:0 |
partially evaluated: sx < image_width yes Evaluation Count:39944 | no Evaluation Count:0 |
| 0-39944 |
3868 | if (sx < 0) { partially evaluated: sx < 0 no Evaluation Count:0 | yes Evaluation Count:39944 |
| 0-39944 |
3869 | x -= sx; | - |
3870 | length += sx; | - |
3871 | sx = 0; | - |
3872 | } | 0 |
3873 | if (sx + length > image_width) partially evaluated: sx + length > image_width no Evaluation Count:0 | yes Evaluation Count:39944 |
| 0-39944 |
3874 | length = image_width - sx; never executed: length = image_width - sx; | 0 |
3875 | if (length > 0) { partially evaluated: length > 0 yes Evaluation Count:39944 | no Evaluation Count:0 |
| 0-39944 |
3876 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - |
3877 | while (length) { evaluated: length yes Evaluation Count:39944 | yes Evaluation Count:39944 |
| 39944 |
3878 | int l = qMin(buffer_size, length); | - |
3879 | const uint *src = op.src_fetch(src_buffer, &op, data, sy, sx, l); | - |
3880 | uint *dest = op.dest_fetch ? op.dest_fetch(buffer, data->rasterBuffer, x, spans->y, l) : buffer; evaluated: op.dest_fetch yes Evaluation Count:30056 | yes Evaluation Count:9888 |
| 9888-30056 |
3881 | op.func(dest, src, l, coverage); | - |
3882 | if (op.dest_store) evaluated: op.dest_store yes Evaluation Count:30918 | yes Evaluation Count:9026 |
| 9026-30918 |
3883 | op.dest_store(data->rasterBuffer, x, spans->y, dest, l); executed: op.dest_store(data->rasterBuffer, x, spans->y, dest, l); Execution Count:30918 | 30918 |
3884 | x += l; | - |
3885 | sx += l; | - |
3886 | length -= l; | - |
3887 | } executed: } Execution Count:39944 | 39944 |
3888 | } executed: } Execution Count:39944 | 39944 |
3889 | } executed: } Execution Count:39944 | 39944 |
3890 | ++spans; | - |
3891 | } executed: } Execution Count:39944 | 39944 |
3892 | } executed: } Execution Count:1216 | 1216 |
3893 | | - |
3894 | static void blend_untransformed_argb(int count, const QSpan *spans, void *userData) | - |
3895 | { | - |
3896 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - |
3897 | if (data->texture.format != QImage::Format_ARGB32_Premultiplied evaluated: data->texture.format != QImage::Format_ARGB32_Premultiplied yes Evaluation Count:64 | yes Evaluation Count:27 |
| 27-64 |
3898 | && data->texture.format != QImage::Format_RGB32) { partially evaluated: data->texture.format != QImage::Format_RGB32 yes Evaluation Count:64 | no Evaluation Count:0 |
| 0-64 |
3899 | blend_untransformed_generic(count, spans, userData); | - |
3900 | return; executed: return; Execution Count:64 | 64 |
3901 | } | - |
3902 | | - |
3903 | Operator op = getOperator(data, spans, count); | - |
3904 | | - |
3905 | const int image_width = data->texture.width; | - |
3906 | const int image_height = data->texture.height; | - |
3907 | int xoff = -qRound(-data->dx); | - |
3908 | int yoff = -qRound(-data->dy); | - |
3909 | | - |
3910 | while (count--) { evaluated: count-- yes Evaluation Count:5198 | yes Evaluation Count:27 |
| 27-5198 |
3911 | int x = spans->x; | - |
3912 | int length = spans->len; | - |
3913 | int sx = xoff + x; | - |
3914 | int sy = yoff + spans->y; | - |
3915 | if (sy >= 0 && sy < image_height && sx < image_width) { partially evaluated: sy >= 0 yes Evaluation Count:5198 | no Evaluation Count:0 |
partially evaluated: sy < image_height yes Evaluation Count:5198 | no Evaluation Count:0 |
partially evaluated: sx < image_width yes Evaluation Count:5198 | no Evaluation Count:0 |
| 0-5198 |
3916 | if (sx < 0) { partially evaluated: sx < 0 no Evaluation Count:0 | yes Evaluation Count:5198 |
| 0-5198 |
3917 | x -= sx; | - |
3918 | length += sx; | - |
3919 | sx = 0; | - |
3920 | } | 0 |
3921 | if (sx + length > image_width) partially evaluated: sx + length > image_width no Evaluation Count:0 | yes Evaluation Count:5198 |
| 0-5198 |
3922 | length = image_width - sx; never executed: length = image_width - sx; | 0 |
3923 | if (length > 0) { partially evaluated: length > 0 yes Evaluation Count:5198 | no Evaluation Count:0 |
| 0-5198 |
3924 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - |
3925 | const uint *src = (uint *)data->texture.scanLine(sy) + sx; | - |
3926 | uint *dest = ((uint *)data->rasterBuffer->scanLine(spans->y)) + x; | - |
3927 | op.func(dest, src, length, coverage); | - |
3928 | } executed: } Execution Count:5198 | 5198 |
3929 | } executed: } Execution Count:5198 | 5198 |
3930 | ++spans; | - |
3931 | } executed: } Execution Count:5198 | 5198 |
3932 | } executed: } Execution Count:27 | 27 |
3933 | | - |
3934 | static inline quint16 interpolate_pixel_rgb16_255(quint16 x, quint8 a, | - |
3935 | quint16 y, quint8 b) | - |
3936 | { | - |
3937 | quint16 t = ((((x & 0x07e0) * a) + ((y & 0x07e0) * b)) >> 5) & 0x07e0; | - |
3938 | t |= ((((x & 0xf81f) * a) + ((y & 0xf81f) * b)) >> 5) & 0xf81f; | - |
3939 | | - |
3940 | return t; executed: return t; Execution Count:1280 | 1280 |
3941 | } | - |
3942 | | - |
3943 | static inline quint32 interpolate_pixel_rgb16x2_255(quint32 x, quint8 a, | - |
3944 | quint32 y, quint8 b) | - |
3945 | { | - |
3946 | uint t; | - |
3947 | t = ((((x & 0xf81f07e0) >> 5) * a) + (((y & 0xf81f07e0) >> 5) * b)) & 0xf81f07e0; | - |
3948 | t |= ((((x & 0x07e0f81f) * a) + ((y & 0x07e0f81f) * b)) >> 5) & 0x07e0f81f; | - |
3949 | return t; executed: return t; Execution Count:39680 | 39680 |
3950 | } | - |
3951 | | - |
3952 | static inline void blend_sourceOver_rgb16_rgb16(quint16 *__restrict__ dest, | - |
3953 | const quint16 *__restrict__ src, | - |
3954 | int length, | - |
3955 | const quint8 alpha, | - |
3956 | const quint8 ialpha) | - |
3957 | { | - |
3958 | const int dstAlign = ((quintptr)dest) & 0x3; | - |
3959 | if (dstAlign) { evaluated: dstAlign yes Evaluation Count:640 | yes Evaluation Count:640 |
| 640 |
3960 | *dest = interpolate_pixel_rgb16_255(*src, alpha, *dest, ialpha); | - |
3961 | ++dest; | - |
3962 | ++src; | - |
3963 | --length; | - |
3964 | } executed: } Execution Count:640 | 640 |
3965 | const int srcAlign = ((quintptr)src) & 0x3; | - |
3966 | int length32 = length >> 1; | - |
3967 | if (length32 && srcAlign == 0) { partially evaluated: length32 yes Evaluation Count:1280 | no Evaluation Count:0 |
partially evaluated: srcAlign == 0 yes Evaluation Count:1280 | no Evaluation Count:0 |
| 0-1280 |
3968 | while (length32--) { evaluated: length32-- yes Evaluation Count:39680 | yes Evaluation Count:1280 |
| 1280-39680 |
3969 | const quint32 *src32 = reinterpret_cast<const quint32*>(src); | - |
3970 | quint32 *dest32 = reinterpret_cast<quint32*>(dest); | - |
3971 | *dest32 = interpolate_pixel_rgb16x2_255(*src32, alpha, | - |
3972 | *dest32, ialpha); | - |
3973 | dest += 2; | - |
3974 | src += 2; | - |
3975 | } executed: } Execution Count:39680 | 39680 |
3976 | length &= 0x1; | - |
3977 | } executed: } Execution Count:1280 | 1280 |
3978 | while (length--) { evaluated: length-- yes Evaluation Count:640 | yes Evaluation Count:1280 |
| 640-1280 |
3979 | *dest = interpolate_pixel_rgb16_255(*src, alpha, *dest, ialpha); | - |
3980 | ++dest; | - |
3981 | ++src; | - |
3982 | } executed: } Execution Count:640 | 640 |
3983 | } executed: } Execution Count:1280 | 1280 |
3984 | | - |
3985 | static void blend_untransformed_rgb565(int count, const QSpan *spans, void *userData) | - |
3986 | { | - |
3987 | QSpanData *data = reinterpret_cast<QSpanData*>(userData); | - |
3988 | QPainter::CompositionMode mode = data->rasterBuffer->compositionMode; | - |
3989 | | - |
3990 | if (data->texture.format != QImage::Format_RGB16 partially evaluated: data->texture.format != QImage::Format_RGB16 yes Evaluation Count:175 | no Evaluation Count:0 |
| 0-175 |
3991 | || (mode != QPainter::CompositionMode_SourceOver never evaluated: mode != QPainter::CompositionMode_SourceOver | 0 |
3992 | && mode != QPainter::CompositionMode_Source)) never evaluated: mode != QPainter::CompositionMode_Source | 0 |
3993 | { | - |
3994 | blend_untransformed_generic(count, spans, userData); | - |
3995 | return; executed: return; Execution Count:175 | 175 |
3996 | } | - |
3997 | | - |
3998 | const int image_width = data->texture.width; | - |
3999 | const int image_height = data->texture.height; | - |
4000 | int xoff = -qRound(-data->dx); | - |
4001 | int yoff = -qRound(-data->dy); | - |
4002 | | - |
4003 | while (count--) { | 0 |
4004 | const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8; | - |
4005 | if (coverage == 0) { never evaluated: coverage == 0 | 0 |
4006 | ++spans; | - |
4007 | continue; never executed: continue; | 0 |
4008 | } | - |
4009 | | - |
4010 | int x = spans->x; | - |
4011 | int length = spans->len; | - |
4012 | int sx = xoff + x; | - |
4013 | int sy = yoff + spans->y; | - |
4014 | if (sy >= 0 && sy < image_height && sx < image_width) { never evaluated: sy < image_height never evaluated: sx < image_width | 0 |
4015 | if (sx < 0) { | 0 |
4016 | x -= sx; | - |
4017 | length += sx; | - |
4018 | sx = 0; | - |
4019 | } | 0 |
4020 | if (sx + length > image_width) never evaluated: sx + length > image_width | 0 |
4021 | length = image_width - sx; never executed: length = image_width - sx; | 0 |
4022 | if (length > 0) { never evaluated: length > 0 | 0 |
4023 | quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + x; | - |
4024 | const quint16 *src = (quint16 *)data->texture.scanLine(sy) + sx; | - |
4025 | if (coverage == 255) { never evaluated: coverage == 255 | 0 |
4026 | memcpy(dest, src, length * sizeof(quint16)); | - |
4027 | } else { | 0 |
4028 | const quint8 alpha = (coverage + 1) >> 3; | - |
4029 | const quint8 ialpha = 0x20 - alpha; | - |
4030 | if (alpha > 0) never evaluated: alpha > 0 | 0 |
4031 | blend_sourceOver_rgb16_rgb16(dest, src, length, alpha, ialpha); never executed: blend_sourceOver_rgb16_rgb16(dest, src, length, alpha, ialpha); | 0 |
4032 | } | 0 |
4033 | } | - |
4034 | } | 0 |
4035 | ++spans; | - |
4036 | } | 0 |
4037 | } | 0 |
4038 | | - |
4039 | static void blend_tiled_generic(int count, const QSpan *spans, void *userData) | - |
4040 | { | - |
4041 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - |
4042 | | - |
4043 | uint buffer[buffer_size]; | - |
4044 | uint src_buffer[buffer_size]; | - |
4045 | Operator op = getOperator(data, spans, count); | - |
4046 | | - |
4047 | const int image_width = data->texture.width; | - |
4048 | const int image_height = data->texture.height; | - |
4049 | int xoff = -qRound(-data->dx) % image_width; | - |
4050 | int yoff = -qRound(-data->dy) % image_height; | - |
4051 | | - |
4052 | if (xoff < 0) evaluated: xoff < 0 yes Evaluation Count:14282 | yes Evaluation Count:1843 |
| 1843-14282 |
4053 | xoff += image_width; executed: xoff += image_width; Execution Count:14282 | 14282 |
4054 | if (yoff < 0) evaluated: yoff < 0 yes Evaluation Count:14532 | yes Evaluation Count:1593 |
| 1593-14532 |
4055 | yoff += image_height; executed: yoff += image_height; Execution Count:14532 | 14532 |
4056 | | - |
4057 | while (count--) { evaluated: count-- yes Evaluation Count:418116 | yes Evaluation Count:16125 |
| 16125-418116 |
4058 | int x = spans->x; | - |
4059 | int length = spans->len; | - |
4060 | int sx = (xoff + spans->x) % image_width; | - |
4061 | int sy = (spans->y + yoff) % image_height; | - |
4062 | if (sx < 0) partially evaluated: sx < 0 no Evaluation Count:0 | yes Evaluation Count:418116 |
| 0-418116 |
4063 | sx += image_width; never executed: sx += image_width; | 0 |
4064 | if (sy < 0) partially evaluated: sy < 0 no Evaluation Count:0 | yes Evaluation Count:418116 |
| 0-418116 |
4065 | sy += image_height; never executed: sy += image_height; | 0 |
4066 | | - |
4067 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - |
4068 | while (length) { evaluated: length yes Evaluation Count:1129687 | yes Evaluation Count:418116 |
| 418116-1129687 |
4069 | int l = qMin(image_width - sx, length); | - |
4070 | if (buffer_size < l) partially evaluated: buffer_size < l no Evaluation Count:0 | yes Evaluation Count:1129687 |
| 0-1129687 |
4071 | l = buffer_size; never executed: l = buffer_size; | 0 |
4072 | const uint *src = op.src_fetch(src_buffer, &op, data, sy, sx, l); | - |
4073 | uint *dest = op.dest_fetch ? op.dest_fetch(buffer, data->rasterBuffer, x, spans->y, l) : buffer; evaluated: op.dest_fetch yes Evaluation Count:1126250 | yes Evaluation Count:3437 |
| 3437-1126250 |
4074 | op.func(dest, src, l, coverage); | - |
4075 | if (op.dest_store) evaluated: op.dest_store yes Evaluation Count:1046462 | yes Evaluation Count:83225 |
| 83225-1046462 |
4076 | op.dest_store(data->rasterBuffer, x, spans->y, dest, l); executed: op.dest_store(data->rasterBuffer, x, spans->y, dest, l); Execution Count:1046462 | 1046462 |
4077 | x += l; | - |
4078 | sx += l; | - |
4079 | length -= l; | - |
4080 | if (sx >= image_width) evaluated: sx >= image_width yes Evaluation Count:896108 | yes Evaluation Count:233579 |
| 233579-896108 |
4081 | sx = 0; executed: sx = 0; Execution Count:896108 | 896108 |
4082 | } executed: } Execution Count:1129687 | 1129687 |
4083 | ++spans; | - |
4084 | } executed: } Execution Count:418116 | 418116 |
4085 | } executed: } Execution Count:16125 | 16125 |
4086 | | - |
4087 | static void blend_tiled_argb(int count, const QSpan *spans, void *userData) | - |
4088 | { | - |
4089 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - |
4090 | if (data->texture.format != QImage::Format_ARGB32_Premultiplied evaluated: data->texture.format != QImage::Format_ARGB32_Premultiplied yes Evaluation Count:1 | yes Evaluation Count:1457 |
| 1-1457 |
4091 | && data->texture.format != QImage::Format_RGB32) { partially evaluated: data->texture.format != QImage::Format_RGB32 no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
4092 | blend_tiled_generic(count, spans, userData); | - |
4093 | return; | 0 |
4094 | } | - |
4095 | | - |
4096 | Operator op = getOperator(data, spans, count); | - |
4097 | | - |
4098 | int image_width = data->texture.width; | - |
4099 | int image_height = data->texture.height; | - |
4100 | int xoff = -qRound(-data->dx) % image_width; | - |
4101 | int yoff = -qRound(-data->dy) % image_height; | - |
4102 | | - |
4103 | if (xoff < 0) partially evaluated: xoff < 0 no Evaluation Count:0 | yes Evaluation Count:1458 |
| 0-1458 |
4104 | xoff += image_width; never executed: xoff += image_width; | 0 |
4105 | if (yoff < 0) partially evaluated: yoff < 0 no Evaluation Count:0 | yes Evaluation Count:1458 |
| 0-1458 |
4106 | yoff += image_height; never executed: yoff += image_height; | 0 |
4107 | | - |
4108 | while (count--) { evaluated: count-- yes Evaluation Count:9299 | yes Evaluation Count:1458 |
| 1458-9299 |
4109 | int x = spans->x; | - |
4110 | int length = spans->len; | - |
4111 | int sx = (xoff + spans->x) % image_width; | - |
4112 | int sy = (spans->y + yoff) % image_height; | - |
4113 | if (sx < 0) partially evaluated: sx < 0 no Evaluation Count:0 | yes Evaluation Count:9299 |
| 0-9299 |
4114 | sx += image_width; never executed: sx += image_width; | 0 |
4115 | if (sy < 0) partially evaluated: sy < 0 no Evaluation Count:0 | yes Evaluation Count:9299 |
| 0-9299 |
4116 | sy += image_height; never executed: sy += image_height; | 0 |
4117 | | - |
4118 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - |
4119 | while (length) { evaluated: length yes Evaluation Count:10522 | yes Evaluation Count:9299 |
| 9299-10522 |
4120 | int l = qMin(image_width - sx, length); | - |
4121 | if (buffer_size < l) partially evaluated: buffer_size < l no Evaluation Count:0 | yes Evaluation Count:10522 |
| 0-10522 |
4122 | l = buffer_size; never executed: l = buffer_size; | 0 |
4123 | const uint *src = (uint *)data->texture.scanLine(sy) + sx; | - |
4124 | uint *dest = ((uint *)data->rasterBuffer->scanLine(spans->y)) + x; | - |
4125 | op.func(dest, src, l, coverage); | - |
4126 | x += l; | - |
4127 | length -= l; | - |
4128 | sx = 0; | - |
4129 | } executed: } Execution Count:10522 | 10522 |
4130 | ++spans; | - |
4131 | } executed: } Execution Count:9299 | 9299 |
4132 | } executed: } Execution Count:1458 | 1458 |
4133 | | - |
4134 | static void blend_tiled_rgb565(int count, const QSpan *spans, void *userData) | - |
4135 | { | - |
4136 | QSpanData *data = reinterpret_cast<QSpanData*>(userData); | - |
4137 | QPainter::CompositionMode mode = data->rasterBuffer->compositionMode; | - |
4138 | | - |
4139 | if (data->texture.format != QImage::Format_RGB16 evaluated: data->texture.format != QImage::Format_RGB16 yes Evaluation Count:15927 | yes Evaluation Count:8 |
| 8-15927 |
4140 | || (mode != QPainter::CompositionMode_SourceOver partially evaluated: mode != QPainter::CompositionMode_SourceOver no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
4141 | && mode != QPainter::CompositionMode_Source)) never evaluated: mode != QPainter::CompositionMode_Source | 0 |
4142 | { | - |
4143 | blend_tiled_generic(count, spans, userData); | - |
4144 | return; executed: return; Execution Count:15927 | 15927 |
4145 | } | - |
4146 | | - |
4147 | const int image_width = data->texture.width; | - |
4148 | const int image_height = data->texture.height; | - |
4149 | int xoff = -qRound(-data->dx) % image_width; | - |
4150 | int yoff = -qRound(-data->dy) % image_height; | - |
4151 | | - |
4152 | if (xoff < 0) partially evaluated: xoff < 0 no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
4153 | xoff += image_width; never executed: xoff += image_width; | 0 |
4154 | if (yoff < 0) partially evaluated: yoff < 0 no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
4155 | yoff += image_height; never executed: yoff += image_height; | 0 |
4156 | | - |
4157 | while (count--) { evaluated: count-- yes Evaluation Count:1024 | yes Evaluation Count:8 |
| 8-1024 |
4158 | const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8; | - |
4159 | if (coverage == 0) { evaluated: coverage == 0 yes Evaluation Count:128 | yes Evaluation Count:896 |
| 128-896 |
4160 | ++spans; | - |
4161 | continue; executed: continue; Execution Count:128 | 128 |
4162 | } | - |
4163 | | - |
4164 | int x = spans->x; | - |
4165 | int length = spans->len; | - |
4166 | int sx = (xoff + spans->x) % image_width; | - |
4167 | int sy = (spans->y + yoff) % image_height; | - |
4168 | if (sx < 0) partially evaluated: sx < 0 no Evaluation Count:0 | yes Evaluation Count:896 |
| 0-896 |
4169 | sx += image_width; never executed: sx += image_width; | 0 |
4170 | if (sy < 0) partially evaluated: sy < 0 no Evaluation Count:0 | yes Evaluation Count:896 |
| 0-896 |
4171 | sy += image_height; never executed: sy += image_height; | 0 |
4172 | | - |
4173 | if (coverage == 255) { evaluated: coverage == 255 yes Evaluation Count:128 | yes Evaluation Count:768 |
| 128-768 |
4174 | | - |
4175 | length = qMin(image_width,length); | - |
4176 | int tx = x; | - |
4177 | while (length) { evaluated: length yes Evaluation Count:256 | yes Evaluation Count:128 |
| 128-256 |
4178 | int l = qMin(image_width - sx, length); | - |
4179 | if (buffer_size < l) partially evaluated: buffer_size < l no Evaluation Count:0 | yes Evaluation Count:256 |
| 0-256 |
4180 | l = buffer_size; never executed: l = buffer_size; | 0 |
4181 | quint16 *dest = ((quint16 *)data->rasterBuffer->scanLine(spans->y)) + tx; | - |
4182 | const quint16 *src = (quint16 *)data->texture.scanLine(sy) + sx; | - |
4183 | memcpy(dest, src, l * sizeof(quint16)); | - |
4184 | length -= l; | - |
4185 | tx += l; | - |
4186 | sx = 0; | - |
4187 | } executed: } Execution Count:256 | 256 |
4188 | | - |
4189 | | - |
4190 | | - |
4191 | | - |
4192 | | - |
4193 | | - |
4194 | | - |
4195 | int copy_image_width = qMin(image_width, int(spans->len)); | - |
4196 | length = spans->len - copy_image_width; | - |
4197 | quint16 *src = ((quint16 *)data->rasterBuffer->scanLine(spans->y)) + x; | - |
4198 | quint16 *dest = src + copy_image_width; | - |
4199 | while (copy_image_width < length) { partially evaluated: copy_image_width < length no Evaluation Count:0 | yes Evaluation Count:128 |
| 0-128 |
4200 | memcpy(dest, src, copy_image_width * sizeof(quint16)); | - |
4201 | dest += copy_image_width; | - |
4202 | length -= copy_image_width; | - |
4203 | copy_image_width *= 2; | - |
4204 | } | 0 |
4205 | if (length > 0) partially evaluated: length > 0 yes Evaluation Count:128 | no Evaluation Count:0 |
| 0-128 |
4206 | memcpy(dest, src, length * sizeof(quint16)); executed: memcpy(dest, src, length * sizeof(quint16)); Execution Count:128 | 128 |
4207 | } else { executed: } Execution Count:128 | 128 |
4208 | const quint8 alpha = (coverage + 1) >> 3; | - |
4209 | const quint8 ialpha = 0x20 - alpha; | - |
4210 | if (alpha > 0) { evaluated: alpha > 0 yes Evaluation Count:640 | yes Evaluation Count:128 |
| 128-640 |
4211 | while (length) { evaluated: length yes Evaluation Count:1280 | yes Evaluation Count:640 |
| 640-1280 |
4212 | int l = qMin(image_width - sx, length); | - |
4213 | if (buffer_size < l) partially evaluated: buffer_size < l no Evaluation Count:0 | yes Evaluation Count:1280 |
| 0-1280 |
4214 | l = buffer_size; never executed: l = buffer_size; | 0 |
4215 | quint16 *dest = ((quint16 *)data->rasterBuffer->scanLine(spans->y)) + x; | - |
4216 | const quint16 *src = (quint16 *)data->texture.scanLine(sy) + sx; | - |
4217 | blend_sourceOver_rgb16_rgb16(dest, src, l, alpha, ialpha); | - |
4218 | x += l; | - |
4219 | length -= l; | - |
4220 | sx = 0; | - |
4221 | } executed: } Execution Count:1280 | 1280 |
4222 | } executed: } Execution Count:640 | 640 |
4223 | } executed: } Execution Count:768 | 768 |
4224 | ++spans; | - |
4225 | } executed: } Execution Count:896 | 896 |
4226 | } executed: } Execution Count:8 | 8 |
4227 | | - |
4228 | static void blend_transformed_bilinear_rgb565(int count, const QSpan *spans, void *userData) | - |
4229 | { | - |
4230 | QSpanData *data = reinterpret_cast<QSpanData*>(userData); | - |
4231 | QPainter::CompositionMode mode = data->rasterBuffer->compositionMode; | - |
4232 | | - |
4233 | if (data->texture.format != QImage::Format_RGB16 never evaluated: data->texture.format != QImage::Format_RGB16 | 0 |
4234 | || (mode != QPainter::CompositionMode_SourceOver never evaluated: mode != QPainter::CompositionMode_SourceOver | 0 |
4235 | && mode != QPainter::CompositionMode_Source)) never evaluated: mode != QPainter::CompositionMode_Source | 0 |
4236 | { | - |
4237 | blend_src_generic(count, spans, userData); | - |
4238 | return; | 0 |
4239 | } | - |
4240 | | - |
4241 | quint16 buffer[buffer_size]; | - |
4242 | | - |
4243 | const int src_minx = data->texture.x1; | - |
4244 | const int src_miny = data->texture.y1; | - |
4245 | const int src_maxx = data->texture.x2 - 1; | - |
4246 | const int src_maxy = data->texture.y2 - 1; | - |
4247 | | - |
4248 | if (data->fast_matrix) { never evaluated: data->fast_matrix | 0 |
4249 | | - |
4250 | const int fdx = (int)(data->m11 * fixed_scale); | - |
4251 | const int fdy = (int)(data->m12 * fixed_scale); | - |
4252 | | - |
4253 | while (count--) { | 0 |
4254 | const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8; | - |
4255 | const quint8 alpha = (coverage + 1) >> 3; | - |
4256 | const quint8 ialpha = 0x20 - alpha; | - |
4257 | if (alpha == 0) { never evaluated: alpha == 0 | 0 |
4258 | ++spans; | - |
4259 | continue; never executed: continue; | 0 |
4260 | } | - |
4261 | | - |
4262 | quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x; | - |
4263 | const qreal cx = spans->x + qreal(0.5); | - |
4264 | const qreal cy = spans->y + qreal(0.5); | - |
4265 | int x = int((data->m21 * cy | - |
4266 | + data->m11 * cx + data->dx) * fixed_scale) - half_point; | - |
4267 | int y = int((data->m22 * cy | - |
4268 | + data->m12 * cx + data->dy) * fixed_scale) - half_point; | - |
4269 | int length = spans->len; | - |
4270 | | - |
4271 | while (length) { | 0 |
4272 | int l; | - |
4273 | quint16 *b; | - |
4274 | if (ialpha == 0) { never evaluated: ialpha == 0 | 0 |
4275 | l = length; | - |
4276 | b = dest; | - |
4277 | } else { | 0 |
4278 | l = qMin(length, buffer_size); | - |
4279 | b = buffer; | - |
4280 | } | 0 |
4281 | const quint16 *end = b + l; | - |
4282 | | - |
4283 | while (b < end) { | 0 |
4284 | int x1 = (x >> 16); | - |
4285 | int x2; | - |
4286 | int y1 = (y >> 16); | - |
4287 | int y2; | - |
4288 | | - |
4289 | fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(0, src_minx, src_maxx, x1, x2); | - |
4290 | fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(0, src_miny, src_maxy, y1, y2); | - |
4291 | | - |
4292 | const quint16 *src1 = (quint16*)data->texture.scanLine(y1); | - |
4293 | const quint16 *src2 = (quint16*)data->texture.scanLine(y2); | - |
4294 | quint16 tl = src1[x1]; | - |
4295 | const quint16 tr = src1[x2]; | - |
4296 | quint16 bl = src2[x1]; | - |
4297 | const quint16 br = src2[x2]; | - |
4298 | | - |
4299 | const uint distxsl8 = x & 0xff00; | - |
4300 | const uint distysl8 = y & 0xff00; | - |
4301 | const uint distx = distxsl8 >> 8; | - |
4302 | const uint disty = distysl8 >> 8; | - |
4303 | const uint distxy = distx * disty; | - |
4304 | | - |
4305 | const uint tlw = 0x10000 - distxsl8 - distysl8 + distxy; | - |
4306 | const uint trw = distxsl8 - distxy; | - |
4307 | const uint blw = distysl8 - distxy; | - |
4308 | const uint brw = distxy; | - |
4309 | uint red = ((tl & 0xf800) * tlw + (tr & 0xf800) * trw | - |
4310 | + (bl & 0xf800) * blw + (br & 0xf800) * brw) & 0xf8000000; | - |
4311 | uint green = ((tl & 0x07e0) * tlw + (tr & 0x07e0) * trw | - |
4312 | + (bl & 0x07e0) * blw + (br & 0x07e0) * brw) & 0x07e00000; | - |
4313 | uint blue = ((tl & 0x001f) * tlw + (tr & 0x001f) * trw | - |
4314 | + (bl & 0x001f) * blw + (br & 0x001f) * brw); | - |
4315 | *b = quint16((red | green | blue) >> 16); | - |
4316 | | - |
4317 | ++b; | - |
4318 | x += fdx; | - |
4319 | y += fdy; | - |
4320 | } | 0 |
4321 | | - |
4322 | if (ialpha != 0) never evaluated: ialpha != 0 | 0 |
4323 | blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); | 0 |
4324 | | - |
4325 | dest += l; | - |
4326 | length -= l; | - |
4327 | } | 0 |
4328 | ++spans; | - |
4329 | } | 0 |
4330 | } else { | 0 |
4331 | const qreal fdx = data->m11; | - |
4332 | const qreal fdy = data->m12; | - |
4333 | const qreal fdw = data->m13; | - |
4334 | | - |
4335 | while (count--) { | 0 |
4336 | const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8; | - |
4337 | const quint8 alpha = (coverage + 1) >> 3; | - |
4338 | const quint8 ialpha = 0x20 - alpha; | - |
4339 | if (alpha == 0) { never evaluated: alpha == 0 | 0 |
4340 | ++spans; | - |
4341 | continue; never executed: continue; | 0 |
4342 | } | - |
4343 | | - |
4344 | quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x; | - |
4345 | | - |
4346 | const qreal cx = spans->x + qreal(0.5); | - |
4347 | const qreal cy = spans->y + qreal(0.5); | - |
4348 | | - |
4349 | qreal x = data->m21 * cy + data->m11 * cx + data->dx; | - |
4350 | qreal y = data->m22 * cy + data->m12 * cx + data->dy; | - |
4351 | qreal w = data->m23 * cy + data->m13 * cx + data->m33; | - |
4352 | | - |
4353 | int length = spans->len; | - |
4354 | while (length) { | 0 |
4355 | int l; | - |
4356 | quint16 *b; | - |
4357 | if (ialpha == 0) { never evaluated: ialpha == 0 | 0 |
4358 | l = length; | - |
4359 | b = dest; | - |
4360 | } else { | 0 |
4361 | l = qMin(length, buffer_size); | - |
4362 | b = buffer; | - |
4363 | } | 0 |
4364 | const quint16 *end = b + l; | - |
4365 | | - |
4366 | while (b < end) { | 0 |
4367 | const qreal iw = w == 0 ? 1 : 1 / w; | 0 |
4368 | const qreal px = x * iw - qreal(0.5); | - |
4369 | const qreal py = y * iw - qreal(0.5); | - |
4370 | | - |
4371 | int x1 = int(px) - (px < 0); | - |
4372 | int x2; | - |
4373 | int y1 = int(py) - (py < 0); | - |
4374 | int y2; | - |
4375 | | - |
4376 | fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(0, src_minx, src_maxx, x1, x2); | - |
4377 | fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(0, src_miny, src_maxy, y1, y2); | - |
4378 | | - |
4379 | const quint16 *src1 = (quint16 *)data->texture.scanLine(y1); | - |
4380 | const quint16 *src2 = (quint16 *)data->texture.scanLine(y2); | - |
4381 | quint16 tl = src1[x1]; | - |
4382 | const quint16 tr = src1[x2]; | - |
4383 | quint16 bl = src2[x1]; | - |
4384 | const quint16 br = src2[x2]; | - |
4385 | | - |
4386 | const uint distx = uint((px - x1) * 256); | - |
4387 | const uint disty = uint((py - y1) * 256); | - |
4388 | const uint distxsl8 = distx << 8; | - |
4389 | const uint distysl8 = disty << 8; | - |
4390 | const uint distxy = distx * disty; | - |
4391 | | - |
4392 | const uint tlw = 0x10000 - distxsl8 - distysl8 + distxy; | - |
4393 | const uint trw = distxsl8 - distxy; | - |
4394 | const uint blw = distysl8 - distxy; | - |
4395 | const uint brw = distxy; | - |
4396 | uint red = ((tl & 0xf800) * tlw + (tr & 0xf800) * trw | - |
4397 | + (bl & 0xf800) * blw + (br & 0xf800) * brw) & 0xf8000000; | - |
4398 | uint green = ((tl & 0x07e0) * tlw + (tr & 0x07e0) * trw | - |
4399 | + (bl & 0x07e0) * blw + (br & 0x07e0) * brw) & 0x07e00000; | - |
4400 | uint blue = ((tl & 0x001f) * tlw + (tr & 0x001f) * trw | - |
4401 | + (bl & 0x001f) * blw + (br & 0x001f) * brw); | - |
4402 | *b = quint16((red | green | blue) >> 16); | - |
4403 | | - |
4404 | ++b; | - |
4405 | x += fdx; | - |
4406 | y += fdy; | - |
4407 | w += fdw; | - |
4408 | } | 0 |
4409 | | - |
4410 | if (ialpha != 0) never evaluated: ialpha != 0 | 0 |
4411 | blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); | 0 |
4412 | | - |
4413 | dest += l; | - |
4414 | length -= l; | - |
4415 | } | 0 |
4416 | ++spans; | - |
4417 | } | 0 |
4418 | } | 0 |
4419 | } | - |
4420 | | - |
4421 | static void blend_transformed_argb(int count, const QSpan *spans, void *userData) | - |
4422 | { | - |
4423 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - |
4424 | if (data->texture.format != QImage::Format_ARGB32_Premultiplied partially evaluated: data->texture.format != QImage::Format_ARGB32_Premultiplied yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
4425 | && data->texture.format != QImage::Format_RGB32) { partially evaluated: data->texture.format != QImage::Format_RGB32 yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
4426 | blend_src_generic(count, spans, userData); | - |
4427 | return; executed: return; Execution Count:1 | 1 |
4428 | } | - |
4429 | | - |
4430 | CompositionFunction func = functionForMode[data->rasterBuffer->compositionMode]; | - |
4431 | uint buffer[buffer_size]; | - |
4432 | | - |
4433 | int image_width = data->texture.width; | - |
4434 | int image_height = data->texture.height; | - |
4435 | | - |
4436 | if (data->fast_matrix) { never evaluated: data->fast_matrix | 0 |
4437 | | - |
4438 | int fdx = (int)(data->m11 * fixed_scale); | - |
4439 | int fdy = (int)(data->m12 * fixed_scale); | - |
4440 | | - |
4441 | while (count--) { | 0 |
4442 | void *t = data->rasterBuffer->scanLine(spans->y); | - |
4443 | | - |
4444 | uint *target = ((uint *)t) + spans->x; | - |
4445 | | - |
4446 | const qreal cx = spans->x + qreal(0.5); | - |
4447 | const qreal cy = spans->y + qreal(0.5); | - |
4448 | | - |
4449 | int x = int((data->m21 * cy | - |
4450 | + data->m11 * cx + data->dx) * fixed_scale); | - |
4451 | int y = int((data->m22 * cy | - |
4452 | + data->m12 * cx + data->dy) * fixed_scale); | - |
4453 | | - |
4454 | int length = spans->len; | - |
4455 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - |
4456 | while (length) { | 0 |
4457 | int l = qMin(length, buffer_size); | - |
4458 | const uint *end = buffer + l; | - |
4459 | uint *b = buffer; | - |
4460 | while (b < end) { | 0 |
4461 | int px = qBound(0, x >> 16, image_width - 1); | - |
4462 | int py = qBound(0, y >> 16, image_height - 1); | - |
4463 | *b = reinterpret_cast<const uint *>(data->texture.scanLine(py))[px]; | - |
4464 | | - |
4465 | x += fdx; | - |
4466 | y += fdy; | - |
4467 | ++b; | - |
4468 | } | 0 |
4469 | func(target, buffer, l, coverage); | - |
4470 | target += l; | - |
4471 | length -= l; | - |
4472 | } | 0 |
4473 | ++spans; | - |
4474 | } | 0 |
4475 | } else { | 0 |
4476 | const qreal fdx = data->m11; | - |
4477 | const qreal fdy = data->m12; | - |
4478 | const qreal fdw = data->m13; | - |
4479 | while (count--) { | 0 |
4480 | void *t = data->rasterBuffer->scanLine(spans->y); | - |
4481 | | - |
4482 | uint *target = ((uint *)t) + spans->x; | - |
4483 | | - |
4484 | const qreal cx = spans->x + qreal(0.5); | - |
4485 | const qreal cy = spans->y + qreal(0.5); | - |
4486 | | - |
4487 | qreal x = data->m21 * cy + data->m11 * cx + data->dx; | - |
4488 | qreal y = data->m22 * cy + data->m12 * cx + data->dy; | - |
4489 | qreal w = data->m23 * cy + data->m13 * cx + data->m33; | - |
4490 | | - |
4491 | int length = spans->len; | - |
4492 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - |
4493 | while (length) { | 0 |
4494 | int l = qMin(length, buffer_size); | - |
4495 | const uint *end = buffer + l; | - |
4496 | uint *b = buffer; | - |
4497 | while (b < end) { | 0 |
4498 | const qreal iw = w == 0 ? 1 : 1 / w; | 0 |
4499 | const qreal tx = x * iw; | - |
4500 | const qreal ty = y * iw; | - |
4501 | const int px = qBound(0, int(tx) - (tx < 0), image_width - 1); | - |
4502 | const int py = qBound(0, int(ty) - (ty < 0), image_height - 1); | - |
4503 | | - |
4504 | *b = reinterpret_cast<const uint *>(data->texture.scanLine(py))[px]; | - |
4505 | x += fdx; | - |
4506 | y += fdy; | - |
4507 | w += fdw; | - |
4508 | | - |
4509 | ++b; | - |
4510 | } | 0 |
4511 | func(target, buffer, l, coverage); | - |
4512 | target += l; | - |
4513 | length -= l; | - |
4514 | } | 0 |
4515 | ++spans; | - |
4516 | } | 0 |
4517 | } | 0 |
4518 | } | - |
4519 | | - |
4520 | static void blend_transformed_rgb565(int count, const QSpan *spans, void *userData) | - |
4521 | { | - |
4522 | QSpanData *data = reinterpret_cast<QSpanData*>(userData); | - |
4523 | QPainter::CompositionMode mode = data->rasterBuffer->compositionMode; | - |
4524 | | - |
4525 | if (data->texture.format != QImage::Format_RGB16 never evaluated: data->texture.format != QImage::Format_RGB16 | 0 |
4526 | || (mode != QPainter::CompositionMode_SourceOver never evaluated: mode != QPainter::CompositionMode_SourceOver | 0 |
4527 | && mode != QPainter::CompositionMode_Source)) never evaluated: mode != QPainter::CompositionMode_Source | 0 |
4528 | { | - |
4529 | blend_src_generic(count, spans, userData); | - |
4530 | return; | 0 |
4531 | } | - |
4532 | | - |
4533 | quint16 buffer[buffer_size]; | - |
4534 | const int image_width = data->texture.width; | - |
4535 | const int image_height = data->texture.height; | - |
4536 | | - |
4537 | if (data->fast_matrix) { never evaluated: data->fast_matrix | 0 |
4538 | | - |
4539 | const int fdx = (int)(data->m11 * fixed_scale); | - |
4540 | const int fdy = (int)(data->m12 * fixed_scale); | - |
4541 | | - |
4542 | while (count--) { | 0 |
4543 | const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8; | - |
4544 | const quint8 alpha = (coverage + 1) >> 3; | - |
4545 | const quint8 ialpha = 0x20 - alpha; | - |
4546 | if (alpha == 0) { never evaluated: alpha == 0 | 0 |
4547 | ++spans; | - |
4548 | continue; never executed: continue; | 0 |
4549 | } | - |
4550 | | - |
4551 | quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x; | - |
4552 | const qreal cx = spans->x + qreal(0.5); | - |
4553 | const qreal cy = spans->y + qreal(0.5); | - |
4554 | int x = int((data->m21 * cy | - |
4555 | + data->m11 * cx + data->dx) * fixed_scale); | - |
4556 | int y = int((data->m22 * cy | - |
4557 | + data->m12 * cx + data->dy) * fixed_scale); | - |
4558 | int length = spans->len; | - |
4559 | | - |
4560 | while (length) { | 0 |
4561 | int l; | - |
4562 | quint16 *b; | - |
4563 | if (ialpha == 0) { never evaluated: ialpha == 0 | 0 |
4564 | l = length; | - |
4565 | b = dest; | - |
4566 | } else { | 0 |
4567 | l = qMin(length, buffer_size); | - |
4568 | b = buffer; | - |
4569 | } | 0 |
4570 | const quint16 *end = b + l; | - |
4571 | | - |
4572 | while (b < end) { | 0 |
4573 | const int px = qBound(0, x >> 16, image_width - 1); | - |
4574 | const int py = qBound(0, y >> 16, image_height - 1); | - |
4575 | | - |
4576 | *b = ((quint16 *)data->texture.scanLine(py))[px]; | - |
4577 | ++b; | - |
4578 | | - |
4579 | x += fdx; | - |
4580 | y += fdy; | - |
4581 | } | 0 |
4582 | | - |
4583 | if (ialpha != 0) never evaluated: ialpha != 0 | 0 |
4584 | blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); | 0 |
4585 | | - |
4586 | dest += l; | - |
4587 | length -= l; | - |
4588 | } | 0 |
4589 | ++spans; | - |
4590 | } | 0 |
4591 | } else { | 0 |
4592 | const qreal fdx = data->m11; | - |
4593 | const qreal fdy = data->m12; | - |
4594 | const qreal fdw = data->m13; | - |
4595 | | - |
4596 | while (count--) { | 0 |
4597 | const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8; | - |
4598 | const quint8 alpha = (coverage + 1) >> 3; | - |
4599 | const quint8 ialpha = 0x20 - alpha; | - |
4600 | if (alpha == 0) { never evaluated: alpha == 0 | 0 |
4601 | ++spans; | - |
4602 | continue; never executed: continue; | 0 |
4603 | } | - |
4604 | | - |
4605 | quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x; | - |
4606 | | - |
4607 | const qreal cx = spans->x + qreal(0.5); | - |
4608 | const qreal cy = spans->y + qreal(0.5); | - |
4609 | | - |
4610 | qreal x = data->m21 * cy + data->m11 * cx + data->dx; | - |
4611 | qreal y = data->m22 * cy + data->m12 * cx + data->dy; | - |
4612 | qreal w = data->m23 * cy + data->m13 * cx + data->m33; | - |
4613 | | - |
4614 | int length = spans->len; | - |
4615 | while (length) { | 0 |
4616 | int l; | - |
4617 | quint16 *b; | - |
4618 | if (ialpha == 0) { never evaluated: ialpha == 0 | 0 |
4619 | l = length; | - |
4620 | b = dest; | - |
4621 | } else { | 0 |
4622 | l = qMin(length, buffer_size); | - |
4623 | b = buffer; | - |
4624 | } | 0 |
4625 | const quint16 *end = b + l; | - |
4626 | | - |
4627 | while (b < end) { | 0 |
4628 | const qreal iw = w == 0 ? 1 : 1 / w; | 0 |
4629 | const qreal tx = x * iw; | - |
4630 | const qreal ty = y * iw; | - |
4631 | | - |
4632 | const int px = qBound(0, int(tx) - (tx < 0), image_width - 1); | - |
4633 | const int py = qBound(0, int(ty) - (ty < 0), image_height - 1); | - |
4634 | | - |
4635 | *b = ((quint16 *)data->texture.scanLine(py))[px]; | - |
4636 | ++b; | - |
4637 | | - |
4638 | x += fdx; | - |
4639 | y += fdy; | - |
4640 | w += fdw; | - |
4641 | } | 0 |
4642 | | - |
4643 | if (ialpha != 0) never evaluated: ialpha != 0 | 0 |
4644 | blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); | 0 |
4645 | | - |
4646 | dest += l; | - |
4647 | length -= l; | - |
4648 | } | 0 |
4649 | ++spans; | - |
4650 | } | 0 |
4651 | } | 0 |
4652 | } | - |
4653 | | - |
4654 | static void blend_transformed_tiled_argb(int count, const QSpan *spans, void *userData) | - |
4655 | { | - |
4656 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - |
4657 | if (data->texture.format != QImage::Format_ARGB32_Premultiplied partially evaluated: data->texture.format != QImage::Format_ARGB32_Premultiplied no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
4658 | && data->texture.format != QImage::Format_RGB32) { never evaluated: data->texture.format != QImage::Format_RGB32 | 0 |
4659 | blend_src_generic(count, spans, userData); | - |
4660 | return; | 0 |
4661 | } | - |
4662 | | - |
4663 | CompositionFunction func = functionForMode[data->rasterBuffer->compositionMode]; | - |
4664 | uint buffer[buffer_size]; | - |
4665 | | - |
4666 | int image_width = data->texture.width; | - |
4667 | int image_height = data->texture.height; | - |
4668 | const int scanline_offset = data->texture.bytesPerLine / 4; | - |
4669 | | - |
4670 | if (data->fast_matrix) { partially evaluated: data->fast_matrix no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
4671 | | - |
4672 | int fdx = (int)(data->m11 * fixed_scale); | - |
4673 | int fdy = (int)(data->m12 * fixed_scale); | - |
4674 | | - |
4675 | while (count--) { | 0 |
4676 | void *t = data->rasterBuffer->scanLine(spans->y); | - |
4677 | | - |
4678 | uint *target = ((uint *)t) + spans->x; | - |
4679 | uint *image_bits = (uint *)data->texture.imageData; | - |
4680 | | - |
4681 | const qreal cx = spans->x + qreal(0.5); | - |
4682 | const qreal cy = spans->y + qreal(0.5); | - |
4683 | | - |
4684 | int x = int((data->m21 * cy | - |
4685 | + data->m11 * cx + data->dx) * fixed_scale); | - |
4686 | int y = int((data->m22 * cy | - |
4687 | + data->m12 * cx + data->dy) * fixed_scale); | - |
4688 | | - |
4689 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - |
4690 | int length = spans->len; | - |
4691 | while (length) { | 0 |
4692 | int l = qMin(length, buffer_size); | - |
4693 | const uint *end = buffer + l; | - |
4694 | uint *b = buffer; | - |
4695 | while (b < end) { | 0 |
4696 | int px = x >> 16; | - |
4697 | int py = y >> 16; | - |
4698 | px %= image_width; | - |
4699 | py %= image_height; | - |
4700 | if (px < 0) px += image_width; never executed: px += image_width; | 0 |
4701 | if (py < 0) py += image_height; never executed: py += image_height; | 0 |
4702 | int y_offset = py * scanline_offset; | - |
4703 | | - |
4704 | qt_noop(); | - |
4705 | qt_noop(); | - |
4706 | | - |
4707 | *b = image_bits[y_offset + px]; | - |
4708 | x += fdx; | - |
4709 | y += fdy; | - |
4710 | ++b; | - |
4711 | } | 0 |
4712 | func(target, buffer, l, coverage); | - |
4713 | target += l; | - |
4714 | length -= l; | - |
4715 | } | 0 |
4716 | ++spans; | - |
4717 | } | 0 |
4718 | } else { | 0 |
4719 | const qreal fdx = data->m11; | - |
4720 | const qreal fdy = data->m12; | - |
4721 | const qreal fdw = data->m13; | - |
4722 | while (count--) { evaluated: count-- yes Evaluation Count:111 | yes Evaluation Count:2 |
| 2-111 |
4723 | void *t = data->rasterBuffer->scanLine(spans->y); | - |
4724 | | - |
4725 | uint *target = ((uint *)t) + spans->x; | - |
4726 | uint *image_bits = (uint *)data->texture.imageData; | - |
4727 | | - |
4728 | const qreal cx = spans->x + qreal(0.5); | - |
4729 | const qreal cy = spans->y + qreal(0.5); | - |
4730 | | - |
4731 | qreal x = data->m21 * cy + data->m11 * cx + data->dx; | - |
4732 | qreal y = data->m22 * cy + data->m12 * cx + data->dy; | - |
4733 | qreal w = data->m23 * cy + data->m13 * cx + data->m33; | - |
4734 | | - |
4735 | const int coverage = (spans->coverage * data->texture.const_alpha) >> 8; | - |
4736 | int length = spans->len; | - |
4737 | while (length) { evaluated: length yes Evaluation Count:111 | yes Evaluation Count:111 |
| 111 |
4738 | int l = qMin(length, buffer_size); | - |
4739 | const uint *end = buffer + l; | - |
4740 | uint *b = buffer; | - |
4741 | while (b < end) { evaluated: b < end yes Evaluation Count:12101 | yes Evaluation Count:111 |
| 111-12101 |
4742 | const qreal iw = w == 0 ? 1 : 1 / w; partially evaluated: w == 0 no Evaluation Count:0 | yes Evaluation Count:12101 |
| 0-12101 |
4743 | const qreal tx = x * iw; | - |
4744 | const qreal ty = y * iw; | - |
4745 | int px = int(tx) - (tx < 0); | - |
4746 | int py = int(ty) - (ty < 0); | - |
4747 | | - |
4748 | px %= image_width; | - |
4749 | py %= image_height; | - |
4750 | if (px < 0) px += image_width; executed: px += image_width; Execution Count:10450 evaluated: px < 0 yes Evaluation Count:10450 | yes Evaluation Count:1651 |
| 1651-10450 |
4751 | if (py < 0) py += image_height; never executed: py += image_height; partially evaluated: py < 0 no Evaluation Count:0 | yes Evaluation Count:12101 |
| 0-12101 |
4752 | int y_offset = py * scanline_offset; | - |
4753 | | - |
4754 | qt_noop(); | - |
4755 | qt_noop(); | - |
4756 | | - |
4757 | *b = image_bits[y_offset + px]; | - |
4758 | x += fdx; | - |
4759 | y += fdy; | - |
4760 | w += fdw; | - |
4761 | | - |
4762 | if (!w) { partially evaluated: !w no Evaluation Count:0 | yes Evaluation Count:12101 |
| 0-12101 |
4763 | w += fdw; | - |
4764 | } | 0 |
4765 | ++b; | - |
4766 | } executed: } Execution Count:12101 | 12101 |
4767 | func(target, buffer, l, coverage); | - |
4768 | target += l; | - |
4769 | length -= l; | - |
4770 | } executed: } Execution Count:111 | 111 |
4771 | ++spans; | - |
4772 | } executed: } Execution Count:111 | 111 |
4773 | } executed: } Execution Count:2 | 2 |
4774 | } | - |
4775 | | - |
4776 | static void blend_transformed_tiled_rgb565(int count, const QSpan *spans, void *userData) | - |
4777 | { | - |
4778 | QSpanData *data = reinterpret_cast<QSpanData*>(userData); | - |
4779 | QPainter::CompositionMode mode = data->rasterBuffer->compositionMode; | - |
4780 | | - |
4781 | if (data->texture.format != QImage::Format_RGB16 never evaluated: data->texture.format != QImage::Format_RGB16 | 0 |
4782 | || (mode != QPainter::CompositionMode_SourceOver never evaluated: mode != QPainter::CompositionMode_SourceOver | 0 |
4783 | && mode != QPainter::CompositionMode_Source)) never evaluated: mode != QPainter::CompositionMode_Source | 0 |
4784 | { | - |
4785 | blend_src_generic(count, spans, userData); | - |
4786 | return; | 0 |
4787 | } | - |
4788 | | - |
4789 | quint16 buffer[buffer_size]; | - |
4790 | const int image_width = data->texture.width; | - |
4791 | const int image_height = data->texture.height; | - |
4792 | | - |
4793 | if (data->fast_matrix) { never evaluated: data->fast_matrix | 0 |
4794 | | - |
4795 | const int fdx = (int)(data->m11 * fixed_scale); | - |
4796 | const int fdy = (int)(data->m12 * fixed_scale); | - |
4797 | | - |
4798 | while (count--) { | 0 |
4799 | const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8; | - |
4800 | const quint8 alpha = (coverage + 1) >> 3; | - |
4801 | const quint8 ialpha = 0x20 - alpha; | - |
4802 | if (alpha == 0) { never evaluated: alpha == 0 | 0 |
4803 | ++spans; | - |
4804 | continue; never executed: continue; | 0 |
4805 | } | - |
4806 | | - |
4807 | quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x; | - |
4808 | const qreal cx = spans->x + qreal(0.5); | - |
4809 | const qreal cy = spans->y + qreal(0.5); | - |
4810 | int x = int((data->m21 * cy | - |
4811 | + data->m11 * cx + data->dx) * fixed_scale); | - |
4812 | int y = int((data->m22 * cy | - |
4813 | + data->m12 * cx + data->dy) * fixed_scale); | - |
4814 | int length = spans->len; | - |
4815 | | - |
4816 | while (length) { | 0 |
4817 | int l; | - |
4818 | quint16 *b; | - |
4819 | if (ialpha == 0) { never evaluated: ialpha == 0 | 0 |
4820 | l = length; | - |
4821 | b = dest; | - |
4822 | } else { | 0 |
4823 | l = qMin(length, buffer_size); | - |
4824 | b = buffer; | - |
4825 | } | 0 |
4826 | const quint16 *end = b + l; | - |
4827 | | - |
4828 | while (b < end) { | 0 |
4829 | int px = (x >> 16) % image_width; | - |
4830 | int py = (y >> 16) % image_height; | - |
4831 | | - |
4832 | if (px < 0) | 0 |
4833 | px += image_width; never executed: px += image_width; | 0 |
4834 | if (py < 0) | 0 |
4835 | py += image_height; never executed: py += image_height; | 0 |
4836 | | - |
4837 | *b = ((quint16 *)data->texture.scanLine(py))[px]; | - |
4838 | ++b; | - |
4839 | | - |
4840 | x += fdx; | - |
4841 | y += fdy; | - |
4842 | } | 0 |
4843 | | - |
4844 | if (ialpha != 0) never evaluated: ialpha != 0 | 0 |
4845 | blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); | 0 |
4846 | | - |
4847 | dest += l; | - |
4848 | length -= l; | - |
4849 | } | 0 |
4850 | ++spans; | - |
4851 | } | 0 |
4852 | } else { | 0 |
4853 | const qreal fdx = data->m11; | - |
4854 | const qreal fdy = data->m12; | - |
4855 | const qreal fdw = data->m13; | - |
4856 | | - |
4857 | while (count--) { | 0 |
4858 | const quint8 coverage = (data->texture.const_alpha * spans->coverage) >> 8; | - |
4859 | const quint8 alpha = (coverage + 1) >> 3; | - |
4860 | const quint8 ialpha = 0x20 - alpha; | - |
4861 | if (alpha == 0) { never evaluated: alpha == 0 | 0 |
4862 | ++spans; | - |
4863 | continue; never executed: continue; | 0 |
4864 | } | - |
4865 | | - |
4866 | quint16 *dest = (quint16 *)data->rasterBuffer->scanLine(spans->y) + spans->x; | - |
4867 | | - |
4868 | const qreal cx = spans->x + qreal(0.5); | - |
4869 | const qreal cy = spans->y + qreal(0.5); | - |
4870 | | - |
4871 | qreal x = data->m21 * cy + data->m11 * cx + data->dx; | - |
4872 | qreal y = data->m22 * cy + data->m12 * cx + data->dy; | - |
4873 | qreal w = data->m23 * cy + data->m13 * cx + data->m33; | - |
4874 | | - |
4875 | int length = spans->len; | - |
4876 | while (length) { | 0 |
4877 | int l; | - |
4878 | quint16 *b; | - |
4879 | if (ialpha == 0) { never evaluated: ialpha == 0 | 0 |
4880 | l = length; | - |
4881 | b = dest; | - |
4882 | } else { | 0 |
4883 | l = qMin(length, buffer_size); | - |
4884 | b = buffer; | - |
4885 | } | 0 |
4886 | const quint16 *end = b + l; | - |
4887 | | - |
4888 | while (b < end) { | 0 |
4889 | const qreal iw = w == 0 ? 1 : 1 / w; | 0 |
4890 | const qreal tx = x * iw; | - |
4891 | const qreal ty = y * iw; | - |
4892 | | - |
4893 | int px = int(tx) - (tx < 0); | - |
4894 | int py = int(ty) - (ty < 0); | - |
4895 | | - |
4896 | px %= image_width; | - |
4897 | py %= image_height; | - |
4898 | if (px < 0) | 0 |
4899 | px += image_width; never executed: px += image_width; | 0 |
4900 | if (py < 0) | 0 |
4901 | py += image_height; never executed: py += image_height; | 0 |
4902 | | - |
4903 | *b = ((quint16 *)data->texture.scanLine(py))[px]; | - |
4904 | ++b; | - |
4905 | | - |
4906 | x += fdx; | - |
4907 | y += fdy; | - |
4908 | w += fdw; | - |
4909 | | - |
4910 | if (!w) | 0 |
4911 | w += fdw; never executed: w += fdw; | 0 |
4912 | } | 0 |
4913 | | - |
4914 | if (ialpha != 0) never evaluated: ialpha != 0 | 0 |
4915 | blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); never executed: blend_sourceOver_rgb16_rgb16(dest, buffer, l, alpha, ialpha); | 0 |
4916 | | - |
4917 | dest += l; | - |
4918 | length -= l; | - |
4919 | } | 0 |
4920 | ++spans; | - |
4921 | } | 0 |
4922 | } | 0 |
4923 | } | - |
4924 | | - |
4925 | | - |
4926 | | - |
4927 | static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats] = { | - |
4928 | | - |
4929 | { | - |
4930 | 0, | - |
4931 | blend_untransformed_generic, | - |
4932 | blend_untransformed_generic, | - |
4933 | blend_untransformed_generic, | - |
4934 | blend_untransformed_generic, | - |
4935 | blend_untransformed_generic, | - |
4936 | blend_untransformed_argb, | - |
4937 | blend_untransformed_rgb565, | - |
4938 | blend_untransformed_generic, | - |
4939 | blend_untransformed_generic, | - |
4940 | blend_untransformed_generic, | - |
4941 | blend_untransformed_generic, | - |
4942 | blend_untransformed_generic, | - |
4943 | blend_untransformed_generic, | - |
4944 | blend_untransformed_generic, | - |
4945 | blend_untransformed_generic, | - |
4946 | }, | - |
4947 | | - |
4948 | { | - |
4949 | 0, | - |
4950 | blend_tiled_generic, | - |
4951 | blend_tiled_generic, | - |
4952 | blend_tiled_generic, | - |
4953 | blend_tiled_generic, | - |
4954 | blend_tiled_generic, | - |
4955 | blend_tiled_argb, | - |
4956 | blend_tiled_rgb565, | - |
4957 | blend_tiled_generic, | - |
4958 | blend_tiled_generic, | - |
4959 | blend_tiled_generic, | - |
4960 | blend_tiled_generic, | - |
4961 | blend_tiled_generic, | - |
4962 | blend_tiled_generic, | - |
4963 | blend_tiled_generic, | - |
4964 | blend_tiled_generic, | - |
4965 | }, | - |
4966 | | - |
4967 | { | - |
4968 | 0, | - |
4969 | blend_src_generic, | - |
4970 | blend_src_generic, | - |
4971 | blend_src_generic, | - |
4972 | blend_src_generic, | - |
4973 | blend_src_generic, | - |
4974 | blend_transformed_argb, | - |
4975 | blend_transformed_rgb565, | - |
4976 | blend_src_generic, | - |
4977 | blend_src_generic, | - |
4978 | blend_src_generic, | - |
4979 | blend_src_generic, | - |
4980 | blend_src_generic, | - |
4981 | blend_src_generic, | - |
4982 | blend_src_generic, | - |
4983 | blend_src_generic, | - |
4984 | }, | - |
4985 | | - |
4986 | { | - |
4987 | 0, | - |
4988 | blend_src_generic, | - |
4989 | blend_src_generic, | - |
4990 | blend_src_generic, | - |
4991 | blend_src_generic, | - |
4992 | blend_src_generic, | - |
4993 | blend_transformed_tiled_argb, | - |
4994 | blend_transformed_tiled_rgb565, | - |
4995 | blend_src_generic, | - |
4996 | blend_src_generic, | - |
4997 | blend_src_generic, | - |
4998 | blend_src_generic, | - |
4999 | blend_src_generic, | - |
5000 | blend_src_generic, | - |
5001 | blend_src_generic, | - |
5002 | blend_src_generic | - |
5003 | }, | - |
5004 | | - |
5005 | { | - |
5006 | 0, | - |
5007 | blend_src_generic, | - |
5008 | blend_src_generic, | - |
5009 | blend_src_generic, | - |
5010 | blend_src_generic, | - |
5011 | blend_src_generic, | - |
5012 | blend_src_generic, | - |
5013 | blend_transformed_bilinear_rgb565, | - |
5014 | blend_src_generic, | - |
5015 | blend_src_generic, | - |
5016 | blend_src_generic, | - |
5017 | blend_src_generic, | - |
5018 | blend_src_generic, | - |
5019 | blend_src_generic, | - |
5020 | blend_src_generic, | - |
5021 | blend_src_generic, | - |
5022 | }, | - |
5023 | | - |
5024 | { | - |
5025 | 0, | - |
5026 | blend_src_generic, | - |
5027 | blend_src_generic, | - |
5028 | blend_src_generic, | - |
5029 | blend_src_generic, | - |
5030 | blend_src_generic, | - |
5031 | blend_src_generic, | - |
5032 | blend_src_generic, | - |
5033 | blend_src_generic, | - |
5034 | blend_src_generic, | - |
5035 | blend_src_generic, | - |
5036 | blend_src_generic, | - |
5037 | blend_src_generic, | - |
5038 | blend_src_generic, | - |
5039 | blend_src_generic, | - |
5040 | blend_src_generic, | - |
5041 | } | - |
5042 | }; | - |
5043 | | - |
5044 | void qBlendTexture(int count, const QSpan *spans, void *userData) | - |
5045 | { | - |
5046 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - |
5047 | ProcessSpans proc = processTextureSpans[getBlendType(data)][data->rasterBuffer->format]; | - |
5048 | proc(count, spans, userData); | - |
5049 | } executed: } Execution Count:18866 | 18866 |
5050 | | - |
5051 | template <class DST> | - |
5052 | inline void qt_bitmapblit_template(QRasterBuffer *rasterBuffer, | - |
5053 | int x, int y, DST color, | - |
5054 | const uchar *map, | - |
5055 | int mapWidth, int mapHeight, int mapStride) | - |
5056 | { | - |
5057 | DST *dest = reinterpret_cast<DST *>(rasterBuffer->scanLine(y)) + x; | - |
5058 | const int destStride = rasterBuffer->bytesPerLine() / sizeof(DST); | - |
5059 | | - |
5060 | if (mapWidth > 8) { never evaluated: mapWidth > 8 | 0 |
5061 | while (mapHeight--) { never evaluated: mapHeight-- | 0 |
5062 | int x0 = 0; | - |
5063 | int n = 0; | - |
5064 | for (int x = 0; x < mapWidth; x += 8) { never evaluated: x < mapWidth | 0 |
5065 | uchar s = map[x >> 3]; | - |
5066 | for (int i = 0; i < 8; ++i) { | 0 |
5067 | if (s & 0x80) { never evaluated: s & 0x80 | 0 |
5068 | ++n; | - |
5069 | } else { | 0 |
5070 | if (n) { | 0 |
5071 | qt_memfill(dest + x0, color, n); | - |
5072 | x0 += n + 1; | - |
5073 | n = 0; | - |
5074 | } else { | 0 |
5075 | ++x0; | - |
5076 | } | 0 |
5077 | if (!s) { | 0 |
5078 | x0 += 8 - 1 - i; | - |
5079 | break; | 0 |
5080 | } | - |
5081 | } | 0 |
5082 | s <<= 1; | - |
5083 | } | 0 |
5084 | } | 0 |
5085 | if (n) | 0 |
5086 | qt_memfill(dest + x0, color, n); never executed: qt_memfill(dest + x0, color, n); | 0 |
5087 | dest += destStride; | - |
5088 | map += mapStride; | - |
5089 | } | 0 |
5090 | } else { | 0 |
5091 | while (mapHeight--) { never evaluated: mapHeight-- | 0 |
5092 | int x0 = 0; | - |
5093 | int n = 0; | - |
5094 | for (uchar s = *map; s; s <<= 1) { | 0 |
5095 | if (s & 0x80) { never evaluated: s & 0x80 | 0 |
5096 | ++n; | - |
5097 | } else if (n) { | 0 |
5098 | qt_memfill(dest + x0, color, n); | - |
5099 | x0 += n + 1; | - |
5100 | n = 0; | - |
5101 | } else { | 0 |
5102 | ++x0; | - |
5103 | } | 0 |
5104 | } | - |
5105 | if (n) | 0 |
5106 | qt_memfill(dest + x0, color, n); never executed: qt_memfill(dest + x0, color, n); | 0 |
5107 | dest += destStride; | - |
5108 | map += mapStride; | - |
5109 | } | 0 |
5110 | } | 0 |
5111 | } | - |
5112 | | - |
5113 | static void qt_gradient_quint32(int count, const QSpan *spans, void *userData) | - |
5114 | { | - |
5115 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - |
5116 | | - |
5117 | bool isVerticalGradient = | - |
5118 | data->txop <= QTransform::TxScale && partially evaluated: data->txop <= QTransform::TxScale yes Evaluation Count:16099 | no Evaluation Count:0 |
| 0-16099 |
5119 | data->type == QSpanData::LinearGradient && evaluated: data->type == QSpanData::LinearGradient yes Evaluation Count:16085 | yes Evaluation Count:17 |
| 17-16085 |
5120 | data->gradient.linear.end.x == data->gradient.linear.origin.x; evaluated: data->gradient.linear.end.x == data->gradient.linear.origin.x yes Evaluation Count:32 | yes Evaluation Count:16054 |
| 32-16054 |
5121 | | - |
5122 | if (isVerticalGradient) { evaluated: isVerticalGradient yes Evaluation Count:32 | yes Evaluation Count:16071 |
| 32-16071 |
5123 | LinearGradientValues linear; | - |
5124 | getLinearGradientValues(&linear, data); | - |
5125 | | - |
5126 | CompositionFunctionSolid funcSolid = | - |
5127 | functionForModeSolid[data->rasterBuffer->compositionMode]; | - |
5128 | const int gss = 1024 - 1; | - |
5129 | int yinc = int((linear.dy * data->m22 * gss) * (1<<8)); | - |
5130 | int off = int((((linear.dy * (data->m22 * qreal(0.5) + data->dy) + linear.off) * gss) * (1<<8))); | - |
5131 | | - |
5132 | while (count--) { evaluated: count-- yes Evaluation Count:4109 | yes Evaluation Count:32 |
| 32-4109 |
5133 | int y = spans->y; | - |
5134 | int x = spans->x; | - |
5135 | | - |
5136 | quint32 *dst = (quint32 *)(data->rasterBuffer->scanLine(y)) + x; | - |
5137 | quint32 color = | - |
5138 | qt_gradient_pixel_fixed(&data->gradient, yinc * y + off); | - |
5139 | | - |
5140 | funcSolid(dst, spans->len, color, spans->coverage); | - |
5141 | ++spans; | - |
5142 | } executed: } Execution Count:4109 | 4109 |
5143 | | - |
5144 | } else { executed: } Execution Count:32 | 32 |
5145 | blend_src_generic(count, spans, userData); | - |
5146 | } executed: } Execution Count:16063 | 16063 |
5147 | } | - |
5148 | | - |
5149 | static void qt_gradient_quint16(int count, const QSpan *spans, void *userData) | - |
5150 | { | - |
5151 | QSpanData *data = reinterpret_cast<QSpanData *>(userData); | - |
5152 | | - |
5153 | bool isVerticalGradient = | - |
5154 | data->txop <= QTransform::TxScale && partially evaluated: data->txop <= QTransform::TxScale yes Evaluation Count:1463 | no Evaluation Count:0 |
| 0-1463 |
5155 | data->type == QSpanData::LinearGradient && evaluated: data->type == QSpanData::LinearGradient yes Evaluation Count:961 | yes Evaluation Count:502 |
| 502-961 |
5156 | data->gradient.linear.end.x == data->gradient.linear.origin.x; evaluated: data->gradient.linear.end.x == data->gradient.linear.origin.x yes Evaluation Count:468 | yes Evaluation Count:493 |
| 468-493 |
5157 | | - |
5158 | if (isVerticalGradient) { evaluated: isVerticalGradient yes Evaluation Count:468 | yes Evaluation Count:995 |
| 468-995 |
5159 | | - |
5160 | LinearGradientValues linear; | - |
5161 | getLinearGradientValues(&linear, data); | - |
5162 | const int gss = 1024 - 1; | - |
5163 | int yinc = int((linear.dy * data->m22 * gss) * (1<<8)); | - |
5164 | int off = int((((linear.dy * (data->m22 * qreal(0.5) + data->dy) + linear.off) * gss) * (1<<8))); | - |
5165 | | - |
5166 | uint oldColor = data->solid.color; | - |
5167 | while (count--) { evaluated: count-- yes Evaluation Count:5226 | yes Evaluation Count:468 |
| 468-5226 |
5168 | int y = spans->y; | - |
5169 | | - |
5170 | quint32 color = qt_gradient_pixel_fixed(&data->gradient, yinc * y + off); | - |
5171 | | - |
5172 | data->solid.color = color; | - |
5173 | blend_color_rgb16(1, spans, userData); | - |
5174 | ++spans; | - |
5175 | } executed: } Execution Count:5226 | 5226 |
5176 | data->solid.color = oldColor; | - |
5177 | | - |
5178 | } else { executed: } Execution Count:468 | 468 |
5179 | blend_src_generic(count, spans, userData); | - |
5180 | } executed: } Execution Count:995 | 995 |
5181 | } | - |
5182 | | - |
5183 | inline static void qt_bitmapblit_quint32(QRasterBuffer *rasterBuffer, | - |
5184 | int x, int y, quint32 color, | - |
5185 | const uchar *map, | - |
5186 | int mapWidth, int mapHeight, int mapStride) | - |
5187 | { | - |
5188 | qt_bitmapblit_template<quint32>(rasterBuffer, x, y, color, | - |
5189 | map, mapWidth, mapHeight, mapStride); | - |
5190 | } | 0 |
5191 | | - |
5192 | inline static void qt_bitmapblit_quint16(QRasterBuffer *rasterBuffer, | - |
5193 | int x, int y, quint32 color, | - |
5194 | const uchar *map, | - |
5195 | int mapWidth, int mapHeight, int mapStride) | - |
5196 | { | - |
5197 | qt_bitmapblit_template<quint16>(rasterBuffer, x, y, qConvertRgb32To16(color), | - |
5198 | map, mapWidth, mapHeight, mapStride); | - |
5199 | } | 0 |
5200 | | - |
5201 | static void qt_alphamapblit_quint16(QRasterBuffer *rasterBuffer, | - |
5202 | int x, int y, quint32 color, | - |
5203 | const uchar *map, | - |
5204 | int mapWidth, int mapHeight, int mapStride, | - |
5205 | const QClipData *) | - |
5206 | { | - |
5207 | const quint16 c = qConvertRgb32To16(color); | - |
5208 | quint16 *dest = reinterpret_cast<quint16*>(rasterBuffer->scanLine(y)) + x; | - |
5209 | const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint16); | - |
5210 | | - |
5211 | while (mapHeight--) { evaluated: mapHeight-- yes Evaluation Count:892486 | yes Evaluation Count:94275 |
| 94275-892486 |
5212 | for (int i = 0; i < mapWidth; ++i) { evaluated: i < mapWidth yes Evaluation Count:5449469 | yes Evaluation Count:892486 |
| 892486-5449469 |
5213 | const int coverage = map[i]; | - |
5214 | | - |
5215 | if (coverage == 0) { evaluated: coverage == 0 yes Evaluation Count:1885208 | yes Evaluation Count:3564261 |
| 1885208-3564261 |
5216 | | - |
5217 | } else if (coverage == 255) { executed: } Execution Count:1885208 evaluated: coverage == 255 yes Evaluation Count:115759 | yes Evaluation Count:3448502 |
| 115759-3448502 |
5218 | dest[i] = c; | - |
5219 | } else { executed: } Execution Count:115759 | 115759 |
5220 | int ialpha = 255 - coverage; | - |
5221 | dest[i] = BYTE_MUL_RGB16(c, coverage) | - |
5222 | + BYTE_MUL_RGB16(dest[i], ialpha); | - |
5223 | } executed: } Execution Count:3448502 | 3448502 |
5224 | } | - |
5225 | dest += destStride; | - |
5226 | map += mapStride; | - |
5227 | } executed: } Execution Count:892486 | 892486 |
5228 | } executed: } Execution Count:94275 | 94275 |
5229 | | - |
5230 | static inline void rgbBlendPixel(quint32 *dst, int coverage, int sr, int sg, int sb, const uchar *gamma, const uchar *invgamma) | - |
5231 | { | - |
5232 | | - |
5233 | int da = qAlpha(*dst); | - |
5234 | int dr = qRed(*dst); | - |
5235 | int dg = qGreen(*dst); | - |
5236 | int db = qBlue(*dst); | - |
5237 | | - |
5238 | if (da != 255 never evaluated: da != 255 | 0 |
5239 | ) { | - |
5240 | | - |
5241 | int a = qGray(coverage); | - |
5242 | sr = qt_div_255(invgamma[sr] * a); | - |
5243 | sg = qt_div_255(invgamma[sg] * a); | - |
5244 | sb = qt_div_255(invgamma[sb] * a); | - |
5245 | | - |
5246 | int ia = 255 - a; | - |
5247 | dr = qt_div_255(dr * ia); | - |
5248 | dg = qt_div_255(dg * ia); | - |
5249 | db = qt_div_255(db * ia); | - |
5250 | | - |
5251 | *dst = ((a + qt_div_255((255 - a) * da)) << 24) | - |
5252 | | ((sr + dr) << 16) | - |
5253 | | ((sg + dg) << 8) | - |
5254 | | ((sb + db)); | - |
5255 | return; | 0 |
5256 | } | - |
5257 | | - |
5258 | int mr = qRed(coverage); | - |
5259 | int mg = qGreen(coverage); | - |
5260 | int mb = qBlue(coverage); | - |
5261 | | - |
5262 | dr = gamma[dr]; | - |
5263 | dg = gamma[dg]; | - |
5264 | db = gamma[db]; | - |
5265 | | - |
5266 | int nr = qt_div_255((sr - dr) * mr) + dr; | - |
5267 | int ng = qt_div_255((sg - dg) * mg) + dg; | - |
5268 | int nb = qt_div_255((sb - db) * mb) + db; | - |
5269 | | - |
5270 | nr = invgamma[nr]; | - |
5271 | ng = invgamma[ng]; | - |
5272 | nb = invgamma[nb]; | - |
5273 | | - |
5274 | *dst = qRgb(nr, ng, nb); | - |
5275 | } | 0 |
5276 | static void qt_alphamapblit_quint32(QRasterBuffer *rasterBuffer, | - |
5277 | int x, int y, quint32 color, | - |
5278 | const uchar *map, | - |
5279 | int mapWidth, int mapHeight, int mapStride, | - |
5280 | const QClipData *clip) | - |
5281 | { | - |
5282 | const quint32 c = color; | - |
5283 | const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint32); | - |
5284 | if (!clip) { evaluated: !clip yes Evaluation Count:6843 | yes Evaluation Count:513 |
| 513-6843 |
5285 | quint32 *dest = reinterpret_cast<quint32*>(rasterBuffer->scanLine(y)) + x; | - |
5286 | while (mapHeight--) { evaluated: mapHeight-- yes Evaluation Count:56452 | yes Evaluation Count:6843 |
| 6843-56452 |
5287 | for (int i = 0; i < mapWidth; ++i) { evaluated: i < mapWidth yes Evaluation Count:277335 | yes Evaluation Count:56452 |
| 56452-277335 |
5288 | const int coverage = map[i]; | - |
5289 | | - |
5290 | if (coverage == 0) { evaluated: coverage == 0 yes Evaluation Count:91959 | yes Evaluation Count:185376 |
| 91959-185376 |
5291 | | - |
5292 | } else if (coverage == 255) { executed: } Execution Count:91959 evaluated: coverage == 255 yes Evaluation Count:17448 | yes Evaluation Count:167928 |
| 17448-167928 |
5293 | dest[i] = c; | - |
5294 | } else { executed: } Execution Count:17448 | 17448 |
5295 | | - |
5296 | | - |
5297 | | - |
5298 | | - |
5299 | | - |
5300 | | - |
5301 | { | - |
5302 | int ialpha = 255 - coverage; | - |
5303 | dest[i] = INTERPOLATE_PIXEL_255(c, coverage, dest[i], ialpha); | - |
5304 | } | - |
5305 | } executed: } Execution Count:167928 | 167928 |
5306 | } | - |
5307 | dest += destStride; | - |
5308 | map += mapStride; | - |
5309 | } executed: } Execution Count:56452 | 56452 |
5310 | } else { executed: } Execution Count:6843 | 6843 |
5311 | int bottom = qMin(y + mapHeight, rasterBuffer->height()); | - |
5312 | | - |
5313 | int top = qMax(y, 0); | - |
5314 | map += (top - y) * mapStride; | - |
5315 | | - |
5316 | const_cast<QClipData *>(clip)->initialize(); | - |
5317 | for (int yp = top; yp<bottom; ++yp) { evaluated: yp<bottom yes Evaluation Count:4872 | yes Evaluation Count:513 |
| 513-4872 |
5318 | const QClipData::ClipLine &line = clip->m_clipLines[yp]; | - |
5319 | | - |
5320 | quint32 *dest = reinterpret_cast<quint32 *>(rasterBuffer->scanLine(yp)); | - |
5321 | | - |
5322 | for (int i=0; i<line.count; ++i) { evaluated: i<line.count yes Evaluation Count:4872 | yes Evaluation Count:4872 |
| 4872 |
5323 | const QSpan &clip = line.spans[i]; | - |
5324 | | - |
5325 | int start = qMax<int>(x, clip.x); | - |
5326 | int end = qMin<int>(x + mapWidth, clip.x + clip.len); | - |
5327 | | - |
5328 | for (int xp=start; xp<end; ++xp) { evaluated: xp<end yes Evaluation Count:18364 | yes Evaluation Count:4872 |
| 4872-18364 |
5329 | const int coverage = map[xp - x]; | - |
5330 | | - |
5331 | if (coverage == 0) { evaluated: coverage == 0 yes Evaluation Count:7288 | yes Evaluation Count:11076 |
| 7288-11076 |
5332 | | - |
5333 | } else if (coverage == 255) { executed: } Execution Count:7288 evaluated: coverage == 255 yes Evaluation Count:1190 | yes Evaluation Count:9886 |
| 1190-9886 |
5334 | dest[xp] = c; | - |
5335 | } else { executed: } Execution Count:1190 | 1190 |
5336 | | - |
5337 | | - |
5338 | | - |
5339 | | - |
5340 | | - |
5341 | | - |
5342 | { | - |
5343 | int ialpha = 255 - coverage; | - |
5344 | dest[xp] = INTERPOLATE_PIXEL_255(c, coverage, dest[xp], ialpha); | - |
5345 | } | - |
5346 | } executed: } Execution Count:9886 | 9886 |
5347 | | - |
5348 | } | - |
5349 | } executed: } Execution Count:4872 | 4872 |
5350 | map += mapStride; | - |
5351 | } executed: } Execution Count:4872 | 4872 |
5352 | } executed: } Execution Count:513 | 513 |
5353 | } | - |
5354 | | - |
5355 | static void qt_alphargbblit_quint32(QRasterBuffer *rasterBuffer, | - |
5356 | int x, int y, quint32 color, | - |
5357 | const uint *src, int mapWidth, int mapHeight, int srcStride, | - |
5358 | const QClipData *clip) | - |
5359 | { | - |
5360 | const quint32 c = color; | - |
5361 | | - |
5362 | int sr = qRed(color); | - |
5363 | int sg = qGreen(color); | - |
5364 | int sb = qBlue(color); | - |
5365 | int sa = qAlpha(color); | - |
5366 | | - |
5367 | const QDrawHelperGammaTables *tables = QGuiApplicationPrivate::instance()->gammaTables(); | - |
5368 | if (!tables) | 0 |
5369 | return; | 0 |
5370 | | - |
5371 | const uchar *gamma = tables->qt_pow_rgb_gamma; | - |
5372 | const uchar *invgamma = tables->qt_pow_rgb_invgamma; | - |
5373 | | - |
5374 | sr = gamma[sr]; | - |
5375 | sg = gamma[sg]; | - |
5376 | sb = gamma[sb]; | - |
5377 | | - |
5378 | if (sa == 0) | 0 |
5379 | return; | 0 |
5380 | | - |
5381 | if (!clip) { | 0 |
5382 | quint32 *dst = reinterpret_cast<quint32*>(rasterBuffer->scanLine(y)) + x; | - |
5383 | const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint32); | - |
5384 | while (mapHeight--) { never evaluated: mapHeight-- | 0 |
5385 | for (int i = 0; i < mapWidth; ++i) { never evaluated: i < mapWidth | 0 |
5386 | const uint coverage = src[i]; | - |
5387 | if (coverage == 0xffffffff) { never evaluated: coverage == 0xffffffff | 0 |
5388 | dst[i] = c; | - |
5389 | } else if (coverage != 0xff000000) { never evaluated: coverage != 0xff000000 | 0 |
5390 | rgbBlendPixel(dst+i, coverage, sr, sg, sb, gamma, invgamma); | - |
5391 | } | 0 |
5392 | } | - |
5393 | | - |
5394 | dst += destStride; | - |
5395 | src += srcStride; | - |
5396 | } | 0 |
5397 | } else { | 0 |
5398 | int bottom = qMin(y + mapHeight, rasterBuffer->height()); | - |
5399 | | - |
5400 | int top = qMax(y, 0); | - |
5401 | src += (top - y) * srcStride; | - |
5402 | | - |
5403 | const_cast<QClipData *>(clip)->initialize(); | - |
5404 | for (int yp = top; yp<bottom; ++yp) { never evaluated: yp<bottom | 0 |
5405 | const QClipData::ClipLine &line = clip->m_clipLines[yp]; | - |
5406 | | - |
5407 | quint32 *dst = reinterpret_cast<quint32 *>(rasterBuffer->scanLine(yp)); | - |
5408 | | - |
5409 | for (int i=0; i<line.count; ++i) { never evaluated: i<line.count | 0 |
5410 | const QSpan &clip = line.spans[i]; | - |
5411 | | - |
5412 | int start = qMax<int>(x, clip.x); | - |
5413 | int end = qMin<int>(x + mapWidth, clip.x + clip.len); | - |
5414 | | - |
5415 | for (int xp=start; xp<end; ++xp) { | 0 |
5416 | const uint coverage = src[xp - x]; | - |
5417 | if (coverage == 0xffffffff) { never evaluated: coverage == 0xffffffff | 0 |
5418 | dst[xp] = c; | - |
5419 | } else if (coverage != 0xff000000) { never evaluated: coverage != 0xff000000 | 0 |
5420 | rgbBlendPixel(dst+xp, coverage, sr, sg, sb, gamma, invgamma); | - |
5421 | } | 0 |
5422 | } | - |
5423 | } | 0 |
5424 | src += srcStride; | - |
5425 | } | 0 |
5426 | | - |
5427 | } | 0 |
5428 | } | - |
5429 | | - |
5430 | static void qt_rectfill_quint32(QRasterBuffer *rasterBuffer, | - |
5431 | int x, int y, int width, int height, | - |
5432 | quint32 color) | - |
5433 | { | - |
5434 | qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()), | - |
5435 | color, x, y, width, height, rasterBuffer->bytesPerLine()); | - |
5436 | } executed: } Execution Count:1020 | 1020 |
5437 | | - |
5438 | static void qt_rectfill_quint16(QRasterBuffer *rasterBuffer, | - |
5439 | int x, int y, int width, int height, | - |
5440 | quint32 color) | - |
5441 | { | - |
5442 | qt_rectfill<quint16>(reinterpret_cast<quint16 *>(rasterBuffer->buffer()), | - |
5443 | qConvertRgb32To16(color), x, y, width, height, rasterBuffer->bytesPerLine()); | - |
5444 | } executed: } Execution Count:39808 | 39808 |
5445 | | - |
5446 | static void qt_rectfill_nonpremul_quint32(QRasterBuffer *rasterBuffer, | - |
5447 | int x, int y, int width, int height, | - |
5448 | quint32 color) | - |
5449 | { | - |
5450 | qt_rectfill<quint32>(reinterpret_cast<quint32 *>(rasterBuffer->buffer()), | - |
5451 | (qAlpha(color) == 0 ? 0 : ((qAlpha(color) << 24) | (((255*qRed(color))/ qAlpha(color)) << 16) | (((255*qGreen(color)) / qAlpha(color)) << 8) | ((255*qBlue(color)) / qAlpha(color)))), x, y, width, height, rasterBuffer->bytesPerLine()); | - |
5452 | } executed: } Execution Count:201 | 201 |
5453 | | - |
5454 | | - |
5455 | | - |
5456 | | - |
5457 | | - |
5458 | DrawHelper qDrawHelper[QImage::NImageFormats] = | - |
5459 | { | - |
5460 | | - |
5461 | { 0, 0, 0, 0, 0, 0 }, | - |
5462 | | - |
5463 | { | - |
5464 | blend_color_generic, | - |
5465 | blend_src_generic, | - |
5466 | 0, 0, 0, 0 | - |
5467 | }, | - |
5468 | | - |
5469 | { | - |
5470 | blend_color_generic, | - |
5471 | blend_src_generic, | - |
5472 | 0, 0, 0, 0 | - |
5473 | }, | - |
5474 | | - |
5475 | { | - |
5476 | blend_color_generic, | - |
5477 | blend_src_generic, | - |
5478 | 0, 0, 0, 0 | - |
5479 | }, | - |
5480 | | - |
5481 | { | - |
5482 | blend_color_argb, | - |
5483 | qt_gradient_quint32, | - |
5484 | qt_bitmapblit_quint32, | - |
5485 | qt_alphamapblit_quint32, | - |
5486 | qt_alphargbblit_quint32, | - |
5487 | qt_rectfill_quint32 | - |
5488 | }, | - |
5489 | | - |
5490 | { | - |
5491 | blend_color_generic, | - |
5492 | qt_gradient_quint32, | - |
5493 | qt_bitmapblit_quint32, | - |
5494 | qt_alphamapblit_quint32, | - |
5495 | qt_alphargbblit_quint32, | - |
5496 | qt_rectfill_nonpremul_quint32 | - |
5497 | }, | - |
5498 | | - |
5499 | { | - |
5500 | blend_color_argb, | - |
5501 | qt_gradient_quint32, | - |
5502 | qt_bitmapblit_quint32, | - |
5503 | qt_alphamapblit_quint32, | - |
5504 | qt_alphargbblit_quint32, | - |
5505 | qt_rectfill_quint32 | - |
5506 | }, | - |
5507 | | - |
5508 | { | - |
5509 | blend_color_rgb16, | - |
5510 | qt_gradient_quint16, | - |
5511 | qt_bitmapblit_quint16, | - |
5512 | qt_alphamapblit_quint16, | - |
5513 | 0, | - |
5514 | qt_rectfill_quint16 | - |
5515 | }, | - |
5516 | | - |
5517 | { | - |
5518 | blend_color_generic, | - |
5519 | blend_src_generic, | - |
5520 | 0, 0, 0, 0 | - |
5521 | }, | - |
5522 | | - |
5523 | { | - |
5524 | blend_color_generic, | - |
5525 | blend_src_generic, | - |
5526 | 0, 0, 0, 0 | - |
5527 | }, | - |
5528 | | - |
5529 | { | - |
5530 | blend_color_generic, | - |
5531 | blend_src_generic, | - |
5532 | 0, 0, 0, 0 | - |
5533 | }, | - |
5534 | | - |
5535 | { | - |
5536 | blend_color_generic, | - |
5537 | blend_src_generic, | - |
5538 | 0, 0, 0, 0 | - |
5539 | }, | - |
5540 | | - |
5541 | { | - |
5542 | blend_color_generic, | - |
5543 | blend_src_generic, | - |
5544 | 0, 0, 0, 0 | - |
5545 | }, | - |
5546 | | - |
5547 | { | - |
5548 | blend_color_generic, | - |
5549 | blend_src_generic, | - |
5550 | 0, 0, 0, 0 | - |
5551 | }, | - |
5552 | | - |
5553 | { | - |
5554 | blend_color_generic, | - |
5555 | blend_src_generic, | - |
5556 | 0, 0, 0, 0 | - |
5557 | }, | - |
5558 | | - |
5559 | { | - |
5560 | blend_color_generic, | - |
5561 | blend_src_generic, | - |
5562 | 0, 0, 0, 0 | - |
5563 | } | - |
5564 | }; | - |
5565 | template <class T> | - |
5566 | inline void qt_memfill_template(T *dest, T color, int count) | - |
5567 | { | - |
5568 | int n = (count + 7) / 8; | - |
5569 | switch (count & 0x07) | - |
5570 | { | - |
5571 | case 0: do { *dest++ = color; | - |
5572 | case 7: *dest++ = color; code before this statement never executed: case 7: | 0 |
5573 | case 6: *dest++ = color; code before this statement never executed: case 6: | 0 |
5574 | case 5: *dest++ = color; code before this statement never executed: case 5: | 0 |
5575 | case 4: *dest++ = color; code before this statement never executed: case 4: | 0 |
5576 | case 3: *dest++ = color; code before this statement never executed: case 3: | 0 |
5577 | case 2: *dest++ = color; code before this statement never executed: case 2: | 0 |
5578 | case 1: *dest++ = color; code before this statement never executed: case 1: | 0 |
5579 | } while (--n > 0); | 0 |
5580 | } | 0 |
5581 | } | 0 |
5582 | | - |
5583 | template <> | - |
5584 | inline void qt_memfill_template(quint16 *dest, quint16 value, int count) | - |
5585 | { | - |
5586 | if (count < 3) { never evaluated: count < 3 | 0 |
5587 | switch (count) { | - |
5588 | case 2: *dest++ = value; | - |
5589 | case 1: *dest = value; code before this statement never executed: case 1: | 0 |
5590 | } | 0 |
5591 | return; | 0 |
5592 | } | - |
5593 | | - |
5594 | const int align = (quintptr)(dest) & 0x3; | - |
5595 | switch (align) { | - |
5596 | case 2: *dest++ = value; --count; | - |
5597 | } | 0 |
5598 | | - |
5599 | const quint32 value32 = (value << 16) | value; | - |
5600 | qt_memfill(reinterpret_cast<quint32*>(dest), value32, count / 2); | - |
5601 | if (count & 0x1) never evaluated: count & 0x1 | 0 |
5602 | dest[count - 1] = value; never executed: dest[count - 1] = value; | 0 |
5603 | } | 0 |
5604 | | - |
5605 | | - |
5606 | static void qt_memfill_quint16(quint16 *dest, quint16 color, int count) | - |
5607 | { | - |
5608 | qt_memfill_template<quint16>(dest, color, count); | - |
5609 | } | 0 |
5610 | | - |
5611 | typedef void (*qt_memfill32_func)(quint32 *dest, quint32 value, int count); | - |
5612 | typedef void (*qt_memfill16_func)(quint16 *dest, quint16 value, int count); | - |
5613 | static void qt_memfill32_setup(quint32 *dest, quint32 value, int count); | - |
5614 | static void qt_memfill16_setup(quint16 *dest, quint16 value, int count); | - |
5615 | | - |
5616 | qt_memfill32_func qt_memfill32 = qt_memfill32_setup; | - |
5617 | qt_memfill16_func qt_memfill16 = qt_memfill16_setup; | - |
5618 | | - |
5619 | void qInitDrawhelperAsm() | - |
5620 | { | - |
5621 | | - |
5622 | qt_memfill32 = qt_memfill_template<quint32>; | - |
5623 | qt_memfill16 = qt_memfill_quint16; | - |
5624 | | - |
5625 | CompositionFunction *functionForModeAsm = 0; | - |
5626 | CompositionFunctionSolid *functionForModeSolidAsm = 0; | - |
5627 | | - |
5628 | const uint features = qCpuFeatures(); | - |
5629 | if (false) { partially evaluated: false no Evaluation Count:0 | yes Evaluation Count:290 |
| 0-290 |
5630 | | - |
5631 | } else if (features & AVX) { partially evaluated: features & AVX no Evaluation Count:0 | yes Evaluation Count:290 |
| 0-290 |
5632 | qt_memfill32 = qt_memfill32_avx; | - |
5633 | qt_memfill16 = qt_memfill16_avx; | - |
5634 | qDrawHelper[QImage::Format_RGB32].bitmapBlit = qt_bitmapblit32_avx; | - |
5635 | qDrawHelper[QImage::Format_ARGB32].bitmapBlit = qt_bitmapblit32_avx; | - |
5636 | qDrawHelper[QImage::Format_ARGB32_Premultiplied].bitmapBlit = qt_bitmapblit32_avx; | - |
5637 | qDrawHelper[QImage::Format_RGB16].bitmapBlit = qt_bitmapblit16_avx; | - |
5638 | | - |
5639 | extern void qt_scale_image_argb32_on_argb32_avx(uchar *destPixels, int dbpl, | - |
5640 | const uchar *srcPixels, int sbpl, | - |
5641 | const QRectF &targetRect, | - |
5642 | const QRectF &sourceRect, | - |
5643 | const QRect &clip, | - |
5644 | int const_alpha); | - |
5645 | qScaleFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_argb32_avx; | - |
5646 | qScaleFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_argb32_avx; | - |
5647 | | - |
5648 | | - |
5649 | } else if (features & SSE2) { partially evaluated: features & SSE2 yes Evaluation Count:290 | no Evaluation Count:0 |
| 0-290 |
5650 | qt_memfill32 = qt_memfill32_sse2; | - |
5651 | qt_memfill16 = qt_memfill16_sse2; | - |
5652 | qDrawHelper[QImage::Format_RGB32].bitmapBlit = qt_bitmapblit32_sse2; | - |
5653 | qDrawHelper[QImage::Format_ARGB32].bitmapBlit = qt_bitmapblit32_sse2; | - |
5654 | qDrawHelper[QImage::Format_ARGB32_Premultiplied].bitmapBlit = qt_bitmapblit32_sse2; | - |
5655 | qDrawHelper[QImage::Format_RGB16].bitmapBlit = qt_bitmapblit16_sse2; | - |
5656 | | - |
5657 | extern void qt_scale_image_argb32_on_argb32_sse2(uchar *destPixels, int dbpl, | - |
5658 | const uchar *srcPixels, int sbpl, | - |
5659 | const QRectF &targetRect, | - |
5660 | const QRectF &sourceRect, | - |
5661 | const QRect &clip, | - |
5662 | int const_alpha); | - |
5663 | qScaleFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_argb32_sse2; | - |
5664 | qScaleFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_argb32_sse2; | - |
5665 | | - |
5666 | } executed: } Execution Count:290 | 290 |
5667 | | - |
5668 | | - |
5669 | if (features & SSE2) { partially evaluated: features & SSE2 yes Evaluation Count:290 | no Evaluation Count:0 |
| 0-290 |
5670 | extern void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl, | - |
5671 | const uchar *srcPixels, int sbpl, | - |
5672 | int w, int h, | - |
5673 | int const_alpha); | - |
5674 | extern void qt_blend_argb32_on_argb32_sse2(uchar *destPixels, int dbpl, | - |
5675 | const uchar *srcPixels, int sbpl, | - |
5676 | int w, int h, | - |
5677 | int const_alpha); | - |
5678 | | - |
5679 | qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2; | - |
5680 | qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2; | - |
5681 | qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2; | - |
5682 | qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2; | - |
5683 | | - |
5684 | extern const uint * qt_fetch_radial_gradient_sse2(uint *buffer, const Operator *op, const QSpanData *data, | - |
5685 | int y, int x, int length); | - |
5686 | | - |
5687 | qt_fetch_radial_gradient = qt_fetch_radial_gradient_sse2; | - |
5688 | } executed: } Execution Count:290 | 290 |
5689 | | - |
5690 | | - |
5691 | if (features & SSSE3) { partially evaluated: features & SSSE3 yes Evaluation Count:290 | no Evaluation Count:0 |
| 0-290 |
5692 | extern void qt_blend_argb32_on_argb32_ssse3(uchar *destPixels, int dbpl, | - |
5693 | const uchar *srcPixels, int sbpl, | - |
5694 | int w, int h, | - |
5695 | int const_alpha); | - |
5696 | | - |
5697 | qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_ssse3; | - |
5698 | qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_ssse3; | - |
5699 | } executed: } Execution Count:290 | 290 |
5700 | | - |
5701 | | - |
5702 | | - |
5703 | if (features & AVX) { partially evaluated: features & AVX no Evaluation Count:0 | yes Evaluation Count:290 |
| 0-290 |
5704 | extern void qt_blend_rgb32_on_rgb32_avx(uchar *destPixels, int dbpl, | - |
5705 | const uchar *srcPixels, int sbpl, | - |
5706 | int w, int h, | - |
5707 | int const_alpha); | - |
5708 | extern void qt_blend_argb32_on_argb32_avx(uchar *destPixels, int dbpl, | - |
5709 | const uchar *srcPixels, int sbpl, | - |
5710 | int w, int h, | - |
5711 | int const_alpha); | - |
5712 | | - |
5713 | qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_avx; | - |
5714 | qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_avx; | - |
5715 | qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_avx; | - |
5716 | qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_avx; | - |
5717 | | - |
5718 | extern const uint * qt_fetch_radial_gradient_avx(uint *buffer, const Operator *op, const QSpanData *data, | - |
5719 | int y, int x, int length); | - |
5720 | | - |
5721 | qt_fetch_radial_gradient = qt_fetch_radial_gradient_avx; | - |
5722 | } | 0 |
5723 | | - |
5724 | | - |
5725 | | - |
5726 | | - |
5727 | | - |
5728 | if (features & SSE2) { partially evaluated: features & SSE2 yes Evaluation Count:290 | no Evaluation Count:0 |
| 0-290 |
5729 | functionForModeAsm = qt_functionForMode_SSE2; | - |
5730 | functionForModeSolidAsm = qt_functionForModeSolid_SSE2; | - |
5731 | } executed: } Execution Count:290 | 290 |
5732 | | - |
5733 | | - |
5734 | if (features & AVX) { partially evaluated: features & AVX no Evaluation Count:0 | yes Evaluation Count:290 |
| 0-290 |
5735 | extern void comp_func_SourceOver_avx(uint *destPixels, | - |
5736 | const uint *srcPixels, | - |
5737 | int length, | - |
5738 | uint const_alpha); | - |
5739 | extern void comp_func_solid_SourceOver_avx(uint *destPixels, int length, uint color, uint const_alpha); | - |
5740 | extern void comp_func_Plus_avx(uint *dst, const uint *src, int length, uint const_alpha); | - |
5741 | extern void comp_func_Source_avx(uint *dst, const uint *src, int length, uint const_alpha); | - |
5742 | | - |
5743 | functionForModeAsm[0] = comp_func_SourceOver_avx; | - |
5744 | functionForModeAsm[QPainter::CompositionMode_Source] = comp_func_Source_avx; | - |
5745 | functionForModeAsm[QPainter::CompositionMode_Plus] = comp_func_Plus_avx; | - |
5746 | functionForModeSolidAsm[0] = comp_func_solid_SourceOver_avx; | - |
5747 | } | 0 |
5748 | if (functionForModeSolidAsm) { partially evaluated: functionForModeSolidAsm yes Evaluation Count:290 | no Evaluation Count:0 |
| 0-290 |
5749 | const int destinationMode = QPainter::CompositionMode_Destination; | - |
5750 | functionForModeSolidAsm[destinationMode] = functionForModeSolid_C[destinationMode]; | - |
5751 | | - |
5752 | | - |
5753 | | - |
5754 | for (int mode = 12; mode < 24; ++mode) evaluated: mode < 24 yes Evaluation Count:3480 | yes Evaluation Count:290 |
| 290-3480 |
5755 | functionForModeSolidAsm[mode] = functionForModeSolid_C[mode]; executed: functionForModeSolidAsm[mode] = functionForModeSolid_C[mode]; Execution Count:3480 | 3480 |
5756 | | - |
5757 | functionForModeSolid = functionForModeSolidAsm; | - |
5758 | } executed: } Execution Count:290 | 290 |
5759 | if (functionForModeAsm) partially evaluated: functionForModeAsm yes Evaluation Count:290 | no Evaluation Count:0 |
| 0-290 |
5760 | functionForMode = functionForModeAsm; executed: functionForMode = functionForModeAsm; Execution Count:290 | 290 |
5761 | } executed: } Execution Count:290 | 290 |
5762 | | - |
5763 | static void qt_memfill32_setup(quint32 *dest, quint32 value, int count) | - |
5764 | { | - |
5765 | qInitDrawhelperAsm(); | - |
5766 | qt_memfill32(dest, value, count); | - |
5767 | } executed: } Execution Count:1 | 1 |
5768 | | - |
5769 | static void qt_memfill16_setup(quint16 *dest, quint16 value, int count) | - |
5770 | { | - |
5771 | qInitDrawhelperAsm(); | - |
5772 | qt_memfill16(dest, value, count); | - |
5773 | } | 0 |
5774 | | - |
5775 | | - |
5776 | | - |
| | |