diff options
-rw-r--r-- | gn/core.gni | 9 | ||||
-rw-r--r-- | src/jumper/SkJumper.cpp | 22 |
2 files changed, 25 insertions, 6 deletions
diff --git a/gn/core.gni b/gn/core.gni index 748e44acc0..eb0d0d2eaf 100644 --- a/gn/core.gni +++ b/gn/core.gni @@ -521,8 +521,15 @@ skia_core_sources += [ "$_src/jumper/SkJumper_stages.cpp", "$_src/jumper/SkJumper_stages_lowp.cpp", ] +skia_core_defines = [] if (is_win) { - skia_core_sources += [ "$_src/jumper/SkJumper_generated_win.S" ] + if (host_os == "win") { + skia_core_sources += [ "$_src/jumper/SkJumper_generated_win.S" ] + } else { + # TODO(thakis): Enable jumper in linux->win cross builds once the + # assembler situation is figured out, https://crbug.com/762167 + skia_core_defines += [ "SK_JUMPER_USE_ASSEMBLY=0" ] + } } else { skia_core_sources += [ "$_src/jumper/SkJumper_generated.S" ] } diff --git a/src/jumper/SkJumper.cpp b/src/jumper/SkJumper.cpp index 22d6e086d4..cd013f7ae3 100644 --- a/src/jumper/SkJumper.cpp +++ b/src/jumper/SkJumper.cpp @@ -17,13 +17,21 @@ #if !defined(__has_feature) #define __has_feature(x) 0 #endif +#if !defined(SK_JUMPER_USE_ASSEMBLY) +#if __has_feature(memory_sanitizer) +#define SK_JUMPER_USE_ASSEMBLY 0 +#else +#define SK_JUMPER_USE_ASSEMBLY 1 +#endif +#endif #define M(st) +1 static const int kNumStages = SK_RASTER_PIPELINE_STAGES(M); #undef M #ifndef SK_JUMPER_DISABLE_8BIT - #if 0 && !__has_feature(memory_sanitizer) && (defined(__x86_64__) || defined(_M_X64)) + // Intentionally commented out; optional logging for local debugging. + #if 0 && SK_JUMPER_USE_ASSEMBLY && (defined(__x86_64__) || defined(_M_X64)) #include <atomic> #define M(st) #st, @@ -102,7 +110,7 @@ using StartPipelineFn = void(size_t,size_t,size_t,size_t, void**); extern "C" { -#if __has_feature(memory_sanitizer) +#if !SK_JUMPER_USE_ASSEMBLY // We'll just run baseline code. #elif defined(__arm__) @@ -172,7 +180,8 @@ extern "C" { } -#if !__has_feature(memory_sanitizer) && (defined(__x86_64__) || defined(_M_X64)) +#if SK_JUMPER_USE_ASSEMBLY +#if defined(__x86_64__) || defined(_M_X64) template <SkRasterPipeline::StockStage st> static constexpr StageFn* hsw_lowp() { return nullptr; } @@ -217,6 +226,7 @@ extern "C" { LOWP_STAGES(M) #undef M #endif +#endif // Engines comprise everything we need to run SkRasterPipelines. struct SkJumper_Engine { @@ -237,7 +247,7 @@ static SkJumper_Engine gEngine = kBaseline; static SkOnce gChooseEngineOnce; static SkJumper_Engine choose_engine() { -#if __has_feature(memory_sanitizer) +#if !SK_JUMPER_USE_ASSEMBLY // We'll just run baseline code. #elif defined(__arm__) @@ -316,7 +326,8 @@ static SkJumper_Engine choose_engine() { static SkOnce gChooseLowpOnce; static SkJumper_Engine choose_lowp() { - #if !__has_feature(memory_sanitizer) && (defined(__x86_64__) || defined(_M_X64)) + #if SK_JUMPER_USE_ASSEMBLY + #if defined(__x86_64__) || defined(_M_X64) if (1 && SkCpu::Supports(SkCpu::HSW)) { return { #define M(st) hsw_lowp<SkRasterPipeline::st>(), @@ -364,6 +375,7 @@ static SkJumper_Engine choose_engine() { #undef M }; #endif + #endif return kNone; } #endif |