diff options
Diffstat (limited to 'src/gpu/vk/GrVkSemaphore.h')
-rw-r--r-- | src/gpu/vk/GrVkSemaphore.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/gpu/vk/GrVkSemaphore.h b/src/gpu/vk/GrVkSemaphore.h index 0a3bc1742b..b99eb944f7 100644 --- a/src/gpu/vk/GrVkSemaphore.h +++ b/src/gpu/vk/GrVkSemaphore.h @@ -13,17 +13,23 @@ #include "vk/GrVkTypes.h" +class GrBackendSemaphore; class GrVkGpu; class GrVkSemaphore : public GrSemaphore { public: - static sk_sp<GrVkSemaphore> Make(const GrVkGpu* gpu); + static sk_sp<GrVkSemaphore> Make(const GrVkGpu* gpu, bool isOwned); + + static sk_sp<GrVkSemaphore> MakeWrapped(const GrVkGpu* gpu, + VkSemaphore semaphore, + GrWrapOwnership); ~GrVkSemaphore() override; class Resource : public GrVkResource { public: - Resource(VkSemaphore semaphore) : INHERITED(), fSemaphore(semaphore) {} + Resource(VkSemaphore semaphore, bool isOwned) + : INHERITED(), fSemaphore(semaphore), fIsOwned(isOwned) {} ~Resource() override {} @@ -38,6 +44,7 @@ public: void freeGPUData(const GrVkGpu* gpu) const override; VkSemaphore fSemaphore; + bool fIsOwned; typedef GrVkResource INHERITED; }; @@ -45,7 +52,9 @@ public: const Resource* getResource() const { return fResource; } private: - GrVkSemaphore(const GrVkGpu* gpu, VkSemaphore semaphore); + GrVkSemaphore(const GrVkGpu* gpu, VkSemaphore semaphore, bool isOwned); + + void setBackendSemaphore(GrBackendSemaphore*) const override; const Resource* fResource; |