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

#include <GrMtlSemaphore.h>

Inheritance diagram for GrMtlEvent:
GrManagedResource SkNoncopyable

Public Member Functions

 ~GrMtlEvent () override
 
id< MTLEvent > mtlEvent () const SK_API_AVAILABLE(macos(10.14)
 
id< MTLEvent > ios (12.0)
 
id< MTLEvent > tvos (12.0))
 
void freeGPUData () const override
 
- Public Member Functions inherited from GrManagedResource
 GrManagedResource ()
 
virtual ~GrManagedResource ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Static Public Member Functions

static sk_sp< GrMtlEventMake (GrMtlGpu *gpu)
 
static sk_sp< GrMtlEventMakeWrapped (GrMTLHandle event)
 

Detailed Description

Definition at line 21 of file GrMtlSemaphore.h.

Constructor & Destructor Documentation

◆ ~GrMtlEvent()

GrMtlEvent::~GrMtlEvent ( )
inlineoverride

Definition at line 27 of file GrMtlSemaphore.h.

27{}

Member Function Documentation

◆ freeGPUData()

void GrMtlEvent::freeGPUData ( ) const
inlineoverridevirtual

Must be implemented by any subclasses. Deletes any GPU data associated with this resource

Implements GrManagedResource.

Definition at line 44 of file GrMtlSemaphore.h.

44 {
45 if (@available(macOS 10.14, iOS 12.0, tvOS 12.0, *)) {
46 fMtlEvent = nil;
47 }
48 }

◆ ios()

id< MTLEvent > GrMtlEvent::ios ( 12.  0)

◆ Make()

GR_NORETAIN_BEGIN sk_sp< GrMtlEvent > GrMtlEvent::Make ( GrMtlGpu gpu)
static

Definition at line 19 of file GrMtlSemaphore.mm.

19 {
20 if (@available(macOS 10.14, iOS 12.0, tvOS 12.0, *)) {
21 id<MTLEvent> event = [gpu->device() newEvent];
23 } else {
24 return nullptr;
25 }
26}
id< MTLDevice > device() const
Definition: GrMtlGpu.h:49
FlKeyEvent * event

◆ MakeWrapped()

sk_sp< GrMtlEvent > GrMtlEvent::MakeWrapped ( GrMTLHandle  event)
static

Definition at line 28 of file GrMtlSemaphore.mm.

28 {
29 // The GrMtlEvent will have strong ownership at this point.
30 // The GrMTLHandle will subsequently only have weak ownership.
31 if (@available(macOS 10.14, iOS 12.0, tvOS 12.0, *)) {
32 id<MTLEvent> mtlEvent = (__bridge_transfer id<MTLEvent>)event;
34 } else {
35 return nullptr;
36 }
37}
id< MTLEvent > mtlEvent() const SK_API_AVAILABLE(macos(10.14)

◆ mtlEvent()

id< MTLEvent > GrMtlEvent::mtlEvent ( ) const

◆ tvos()

id< MTLEvent > GrMtlEvent::tvos ( 12.  0)
inline

Definition at line 29 of file GrMtlSemaphore.h.

29 {
30 return fMtlEvent;
31 }

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