Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
skgpu::graphite::DawnAsyncResult< T > Class Template Reference

#include <DawnAsyncWait.h>

Public Member Functions

 DawnAsyncResult (const DawnSharedContext *sharedContext)
 
 ~DawnAsyncResult ()
 
void set (const T &result)
 
const TgetIfReady () const
 
const TwaitAndGet () const
 

Detailed Description

template<typename T>
class skgpu::graphite::DawnAsyncResult< T >

Definition at line 52 of file DawnAsyncWait.h.

Constructor & Destructor Documentation

◆ DawnAsyncResult()

template<typename T >
skgpu::graphite::DawnAsyncResult< T >::DawnAsyncResult ( const DawnSharedContext sharedContext)
inline

Definition at line 54 of file DawnAsyncWait.h.

54: fSync(sharedContext) {}

◆ ~DawnAsyncResult()

template<typename T >
skgpu::graphite::DawnAsyncResult< T >::~DawnAsyncResult ( )
inline

Definition at line 56 of file DawnAsyncWait.h.

56 {
57 if (fSync.mayBusyWait()) {
58 fSync.busyWait();
59 }
60 SkASSERT(fSync.yieldAndCheck());
61 }
#define SkASSERT(cond)
Definition: SkAssert.h:116

Member Function Documentation

◆ getIfReady()

template<typename T >
const T * skgpu::graphite::DawnAsyncResult< T >::getIfReady ( ) const
inline

Definition at line 68 of file DawnAsyncWait.h.

68{ return fSync.yieldAndCheck() ? &fResult : nullptr; }

◆ set()

template<typename T >
void skgpu::graphite::DawnAsyncResult< T >::set ( const T result)
inline

Definition at line 63 of file DawnAsyncWait.h.

63 {
64 fResult = result;
65 fSync.signal();
66 }
GAsyncResult * result

◆ waitAndGet()

template<typename T >
const T & skgpu::graphite::DawnAsyncResult< T >::waitAndGet ( ) const
inline

Definition at line 70 of file DawnAsyncWait.h.

70 {
71 // If fSync is already signaled, the wait will return immediately.
72 fSync.busyWait();
73 return fResult;
74 }

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