Make room for shifting GrContext to GrDirectContext
Change-Id: I6291b0c513c641c3bb49260031b501da42b11ede
Reviewed-on: https://skia-review.googlesource.com/c/190002
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/gn/gpu.gni b/gn/gpu.gni
index d9fc96d..025583f 100644
--- a/gn/gpu.gni
+++ b/gn/gpu.gni
@@ -90,7 +90,6 @@
"$_src/gpu/GrDeferredUpload.h",
"$_src/gpu/GrDeinstantiateProxyTracker.cpp",
"$_src/gpu/GrDeinstantiateProxyTracker.h",
- "$_src/gpu/GrDirectContext.cpp",
"$_src/gpu/GrDistanceFieldGenFromVector.cpp",
"$_src/gpu/GrDistanceFieldGenFromVector.h",
"$_src/gpu/GrDrawingManager.cpp",
@@ -119,6 +118,7 @@
"$_src/gpu/GrImageContextPriv.h",
"$_src/gpu/GrImageTextureMaker.cpp",
"$_src/gpu/GrImageTextureMaker.h",
+ "$_src/gpu/GrLegacyDirectContext.cpp",
"$_src/gpu/GrMemoryPool.cpp",
"$_src/gpu/GrMemoryPool.h",
"$_src/gpu/GrMesh.h",
diff --git a/src/gpu/GrDirectContext.cpp b/src/gpu/GrLegacyDirectContext.cpp
similarity index 91%
rename from src/gpu/GrDirectContext.cpp
rename to src/gpu/GrLegacyDirectContext.cpp
index fb2adf6..490b62b 100644
--- a/src/gpu/GrDirectContext.cpp
+++ b/src/gpu/GrLegacyDirectContext.cpp
@@ -24,14 +24,14 @@
#include "vk/GrVkGpu.h"
#endif
-class SK_API GrDirectContext : public GrContext {
+class SK_API GrLegacyDirectContext : public GrContext {
public:
- GrDirectContext(GrBackendApi backend, const GrContextOptions& options)
+ GrLegacyDirectContext(GrBackendApi backend, const GrContextOptions& options)
: INHERITED(backend, options)
, fAtlasManager(nullptr) {
}
- ~GrDirectContext() override {
+ ~GrLegacyDirectContext() override {
// this if-test protects against the case where the context is being destroyed
// before having been fully created
if (this->priv().getGpu()) {
@@ -120,7 +120,7 @@
sk_sp<GrContext> GrContext::MakeGL(sk_sp<const GrGLInterface> interface,
const GrContextOptions& options) {
- sk_sp<GrContext> context(new GrDirectContext(GrBackendApi::kOpenGL, options));
+ sk_sp<GrContext> context(new GrLegacyDirectContext(GrBackendApi::kOpenGL, options));
context->fGpu = GrGLGpu::Make(std::move(interface), options, context.get());
if (!context->fGpu) {
@@ -140,7 +140,7 @@
sk_sp<GrContext> GrContext::MakeMock(const GrMockOptions* mockOptions,
const GrContextOptions& options) {
- sk_sp<GrContext> context(new GrDirectContext(GrBackendApi::kMock, options));
+ sk_sp<GrContext> context(new GrLegacyDirectContext(GrBackendApi::kMock, options));
context->fGpu = GrMockGpu::Make(mockOptions, options, context.get());
if (!context->fGpu) {
@@ -166,7 +166,7 @@
const GrContextOptions& options) {
#ifdef SK_VULKAN
GrContextOptions defaultOptions;
- sk_sp<GrContext> context(new GrDirectContext(GrBackendApi::kVulkan, options));
+ sk_sp<GrContext> context(new GrLegacyDirectContext(GrBackendApi::kVulkan, options));
context->fGpu = GrVkGpu::Make(backendContext, options, context.get());
if (!context->fGpu) {
@@ -189,7 +189,7 @@
}
sk_sp<GrContext> GrContext::MakeMetal(void* device, void* queue, const GrContextOptions& options) {
- sk_sp<GrContext> context(new GrDirectContext(GrBackendApi::kMetal, options));
+ sk_sp<GrContext> context(new GrLegacyDirectContext(GrBackendApi::kMetal, options));
context->fGpu = GrMtlTrampoline::MakeGpu(context.get(), options, device, queue);
if (!context->fGpu) {