OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrVkGpu_DEFINED | 8 #ifndef GrVkGpu_DEFINED |
9 #define GrVkGpu_DEFINED | 9 #define GrVkGpu_DEFINED |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 class GrVkTexture; | 43 class GrVkTexture; |
44 struct GrVkInterface; | 44 struct GrVkInterface; |
45 | 45 |
46 class GrVkGpu : public GrGpu { | 46 class GrVkGpu : public GrGpu { |
47 public: | 47 public: |
48 static GrGpu* Create(GrBackendContext backendContext, const GrContextOptions
& options, | 48 static GrGpu* Create(GrBackendContext backendContext, const GrContextOptions
& options, |
49 GrContext* context); | 49 GrContext* context); |
50 | 50 |
51 ~GrVkGpu() override; | 51 ~GrVkGpu() override; |
52 | 52 |
53 const GrVkInterface* vkInterface() const { return fBackendContext->fInterfac
e; } | 53 const GrVkInterface* vkInterface() const { return fBackendContext->fInterfac
e.get(); } |
54 const GrVkCaps& vkCaps() const { return *fVkCaps; } | 54 const GrVkCaps& vkCaps() const { return *fVkCaps; } |
55 | 55 |
56 VkDevice device() const { return fDevice; } | 56 VkDevice device() const { return fDevice; } |
57 VkQueue queue() const { return fQueue; } | 57 VkQueue queue() const { return fQueue; } |
58 VkCommandPool cmdPool() const { return fCmdPool; } | 58 VkCommandPool cmdPool() const { return fCmdPool; } |
59 VkPhysicalDeviceMemoryProperties physicalDeviceMemoryProperties() const { | 59 VkPhysicalDeviceMemoryProperties physicalDeviceMemoryProperties() const { |
60 return fPhysDevMemProps; | 60 return fPhysDevMemProps; |
61 } | 61 } |
62 | 62 |
63 GrVkResourceProvider& resourceProvider() { return fResourceProvider; } | 63 GrVkResourceProvider& resourceProvider() { return fResourceProvider; } |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 const GrVkBackendContext* backendContext); | 175 const GrVkBackendContext* backendContext); |
176 | 176 |
177 void onResetContext(uint32_t resetBits) override {} | 177 void onResetContext(uint32_t resetBits) override {} |
178 | 178 |
179 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, | 179 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, |
180 const SkTArray<GrMipLevel>&) override; | 180 const SkTArray<GrMipLevel>&) override; |
181 | 181 |
182 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, SkBudgeted, | 182 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, SkBudgeted, |
183 const SkTArray<GrMipLevel>&) override {
return NULL; } | 183 const SkTArray<GrMipLevel>&) override {
return NULL; } |
184 | 184 |
185 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership
) override; | 185 sk_sp<GrTexture> onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwn
ership) override; |
186 | 186 |
187 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, | 187 sk_sp<GrRenderTarget> onWrapBackendRenderTarget(const GrBackendRenderTargetD
esc&, |
188 GrWrapOwnership) override; | 188 GrWrapOwnership) override; |
189 GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTextureDes
c&) override { return NULL; } | 189 sk_sp<GrRenderTarget> onWrapBackendTextureAsRenderTarget(const GrBackendText
ureDesc&) override { |
| 190 return nullptr; |
| 191 } |
190 | 192 |
191 GrBuffer* onCreateBuffer(size_t size, GrBufferType type, GrAccessPattern, | 193 GrBuffer* onCreateBuffer(size_t size, GrBufferType type, GrAccessPattern, |
192 const void* data) override; | 194 const void* data) override; |
193 | 195 |
194 gr_instanced::InstancedRendering* onCreateInstancedRendering() override { re
turn nullptr; } | 196 gr_instanced::InstancedRendering* onCreateInstancedRendering() override { re
turn nullptr; } |
195 | 197 |
196 bool onReadPixels(GrSurface* surface, | 198 bool onReadPixels(GrSurface* surface, |
197 int left, int top, int width, int height, | 199 int left, int top, int width, int height, |
198 GrPixelConfig, | 200 GrPixelConfig, |
199 void* buffer, | 201 void* buffer, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 #else | 283 #else |
282 // Shaderc compiler used for compiling glsl in spirv. We only want to create
the compiler once | 284 // Shaderc compiler used for compiling glsl in spirv. We only want to create
the compiler once |
283 // since there is significant overhead to the first compile of any compiler. | 285 // since there is significant overhead to the first compile of any compiler. |
284 shaderc_compiler_t fCompiler; | 286 shaderc_compiler_t fCompiler; |
285 #endif | 287 #endif |
286 | 288 |
287 typedef GrGpu INHERITED; | 289 typedef GrGpu INHERITED; |
288 }; | 290 }; |
289 | 291 |
290 #endif | 292 #endif |
OLD | NEW |