Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(869)

Unified Diff: src/opts/SkBlitRow_opts_SSE2.cpp

Issue 609823003: Improve SkARGB32_A8_BlitMask_SSE2 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Improve SkARGB32_A8_BlitMask_SSE2 Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698