From 008b9d80ab9adbf2656eceaf54d11cd15e4dda05 Mon Sep 17 00:00:00 2001 From: csmartdalton Date: Wed, 22 Feb 2017 12:00:42 -0700 Subject: Add the ability to enable/disable GPU path renderers Adds a bitfield to GrContextOptions that masks out path renderers. Adds commandline flags support to set this bitfield in tools apps. Removes GrGLInterfaceRemoveNVPR since we can now accomplish the same thing in the context options. BUG=skia: Change-Id: Icf2a4df36374b3ba2f69ebf0db56e8aedd6cf65f Reviewed-on: https://skia-review.googlesource.com/8786 Reviewed-by: Brian Salomon Commit-Queue: Chris Dalton --- tools/skpbench/skpbench.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools/skpbench') diff --git a/tools/skpbench/skpbench.cpp b/tools/skpbench/skpbench.cpp index 3887c5ea88..569c204a72 100644 --- a/tools/skpbench/skpbench.cpp +++ b/tools/skpbench/skpbench.cpp @@ -8,6 +8,7 @@ #include "GpuTimer.h" #include "GrContextFactory.h" #include "SkCanvas.h" +#include "SkCommonFlagsPathRenderer.h" #include "SkOSFile.h" #include "SkOSPath.h" #include "SkPerlinNoiseShader.h" @@ -46,6 +47,7 @@ DEFINE_string(skp, "", "path to a single .skp file, or 'warmup' for a builtin wa DEFINE_string(png, "", "if set, save a .png proof to disk at this file location"); DEFINE_int32(verbosity, 4, "level of verbosity (0=none to 5=debug)"); DEFINE_bool(suppressHeader, false, "don't print a header row before the results"); +DEFINE_pathrenderer_flag; static const char* header = " accum median max min stddev samples sample_ms clock metric config bench"; @@ -271,7 +273,9 @@ int main(int argc, char** argv) { } // Create a context. - sk_gpu_test::GrContextFactory factory; + GrContextOptions ctxOptions; + ctxOptions.fGpuPathRenderers = CollectGpuPathRenderersFromFlags(); + sk_gpu_test::GrContextFactory factory(ctxOptions); sk_gpu_test::ContextInfo ctxInfo = factory.getContextInfo(config->getContextType(), config->getContextOverrides()); GrContext* ctx = ctxInfo.grContext(); -- cgit v1.2.3