Add Make[backend] calls for creating GrContexts
Docs-Preview: https://skia.org/?cl=26369
Bug: skia:
Change-Id: I460ee63e466f85b05918479f068a2e5ca2d70550
Reviewed-on: https://skia-review.googlesource.com/26369
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index f48b8db..b5d2f74 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -22,12 +22,14 @@
class GrContextThreadSafeProxy;
class GrDrawingManager;
struct GrDrawOpAtlasConfig;
-class GrRenderTargetContext;
class GrFragmentProcessor;
+struct GrGLInterface;
class GrGpu;
class GrIndexBuffer;
+struct GrMockOptions;
class GrOvalRenderer;
class GrPath;
+class GrRenderTargetContext;
class GrResourceEntry;
class GrResourceCache;
class GrResourceProvider;
@@ -37,6 +39,7 @@
class GrTextContext;
class GrTextureProxy;
class GrVertexBuffer;
+struct GrVkBackendContext;
class GrSwizzle;
class SkTraceMemoryDump;
@@ -51,6 +54,14 @@
static GrContext* Create(GrBackend, GrBackendContext, const GrContextOptions& options);
static GrContext* Create(GrBackend, GrBackendContext);
+ static sk_sp<GrContext> MakeGL(const GrGLInterface*, const GrContextOptions&);
+ static sk_sp<GrContext> MakeGL(const GrGLInterface*);
+
+#ifdef SK_VULKAN
+ static sk_sp<GrContext> MakeVulkan(const GrVkBackendContext*, const GrContextOptions&);
+ static sk_sp<GrContext> MakeVulkan(const GrVkBackendContext*);
+#endif
+
#ifdef SK_METAL
/**
* Makes a GrContext which uses Metal as the backend. The device parameter is an MTLDevice
@@ -59,8 +70,12 @@
* GrContext is destroyed.
*/
static sk_sp<GrContext> MakeMetal(void* device, void* queue, const GrContextOptions& options);
+ static sk_sp<GrContext> MakeMetal(void* device, void* queue);
#endif
+ static sk_sp<GrContext> MakeMock(const GrMockOptions*, const GrContextOptions&);
+ static sk_sp<GrContext> MakeMock(const GrMockOptions*);
+
virtual ~GrContext();
sk_sp<GrContextThreadSafeProxy> threadSafeProxy();
diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h
index 56e655d..f178532 100644
--- a/include/gpu/gl/GrGLInterface.h
+++ b/include/gpu/gl/GrGLInterface.h
@@ -17,8 +17,8 @@
/**
* 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::Create. If NULL is
- * passed to Create then a "default" GL interface is created. If the default is
+ * specified per-GrContext as a parameter to GrContext::MakeGL. If NULL is
+ * passed to MakeGL then a "default" GL interface is created. If the default is
* also NULL GrContext creation will fail.
*
* The default interface is returned by GrGLDefaultInterface. This function's