Index: src/opts/SkBlitRow_opts_SSE2.cpp |
diff --git a/src/opts/SkBlitRow_opts_SSE2.cpp b/src/opts/SkBlitRow_opts_SSE2.cpp |
index 391b24c8673809c9a40a0225be52129af2369237..363cdab9f0390daf7847dba10f95cbeebfdda199 100644 |
--- a/src/opts/SkBlitRow_opts_SSE2.cpp |
+++ b/src/opts/SkBlitRow_opts_SSE2.cpp |
@@ -436,21 +436,20 @@ void SkARGB32_A8_BlitMask_SSE2(void* device, size_t dstRB, const void* maskPtr, |
__m128i c_256 = _mm_set1_epi16(256); |
__m128i c_1 = _mm_set1_epi16(1); |
__m128i src_pixel = _mm_set1_epi32(color); |
while (count >= 4) { |
// Load 4 pixels each of src and dest. |
__m128i dst_pixel = _mm_load_si128(d); |
//set the aphla value |
- __m128i src_scale_wide = _mm_set_epi8(0, *(mask+3),\ |
- 0, *(mask+3),0, \ |
- *(mask+2),0, *(mask+2),\ |
- 0,*(mask+1), 0,*(mask+1),\ |
- 0, *mask,0,*mask); |
+ __m128i src_scale_wide = _mm_cvtsi32_si128(*reinterpret_cast<const uint32_t*>(mask)); |
+ src_scale_wide = _mm_unpacklo_epi8(src_scale_wide, |
+ _mm_setzero_si128()); |
+ src_scale_wide = _mm_unpacklo_epi16(src_scale_wide, src_scale_wide); |
//call SkAlpha255To256() |
src_scale_wide = _mm_add_epi16(src_scale_wide, c_1); |
// Get red and blue pixels into lower byte of each word. |
__m128i dst_rb = _mm_and_si128(rb_mask, dst_pixel); |
__m128i src_rb = _mm_and_si128(rb_mask, src_pixel); |