| 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" |
| 11 #include "SkMutex.h" | 11 #include "SkMutex.h" |
| 12 #include "SkPixelRef.h" | 12 #include "SkPixelRef.h" |
| 13 #include "SkResourceCache.h" | 13 #include "SkResourceCache.h" |
| 14 | 14 |
| 15 #include <stddef.h> | 15 #include <stddef.h> |
| 16 #include <stdlib.h> |
| 16 | 17 |
| 17 DECLARE_SKMESSAGEBUS_MESSAGE(SkResourceCache::PurgeSharedIDMessage) | 18 DECLARE_SKMESSAGEBUS_MESSAGE(SkResourceCache::PurgeSharedIDMessage) |
| 18 | 19 |
| 19 // This can be defined by the caller's build system | 20 // This can be defined by the caller's build system |
| 20 //#define SK_USE_DISCARDABLE_SCALEDIMAGECACHE | 21 //#define SK_USE_DISCARDABLE_SCALEDIMAGECACHE |
| 21 | 22 |
| 22 #ifndef SK_DISCARDABLEMEMORY_SCALEDIMAGECACHE_COUNT_LIMIT | 23 #ifndef SK_DISCARDABLEMEMORY_SCALEDIMAGECACHE_COUNT_LIMIT |
| 23 # define SK_DISCARDABLEMEMORY_SCALEDIMAGECACHE_COUNT_LIMIT 1024 | 24 # define SK_DISCARDABLEMEMORY_SCALEDIMAGECACHE_COUNT_LIMIT 1024 |
| 24 #endif | 25 #endif |
| 25 | 26 |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 ///////////// | 665 ///////////// |
| 665 | 666 |
| 666 static void dump_visitor(const SkResourceCache::Rec& rec, void*) { | 667 static void dump_visitor(const SkResourceCache::Rec& rec, void*) { |
| 667 SkDebugf("RC: %12s bytes %9lu discardable %p\n", | 668 SkDebugf("RC: %12s bytes %9lu discardable %p\n", |
| 668 rec.getCategory(), rec.bytesUsed(), rec.diagnostic_only_getDiscarda
ble()); | 669 rec.getCategory(), rec.bytesUsed(), rec.diagnostic_only_getDiscarda
ble()); |
| 669 } | 670 } |
| 670 | 671 |
| 671 void SkResourceCache::TestDumpMemoryStatistics() { | 672 void SkResourceCache::TestDumpMemoryStatistics() { |
| 672 VisitAll(dump_visitor, nullptr); | 673 VisitAll(dump_visitor, nullptr); |
| 673 } | 674 } |
| OLD | NEW |