aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar marco.diiga <marco.diiga@gmail.com>2016-03-21 06:04:43 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-21 06:04:43 -0700
commitf8ee67edb8e5fed34bf4d5208bce89ea8be1ac1e (patch)
tree29872f02ba09786d8a72419ca15c186d4eae95ad
parent2c9c469cc91716c3b3637562b62b549016a9967f (diff)
Fix for unaligned automatic variable address in SSE routines. This used to work on linux but crashed on windows when rendering antialiased glyphs. I tracked the problem down to an alignment issue.
-rw-r--r--AUTHORS1
-rw-r--r--src/opts/SkOpts_sse41.cpp3
2 files changed, 2 insertions, 2 deletions
diff --git a/AUTHORS b/AUTHORS
index 4b3c09ed9c..893569c3b4 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -39,3 +39,4 @@ Thiago Fransosi Farina <thiago.farina@gmail.com>
Jose Mayol <jei.mayol@gmail.com>
Linaro <*@linaro.org>
Christian Plesner Hansen <plesner@t.undra.org>
+Marco Alesiani <marco.diiga@gmail.com> \ No newline at end of file
diff --git a/src/opts/SkOpts_sse41.cpp b/src/opts/SkOpts_sse41.cpp
index f097e56c5e..7a76081e7a 100644
--- a/src/opts/SkOpts_sse41.cpp
+++ b/src/opts/SkOpts_sse41.cpp
@@ -50,8 +50,7 @@ static m64i next1(const uint32_t*& ptr) {
// xyzw -> xxxx yyyy zzzz wwww
static __m128i replicate_coverage(__m128i xyzw) {
- const uint8_t mask[] = { 0,0,0,0, 1,1,1,1, 2,2,2,2, 3,3,3,3 };
- return _mm_shuffle_epi8(xyzw, _mm_load_si128((const __m128i*)mask));
+ return _mm_shuffle_epi8(xyzw, _mm_setr_epi8(0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3));
}
static __m128i next4(const uint8_t*& ptr) {