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

Unified Diff: src/opts/SkBitmapProcState_opts_SSE2.cpp

Issue 239453010: Properly enable S32_D16_filter_DX_SSE2 optimization. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Removed obsolete code Created 6 years, 8 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 | « no previous file | src/opts/opts_check_SSE2.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | src/opts/opts_check_SSE2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698