1 // Copyright 2018 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_TILES_IMAGE_DECODE_CACHE_UTILS_H_
6 #define CC_TILES_IMAGE_DECODE_CACHE_UTILS_H_
8 #include "base/memory/memory_pressure_listener.h"
9 #include "build/build_config.h"
10 #include "cc/cc_export.h"
11 #include "cc/paint/paint_flags.h"
12 #include "third_party/skia/include/core/SkPixmap.h"
16 class CC_EXPORT ImageDecodeCacheUtils {
18 static bool ShouldEvictCaches(
19 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
21 // Returns budget bytes for decoded images that may be different depending
22 // whether it's for renderer or for the ui compositor.
23 static size_t GetWorkingSetBytesForImageDecode(bool for_renderer);
28 #endif // CC_TILES_IMAGE_DECODE_CACHE_UTILS_H_