Index: src/lazy/SkDiscardableMemoryPool.h |
diff --git a/src/lazy/SkDiscardableMemoryPool.h b/src/lazy/SkDiscardableMemoryPool.h |
index d141507004151360931df09b8622862dc480962b..6f528782b9e87d1e2e1ca112ec61869d8c24ecd3 100644 |
--- a/src/lazy/SkDiscardableMemoryPool.h |
+++ b/src/lazy/SkDiscardableMemoryPool.h |
@@ -62,7 +62,19 @@ public: |
SkDiscardableMemoryPool* SkGetGlobalDiscardableMemoryPool(); |
#if !defined(SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE) |
-#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (128 * 1024 * 1024) |
+ #if defined(SK_DEFAULT_RESOURCE_CACHE_MB_LIMIT) && \ |
+ SK_DEFAULT_RESOURCE_CACHE_MB_LIMIT > 0 |
+ #define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE \ |
+ (SK_DEFAULT_RESOURCE_CACHE_MB_LIMIT * 1024 * 1024) |
+ #else |
+ #ifdef SK_BUILD_FOR_ANDROID |
+ #define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE \ |
+ (64 * 1024 * 1024) |
+ #else |
+ #define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE \ |
+ (128 * 1024 * 1024) |
+ #endif |
+ #endif |
#endif |
#endif // SkDiscardableMemoryPool_DEFINED |