Avi Drissman | 3e1a26c | 2022-09-15 20:26:03 | [diff] [blame] | 1 | // Copyright 2019 The Chromium Authors |
Ahmed Fakhry | 15d707e | 2019-02-22 23:54:21 | [diff] [blame] | 2 | // 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 Naeem | 20d0ed9 | 2022-06-27 23:57:29 | [diff] [blame] | 7 | #include "base/feature_list.h" |
Miguel Casas | 6193797c | 2020-09-26 00:29:30 | [diff] [blame] | 8 | #include "build/build_config.h" |
Yuta Hijikata | 9aae6d1 | 2020-11-19 06:20:58 | [diff] [blame] | 9 | #include "build/chromeos_buildflags.h" |
Miguel Casas | 6193797c | 2020-09-26 00:29:30 | [diff] [blame] | 10 | |
Ahmed Fakhry | 15d707e | 2019-02-22 23:54:21 | [diff] [blame] | 11 | namespace display { |
| 12 | namespace features { |
| 13 | |
Yuta Hijikata | 9aae6d1 | 2020-11-19 06:20:58 | [diff] [blame] | 14 | #if BUILDFLAG(IS_CHROMEOS_ASH) |
Zoraiz Naeem | 20d0ed9 | 2022-06-27 23:57:29 | [diff] [blame] | 15 | |
| 16 | // Enables the rounded corners for the internal display. |
Daniel Cheng | 849f6a54 | 2022-09-21 16:56:03 | [diff] [blame] | 17 | BASE_FEATURE(kRoundedDisplay, |
| 18 | "RoundedDisplay", |
| 19 | base::FEATURE_DISABLED_BY_DEFAULT); |
Zoraiz Naeem | 20d0ed9 | 2022-06-27 23:57:29 | [diff] [blame] | 20 | |
| 21 | bool IsRoundedDisplayEnabled() { |
| 22 | return base::FeatureList::IsEnabled(kRoundedDisplay); |
| 23 | } |
| 24 | |
Miguel Casas | 8821b098 | 2020-07-02 12:28:49 | [diff] [blame] | 25 | // Enables using HDR transfer function if the monitor says it supports it. |
Daniel Cheng | 849f6a54 | 2022-09-21 16:56:03 | [diff] [blame] | 26 | BASE_FEATURE(kUseHDRTransferFunction, |
| 27 | "UseHDRTransferFunction", |
| 28 | // TODO(b/168843009): Temporarily disable on ARM while investigating. |
Miguel Casas | 6193797c | 2020-09-26 00:29:30 | [diff] [blame] | 29 | #if defined(ARCH_CPU_ARM_FAMILY) |
Daniel Cheng | 849f6a54 | 2022-09-21 16:56:03 | [diff] [blame] | 30 | base::FEATURE_DISABLED_BY_DEFAULT |
Miguel Casas | 6193797c | 2020-09-26 00:29:30 | [diff] [blame] | 31 | #else |
Daniel Cheng | 849f6a54 | 2022-09-21 16:56:03 | [diff] [blame] | 32 | base::FEATURE_ENABLED_BY_DEFAULT |
Miguel Casas | 6193797c | 2020-09-26 00:29:30 | [diff] [blame] | 33 | #endif |
Daniel Cheng | 849f6a54 | 2022-09-21 16:56:03 | [diff] [blame] | 34 | ); |
Zoraiz Naeem | 20d0ed9 | 2022-06-27 23:57:29 | [diff] [blame] | 35 | |
Miguel Casas | 8821b098 | 2020-07-02 12:28:49 | [diff] [blame] | 36 | #endif |
| 37 | |
Ahmed Fakhry | 15d707e | 2019-02-22 23:54:21 | [diff] [blame] | 38 | // 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 Cheng | 849f6a54 | 2022-09-21 16:56:03 | [diff] [blame] | 41 | BASE_FEATURE(kListAllDisplayModes, |
| 42 | "ListAllDisplayModes", |
| 43 | base::FEATURE_ENABLED_BY_DEFAULT); |
Ahmed Fakhry | 15d707e | 2019-02-22 23:54:21 | [diff] [blame] | 44 | |
| 45 | bool IsListAllDisplayModesEnabled() { |
| 46 | return base::FeatureList::IsEnabled(kListAllDisplayModes); |
| 47 | } |
| 48 | |
Gil Dekel | 43a1458 | 2022-12-02 05:50:28 | [diff] [blame] | 49 | // 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). |
| 52 | BASE_FEATURE(kEnableEdidBasedDisplayIds, |
| 53 | "EnableEdidBasedDisplayIds", |
| 54 | base::FEATURE_DISABLED_BY_DEFAULT); |
| 55 | |
| 56 | bool IsEdidBasedDisplayIdsEnabled() { |
| 57 | return base::FeatureList::IsEnabled(kEnableEdidBasedDisplayIds); |
| 58 | } |
| 59 | |
Gil Dekel | bfe93adb | 2021-08-09 18:17:17 | [diff] [blame] | 60 | // 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 Cheng | 849f6a54 | 2022-09-21 16:56:03 | [diff] [blame] | 63 | BASE_FEATURE(kEnableHardwareMirrorMode, |
| 64 | "EnableHardwareMirrorMode", |
| 65 | base::FEATURE_DISABLED_BY_DEFAULT); |
Gil Dekel | 11cbdfb | 2020-12-23 21:43:27 | [diff] [blame] | 66 | |
| 67 | bool IsHardwareMirrorModeEnabled() { |
| 68 | return base::FeatureList::IsEnabled(kEnableHardwareMirrorMode); |
| 69 | } |
| 70 | |
Mark Yacoub | b3a7f16 | 2022-04-26 04:41:01 | [diff] [blame] | 71 | // 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 Cheng | 849f6a54 | 2022-09-21 16:56:03 | [diff] [blame] | 73 | BASE_FEATURE(kRequireHdcpKeyProvisioning, |
| 74 | "RequireHdcpKeyProvisioning", |
| 75 | base::FEATURE_DISABLED_BY_DEFAULT); |
Mark Yacoub | b3a7f16 | 2022-04-26 04:41:01 | [diff] [blame] | 76 | bool IsHdcpKeyProvisioningRequired() { |
| 77 | return base::FeatureList::IsEnabled(kRequireHdcpKeyProvisioning); |
| 78 | } |
| 79 | |
Ahmed Fakhry | 15d707e | 2019-02-22 23:54:21 | [diff] [blame] | 80 | } // namespace features |
| 81 | } // namespace display |