OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 // | 366 // |
367 // This is complicated and confusing. May try this in the future. For | 367 // This is complicated and confusing. May try this in the future. For |
368 // now, these resources are just LRU'd as if we never got the message. | 368 // now, these resources are just LRU'd as if we never got the message. |
369 while (GrResourceCacheEntry* entry = fCache.find(invalidated[i].key, GrT
FindUnreffedFunctor())) { | 369 while (GrResourceCacheEntry* entry = fCache.find(invalidated[i].key, GrT
FindUnreffedFunctor())) { |
370 this->deleteResource(entry); | 370 this->deleteResource(entry); |
371 } | 371 } |
372 } | 372 } |
373 } | 373 } |
374 | 374 |
375 void GrResourceCache::deleteResource(GrResourceCacheEntry* entry) { | 375 void GrResourceCache::deleteResource(GrResourceCacheEntry* entry) { |
376 SkASSERT(1 == entry->fResource->getRefCnt()); | 376 SkASSERT(entry->fResource->unique()); |
377 | 377 |
378 // remove from our cache | 378 // remove from our cache |
379 fCache.remove(entry->key(), entry); | 379 fCache.remove(entry->key(), entry); |
380 | 380 |
381 // remove from our llist | 381 // remove from our llist |
382 this->internalDetach(entry); | 382 this->internalDetach(entry); |
383 delete entry; | 383 delete entry; |
384 } | 384 } |
385 | 385 |
386 void GrResourceCache::internalPurge(int extraCount, size_t extraBytes) { | 386 void GrResourceCache::internalPurge(int extraCount, size_t extraBytes) { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 fEntryBytes, fHighWaterEntryBytes); | 536 fEntryBytes, fHighWaterEntryBytes); |
537 SkDebugf("\t\tDetached Entry Count: current %d high %d\n", | 537 SkDebugf("\t\tDetached Entry Count: current %d high %d\n", |
538 fClientDetachedCount, fHighWaterClientDetachedCount); | 538 fClientDetachedCount, fHighWaterClientDetachedCount); |
539 SkDebugf("\t\tDetached Bytes: current %d high %d\n", | 539 SkDebugf("\t\tDetached Bytes: current %d high %d\n", |
540 fClientDetachedBytes, fHighWaterClientDetachedBytes); | 540 fClientDetachedBytes, fHighWaterClientDetachedBytes); |
541 } | 541 } |
542 | 542 |
543 #endif | 543 #endif |
544 | 544 |
545 /////////////////////////////////////////////////////////////////////////////// | 545 /////////////////////////////////////////////////////////////////////////////// |
OLD | NEW |