diff options
author | 2017-07-25 10:05:01 -0400 | |
---|---|---|
committer | 2017-07-25 14:33:03 +0000 | |
commit | 02611d9afdd887ee443825ac88377f2eea093380 (patch) | |
tree | 3e35b4e4fde4b6f387f7bdb345b049c1ab76e182 /src/gpu/vk/GrVkGpu.cpp | |
parent | 10b6ad13f996d2f522bc057d17acea58e43a7f0b (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 'src/gpu/vk/GrVkGpu.cpp')
-rw-r--r-- | src/gpu/vk/GrVkGpu.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index d7094b7c18..d1e535ea6a 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -76,19 +76,22 @@ VKAPI_ATTR VkBool32 VKAPI_CALL DebugReportCallback( GrGpu* GrVkGpu::Create(GrBackendContext backendContext, const GrContextOptions& options, GrContext* context) { - const GrVkBackendContext* vkBackendContext = - reinterpret_cast<const GrVkBackendContext*>(backendContext); - if (!vkBackendContext) { + return Create(reinterpret_cast<const GrVkBackendContext*>(backendContext), options, context); +} + +GrGpu* GrVkGpu::Create(const GrVkBackendContext* backendContext, const GrContextOptions& options, + GrContext* context) { + if (!backendContext) { return nullptr; } else { - vkBackendContext->ref(); + backendContext->ref(); } - if (!vkBackendContext->fInterface->validate(vkBackendContext->fExtensions)) { + if (!backendContext->fInterface->validate(backendContext->fExtensions)) { return nullptr; } - return new GrVkGpu(context, options, vkBackendContext); + return new GrVkGpu(context, options, backendContext); } //////////////////////////////////////////////////////////////////////////////// |