Skia
2DGraphicsLibrary
|
A key that allows for exclusive use of a resource for a use case (AKA "domain"). More...
#include <GrResourceKey.h>
Public Types | |
typedef uint32_t | Domain |
Public Member Functions | |
GrUniqueKey () | |
Creates an invalid unique key. More... | |
GrUniqueKey (const GrUniqueKey &that) | |
GrUniqueKey & | operator= (const GrUniqueKey &that) |
bool | operator== (const GrUniqueKey &that) const |
bool | operator!= (const GrUniqueKey &that) const |
void | setCustomData (sk_sp< SkData > data) |
SkData * | getCustomData () const |
SkDEBUGCODE (const char *tag() const {return fTag.c_str();}) class Builder | |
Builder (GrUniqueKey *key, const GrUniqueKey &innerKey, Domain domain, int extraData32Cnt, const char *tag=nullptr) | |
Used to build a key that wraps another key and adds additional data. More... | |
![]() | |
uint32_t | hash () const |
size_t | size () const |
Static Public Member Functions | |
static Domain | GenerateDomain () |
Generate a Domain for unique keys. More... | |
Private Types | |
typedef GrResourceKey | INHERITED |
Static Private Member Functions | |
static int | Data32CntForInnerKey (const GrUniqueKey &innerKey) |
Private Attributes | |
sk_sp< SkData > | fData |
Additional Inherited Members | |
![]() | |
void | reset () |
Reset to an invalid key. More... | |
bool | operator== (const GrResourceKey &that) const |
GrResourceKey & | operator= (const GrResourceKey &that) |
bool | isValid () const |
uint32_t | domain () const |
size_t | dataSize () const |
size of the key data, excluding meta-data (hash, domain, etc). More... | |
const uint32_t * | data () const |
ptr to the key data, excluding meta-data (hash, domain, etc). More... | |
![]() | |
static const uint32_t | kInvalidDomain = 0 |
A key that allows for exclusive use of a resource for a use case (AKA "domain").
There are three rules governing the use of unique keys:
Unique keys preempt scratch keys. While a resource has a unique key it is inaccessible via its scratch key. It can become scratch again if the unique key is removed.
|
inline |
Creates an invalid unique key.
It must be initialized using a Builder object before use.
|
inline |
Used to build a key that wraps another key and adds additional data.
|
static |
Generate a Domain for unique keys.