Avi Drissman | 4e1b7bc3 | 2022-09-15 14:03:50 | [diff] [blame] | 1 | // Copyright 2012 The Chromium Authors |
[email protected] | b7c4f03 | 2012-08-07 16:38:56 | [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 | |
[email protected] | 1515493 | 2013-08-21 03:27:24 | [diff] [blame] | 5 | #include "content/browser/gpu/compositor_util.h" |
[email protected] | b7c4f03 | 2012-08-07 16:38:56 | [diff] [blame] | 6 | |
avi | b734894 | 2015-12-25 20:57:10 | [diff] [blame] | 7 | #include <stddef.h> |
| 8 | |
Jonathan Backer | 76dfd50 | 2018-05-03 18:34:31 | [diff] [blame] | 9 | #include <algorithm> |
| 10 | #include <memory> |
dcheng | 98e96a7 | 2016-06-11 03:41:48 | [diff] [blame] | 11 | #include <utility> |
| 12 | |
[email protected] | b7c4f03 | 2012-08-07 16:38:56 | [diff] [blame] | 13 | #include "base/command_line.h" |
ericrk | fc49323 | 2016-05-17 22:08:23 | [diff] [blame] | 14 | #include "base/feature_list.h" |
[email protected] | eab9db7 | 2013-10-30 23:13:14 | [diff] [blame] | 15 | #include "base/logging.h" |
[email protected] | 8f3f659 | 2014-06-07 00:24:06 | [diff] [blame] | 16 | #include "base/metrics/field_trial.h" |
danakj | 8a91b03 | 2014-08-30 00:04:22 | [diff] [blame] | 17 | #include "base/strings/string_number_conversions.h" |
Kenneth Russell | cc1732e0 | 2018-07-30 19:42:56 | [diff] [blame] | 18 | #include "base/strings/string_split.h" |
Sebastien Marchand | 75a7cdf | 2018-11-13 23:47:03 | [diff] [blame] | 19 | #include "base/system/sys_info.h" |
Austin Sullivan | bf2dfe3 | 2021-05-07 22:19:58 | [diff] [blame] | 20 | #include "base/values.h" |
[email protected] | 7aa0d38 | 2013-09-06 08:21:18 | [diff] [blame] | 21 | #include "build/build_config.h" |
Zhenyao Mo | 4353922 | 2025-05-07 20:38:04 | [diff] [blame] | 22 | #include "cc/base/features.h" |
[email protected] | f454eed | 2013-10-16 05:48:02 | [diff] [blame] | 23 | #include "cc/base/switches.h" |
Fady Samuel | 54f7a13 | 2018-03-06 17:14:55 | [diff] [blame] | 24 | #include "components/viz/common/features.h" |
Zhenyao Mo | df92855 | 2018-03-30 19:30:09 | [diff] [blame] | 25 | #include "content/browser/compositor/image_transport_factory.h" |
[email protected] | f454eed | 2013-10-16 05:48:02 | [diff] [blame] | 26 | #include "content/browser/gpu/gpu_data_manager_impl.h" |
Ken Russell | 225fb01 | 2018-04-12 18:01:04 | [diff] [blame] | 27 | #include "content/browser/gpu/gpu_process_host.h" |
ericrk | fc49323 | 2016-05-17 22:08:23 | [diff] [blame] | 28 | #include "content/public/common/content_features.h" |
[email protected] | b7c4f03 | 2012-08-07 16:38:56 | [diff] [blame] | 29 | #include "content/public/common/content_switches.h" |
Peng Huang | 9b7d2ee | 2019-10-02 20:18:22 | [diff] [blame] | 30 | #include "gpu/command_buffer/service/gpu_switches.h" |
Chris Blume | 29bf536 | 2019-09-06 02:34:45 | [diff] [blame] | 31 | #include "gpu/config/gpu_blocklist.h" |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 32 | #include "gpu/config/gpu_driver_bug_list.h" |
| 33 | #include "gpu/config/gpu_driver_bug_workaround_type.h" |
[email protected] | d7b5cc7 | 2013-05-23 20:05:00 | [diff] [blame] | 34 | #include "gpu/config/gpu_feature_type.h" |
Sunny Sachanandani | a8bbcf9 | 2017-09-20 05:26:01 | [diff] [blame] | 35 | #include "gpu/config/gpu_finch_features.h" |
Zhenyao Mo | f920e13 | 2017-12-19 20:16:50 | [diff] [blame] | 36 | #include "gpu/config/gpu_switches.h" |
Peng Huang | 9b7d2ee | 2019-10-02 20:18:22 | [diff] [blame] | 37 | #include "gpu/vulkan/buildflags.h" |
Ted Meyer | a7b40253 | 2020-12-04 10:39:24 | [diff] [blame] | 38 | #include "media/base/media_switches.h" |
Scott Violet | a35f9a4 | 2018-03-22 22:00:44 | [diff] [blame] | 39 | #include "media/media_buildflags.h" |
Sunny Sachanandani | fb74c17f | 2023-04-10 21:29:17 | [diff] [blame] | 40 | #include "skia/buildflags.h" |
Dave Tapuska | 9bcf6cc | 2020-06-25 15:15:01 | [diff] [blame] | 41 | #include "third_party/blink/public/common/switches.h" |
Peng Huang | 5f3d435 | 2021-11-23 17:51:29 | [diff] [blame] | 42 | #include "ui/base/ui_base_features.h" |
zmo | 05f50f9b | 2016-10-29 00:40:29 | [diff] [blame] | 43 | #include "ui/gl/gl_switches.h" |
[email protected] | b7c4f03 | 2012-08-07 16:38:56 | [diff] [blame] | 44 | |
[email protected] | 99456fa | 2012-11-01 18:22:08 | [diff] [blame] | 45 | namespace content { |
[email protected] | cb643093 | 2012-10-31 00:53:36 | [diff] [blame] | 46 | |
[email protected] | 99456fa | 2012-11-01 18:22:08 | [diff] [blame] | 47 | namespace { |
[email protected] | cb643093 | 2012-10-31 00:53:36 | [diff] [blame] | 48 | |
danakj | 8a91b03 | 2014-08-30 00:04:22 | [diff] [blame] | 49 | const int kMinRasterThreads = 1; |
reveman | 94760850 | 2015-06-25 23:10:56 | [diff] [blame] | 50 | const int kMaxRasterThreads = 4; |
[email protected] | 6fa615b4 | 2014-04-28 10:28:20 | [diff] [blame] | 51 | |
senorblanco | b60ba95 | 2015-01-27 19:12:36 | [diff] [blame] | 52 | const int kMinMSAASampleCount = 0; |
| 53 | |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 54 | enum class GpuFeatureInfoType { kCurrent, kForHardwareGpu }; |
| 55 | |
kylechar | 6c29b0c | 2019-06-07 18:50:40 | [diff] [blame] | 56 | struct DisableInfo { |
| 57 | // The feature being disabled will be listed as a problem with |description|. |
| 58 | static DisableInfo Problem(const std::string& description) { |
| 59 | return DisableInfo{true, description}; |
| 60 | } |
| 61 | |
| 62 | // The feature being disabled will not be listed as a problem. |
| 63 | static DisableInfo NotProblem() { return DisableInfo{false, ""}; } |
| 64 | |
| 65 | bool is_problem; |
| 66 | std::string description; |
| 67 | }; |
| 68 | |
Zhenyao Mo | f920e13 | 2017-12-19 20:16:50 | [diff] [blame] | 69 | struct GpuFeatureData { |
[email protected] | f454eed | 2013-10-16 05:48:02 | [diff] [blame] | 70 | std::string name; |
Zhenyao Mo | f920e13 | 2017-12-19 20:16:50 | [diff] [blame] | 71 | gpu::GpuFeatureStatus status; |
kylechar | e5461b2 | 2024-02-27 18:08:48 | [diff] [blame] | 72 | DisableInfo disabled_info = DisableInfo::NotProblem(); |
| 73 | bool fallback_to_software = false; |
[email protected] | f454eed | 2013-10-16 05:48:02 | [diff] [blame] | 74 | }; |
| 75 | |
kylechar | b920f9a | 2024-03-04 15:28:42 | [diff] [blame] | 76 | // Returns enabled/disabled based on a bool for when there is no GpuFeatureType. |
| 77 | gpu::GpuFeatureStatus GetFakeFeatureStatus(bool enabled) { |
| 78 | return enabled ? gpu::kGpuFeatureStatusEnabled |
| 79 | : gpu::kGpuFeatureStatusDisabled; |
| 80 | } |
| 81 | |
kylechar | 621dd6b | 2024-03-04 22:08:49 | [diff] [blame] | 82 | // `force_disabled` should only be true when the feature status from |
| 83 | // `gpu_feature_info` is missing information. In general this should be avoided |
| 84 | // and GpuFeatureInfo should be made to be correct. |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 85 | gpu::GpuFeatureStatus SafeGetFeatureStatus( |
| 86 | const gpu::GpuFeatureInfo& gpu_feature_info, |
kylechar | b920f9a | 2024-03-04 15:28:42 | [diff] [blame] | 87 | gpu::GpuFeatureType feature, |
| 88 | bool force_disabled = false) { |
| 89 | if (force_disabled) { |
| 90 | return gpu::kGpuFeatureStatusDisabled; |
| 91 | } |
| 92 | |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 93 | if (!gpu_feature_info.IsInitialized()) { |
Ken Russell | 225fb01 | 2018-04-12 18:01:04 | [diff] [blame] | 94 | // The GPU process probably crashed during startup, but we can't |
| 95 | // assert this as the test bots are slow, and recording the crash |
| 96 | // is racy. Be robust and just say that all features are disabled. |
| 97 | return gpu::kGpuFeatureStatusDisabled; |
| 98 | } |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 99 | DCHECK(feature >= 0 && feature < gpu::NUMBER_OF_GPU_FEATURE_TYPES); |
| 100 | return gpu_feature_info.status_values[feature]; |
Ken Russell | 225fb01 | 2018-04-12 18:01:04 | [diff] [blame] | 101 | } |
| 102 | |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 103 | std::vector<GpuFeatureData> GetGpuFeatureData( |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 104 | const gpu::GpuFeatureInfo& gpu_feature_info, |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 105 | bool is_gpu_compositing_disabled) { |
[email protected] | 47927870 | 2014-08-11 20:32:09 | [diff] [blame] | 106 | const base::CommandLine& command_line = |
| 107 | *base::CommandLine::ForCurrentProcess(); |
jbauman | 63c40849 | 2016-07-28 21:21:44 | [diff] [blame] | 108 | |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 109 | std::vector<GpuFeatureData> features; |
| 110 | features.emplace_back( |
| 111 | "2d_canvas", |
kylechar | b920f9a | 2024-03-04 15:28:42 | [diff] [blame] | 112 | SafeGetFeatureStatus( |
| 113 | gpu_feature_info, gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS, |
| 114 | command_line.HasSwitch(switches::kDisableAccelerated2dCanvas)), |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 115 | DisableInfo::Problem( |
| 116 | "Accelerated 2D canvas is unavailable: either disabled " |
| 117 | "via blocklist or the command line."), |
| 118 | true); |
| 119 | features.emplace_back( |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 120 | "gpu_compositing", |
| 121 | // TODO(rivr): Replace with a check to see which backend is used for |
| 122 | // compositing; do the same for GPU rasterization if it's enabled. For |
| 123 | // now assume that if GL is blocklisted, then Vulkan is also. Check GL to |
| 124 | // see if GPU compositing is disabled. |
| 125 | SafeGetFeatureStatus(gpu_feature_info, |
kylechar | b920f9a | 2024-03-04 15:28:42 | [diff] [blame] | 126 | gpu::GPU_FEATURE_TYPE_ACCELERATED_GL, |
| 127 | is_gpu_compositing_disabled), |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 128 | DisableInfo::Problem( |
| 129 | "Gpu compositing has been disabled, either via blocklist, " |
| 130 | "about:flags " |
| 131 | "or the command line. The browser will fall back to software " |
| 132 | "compositing and hardware acceleration will be unavailable."), |
| 133 | true); |
| 134 | features.emplace_back( |
| 135 | "webgl", |
| 136 | SafeGetFeatureStatus(gpu_feature_info, |
kylechar | b920f9a | 2024-03-04 15:28:42 | [diff] [blame] | 137 | gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL, |
| 138 | command_line.HasSwitch(switches::kDisableWebGL)), |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 139 | DisableInfo::Problem( |
| 140 | "WebGL has been disabled via blocklist or the command line."), |
| 141 | false); |
| 142 | features.emplace_back( |
| 143 | "video_decode", |
kylechar | b920f9a | 2024-03-04 15:28:42 | [diff] [blame] | 144 | SafeGetFeatureStatus( |
| 145 | gpu_feature_info, gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE, |
Xiaohan Wang | 51dde998 | 2022-01-14 18:37:49 | [diff] [blame] | 146 | #if BUILDFLAG(IS_LINUX) |
Robert Mader | 5482210 | 2024-10-02 19:21:17 | [diff] [blame] | 147 | !base::FeatureList::IsEnabled(media::kAcceleratedVideoDecodeLinux) || |
Xiaohan Wang | 51dde998 | 2022-01-14 18:37:49 | [diff] [blame] | 148 | #endif // BUILDFLAG(IS_LINUX) |
kylechar | b920f9a | 2024-03-04 15:28:42 | [diff] [blame] | 149 | command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode)), |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 150 | DisableInfo::Problem( |
| 151 | "Accelerated video decode has been disabled, either via blocklist, " |
| 152 | "about:flags or the command line."), |
| 153 | true); |
| 154 | features.emplace_back( |
| 155 | "video_encode", |
kylechar | b920f9a | 2024-03-04 15:28:42 | [diff] [blame] | 156 | SafeGetFeatureStatus( |
| 157 | gpu_feature_info, gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE, |
Xiaohan Wang | 51dde998 | 2022-01-14 18:37:49 | [diff] [blame] | 158 | #if BUILDFLAG(IS_LINUX) |
Robert Mader | 5482210 | 2024-10-02 19:21:17 | [diff] [blame] | 159 | !base::FeatureList::IsEnabled(media::kAcceleratedVideoEncodeLinux)), |
Chunbo Hua | c6e4a09 | 2021-11-17 05:07:43 | [diff] [blame] | 160 | #else |
kylechar | b920f9a | 2024-03-04 15:28:42 | [diff] [blame] | 161 | command_line.HasSwitch(switches::kDisableAcceleratedVideoEncode)), |
Xiaohan Wang | 51dde998 | 2022-01-14 18:37:49 | [diff] [blame] | 162 | #endif // BUILDFLAG(IS_LINUX) |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 163 | DisableInfo::Problem( |
| 164 | "Accelerated video encode has been disabled, either via blocklist, " |
| 165 | "about:flags or the command line."), |
| 166 | true); |
| 167 | features.emplace_back( |
| 168 | "rasterization", |
kylechar | 621dd6b | 2024-03-04 22:08:49 | [diff] [blame] | 169 | SafeGetFeatureStatus(gpu_feature_info, |
| 170 | gpu::GPU_FEATURE_TYPE_GPU_TILE_RASTERIZATION), |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 171 | DisableInfo::Problem( |
| 172 | "Accelerated rasterization has been disabled, either via blocklist, " |
| 173 | "about:flags or the command line."), |
| 174 | true); |
| 175 | features.emplace_back( |
kylechar | e5461b2 | 2024-02-27 18:08:48 | [diff] [blame] | 176 | "opengl", SafeGetFeatureStatus(gpu_feature_info, |
| 177 | gpu::GPU_FEATURE_TYPE_ACCELERATED_GL)); |
Peng Huang | 9b7d2ee | 2019-10-02 20:18:22 | [diff] [blame] | 178 | #if BUILDFLAG(ENABLE_VULKAN) |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 179 | features.emplace_back( |
| 180 | "vulkan", |
kylechar | 621dd6b | 2024-03-04 22:08:49 | [diff] [blame] | 181 | SafeGetFeatureStatus(gpu_feature_info, gpu::GPU_FEATURE_TYPE_VULKAN)); |
Peng Huang | 9b7d2ee | 2019-10-02 20:18:22 | [diff] [blame] | 182 | #endif |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 183 | features.emplace_back( |
kylechar | b920f9a | 2024-03-04 15:28:42 | [diff] [blame] | 184 | "multiple_raster_threads", |
| 185 | GetFakeFeatureStatus(NumberOfRendererRasterThreads() > 1)); |
Xiaohan Wang | 51dde998 | 2022-01-14 18:37:49 | [diff] [blame] | 186 | #if BUILDFLAG(IS_ANDROID) |
Hailey Wang | 4b252829 | 2025-08-19 18:02:32 | [diff] [blame] | 187 | features.emplace_back( |
| 188 | "surface_control", |
| 189 | SafeGetFeatureStatus(gpu_feature_info, |
| 190 | gpu::GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL)); |
Khushal | bb1963a | 2018-10-02 21:02:35 | [diff] [blame] | 191 | #endif |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 192 | features.emplace_back( |
| 193 | "webgl2", |
kylechar | b920f9a | 2024-03-04 15:28:42 | [diff] [blame] | 194 | SafeGetFeatureStatus( |
| 195 | gpu_feature_info, gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL2, |
| 196 | command_line.HasSwitch(switches::kDisableWebGL) || |
| 197 | command_line.HasSwitch(switches::kDisableWebGL2)), |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 198 | DisableInfo::Problem( |
| 199 | "WebGL2 has been disabled via blocklist or the command line."), |
| 200 | false); |
kylechar | b920f9a | 2024-03-04 15:28:42 | [diff] [blame] | 201 | features.emplace_back("raw_draw", |
Peter Kasting | 6e6af3c | 2024-10-15 00:13:18 | [diff] [blame] | 202 | GetFakeFeatureStatus(::features::IsUsingRawDraw())); |
Maggie Chen | 4fa6513a | 2025-07-09 22:11:19 | [diff] [blame] | 203 | features.emplace_back( |
| 204 | "direct_rendering_display_compositor", |
| 205 | SafeGetFeatureStatus( |
| 206 | gpu_feature_info, |
| 207 | gpu::GPU_FEATURE_TYPE_DIRECT_RENDERING_DISPLAY_COMPOSITOR)); |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 208 | features.emplace_back( |
| 209 | "webgpu", |
kylechar | b920f9a | 2024-03-04 15:28:42 | [diff] [blame] | 210 | SafeGetFeatureStatus( |
| 211 | gpu_feature_info, gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGPU, |
| 212 | !command_line.HasSwitch(switches::kEnableUnsafeWebGPU) && |
| 213 | !base::FeatureList::IsEnabled(::features::kWebGPUService)), |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 214 | DisableInfo::Problem( |
| 215 | "WebGPU has been disabled via blocklist or the command line."), |
| 216 | false); |
| 217 | features.emplace_back( |
| 218 | "skia_graphite", |
| 219 | SafeGetFeatureStatus(gpu_feature_info, |
kylechar | e5461b2 | 2024-02-27 18:08:48 | [diff] [blame] | 220 | gpu::GPU_FEATURE_TYPE_SKIA_GRAPHITE)); |
Pooja Patel | a00fc49 | 2024-03-07 19:24:08 | [diff] [blame] | 221 | features.emplace_back( |
| 222 | "webnn", |
| 223 | SafeGetFeatureStatus(gpu_feature_info, gpu::GPU_FEATURE_TYPE_WEBNN)); |
Zhenyao Mo | 4353922 | 2025-05-07 20:38:04 | [diff] [blame] | 224 | features.emplace_back("trees_in_viz", |
| 225 | base::FeatureList::IsEnabled(::features::kTreesInViz) |
| 226 | ? gpu::kGpuFeatureStatusEnabled |
| 227 | : gpu::kGpuFeatureStatusDisabled); |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 228 | return features; |
[email protected] | f454eed | 2013-10-16 05:48:02 | [diff] [blame] | 229 | } |
| 230 | |
Austin Sullivan | bf2dfe3 | 2021-05-07 22:19:58 | [diff] [blame] | 231 | base::Value GetFeatureStatusImpl(GpuFeatureInfoType type) { |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 232 | GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); |
| 233 | std::string gpu_access_blocked_reason; |
Zhenyao Mo | 811534f3 | 2020-12-22 23:17:14 | [diff] [blame] | 234 | bool gpu_access_blocked; |
| 235 | gpu::GpuFeatureInfo gpu_feature_info; |
| 236 | bool is_gpu_compositing_disabled; |
| 237 | if (type == GpuFeatureInfoType::kCurrent) { |
| 238 | gpu_access_blocked = !manager->GpuAccessAllowed(&gpu_access_blocked_reason); |
| 239 | gpu_feature_info = manager->GetGpuFeatureInfo(); |
| 240 | is_gpu_compositing_disabled = manager->IsGpuCompositingDisabled(); |
| 241 | } else { |
| 242 | gpu_access_blocked = |
| 243 | !manager->GpuAccessAllowedForHardwareGpu(&gpu_access_blocked_reason); |
| 244 | gpu_feature_info = manager->GetGpuFeatureInfoForHardwareGpu(); |
| 245 | is_gpu_compositing_disabled = |
| 246 | manager->IsGpuCompositingDisabledForHardwareGpu(); |
| 247 | } |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 248 | |
Matt Menke | ad6c1a5 | 2022-08-12 00:58:25 | [diff] [blame] | 249 | base::Value::Dict feature_status_dict; |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 250 | |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 251 | for (auto& gpu_feature_data : |
| 252 | GetGpuFeatureData(gpu_feature_info, is_gpu_compositing_disabled)) { |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 253 | std::string status; |
kylechar | 6c29b0c | 2019-06-07 18:50:40 | [diff] [blame] | 254 | // Features undergoing a finch controlled roll out. |
kylechar | 0b3b002 | 2022-06-07 13:10:26 | [diff] [blame] | 255 | if (gpu_feature_data.name == "raw_draw" || |
| 256 | gpu_feature_data.name == "direct_rendering_display_compositor") { |
kylechar | b920f9a | 2024-03-04 15:28:42 | [diff] [blame] | 257 | status = gpu_feature_data.status == gpu::kGpuFeatureStatusEnabled |
| 258 | ? "enabled_on" |
| 259 | : "disabled_off_ok"; |
| 260 | } else if (gpu_access_blocked || |
kylechar | 0dad9bc7 | 2018-08-03 00:35:30 | [diff] [blame] | 261 | gpu_feature_data.status == gpu::kGpuFeatureStatusDisabled) { |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 262 | status = "disabled"; |
| 263 | if (gpu_feature_data.fallback_to_software) |
| 264 | status += "_software"; |
| 265 | else |
| 266 | status += "_off"; |
Corentin Wallez | 5cbffcc | 2020-07-08 10:23:57 | [diff] [blame] | 267 | } else if (gpu_feature_data.status == gpu::kGpuFeatureStatusBlocklisted) { |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 268 | status = "unavailable_off"; |
| 269 | } else if (gpu_feature_data.status == gpu::kGpuFeatureStatusSoftware) { |
| 270 | status = "unavailable_software"; |
| 271 | } else { |
| 272 | status = "enabled"; |
Justin Novosad | 5a90207 | 2021-08-23 15:32:58 | [diff] [blame] | 273 | if (gpu_feature_data.name == "canvas_oop_rasterization") { |
| 274 | status += "_on"; |
| 275 | } |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 276 | if ((gpu_feature_data.name == "webgl" || |
Yunchao He | e04a479c | 2022-04-01 18:09:09 | [diff] [blame] | 277 | gpu_feature_data.name == "webgl2" || |
| 278 | gpu_feature_data.name == "webgpu") && |
Zhenyao Mo | 811534f3 | 2020-12-22 23:17:14 | [diff] [blame] | 279 | is_gpu_compositing_disabled) |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 280 | status += "_readback"; |
| 281 | if (gpu_feature_data.name == "rasterization") { |
danakj | 51faabd | 2020-03-31 17:25:05 | [diff] [blame] | 282 | const base::CommandLine& command_line = |
| 283 | *base::CommandLine::ForCurrentProcess(); |
| 284 | if (command_line.HasSwitch(switches::kEnableGpuRasterization)) |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 285 | status += "_force"; |
| 286 | } |
| 287 | if (gpu_feature_data.name == "multiple_raster_threads") { |
| 288 | const base::CommandLine& command_line = |
| 289 | *base::CommandLine::ForCurrentProcess(); |
Peter Kasting | 6e6af3c | 2024-10-15 00:13:18 | [diff] [blame] | 290 | if (command_line.HasSwitch(switches::kNumRasterThreads)) { |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 291 | status += "_force"; |
Ken Rockot | 2ab918c7 | 2023-04-13 17:53:17 | [diff] [blame] | 292 | } |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 293 | status += "_on"; |
| 294 | } |
Sean Gilhuly | 1e54ddb | 2019-11-28 18:52:28 | [diff] [blame] | 295 | if (gpu_feature_data.name == "opengl" || |
| 296 | gpu_feature_data.name == "metal" || |
Peng Huang | 9b7d2ee | 2019-10-02 20:18:22 | [diff] [blame] | 297 | gpu_feature_data.name == "vulkan" || |
kylechar | 67db7ae4 | 2024-01-25 20:32:35 | [diff] [blame] | 298 | gpu_feature_data.name == "skia_graphite" || |
Pooja Patel | a00fc49 | 2024-03-07 19:24:08 | [diff] [blame] | 299 | gpu_feature_data.name == "surface_control" || |
Zhenyao Mo | 4353922 | 2025-05-07 20:38:04 | [diff] [blame] | 300 | gpu_feature_data.name == "webnn" || |
| 301 | gpu_feature_data.name == "trees_in_viz") { |
Christopher Cameron | 3a360189 | 2019-05-16 21:43:52 | [diff] [blame] | 302 | status += "_on"; |
kylechar | 6c29b0c | 2019-06-07 18:50:40 | [diff] [blame] | 303 | } |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 304 | } |
Matt Menke | ad6c1a5 | 2022-08-12 00:58:25 | [diff] [blame] | 305 | feature_status_dict.Set(gpu_feature_data.name, status); |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 306 | } |
Matt Menke | ad6c1a5 | 2022-08-12 00:58:25 | [diff] [blame] | 307 | return base::Value(std::move(feature_status_dict)); |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 308 | } |
| 309 | |
Austin Sullivan | bf2dfe3 | 2021-05-07 22:19:58 | [diff] [blame] | 310 | base::Value GetProblemsImpl(GpuFeatureInfoType type) { |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 311 | GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); |
| 312 | std::string gpu_access_blocked_reason; |
Zhenyao Mo | 811534f3 | 2020-12-22 23:17:14 | [diff] [blame] | 313 | bool gpu_access_blocked; |
| 314 | gpu::GpuFeatureInfo gpu_feature_info; |
| 315 | bool is_gpu_compositing_disabled; |
| 316 | if (type == GpuFeatureInfoType::kCurrent) { |
| 317 | gpu_access_blocked = !manager->GpuAccessAllowed(&gpu_access_blocked_reason); |
| 318 | gpu_feature_info = manager->GetGpuFeatureInfo(); |
| 319 | is_gpu_compositing_disabled = manager->IsGpuCompositingDisabled(); |
| 320 | } else { |
| 321 | gpu_access_blocked = |
| 322 | !manager->GpuAccessAllowedForHardwareGpu(&gpu_access_blocked_reason); |
| 323 | gpu_feature_info = manager->GetGpuFeatureInfoForHardwareGpu(); |
| 324 | is_gpu_compositing_disabled = |
| 325 | manager->IsGpuCompositingDisabledForHardwareGpu(); |
| 326 | } |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 327 | |
Matt Menke | ad6c1a5 | 2022-08-12 00:58:25 | [diff] [blame] | 328 | base::Value::List problem_list; |
Corentin Wallez | 5cbffcc | 2020-07-08 10:23:57 | [diff] [blame] | 329 | if (!gpu_feature_info.applied_gpu_blocklist_entries.empty()) { |
| 330 | std::unique_ptr<gpu::GpuBlocklist> blocklist(gpu::GpuBlocklist::Create()); |
Austin Sullivan | bf2dfe3 | 2021-05-07 22:19:58 | [diff] [blame] | 331 | blocklist->GetReasons(problem_list, "disabledFeatures", |
Corentin Wallez | 5cbffcc | 2020-07-08 10:23:57 | [diff] [blame] | 332 | gpu_feature_info.applied_gpu_blocklist_entries); |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 333 | } |
| 334 | if (!gpu_feature_info.applied_gpu_driver_bug_list_entries.empty()) { |
| 335 | std::unique_ptr<gpu::GpuDriverBugList> bug_list( |
| 336 | gpu::GpuDriverBugList::Create()); |
Austin Sullivan | bf2dfe3 | 2021-05-07 22:19:58 | [diff] [blame] | 337 | bug_list->GetReasons(problem_list, "workarounds", |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 338 | gpu_feature_info.applied_gpu_driver_bug_list_entries); |
| 339 | } |
| 340 | |
| 341 | if (gpu_access_blocked) { |
Matt Menke | ad6c1a5 | 2022-08-12 00:58:25 | [diff] [blame] | 342 | base::Value::Dict problem; |
| 343 | problem.Set("description", |
| 344 | "GPU process was unable to boot: " + gpu_access_blocked_reason); |
| 345 | problem.Set("crBugs", base::Value::List()); |
| 346 | base::Value::List disabled_features; |
Austin Sullivan | bf2dfe3 | 2021-05-07 22:19:58 | [diff] [blame] | 347 | disabled_features.Append("all"); |
Matt Menke | ad6c1a5 | 2022-08-12 00:58:25 | [diff] [blame] | 348 | problem.Set("affectedGpuSettings", std::move(disabled_features)); |
| 349 | problem.Set("tag", "disabledFeatures"); |
| 350 | problem_list.Insert(problem_list.begin(), base::Value(std::move(problem))); |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 351 | } |
| 352 | |
kylechar | 464200c | 2024-02-27 17:59:06 | [diff] [blame] | 353 | for (auto& gpu_feature_data : |
| 354 | GetGpuFeatureData(gpu_feature_info, is_gpu_compositing_disabled)) { |
kylechar | b920f9a | 2024-03-04 15:28:42 | [diff] [blame] | 355 | if (gpu_feature_data.status != gpu::kGpuFeatureStatusEnabled && |
kylechar | 6c29b0c | 2019-06-07 18:50:40 | [diff] [blame] | 356 | gpu_feature_data.disabled_info.is_problem) { |
Matt Menke | ad6c1a5 | 2022-08-12 00:58:25 | [diff] [blame] | 357 | base::Value::Dict problem; |
| 358 | problem.Set("description", gpu_feature_data.disabled_info.description); |
| 359 | problem.Set("crBugs", base::Value::List()); |
| 360 | base::Value::List disabled_features; |
Austin Sullivan | bf2dfe3 | 2021-05-07 22:19:58 | [diff] [blame] | 361 | disabled_features.Append(gpu_feature_data.name); |
Matt Menke | ad6c1a5 | 2022-08-12 00:58:25 | [diff] [blame] | 362 | problem.Set("affectedGpuSettings", std::move(disabled_features)); |
| 363 | problem.Set("tag", "disabledFeatures"); |
| 364 | problem_list.Insert(problem_list.begin(), |
| 365 | base::Value(std::move(problem))); |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 366 | } |
| 367 | } |
Matt Menke | ad6c1a5 | 2022-08-12 00:58:25 | [diff] [blame] | 368 | return base::Value(std::move(problem_list)); |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 369 | } |
| 370 | |
| 371 | std::vector<std::string> GetDriverBugWorkaroundsImpl(GpuFeatureInfoType type) { |
| 372 | GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); |
| 373 | const gpu::GpuFeatureInfo gpu_feature_info = |
| 374 | type == GpuFeatureInfoType::kCurrent |
| 375 | ? manager->GetGpuFeatureInfo() |
| 376 | : manager->GetGpuFeatureInfoForHardwareGpu(); |
| 377 | |
| 378 | std::vector<std::string> workarounds; |
| 379 | for (auto workaround : gpu_feature_info.enabled_gpu_driver_bug_workarounds) { |
| 380 | workarounds.push_back(gpu::GpuDriverBugWorkaroundTypeToString( |
| 381 | static_cast<gpu::GpuDriverBugWorkaroundType>(workaround))); |
| 382 | } |
Kenneth Russell | cc1732e0 | 2018-07-30 19:42:56 | [diff] [blame] | 383 | // Tell clients about the disabled extensions and disabled WebGL |
| 384 | // extensions as well, to avoid confusion. Do this in a way that's |
| 385 | // compatible with the current reporting of driver bug workarounds |
| 386 | // to DevTools and Telemetry, and from there to the GPU tests. |
| 387 | // |
| 388 | // This code must be kept in sync with |
| 389 | // GpuBenchmarking::GetGpuDriverBugWorkarounds. |
| 390 | for (auto ext : base::SplitString(gpu_feature_info.disabled_extensions, |
| 391 | " ", |
| 392 | base::TRIM_WHITESPACE, |
| 393 | base::SPLIT_WANT_NONEMPTY)) { |
| 394 | workarounds.push_back("disabled_extension_" + ext); |
| 395 | } |
| 396 | for (auto ext : base::SplitString(gpu_feature_info.disabled_webgl_extensions, |
| 397 | " ", |
| 398 | base::TRIM_WHITESPACE, |
| 399 | base::SPLIT_WANT_NONEMPTY)) { |
| 400 | workarounds.push_back("disabled_webgl_extension_" + ext); |
| 401 | } |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 402 | return workarounds; |
| 403 | } |
| 404 | |
[email protected] | cb643093 | 2012-10-31 00:53:36 | [diff] [blame] | 405 | } // namespace |
| 406 | |
danakj | 8a91b03 | 2014-08-30 00:04:22 | [diff] [blame] | 407 | int NumberOfRendererRasterThreads() { |
vmiura | 6bfd5d89 | 2015-06-09 22:47:04 | [diff] [blame] | 408 | int num_processors = base::SysInfo::NumberOfProcessors(); |
| 409 | |
Xiaohan Wang | 51dde998 | 2022-01-14 18:37:49 | [diff] [blame] | 410 | #if BUILDFLAG(IS_ANDROID) || \ |
| 411 | (BUILDFLAG(IS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)) |
reveman | 1760f2f | 2016-08-25 23:36:38 | [diff] [blame] | 412 | // Android and ChromeOS ARM devices may report 6 to 8 CPUs for big.LITTLE |
| 413 | // configurations. Limit the number of raster threads based on maximum of |
| 414 | // 4 big cores. |
vmiura | 6bfd5d89 | 2015-06-09 22:47:04 | [diff] [blame] | 415 | num_processors = std::min(num_processors, 4); |
| 416 | #endif |
| 417 | |
| 418 | int num_raster_threads = num_processors / 2; |
danakj | 8a91b03 | 2014-08-30 00:04:22 | [diff] [blame] | 419 | |
Xiaohan Wang | 51dde998 | 2022-01-14 18:37:49 | [diff] [blame] | 420 | #if BUILDFLAG(IS_ANDROID) |
reveman | 0e8fda5 | 2015-06-25 21:39:17 | [diff] [blame] | 421 | // Limit the number of raster threads to 1 on Android. |
| 422 | // TODO(reveman): Remove this when we have a better mechanims to prevent |
| 423 | // pre-paint raster work from slowing down non-raster work. crbug.com/504515 |
| 424 | num_raster_threads = 1; |
| 425 | #endif |
| 426 | |
reveman | fb8bb92 | 2015-05-19 17:58:13 | [diff] [blame] | 427 | const base::CommandLine& command_line = |
| 428 | *base::CommandLine::ForCurrentProcess(); |
danakj | 8a91b03 | 2014-08-30 00:04:22 | [diff] [blame] | 429 | |
Peter Kasting | 6e6af3c | 2024-10-15 00:13:18 | [diff] [blame] | 430 | if (command_line.HasSwitch(switches::kNumRasterThreads)) { |
Dave Tapuska | fcd9bb78 | 2022-07-12 18:09:31 | [diff] [blame] | 431 | std::string string_value = |
Peter Kasting | 6e6af3c | 2024-10-15 00:13:18 | [diff] [blame] | 432 | command_line.GetSwitchValueASCII(switches::kNumRasterThreads); |
reveman | fb8bb92 | 2015-05-19 17:58:13 | [diff] [blame] | 433 | if (!base::StringToInt(string_value, &num_raster_threads)) { |
Peter Kasting | 6e6af3c | 2024-10-15 00:13:18 | [diff] [blame] | 434 | DLOG(WARNING) << "Failed to parse switch " << switches::kNumRasterThreads |
| 435 | << ": " << string_value; |
reveman | fb8bb92 | 2015-05-19 17:58:13 | [diff] [blame] | 436 | } |
| 437 | } |
| 438 | |
Baitinq | bc4cea1 | 2023-04-22 00:48:39 | [diff] [blame] | 439 | return std::clamp(num_raster_threads, kMinRasterThreads, kMaxRasterThreads); |
danakj | 8a91b03 | 2014-08-30 00:04:22 | [diff] [blame] | 440 | } |
| 441 | |
danakj | 0977ec8 | 2015-01-13 01:54:34 | [diff] [blame] | 442 | bool IsZeroCopyUploadEnabled() { |
| 443 | const base::CommandLine& command_line = |
| 444 | *base::CommandLine::ForCurrentProcess(); |
Xiaohan Wang | 51dde998 | 2022-01-14 18:37:49 | [diff] [blame] | 445 | #if BUILDFLAG(IS_MAC) |
Dave Tapuska | 9bcf6cc | 2020-06-25 15:15:01 | [diff] [blame] | 446 | return !command_line.HasSwitch(blink::switches::kDisableZeroCopy); |
andresantoso | 67c34a52 | 2015-09-23 22:57:15 | [diff] [blame] | 447 | #else |
Dave Tapuska | 9bcf6cc | 2020-06-25 15:15:01 | [diff] [blame] | 448 | return command_line.HasSwitch(blink::switches::kEnableZeroCopy); |
andresantoso | 67c34a52 | 2015-09-23 22:57:15 | [diff] [blame] | 449 | #endif |
danakj | 0977ec8 | 2015-01-13 01:54:34 | [diff] [blame] | 450 | } |
| 451 | |
ericrk | 1d17f75 | 2015-10-20 03:03:07 | [diff] [blame] | 452 | bool IsPartialRasterEnabled() { |
Peng Huang | 6cae410 | 2021-09-29 20:46:11 | [diff] [blame] | 453 | // Partial raster is not supported with RawDraw. |
Peter Kasting | 6e6af3c | 2024-10-15 00:13:18 | [diff] [blame] | 454 | if (::features::IsUsingRawDraw()) { |
Peng Huang | 6cae410 | 2021-09-29 20:46:11 | [diff] [blame] | 455 | return false; |
Arthur Sonzogni | bdeca8e | 2023-09-11 08:32:12 | [diff] [blame] | 456 | } |
chrishtr | a8662c6 | 2016-03-30 16:19:24 | [diff] [blame] | 457 | const auto& command_line = *base::CommandLine::ForCurrentProcess(); |
Dave Tapuska | 9bcf6cc | 2020-06-25 15:15:01 | [diff] [blame] | 458 | return !command_line.HasSwitch(blink::switches::kDisablePartialRaster); |
jbroman | 5f7f7193 | 2015-08-18 16:24:46 | [diff] [blame] | 459 | } |
| 460 | |
ccameron | c7fcd13 | 2015-11-03 20:14:31 | [diff] [blame] | 461 | bool IsGpuMemoryBufferCompositorResourcesEnabled() { |
Peng Huang | a7d30d3 | 2021-11-30 19:43:31 | [diff] [blame] | 462 | // To use Raw Draw, the Raw Draw shared image backing should be used, so |
| 463 | // not use GPU memory buffer shared image backings for compositor resources. |
Peter Kasting | 6e6af3c | 2024-10-15 00:13:18 | [diff] [blame] | 464 | if (::features::IsUsingRawDraw()) { |
Peng Huang | a7d30d3 | 2021-11-30 19:43:31 | [diff] [blame] | 465 | return false; |
| 466 | } |
ccameron | c7fcd13 | 2015-11-03 20:14:31 | [diff] [blame] | 467 | const base::CommandLine& command_line = |
| 468 | *base::CommandLine::ForCurrentProcess(); |
ccameron | a956c997f | 2015-11-10 07:13:28 | [diff] [blame] | 469 | if (command_line.HasSwitch( |
Dave Tapuska | 9bcf6cc | 2020-06-25 15:15:01 | [diff] [blame] | 470 | blink::switches::kEnableGpuMemoryBufferCompositorResources)) { |
ccameron | a956c997f | 2015-11-10 07:13:28 | [diff] [blame] | 471 | return true; |
| 472 | } |
| 473 | if (command_line.HasSwitch( |
| 474 | switches::kDisableGpuMemoryBufferCompositorResources)) { |
| 475 | return false; |
| 476 | } |
| 477 | |
Maksim Sisov | a936fcb | 2023-03-16 20:59:05 | [diff] [blame] | 478 | #if BUILDFLAG(IS_APPLE) |
ccameron | c871e30 | 2015-11-24 03:42:10 | [diff] [blame] | 479 | return true; |
Michael Tang | bca8867 | 2024-07-30 00:24:37 | [diff] [blame] | 480 | #elif BUILDFLAG(IS_WIN) |
| 481 | return features::IsDelegatedCompositingEnabled() && |
Michael Tang | 54f58c33 | 2024-08-06 18:15:07 | [diff] [blame] | 482 | features::kDelegatedCompositingModeParam.Get() == |
| 483 | features::DelegatedCompositingMode::kFull; |
ccameron | a956c997f | 2015-11-10 07:13:28 | [diff] [blame] | 484 | #else |
| 485 | return false; |
| 486 | #endif |
ccameron | c7fcd13 | 2015-11-03 20:14:31 | [diff] [blame] | 487 | } |
| 488 | |
senorblanco | b60ba95 | 2015-01-27 19:12:36 | [diff] [blame] | 489 | int GpuRasterizationMSAASampleCount() { |
| 490 | const base::CommandLine& command_line = |
| 491 | *base::CommandLine::ForCurrentProcess(); |
| 492 | |
Dave Tapuska | 9bcf6cc | 2020-06-25 15:15:01 | [diff] [blame] | 493 | if (!command_line.HasSwitch( |
| 494 | blink::switches::kGpuRasterizationMSAASampleCount)) |
Xiaohan Wang | 51dde998 | 2022-01-14 18:37:49 | [diff] [blame] | 495 | #if BUILDFLAG(IS_ANDROID) |
senorblanco | fb88a4e | 2015-05-08 17:28:41 | [diff] [blame] | 496 | return 4; |
| 497 | #else |
senorblanco | 2a5b0e1 | 2015-08-14 21:55:37 | [diff] [blame] | 498 | // Desktop platforms will compute this automatically based on DPI. |
| 499 | return -1; |
senorblanco | fb88a4e | 2015-05-08 17:28:41 | [diff] [blame] | 500 | #endif |
senorblanco | b60ba95 | 2015-01-27 19:12:36 | [diff] [blame] | 501 | std::string string_value = command_line.GetSwitchValueASCII( |
Dave Tapuska | 9bcf6cc | 2020-06-25 15:15:01 | [diff] [blame] | 502 | blink::switches::kGpuRasterizationMSAASampleCount); |
senorblanco | b60ba95 | 2015-01-27 19:12:36 | [diff] [blame] | 503 | int msaa_sample_count = 0; |
| 504 | if (base::StringToInt(string_value, &msaa_sample_count) && |
| 505 | msaa_sample_count >= kMinMSAASampleCount) { |
| 506 | return msaa_sample_count; |
| 507 | } else { |
| 508 | DLOG(WARNING) << "Failed to parse switch " |
Dave Tapuska | 9bcf6cc | 2020-06-25 15:15:01 | [diff] [blame] | 509 | << blink::switches::kGpuRasterizationMSAASampleCount << ": " |
senorblanco | b60ba95 | 2015-01-27 19:12:36 | [diff] [blame] | 510 | << string_value; |
| 511 | return 0; |
| 512 | } |
| 513 | } |
| 514 | |
sunnyps | 3fe3c98 | 2016-05-18 00:22:46 | [diff] [blame] | 515 | bool IsMainFrameBeforeActivationEnabled() { |
| 516 | if (base::SysInfo::NumberOfProcessors() < 4) |
| 517 | return false; |
| 518 | |
Sunny Sachanandani | a8bbcf9 | 2017-09-20 05:26:01 | [diff] [blame] | 519 | if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
Peter Kasting | 6e6af3c | 2024-10-15 00:13:18 | [diff] [blame] | 520 | switches::kDisableMainFrameBeforeActivation)) { |
sunnyps | 3fe3c98 | 2016-05-18 00:22:46 | [diff] [blame] | 521 | return false; |
Peter Kasting | 6e6af3c | 2024-10-15 00:13:18 | [diff] [blame] | 522 | } |
sunnyps | 3fe3c98 | 2016-05-18 00:22:46 | [diff] [blame] | 523 | |
sunnyps | 398642c | 2016-09-03 00:04:09 | [diff] [blame] | 524 | return true; |
sunnyps | 3fe3c98 | 2016-05-18 00:22:46 | [diff] [blame] | 525 | } |
| 526 | |
Austin Sullivan | bf2dfe3 | 2021-05-07 22:19:58 | [diff] [blame] | 527 | base::Value GetFeatureStatus() { |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 528 | return GetFeatureStatusImpl(GpuFeatureInfoType::kCurrent); |
[email protected] | f454eed | 2013-10-16 05:48:02 | [diff] [blame] | 529 | } |
| 530 | |
Austin Sullivan | bf2dfe3 | 2021-05-07 22:19:58 | [diff] [blame] | 531 | base::Value GetProblems() { |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 532 | return GetProblemsImpl(GpuFeatureInfoType::kCurrent); |
[email protected] | f454eed | 2013-10-16 05:48:02 | [diff] [blame] | 533 | } |
| 534 | |
vkuzkokov | 7a4981d7 | 2014-11-13 10:22:36 | [diff] [blame] | 535 | std::vector<std::string> GetDriverBugWorkarounds() { |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 536 | return GetDriverBugWorkaroundsImpl(GpuFeatureInfoType::kCurrent); |
| 537 | } |
| 538 | |
Austin Sullivan | bf2dfe3 | 2021-05-07 22:19:58 | [diff] [blame] | 539 | base::Value GetFeatureStatusForHardwareGpu() { |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 540 | return GetFeatureStatusImpl(GpuFeatureInfoType::kForHardwareGpu); |
| 541 | } |
| 542 | |
Austin Sullivan | bf2dfe3 | 2021-05-07 22:19:58 | [diff] [blame] | 543 | base::Value GetProblemsForHardwareGpu() { |
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 544 | return GetProblemsImpl(GpuFeatureInfoType::kForHardwareGpu); |
| 545 | } |
| 546 | |
| 547 | std::vector<std::string> GetDriverBugWorkaroundsForHardwareGpu() { |
| 548 | return GetDriverBugWorkaroundsImpl(GpuFeatureInfoType::kForHardwareGpu); |
[email protected] | f454eed | 2013-10-16 05:48:02 | [diff] [blame] | 549 | } |
| 550 | |
[email protected] | cb643093 | 2012-10-31 00:53:36 | [diff] [blame] | 551 | } // namespace content |