From d829dd3f445afae8c74630c4c8b93347b4a7c7bd Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 7 Dec 2016 13:08:44 +0100 Subject: [PATCH] Fix inconsistent alpha masking in qConvertARGB32PMToARGB64PM_sse2 The prolog and epilog did not force RGB32 to be converted to RGB64 with alpha fully defined like the middle optimized part. Change-Id: If7c4829f2239f9a3c524f78b9ce269e2b0b5b150 Reviewed-by: Eirik Aavitsland --- src/gui/painting/qdrawhelper.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 8700a0fce1..ff7c8dfc28 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -580,6 +580,8 @@ static inline void qConvertARGB32PMToARGB64PM_sse2(QRgba64 *buffer, const uint * int i = 0; for (; ((uintptr_t)buffer & 0xf) && i < count; ++i) { uint s = *src++; + if (maskAlpha) + s = s | 0xff000000; if (RGBA) s = RGBA2ARGB(s); *buffer++ = QRgba64::fromArgb32(s); @@ -605,6 +607,8 @@ static inline void qConvertARGB32PMToARGB64PM_sse2(QRgba64 *buffer, const uint * SIMD_EPILOGUE(i, count, 3) { uint s = *src++; + if (maskAlpha) + s = s | 0xff000000; if (RGBA) s = RGBA2ARGB(s); *buffer++ = QRgba64::fromArgb32(s);