Add versions of MakeGL() that don't require include GrGLInterface.h in order to use the GrGLMakeNativeInterface

Change-Id: I77bd3c683c284aecc50a3552bbf1fb901f1bcc44
Reviewed-on: https://skia-review.googlesource.com/119002
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 0ebfd7c..21fd2e6 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -55,10 +55,14 @@
 class SK_API GrContext : public SkRefCnt {
 public:
     /**
-     * Creates a GrContext for a backend context.
+     * Creates a GrContext for a backend context. If no GrGLInterface is provided then the result of
+     * GrGLMakeNativeInterface() is used if it succeeds.
      */
     static sk_sp<GrContext> MakeGL(sk_sp<const GrGLInterface>, const GrContextOptions&);
     static sk_sp<GrContext> MakeGL(sk_sp<const GrGLInterface>);
+    static sk_sp<GrContext> MakeGL(const GrContextOptions&);
+    static sk_sp<GrContext> MakeGL();
+
     // Deprecated
     static sk_sp<GrContext> MakeGL(const GrGLInterface*);
     static sk_sp<GrContext> MakeGL(const GrGLInterface*, const GrContextOptions&);
diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h
index 64d0cfb..bf2685e 100644
--- a/include/gpu/gl/GrGLInterface.h
+++ b/include/gpu/gl/GrGLInterface.h
@@ -21,14 +21,14 @@
 /**
  * Rather than depend on platform-specific GL headers and libraries, we require
  * the client to provide a struct of GL function pointers. This struct can be
- * specified per-GrContext as a parameter to GrContext::MakeGL. If NULL is
- * passed to MakeGL then a "native" GL interface is created. If the native is
- * also NULL GrContext creation will fail.
+ * specified per-GrContext as a parameter to GrContext::MakeGL. If no interface is
+ * passed to MakeGL then a default GL interface is created using GrGLMakeNativeInterface().
+ * If this returns nullptr then GrContext::MakeGL() will fail.
  *
- * The default interface is returned by GrGLMakeNativeInterface. This function's
- * implementation is platform-specific. Several have been provided
- * (for GLX, WGL, EGL, etc), along with an implementation that simply returns
- * NULL.
+ * The implementation of GrGLMakeNativeInterface is platform-specific. Several
+ * implementations have been provided (for GLX, WGL, EGL, etc), along with an
+ * implementation that simply returns nullptr. Clients should select the most
+ * appropriate one to build.
  */
 SK_API sk_sp<const GrGLInterface> GrGLMakeNativeInterface();
 // Deprecated alternative to GrGLMakeNativeInterface().
diff --git a/src/gpu/GrDirectContext.cpp b/src/gpu/GrDirectContext.cpp
index 204d676..9407a7d 100644
--- a/src/gpu/GrDirectContext.cpp
+++ b/src/gpu/GrDirectContext.cpp
@@ -100,6 +100,15 @@
     return MakeGL(std::move(interface), defaultOptions);
 }
 
+sk_sp<GrContext> GrContext::MakeGL(const GrContextOptions& options) {
+    return MakeGL(nullptr, options);
+}
+
+sk_sp<GrContext> GrContext::MakeGL() {
+    GrContextOptions defaultOptions;
+    return MakeGL(nullptr, defaultOptions);
+}
+
 sk_sp<GrContext> GrContext::MakeGL(const GrGLInterface* interface) {
     return MakeGL(sk_ref_sp(interface));
 }