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/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index d7094b7..d1e535e 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -76,19 +76,22 @@
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);
}
////////////////////////////////////////////////////////////////////////////////