From c7ad40f76f6f23b3acd73b53e989220fd71f2da2 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Thu, 31 May 2018 14:27:17 -0400 Subject: Remove SK_SUPPORT_GPU checks in tool-only code Most of this is (obviously) not necessary to do, but once I started, I figured I'd just get it all. Tools (nanobench, DM, skiaserve), all GMs, benches, and unit tests, plus support code (command line parsing and config stuff). This is almost entirely mechanical. Bug: skia: Change-Id: I209500f8df8c5bd43f8298ff26440d1c4d7425fb Reviewed-on: https://skia-review.googlesource.com/131153 Reviewed-by: Mike Klein Reviewed-by: Brian Salomon Commit-Queue: Brian Osman --- dm/DM.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'dm/DM.cpp') diff --git a/dm/DM.cpp b/dm/DM.cpp index 3551a8c8f2..69c2504191 100644 --- a/dm/DM.cpp +++ b/dm/DM.cpp @@ -857,17 +857,8 @@ static void push_sink(const SkCommandLineConfig& config, Sink* s) { ts.tag = config.getTag(); } -static bool gpu_supported() { -#if SK_SUPPORT_GPU - return FLAGS_gpu; -#else - return false; -#endif -} - static Sink* create_sink(const GrContextOptions& grCtxOptions, const SkCommandLineConfig* config) { -#if SK_SUPPORT_GPU - if (gpu_supported()) { + if (FLAGS_gpu) { if (const SkCommandLineConfigGpu* gpuConfig = config->asConfigGpu()) { GrContextFactory::ContextType contextType = gpuConfig->getContextType(); GrContextFactory::ContextOverrides contextOverrides = gpuConfig->getContextOverrides(); @@ -892,7 +883,6 @@ static Sink* create_sink(const GrContextOptions& grCtxOptions, const SkCommandLi } } } -#endif if (const SkCommandLineConfigSvg* svgConfig = config->asConfigSvg()) { int pageIndex = svgConfig->getPageIndex(); return new SVGSink(pageIndex); @@ -1273,7 +1263,7 @@ static void gather_tests() { if (SkCommandLineFlags::ShouldSkip(FLAGS_match, test.name)) { continue; } - if (test.needsGpu && gpu_supported()) { + if (test.needsGpu && FLAGS_gpu) { (FLAGS_gpu_threading ? gParallelTests : gSerialTests).push(test); } else if (!test.needsGpu && FLAGS_cpu) { gParallelTests.push(test); @@ -1366,9 +1356,7 @@ int main(int argc, char** argv) { } GrContextOptions grCtxOptions; -#if SK_SUPPORT_GPU SetCtxOptionsFromCommonFlags(&grCtxOptions); -#endif JsonWriter::DumpJson(); // It's handy for the bots to assume this is ~never missing. SkAutoGraphics ag; -- cgit v1.2.3