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. |
| 17 | const base::Feature kRoundedDisplay{"RoundedDisplay", |
| 18 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 19 | |
| 20 | bool IsRoundedDisplayEnabled() { |
| 21 | return base::FeatureList::IsEnabled(kRoundedDisplay); |
| 22 | } |
| 23 | |
Miguel Casas | 8821b098 | 2020-07-02 12:28:49 | [diff] [blame] | 24 | // Enables using HDR transfer function if the monitor says it supports it. |
Miguel Casas | 6193797c | 2020-09-26 00:29:30 | [diff] [blame] | 25 | const base::Feature kUseHDRTransferFunction { |
| 26 | "UseHDRTransferFunction", |
| 27 | // TODO(b/168843009): Temporarily disable on ARM while investigating. |
| 28 | #if defined(ARCH_CPU_ARM_FAMILY) |
| 29 | base::FEATURE_DISABLED_BY_DEFAULT |
| 30 | #else |
| 31 | base::FEATURE_ENABLED_BY_DEFAULT |
| 32 | #endif |
| 33 | }; |
Zoraiz Naeem | 20d0ed9 | 2022-06-27 23:57:29 | [diff] [blame] | 34 | |
Miguel Casas | 8821b098 | 2020-07-02 12:28:49 | [diff] [blame] | 35 | #endif |
| 36 | |
Ahmed Fakhry | 15d707e | 2019-02-22 23:54:21 | [diff] [blame] | 37 | // This features allows listing all display modes of external displays in the |
| 38 | // display settings and setting any one of them exactly as requested, which can |
| 39 | // be very useful for debugging and development purposes. |
| 40 | const base::Feature kListAllDisplayModes = {"ListAllDisplayModes", |
Bailey Berro | 77d41547 | 2020-06-12 17:39:10 | [diff] [blame] | 41 | base::FEATURE_ENABLED_BY_DEFAULT}; |
Ahmed Fakhry | 15d707e | 2019-02-22 23:54:21 | [diff] [blame] | 42 | |
| 43 | bool IsListAllDisplayModesEnabled() { |
| 44 | return base::FeatureList::IsEnabled(kListAllDisplayModes); |
| 45 | } |
| 46 | |
Gil Dekel | bfe93adb | 2021-08-09 18:17:17 | [diff] [blame] | 47 | // A temporary flag to control hardware mirroring until it is decided whether to |
| 48 | // permanently remove hardware mirroring support. See crbug.com/1161556 for |
| 49 | // details. |
Gil Dekel | 11cbdfb | 2020-12-23 21:43:27 | [diff] [blame] | 50 | const base::Feature kEnableHardwareMirrorMode{ |
| 51 | "EnableHardwareMirrorMode", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 52 | |
| 53 | bool IsHardwareMirrorModeEnabled() { |
| 54 | return base::FeatureList::IsEnabled(kEnableHardwareMirrorMode); |
| 55 | } |
| 56 | |
Mark Yacoub | b3a7f16 | 2022-04-26 04:41:01 | [diff] [blame] | 57 | // A temporary flag to require Content Protection to use provisioned key as the |
| 58 | // kernel doesn't expose that it requires this yet.(b/112172923) |
| 59 | const base::Feature kRequireHdcpKeyProvisioning{ |
| 60 | "RequireHdcpKeyProvisioning", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 61 | bool IsHdcpKeyProvisioningRequired() { |
| 62 | return base::FeatureList::IsEnabled(kRequireHdcpKeyProvisioning); |
| 63 | } |
| 64 | |
Ahmed Fakhry | 15d707e | 2019-02-22 23:54:21 | [diff] [blame] | 65 | } // namespace features |
| 66 | } // namespace display |