aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-07-25 10:05:01 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-25 14:33:03 +0000
commit02611d9afdd887ee443825ac88377f2eea093380 (patch)
tree3e35b4e4fde4b6f387f7bdb345b049c1ab76e182 /include/gpu
parent10b6ad13f996d2f522bc057d17acea58e43a7f0b (diff)
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>
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/GrContext.h17
-rw-r--r--include/gpu/gl/GrGLInterface.h4
2 files changed, 18 insertions, 3 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index f48b8db710..b5d2f741ef 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -22,12 +22,14 @@ class GrContextPriv;
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 GrTextBlobCache;
class GrTextContext;
class GrTextureProxy;
class GrVertexBuffer;
+struct GrVkBackendContext;
class GrSwizzle;
class SkTraceMemoryDump;
@@ -51,6 +54,14 @@ public:
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 @@ public:
* 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 56e655d887..f1785326fb 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