Revert of Add config options to run different GPU APIs to dm and nanobench (patchset #21 id:400001 of https://codereview.chromium.org/1490113005/ )

Reason for revert:
The Test-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Debug builder fails after this CL.

Links to specific builds:
http://build.chromium.org/p/client.skia/builders/Test-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Debug/builds/1689
http://build.chromium.org/p/client.skia/builders/Test-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Debug/builds/1690
http://build.chromium.org/p/client.skia/builders/Test-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Debug/builds/1691

Original issue's description:
> Add config options to run different GPU APIs to dm and nanobench
>
> Add extended config specification form that can be used to run different
> gpu backend with different APIs.
>
> The configs can be specified with the form:
> gpu(api=string,dit=bool,nvpr=bool,samples=int)
>
> This replaces and removes the --gpuAPI flag.
>
> All existing configs should still work.
>
> Adds following documentation:
>
> out/Debug/dm --help config
>
> Flags:
>     --config:	type: string	default: 565 8888 gpu nonrendering
>         Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
>         nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
>         xps or use extended form 'backend(option=value,...)'.
>
>         Extended form: 'backend(option=value,...)'
>
>         Possible backends and options:
>
>         gpu(api=string,dit=bool,nvpr=bool,samples=int)	GPU backend
>         	api	type: string	default: native.
>         	    Select graphics API to use with gpu backend.
>         	    Options:
>         		native			Use platform default OpenGL or OpenGL ES backend.
>         		gl    			Use OpenGL.
>         		gles  			Use OpenGL ES.
>         		debug 			Use debug OpenGL.
>         		null  			Use null OpenGL.
>         	dit	type: bool	default: false.
>         	    Use device independent text.
>         	nvpr	type: bool	default: false.
>         	    Use NV_path_rendering OpenGL and OpenGL ES extension.
>         	samples	type: int	default: 0.
>         	    Use multisampling with N samples.
>
>         Predefined configs:
>
>         	gpu      	= gpu()
>         	msaa4    	= gpu(samples=4)
>         	msaa16   	= gpu(samples=16)
>         	nvprmsaa4	= gpu(nvpr=true,samples=4)
>         	nvprmsaa16	= gpu(nvpr=true,samples=16)
>         	gpudft    	= gpu(dit=true)
>         	gpudebug  	= gpu(api=debug)
>         	gpunull   	= gpu(api=null)
>         	debug     	= gpu(api=debug)
>         	nullgpu   	= gpu(api=null)
>
> BUG=skia:2992
>
> Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1490113005
>
> Committed: https://skia.googlesource.com/skia/+/c8b4336444e7b90382e04e33665fb3b8490b825b
>
> Committed: https://skia.googlesource.com/skia/+/9ebc3f0ee6db215dde461dc4777d85988cf272dd

TBR=mtklein@google.com,bsalomon@google.com,joshualitt@google.com,scroggo@google.com,kkinnunen@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:2992

Review URL: https://codereview.chromium.org/1548683002
diff --git a/tools/flags/SkCommandLineFlags.cpp b/tools/flags/SkCommandLineFlags.cpp
index cddf9fb..9b2c961 100644
--- a/tools/flags/SkCommandLineFlags.cpp
+++ b/tools/flags/SkCommandLineFlags.cpp
@@ -22,10 +22,8 @@
 
 bool SkFlagInfo::CreateStringFlag(const char* name, const char* shortName,
                                   SkCommandLineFlags::StringArray* pStrings,
-                                  const char* defaultValue, const char* helpString,
-                                  const char* extendedHelpString) {
-    SkFlagInfo* info = new SkFlagInfo(name, shortName, kString_FlagType, helpString,
-                                      extendedHelpString);
+                                  const char* defaultValue, const char* helpString) {
+    SkFlagInfo* info = new SkFlagInfo(name, shortName, kString_FlagType, helpString);
     info->fDefaultString.set(defaultValue);
 
     info->fStrings = pStrings;
@@ -153,16 +151,29 @@
 // Maximum line length for the help message.
 #define LINE_LENGTH 72
 
-static void print_indented(const SkString& text) {
-    size_t length = text.size();
-    const char* currLine = text.c_str();
+static void print_help_for_flag(const SkFlagInfo* flag) {
+    SkDebugf("    --%s", flag->name().c_str());
+    const SkString& shortName = flag->shortName();
+    if (shortName.size() > 0) {
+        SkDebugf(" or -%s", shortName.c_str());
+    }
+    SkDebugf(":\ttype: %s", flag->typeAsString().c_str());
+    if (flag->defaultValue().size() > 0) {
+        SkDebugf("\tdefault: %s", flag->defaultValue().c_str());
+    }
+    SkDebugf("\n");
+    const SkString& help = flag->help();
+    size_t length = help.size();
+    const char* currLine = help.c_str();
     const char* stop = currLine + length;
     while (currLine < stop) {
-        int lineBreak = SkStrFind(currLine, "\n");
-        if (lineBreak < 0) {
-            lineBreak = static_cast<int>(strlen(currLine));
+        if (strlen(currLine) < LINE_LENGTH) {
+            // Only one line length's worth of text left.
+            SkDebugf("        %s\n", currLine);
+            break;
         }
-        if (lineBreak > LINE_LENGTH) {
+        int lineBreak = SkStrFind(currLine, "\n");
+        if (lineBreak < 0 || lineBreak > LINE_LENGTH) {
             // No line break within line length. Will need to insert one.
             // Find a space before the line break.
             int spaceIndex = LINE_LENGTH - 1;
@@ -187,26 +198,6 @@
             currLine += lineBreak;
         }
     }
-}
-
-static void print_help_for_flag(const SkFlagInfo* flag) {
-    SkDebugf("    --%s", flag->name().c_str());
-    const SkString& shortName = flag->shortName();
-    if (shortName.size() > 0) {
-        SkDebugf(" or -%s", shortName.c_str());
-    }
-    SkDebugf(":\ttype: %s", flag->typeAsString().c_str());
-    if (flag->defaultValue().size() > 0) {
-        SkDebugf("\tdefault: %s", flag->defaultValue().c_str());
-    }
-    SkDebugf("\n");
-    const SkString& help = flag->help();
-    print_indented(help);
-    SkDebugf("\n");
-}
-static void print_extended_help_for_flag(const SkFlagInfo* flag) {
-    print_help_for_flag(flag);
-    print_indented(flag->extendedHelp());
     SkDebugf("\n");
 }
 
@@ -257,10 +248,6 @@
                          CompareFlagsByName());
                 for (int i = 0; i < allFlags.count(); ++i) {
                     print_help_for_flag(allFlags[i]);
-                    if (allFlags[i]->extendedHelp().size() > 0) {
-                        SkDebugf("        Use '--help %s' for more information.\n",
-                                 allFlags[i]->name().c_str());
-                    }
                 }
             } else {
                 for (SkFlagInfo* flag = SkCommandLineFlags::gHead; flag;
@@ -268,7 +255,7 @@
                     for (int k = 0; k < helpFlags.count(); k++) {
                         if (flag->name().equals(helpFlags[k]) ||
                             flag->shortName().equals(helpFlags[k])) {
-                            print_extended_help_for_flag(flag);
+                            print_help_for_flag(flag);
                             helpFlags.remove(k);
                             break;
                         }
diff --git a/tools/flags/SkCommandLineFlags.h b/tools/flags/SkCommandLineFlags.h
index 909718d..5909413 100644
--- a/tools/flags/SkCommandLineFlags.h
+++ b/tools/flags/SkCommandLineFlags.h
@@ -76,11 +76,6 @@
  *  as its value. All strings that follow the flag on the command line (until
  *  a string that begins with '-') will be entries in the array.
  *
- *  DEFINE_extended_string(args, .., .., extendedHelpString);
- *
- *  creates a similar string array flag as DEFINE_string. The flag will have extended help text
- *  (extendedHelpString) that can the user can see with '--help <args>' flag.
- *
  *  Any flag can be referenced from another file after using the following:
  *
  *  DECLARE_x(name);
@@ -119,10 +114,6 @@
      */
     class StringArray {
     public:
-        StringArray() { }
-        explicit StringArray(const SkTArray<SkString>& strings)
-            : fStrings(strings) {
-        }
         const char* operator[](int i) const {
             SkASSERT(i >= 0 && i < fStrings.count());
             return fStrings[i].c_str();
@@ -213,15 +204,7 @@
                                                                    nullptr,              \
                                                                    &FLAGS_##name,     \
                                                                    defaultValue,      \
-                                                                   helpString, nullptr)
-#define DEFINE_extended_string(name, defaultValue, helpString, extendedHelpString) \
-SkCommandLineFlags::StringArray FLAGS_##name;                                      \
-SK_UNUSED static bool unused_##name = SkFlagInfo::CreateStringFlag(TO_STRING(name),   \
-                                                                   nullptr, \
-                                                                   &FLAGS_##name, \
-                                                                   defaultValue, \
-                                                                   helpString, \
-                                                                   extendedHelpString)
+                                                                   helpString)
 
 // string2 allows specifying a short name. There is an assert that shortName
 // is only 1 character.
@@ -231,7 +214,7 @@
                                                                    TO_STRING(shortName),  \
                                                                    &FLAGS_##name,         \
                                                                    defaultValue,          \
-                                                                   helpString, nullptr)
+                                                                   helpString)
 
 #define DECLARE_string(name) extern SkCommandLineFlags::StringArray FLAGS_##name;
 
@@ -290,7 +273,7 @@
      */
     static bool CreateBoolFlag(const char* name, const char* shortName, bool* pBool,
                                bool defaultValue, const char* helpString) {
-        SkFlagInfo* info = new SkFlagInfo(name, shortName, kBool_FlagType, helpString, nullptr);
+        SkFlagInfo* info = new SkFlagInfo(name, shortName, kBool_FlagType, helpString);
         info->fBoolValue = pBool;
         *info->fBoolValue = info->fDefaultBool = defaultValue;
         return true;
@@ -304,15 +287,14 @@
      */
     static bool CreateStringFlag(const char* name, const char* shortName,
                                  SkCommandLineFlags::StringArray* pStrings,
-                                 const char* defaultValue, const char* helpString,
-                                 const char* extendedHelpString);
+                                 const char* defaultValue, const char* helpString);
 
     /**
      *  See comments for CreateBoolFlag.
      */
     static bool CreateIntFlag(const char* name, int32_t* pInt,
                               int32_t defaultValue, const char* helpString) {
-        SkFlagInfo* info = new SkFlagInfo(name, nullptr, kInt_FlagType, helpString, nullptr);
+        SkFlagInfo* info = new SkFlagInfo(name, nullptr, kInt_FlagType, helpString);
         info->fIntValue = pInt;
         *info->fIntValue = info->fDefaultInt = defaultValue;
         return true;
@@ -320,7 +302,7 @@
 
     static bool CreateIntFlag(const char* name, const char* shortName, int32_t* pInt,
                               int32_t defaultValue, const char* helpString) {
-        SkFlagInfo* info = new SkFlagInfo(name, shortName, kInt_FlagType, helpString, nullptr);
+        SkFlagInfo* info = new SkFlagInfo(name, shortName, kInt_FlagType, helpString);
         info->fIntValue = pInt;
         *info->fIntValue = info->fDefaultInt = defaultValue;
         return true;
@@ -331,7 +313,7 @@
      */
     static bool CreateDoubleFlag(const char* name, double* pDouble,
                                  double defaultValue, const char* helpString) {
-        SkFlagInfo* info = new SkFlagInfo(name, nullptr, kDouble_FlagType, helpString, nullptr);
+        SkFlagInfo* info = new SkFlagInfo(name, nullptr, kDouble_FlagType, helpString);
         info->fDoubleValue = pDouble;
         *info->fDoubleValue = info->fDefaultDouble = defaultValue;
         return true;
@@ -401,7 +383,6 @@
     const SkString& shortName() const { return fShortName; }
 
     const SkString& help() const { return fHelpString; }
-    const SkString& extendedHelp() const { return fExtendedHelpString; }
 
     SkString defaultValue() const {
         SkString result;
@@ -440,13 +421,11 @@
     }
 
 private:
-    SkFlagInfo(const char* name, const char* shortName, FlagTypes type, const char* helpString,
-               const char* extendedHelpString)
+    SkFlagInfo(const char* name, const char* shortName, FlagTypes type, const char* helpString)
         : fName(name)
         , fShortName(shortName)
         , fFlagType(type)
         , fHelpString(helpString)
-        , fExtendedHelpString(extendedHelpString)
         , fBoolValue(nullptr)
         , fDefaultBool(false)
         , fIntValue(nullptr)
@@ -474,7 +453,6 @@
     SkString             fShortName;
     FlagTypes            fFlagType;
     SkString             fHelpString;
-    SkString             fExtendedHelpString;
     bool*                fBoolValue;
     bool                 fDefaultBool;
     int32_t*             fIntValue;
diff --git a/tools/flags/SkCommonFlags.cpp b/tools/flags/SkCommonFlags.cpp
index a2da131..9783dde 100644
--- a/tools/flags/SkCommonFlags.cpp
+++ b/tools/flags/SkCommonFlags.cpp
@@ -7,6 +7,11 @@
 
 #include "SkCommonFlags.h"
 
+DEFINE_string(config, "565 8888 gpu nonrendering angle hwui ", "Options: "
+              "565 8888 angle debug gpu gpudebug gpudft gpunull hwui mesa "
+              "msaa16 msaa4 nonrendering null nullgpu nvprmsaa16 nvprmsaa4 "
+              "pdf skp svg xps (and maybe more)");
+
 DEFINE_bool(cpu, true, "master switch for running CPU-bound work.");
 
 DEFINE_bool(dryRun, false,
@@ -14,6 +19,11 @@
 
 DEFINE_bool(gpu, true, "master switch for running GPU-bound work.");
 
+DEFINE_string(gpuAPI, "", "Force use of specific gpu API.  Using \"gl\" "
+              "forces OpenGL API. Using \"gles\" forces OpenGL ES API. "
+              "Defaults to empty string, which selects the API native to the "
+              "system.");
+
 DEFINE_string(images, "", "Directory of images to decode.");
 
 DEFINE_string2(match, m, nullptr,
diff --git a/tools/flags/SkCommonFlags.h b/tools/flags/SkCommonFlags.h
index ddd8d3a..d6fb2c1 100644
--- a/tools/flags/SkCommonFlags.h
+++ b/tools/flags/SkCommonFlags.h
@@ -10,9 +10,11 @@
 
 #include "SkCommandLineFlags.h"
 
+DECLARE_string(config);
 DECLARE_bool(cpu);
 DECLARE_bool(dryRun);
 DECLARE_bool(gpu);
+DECLARE_string(gpuAPI);
 DECLARE_string(images);
 DECLARE_string(match);
 DECLARE_bool(quiet);
diff --git a/tools/flags/SkCommonFlagsConfig.cpp b/tools/flags/SkCommonFlagsConfig.cpp
deleted file mode 100644
index e9e2d75..0000000
--- a/tools/flags/SkCommonFlagsConfig.cpp
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkCommonFlagsConfig.h"
-
-#include <stdlib.h>
-
-static const char defaultConfigs[] =
-    "565 8888 gpu nonrendering"
-#if SK_ANGLE
-#ifdef SK_BUILD_FOR_WIN
-    " angle"
-#endif
-#endif
-#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
-    " hwui"
-#endif
-    ;
-
-static const char configHelp[] =
-    "Options: 565 8888 debug gpu gpudebug gpudft gpunull "
-    "msaa16 msaa4 nonrendering null nullgpu nvprmsaa16 nvprmsaa4 "
-    "pdf pdf_poppler skp svg xps"
-#if SK_ANGLE
-#ifdef SK_BUILD_FOR_WIN
-    " angle"
-#endif
-    " angle-gl"
-#endif
-#if SK_COMMAND_BUFFER
-    " commandbuffer"
-#endif
-#if SK_MESA
-    " mesa"
-#endif
-#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
-    " hwui"
-#endif
-    " or use extended form 'backend(option=value,...)'.\n";
-
-static const char configExtendedHelp[] =
-    "Extended form: 'backend(option=value,...)'\n\n"
-    "Possible backends and options:\n"
-#if SK_SUPPORT_GPU
-    "\n"
-    "gpu(api=string,dit=bool,nvpr=bool,samples=int)\tGPU backend\n"
-    "\tapi\ttype: string\tdefault: native.\n"
-    "\t    Select graphics API to use with gpu backend.\n"
-    "\t    Options:\n"
-    "\t\tnative\t\t\tUse platform default OpenGL or OpenGL ES backend.\n"
-    "\t\tgl    \t\t\tUse OpenGL.\n"
-    "\t\tgles  \t\t\tUse OpenGL ES.\n"
-    "\t\tdebug \t\t\tUse debug OpenGL.\n"
-    "\t\tnull  \t\t\tUse null OpenGL.\n"
-#if SK_ANGLE
-#ifdef SK_BUILD_FOR_WIN
-    "\t\tangle\t\t\tUse ANGLE DirectX.\n"
-#endif
-    "\t\tangle-gl\t\t\tUse ANGLE OpenGL.\n"
-#endif
-#if SK_COMMAND_BUFFER
-    "\t\tcommandbuffer\t\tUse command buffer.\n"
-#endif
-#if SK_MESA
-    "\t\tmesa\t\t\tUse MESA.\n"
-#endif
-    "\tdit\ttype: bool\tdefault: false.\n"
-    "\t    Use device independent text.\n"
-    "\tnvpr\ttype: bool\tdefault: false.\n"
-    "\t    Use NV_path_rendering OpenGL and OpenGL ES extension.\n"
-    "\tsamples\ttype: int\tdefault: 0.\n"
-    "\t    Use multisampling with N samples.\n"
-    "\n"
-    "Predefined configs:\n\n"
-    "\tgpu      \t= gpu()\n"
-    "\tmsaa4    \t= gpu(samples=4)\n"
-    "\tmsaa16   \t= gpu(samples=16)\n"
-    "\tnvprmsaa4\t= gpu(nvpr=true,samples=4)\n"
-    "\tnvprmsaa16\t= gpu(nvpr=true,samples=16)\n"
-    "\tgpudft    \t= gpu(dit=true)\n"
-    "\tgpudebug  \t= gpu(api=debug)\n"
-    "\tgpunull   \t= gpu(api=null)\n"
-    "\tdebug     \t= gpu(api=debug)\n"
-    "\tnullgpu   \t= gpu(api=null)\n"
-#if SK_ANGLE
-#ifdef SK_BUILD_FOR_WIN
-    "\tangle     \t= gpu(api=angle)\n"
-#endif
-    "\tangle-gl  \t= gpu(api=angle-gl)\n"
-#endif
-#if SK_COMMAND_BUFFER
-    "\tcommandbuffer\t= gpu(api=commandbuffer)\n"
-#endif
-#if SK_MESA
-    "\tmesa      \t= gpu(api=mesa)\n"
-#endif
-#endif
-    ;
-
-DEFINE_extended_string(config, defaultConfigs, configHelp, configExtendedHelp);
-
-static const struct {
-    const char* predefinedConfig;
-    const char* backend;
-    const char* options;
-} gPredefinedConfigs[] = {
-#if SK_SUPPORT_GPU
-    { "gpu",        "gpu", "" },
-    { "msaa4",      "gpu", "samples=4" },
-    { "msaa16",     "gpu", "samples=16" },
-    { "nvprmsaa4",  "gpu", "nvpr=true,samples=4" },
-    { "nvprmsaa16", "gpu", "nvpr=true,samples=16" },
-    { "gpudft",     "gpu", "dit=true" },
-    { "gpudebug",   "gpu", "api=debug" },
-    { "gpunull",    "gpu", "api=null" },
-    { "debug",      "gpu", "api=debug" },
-    { "nullgpu",    "gpu", "api=null" }
-#if SK_ANGLE
-#ifdef SK_BUILD_FOR_WIN
-    , { "angle",      "gpu", "api=angle" }
-#endif
-    , { "angle-gl",   "gpu", "api=angle-gl" }
-#endif
-#if SK_COMMAND_BUFFER
-    , { "commandbuffer", "gpu", "api=commandbuffer" }
-#endif
-#if SK_MESA
-    , { "mesa", "gpu", "api=mesa" }
-#endif
-#else
-    { "", "", "" }
-#endif
-};
-
-SkCommandLineConfig::SkCommandLineConfig(const SkString& tag, const SkString& backend,
-                                         const SkTArray<SkString>& viaParts)
-        : fTag(tag)
-        , fBackend(backend)
-        , fViaParts(viaParts) {
-}
-SkCommandLineConfig::~SkCommandLineConfig() {
-}
-
-#if SK_SUPPORT_GPU
-SkCommandLineConfigGpu::SkCommandLineConfigGpu(
-    const SkString& tag, const SkTArray<SkString>& viaParts,
-    ContextType contextType, bool useNVPR, bool useDIText, int samples)
-        : SkCommandLineConfig(tag, SkString("gpu"), viaParts)
-        , fContextType(contextType)
-        , fUseNVPR(useNVPR)
-        , fUseDIText(useDIText)
-        , fSamples(samples) {
-}
-static bool parse_option_int(const SkString& value, int* outInt) {
-    if (value.isEmpty()) {
-        return false;
-    }
-    char* endptr = nullptr;
-    long intValue = strtol(value.c_str(), &endptr, 10);
-    if (*endptr != '\0') {
-        return false;
-    }
-    *outInt = static_cast<int>(intValue);
-    return true;
-}
-static bool parse_option_bool(const SkString& value, bool* outBool) {
-    if (value.equals("true")) {
-        *outBool = true;
-        return true;
-    }
-    if (value.equals("false")) {
-        *outBool = false;
-        return true;
-    }
-    return false;
-}
-static bool parse_option_gpu_api(const SkString& value,
-                                 SkCommandLineConfigGpu::ContextType* outContextType) {
-    if (value.equals("native")) {
-        *outContextType = GrContextFactory::kNative_GLContextType;
-        return true;
-    }
-    if (value.equals("gl")) {
-        *outContextType = GrContextFactory::kGL_GLContextType;
-        return true;
-    }
-    if (value.equals("gles")) {
-        *outContextType = GrContextFactory::kGLES_GLContextType;
-        return true;
-    }
-    if (value.equals("debug")) {
-        *outContextType = GrContextFactory::kDebug_GLContextType;
-        return true;
-    }
-    if (value.equals("null")) {
-        *outContextType = GrContextFactory::kNull_GLContextType;
-        return true;
-    }
-#if SK_ANGLE
-#ifdef SK_BUILD_FOR_WIN
-    if (value.equals("angle")) {
-        *outContextType = GrContextFactory::kANGLE_GLContextType;
-        return true;
-    }
-#endif
-    if (value.equals("angle-gl")) {
-        *outContextType = GrContextFactory::kANGLE_GL_GLContextType;
-        return true;
-    }
-#endif
-#if SK_COMMAND_BUFFER
-    if (value.equals("commandbuffer")) {
-        *outContextType = GrContextFactory::kCommandBuffer_GLContextType;
-        return true;
-    }
-#endif
-#if SK_MESA
-    if (value.equals("mesa")) {
-        *outContextType = GrContextFactory::kMESA_GLContextType;
-        return true;
-    }
-#endif
-    return false;
-}
-
-SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag,
-                                                      const SkTArray<SkString>& vias,
-                                                      const SkString& options) {
-    // Defaults for GPU backend.
-    bool seenAPI = false;
-    SkCommandLineConfigGpu::ContextType contextType = GrContextFactory::kNative_GLContextType;
-    bool seenUseNVPR = false;
-    bool useNVPR = false;
-    bool seenUseDIText =false;
-    bool useDIText = false;
-    bool seenSamples = false;
-    int samples = 0;
-
-    SkTArray<SkString> optionParts;
-    SkStrSplit(options.c_str(), ",", kStrict_SkStrSplitMode, &optionParts);
-    for (int i = 0; i < optionParts.count(); ++i) {
-        SkTArray<SkString> keyValueParts;
-        SkStrSplit(optionParts[i].c_str(), "=", kStrict_SkStrSplitMode, &keyValueParts);
-        if (keyValueParts.count() != 2) {
-            return nullptr;
-        }
-        const SkString& key = keyValueParts[0];
-        const SkString& value = keyValueParts[1];
-        bool valueOk = false;
-        if (key.equals("api") && !seenAPI) {
-            valueOk = parse_option_gpu_api(value, &contextType);
-            seenAPI = true;
-        } else if (key.equals("nvpr") && !seenUseNVPR) {
-            valueOk = parse_option_bool(value, &useNVPR);
-            seenUseNVPR = true;
-        } else if (key.equals("dit") && !seenUseDIText) {
-            valueOk = parse_option_bool(value, &useDIText);
-            seenUseDIText = true;
-        } else if (key.equals("samples") && !seenSamples) {
-            valueOk = parse_option_int(value, &samples);
-            seenSamples = true;
-        }
-        if (!valueOk) {
-            return nullptr;
-        }
-    }
-    return new SkCommandLineConfigGpu(tag, vias, contextType, useNVPR, useDIText, samples);
-}
-#endif
-
-void ParseConfigs(const SkCommandLineFlags::StringArray& configs,
-                  SkCommandLineConfigArray* outResult) {
-    outResult->reset();
-    for (int i = 0; i < configs.count(); ++i) {
-        SkString extendedBackend;
-        SkString extendedOptions;
-        SkString simpleBackend;
-        SkTArray<SkString> vias;
-
-        SkString tag(configs[i]);
-        SkTArray<SkString> parts;
-        SkStrSplit(tag.c_str(), "(", kStrict_SkStrSplitMode, &parts);
-        if (parts.count() == 2) {
-            SkTArray<SkString> parts2;
-            SkStrSplit(parts[1].c_str(), ")", kStrict_SkStrSplitMode, &parts2);
-            if (parts2.count() == 2 && parts2[1].isEmpty()) {
-                SkStrSplit(parts[0].c_str(), "-", kStrict_SkStrSplitMode, &vias);
-                if (vias.count()) {
-                    extendedBackend = vias[vias.count() - 1];
-                    vias.pop_back();
-                } else {
-                    extendedBackend = parts[0];
-                }
-                extendedOptions = parts2[0];
-                simpleBackend.printf("%s(%s)", extendedBackend.c_str(), extendedOptions.c_str());
-            }
-        }
-
-        if (extendedBackend.isEmpty()) {
-            simpleBackend = tag;
-            SkStrSplit(tag.c_str(), "-", kStrict_SkStrSplitMode, &vias);
-            if (vias.count()) {
-                simpleBackend = vias[vias.count() - 1];
-                vias.pop_back();
-            }
-            // Note: no #if SK_ANGLE: this is a special rule in the via-tag grammar.
-            if (vias.count() && simpleBackend.equals("gl") &&
-                vias[vias.count() - 1].equals("angle")) {
-                simpleBackend = "angle-gl";
-                vias.pop_back();
-            }
-
-            for (auto& predefinedConfig : gPredefinedConfigs) {
-                if (simpleBackend.equals(predefinedConfig.predefinedConfig)) {
-                    extendedBackend = predefinedConfig.backend;
-                    extendedOptions = predefinedConfig.options;
-                    break;
-                }
-            }
-        }
-        SkCommandLineConfig* parsedConfig = nullptr;
-#if SK_SUPPORT_GPU
-        if (extendedBackend.equals("gpu")) {
-            parsedConfig = parse_command_line_config_gpu(tag, vias, extendedOptions);
-        }
-#endif
-        if (!parsedConfig) {
-            parsedConfig = new SkCommandLineConfig(tag, simpleBackend, vias);
-        }
-        outResult->emplace_back(parsedConfig);
-    }
-}
diff --git a/tools/flags/SkCommonFlagsConfig.h b/tools/flags/SkCommonFlagsConfig.h
deleted file mode 100644
index 423cf11..0000000
--- a/tools/flags/SkCommonFlagsConfig.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SK_COMMON_FLAGS_CONFIG_H
-#define SK_COMMON_FLAGS_CONFIG_H
-
-#include "SkCommandLineFlags.h"
-
-#if SK_SUPPORT_GPU
-#include "GrContextFactory.h"
-#endif
-
-DECLARE_string(config);
-
-#if SK_SUPPORT_GPU
-class SkCommandLineConfigGpu;
-#endif
-
-// SkCommandLineConfig represents a Skia rendering configuration string.
-// The string has following form:
-// tag:
-//   [via-]*backend
-// where 'backend' consists of chars excluding hyphen or "angle-gl"
-// and each 'via' consists of chars excluding hyphen.
-class SkCommandLineConfig {
-  public:
-    SkCommandLineConfig(const SkString& tag, const SkString& backend,
-                        const SkTArray<SkString>& viaParts);
-    virtual ~SkCommandLineConfig();
-#if SK_SUPPORT_GPU
-    virtual const SkCommandLineConfigGpu* asConfigGpu() const { return nullptr; }
-#endif
-    const SkString& getTag() const { return fTag; }
-    const SkString& getBackend() const { return fBackend; }
-    const SkTArray<SkString>& getViaParts() const { return fViaParts; }
-  private:
-    SkString fTag;
-    SkString fBackend;
-    SkTArray<SkString> fViaParts;
-};
-
-#if SK_SUPPORT_GPU
-// SkCommandLineConfigGpu is a SkCommandLineConfig that extracts information out of the backend
-// part of the tag. It is constructed tags that have:
-// * backends of form "gpu(option=value,option2=value,...)"
-// * backends that represent a shorthand of above (such as "msaa16" representing "gpu(samples=16)")
-class SkCommandLineConfigGpu : public SkCommandLineConfig {
-  public:
-    typedef GrContextFactory::GLContextType ContextType;
-    SkCommandLineConfigGpu(const SkString& tag, const SkTArray<SkString>& viaParts,
-                           ContextType contextType, bool useNVPR, bool useDIText, int samples);
-    const SkCommandLineConfigGpu* asConfigGpu() const override { return this; }
-    ContextType getContextType() const { return fContextType; }
-    bool getUseNVPR() const { return fUseNVPR; }
-    bool getUseDIText() const { return fUseDIText; }
-    int getSamples() const { return fSamples; }
-
-  private:
-    ContextType fContextType;
-    bool fUseNVPR;
-    bool fUseDIText;
-    int fSamples;
-};
-#endif
-
-typedef SkTArray<SkAutoTDelete<SkCommandLineConfig>, true> SkCommandLineConfigArray;
-void ParseConfigs(const SkCommandLineFlags::StringArray& configList,
-                  SkCommandLineConfigArray* outResult);
-
-#endif