Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: src/gpu/GrGpuFactory.cpp

Issue 1290813002: Add support for a new GPU interface (Closed) Base URL: https://chromium.googlesource.com/skia@master
Patch Set: Get rid of test #defines Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrContextFactory.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpuFactory.cpp
diff --git a/src/gpu/GrGpuFactory.cpp b/src/gpu/GrGpuFactory.cpp
index 3001a0d41aa001df664adc4174477a5be6da546f..854e484747cb58ce9b5d3410d724d313da126047 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;
}
« no previous file with comments | « src/gpu/GrContextFactory.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698