diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-09-06 11:03:33 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-09-09 14:31:24 +0000 |
commit | 806b45e7c76f6825e32fde10824beb62eecc40ab (patch) | |
tree | 8013541d154202783de4e8fd9fa9620bd9945460 /src/gui/painting/qdrawingprimitive_sse2_p.h | |
parent | fe82f50a65ecafee9ea7d0e48cf3bb2106414001 (diff) |
Make blendPixel function general
Moves the blendPixel function from the SSSE3 file and use it more
generally, also adds a const_alpha version.
Change-Id: Ia29d1ab3879a845d5b65e0610b7836507e33c7ed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/painting/qdrawingprimitive_sse2_p.h')
-rw-r--r-- | src/gui/painting/qdrawingprimitive_sse2_p.h | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/gui/painting/qdrawingprimitive_sse2_p.h b/src/gui/painting/qdrawingprimitive_sse2_p.h index 8799dff92a..7affc63b32 100644 --- a/src/gui/painting/qdrawingprimitive_sse2_p.h +++ b/src/gui/painting/qdrawingprimitive_sse2_p.h @@ -171,11 +171,7 @@ QT_BEGIN_NAMESPACE \ /* First, get dst aligned. */ \ ALIGNMENT_PROLOGUE_16BYTES(dst, x, length) { \ - uint s = src[x]; \ - if (s >= 0xff000000) \ - dst[x] = s; \ - else if (s != 0) \ - dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \ + blend_pixel(dst[x], src[x]); \ } \ \ for (; x < length-3; x += 4) { \ @@ -183,11 +179,7 @@ QT_BEGIN_NAMESPACE BLEND_SOURCE_OVER_ARGB32_SSE2_helper(dst, srcVector, nullVector, half, one, colorMask, alphaMask) \ } \ for (; x < length; ++x) { \ - uint s = src[x]; \ - if (s >= 0xff000000) \ - dst[x] = s; \ - else if (s != 0) \ - dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \ + blend_pixel(dst[x], src[x]); \ } \ } @@ -207,11 +199,7 @@ QT_BEGIN_NAMESPACE int x = 0; \ \ ALIGNMENT_PROLOGUE_16BYTES(dst, x, length) { \ - quint32 s = src[x]; \ - if (s != 0) { \ - s = BYTE_MUL(s, const_alpha); \ - dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \ - } \ + blend_pixel(dst[x], src[x], const_alpha); \ } \ \ for (; x < length-3; x += 4) { \ @@ -232,11 +220,7 @@ QT_BEGIN_NAMESPACE } \ } \ for (; x < length; ++x) { \ - quint32 s = src[x]; \ - if (s != 0) { \ - s = BYTE_MUL(s, const_alpha); \ - dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \ - } \ + blend_pixel(dst[x], src[x], const_alpha); \ } \ } |