Chromium Code Reviews| Index: src/gpu/vk/GrVkImage.h |
| diff --git a/src/gpu/vk/GrVkImage.h b/src/gpu/vk/GrVkImage.h |
| index 5b3b527202be99236a340485fe93354ec6591baf..d912ce91c35c6b379fd48c1d1f9c5366678c9804 100644 |
| --- a/src/gpu/vk/GrVkImage.h |
| +++ b/src/gpu/vk/GrVkImage.h |
| @@ -9,6 +9,8 @@ |
| #define GrVkImage_DEFINED |
| #include "GrVkResource.h" |
| + |
| +#include "GrTypesPriv.h" |
| #include "SkTypes.h" |
| #include "vk/GrVkDefines.h" |
| @@ -25,10 +27,11 @@ public: |
| kLinearTiling_Flag = 0x01 |
| }; |
| - VkImage fImage; |
| - VkDeviceMemory fAlloc; |
| - Flags fFlags; |
| - VkFormat fFormat; |
| + VkImage fImage; |
| + VkDeviceMemory fAlloc; |
| + Flags fFlags; |
| + VkFormat fFormat; |
| + GrBackendObjectOwnership fOwnership; |
|
jvanverth1
2016/04/29 13:44:14
I added this here rather than the texture because
|
| Resource() |
| : INHERITED() |
| @@ -37,10 +40,13 @@ public: |
| , fFlags(kNo_Flags) |
| , fFormat(VK_FORMAT_UNDEFINED) {} |
| - Resource(VkImage image, VkDeviceMemory alloc, Flags flags, VkFormat format) |
| - : fImage(image), fAlloc(alloc), fFlags(flags), fFormat(format) {} |
| + Resource(VkImage image, VkDeviceMemory alloc, Flags flags, VkFormat format, |
| + GrBackendObjectOwnership ownership = GrBackendObjectOwnership::kOwned) |
| + : fImage(image), fAlloc(alloc), fFlags(flags), fFormat(format) |
| + , fOwnership(ownership) {} |
| ~Resource() override {} |
| + |
| private: |
| void freeGPUData(const GrVkGpu* gpu) const override; |
| @@ -51,7 +57,8 @@ public: |
| class BorrowedResource : public Resource { |
| public: |
| BorrowedResource(VkImage image, VkDeviceMemory alloc, Flags flags, VkFormat format) |
| - : Resource(image, alloc, flags, format) {} |
| + : Resource(image, alloc, flags, format, GrBackendObjectOwnership::kBorrowed) { |
| + } |
| private: |
| void freeGPUData(const GrVkGpu* gpu) const override; |
| }; |