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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 /** | 47 /** |
48 * If the resource is currently cached by a content key, the key is returned
, otherwise NULL. | 48 * If the resource is currently cached by a content key, the key is returned
, otherwise NULL. |
49 */ | 49 */ |
50 const GrResourceKey* getContentKey() const { | 50 const GrResourceKey* getContentKey() const { |
51 if (fResource->fContentKeySet) { | 51 if (fResource->fContentKeySet) { |
52 return &fResource->fContentKey; | 52 return &fResource->fContentKey; |
53 } | 53 } |
54 return NULL; | 54 return NULL; |
55 } | 55 } |
56 | 56 |
| 57 bool isWrapped() const { return fResource->isWrapped(); } |
| 58 |
57 /** | 59 /** |
58 * Called by the cache to delete the resource under normal circumstances. | 60 * Called by the cache to delete the resource under normal circumstances. |
59 */ | 61 */ |
60 void release() { | 62 void release() { |
61 fResource->release(); | 63 fResource->release(); |
62 if (fResource->isPurgable()) { | 64 if (fResource->isPurgable()) { |
63 SkDELETE(fResource); | 65 SkDELETE(fResource); |
64 } | 66 } |
65 } | 67 } |
66 | 68 |
(...skipping 21 matching lines...) Expand all Loading... |
88 friend class GrGpuResource; // to construct/copy this type. | 90 friend class GrGpuResource; // to construct/copy this type. |
89 }; | 91 }; |
90 | 92 |
91 inline GrGpuResource::CacheAccess GrGpuResource::cacheAccess() { return CacheAcc
ess(this); } | 93 inline GrGpuResource::CacheAccess GrGpuResource::cacheAccess() { return CacheAcc
ess(this); } |
92 | 94 |
93 inline const GrGpuResource::CacheAccess GrGpuResource::cacheAccess() const { | 95 inline const GrGpuResource::CacheAccess GrGpuResource::cacheAccess() const { |
94 return CacheAccess(const_cast<GrGpuResource*>(this)); | 96 return CacheAccess(const_cast<GrGpuResource*>(this)); |
95 } | 97 } |
96 | 98 |
97 #endif | 99 #endif |
OLD | NEW |