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 "SkDiscardableMemory.h" | 8 #include "SkDiscardableMemory.h" |
9 #include "SkDiscardableMemoryPool.h" | 9 #include "SkDiscardableMemoryPool.h" |
10 #include "SkOnce.h" | 10 #include "SkOnce.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 return SkNEW_ARGS(DiscardableMemoryPool, (size, mutex)); | 264 return SkNEW_ARGS(DiscardableMemoryPool, (size, mutex)); |
265 } | 265 } |
266 | 266 |
267 SkDiscardableMemoryPool* SkGetGlobalDiscardableMemoryPool() { | 267 SkDiscardableMemoryPool* SkGetGlobalDiscardableMemoryPool() { |
268 SK_DECLARE_STATIC_ONCE(create_pool_once); | 268 SK_DECLARE_STATIC_ONCE(create_pool_once); |
269 SkOnce(&create_pool_once, create_global_pool, 0, &cleanup_global_pool); | 269 SkOnce(&create_pool_once, create_global_pool, 0, &cleanup_global_pool); |
270 SkASSERT(NULL != gPool); | 270 SkASSERT(NULL != gPool); |
271 return gPool; | 271 return gPool; |
272 } | 272 } |
273 | 273 |
| 274 // defined in SkImageGenerator.h |
| 275 void SkPurgeGlobalDiscardableMemoryPool() { |
| 276 SkGetGlobalDiscardableMemoryPool()->dumpPool(); |
| 277 } |
274 //////////////////////////////////////////////////////////////////////////////// | 278 //////////////////////////////////////////////////////////////////////////////// |
OLD | NEW |