#include "gpu/config/skia_limits.h"
#include <inttypes.h>
#include "base/system/sys_info.h"
#include "build/build_config.h"
#include "components/miracle_parameter/common/public/miracle_parameter.h"
namespace gpu {
namespace {
BASE_FEATURE(…);
MIRACLE_PARAMETER_FOR_INT(GetMaxGaneshResourceCacheBytes,
kGrCacheLimitsFeature,
"MaxGaneshResourceCacheBytes",
96 * 1024 * 1024)
MIRACLE_PARAMETER_FOR_INT(GetMaxDefaultGlyphCacheTextureBytes,
kGrCacheLimitsFeature,
"MaxDefaultGlyphCacheTextureBytes",
2048 * 1024 * 4)
#if !BUILDFLAG(IS_NACL)
MIRACLE_PARAMETER_FOR_INT(GetMaxLowEndGaneshResourceCacheBytes,
kGrCacheLimitsFeature,
"MaxLowEndGaneshResourceCacheBytes",
48 * 1024 * 1024)
MIRACLE_PARAMETER_FOR_INT(GetMaxHighEndGaneshResourceCacheBytes,
kGrCacheLimitsFeature,
"MaxHighEndGaneshResourceCacheBytes",
256 * 1024 * 1024)
MIRACLE_PARAMETER_FOR_INT(GetMaxLowEndGlyphCacheTextureBytes,
kGrCacheLimitsFeature,
"MaxLowEndGlyphCacheTextureBytes",
1024 * 512 * 4)
MIRACLE_PARAMETER_FOR_INT(GetHighEndMemoryThresholdMB,
kGrCacheLimitsFeature,
"HighEndMemoryThresholdMB",
4096)
#endif
MIRACLE_PARAMETER_FOR_INT(GetMaxGpuMainGraphiteImageProviderBytes,
kGrCacheLimitsFeature,
"MaxGpuMainGraphiteImageProviderBytes",
16 * 1024 * 1024)
MIRACLE_PARAMETER_FOR_INT(GetMaxVizCompositorGraphiteImageProviderBytes,
kGrCacheLimitsFeature,
"MaxVizCompositorGraphiteImageProviderBytes",
4 * 1024 * 1024)
}
void DetermineGraphiteImageProviderCacheLimits(
size_t* max_gpu_main_image_provider_cache_bytes,
size_t* max_viz_compositor_image_provider_cache_bytes) { … }
void DetermineGrCacheLimitsFromAvailableMemory(
size_t* max_resource_cache_bytes,
size_t* max_glyph_cache_texture_bytes) { … }
void DefaultGrCacheLimitsForTests(size_t* max_resource_cache_bytes,
size_t* max_glyph_cache_texture_bytes) { … }
}