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