aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpuFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrGpuFactory.cpp')
-rw-r--r--src/gpu/GrGpuFactory.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gpu/GrGpuFactory.cpp b/src/gpu/GrGpuFactory.cpp
index 3001a0d41a..854e484747 100644
--- a/src/gpu/GrGpuFactory.cpp
+++ b/src/gpu/GrGpuFactory.cpp
@@ -13,8 +13,13 @@
#include "gl/GrGLConfig.h"
#include "gl/GrGLGpu.h"
-static const int kMaxNumBackends = 4;
-static CreateGpuProc gGpuFactories[kMaxNumBackends] = {GrGLGpu::Create, NULL, NULL, NULL};
+static CreateGpuProc gGpuFactories[kBackendCount] = { GrGLGpu::Create, NULL };
+
+#ifdef SK_VULKAN
+extern GrGpu* vk_gpu_create(GrBackendContext backendContext, const GrContextOptions& options,
+ GrContext* context);
+GrGpuFactoryRegistrar gVkGpuFactoryProc(kVulkan_GrBackend, vk_gpu_create);
+#endif
GrGpuFactoryRegistrar::GrGpuFactoryRegistrar(int i, CreateGpuProc proc) {
gGpuFactories[i] = proc;
@@ -24,7 +29,7 @@ GrGpu* GrGpu::Create(GrBackend backend,
GrBackendContext backendContext,
const GrContextOptions& options,
GrContext* context) {
- SkASSERT((int)backend < kMaxNumBackends);
+ SkASSERT((int)backend < kBackendCount);
if (!gGpuFactories[backend]) {
return NULL;
}