| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef GrGpuResourceCacheAccess_DEFINED | 9 #ifndef GrGpuResourceCacheAccess_DEFINED |
| 10 #define GrGpuResourceCacheAccess_DEFINED | 10 #define GrGpuResourceCacheAccess_DEFINED |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 } | 43 } |
| 44 | 44 |
| 45 /** | 45 /** |
| 46 * If this resource can be used as a scratch resource this returns a valid s
cratch key. | 46 * If this resource can be used as a scratch resource this returns a valid s
cratch key. |
| 47 * Otherwise it returns a key for which isNullScratch is true. The resource
may currently be | 47 * Otherwise it returns a key for which isNullScratch is true. The resource
may currently be |
| 48 * used as content resource rather than scratch. Check isScratch(). | 48 * used as content resource rather than scratch. Check isScratch(). |
| 49 */ | 49 */ |
| 50 const GrResourceKey& getScratchKey() const { return fResource->fScratchKey;
} | 50 const GrResourceKey& getScratchKey() const { return fResource->fScratchKey;
} |
| 51 | 51 |
| 52 /** | 52 /** |
| 53 * If the resource has a scratch key, the key will be removed. Since scratch
keys are installed |
| 54 * at resource creation time, this means the resource will never again be us
ed as scratch. |
| 55 */ |
| 56 void removeScratchKey() const { fResource->removeScratchKey(); } |
| 57 |
| 58 /** |
| 53 * If the resource is currently cached by a content key, the key is returned
, otherwise NULL. | 59 * If the resource is currently cached by a content key, the key is returned
, otherwise NULL. |
| 54 */ | 60 */ |
| 55 const GrResourceKey* getContentKey() const { | 61 const GrResourceKey* getContentKey() const { |
| 56 if (fResource->fFlags & GrGpuResource::kContentKeySet_Flag) { | 62 if (fResource->fFlags & GrGpuResource::kContentKeySet_Flag) { |
| 57 return &fResource->fContentKey; | 63 return &fResource->fContentKey; |
| 58 } | 64 } |
| 59 return NULL; | 65 return NULL; |
| 60 } | 66 } |
| 61 | 67 |
| 62 /** | 68 /** |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 friend class GrGpuResource; // to construct/copy this type. | 113 friend class GrGpuResource; // to construct/copy this type. |
| 108 }; | 114 }; |
| 109 | 115 |
| 110 inline GrGpuResource::CacheAccess GrGpuResource::cacheAccess() { return CacheAcc
ess(this); } | 116 inline GrGpuResource::CacheAccess GrGpuResource::cacheAccess() { return CacheAcc
ess(this); } |
| 111 | 117 |
| 112 inline const GrGpuResource::CacheAccess GrGpuResource::cacheAccess() const { | 118 inline const GrGpuResource::CacheAccess GrGpuResource::cacheAccess() const { |
| 113 return CacheAccess(const_cast<GrGpuResource*>(this)); | 119 return CacheAccess(const_cast<GrGpuResource*>(this)); |
| 114 } | 120 } |
| 115 | 121 |
| 116 #endif | 122 #endif |
| OLD | NEW |