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 #ifndef SkDiscardableMemoryPool_DEFINED | 8 #ifndef SkDiscardableMemoryPool_DEFINED |
9 #define SkDiscardableMemoryPool_DEFINED | 9 #define SkDiscardableMemoryPool_DEFINED |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 size_t size, SkBaseMutex* mutex = NULL); | 55 size_t size, SkBaseMutex* mutex = NULL); |
56 }; | 56 }; |
57 | 57 |
58 /** | 58 /** |
59 * Returns (and creates if needed) a threadsafe global | 59 * Returns (and creates if needed) a threadsafe global |
60 * SkDiscardableMemoryPool. | 60 * SkDiscardableMemoryPool. |
61 */ | 61 */ |
62 SkDiscardableMemoryPool* SkGetGlobalDiscardableMemoryPool(); | 62 SkDiscardableMemoryPool* SkGetGlobalDiscardableMemoryPool(); |
63 | 63 |
64 #if !defined(SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE) | 64 #if !defined(SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE) |
65 #if defined(SK_DEFAULT_RESOURCE_CACHE_MB_LIMIT) && \ | 65 #define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (128 * 1024 * 1024) |
66 SK_DEFAULT_RESOURCE_CACHE_MB_LIMIT > 0 | |
67 #define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE \ | |
68 (SK_DEFAULT_RESOURCE_CACHE_MB_LIMIT * 1024 * 1024) | |
69 #else | |
70 #define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE \ | |
71 (128 * 1024 * 1024) | |
72 #endif | |
73 #endif | 66 #endif |
74 | 67 |
75 #endif // SkDiscardableMemoryPool_DEFINED | 68 #endif // SkDiscardableMemoryPool_DEFINED |
OLD | NEW |