| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrGpuResource_DEFINED | 8 #ifndef GrGpuResource_DEFINED |
| 9 #define GrGpuResource_DEFINED | 9 #define GrGpuResource_DEFINED |
| 10 | 10 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 void setCacheEntry(GrResourceCacheEntry* cacheEntry) { fCacheEntry = cacheEn
try; } | 165 void setCacheEntry(GrResourceCacheEntry* cacheEntry) { fCacheEntry = cacheEn
try; } |
| 166 GrResourceCacheEntry* getCacheEntry() { return fCacheEntry; } | 166 GrResourceCacheEntry* getCacheEntry() { return fCacheEntry; } |
| 167 | 167 |
| 168 /** | 168 /** |
| 169 * If this resource can be used as a scratch resource this returns a valid | 169 * If this resource can be used as a scratch resource this returns a valid |
| 170 * scratch key. Otherwise it returns a key for which isNullScratch is true. | 170 * scratch key. Otherwise it returns a key for which isNullScratch is true. |
| 171 */ | 171 */ |
| 172 const GrResourceKey& getScratchKey() const { return fScratchKey; } | 172 const GrResourceKey& getScratchKey() const { return fScratchKey; } |
| 173 | 173 |
| 174 /** | 174 /** |
| 175 * Gets an id that is unique for this GrCacheable object. It is static in th
at it does | 175 * Gets an id that is unique for this GrGpuResource object. It is static in
that it does |
| 176 * not change when the content of the GrCacheable object changes. This will
never return | 176 * not change when the content of the GrGpuResource object changes. This wil
l never return |
| 177 * 0. | 177 * 0. |
| 178 */ | 178 */ |
| 179 uint32_t getUniqueID() const { return fUniqueID; } | 179 uint32_t getUniqueID() const { return fUniqueID; } |
| 180 | 180 |
| 181 protected: | 181 protected: |
| 182 // This must be called by every GrGpuObject. It should be called once the ob
ject is fully | 182 // This must be called by every GrGpuObject. It should be called once the ob
ject is fully |
| 183 // initialized (i.e. not in a base class constructor). | 183 // initialized (i.e. not in a base class constructor). |
| 184 void registerWithCache(); | 184 void registerWithCache(); |
| 185 | 185 |
| 186 GrGpuResource(GrGpu*, bool isWrapped); | 186 GrGpuResource(GrGpu*, bool isWrapped); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 GrResourceCacheEntry* fCacheEntry; // NULL if not in cache | 239 GrResourceCacheEntry* fCacheEntry; // NULL if not in cache |
| 240 const uint32_t fUniqueID; | 240 const uint32_t fUniqueID; |
| 241 | 241 |
| 242 GrResourceKey fScratchKey; | 242 GrResourceKey fScratchKey; |
| 243 | 243 |
| 244 typedef GrGpuRef INHERITED; | 244 typedef GrGpuRef INHERITED; |
| 245 }; | 245 }; |
| 246 | 246 |
| 247 #endif | 247 #endif |
| OLD | NEW |