Index: src/core/SkOpts.cpp |
diff --git a/src/core/SkOpts.cpp b/src/core/SkOpts.cpp |
index 50659d4590fa95948b02cd1fea2e16afbe274528..102247ed08edfcc3d97f2459dca474519eea91f4 100644 |
--- a/src/core/SkOpts.cpp |
+++ b/src/core/SkOpts.cpp |
@@ -19,6 +19,7 @@ |
#include "SkSwizzler_opts.h" |
#include "SkTextureCompressor_opts.h" |
#include "SkXfermode_opts.h" |
+#include "SkMatrixConvolutionImageFilter_opts.h" |
namespace SK_OPTS_NS { |
static void float_to_half(uint16_t dst[], const float src[], int n) { |
@@ -106,19 +107,29 @@ namespace SkOpts { |
decltype(half_to_float) half_to_float = sk_default::half_to_float; |
decltype(float_to_half) float_to_half = sk_default::float_to_half; |
+ decltype(matrix_convolution_image_filter_filter_pixels) matrix_convolution_image_filter_filter_pixels = sk_default::SkMatrixConvolutionImageFilter_filterPixels_none; |
+ |
// Each Init_foo() is defined in src/opts/SkOpts_foo.cpp. |
+ void Init_sse_sse2(); |
void Init_ssse3(); |
void Init_sse41(); |
void Init_sse42() {} |
void Init_avx() {} |
- void Init_avx2() {} |
+ void Init_avx2(); |
void Init_neon(); |
static void init() { |
// TODO: Chrome's not linking _sse* opts on iOS simulator builds. Bug or feature? |
#if defined(SK_CPU_X86) && !defined(SK_BUILD_FOR_IOS) |
+ |
+ // 'opts' target for x86 is already compiled with -msse2. Therefore, MMX, SSE, SSE2 |
+ // should be supported by every x86 CPU. So, just call Init_sse_sse2 function without |
+ // any additional check. |
+ Init_sse_sse2(); |
+ |
uint32_t abcd[] = {0,0,0,0}; |
cpuid(abcd); |
+ |
if (abcd[2] & (1<< 9)) { Init_ssse3(); } |
if (abcd[2] & (1<<19)) { Init_sse41(); } |
if (abcd[2] & (1<<20)) { Init_sse42(); } |