aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-04-06 09:18:00 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-06 14:44:53 +0000
commitc1b9c1005f1e07558c0d32cf8f80d022b312719e (patch)
treec0d85bc2d28c60e8a709814eb3680da61232d8a7 /include
parent9ca3065ca5bac6cc45c0ea5de23aebab92282227 (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrContext.h6
-rw-r--r--include/gpu/gl/GrGLInterface.h14
2 files changed, 12 insertions, 8 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 0ebfd7c979..21fd2e6376 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -55,10 +55,14 @@ class SkTraceMemoryDump;
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 64d0cfbfbe..bf2685eb1c 100644
--- a/include/gpu/gl/GrGLInterface.h
+++ b/include/gpu/gl/GrGLInterface.h
@@ -21,14 +21,14 @@ struct GrGLInterface;
/**
* 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().