aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-03-23 16:10:36 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-23 21:12:50 +0000
commit032aaae5be51e92ec9677d6c511241b19a7cb70d (patch)
tree8fe817c2a16ff23bcb18dfda5a70cec1cc9524de /src
parenta6a3df7d64dc81082619ab103450fc6d0af7c644 (diff)
Remove legacy GrContext factories function and supporting code/types.
Change-Id: I437a4a0a58bf70ea1b8b0659b099a2af2bfa64fe Reviewed-on: https://skia-review.googlesource.com/116197 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrDirectContext.cpp23
-rw-r--r--src/gpu/GrGpu.h9
-rw-r--r--src/gpu/GrGpuFactory.cpp32
-rw-r--r--src/gpu/GrGpuFactory.h24
-rw-r--r--src/gpu/gl/GrGLGpu.cpp6
-rw-r--r--src/gpu/gl/GrGLGpu.h1
-rw-r--r--src/gpu/mock/GrMockGpu.cpp5
-rw-r--r--src/gpu/mock/GrMockGpu.h1
-rw-r--r--src/gpu/vk/GrVkGpu.cpp6
-rw-r--r--src/gpu/vk/GrVkGpu.h2
10 files changed, 0 insertions, 109 deletions
diff --git a/src/gpu/GrDirectContext.cpp b/src/gpu/GrDirectContext.cpp
index 7302c90d5a..204d676686 100644
--- a/src/gpu/GrDirectContext.cpp
+++ b/src/gpu/GrDirectContext.cpp
@@ -95,29 +95,6 @@ private:
typedef GrContext INHERITED;
};
-GrContext* GrContext::Create(GrBackend backend, GrBackendContext backendContext) {
- GrContextOptions defaultOptions;
- return Create(backend, backendContext, defaultOptions);
-}
-
-GrContext* GrContext::Create(GrBackend backend, GrBackendContext backendContext,
- const GrContextOptions& options) {
-
- sk_sp<GrContext> context(new GrDirectContext(backend));
-
- context->fGpu = GrGpu::Make(backend, backendContext, options, context.get());
- if (!context->fGpu) {
- return nullptr;
- }
-
- context->fCaps = context->fGpu->refCaps();
- if (!context->init(options)) {
- return nullptr;
- }
-
- return context.release();
-}
-
sk_sp<GrContext> GrContext::MakeGL(sk_sp<const GrGLInterface> interface) {
GrContextOptions defaultOptions;
return MakeGL(std::move(interface), defaultOptions);
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 78b6fd4654..87d93ac4e4 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -44,15 +44,6 @@ class SkJSONWriter;
class GrGpu : public SkRefCnt {
public:
- /**
- * Create an instance of GrGpu that matches the specified backend. If the requested backend is
- * not supported (at compile-time or run-time) this returns nullptr. The context will not be
- * fully constructed and should not be used by GrGpu until after this function returns.
- */
- static sk_sp<GrGpu> Make(GrBackend, GrBackendContext, const GrContextOptions&, GrContext*);
-
- ////////////////////////////////////////////////////////////////////////////
-
GrGpu(GrContext* context);
~GrGpu() override;
diff --git a/src/gpu/GrGpuFactory.cpp b/src/gpu/GrGpuFactory.cpp
deleted file mode 100644
index eb3c2928b6..0000000000
--- a/src/gpu/GrGpuFactory.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2011 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-
-#include "GrGpuFactory.h"
-#include "gl/GrGLGpu.h"
-#include "mock/GrMockGpu.h"
-#ifdef SK_VULKAN
-#include "vk/GrVkGpu.h"
-#endif
-
-sk_sp<GrGpu> GrGpu::Make(GrBackend backend,
- GrBackendContext backendContext,
- const GrContextOptions& options,
- GrContext* context) {
- switch (backend) {
- case kOpenGL_GrBackend:
- return GrGLGpu::Make(backendContext, options, context);
-#ifdef SK_VULKAN
- case kVulkan_GrBackend:
- return GrVkGpu::Make(backendContext, options, context);
-#endif
- case kMock_GrBackend:
- return GrMockGpu::Make(backendContext, options, context);
- default:
- return nullptr;
- }
-}
diff --git a/src/gpu/GrGpuFactory.h b/src/gpu/GrGpuFactory.h
deleted file mode 100644
index aecc2c1705..0000000000
--- a/src/gpu/GrGpuFactory.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef GrGpuFactory_DEFINED
-#define GrGpuFactory_DEFINED
-
-#include "GrTypes.h"
-
-class GrGpu;
-class GrContext;
-struct GrContextOptions;
-
-typedef GrGpu* (*CreateGpuProc)(GrBackendContext, const GrContextOptions& options, GrContext*);
-
-class GrGpuFactoryRegistrar {
-public:
- GrGpuFactoryRegistrar(int i, CreateGpuProc proc);
-};
-
-#endif
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index c6e2d2537f..08bca6dcc8 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -175,12 +175,6 @@ bool GrGLGpu::BlendCoeffReferencesConstant(GrBlendCoeff coeff) {
///////////////////////////////////////////////////////////////////////////////
-sk_sp<GrGpu> GrGLGpu::Make(GrBackendContext backendContext, const GrContextOptions& options,
- GrContext* context) {
- const auto* interface = reinterpret_cast<const GrGLInterface*>(backendContext);
- return Make(sk_ref_sp(interface), options, context);
-}
-
sk_sp<GrGpu> GrGLGpu::Make(sk_sp<const GrGLInterface> interface, const GrContextOptions& options,
GrContext* context) {
if (!interface) {
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 9a03d97126..4858963271 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -34,7 +34,6 @@ class GrSwizzle;
class GrGLGpu final : public GrGpu, private GrMesh::SendToGpuImpl {
public:
- static sk_sp<GrGpu> Make(GrBackendContext backendContext, const GrContextOptions&, GrContext*);
static sk_sp<GrGpu> Make(sk_sp<const GrGLInterface>, const GrContextOptions&, GrContext*);
~GrGLGpu() override;
diff --git a/src/gpu/mock/GrMockGpu.cpp b/src/gpu/mock/GrMockGpu.cpp
index 4b786ab9b2..a677d63bba 100644
--- a/src/gpu/mock/GrMockGpu.cpp
+++ b/src/gpu/mock/GrMockGpu.cpp
@@ -38,11 +38,6 @@ int GrMockGpu::NextExternalRenderTargetID() {
return sk_atomic_inc(&gID);
}
-sk_sp<GrGpu> GrMockGpu::Make(GrBackendContext backendContext,
- const GrContextOptions& contextOptions, GrContext* context) {
- return Make(reinterpret_cast<const GrMockOptions*>(backendContext), contextOptions, context);
-}
-
sk_sp<GrGpu> GrMockGpu::Make(const GrMockOptions* mockOptions,
const GrContextOptions& contextOptions, GrContext* context) {
static const GrMockOptions kDefaultOptions = GrMockOptions();
diff --git a/src/gpu/mock/GrMockGpu.h b/src/gpu/mock/GrMockGpu.h
index 5065350746..73e6a4bfc5 100644
--- a/src/gpu/mock/GrMockGpu.h
+++ b/src/gpu/mock/GrMockGpu.h
@@ -20,7 +20,6 @@ class GrPipeline;
class GrMockGpu : public GrGpu {
public:
- static sk_sp<GrGpu> Make(GrBackendContext, const GrContextOptions&, GrContext*);
static sk_sp<GrGpu> Make(const GrMockOptions*, const GrContextOptions&, GrContext*);
~GrMockGpu() override {}
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index b59d85e0bb..af9505821a 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -73,12 +73,6 @@ VKAPI_ATTR VkBool32 VKAPI_CALL DebugReportCallback(
}
#endif
-sk_sp<GrGpu> GrVkGpu::Make(GrBackendContext backendContext, const GrContextOptions& options,
- GrContext* context) {
- const auto* backend = reinterpret_cast<const GrVkBackendContext*>(backendContext);
- return Make(sk_ref_sp(backend), options, context);
-}
-
sk_sp<GrGpu> GrVkGpu::Make(sk_sp<const GrVkBackendContext> backendContext,
const GrContextOptions& options, GrContext* context) {
if (!backendContext) {
diff --git a/src/gpu/vk/GrVkGpu.h b/src/gpu/vk/GrVkGpu.h
index 20df339627..7bdfbeaab3 100644
--- a/src/gpu/vk/GrVkGpu.h
+++ b/src/gpu/vk/GrVkGpu.h
@@ -9,7 +9,6 @@
#define GrVkGpu_DEFINED
#include "GrGpu.h"
-#include "GrGpuFactory.h"
#include "vk/GrVkBackendContext.h"
#include "GrVkCaps.h"
#include "GrVkCopyManager.h"
@@ -38,7 +37,6 @@ namespace SkSL {
class GrVkGpu : public GrGpu {
public:
- static sk_sp<GrGpu> Make(GrBackendContext backendContext, const GrContextOptions&, GrContext*);
static sk_sp<GrGpu> Make(sk_sp<const GrVkBackendContext>, const GrContextOptions&, GrContext*);
~GrVkGpu() override;