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

Side by Side Diff: src/gpu/GrGpuFactory.cpp

Issue 1825593002: GrVkGpu initialization cleanup. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments (and rebase to ToT) Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrContextFactory.cpp ('k') | src/gpu/gl/GrGLUniformHandler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "GrGpuFactory.h" 10 #include "GrGpuFactory.h"
11 11
12 #include "GrGpu.h" 12 #include "GrGpu.h"
13 #include "gl/GrGLConfig.h" 13 #include "gl/GrGLConfig.h"
14 #include "gl/GrGLGpu.h" 14 #include "gl/GrGLGpu.h"
15 #ifdef SK_VULKAN
16 #include "vk/GrVkGpu.h"
17 #endif
15 18
16 static CreateGpuProc gGpuFactories[kBackendCount] = { GrGLGpu::Create, nullptr } ; 19 static CreateGpuProc gGpuFactories[kBackendCount] = { GrGLGpu::Create, nullptr } ;
17 20
18 #ifdef SK_VULKAN 21 #ifdef SK_VULKAN
19 extern GrGpu* vk_gpu_create(GrBackendContext backendContext, const GrContextOpti ons& options, 22 GrGpuFactoryRegistrar gVkGpuFactoryProc(kVulkan_GrBackend, GrVkGpu::Create);
20 GrContext* context);
21 GrGpuFactoryRegistrar gVkGpuFactoryProc(kVulkan_GrBackend, vk_gpu_create);
22 #endif 23 #endif
23 24
24 GrGpuFactoryRegistrar::GrGpuFactoryRegistrar(int i, CreateGpuProc proc) { 25 GrGpuFactoryRegistrar::GrGpuFactoryRegistrar(int i, CreateGpuProc proc) {
25 gGpuFactories[i] = proc; 26 gGpuFactories[i] = proc;
26 } 27 }
27 28
28 GrGpu* GrGpu::Create(GrBackend backend, 29 GrGpu* GrGpu::Create(GrBackend backend,
29 GrBackendContext backendContext, 30 GrBackendContext backendContext,
30 const GrContextOptions& options, 31 const GrContextOptions& options,
31 GrContext* context) { 32 GrContext* context) {
32 SkASSERT((int)backend < kBackendCount); 33 SkASSERT((int)backend < kBackendCount);
33 if (!gGpuFactories[backend]) { 34 if (!gGpuFactories[backend]) {
34 return nullptr; 35 return nullptr;
35 } 36 }
36 return (gGpuFactories[backend])(backendContext, options, context); 37 return (gGpuFactories[backend])(backendContext, options, context);
37 } 38 }
OLDNEW
« no previous file with comments | « src/gpu/GrContextFactory.cpp ('k') | src/gpu/gl/GrGLUniformHandler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698