Commit 55f5736a authored by Emircan Uysaler's avatar Emircan Uysaler Committed by Commit Bot

[Fuchsia] Reduce Skia's ResourceCacheLimit

This CL reduces Skia resource usage to address memory issues
explained on fxb/36620.

Test: Tested cast_runner on device.
Bug: 982922, fuchsia:36620
Change-Id: I7af5c5a252c10110abe7b783527b48e933a86807
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1851127
Commit-Queue: Emircan Uysaler <emircan@chromium.org>
Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704632}
parent 393a3435
...@@ -134,7 +134,12 @@ void DetermineGrCacheLimitsFromAvailableMemory( ...@@ -134,7 +134,12 @@ void DetermineGrCacheLimitsFromAvailableMemory(
size_t* max_resource_cache_bytes, size_t* max_resource_cache_bytes,
size_t* max_glyph_cache_texture_bytes) { size_t* max_glyph_cache_texture_bytes) {
// Default limits. // Default limits.
#if defined(OS_FUCHSIA)
// Reduce protected budget on fuchsia due to https://fxb/36620.
constexpr size_t kMaxGaneshResourceCacheBytes = 24 * 1024 * 1024;
#else
constexpr size_t kMaxGaneshResourceCacheBytes = 96 * 1024 * 1024; constexpr size_t kMaxGaneshResourceCacheBytes = 96 * 1024 * 1024;
#endif // defined(OS_FUCHSIA)
constexpr size_t kMaxDefaultGlyphCacheTextureBytes = 2048 * 1024 * 4; constexpr size_t kMaxDefaultGlyphCacheTextureBytes = 2048 * 1024 * 4;
*max_resource_cache_bytes = kMaxGaneshResourceCacheBytes; *max_resource_cache_bytes = kMaxGaneshResourceCacheBytes;
...@@ -144,7 +149,12 @@ void DetermineGrCacheLimitsFromAvailableMemory( ...@@ -144,7 +149,12 @@ void DetermineGrCacheLimitsFromAvailableMemory(
#if !defined(OS_NACL) #if !defined(OS_NACL)
// The limit of the bytes allocated toward GPU resources in the GrContext's // The limit of the bytes allocated toward GPU resources in the GrContext's
// GPU cache. // GPU cache.
#if defined(OS_FUCHSIA)
// Reduce protected budget on fuchsia due to https://fxb/36620.
constexpr size_t kMaxLowEndGaneshResourceCacheBytes = 24 * 1024 * 1024;
#else
constexpr size_t kMaxLowEndGaneshResourceCacheBytes = 48 * 1024 * 1024; constexpr size_t kMaxLowEndGaneshResourceCacheBytes = 48 * 1024 * 1024;
#endif // defined(OS_FUCHSIA)
constexpr size_t kMaxHighEndGaneshResourceCacheBytes = 256 * 1024 * 1024; constexpr size_t kMaxHighEndGaneshResourceCacheBytes = 256 * 1024 * 1024;
// Limits for glyph cache textures. // Limits for glyph cache textures.
constexpr size_t kMaxLowEndGlyphCacheTextureBytes = 1024 * 512 * 4; constexpr size_t kMaxLowEndGlyphCacheTextureBytes = 1024 * 512 * 4;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment