#include "third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.h"
#include <algorithm>
#include <tuple>
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/metrics/field_trial_params.h"
#include "base/strings/string_number_conversions.h"
#include "base/system/sys_info.h"
#include "build/build_config.h"
#include "cc/base/features.h"
#include "cc/base/switches.h"
#include "cc/tiles/image_decode_cache_utils.h"
#include "cc/trees/layer_tree_settings.h"
#include "components/viz/common/features.h"
#include "components/viz/common/switches.h"
#include "gpu/command_buffer/service/gpu_switches.h"
#include "gpu/config/gpu_finch_features.h"
#include "media/base/media_switches.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/switches.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/web_test_support.h"
#include "ui/base/ui_base_features.h"
#include "ui/base/ui_base_switches.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/overlay_scrollbar_constants_aura.h"
namespace blink {
namespace {
BASE_FEATURE(…);
BASE_FEATURE(…);
constexpr base::FeatureParam<double> kFadeDelayScalingFactor{ … };
constexpr base::FeatureParam<double> kFadeDurationScalingFactor{ … };
void InitializeScrollbarFadeAndDelay(cc::LayerTreeSettings& settings) { … }
#if BUILDFLAG(IS_ANDROID)
static const int kSmallScreenPixelThreshold = 1e5;
bool IsSmallScreen(const gfx::Size& size) {
int area = 0;
if (!size.GetCheckedArea().AssignIfValid(&area))
return false;
return area < kSmallScreenPixelThreshold;
}
#endif
std::pair<int, int> GetTilingInterestAreaSizes() { … }
#if !BUILDFLAG(IS_ANDROID)
BASE_FEATURE(…);
constexpr size_t kLargeResolutionMemoryMB = …;
constexpr size_t kDefaultMemoryMB = …;
constexpr base::FeatureParam<int> kNewLargeResolutionMemoryMB{ … };
constexpr base::FeatureParam<int> kNewDefaultMemoryMB{ … };
size_t GetLargeResolutionMemoryMB() { … }
size_t GetDefaultMemoryMB() { … }
#endif
}
cc::ManagedMemoryPolicy GetGpuMemoryPolicy(
const cc::ManagedMemoryPolicy& default_policy,
const gfx::Size& initial_screen_size,
float initial_device_scale_factor) { … }
cc::LayerTreeSettings GenerateLayerTreeSettings(
bool is_threaded,
bool is_for_embedded_frame,
bool is_for_scalable_page,
const gfx::Size& initial_screen_size,
float initial_device_scale_factor) { … }
}