1 /* 2 * Copyright 2011 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 9 #include "GrGpuFactory.h" 10 #include "gl/GrGLGpu.h" 11 #include "mock/GrMockGpu.h" 12 #ifdef SK_VULKAN 13 #include "vk/GrVkGpu.h" 14 #endif 15 16 GrGpu* GrGpu::Create(GrBackend backend, 17 GrBackendContext backendContext, 18 const GrContextOptions& options, 19 GrContext* context) { 20 switch (backend) { 21 case kOpenGL_GrBackend: 22 return GrGLGpu::Create(backendContext, options, context); 23 #ifdef SK_VULKAN 24 case kVulkan_GrBackend: 25 return GrVkGpu::Create(backendContext, options, context); 26 #endif 27 case kMock_GrBackend: 28 return GrMockGpu::Create(backendContext, options, context); 29 default: 30 return nullptr; 31 } 32 } 33