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

Side by Side Diff: src/opts/SkBitmapProcState_opts_SSSE3.cpp

Issue 773753002: Add SSSE3 acceleration for S32_D16_filter_DXDY (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmapProcState_opts_SSSE3.h" 8 #include "SkBitmapProcState_opts_SSSE3.h"
9 #include "SkColorPriv.h"
9 #include "SkPaint.h" 10 #include "SkPaint.h"
10 #include "SkUtils.h" 11 #include "SkUtils.h"
11 12
12 /* With the exception of the compilers that don't support it, we always build th e 13 /* With the exception of the compilers that don't support it, we always build th e
13 * SSSE3 functions and enable the caller to determine SSSE3 support. However fo r 14 * SSSE3 functions and enable the caller to determine SSSE3 support. However fo r
14 * compilers that do not support SSSE3 we provide a stub implementation. 15 * compilers that do not support SSSE3 we provide a stub implementation.
15 */ 16 */
16 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 17 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3
17 18
18 #include <tmmintrin.h> // SSSE3 19 #include <tmmintrin.h> // SSSE3
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 S32_generic_D32_filter_DX_SSSE3<false>(s, xy, count, colors); 714 S32_generic_D32_filter_DX_SSSE3<false>(s, xy, count, colors);
714 } 715 }
715 716
716 void S32_alpha_D32_filter_DX_SSSE3(const SkBitmapProcState& s, 717 void S32_alpha_D32_filter_DX_SSSE3(const SkBitmapProcState& s,
717 const uint32_t* xy, 718 const uint32_t* xy,
718 int count, uint32_t* colors) { 719 int count, uint32_t* colors) {
719 S32_generic_D32_filter_DX_SSSE3<true>(s, xy, count, colors); 720 S32_generic_D32_filter_DX_SSSE3<true>(s, xy, count, colors);
720 } 721 }
721 722
722 void S32_opaque_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, 723 void S32_opaque_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s,
723 const uint32_t* xy, 724 const uint32_t* xy,
724 int count, uint32_t* colors) { 725 int count, uint32_t* colors) {
725 S32_generic_D32_filter_DXDY_SSSE3<false>(s, xy, count, colors); 726 S32_generic_D32_filter_DXDY_SSSE3<false>(s, xy, count, colors);
726 } 727 }
727 728
728 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, 729 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s,
729 const uint32_t* xy, 730 const uint32_t* xy,
730 int count, uint32_t* colors) { 731 int count, uint32_t* colors) {
731 S32_generic_D32_filter_DXDY_SSSE3<true>(s, xy, count, colors); 732 S32_generic_D32_filter_DXDY_SSSE3<true>(s, xy, count, colors);
732 } 733 }
733 734
735 void S32_D16_filter_DXDY_SSSE3(const SkBitmapProcState& s,
736 const uint32_t* xy,
737 int count, uint16_t* colors) {
738 SkAutoTMalloc<uint32_t> colors32(count);
qiankun 2014/12/02 10:51:41 If "uint32_t colors32[128];" used here, it's more
mtklein 2014/12/02 15:19:05 Might be worth trying SkAutoSTMalloc<64, uint32_t>
qiankun1 2014/12/02 15:58:43 Done. Where is these performance improvement from?
mtklein 2014/12/02 16:52:22 Right, just heap vs. stack. There's no difference
739 S32_generic_D32_filter_DXDY_SSSE3<false>(s, xy, count, colors32);
740 for(int i = 0; i < count; i++) {
741 *colors++ = SkPixel32ToPixel16(colors32[i]);
742 }
743 }
744
734 #else // SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 745 #else // SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3
735 746
736 void S32_opaque_D32_filter_DX_SSSE3(const SkBitmapProcState& s, 747 void S32_opaque_D32_filter_DX_SSSE3(const SkBitmapProcState& s,
737 const uint32_t* xy, 748 const uint32_t* xy,
738 int count, uint32_t* colors) { 749 int count, uint32_t* colors) {
739 sk_throw(); 750 sk_throw();
740 } 751 }
741 752
742 void S32_alpha_D32_filter_DX_SSSE3(const SkBitmapProcState& s, 753 void S32_alpha_D32_filter_DX_SSSE3(const SkBitmapProcState& s,
743 const uint32_t* xy, 754 const uint32_t* xy,
744 int count, uint32_t* colors) { 755 int count, uint32_t* colors) {
745 sk_throw(); 756 sk_throw();
746 } 757 }
747 758
748 void S32_opaque_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, 759 void S32_opaque_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s,
749 const uint32_t* xy, 760 const uint32_t* xy,
750 int count, uint32_t* colors) { 761 int count, uint32_t* colors) {
751 sk_throw(); 762 sk_throw();
752 } 763 }
753 764
754 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, 765 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s,
755 const uint32_t* xy, 766 const uint32_t* xy,
756 int count, uint32_t* colors) { 767 int count, uint32_t* colors) {
757 sk_throw(); 768 sk_throw();
758 } 769 }
759 770
771 void S32_D16_filter_DXDY_SSSE3(const SkBitmapProcState& s,
772 const uint32_t* xy,
773 int count, uint32_t* colors) {
774 sk_throw();
775 }
776
760 #endif 777 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698