aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-05-23 11:31:14 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-23 16:06:11 +0000
commit5373609d90d8f84b75718b15f3522f9d2f4226cb (patch)
tree10b3c27a101f94afce734df4dc003ce953ce7f7a /src
parent435071e8ab865e395bec34ef128a412ceb50f063 (diff)
add knob to turn off fancy SkJumper features
This is a new public API for testing (layout tests). Change-Id: I10345231bad373c741b1e9656e546000538121b3 Reviewed-on: https://skia-review.googlesource.com/17712 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/core/SkGraphics.cpp5
-rw-r--r--src/jumper/SkJumper.cpp8
-rw-r--r--src/jumper/SkJumper.h2
3 files changed, 12 insertions, 3 deletions
diff --git a/src/core/SkGraphics.cpp b/src/core/SkGraphics.cpp
index 803b7435bb..015b820538 100644
--- a/src/core/SkGraphics.cpp
+++ b/src/core/SkGraphics.cpp
@@ -28,6 +28,7 @@
#include "SkTSearch.h"
#include "SkTime.h"
#include "SkUtils.h"
+#include "../jumper/SkJumper.h"
#include <stdlib.h>
@@ -109,3 +110,7 @@ void SkGraphics::SetFlags(const char* flags) {
flags = nextSemi + 1;
} while (nextSemi);
}
+
+void SkGraphics::DisableFancySkJumperFeatures() {
+ gSkJumperEnableFancyFeatures = false;
+}
diff --git a/src/jumper/SkJumper.cpp b/src/jumper/SkJumper.cpp
index 8daf29eb88..f8354ce388 100644
--- a/src/jumper/SkJumper.cpp
+++ b/src/jumper/SkJumper.cpp
@@ -114,6 +114,8 @@ static const SkJumper_Engine kPortable = {
static SkJumper_Engine gPlatform = kPortable;
static SkOnce gChooseEngineOnce;
+bool gSkJumperEnableFancyFeatures = true;
+
static SkJumper_Engine choose_engine() {
#if __has_feature(memory_sanitizer)
// We'll just run portable code.
@@ -137,7 +139,7 @@ static SkJumper_Engine choose_engine() {
}
#elif defined(__x86_64__) || defined(_M_X64)
- if (1 && SkCpu::Supports(SkCpu::HSW)) {
+ if (gSkJumperEnableFancyFeatures && SkCpu::Supports(SkCpu::HSW)) {
return {
#define M(stage) ASM(stage, hsw),
{ SK_RASTER_PIPELINE_STAGES(M) },
@@ -145,7 +147,7 @@ static SkJumper_Engine choose_engine() {
#undef M
};
}
- if (1 && SkCpu::Supports(SkCpu::AVX)) {
+ if (gSkJumperEnableFancyFeatures && SkCpu::Supports(SkCpu::AVX)) {
return {
#define M(stage) ASM(stage, avx),
{ SK_RASTER_PIPELINE_STAGES(M) },
@@ -153,7 +155,7 @@ static SkJumper_Engine choose_engine() {
#undef M
};
}
- if (1 && SkCpu::Supports(SkCpu::SSE41)) {
+ if (gSkJumperEnableFancyFeatures && SkCpu::Supports(SkCpu::SSE41)) {
return {
#define M(stage) ASM(stage, sse41),
{ SK_RASTER_PIPELINE_STAGES(M) },
diff --git a/src/jumper/SkJumper.h b/src/jumper/SkJumper.h
index 7d6d0afa31..b0a781c05c 100644
--- a/src/jumper/SkJumper.h
+++ b/src/jumper/SkJumper.h
@@ -8,6 +8,8 @@
#ifndef SkJumper_DEFINED
#define SkJumper_DEFINED
+extern bool gSkJumperEnableFancyFeatures;
+
// This file contains definitions shared by SkJumper.cpp (compiled normally as part of Skia)
// and SkJumper_stages.cpp (compiled into Skia _and_ offline into SkJumper_generated.h).
// Keep it simple!