diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-10-23 14:01:35 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-10-23 14:45:03 +0200 |
commit | 790aef362fd195adf97d8c780a7cbbbade27d51f (patch) | |
tree | 8be464687ab21806cfe9f7ada27098b563aa41b2 /src/gui/painting/qdrawhelper.cpp | |
parent | 9720efbd1035c2e939b0581163e6d804c713dd96 (diff) | |
parent | 07475c662eb73c833da2d461b8ef2702ca1e2cfb (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
.qmake.conf
configure
src/corelib/global/qglobal.h
src/tools/qdoc/node.cpp
src/tools/qdoc/qdocdatabase.cpp
tests/auto/corelib/io/qsettings/tst_qsettings.cpp
tools/configure/configureapp.cpp
Change-Id: I66028ae5e441a06b73ee85ba72a03a3af3e8593f
Diffstat (limited to 'src/gui/painting/qdrawhelper.cpp')
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 64a363868a..6cfc4b9307 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -503,14 +503,16 @@ static const uint *QT_FASTCALL convertRGBA8888PMFromARGB32PM(uint *buffer, const template<bool RGBA, bool maskAlpha> static inline void qConvertARGB32PMToARGB64PM_sse2(QRgba64 *buffer, const uint *src, int count) { + if (count <= 0) + return; + const __m128i amask = _mm_set1_epi32(0xff000000); int i = 0; - if (((uintptr_t)buffer & 0xf) && count > 0) { + for (; ((uintptr_t)buffer & 0xf) && i < count; ++i) { uint s = *src++; if (RGBA) s = RGBA2ARGB(s); *buffer++ = QRgba64::fromArgb32(s); - i++; } for (; i < count-3; i += 4) { __m128i vs = _mm_loadu_si128((const __m128i*)src); @@ -641,15 +643,18 @@ static const uint *QT_FASTCALL convertA2RGB30PMToARGB32PM(uint *buffer, const ui template<QtPixelOrder PixelOrder> static inline void qConvertA2RGB30PMToARGB64PM_sse2(QRgba64 *buffer, const uint *src, int count) { + if (count <= 0) + return; + const __m128i rmask = _mm_set1_epi32(0x3ff00000); const __m128i gmask = _mm_set1_epi32(0x000ffc00); const __m128i bmask = _mm_set1_epi32(0x000003ff); const __m128i afactor = _mm_set1_epi16(0x5555); int i = 0; - if (((uintptr_t)buffer & 0xf) && count > 0) { + + for (; ((uintptr_t)buffer & 0xf) && i < count; ++i) *buffer++ = qConvertA2rgb30ToRgb64<PixelOrder>(*src++); - i++; - } + for (; i < count-3; i += 4) { __m128i vs = _mm_loadu_si128((const __m128i*)src); src += 4; |