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

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

Issue 576763002: allow SkBitmapCache to operate on a local instance, for testability (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use __VA_ARGS__ explicitly to make MSVC happy Created 6 years, 3 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/core/SkResourceCache.h ('k') | tests/SkResourceCacheTest.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 * 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 "SkChecksum.h" 8 #include "SkChecksum.h"
9 #include "SkResourceCache.h" 9 #include "SkResourceCache.h"
10 #include "SkMipMap.h" 10 #include "SkMipMap.h"
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 size_t SkResourceCache::GetTotalByteLimit() { 425 size_t SkResourceCache::GetTotalByteLimit() {
426 SkAutoMutexAcquire am(gMutex); 426 SkAutoMutexAcquire am(gMutex);
427 return get_cache()->getTotalByteLimit(); 427 return get_cache()->getTotalByteLimit();
428 } 428 }
429 429
430 size_t SkResourceCache::SetTotalByteLimit(size_t newLimit) { 430 size_t SkResourceCache::SetTotalByteLimit(size_t newLimit) {
431 SkAutoMutexAcquire am(gMutex); 431 SkAutoMutexAcquire am(gMutex);
432 return get_cache()->setTotalByteLimit(newLimit); 432 return get_cache()->setTotalByteLimit(newLimit);
433 } 433 }
434 434
435 SkResourceCache::DiscardableFactory SkResourceCache::GetDiscardableFactory() {
436 SkAutoMutexAcquire am(gMutex);
437 return get_cache()->discardableFactory();
438 }
439
435 SkBitmap::Allocator* SkResourceCache::GetAllocator() { 440 SkBitmap::Allocator* SkResourceCache::GetAllocator() {
436 SkAutoMutexAcquire am(gMutex); 441 SkAutoMutexAcquire am(gMutex);
437 return get_cache()->allocator(); 442 return get_cache()->allocator();
438 } 443 }
439 444
440 void SkResourceCache::Dump() { 445 void SkResourceCache::Dump() {
441 SkAutoMutexAcquire am(gMutex); 446 SkAutoMutexAcquire am(gMutex);
442 get_cache()->dump(); 447 get_cache()->dump();
443 } 448 }
444 449
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 } 493 }
489 494
490 size_t SkGraphics::SetResourceCacheSingleAllocationByteLimit(size_t newLimit) { 495 size_t SkGraphics::SetResourceCacheSingleAllocationByteLimit(size_t newLimit) {
491 return SkResourceCache::SetSingleAllocationByteLimit(newLimit); 496 return SkResourceCache::SetSingleAllocationByteLimit(newLimit);
492 } 497 }
493 498
494 void SkGraphics::PurgeResourceCache() { 499 void SkGraphics::PurgeResourceCache() {
495 return SkResourceCache::PurgeAll(); 500 return SkResourceCache::PurgeAll();
496 } 501 }
497 502
OLDNEW
« no previous file with comments | « src/core/SkResourceCache.h ('k') | tests/SkResourceCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698