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