Rename enums in GrContextFactory to remove "GL"

Also, remove kNative as a separate context type and instead make it an alias for kGL or kGLES based on OS.

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1845923004

Review URL: https://codereview.chromium.org/1845923004
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 521824e..5e26b48 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -385,11 +385,11 @@
 }
 
 #if SK_SUPPORT_GPU
-#define kBogusGLContextType GrContextFactory::kNative_GLContextType
-#define kBogusGLContextOptions GrContextFactory::kNone_GLContextOptions
+#define kBogusContextType GrContextFactory::kNativeGL_ContextType
+#define kBogusContextOptions GrContextFactory::kNone_ContextOptions
 #else
-#define kBogusGLContextType 0
-#define kBogusGLContextOptions 0
+#define kBogusContextType 0
+#define kBogusContextOptions 0
 #endif
 
 static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* configs) {
@@ -399,8 +399,8 @@
         if (!FLAGS_gpu)
             return;
 
-        const auto ctxOptions = gpuConfig->getUseNVPR() ? GrContextFactory::kEnableNVPR_GLContextOptions
-                                                        : GrContextFactory::kNone_GLContextOptions;
+        const auto ctxOptions = gpuConfig->getUseNVPR() ? GrContextFactory::kEnableNVPR_ContextOptions
+                                                        : GrContextFactory::kNone_ContextOptions;
         const auto ctxType = gpuConfig->getContextType();
         const auto sampleCount = gpuConfig->getSamples();
 
@@ -437,7 +437,7 @@
         if (config->getTag().equals(#name)) {                                \
             Config config = {                                                \
                 SkString(#name), Benchmark::backend, color, alpha, profile,  \
-                0, kBogusGLContextType, kBogusGLContextOptions, false        \
+                0, kBogusContextType, kBogusContextOptions, false            \
             };                                                               \
             configs->push_back(config);                                      \
             return;                                                          \
@@ -463,7 +463,7 @@
     if (config->getTag().equals("hwui")) {
         Config config = { SkString("hwui"), Benchmark::kHWUI_Backend,
                           kRGBA_8888_SkColorType, kPremul_SkAlphaType, kLinear_SkColorProfileType,
-                          0, kBogusGLContextType, kBogusGLContextOptions, false };
+                          0, kBogusContextType, kBogusContextOptions, false };
         configs->push_back(config);
     }
 #endif
diff --git a/bench/nanobench.h b/bench/nanobench.h
index 844811e..ceab0f6 100644
--- a/bench/nanobench.h
+++ b/bench/nanobench.h
@@ -29,8 +29,8 @@
     SkColorProfileType profile;
     int samples;
 #if SK_SUPPORT_GPU
-    sk_gpu_test::GrContextFactory::GLContextType ctxType;
-    sk_gpu_test::GrContextFactory::GLContextOptions ctxOptions;
+    sk_gpu_test::GrContextFactory::ContextType ctxType;
+    sk_gpu_test::GrContextFactory::ContextOptions ctxOptions;
     bool useDFText;
 #else
     int bogusInt;
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 07e594b..15e12fd 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -814,17 +814,17 @@
 #if SK_SUPPORT_GPU
     if (gpu_supported()) {
         if (const SkCommandLineConfigGpu* gpuConfig = config->asConfigGpu()) {
-            GrContextFactory::GLContextType contextType = gpuConfig->getContextType();
-            GrContextFactory::GLContextOptions contextOptions =
-                    GrContextFactory::kNone_GLContextOptions;
+            GrContextFactory::ContextType contextType = gpuConfig->getContextType();
+            GrContextFactory::ContextOptions contextOptions =
+                    GrContextFactory::kNone_ContextOptions;
             if (gpuConfig->getUseNVPR()) {
-                contextOptions = static_cast<GrContextFactory::GLContextOptions>(
-                    contextOptions | GrContextFactory::kEnableNVPR_GLContextOptions);
+                contextOptions = static_cast<GrContextFactory::ContextOptions>(
+                    contextOptions | GrContextFactory::kEnableNVPR_ContextOptions);
             }
             if (kSRGB_SkColorProfileType == gpuConfig->getProfileType() ||
                 kRGBA_F16_SkColorType == gpuConfig->getColorType()) {
-                contextOptions = static_cast<GrContextFactory::GLContextOptions>(
-                    contextOptions | GrContextFactory::kRequireSRGBSupport_GLContextOptions);
+                contextOptions = static_cast<GrContextFactory::ContextOptions>(
+                    contextOptions | GrContextFactory::kRequireSRGBSupport_ContextOptions);
             }
             GrContextFactory testFactory;
             if (!testFactory.get(contextType, contextOptions)) {
@@ -1442,35 +1442,36 @@
     // Iterate over context types, except use "native" instead of explicitly trying OpenGL and
     // OpenGL ES. Do not use GLES on desktop, since tests do not account for not fixing
     // http://skbug.com/2809
-    GrContextFactory::GLContextType contextTypes[] = {
-        GrContextFactory::kNative_GLContextType,
+    GrContextFactory::ContextType contextTypes[] = {
+        GrContextFactory::kNativeGL_ContextType,
 #if SK_ANGLE
 #ifdef SK_BUILD_FOR_WIN
-        GrContextFactory::kANGLE_GLContextType,
+        GrContextFactory::kANGLE_ContextType,
 #endif
-        GrContextFactory::kANGLE_GL_GLContextType,
+        GrContextFactory::kANGLE_GL_ContextType,
 #endif
 #if SK_COMMAND_BUFFER
-        GrContextFactory::kCommandBuffer_GLContextType,
+        GrContextFactory::kCommandBuffer_ContextType,
 #endif
 #if SK_MESA
-        GrContextFactory::kMESA_GLContextType,
+        GrContextFactory::kMESA_ContextType,
 #endif
-        GrContextFactory::kNull_GLContextType,
-        GrContextFactory::kDebug_GLContextType,
+        GrContextFactory::kNullGL_ContextType,
+        GrContextFactory::kDebugGL_ContextType,
     };
-    static_assert(SK_ARRAY_COUNT(contextTypes) == GrContextFactory::kGLContextTypeCnt - 2,
-                  "Skipping unexpected GLContextType for GPU tests");
+    // Should have named all the context types except one of GL or GLES.
+    static_assert(SK_ARRAY_COUNT(contextTypes) == GrContextFactory::kContextTypeCnt - 1,
+                  "Skipping unexpected ContextType for GPU tests");
 
     for (auto& contextType : contextTypes) {
         int contextSelector = kNone_GPUTestContexts;
-        if (GrContextFactory::IsRenderingGLContext(contextType)) {
+        if (GrContextFactory::IsRenderingContext(contextType)) {
             contextSelector |= kAllRendering_GPUTestContexts;
-        } else if (contextType == GrContextFactory::kNative_GLContextType) {
+        } else if (contextType == GrContextFactory::kNativeGL_ContextType) {
             contextSelector |= kNative_GPUTestContexts;
-        } else if (contextType == GrContextFactory::kNull_GLContextType) {
+        } else if (contextType == GrContextFactory::kNullGL_ContextType) {
             contextSelector |= kNull_GPUTestContexts;
-        } else if (contextType == GrContextFactory::kDebug_GLContextType) {
+        } else if (contextType == GrContextFactory::kDebugGL_ContextType) {
             contextSelector |= kDebug_GPUTestContexts;
         }
         if ((testContexts & contextSelector) == 0) {
@@ -1481,7 +1482,7 @@
             call_test(test, reporter, context);
         }
         context = factory->getContextInfo(contextType,
-                                          GrContextFactory::kEnableNVPR_GLContextOptions);
+                                          GrContextFactory::kEnableNVPR_ContextOptions);
         if (context.fGrContext) {
             call_test(test, reporter, context);
         }
diff --git a/dm/DMGpuSupport.h b/dm/DMGpuSupport.h
index 490737f..2352f83 100644
--- a/dm/DMGpuSupport.h
+++ b/dm/DMGpuSupport.h
@@ -30,8 +30,8 @@
 
 static inline sk_sp<SkSurface> NewGpuSurface(
         sk_gpu_test::GrContextFactory* grFactory,
-        sk_gpu_test::GrContextFactory::GLContextType type,
-        sk_gpu_test::GrContextFactory::GLContextOptions options,
+        sk_gpu_test::GrContextFactory::ContextType type,
+        sk_gpu_test::GrContextFactory::ContextOptions options,
         SkImageInfo info,
         int samples,
         bool useDIText) {
@@ -66,20 +66,22 @@
     GrContextFactory() {};
     explicit GrContextFactory(const GrContextOptions&) {}
 
-    typedef int GLContextType;
+    typedef int ContextType;
 
-    static const GLContextType kANGLE_GLContextType         = 0,
-                               kANGLE_GL_GLContextType      = 0,
-                               kCommandBuffer_GLContextType = 0,
-                               kDebug_GLContextType         = 0,
-                               kMESA_GLContextType          = 0,
-                               kNVPR_GLContextType          = 0,
-                               kNative_GLContextType        = 0,
-                               kNull_GLContextType          = 0;
-    static const int kGLContextTypeCnt = 1;
-    enum GLContextOptions {
-        kNone_GLContextOptions = 0,
-        kEnableNVPR_GLContextOptions = 0x1,
+    static const ContextType kANGLE_ContextType         = 0,
+                             kANGLE_GL_ContextType      = 0,
+                             kCommandBuffer_ContextType = 0,
+                             kDebugGL_ContextType       = 0,
+                             kMESA_ContextType          = 0,
+                             kNVPR_ContextType          = 0,
+                             kNativeGL_ContextType      = 0,
+                             kGL_ContextType            = 0,
+                             kGLES_ContextType          = 0,
+                             kNullGL_ContextType        = 0;
+    static const int kContextTypeCnt = 1;
+    enum ContextOptions {
+        kNone_ContextOptions = 0,
+        kEnableNVPR_ContextOptions = 0x1,
     };
     void destroyContexts() {}
 
@@ -94,8 +96,8 @@
 static const bool kGPUDisabled = true;
 
 static inline SkSurface* NewGpuSurface(sk_gpu_test::GrContextFactory*,
-                                       sk_gpu_test::GrContextFactory::GLContextType,
-                                       sk_gpu_test::GrContextFactory::GLContextOptions,
+                                       sk_gpu_test::GrContextFactory::ContextType,
+                                       sk_gpu_test::GrContextFactory::ContextOptions,
                                        SkImageInfo,
                                        int,
                                        bool) {
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 6584789..a24dad4 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -941,8 +941,8 @@
 
 DEFINE_bool(gpuStats, false, "Append GPU stats to the log for each GPU task?");
 
-GPUSink::GPUSink(GrContextFactory::GLContextType ct,
-                 GrContextFactory::GLContextOptions options,
+GPUSink::GPUSink(GrContextFactory::ContextType ct,
+                 GrContextFactory::ContextOptions options,
                  int samples,
                  bool diText,
                  SkColorType colorType,
diff --git a/dm/DMSrcSink.h b/dm/DMSrcSink.h
index 3a35acf..aec5a30 100644
--- a/dm/DMSrcSink.h
+++ b/dm/DMSrcSink.h
@@ -232,8 +232,8 @@
 
 class GPUSink : public Sink {
 public:
-    GPUSink(sk_gpu_test::GrContextFactory::GLContextType,
-            sk_gpu_test::GrContextFactory::GLContextOptions,
+    GPUSink(sk_gpu_test::GrContextFactory::ContextType,
+            sk_gpu_test::GrContextFactory::ContextOptions,
             int samples, bool diText, SkColorType colorType, SkColorProfileType profileType,
             bool threaded);
 
@@ -242,8 +242,8 @@
     const char* fileExtension() const override { return "png"; }
     SinkFlags flags() const override { return SinkFlags{ SinkFlags::kGPU, SinkFlags::kDirect }; }
 private:
-    sk_gpu_test::GrContextFactory::GLContextType    fContextType;
-    sk_gpu_test::GrContextFactory::GLContextOptions fContextOptions;
+    sk_gpu_test::GrContextFactory::ContextType      fContextType;
+    sk_gpu_test::GrContextFactory::ContextOptions   fContextOptions;
     int                                             fSampleCount;
     bool                                            fUseDIText;
     SkColorType                                     fColorType;
diff --git a/tests/GrContextAbandonTest.cpp b/tests/GrContextAbandonTest.cpp
index c62973f..e1ad8f7 100644
--- a/tests/GrContextAbandonTest.cpp
+++ b/tests/GrContextAbandonTest.cpp
@@ -16,10 +16,10 @@
 
 DEF_GPUTEST(GrContext_abandonContext, reporter, /*factory*/) {
     for (int testType = 0; testType < 6; ++testType) {
-    for (int i = 0; i < GrContextFactory::kGLContextTypeCnt; ++i) {
-        GrContextFactory testFactory;
-        GrContextFactory::GLContextType ctxType = (GrContextFactory::GLContextType) i;
-        GrContextFactory::ContextInfo info = testFactory.getContextInfo(ctxType);
+        for (int i = 0; i < GrContextFactory::kContextTypeCnt; ++i) {
+            GrContextFactory testFactory;
+            GrContextFactory::ContextType ctxType = (GrContextFactory::ContextType) i;
+            GrContextFactory::ContextInfo info = testFactory.getContextInfo(ctxType);
             if (GrContext* context = info.fGrContext) {
                 switch (testType) {
                     case 0:
diff --git a/tests/GrContextFactoryTest.cpp b/tests/GrContextFactoryTest.cpp
index bd18883..6e51b2f 100644
--- a/tests/GrContextFactoryTest.cpp
+++ b/tests/GrContextFactoryTest.cpp
@@ -20,10 +20,10 @@
     // or the context creation fails.
     GrContextFactory testFactory;
     // Test that if NVPR is possible, caps are in sync.
-    for (int i = 0; i < GrContextFactory::kGLContextTypeCnt; ++i) {
-        GrContextFactory::GLContextType glCtxType = static_cast<GrContextFactory::GLContextType>(i);
-        GrContext* context = testFactory.get(glCtxType,
-                                             GrContextFactory::kEnableNVPR_GLContextOptions);
+    for (int i = 0; i < GrContextFactory::kContextTypeCnt; ++i) {
+        GrContextFactory::ContextType ctxType = static_cast<GrContextFactory::ContextType>(i);
+        GrContext* context = testFactory.get(ctxType,
+                                             GrContextFactory::kEnableNVPR_ContextOptions);
         if (!context) {
             continue;
         }
@@ -37,9 +37,9 @@
     // Test that if NVPR is not requested, the context never has path rendering support.
 
     GrContextFactory testFactory;
-    for (int i = 0; i <= GrContextFactory::kLastGLContextType; ++i) {
-        GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContextType)i;
-        GrContext* context = testFactory.get(glCtxType);
+    for (int i = 0; i <= GrContextFactory::kLastContextType; ++i) {
+        GrContextFactory::ContextType ctxType = (GrContextFactory::ContextType)i;
+        GrContext* context = testFactory.get(ctxType);
         if (context) {
             REPORTER_ASSERT(
                 reporter,
@@ -54,16 +54,15 @@
     // created without that flag would not have had sRGB support.
     GrContextFactory testFactory;
     // Test that if sRGB is requested, caps are in sync.
-    for (int i = 0; i < GrContextFactory::kGLContextTypeCnt; ++i) {
-        GrContextFactory::GLContextType glCtxType = static_cast<GrContextFactory::GLContextType>(i);
+    for (int i = 0; i < GrContextFactory::kContextTypeCnt; ++i) {
+        GrContextFactory::ContextType ctxType = static_cast<GrContextFactory::ContextType>(i);
         GrContext* context =
-            testFactory.get(glCtxType,
-                            GrContextFactory::kRequireSRGBSupport_GLContextOptions);
+            testFactory.get(ctxType, GrContextFactory::kRequireSRGBSupport_ContextOptions);
 
         if (context) {
             REPORTER_ASSERT(reporter, context->caps()->srgbSupport());
         } else {
-            context = testFactory.get(glCtxType);
+            context = testFactory.get(ctxType);
             if (context) {
                 REPORTER_ASSERT(reporter, !context->caps()->srgbSupport());
             }
@@ -73,10 +72,9 @@
 
 DEF_GPUTEST(GrContextFactory_abandon, reporter, /*factory*/) {
     GrContextFactory testFactory;
-    for (int i = 0; i < GrContextFactory::kGLContextTypeCnt; ++i) {
-        GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContextType) i;
-        GrContextFactory::ContextInfo info1 =
-                testFactory.getContextInfo(glCtxType);
+    for (int i = 0; i < GrContextFactory::kContextTypeCnt; ++i) {
+        GrContextFactory::ContextType ctxType = (GrContextFactory::ContextType) i;
+        GrContextFactory::ContextInfo info1 = testFactory.getContextInfo(ctxType);
         if (!info1.fGrContext) {
             continue;
         }
@@ -87,7 +85,7 @@
 
         // Test that we get different context after abandon.
         GrContextFactory::ContextInfo info2 =
-                testFactory.getContextInfo(glCtxType);
+                testFactory.getContextInfo(ctxType);
         REPORTER_ASSERT(reporter, info2.fGrContext);
         REPORTER_ASSERT(reporter, info2.fGLContext);
         REPORTER_ASSERT(reporter, info1.fGrContext != info2.fGrContext);
diff --git a/tests/GrPorterDuffTest.cpp b/tests/GrPorterDuffTest.cpp
index 566ec12..b037771 100644
--- a/tests/GrPorterDuffTest.cpp
+++ b/tests/GrPorterDuffTest.cpp
@@ -1148,7 +1148,7 @@
     GrContextOptions opts;
     opts.fSuppressDualSourceBlending = true;
     sk_gpu_test::GrContextFactory mockFactory(opts);
-    GrContext* ctx = mockFactory.get(sk_gpu_test::GrContextFactory::kNull_GLContextType);
+    GrContext* ctx = mockFactory.get(sk_gpu_test::GrContextFactory::kNullGL_ContextType);
     if (!ctx) {
         SkFAIL("Failed to create null context without ARB_blend_func_extended.");
         return;
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp
index 8485fda..0a706a5 100644
--- a/tests/ImageTest.cpp
+++ b/tests/ImageTest.cpp
@@ -407,7 +407,7 @@
 DEF_GPUTEST_FOR_NATIVE_CONTEXT(SkImage_newTextureImage, reporter, context, glContext) {
     GrContextFactory otherFactory;
     GrContextFactory::ContextInfo otherContextInfo =
-        otherFactory.getContextInfo(GrContextFactory::kNative_GLContextType);
+        otherFactory.getContextInfo(GrContextFactory::kNativeGL_ContextType);
     glContext->makeCurrent();
 
     std::function<sk_sp<SkImage>()> imageFactories[] = {
@@ -825,7 +825,7 @@
 
     GrContextFactory otherFactory;
     GrContextFactory::ContextInfo otherContextInfo =
-        otherFactory.getContextInfo(GrContextFactory::kNative_GLContextType);
+        otherFactory.getContextInfo(GrContextFactory::kNativeGL_ContextType);
 
     glContext->makeCurrent();
     REPORTER_ASSERT(reporter, proxy);
diff --git a/tests/SkpSkGrTest.cpp b/tests/SkpSkGrTest.cpp
index 4469d4f..e5553a9 100644
--- a/tests/SkpSkGrTest.cpp
+++ b/tests/SkpSkGrTest.cpp
@@ -253,11 +253,11 @@
     return pngName;
 }
 
-typedef GrContextFactory::GLContextType GLContextType;
+typedef GrContextFactory::ContextType ContextType;
 #ifdef SK_BUILD_FOR_WIN
-static const GLContextType kAngle = GrContextFactory::kANGLE_GLContextType;
+static const ContextType kAngle = GrContextFactory::kANGLE_ContextType;
 #else
-static const GLContextType kNative = GrContextFactory::kNative_GLContextType;
+static const ContextType kNative = GrContextFactory::kNativeGL_ContextType;
 #endif
 
 static int similarBits(const SkBitmap& gr, const SkBitmap& sk) {
diff --git a/tests/TestConfigParsing.cpp b/tests/TestConfigParsing.cpp
index 4057a37..bdfbed4 100644
--- a/tests/TestConfigParsing.cpp
+++ b/tests/TestConfigParsing.cpp
@@ -41,7 +41,7 @@
 #if SK_SUPPORT_GPU
     REPORTER_ASSERT(reporter, configs[0]->asConfigGpu());
     REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getContextType()
-                    == GrContextFactory::kNative_GLContextType);
+                    == GrContextFactory::kNativeGL_ContextType);
     REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseNVPR() == false);
     REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseDIText() == false);
     REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getSamples() == 0);
@@ -164,47 +164,46 @@
     }
 #if SK_SUPPORT_GPU
     REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getContextType() ==
-                    GrContextFactory::kNative_GLContextType);
+                    GrContextFactory::kNativeGL_ContextType);
     REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseNVPR());
     REPORTER_ASSERT(reporter, !configs[0]->asConfigGpu()->getUseDIText());
     REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getSamples() == 0);
 #if SK_ANGLE
 #ifdef SK_BUILD_FOR_WIN
     REPORTER_ASSERT(reporter, configs[1]->asConfigGpu()->getContextType() ==
-                    GrContextFactory::kANGLE_GLContextType);
+                    GrContextFactory::kANGLE_ContextType);
 #else
     REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu());
 #endif
     REPORTER_ASSERT(reporter, configs[2]->asConfigGpu()->getContextType() ==
-                    GrContextFactory::kANGLE_GL_GLContextType);
+                    GrContextFactory::kANGLE_GL_ContextType);
 #else
     REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu());
     REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu());
 #endif
 #if SK_MESA
     REPORTER_ASSERT(reporter, configs[3]->asConfigGpu()->getContextType() ==
-                    GrContextFactory::kMESA_GLContextType);
+                    GrContextFactory::kMESA_ContextType);
 #else
     REPORTER_ASSERT(reporter, !configs[3]->asConfigGpu());
 #endif
 #if SK_COMMAND_BUFFER
     REPORTER_ASSERT(reporter, configs[4]->asConfigGpu()->getContextType() ==
-                    GrContextFactory::kCommandBuffer_GLContextType);
+                    GrContextFactory::kCommandBuffer_ContextType);
 
 #else
     REPORTER_ASSERT(reporter, !configs[4]->asConfigGpu());
 #endif
     REPORTER_ASSERT(reporter, configs[5]->asConfigGpu()->getContextType() ==
-                    GrContextFactory::kNative_GLContextType);
+                    GrContextFactory::kNativeGL_ContextType);
     REPORTER_ASSERT(reporter, !configs[5]->asConfigGpu()->getUseNVPR());
     REPORTER_ASSERT(reporter, !configs[5]->asConfigGpu()->getUseDIText());
     REPORTER_ASSERT(reporter, configs[5]->asConfigGpu()->getSamples() == 0);
     REPORTER_ASSERT(reporter, configs[6]->asConfigGpu()->getContextType() ==
-                    GrContextFactory::kGLES_GLContextType);
+                    GrContextFactory::kGLES_ContextType);
     REPORTER_ASSERT(reporter, !configs[6]->asConfigGpu()->getUseNVPR());
     REPORTER_ASSERT(reporter, !configs[6]->asConfigGpu()->getUseDIText());
     REPORTER_ASSERT(reporter, configs[6]->asConfigGpu()->getSamples() == 0);
-
 #endif
 }
 
@@ -236,16 +235,13 @@
     }
 }
 
-
 DEF_TEST(ParseConfigs_ExtendedGpuConfigsSurprises, reporter) {
     // These just list explicitly some properties of the system.
     SkCommandLineFlags::StringArray config1 = make_string_array({
         // Options are not canonized -> two same configs have a different tag.
         "gpu(nvpr=true,dit=true)", "gpu(dit=true,nvpr=true)",
-        // API native is alias for gl or gles, but it's not canonized -> different tag.
-        "gpu(api=native)", "gpu(api=gl)", "gpu(api=gles)", ""
-        // Default values are not canonized -> different tag.
-        "gpu", "gpu()", "gpu(samples=0)", "gpu(api=native,samples=0)"
+        "gpu(api=debug)", "gpu(api=gl)", "gpu(api=gles)", ""
+        "gpu", "gpu()", "gpu(samples=0)", "gpu(api=gles,samples=0)"
     });
     SkCommandLineConfigArray configs;
     ParseConfigs(config1, &configs);
diff --git a/tests/VkClearTests.cpp b/tests/VkClearTests.cpp
index ab13ffd..5b8a30b 100644
--- a/tests/VkClearTests.cpp
+++ b/tests/VkClearTests.cpp
@@ -200,12 +200,12 @@
     GrContextOptions opts;
     opts.fSuppressPrints = true;
     GrContextFactory debugFactory(opts);
-    for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
-        if (static_cast<GrContextFactory::GLContextType>(type) !=
-            GrContextFactory::kNative_GLContextType) {
+    for (int type = 0; type < GrContextFactory::kContextTypeCnt; ++type) {
+        if (static_cast<GrContextFactory::ContextType>(type) !=
+            GrContextFactory::kNativeGL_ContextType) {
             continue;
         }
-        GrContext* context = debugFactory.get(static_cast<GrContextFactory::GLContextType>(type));
+        GrContext* context = debugFactory.get(static_cast<GrContextFactory::ContextType>(type));
         if (context) {
             basic_clear_test(reporter, context, kRGBA_8888_GrPixelConfig);
             basic_clear_test(reporter, context, kBGRA_8888_GrPixelConfig);
diff --git a/tests/VkUploadPixelsTests.cpp b/tests/VkUploadPixelsTests.cpp
index a509978..e5f72dd 100644
--- a/tests/VkUploadPixelsTests.cpp
+++ b/tests/VkUploadPixelsTests.cpp
@@ -137,12 +137,12 @@
     GrContextOptions opts;
     opts.fSuppressPrints = true;
     GrContextFactory debugFactory(opts);
-    for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
-        if (static_cast<GrContextFactory::GLContextType>(type) !=
-            GrContextFactory::kNative_GLContextType) {
+    for (int type = 0; type < GrContextFactory::kContextTypeCnt; ++type) {
+        if (static_cast<GrContextFactory::ContextType>(type) !=
+            GrContextFactory::kNativeGL_ContextType) {
             continue;
         }
-        GrContext* context = debugFactory.get(static_cast<GrContextFactory::GLContextType>(type));
+        GrContext* context = debugFactory.get(static_cast<GrContextFactory::ContextType>(type));
         if (context) {
             basic_texture_test(reporter, context, kRGBA_8888_GrPixelConfig, false, false);
             basic_texture_test(reporter, context, kRGBA_8888_GrPixelConfig, true, false);
diff --git a/tests/VkWrapTests.cpp b/tests/VkWrapTests.cpp
index 382bdbe..a4fec08 100755
--- a/tests/VkWrapTests.cpp
+++ b/tests/VkWrapTests.cpp
@@ -162,12 +162,12 @@
     GrContextOptions opts;
     opts.fSuppressPrints = true;
     GrContextFactory debugFactory(opts);
-    for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
-        if (static_cast<GrContextFactory::GLContextType>(type) !=
-            GrContextFactory::kNative_GLContextType) {
+    for (int type = 0; type < GrContextFactory::kLastContextType; ++type) {
+        if (static_cast<GrContextFactory::ContextType>(type) !=
+            GrContextFactory::kNativeGL_ContextType) {
             continue;
         }
-        GrContext* context = debugFactory.get(static_cast<GrContextFactory::GLContextType>(type));
+        GrContext* context = debugFactory.get(static_cast<GrContextFactory::ContextType>(type));
         if (context) {
             wrap_tex_test(reporter, context);
             wrap_rt_test(reporter, context);
diff --git a/tools/flags/SkCommonFlagsConfig.cpp b/tools/flags/SkCommonFlagsConfig.cpp
index 1ee3130..b084b1d 100644
--- a/tools/flags/SkCommonFlagsConfig.cpp
+++ b/tools/flags/SkCommonFlagsConfig.cpp
@@ -201,47 +201,43 @@
 }
 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;
+        *outContextType = GrContextFactory::kGL_ContextType;
         return true;
     }
     if (value.equals("gles")) {
-        *outContextType = GrContextFactory::kGLES_GLContextType;
+        *outContextType = GrContextFactory::kGLES_ContextType;
         return true;
     }
     if (value.equals("debug")) {
-        *outContextType = GrContextFactory::kDebug_GLContextType;
+        *outContextType = GrContextFactory::kDebugGL_ContextType;
         return true;
     }
     if (value.equals("null")) {
-        *outContextType = GrContextFactory::kNull_GLContextType;
+        *outContextType = GrContextFactory::kNullGL_ContextType;
         return true;
     }
 #if SK_ANGLE
 #ifdef SK_BUILD_FOR_WIN
     if (value.equals("angle")) {
-        *outContextType = GrContextFactory::kANGLE_GLContextType;
+        *outContextType = GrContextFactory::kANGLE_ContextType;
         return true;
     }
 #endif
     if (value.equals("angle-gl")) {
-        *outContextType = GrContextFactory::kANGLE_GL_GLContextType;
+        *outContextType = GrContextFactory::kANGLE_GL_ContextType;
         return true;
     }
 #endif
 #if SK_COMMAND_BUFFER
     if (value.equals("commandbuffer")) {
-        *outContextType = GrContextFactory::kCommandBuffer_GLContextType;
+        *outContextType = GrContextFactory::kCommandBuffer_ContextType;
         return true;
     }
 #endif
 #if SK_MESA
     if (value.equals("mesa")) {
-        *outContextType = GrContextFactory::kMESA_GLContextType;
+        *outContextType = GrContextFactory::kMESA_ContextType;
         return true;
     }
 #endif
@@ -273,7 +269,7 @@
                                                       const SkString& options) {
     // Defaults for GPU backend.
     bool seenAPI = false;
-    SkCommandLineConfigGpu::ContextType contextType = GrContextFactory::kNative_GLContextType;
+    SkCommandLineConfigGpu::ContextType contextType = GrContextFactory::kNativeGL_ContextType;
     bool seenUseNVPR = false;
     bool useNVPR = false;
     bool seenUseDIText =false;
diff --git a/tools/flags/SkCommonFlagsConfig.h b/tools/flags/SkCommonFlagsConfig.h
index abf5946..5d95ef1 100644
--- a/tools/flags/SkCommonFlagsConfig.h
+++ b/tools/flags/SkCommonFlagsConfig.h
@@ -50,7 +50,7 @@
 // * backends that represent a shorthand of above (such as "msaa16" representing "gpu(samples=16)")
 class SkCommandLineConfigGpu : public SkCommandLineConfig {
   public:
-    typedef sk_gpu_test::GrContextFactory::GLContextType ContextType;
+    typedef sk_gpu_test::GrContextFactory::ContextType ContextType;
     SkCommandLineConfigGpu(const SkString& tag, const SkTArray<SkString>& viaParts,
                            ContextType contextType, bool useNVPR, bool useDIText, int samples,
                            SkColorType colorType, SkColorProfileType profileType);
diff --git a/tools/gpu/GrContextFactory.cpp b/tools/gpu/GrContextFactory.cpp
index c232121..18fbef8 100755
--- a/tools/gpu/GrContextFactory.cpp
+++ b/tools/gpu/GrContextFactory.cpp
@@ -74,8 +74,16 @@
     }
 }
 
-GrContextFactory::ContextInfo GrContextFactory::getContextInfo(GLContextType type,
-                                                               GLContextOptions options) {
+#if defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_WIN) || defined(SK_BUILD_FOR_MAC)
+const GrContextFactory::ContextType GrContextFactory::kNativeGL_ContextType =
+    GrContextFactory::kGL_ContextType;
+#else
+const GrContextFactory::ContextType GrContextFactory::kNativeGL_ContextType =
+    GrContextFactory::kGLES_ContextType;
+#endif
+
+GrContextFactory::ContextInfo GrContextFactory::getContextInfo(ContextType type,
+                                                               ContextOptions options) {
     for (int i = 0; i < fContexts.count(); ++i) {
         Context& context = fContexts[i];
         if (!context.fGLContext) {
@@ -90,39 +98,36 @@
     SkAutoTDelete<GLTestContext> glCtx;
     SkAutoTUnref<GrContext> grCtx;
     switch (type) {
-        case kNative_GLContextType:
-            glCtx.reset(CreatePlatformGLTestContext(kNone_GrGLStandard));
-            break;
-        case kGL_GLContextType:
+        case kGL_ContextType:
             glCtx.reset(CreatePlatformGLTestContext(kGL_GrGLStandard));
             break;
-        case kGLES_GLContextType:
+        case kGLES_ContextType:
             glCtx.reset(CreatePlatformGLTestContext(kGLES_GrGLStandard));
             break;
 #if SK_ANGLE
 #ifdef SK_BUILD_FOR_WIN
-        case kANGLE_GLContextType:
+        case kANGLE_ContextType:
             glCtx.reset(CreateANGLEDirect3DGLTestContext());
             break;
 #endif
-        case kANGLE_GL_GLContextType:
+        case kANGLE_GL_ContextType:
             glCtx.reset(CreateANGLEOpenGLGLTestContext());
             break;
 #endif
 #if SK_COMMAND_BUFFER
-        case kCommandBuffer_GLContextType:
+        case kCommandBuffer_ContextType:
             glCtx.reset(CommandBufferGLTestContext::Create());
             break;
 #endif
 #if SK_MESA
-        case kMESA_GLContextType:
+        case kMESA_ContextType:
             glCtx.reset(CreateMesaGLTestContext());
             break;
 #endif
-        case kNull_GLContextType:
+        case kNullGL_ContextType:
             glCtx.reset(CreateNullGLTestContext());
             break;
-        case kDebug_GLContextType:
+        case kDebugGL_ContextType:
             glCtx.reset(CreateDebugGLTestContext());
             break;
     }
@@ -134,7 +139,7 @@
 
     // Block NVPR from non-NVPR types.
     SkAutoTUnref<const GrGLInterface> glInterface(SkRef(glCtx->gl()));
-    if (!(kEnableNVPR_GLContextOptions & options)) {
+    if (!(kEnableNVPR_ContextOptions & options)) {
         glInterface.reset(GrGLInterfaceRemoveNVPR(glInterface));
         if (!glInterface) {
             return ContextInfo();
@@ -143,7 +148,7 @@
 
     glCtx->makeCurrent();
 #ifdef SK_VULKAN
-    if (kEnableNVPR_GLContextOptions & options) {
+    if (kEnableNVPR_ContextOptions & options) {
         return ContextInfo();
     } else {
         GrBackendContext p3dctx = reinterpret_cast<GrBackendContext>(GrVkBackendContext::Create());
@@ -156,12 +161,12 @@
     if (!grCtx.get()) {
         return ContextInfo();
     }
-    if (kEnableNVPR_GLContextOptions & options) {
+    if (kEnableNVPR_ContextOptions & options) {
         if (!grCtx->caps()->shaderCaps()->pathRenderingSupport()) {
             return ContextInfo();
         }
     }
-    if (kRequireSRGBSupport_GLContextOptions & options) {
+    if (kRequireSRGBSupport_ContextOptions & options) {
         if (!grCtx->caps()->srgbSupport()) {
             return ContextInfo();
         }
diff --git a/tools/gpu/GrContextFactory.h b/tools/gpu/GrContextFactory.h
index 16f6fb2..7c49faa 100644
--- a/tools/gpu/GrContextFactory.h
+++ b/tools/gpu/GrContextFactory.h
@@ -24,76 +24,76 @@
  */
 class GrContextFactory : SkNoncopyable {
 public:
-    enum GLContextType {
-        kNative_GLContextType,  //! OpenGL or OpenGL ES context.
-        kGL_GLContextType,      //! OpenGL context.
-        kGLES_GLContextType,    //! OpenGL ES context.
+    enum ContextType {
+        kGL_ContextType,            //! OpenGL context.
+        kGLES_ContextType,          //! OpenGL ES context.
 #if SK_ANGLE
 #ifdef SK_BUILD_FOR_WIN
-        kANGLE_GLContextType,    //! ANGLE on DirectX OpenGL ES context.
+        kANGLE_ContextType,         //! ANGLE on DirectX OpenGL ES context.
 #endif
-        kANGLE_GL_GLContextType, //! ANGLE on OpenGL OpenGL ES context.
+        kANGLE_GL_ContextType,      //! ANGLE on OpenGL OpenGL ES context.
 #endif
 #if SK_COMMAND_BUFFER
-        kCommandBuffer_GLContextType, //! Chromium command buffer OpenGL ES context.
+        kCommandBuffer_ContextType, //! Chromium command buffer OpenGL ES context.
 #endif
 #if SK_MESA
-        kMESA_GLContextType,  //! MESA OpenGL context
+        kMESA_ContextType,          //! MESA OpenGL context
 #endif
-        kNull_GLContextType,  //! Non-rendering OpenGL mock context.
-        kDebug_GLContextType, //! Non-rendering, state verifying OpenGL context.
-        kLastGLContextType = kDebug_GLContextType
+        kNullGL_ContextType,        //! Non-rendering OpenGL mock context.
+        kDebugGL_ContextType,       //! Non-rendering, state verifying OpenGL context.
+        kLastContextType = kDebugGL_ContextType
     };
 
-    static const int kGLContextTypeCnt = kLastGLContextType + 1;
+    //! OpenGL or OpenGL ES context depending on the platform. To be removed.
+    static const ContextType kNativeGL_ContextType;
+
+    static const int kContextTypeCnt = kLastContextType + 1;
 
     /**
      * Options for GL context creation. For historical and testing reasons the options will default
      * to not using GL_NV_path_rendering extension  even when the driver supports it.
      */
-    enum GLContextOptions {
-        kNone_GLContextOptions = 0,
-        kEnableNVPR_GLContextOptions = 0x1,
-        kRequireSRGBSupport_GLContextOptions = 0x2,
+    enum ContextOptions {
+        kNone_ContextOptions                = 0x0,
+        kEnableNVPR_ContextOptions          = 0x1,
+        kRequireSRGBSupport_ContextOptions  = 0x2,
     };
 
-    static bool IsRenderingGLContext(GLContextType type) {
+    static bool IsRenderingContext(ContextType type) {
         switch (type) {
-            case kNull_GLContextType:
-            case kDebug_GLContextType:
+            case kNullGL_ContextType:
+            case kDebugGL_ContextType:
                 return false;
             default:
                 return true;
         }
     }
 
-    static const char* GLContextTypeName(GLContextType type) {
+    static const char* ContextTypeName(ContextType type) {
         switch (type) {
-            case kNative_GLContextType:
-                return "native";
-            case kGL_GLContextType:
+            case kGL_ContextType:
                 return "gl";
-            case kGLES_GLContextType:
+            case kGLES_ContextType:
                 return "gles";
 #if SK_ANGLE
 #ifdef SK_BUILD_FOR_WIN
-            case kANGLE_GLContextType:
+            case kANGLE_ContextType:
                 return "angle";
 #endif
-            case kANGLE_GL_GLContextType:
+            case kANGLE_GL_ContextType:
                 return "angle-gl";
 #endif
 #if SK_COMMAND_BUFFER
-            case kCommandBuffer_GLContextType:
+            case kCommandBuffer_ContextType:
                 return "commandbuffer";
 #endif
 #if SK_MESA
-            case kMESA_GLContextType:
+            case kMESA_ContextType:
                 return "mesa";
 #endif
-            case kNull_GLContextType:
+            case kNullGL_ContextType:
                 return "null";
-            case kDebug_GLContextType:
+            case kDebugGL_ContextType:
                 return "debug";
             default:
                 SkFAIL("Unknown GL Context type.");
@@ -122,22 +122,21 @@
     /**
      * Get a context initialized with a type of GL context. It also makes the GL context current.
      */
-    ContextInfo getContextInfo(GLContextType type,
-                               GLContextOptions options = kNone_GLContextOptions);
+    ContextInfo getContextInfo(ContextType type,
+                               ContextOptions options = kNone_ContextOptions);
     /**
      * Get a GrContext initialized with a type of GL context. It also makes the GL context current.
      */
-    GrContext* get(GLContextType type,
-                   GLContextOptions options = kNone_GLContextOptions) {
+    GrContext* get(ContextType type, ContextOptions options = kNone_ContextOptions) {
         return this->getContextInfo(type, options).fGrContext;
     }
     const GrContextOptions& getGlobalOptions() const { return fGlobalOptions; }
 
 private:
     struct Context {
-        GLContextType       fType;
-        GLContextOptions    fOptions;
-        GLTestContext*          fGLContext;
+        ContextType         fType;
+        ContextOptions      fOptions;
+        GLTestContext*      fGLContext; //  null if non-GL
         GrContext*          fGrContext;
     };
     SkTArray<Context, true> fContexts;
diff --git a/tools/kilobench/kilobench.cpp b/tools/kilobench/kilobench.cpp
index f4c2999..dc7f938 100644
--- a/tools/kilobench/kilobench.cpp
+++ b/tools/kilobench/kilobench.cpp
@@ -175,8 +175,8 @@
     }
 
     bool init(Benchmark* bench, GrContextFactory* factory, bool useDfText,
-              GrContextFactory::GLContextType ctxType,
-              GrContextFactory::GLContextOptions ctxOptions, int numSamples) {
+              GrContextFactory::ContextType ctxType,
+              GrContextFactory::ContextOptions ctxOptions, int numSamples) {
         GrContext* context = factory->get(ctxType, ctxOptions);
         int maxRTSize = context->caps()->maxRenderTargetSize();
         SkImageInfo info = SkImageInfo::Make(SkTMin(bench->getSize().fX, maxRTSize),
@@ -478,8 +478,8 @@
         fCtxFactory.reset(new GrContextFactory(grContextOpts));
 
         SkAssertResult(fTarget.init(bench, fCtxFactory, false,
-                                    GrContextFactory::kNative_GLContextType,
-                                    GrContextFactory::kNone_GLContextOptions, 0));
+                                    GrContextFactory::kNativeGL_ContextType,
+                                    GrContextFactory::kNone_ContextOptions, 0));
 
         fCanvas = fTarget.getCanvas();
         fTarget.setup();
diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp
index 225ca39..7534b1d 100644
--- a/tools/skiaserve/Request.cpp
+++ b/tools/skiaserve/Request.cpp
@@ -65,8 +65,8 @@
 SkCanvas* Request::getCanvas() {
 #if SK_SUPPORT_GPU
     GrContextFactory* factory = fContextFactory;
-    GLTestContext* gl = factory->getContextInfo(GrContextFactory::kNative_GLContextType,
-                                            GrContextFactory::kNone_GLContextOptions).fGLContext;
+    GLTestContext* gl = factory->getContextInfo(GrContextFactory::kNativeGL_ContextType,
+                                            GrContextFactory::kNone_ContextOptions).fGLContext;
     gl->makeCurrent();
 #endif
     SkASSERT(fDebugCanvas);
@@ -109,8 +109,8 @@
 
 GrContext* Request::getContext() {
 #if SK_SUPPORT_GPU
-  return fContextFactory->get(GrContextFactory::kNative_GLContextType,
-                              GrContextFactory::kNone_GLContextOptions);
+  return fContextFactory->get(GrContextFactory::kNativeGL_ContextType,
+                              GrContextFactory::kNone_ContextOptions);
 #else
   return nullptr;
 #endif