summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qdrawhelper_avx2.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2016-11-18 16:33:12 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-12-03 13:24:36 +0000
commite3b6f6d16577c74433de1ca9e15402cdf285abca (patch)
treeff6a3f155111c51502bf38b0881452afe6cc61fd /src/gui/painting/qdrawhelper_avx2.cpp
parent5cc1265c340656b02f3bd2fccbadd29a21aa8704 (diff)
Fix blending of RGB32 on RGB32 with partial opacity
The alpha channel of an RGB32 image was not properly ignored when doing blending with partial opacity. Now the alpha value is properly ignored, which is both more correct and faster. This also makes SSE2 and AVX2 implementations match NEON which was already doing the right thing (though had dead code for doing it wrong). Change-Id: I4613b8d70ed8c2e36ced10baaa7a4a55bd36a940 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/painting/qdrawhelper_avx2.cpp')
-rw-r--r--src/gui/painting/qdrawhelper_avx2.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gui/painting/qdrawhelper_avx2.cpp b/src/gui/painting/qdrawhelper_avx2.cpp
index acc9bc7ba1..9c1335298e 100644
--- a/src/gui/painting/qdrawhelper_avx2.cpp
+++ b/src/gui/painting/qdrawhelper_avx2.cpp
@@ -267,11 +267,9 @@ void qt_blend_rgb32_on_rgb32_avx2(uchar *destPixels, int dbpl,
// 2) interpolate pixels with AVX2
for (; x < (w - 7); x += 8) {
const __m256i srcVector = _mm256_lddqu_si256((const __m256i *)&src[x]);
- if (!_mm256_testz_si256(srcVector, srcVector)) {
- __m256i dstVector = _mm256_load_si256((__m256i *)&dst[x]);
- INTERPOLATE_PIXEL_255_AVX2(srcVector, dstVector, constAlphaVector, oneMinusConstAlpha, colorMask, half);
- _mm256_store_si256((__m256i *)&dst[x], dstVector);
- }
+ __m256i dstVector = _mm256_load_si256((__m256i *)&dst[x]);
+ INTERPOLATE_PIXEL_255_AVX2(srcVector, dstVector, constAlphaVector, oneMinusConstAlpha, colorMask, half);
+ _mm256_store_si256((__m256i *)&dst[x], dstVector);
}
// 3) Epilogue