OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 | 9 |
10 | 10 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 * is called. | 174 * is called. |
175 */ | 175 */ |
176 void addResource(const GrResourceKey& key, | 176 void addResource(const GrResourceKey& key, |
177 GrGpuResource* resource, | 177 GrGpuResource* resource, |
178 uint32_t ownershipFlags = 0); | 178 uint32_t ownershipFlags = 0); |
179 | 179 |
180 /** | 180 /** |
181 * Determines if the cache contains an entry matching a key. If a matching | 181 * Determines if the cache contains an entry matching a key. If a matching |
182 * entry exists but was detached then it will not be found. | 182 * entry exists but was detached then it will not be found. |
183 */ | 183 */ |
184 bool hasKey(const GrResourceKey& key) const { return NULL != fCache.find(key
); } | 184 bool hasKey(const GrResourceKey& key) const { return SkToBool(fCache.find(ke
y)); } |
185 | 185 |
186 /** | 186 /** |
187 * Hide 'entry' so that future searches will not find it. Such | 187 * Hide 'entry' so that future searches will not find it. Such |
188 * hidden entries will not be purged. The entry still counts against | 188 * hidden entries will not be purged. The entry still counts against |
189 * the cache's budget and should be made non-exclusive when exclusive access | 189 * the cache's budget and should be made non-exclusive when exclusive access |
190 * is no longer needed. | 190 * is no longer needed. |
191 */ | 191 */ |
192 void makeExclusive(GrResourceCacheEntry* entry); | 192 void makeExclusive(GrResourceCacheEntry* entry); |
193 | 193 |
194 /** | 194 /** |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 GrResourceCache* fCache; | 307 GrResourceCache* fCache; |
308 }; | 308 }; |
309 #else | 309 #else |
310 class GrAutoResourceCacheValidate { | 310 class GrAutoResourceCacheValidate { |
311 public: | 311 public: |
312 GrAutoResourceCacheValidate(GrResourceCache*) {} | 312 GrAutoResourceCacheValidate(GrResourceCache*) {} |
313 }; | 313 }; |
314 #endif | 314 #endif |
315 | 315 |
316 #endif | 316 #endif |
OLD | NEW |