Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Static Public Member Functions | List of all members
skgpu::graphite::GraphiteResourceKey Class Reference

#include <GraphiteResourceKey.h>

Inheritance diagram for skgpu::graphite::GraphiteResourceKey:
skgpu::ResourceKey

Classes

class  Builder
 

Public Member Functions

 GraphiteResourceKey ()
 
 GraphiteResourceKey (const GraphiteResourceKey &that)
 
ResourceType resourceType () const
 
Shareable shareable () const
 
GraphiteResourceKeyoperator= (const GraphiteResourceKey &that)
 
bool operator== (const GraphiteResourceKey &that) const
 
bool operator!= (const GraphiteResourceKey &that) const
 
void reset ()
 
bool isValid () const
 
- Public Member Functions inherited from skgpu::ResourceKey
uint32_t hash () const
 
size_t size () const
 
void reset ()
 
bool isValid () const
 

Static Public Member Functions

static ResourceType GenerateResourceType ()
 

Additional Inherited Members

- Protected Member Functions inherited from skgpu::ResourceKey
 ResourceKey ()
 
bool operator== (const ResourceKey &that) const
 
ResourceKeyoperator= (const ResourceKey &that)
 
uint32_t domain () const
 
size_t dataSize () const
 
const uint32_t * data () const
 
- Static Protected Attributes inherited from skgpu::ResourceKey
static const uint32_t kInvalidDomain = 0
 

Detailed Description

Definition at line 16 of file GraphiteResourceKey.h.

Constructor & Destructor Documentation

◆ GraphiteResourceKey() [1/2]

skgpu::graphite::GraphiteResourceKey::GraphiteResourceKey ( )
inline

Creates an invalid key. It must be initialized using a Builder object before use.

Definition at line 22 of file GraphiteResourceKey.h.

◆ GraphiteResourceKey() [2/2]

skgpu::graphite::GraphiteResourceKey::GraphiteResourceKey ( const GraphiteResourceKey that)
inline

Definition at line 24 of file GraphiteResourceKey.h.

24{ *this = that; }

Member Function Documentation

◆ GenerateResourceType()

ResourceType skgpu::graphite::GraphiteResourceKey::GenerateResourceType ( )
static

Generate a unique ResourceType.

Definition at line 12 of file GraphiteResourceKey.cpp.

12 {
13 static std::atomic<int32_t> nextType{ResourceKey::kInvalidDomain + 1};
14
15 int32_t type = nextType.fetch_add(1, std::memory_order_relaxed);
16 if (type > SkTo<int32_t>(UINT16_MAX)) {
17 SK_ABORT("Too many Graphite Resource Types");
18 }
19
20 return static_cast<ResourceType>(type);
21}
#define SK_ABORT(message,...)
Definition: SkAssert.h:70
GLenum type
static const uint32_t kInvalidDomain
Definition: ResourceKey.h:95
uint32_t ResourceType

◆ isValid()

bool skgpu::ResourceKey::isValid ( ) const
inline

Definition at line 55 of file ResourceKey.h.

55{ return kInvalidDomain != this->domain(); }
uint32_t domain() const
Definition: ResourceKey.h:121

◆ operator!=()

bool skgpu::graphite::GraphiteResourceKey::operator!= ( const GraphiteResourceKey that) const
inline

Definition at line 46 of file GraphiteResourceKey.h.

46 {
47 return !(*this == that);
48 }

◆ operator=()

GraphiteResourceKey & skgpu::graphite::GraphiteResourceKey::operator= ( const GraphiteResourceKey that)
inline

Definition at line 35 of file GraphiteResourceKey.h.

35 {
36 this->ResourceKey::operator=(that);
37 fShareable = that.fShareable;
38 return *this;
39 }
ResourceKey & operator=(const ResourceKey &that)
Definition: ResourceKey.h:106

◆ operator==()

bool skgpu::graphite::GraphiteResourceKey::operator== ( const GraphiteResourceKey that) const
inline

Definition at line 41 of file GraphiteResourceKey.h.

41 {
42 bool result = this->ResourceKey::operator==(that);
43 SkASSERT(!result || (result == (fShareable == that.fShareable)));
44 return result;
45 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
bool operator==(const ResourceKey &that) const
Definition: ResourceKey.h:99
GAsyncResult * result

◆ reset()

void skgpu::ResourceKey::reset ( )
inline

reset() returns the key to the invalid state.

Definition at line 49 of file ResourceKey.h.

49 {
50 fKey.reset(kMetaDataCnt);
51 fKey[kHash_MetaDataIdx] = 0;
52 fKey[kDomainAndSize_MetaDataIdx] = kInvalidDomain;
53 }

◆ resourceType()

ResourceType skgpu::graphite::GraphiteResourceKey::resourceType ( ) const
inline

Definition at line 31 of file GraphiteResourceKey.h.

31{ return this->domain(); }

◆ shareable()

Shareable skgpu::graphite::GraphiteResourceKey::shareable ( ) const
inline

Definition at line 33 of file GraphiteResourceKey.h.

33{ return fShareable; }

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