reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 1 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 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. |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 8 | |
egdaniel | 384181c | 2015-03-26 09:09:41 -0700 | [diff] [blame] | 9 | #include "GrGpuFactory.h" |
jvanverth | 39edf76 | 2014-12-22 11:44:19 -0800 | [diff] [blame] | 10 | #include "gl/GrGLGpu.h" |
Brian Salomon | 91a3e52 | 2017-06-23 10:58:19 -0400 | [diff] [blame] | 11 | #include "mock/GrMockGpu.h" |
jvanverth | 633b356 | 2016-03-23 11:01:22 -0700 | [diff] [blame] | 12 | #ifdef SK_VULKAN |
| 13 | #include "vk/GrVkGpu.h" |
| 14 | #endif |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 15 | |
Brian Salomon | 384fab4 | 2017-12-07 12:33:05 -0500 | [diff] [blame] | 16 | sk_sp<GrGpu> GrGpu::Make(GrBackend backend, |
| 17 | GrBackendContext backendContext, |
| 18 | const GrContextOptions& options, |
| 19 | GrContext* context) { |
Brian Salomon | 91a3e52 | 2017-06-23 10:58:19 -0400 | [diff] [blame] | 20 | switch (backend) { |
| 21 | case kOpenGL_GrBackend: |
Brian Salomon | 384fab4 | 2017-12-07 12:33:05 -0500 | [diff] [blame] | 22 | return GrGLGpu::Make(backendContext, options, context); |
Brian Salomon | 91a3e52 | 2017-06-23 10:58:19 -0400 | [diff] [blame] | 23 | #ifdef SK_VULKAN |
| 24 | case kVulkan_GrBackend: |
Brian Salomon | 384fab4 | 2017-12-07 12:33:05 -0500 | [diff] [blame] | 25 | return GrVkGpu::Make(backendContext, options, context); |
Brian Salomon | 91a3e52 | 2017-06-23 10:58:19 -0400 | [diff] [blame] | 26 | #endif |
| 27 | case kMock_GrBackend: |
Brian Salomon | 384fab4 | 2017-12-07 12:33:05 -0500 | [diff] [blame] | 28 | return GrMockGpu::Make(backendContext, options, context); |
Brian Salomon | 91a3e52 | 2017-06-23 10:58:19 -0400 | [diff] [blame] | 29 | default: |
| 30 | return nullptr; |
egdaniel | 384181c | 2015-03-26 09:09:41 -0700 | [diff] [blame] | 31 | } |
egdaniel | 384181c | 2015-03-26 09:09:41 -0700 | [diff] [blame] | 32 | } |