| OLD | NEW |
| 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 "SkMessageBus.h" | 9 #include "SkMessageBus.h" |
| 10 #include "SkMipMap.h" | 10 #include "SkMipMap.h" |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 | 651 |
| 652 size_t SkGraphics::GetResourceCacheSingleAllocationByteLimit() { | 652 size_t SkGraphics::GetResourceCacheSingleAllocationByteLimit() { |
| 653 return SkResourceCache::GetSingleAllocationByteLimit(); | 653 return SkResourceCache::GetSingleAllocationByteLimit(); |
| 654 } | 654 } |
| 655 | 655 |
| 656 size_t SkGraphics::SetResourceCacheSingleAllocationByteLimit(size_t newLimit) { | 656 size_t SkGraphics::SetResourceCacheSingleAllocationByteLimit(size_t newLimit) { |
| 657 return SkResourceCache::SetSingleAllocationByteLimit(newLimit); | 657 return SkResourceCache::SetSingleAllocationByteLimit(newLimit); |
| 658 } | 658 } |
| 659 | 659 |
| 660 void SkGraphics::PurgeResourceCache() { | 660 void SkGraphics::PurgeResourceCache() { |
| 661 SkImageFilter::PurgeCache(); | |
| 662 return SkResourceCache::PurgeAll(); | 661 return SkResourceCache::PurgeAll(); |
| 663 } | 662 } |
| 664 | 663 |
| 665 ///////////// | 664 ///////////// |
| 666 | 665 |
| 667 static void dump_visitor(const SkResourceCache::Rec& rec, void*) { | 666 static void dump_visitor(const SkResourceCache::Rec& rec, void*) { |
| 668 SkDebugf("RC: %12s bytes %9lu discardable %p\n", | 667 SkDebugf("RC: %12s bytes %9lu discardable %p\n", |
| 669 rec.getCategory(), rec.bytesUsed(), rec.diagnostic_only_getDiscarda
ble()); | 668 rec.getCategory(), rec.bytesUsed(), rec.diagnostic_only_getDiscarda
ble()); |
| 670 } | 669 } |
| 671 | 670 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 683 dump->dumpNumericValue(dumpName.c_str(), "size", "bytes", rec.bytesUsed(
)); | 682 dump->dumpNumericValue(dumpName.c_str(), "size", "bytes", rec.bytesUsed(
)); |
| 684 dump->setMemoryBacking(dumpName.c_str(), "malloc", nullptr); | 683 dump->setMemoryBacking(dumpName.c_str(), "malloc", nullptr); |
| 685 } | 684 } |
| 686 } | 685 } |
| 687 | 686 |
| 688 void SkResourceCache::DumpMemoryStatistics(SkTraceMemoryDump* dump) { | 687 void SkResourceCache::DumpMemoryStatistics(SkTraceMemoryDump* dump) { |
| 689 // Since resource could be backed by malloc or discardable, the cache always
dumps detailed | 688 // Since resource could be backed by malloc or discardable, the cache always
dumps detailed |
| 690 // stats to be accurate. | 689 // stats to be accurate. |
| 691 VisitAll(sk_trace_dump_visitor, dump); | 690 VisitAll(sk_trace_dump_visitor, dump); |
| 692 } | 691 } |
| OLD | NEW |