From 88235bbbbe51cc58af8c89f74ef153b433934dd6 Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Thu, 26 Jan 2017 16:23:26 -0500 Subject: [PATCH] Graceful degredation for SkOpts_hsw. __AVX2__ will not be defined if you omit -mavx2. Android does this intentionally for x86 builds. (No mobile CPU supports AVX2 AFAIK.) This should fix the Android roll. Change-Id: Ib94c862641abc11fbb46863afc53bcc049f362ad Reviewed-on: https://skia-review.googlesource.com/7633 Commit-Queue: Mike Klein Reviewed-by: Mike Klein Reviewed-by: Matt Sarett --- src/opts/SkOpts_hsw.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/opts/SkOpts_hsw.cpp b/src/opts/SkOpts_hsw.cpp index 843dcb59c6..f14d2a5aea 100644 --- a/src/opts/SkOpts_hsw.cpp +++ b/src/opts/SkOpts_hsw.cpp @@ -12,6 +12,8 @@ #include // ODR safe #include // ODR safe +#if defined(__AVX2__) + namespace hsw { void convolve_vertically(const int16_t* filter, int filterLen, @@ -94,3 +96,9 @@ namespace SkOpts { convolve_vertically = hsw::convolve_vertically; } } + +#else // defined(__AVX2__) is not true... + +namespace SkOpts { void Init_hsw() {} } + +#endif -- 2.34.1