Index: src/opts/SkBitmapProcState_opts_SSE2.cpp |
diff --git a/src/opts/SkBitmapProcState_opts_SSE2.cpp b/src/opts/SkBitmapProcState_opts_SSE2.cpp |
index 0b079977eb8de089f2a773cbcbd4244de3949bc8..54a2f2dab4b0df8df9359aa24b3d870418bad07d 100644 |
--- a/src/opts/SkBitmapProcState_opts_SSE2.cpp |
+++ b/src/opts/SkBitmapProcState_opts_SSE2.cpp |
@@ -9,6 +9,7 @@ |
#include <emmintrin.h> |
#include "SkBitmapProcState_opts_SSE2.h" |
+#include "SkColorPriv.h" |
#include "SkPaint.h" |
#include "SkUtils.h" |
@@ -639,8 +640,8 @@ void ClampX_ClampY_nofilter_affine_SSE2(const SkBitmapProcState& s, |
* It combines S32_opaque_D32_filter_DX_SSE2 and SkPixel32ToPixel16 |
*/ |
void S32_D16_filter_DX_SSE2(const SkBitmapProcState& s, |
- const uint32_t* xy, |
- int count, uint16_t* colors) { |
+ const uint32_t* xy, |
+ int count, uint16_t* colors) { |
SkASSERT(count > 0 && colors != NULL); |
SkASSERT(s.fFilterLevel != SkPaint::kNone_FilterLevel); |
SkASSERT(s.fBitmap->config() == SkBitmap::kARGB_8888_Config); |
@@ -744,23 +745,6 @@ void S32_D16_filter_DX_SSE2(const SkBitmapProcState& s, |
// Extract low int and store. |
dstColor = _mm_cvtsi128_si32(sum); |
- //*colors++ = SkPixel32ToPixel16(dstColor); |
- // below is much faster than the above. It's tested for Android benchmark--Softweg |
- __m128i _m_temp1 = _mm_set1_epi32(dstColor); |
- __m128i _m_temp2 = _mm_srli_epi32(_m_temp1, 3); |
- |
- unsigned int r32 = _mm_cvtsi128_si32(_m_temp2); |
- unsigned r = (r32 & ((1<<5) -1)) << 11; |
- |
- _m_temp2 = _mm_srli_epi32(_m_temp2, 7); |
- unsigned int g32 = _mm_cvtsi128_si32(_m_temp2); |
- unsigned g = (g32 & ((1<<6) -1)) << 5; |
- |
- _m_temp2 = _mm_srli_epi32(_m_temp2, 9); |
- unsigned int b32 = _mm_cvtsi128_si32(_m_temp2); |
- unsigned b = (b32 & ((1<<5) -1)); |
- |
- *colors++ = r | g | b; |
- |
+ *colors++ = SkPixel32ToPixel16(dstColor); |
} while (--count > 0); |
} |