Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
GrDirectContext::DirectContextID Class Reference

#include <GrDirectContext.h>

Public Member Functions

 DirectContextID ()
 
bool operator== (const DirectContextID &that) const
 
bool operator!= (const DirectContextID &that) const
 
void makeInvalid ()
 
bool isValid () const
 

Static Public Member Functions

static GrDirectContext::DirectContextID Next ()
 

Detailed Description

Definition at line 886 of file GrDirectContext.h.

Constructor & Destructor Documentation

◆ DirectContextID()

GrDirectContext::DirectContextID::DirectContextID ( )
inline

Definition at line 890 of file GrDirectContext.h.

890: fID(SK_InvalidUniqueID) {}
static constexpr uint32_t SK_InvalidUniqueID
Definition: SkTypes.h:196

Member Function Documentation

◆ isValid()

bool GrDirectContext::DirectContextID::isValid ( ) const
inline

Definition at line 896 of file GrDirectContext.h.

896{ return fID != SK_InvalidUniqueID; }

◆ makeInvalid()

void GrDirectContext::DirectContextID::makeInvalid ( )
inline

Definition at line 895 of file GrDirectContext.h.

895{ fID = SK_InvalidUniqueID; }

◆ Next()

GrDirectContext::DirectContextID GrDirectContext::DirectContextID::Next ( )
static

Definition at line 79 of file GrDirectContext.cpp.

79 {
80 static std::atomic<uint32_t> nextID{1};
81 uint32_t id;
82 do {
83 id = nextID.fetch_add(1, std::memory_order_relaxed);
84 } while (id == SK_InvalidUniqueID);
85 return DirectContextID(id);
86}
const uintptr_t id

◆ operator!=()

bool GrDirectContext::DirectContextID::operator!= ( const DirectContextID that) const
inline

Definition at line 893 of file GrDirectContext.h.

893{ return !(*this == that); }

◆ operator==()

bool GrDirectContext::DirectContextID::operator== ( const DirectContextID that) const
inline

Definition at line 892 of file GrDirectContext.h.

892{ return fID == that.fID; }

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