chromium/cc/tiles/image_decode_cache_utils.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_TILES_IMAGE_DECODE_CACHE_UTILS_CC_
#define CC_TILES_IMAGE_DECODE_CACHE_UTILS_CC_

#include "cc/tiles/image_decode_cache_utils.h"

#include "base/check.h"
#include "cc/paint/paint_flags.h"
#include "components/miracle_parameter/common/public/miracle_parameter.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkImageInfo.h"
#include "third_party/skia/include/core/SkPixmap.h"

#if !BUILDFLAG(IS_ANDROID)
#include "base/system/sys_info.h"
#endif

namespace cc {

namespace {

BASE_FEATURE();

MIRACLE_PARAMETER_FOR_INT(GetDefaultDecodedImageWorkingSetBudgetBytes,
                          kImageDecodeConfigurableFeature,
                          "DefaultDecodedImageWorkingSetBudgetBytes",
                          128 * 1024 * 1024)

#if !BUILDFLAG(IS_ANDROID)

MIRACLE_PARAMETER_FOR_INT(GetDecodedImageWorkingSetBudgetBytesForLowEndDevice,
                          kImageDecodeConfigurableFeature,
                          "DecodedImageWorkingSetBudgetBytesForLowEndDevice",
                          32 * 1024 * 1024)

MIRACLE_PARAMETER_FOR_INT(GetDecodedImageWorkingSetBudgetBytesForAboveThreshold,
                          kImageDecodeConfigurableFeature,
                          "DecodedImageWorkingSetBudgetBytesForAboveThreshold",
                          256 * 1024 * 1024)

MIRACLE_PARAMETER_FOR_INT(GetImageDecodeMemoryThresholdMB,
                          kImageDecodeConfigurableFeature,
                          "ImageDecodeMemoryThresholdMB",
                          4 * 1024)

#endif  // !BUILDFLAG(IS_ANDROID)

}  // namespace

// static
bool ImageDecodeCacheUtils::ShouldEvictCaches(
    base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) {}

// static
size_t ImageDecodeCacheUtils::GetWorkingSetBytesForImageDecode(
    bool for_renderer) {}

}  // namespace cc

#endif  // CC_TILES_IMAGE_DECODE_CACHE_UTILS_CC_