diff options
Diffstat (limited to 'tools/flags/SkCommonFlags.cpp')
-rw-r--r-- | tools/flags/SkCommonFlags.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/flags/SkCommonFlags.cpp b/tools/flags/SkCommonFlags.cpp index facbd3139b..0986d2b57c 100644 --- a/tools/flags/SkCommonFlags.cpp +++ b/tools/flags/SkCommonFlags.cpp @@ -6,6 +6,8 @@ */ #include "SkCommonFlags.h" +#include "SkExecutor.h" +#include "SkOnce.h" #include "SkOSFile.h" #include "SkOSPath.h" @@ -54,6 +56,9 @@ DEFINE_string(svgs, "", "Directory to read SVGs from, or a single SVG file."); DEFINE_int32_2(threads, j, -1, "Run threadsafe tests on a threadpool with this many extra threads, " "defaulting to one extra thread per core."); +DEFINE_int32(gpuThreads, 0, "Create this many extra threads to assist with GPU work, " + "including software path rendering."); + DEFINE_bool2(verbose, v, false, "enable verbose output from the test driver."); DEFINE_bool2(veryVerbose, V, false, "tell individual tests to be verbose."); @@ -123,3 +128,9 @@ bool CollectImages(SkCommandLineFlags::StringArray images, SkTArray<SkString>* o } return true; } + +SkExecutor* GpuExecutorForTools() { + static std::unique_ptr<SkExecutor> gGpuExecutor = (0 != FLAGS_gpuThreads) + ? SkExecutor::MakeThreadPool(FLAGS_gpuThreads) : nullptr; + return gGpuExecutor.get(); +} |