xref: /aosp_15_r20/external/skia/src/gpu/graphite/vk/VulkanFramebuffer.h (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1 /*
2 * Copyright 2023 Google LLC
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 #ifndef skgpu_graphite_VulkanFramebuffer_DEFINED
9 #define skgpu_graphite_VulkanFramebuffer_DEFINED
10 
11 #include "src/gpu/graphite/Resource.h"
12 
13 #include "src/gpu/graphite/vk/VulkanGraphiteUtilsPriv.h"
14 
15 namespace skgpu::graphite {
16 
17 class VulkanSharedContext;
18 
19 /**
20  * Resource wrapper for VkFramebuffer
21 */
22 class VulkanFramebuffer : public Resource {
23 public:
24     static sk_sp<VulkanFramebuffer> Make(const VulkanSharedContext*,
25                                          const VkFramebufferCreateInfo&);
26 
framebuffer()27     VkFramebuffer framebuffer() {
28         return fFramebuffer;
29     }
30 
getResourceType()31     const char* getResourceType() const override { return "Vulkan Framebuffer"; }
32 
33 private:
34     VulkanFramebuffer(const VulkanSharedContext*, VkFramebuffer);
35     void freeGpuData() override;
36 
37     const VulkanSharedContext* fSharedContext;
38     VkFramebuffer fFramebuffer;
39 };
40 } // namespace skgpu::graphite
41 
42 #endif // skgpu_graphite_VulkanFramebuffer_DEFINED
43