OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 GrVkFramebuffer_DEFINED | 8 #ifndef GrVkFramebuffer_DEFINED |
9 #define GrVkFramebuffer_DEFINED | 9 #define GrVkFramebuffer_DEFINED |
10 | 10 |
11 #include "GrTypes.h" | 11 #include "GrTypes.h" |
12 | 12 |
13 #include "GrVkResource.h" | 13 #include "GrVkResource.h" |
14 | 14 |
15 #include "vk/GrVkDefines.h" | 15 #include "vk/GrVkDefines.h" |
16 | 16 |
17 class GrVkGpu; | 17 class GrVkGpu; |
18 class GrVkImageView; | 18 class GrVkImageView; |
19 class GrVkRenderPass; | 19 class GrVkRenderPass; |
20 | 20 |
21 class GrVkFramebuffer : public GrVkResource { | 21 class GrVkFramebuffer : public GrVkResource { |
22 public: | 22 public: |
23 static GrVkFramebuffer* Create(GrVkGpu* gpu, | 23 static GrVkFramebuffer* Create(GrVkGpu* gpu, |
24 int width, int height, | 24 int width, int height, |
25 const GrVkRenderPass* renderPass, | 25 const GrVkRenderPass* renderPass, |
26 const GrVkImageView* colorAttachment, | 26 const GrVkImageView* colorAttachment, |
27 const GrVkImageView* resolveAttachment, | |
28 const GrVkImageView* stencilAttachment); | 27 const GrVkImageView* stencilAttachment); |
29 | 28 |
30 VkFramebuffer framebuffer() const { return fFramebuffer; } | 29 VkFramebuffer framebuffer() const { return fFramebuffer; } |
31 | 30 |
32 #ifdef SK_TRACE_VK_RESOURCES | 31 #ifdef SK_TRACE_VK_RESOURCES |
33 void dumpInfo() const override { | 32 void dumpInfo() const override { |
34 SkDebugf("GrVkFramebuffer: %d (%d refs)\n", fFramebuffer, this->getRefCn
t()); | 33 SkDebugf("GrVkFramebuffer: %d (%d refs)\n", fFramebuffer, this->getRefCn
t()); |
35 } | 34 } |
36 #endif | 35 #endif |
37 | 36 |
38 private: | 37 private: |
39 GrVkFramebuffer(VkFramebuffer framebuffer) : INHERITED(), fFramebuffer(frame
buffer) {} | 38 GrVkFramebuffer(VkFramebuffer framebuffer) : INHERITED(), fFramebuffer(frame
buffer) {} |
40 | 39 |
41 GrVkFramebuffer(const GrVkFramebuffer&); | 40 GrVkFramebuffer(const GrVkFramebuffer&); |
42 GrVkFramebuffer& operator=(const GrVkFramebuffer&); | 41 GrVkFramebuffer& operator=(const GrVkFramebuffer&); |
43 | 42 |
44 void freeGPUData(const GrVkGpu* gpu) const override; | 43 void freeGPUData(const GrVkGpu* gpu) const override; |
45 | 44 |
46 VkFramebuffer fFramebuffer; | 45 VkFramebuffer fFramebuffer; |
47 | 46 |
48 typedef GrVkResource INHERITED; | 47 typedef GrVkResource INHERITED; |
49 }; | 48 }; |
50 | 49 |
51 #endif | 50 #endif |
OLD | NEW |