diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-03-14 13:45:11 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-03-15 21:40:22 +0100 |
commit | 304352d9df17ec5e9963c1b0d41c7f7cb951012e (patch) | |
tree | 3306ab9ccf8d05be360070fc8a018791e687f15a /external | |
parent | c98891a4ba67a73d7a683ffb24845512705a4bbf (diff) |
less complicated Skia SSSE3 loop
I copy&pasted this from other code, but in this case it's simpler and
less confusing to not overrun the output buffer.
Change-Id: I782348d9870ac1e87c49e2267953c2f6299dbcd0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112537
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'external')
-rw-r--r-- | external/skia/source/skia_opts_internal.hxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/external/skia/source/skia_opts_internal.hxx b/external/skia/source/skia_opts_internal.hxx index 1f46ee72eb4a..0ca6a04351d2 100644 --- a/external/skia/source/skia_opts_internal.hxx +++ b/external/skia/source/skia_opts_internal.hxx @@ -52,15 +52,13 @@ inline void RGB1_to_R(uint8_t dst[], const uint32_t* src, int count) { const uint8_t X = 0xFF; // Used a placeholder. The value of X is irrelevant. __m128i pack = _mm_setr_epi8(0,4,8,12, X,X,X,X,X,X,X,X,X,X,X,X); -// Storing 4 pixels should store 4 bytes, but here it stores 16, so test count >= 16 -// in order to not overrun the output buffer. - while (count >= 16) { + while (count >= 4) { __m128i rgba = _mm_loadu_si128((const __m128i*) src); __m128i rgb = _mm_shuffle_epi8(rgba, pack); // Store 4 pixels. - _mm_storeu_si128((__m128i*) dst, rgb); + *((uint32_t*)dst) = _mm_cvtsi128_si32(rgb); src += 4; dst += 4; |