Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: src/gpu/GrResourceCache.cpp

Issue 392333008: Make GrCacheable implement its own ref counting. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove extra blank line Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrTexture.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 ///////////////////////////////////////////////////////////////////////////////
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrTexture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698