blob: 7c4d021ece10d020d6c1918080d83fee34106601 [file] [log] [blame]
Avi Drissman3e1a26c2022-09-15 20:26:031// Copyright 2019 The Chromium Authors
Ahmed Fakhry15d707e2019-02-22 23:54:212// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "ui/display/display_features.h"
6
Zoraiz Naeem20d0ed92022-06-27 23:57:297#include "base/feature_list.h"
Miguel Casas6193797c2020-09-26 00:29:308#include "build/build_config.h"
Yuta Hijikata9aae6d12020-11-19 06:20:589#include "build/chromeos_buildflags.h"
Miguel Casas6193797c2020-09-26 00:29:3010
Ahmed Fakhry15d707e2019-02-22 23:54:2111namespace display {
12namespace features {
13
Yuta Hijikata9aae6d12020-11-19 06:20:5814#if BUILDFLAG(IS_CHROMEOS_ASH)
Zoraiz Naeem20d0ed92022-06-27 23:57:2915
16// Enables the rounded corners for the internal display.
Daniel Cheng849f6a542022-09-21 16:56:0317BASE_FEATURE(kRoundedDisplay,
18 "RoundedDisplay",
19 base::FEATURE_DISABLED_BY_DEFAULT);
Zoraiz Naeem20d0ed92022-06-27 23:57:2920
21bool IsRoundedDisplayEnabled() {
22 return base::FeatureList::IsEnabled(kRoundedDisplay);
23}
24
Miguel Casas8821b0982020-07-02 12:28:4925// Enables using HDR transfer function if the monitor says it supports it.
Daniel Cheng849f6a542022-09-21 16:56:0326BASE_FEATURE(kUseHDRTransferFunction,
27 "UseHDRTransferFunction",
28// TODO(b/168843009): Temporarily disable on ARM while investigating.
Miguel Casas6193797c2020-09-26 00:29:3029#if defined(ARCH_CPU_ARM_FAMILY)
Daniel Cheng849f6a542022-09-21 16:56:0330 base::FEATURE_DISABLED_BY_DEFAULT
Miguel Casas6193797c2020-09-26 00:29:3031#else
Daniel Cheng849f6a542022-09-21 16:56:0332 base::FEATURE_ENABLED_BY_DEFAULT
Miguel Casas6193797c2020-09-26 00:29:3033#endif
Daniel Cheng849f6a542022-09-21 16:56:0334);
Zoraiz Naeem20d0ed92022-06-27 23:57:2935
Miguel Casas8821b0982020-07-02 12:28:4936#endif
37
Ahmed Fakhry15d707e2019-02-22 23:54:2138// This features allows listing all display modes of external displays in the
39// display settings and setting any one of them exactly as requested, which can
40// be very useful for debugging and development purposes.
Daniel Cheng849f6a542022-09-21 16:56:0341BASE_FEATURE(kListAllDisplayModes,
42 "ListAllDisplayModes",
43 base::FEATURE_ENABLED_BY_DEFAULT);
Ahmed Fakhry15d707e2019-02-22 23:54:2144
45bool IsListAllDisplayModesEnabled() {
46 return base::FeatureList::IsEnabled(kListAllDisplayModes);
47}
48
Gil Dekel43a14582022-12-02 05:50:2849// TODO(gildekel): A temporary flag to control whether EDID-based (vs.
50// port-based) display IDs are generated per display. Remove once the migration
51// process it complete (b/193019614).
52BASE_FEATURE(kEnableEdidBasedDisplayIds,
53 "EnableEdidBasedDisplayIds",
54 base::FEATURE_DISABLED_BY_DEFAULT);
55
56bool IsEdidBasedDisplayIdsEnabled() {
57 return base::FeatureList::IsEnabled(kEnableEdidBasedDisplayIds);
58}
59
Gil Dekelbfe93adb2021-08-09 18:17:1760// A temporary flag to control hardware mirroring until it is decided whether to
61// permanently remove hardware mirroring support. See crbug.com/1161556 for
62// details.
Daniel Cheng849f6a542022-09-21 16:56:0363BASE_FEATURE(kEnableHardwareMirrorMode,
64 "EnableHardwareMirrorMode",
65 base::FEATURE_DISABLED_BY_DEFAULT);
Gil Dekel11cbdfb2020-12-23 21:43:2766
67bool IsHardwareMirrorModeEnabled() {
68 return base::FeatureList::IsEnabled(kEnableHardwareMirrorMode);
69}
70
Mark Yacoubb3a7f162022-04-26 04:41:0171// A temporary flag to require Content Protection to use provisioned key as the
72// kernel doesn't expose that it requires this yet.(b/112172923)
Daniel Cheng849f6a542022-09-21 16:56:0373BASE_FEATURE(kRequireHdcpKeyProvisioning,
74 "RequireHdcpKeyProvisioning",
75 base::FEATURE_DISABLED_BY_DEFAULT);
Mark Yacoubb3a7f162022-04-26 04:41:0176bool IsHdcpKeyProvisioningRequired() {
77 return base::FeatureList::IsEnabled(kRequireHdcpKeyProvisioning);
78}
79
Ahmed Fakhry15d707e2019-02-22 23:54:2180} // namespace features
81} // namespace display