Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Static Public Member Functions | List of all members
GrVkSemaphore Class Reference

#include <GrVkSemaphore.h>

Inheritance diagram for GrVkSemaphore:
GrSemaphore

Classes

class  Resource
 

Public Member Functions

 ~GrVkSemaphore () override
 
GrBackendSemaphore backendSemaphore () const override
 
ResourcegetResource ()
 
- Public Member Functions inherited from GrSemaphore
virtual ~GrSemaphore ()
 
virtual GrBackendSemaphore backendSemaphore () const =0
 

Static Public Member Functions

static std::unique_ptr< GrVkSemaphoreMake (GrVkGpu *gpu, bool isOwned)
 
static std::unique_ptr< GrVkSemaphoreMakeWrapped (GrVkGpu *, VkSemaphore, GrSemaphoreWrapType, GrWrapOwnership)
 

Detailed Description

Definition at line 22 of file GrVkSemaphore.h.

Constructor & Destructor Documentation

◆ ~GrVkSemaphore()

GrVkSemaphore::~GrVkSemaphore ( )
override

Definition at line 57 of file GrVkSemaphore.cpp.

57 {
58 if (fResource) {
59 fResource->unref();
60 }
61}

Member Function Documentation

◆ backendSemaphore()

GrBackendSemaphore GrVkSemaphore::backendSemaphore ( ) const
overridevirtual

Implements GrSemaphore.

Definition at line 70 of file GrVkSemaphore.cpp.

70 {
71 return GrBackendSemaphores::MakeVk(fResource->semaphore());
72}
VkSemaphore semaphore() const
Definition: GrVkSemaphore.h:47
SK_API GrBackendSemaphore MakeVk(VkSemaphore semaphore)

◆ getResource()

Resource * GrVkSemaphore::getResource ( )
inline

Definition at line 84 of file GrVkSemaphore.h.

84{ return fResource; }

◆ Make()

std::unique_ptr< GrVkSemaphore > GrVkSemaphore::Make ( GrVkGpu gpu,
bool  isOwned 
)
static

Definition at line 20 of file GrVkSemaphore.cpp.

20 {
21 VkSemaphoreCreateInfo createInfo;
22 memset(&createInfo, 0, sizeof(VkSemaphoreCreateInfo));
24 createInfo.pNext = nullptr;
25 createInfo.flags = 0;
26 VkSemaphore semaphore = VK_NULL_HANDLE;
28 GR_VK_CALL_RESULT(gpu, result, CreateSemaphore(gpu->device(), &createInfo, nullptr,
29 &semaphore));
30 if (result != VK_SUCCESS) {
31 return nullptr;
32 }
33
34 return std::unique_ptr<GrVkSemaphore>(new GrVkSemaphore(gpu, semaphore, false, false, isOwned));
35}
#define GR_VK_CALL_RESULT(GPU, RESULT, X)
Definition: GrVkUtil.h:35
VkDevice device() const
Definition: GrVkGpu.h:71
GAsyncResult * result
VkStructureType sType
Definition: vulkan_core.h:3392
VkSemaphoreCreateFlags flags
Definition: vulkan_core.h:3394
VkResult
Definition: vulkan_core.h:140
@ VK_SUCCESS
Definition: vulkan_core.h:141
#define VK_NULL_HANDLE
Definition: vulkan_core.h:46
@ VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
Definition: vulkan_core.h:211

◆ MakeWrapped()

std::unique_ptr< GrVkSemaphore > GrVkSemaphore::MakeWrapped ( GrVkGpu gpu,
VkSemaphore  semaphore,
GrSemaphoreWrapType  wrapType,
GrWrapOwnership  ownership 
)
static

Definition at line 37 of file GrVkSemaphore.cpp.

40 {
41 if (VK_NULL_HANDLE == semaphore) {
42 SkDEBUGFAIL("Trying to wrap an invalid VkSemaphore");
43 return nullptr;
44 }
45 bool prohibitSignal = GrSemaphoreWrapType::kWillWait == wrapType;
46 bool prohibitWait = GrSemaphoreWrapType::kWillSignal == wrapType;
47 return std::unique_ptr<GrVkSemaphore>(new GrVkSemaphore(gpu, semaphore, prohibitSignal,
48 prohibitWait,
49 kBorrow_GrWrapOwnership != ownership));
50}
@ kBorrow_GrWrapOwnership
Definition: GrTypesPriv.h:79
#define SkDEBUGFAIL(message)
Definition: SkAssert.h:118

The documentation for this class was generated from the following files: