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

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

Issue 91453002: Speed up GrResourceCache add and lookup by using TDynamicHash (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrResourceCache.h ('k') | src/gpu/GrTMultiMap.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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 421
422 void GrResourceCache::validate() const { 422 void GrResourceCache::validate() const {
423 fList.validate(); 423 fList.validate();
424 fExclusiveList.validate(); 424 fExclusiveList.validate();
425 SkASSERT(both_zero_or_nonzero(fEntryCount, fEntryBytes)); 425 SkASSERT(both_zero_or_nonzero(fEntryCount, fEntryBytes));
426 SkASSERT(both_zero_or_nonzero(fClientDetachedCount, fClientDetachedBytes)); 426 SkASSERT(both_zero_or_nonzero(fClientDetachedCount, fClientDetachedBytes));
427 SkASSERT(fClientDetachedBytes <= fEntryBytes); 427 SkASSERT(fClientDetachedBytes <= fEntryBytes);
428 SkASSERT(fClientDetachedCount <= fEntryCount); 428 SkASSERT(fClientDetachedCount <= fEntryCount);
429 SkASSERT((fEntryCount - fClientDetachedCount) == fCache.count()); 429 SkASSERT((fEntryCount - fClientDetachedCount) == fCache.count());
430 430
431 fCache.validate();
432
433
434 EntryList::Iter iter; 431 EntryList::Iter iter;
435 432
436 // check that the exclusively held entries are okay 433 // check that the exclusively held entries are okay
437 const GrResourceEntry* entry = iter.init(const_cast<EntryList&>(fExclusiveLi st), 434 const GrResourceEntry* entry = iter.init(const_cast<EntryList&>(fExclusiveLi st),
438 EntryList::Iter::kHead_IterStart); 435 EntryList::Iter::kHead_IterStart);
439 436
440 for ( ; NULL != entry; entry = iter.next()) { 437 for ( ; NULL != entry; entry = iter.next()) {
441 entry->validate(); 438 entry->validate();
442 } 439 }
443 440
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 fEntryBytes, fHighWaterEntryBytes); 483 fEntryBytes, fHighWaterEntryBytes);
487 SkDebugf("\t\tDetached Entry Count: current %d high %d\n", 484 SkDebugf("\t\tDetached Entry Count: current %d high %d\n",
488 fClientDetachedCount, fHighWaterClientDetachedCount); 485 fClientDetachedCount, fHighWaterClientDetachedCount);
489 SkDebugf("\t\tDetached Bytes: current %d high %d\n", 486 SkDebugf("\t\tDetached Bytes: current %d high %d\n",
490 fClientDetachedBytes, fHighWaterClientDetachedBytes); 487 fClientDetachedBytes, fHighWaterClientDetachedBytes);
491 } 488 }
492 489
493 #endif 490 #endif
494 491
495 /////////////////////////////////////////////////////////////////////////////// 492 ///////////////////////////////////////////////////////////////////////////////
OLDNEW
« no previous file with comments | « src/gpu/GrResourceCache.h ('k') | src/gpu/GrTMultiMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698