bsalomon | 744998e | 2014-08-28 09:54:34 -0700 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2014 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
| 8 | |
| 9 | #ifndef GrResourceKey_DEFINED |
| 10 | #define GrResourceKey_DEFINED |
| 11 | |
| 12 | #include "GrTypes.h" |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 13 | #include "SkOnce.h" |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 14 | #include "SkTemplates.h" |
bsalomon | 744998e | 2014-08-28 09:54:34 -0700 | [diff] [blame] | 15 | |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 16 | uint32_t GrResourceKeyHash(const uint32_t* data, size_t size); |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 17 | |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 18 | /** |
| 19 | * Base class for all GrGpuResource cache keys. There are two types of cache keys. Refer to the |
| 20 | * comments for each key type below. |
| 21 | */ |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 22 | class GrResourceKey { |
| 23 | public: |
| 24 | uint32_t hash() const { |
| 25 | this->validate(); |
| 26 | return fKey[kHash_MetaDataIdx]; |
| 27 | } |
| 28 | |
| 29 | size_t size() const { |
| 30 | this->validate(); |
bsalomon | 3bd12ef | 2015-01-28 11:39:48 -0800 | [diff] [blame] | 31 | SkASSERT(this->isValid()); |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 32 | return this->internalSize(); |
| 33 | } |
| 34 | |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 35 | protected: |
| 36 | static const uint32_t kInvalidDomain = 0; |
| 37 | |
| 38 | GrResourceKey() { this->reset(); } |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 39 | |
| 40 | /** Reset to an invalid key. */ |
| 41 | void reset() { |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 42 | GR_STATIC_ASSERT((uint16_t)kInvalidDomain == kInvalidDomain); |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 43 | fKey.reset(kMetaDataCnt); |
| 44 | fKey[kHash_MetaDataIdx] = 0; |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 45 | fKey[kDomainAndSize_MetaDataIdx] = kInvalidDomain; |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 46 | } |
| 47 | |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 48 | bool operator==(const GrResourceKey& that) const { |
kkinnunen | 54b8511 | 2015-05-18 22:47:33 -0700 | [diff] [blame^] | 49 | return this->hash() == that.hash() && |
| 50 | 0 == memcmp(&fKey[kHash_MetaDataIdx + 1], |
| 51 | &that.fKey[kHash_MetaDataIdx + 1], |
| 52 | this->internalSize() - sizeof(uint32_t)); |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 53 | } |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 54 | |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 55 | GrResourceKey& operator=(const GrResourceKey& that) { |
bsalomon | 23e619c | 2015-02-06 11:54:28 -0800 | [diff] [blame] | 56 | SkASSERT(that.isValid()); |
bsalomon | 4dffede | 2015-01-23 07:17:55 -0800 | [diff] [blame] | 57 | if (this != &that) { |
| 58 | size_t bytes = that.size(); |
| 59 | SkASSERT(SkIsAlign4(bytes)); |
| 60 | fKey.reset(SkToInt(bytes / sizeof(uint32_t))); |
| 61 | memcpy(fKey.get(), that.fKey.get(), bytes); |
bsalomon | 23e619c | 2015-02-06 11:54:28 -0800 | [diff] [blame] | 62 | this->validate(); |
bsalomon | 4dffede | 2015-01-23 07:17:55 -0800 | [diff] [blame] | 63 | } |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 64 | return *this; |
| 65 | } |
| 66 | |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 67 | bool isValid() const { return kInvalidDomain != this->domain(); } |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 68 | |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 69 | uint32_t domain() const { return fKey[kDomainAndSize_MetaDataIdx] & 0xffff; } |
| 70 | |
bsalomon | 3bd12ef | 2015-01-28 11:39:48 -0800 | [diff] [blame] | 71 | /** size of the key data, excluding meta-data (hash, domain, etc). */ |
| 72 | size_t dataSize() const { return this->size() - 4 * kMetaDataCnt; } |
| 73 | |
| 74 | /** ptr to the key data, excluding meta-data (hash, domain, etc). */ |
| 75 | const uint32_t* data() const { |
| 76 | this->validate(); |
| 77 | return &fKey[kMetaDataCnt]; |
| 78 | } |
| 79 | |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 80 | /** Used to initialize a key. */ |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 81 | class Builder { |
| 82 | public: |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 83 | Builder(GrResourceKey* key, uint32_t domain, int data32Count) : fKey(key) { |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 84 | SkASSERT(data32Count >= 0); |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 85 | SkASSERT(domain != kInvalidDomain); |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 86 | key->fKey.reset(kMetaDataCnt + data32Count); |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 87 | int size = (data32Count + kMetaDataCnt) * sizeof(uint32_t); |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 88 | SkASSERT(SkToU16(size) == size); |
| 89 | SkASSERT(SkToU16(domain) == domain); |
| 90 | key->fKey[kDomainAndSize_MetaDataIdx] = domain | (size << 16); |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | ~Builder() { this->finish(); } |
| 94 | |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 95 | void finish() { |
| 96 | if (NULL == fKey) { |
| 97 | return; |
| 98 | } |
| 99 | GR_STATIC_ASSERT(0 == kHash_MetaDataIdx); |
| 100 | uint32_t* hash = &fKey->fKey[kHash_MetaDataIdx]; |
| 101 | *hash = GrResourceKeyHash(hash + 1, fKey->internalSize() - sizeof(uint32_t)); |
| 102 | fKey->validate(); |
| 103 | fKey = NULL; |
| 104 | } |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 105 | |
| 106 | uint32_t& operator[](int dataIdx) { |
| 107 | SkASSERT(fKey); |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 108 | SkDEBUGCODE(size_t dataCount = fKey->internalSize() / sizeof(uint32_t) - kMetaDataCnt;) |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 109 | SkASSERT(SkToU32(dataIdx) < dataCount); |
| 110 | return fKey->fKey[kMetaDataCnt + dataIdx]; |
| 111 | } |
| 112 | |
| 113 | private: |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 114 | GrResourceKey* fKey; |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 115 | }; |
| 116 | |
| 117 | private: |
| 118 | enum MetaDataIdx { |
| 119 | kHash_MetaDataIdx, |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 120 | // The key domain and size are packed into a single uint32_t. |
| 121 | kDomainAndSize_MetaDataIdx, |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 122 | |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 123 | kLastMetaDataIdx = kDomainAndSize_MetaDataIdx |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 124 | }; |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 125 | static const uint32_t kMetaDataCnt = kLastMetaDataIdx + 1; |
| 126 | |
bsalomon | 3bd12ef | 2015-01-28 11:39:48 -0800 | [diff] [blame] | 127 | size_t internalSize() const { |
| 128 | return fKey[kDomainAndSize_MetaDataIdx] >> 16; |
| 129 | } |
| 130 | |
| 131 | void validate() const { |
| 132 | SkASSERT(fKey[kHash_MetaDataIdx] == |
| 133 | GrResourceKeyHash(&fKey[kHash_MetaDataIdx] + 1, |
| 134 | this->internalSize() - sizeof(uint32_t))); |
| 135 | SkASSERT(SkIsAlign4(this->internalSize())); |
| 136 | } |
| 137 | |
bsalomon | 1c60dfe | 2015-01-21 09:32:40 -0800 | [diff] [blame] | 138 | friend class TestResource; // For unit test to access kMetaDataCnt. |
| 139 | |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 140 | // bmp textures require 4 uint32_t values. |
bsalomon | 0aa9479 | 2015-02-18 11:33:04 -0800 | [diff] [blame] | 141 | SkAutoSTMalloc<kMetaDataCnt + 4, uint32_t> fKey; |
bsalomon | 7775c85 | 2014-12-30 12:50:52 -0800 | [diff] [blame] | 142 | }; |
| 143 | |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 144 | /** |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 145 | * A key used for scratch resources. There are three important rules about scratch keys: |
| 146 | * * Multiple resources can share the same scratch key. Therefore resources assigned the same |
| 147 | * scratch key should be interchangeable with respect to the code that uses them. |
| 148 | * * A resource can have at most one scratch key and it is set at resource creation by the |
| 149 | * resource itself. |
| 150 | * * When a scratch resource is ref'ed it will not be returned from the |
| 151 | * cache for a subsequent cache request until all refs are released. This facilitates using |
| 152 | * a scratch key for multiple render-to-texture scenarios. An example is a separable blur: |
| 153 | * |
| 154 | * GrTexture* texture[2]; |
| 155 | * texture[0] = get_scratch_texture(scratchKey); |
| 156 | * texture[1] = get_scratch_texture(scratchKey); // texture[0] is already owned so we will get a |
| 157 | * // different one for texture[1] |
| 158 | * draw_mask(texture[0], path); // draws path mask to texture[0] |
| 159 | * blur_x(texture[0], texture[1]); // blurs texture[0] in y and stores result in texture[1] |
| 160 | * blur_y(texture[1], texture[0]); // blurs texture[1] in y and stores result in texture[0] |
| 161 | * texture[1]->unref(); // texture 1 can now be recycled for the next request with scratchKey |
| 162 | * consume_blur(texture[0]); |
| 163 | * texture[0]->unref(); // texture 0 can now be recycled for the next request with scratchKey |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 164 | */ |
| 165 | class GrScratchKey : public GrResourceKey { |
bsalomon | 744998e | 2014-08-28 09:54:34 -0700 | [diff] [blame] | 166 | private: |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 167 | typedef GrResourceKey INHERITED; |
bsalomon | 744998e | 2014-08-28 09:54:34 -0700 | [diff] [blame] | 168 | |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 169 | public: |
| 170 | /** Uniquely identifies the type of resource that is cached as scratch. */ |
| 171 | typedef uint32_t ResourceType; |
bsalomon | 744998e | 2014-08-28 09:54:34 -0700 | [diff] [blame] | 172 | |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 173 | /** Generate a unique ResourceType. */ |
| 174 | static ResourceType GenerateResourceType(); |
| 175 | |
| 176 | /** Creates an invalid scratch key. It must be initialized using a Builder object before use. */ |
| 177 | GrScratchKey() {} |
| 178 | |
| 179 | GrScratchKey(const GrScratchKey& that) { *this = that; } |
| 180 | |
| 181 | /** reset() returns the key to the invalid state. */ |
| 182 | using INHERITED::reset; |
| 183 | |
| 184 | using INHERITED::isValid; |
| 185 | |
| 186 | ResourceType resourceType() const { return this->domain(); } |
| 187 | |
| 188 | GrScratchKey& operator=(const GrScratchKey& that) { |
| 189 | this->INHERITED::operator=(that); |
| 190 | return *this; |
bsalomon | 744998e | 2014-08-28 09:54:34 -0700 | [diff] [blame] | 191 | } |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 192 | |
| 193 | bool operator==(const GrScratchKey& that) const { |
| 194 | return this->INHERITED::operator==(that); |
| 195 | } |
| 196 | bool operator!=(const GrScratchKey& that) const { return !(*this == that); } |
| 197 | |
| 198 | class Builder : public INHERITED::Builder { |
| 199 | public: |
| 200 | Builder(GrScratchKey* key, ResourceType type, int data32Count) |
| 201 | : INHERITED::Builder(key, type, data32Count) {} |
| 202 | }; |
| 203 | }; |
| 204 | |
| 205 | /** |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 206 | * A key that allows for exclusive use of a resource for a use case (AKA "domain"). There are three |
| 207 | * rules governing the use of unique keys: |
| 208 | * * Only one resource can have a given unique key at a time. Hence, "unique". |
| 209 | * * A resource can have at most one unique key at a time. |
| 210 | * * Unlike scratch keys, multiple requests for a unique key will return the same |
| 211 | * resource even if the resource already has refs. |
| 212 | * This key type allows a code path to create cached resources for which it is the exclusive user. |
| 213 | * The code path creates a domain which it sets on its keys. This guarantees that there are no |
| 214 | * cross-domain collisions. |
| 215 | * |
| 216 | * Unique keys preempt scratch keys. While a resource has a unique key it is inaccessible via its |
| 217 | * scratch key. It can become scratch again if the unique key is removed. |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 218 | */ |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 219 | class GrUniqueKey : public GrResourceKey { |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 220 | private: |
| 221 | typedef GrResourceKey INHERITED; |
| 222 | |
| 223 | public: |
| 224 | typedef uint32_t Domain; |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 225 | /** Generate a Domain for unique keys. */ |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 226 | static Domain GenerateDomain(); |
| 227 | |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 228 | /** Creates an invalid unique key. It must be initialized using a Builder object before use. */ |
| 229 | GrUniqueKey() {} |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 230 | |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 231 | GrUniqueKey(const GrUniqueKey& that) { *this = that; } |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 232 | |
| 233 | /** reset() returns the key to the invalid state. */ |
| 234 | using INHERITED::reset; |
| 235 | |
| 236 | using INHERITED::isValid; |
| 237 | |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 238 | GrUniqueKey& operator=(const GrUniqueKey& that) { |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 239 | this->INHERITED::operator=(that); |
| 240 | return *this; |
| 241 | } |
| 242 | |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 243 | bool operator==(const GrUniqueKey& that) const { |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 244 | return this->INHERITED::operator==(that); |
| 245 | } |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 246 | bool operator!=(const GrUniqueKey& that) const { return !(*this == that); } |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 247 | |
| 248 | class Builder : public INHERITED::Builder { |
| 249 | public: |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 250 | Builder(GrUniqueKey* key, Domain domain, int data32Count) |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 251 | : INHERITED::Builder(key, domain, data32Count) {} |
| 252 | |
| 253 | /** Used to build a key that wraps another key and adds additional data. */ |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 254 | Builder(GrUniqueKey* key, const GrUniqueKey& innerKey, Domain domain, |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 255 | int extraData32Cnt) |
bsalomon | 3bd12ef | 2015-01-28 11:39:48 -0800 | [diff] [blame] | 256 | : INHERITED::Builder(key, domain, Data32CntForInnerKey(innerKey) + extraData32Cnt) { |
bsalomon | 37f9a26 | 2015-02-02 13:00:10 -0800 | [diff] [blame] | 257 | SkASSERT(&innerKey != key); |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 258 | // add the inner key to the end of the key so that op[] can be indexed normally. |
bsalomon | 3bd12ef | 2015-01-28 11:39:48 -0800 | [diff] [blame] | 259 | uint32_t* innerKeyData = &this->operator[](extraData32Cnt); |
| 260 | const uint32_t* srcData = innerKey.data(); |
| 261 | (*innerKeyData++) = innerKey.domain(); |
| 262 | memcpy(innerKeyData, srcData, innerKey.dataSize()); |
| 263 | } |
| 264 | |
| 265 | private: |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 266 | static int Data32CntForInnerKey(const GrUniqueKey& innerKey) { |
bsalomon | 3bd12ef | 2015-01-28 11:39:48 -0800 | [diff] [blame] | 267 | // key data + domain |
| 268 | return SkToInt((innerKey.dataSize() >> 2) + 1); |
bsalomon | 24db3b1 | 2015-01-23 04:24:04 -0800 | [diff] [blame] | 269 | } |
| 270 | }; |
bsalomon | 744998e | 2014-08-28 09:54:34 -0700 | [diff] [blame] | 271 | }; |
| 272 | |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 273 | /** |
| 274 | * It is common to need a frequently reused GrUniqueKey where the only requirement is that the key |
| 275 | * is unique. These macros create such a key in a thread safe manner so the key can be truly global |
| 276 | * and only constructed once. |
| 277 | */ |
| 278 | |
| 279 | /** Place outside of function/class definitions. */ |
| 280 | #define GR_DECLARE_STATIC_UNIQUE_KEY(name) SK_DECLARE_STATIC_ONCE(name##_once) |
| 281 | |
| 282 | /** Place inside function where the key is used. */ |
| 283 | #define GR_DEFINE_STATIC_UNIQUE_KEY(name) \ |
| 284 | static GrUniqueKey name; \ |
| 285 | SkOnce(&name##_once, gr_init_static_unique_key_once, &name) |
| 286 | |
| 287 | static inline void gr_init_static_unique_key_once(GrUniqueKey* key) { |
| 288 | GrUniqueKey::Builder builder(key, GrUniqueKey::GenerateDomain(), 0); |
| 289 | } |
| 290 | |
bsalomon | 23e619c | 2015-02-06 11:54:28 -0800 | [diff] [blame] | 291 | // The cache listens for these messages to purge junk resources proactively. |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 292 | class GrUniqueKeyInvalidatedMessage { |
bsalomon | 23e619c | 2015-02-06 11:54:28 -0800 | [diff] [blame] | 293 | public: |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 294 | explicit GrUniqueKeyInvalidatedMessage(const GrUniqueKey& key) : fKey(key) {} |
| 295 | |
| 296 | GrUniqueKeyInvalidatedMessage(const GrUniqueKeyInvalidatedMessage& that) : fKey(that.fKey) {} |
| 297 | |
| 298 | GrUniqueKeyInvalidatedMessage& operator=(const GrUniqueKeyInvalidatedMessage& that) { |
bsalomon | 23e619c | 2015-02-06 11:54:28 -0800 | [diff] [blame] | 299 | fKey = that.fKey; |
| 300 | return *this; |
| 301 | } |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 302 | |
| 303 | const GrUniqueKey& key() const { return fKey; } |
| 304 | |
bsalomon | 23e619c | 2015-02-06 11:54:28 -0800 | [diff] [blame] | 305 | private: |
bsalomon | 8718aaf | 2015-02-19 07:24:21 -0800 | [diff] [blame] | 306 | GrUniqueKey fKey; |
bsalomon | 23e619c | 2015-02-06 11:54:28 -0800 | [diff] [blame] | 307 | }; |
bsalomon | 744998e | 2014-08-28 09:54:34 -0700 | [diff] [blame] | 308 | #endif |