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

Side by Side Diff: src/core/SkScaledImageCache.cpp

Issue 91453002: Speed up GrResourceCache add and lookup by using TDynamicHash (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkScaledImageCache.h" 8 #include "SkScaledImageCache.h"
9 #include "SkMipMap.h" 9 #include "SkMipMap.h"
10 #include "SkOnce.h" 10 #include "SkOnce.h"
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 if (bytesUsed < byteLimit) { 364 if (bytesUsed < byteLimit) {
365 break; 365 break;
366 } 366 }
367 Rec* prev = rec->fPrev; 367 Rec* prev = rec->fPrev;
368 if (0 == rec->fLockCount) { 368 if (0 == rec->fLockCount) {
369 size_t used = rec->bytesUsed(); 369 size_t used = rec->bytesUsed();
370 SkASSERT(used <= bytesUsed); 370 SkASSERT(used <= bytesUsed);
371 bytesUsed -= used; 371 bytesUsed -= used;
372 this->detach(rec); 372 this->detach(rec);
373 #ifdef USE_HASH 373 #ifdef USE_HASH
374 fHash->remove(rec->fKey); 374 fHash->remove(rec);
375 #endif 375 #endif
376 376
377 SkDELETE(rec); 377 SkDELETE(rec);
378 fCount -= 1; 378 fCount -= 1;
379 } 379 }
380 rec = prev; 380 rec = prev;
381 } 381 }
382 fBytesUsed = bytesUsed; 382 fBytesUsed = bytesUsed;
383 } 383 }
384 384
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 return SkScaledImageCache::GetBytesUsed(); 589 return SkScaledImageCache::GetBytesUsed();
590 } 590 }
591 591
592 size_t SkGraphics::GetImageCacheByteLimit() { 592 size_t SkGraphics::GetImageCacheByteLimit() {
593 return SkScaledImageCache::GetByteLimit(); 593 return SkScaledImageCache::GetByteLimit();
594 } 594 }
595 595
596 size_t SkGraphics::SetImageCacheByteLimit(size_t newLimit) { 596 size_t SkGraphics::SetImageCacheByteLimit(size_t newLimit) {
597 return SkScaledImageCache::SetByteLimit(newLimit); 597 return SkScaledImageCache::SetByteLimit(newLimit);
598 } 598 }
OLDNEW
« no previous file with comments | « src/core/SkPictureFlat.h ('k') | src/core/SkTDynamicHash.h » ('j') | src/core/SkTDynamicHash.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698