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

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

Issue 481443002: Add GrResourceCache2. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix leaks Created 6 years, 4 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/GrLayerCache.cpp ('k') | src/gpu/GrResourceCache2.h » ('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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 fCache.remove(entry->key(), entry); 260 fCache.remove(entry->key(), entry);
261 261
262 #ifdef SK_DEBUG 262 #ifdef SK_DEBUG
263 fExclusiveList.addToHead(entry); 263 fExclusiveList.addToHead(entry);
264 #endif 264 #endif
265 } 265 }
266 266
267 void GrResourceCache::removeInvalidResource(GrResourceCacheEntry* entry) { 267 void GrResourceCache::removeInvalidResource(GrResourceCacheEntry* entry) {
268 // If the resource went invalid while it was detached then purge it 268 // If the resource went invalid while it was detached then purge it
269 // This can happen when a 3D context was lost, 269 // This can happen when a 3D context was lost,
270 // the client called GrContext::contextDestroyed() to notify Gr, 270 // the client called GrContext::abandonContext() to notify Gr,
271 // and then later an SkGpuDevice's destructor releases its backing 271 // and then later an SkGpuDevice's destructor releases its backing
272 // texture (which was invalidated at contextDestroyed time). 272 // texture (which was invalidated at contextDestroyed time).
273 // TODO: Safely delete the GrResourceCacheEntry as well. 273 // TODO: Safely delete the GrResourceCacheEntry as well.
274 fClientDetachedCount -= 1; 274 fClientDetachedCount -= 1;
275 fEntryCount -= 1; 275 fEntryCount -= 1;
276 fClientDetachedBytes -= entry->fCachedSize; 276 fClientDetachedBytes -= entry->fCachedSize;
277 fEntryBytes -= entry->fCachedSize; 277 fEntryBytes -= entry->fCachedSize;
278 entry->fCachedSize = 0; 278 entry->fCachedSize = 0;
279 } 279 }
280 280
(...skipping 255 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/GrLayerCache.cpp ('k') | src/gpu/GrResourceCache2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698