Reland fully delineate GL usage w/ skia_use_gl.

Change-Id: I90f40467be145537cc08461fd3805606432f0cfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254240
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Rosasco <rosasco@google.com>
Auto-Submit: John Rosasco <rosasco@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/tools/gpu/GrContextFactory.cpp b/tools/gpu/GrContextFactory.cpp
index d0defdc..be33802 100644
--- a/tools/gpu/GrContextFactory.cpp
+++ b/tools/gpu/GrContextFactory.cpp
@@ -8,7 +8,9 @@
 
 #include "src/gpu/GrContextPriv.h"
 #include "tools/gpu/GrContextFactory.h"
+#ifdef SK_GL
 #include "tools/gpu/gl/GLTestContext.h"
+#endif
 
 #if SK_ANGLE
     #include "tools/gpu/gl/angle/GLTestContext_angle.h"
@@ -152,6 +154,7 @@
     std::unique_ptr<TestContext> testCtx;
     GrBackendApi backend = ContextTypeBackend(type);
     switch (backend) {
+#ifdef SK_GL
         case GrBackendApi::kOpenGL: {
             GLTestContext* glShareContext = masterContext
                     ? static_cast<GLTestContext*>(masterContext->fTestContext) : nullptr;
@@ -199,6 +202,7 @@
             testCtx.reset(glCtx);
             break;
         }
+#endif  // SK_GL
 #ifdef SK_VULKAN
         case GrBackendApi::kVulkan: {
             VkTestContext* vkSharedContext = masterContext
@@ -209,6 +213,7 @@
                 return ContextInfo();
             }
 
+#ifdef SK_GL
             // There is some bug (either in Skia or the NV Vulkan driver) where VkDevice
             // destruction will hang occaisonally. For some reason having an existing GL
             // context fixes this.
@@ -218,6 +223,7 @@
                     fSentinelGLContext.reset(CreatePlatformGLTestContext(kGLES_GrGLStandard));
                 }
             }
+#endif
             break;
         }
 #endif