OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/gpu/compositor_util.h" | 5 #include "content/browser/gpu/compositor_util.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "cc/base/switches.h" | 10 #include "cc/base/switches.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 { | 43 { |
44 "gpu_compositing", | 44 "gpu_compositing", |
45 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING), | 45 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING), |
46 false, | 46 false, |
47 "Gpu compositing has been disabled, either via about:flags or" | 47 "Gpu compositing has been disabled, either via about:flags or" |
48 " command line. The browser will fall back to software compositing" | 48 " command line. The browser will fall back to software compositing" |
49 " and hardware acceleration will be unavailable.", | 49 " and hardware acceleration will be unavailable.", |
50 true | 50 true |
51 }, | 51 }, |
52 { | 52 { |
53 "3d_css", | |
54 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_3D_CSS), | |
55 command_line.HasSwitch(switches::kDisableAcceleratedLayers), | |
56 "Accelerated layers have been disabled at the command line.", | |
57 false | |
58 }, | |
59 { | |
60 "css_animation", | |
61 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_3D_CSS), | |
62 command_line.HasSwitch(cc::switches::kDisableThreadedAnimation) || | |
63 command_line.HasSwitch(switches::kDisableAcceleratedLayers), | |
64 "Accelerated CSS animation has been disabled at the command line.", | |
65 true | |
66 }, | |
67 { | |
68 "webgl", | 53 "webgl", |
69 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL), | 54 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL), |
70 command_line.HasSwitch(switches::kDisableExperimentalWebGL), | 55 command_line.HasSwitch(switches::kDisableExperimentalWebGL), |
71 "WebGL has been disabled, either via about:flags or command line.", | 56 "WebGL has been disabled, either via about:flags or command line.", |
72 false | 57 false |
73 }, | 58 }, |
74 { | 59 { |
75 "flash_3d", | 60 "flash_3d", |
76 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH3D), | 61 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH3D), |
77 command_line.HasSwitch(switches::kDisableFlash3d), | 62 command_line.HasSwitch(switches::kDisableFlash3d), |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 !manager->GpuAccessAllowed(&gpu_access_blocked_reason); | 232 !manager->GpuAccessAllowed(&gpu_access_blocked_reason); |
248 | 233 |
249 base::DictionaryValue* feature_status_dict = new base::DictionaryValue(); | 234 base::DictionaryValue* feature_status_dict = new base::DictionaryValue(); |
250 | 235 |
251 bool eof = false; | 236 bool eof = false; |
252 for (size_t i = 0; !eof; ++i) { | 237 for (size_t i = 0; !eof; ++i) { |
253 const GpuFeatureInfo gpu_feature_info = GetGpuFeatureInfo(i, &eof); | 238 const GpuFeatureInfo gpu_feature_info = GetGpuFeatureInfo(i, &eof); |
254 std::string status; | 239 std::string status; |
255 if (gpu_feature_info.disabled) { | 240 if (gpu_feature_info.disabled) { |
256 status = "disabled"; | 241 status = "disabled"; |
257 if (gpu_feature_info.name == "css_animation") { | 242 if (gpu_feature_info.name == "raster") { |
258 status += "_software_animated"; | |
259 } else if (gpu_feature_info.name == "raster") { | |
260 if (IsImplSidePaintingEnabled()) | 243 if (IsImplSidePaintingEnabled()) |
261 status += "_software_multithreaded"; | 244 status += "_software_multithreaded"; |
262 else | 245 else |
263 status += "_software"; | 246 status += "_software"; |
264 } else { | 247 } else { |
265 if (gpu_feature_info.fallback_to_software) | 248 if (gpu_feature_info.fallback_to_software) |
266 status += "_software"; | 249 status += "_software"; |
267 else | 250 else |
268 status += "_off"; | 251 status += "_off"; |
269 } | 252 } |
270 } else if (manager->ShouldUseSwiftShader()) { | 253 } else if (manager->ShouldUseSwiftShader()) { |
271 status = "unavailable_software"; | 254 status = "unavailable_software"; |
272 } else if (gpu_feature_info.blocked || | 255 } else if (gpu_feature_info.blocked || |
273 gpu_access_blocked) { | 256 gpu_access_blocked) { |
274 status = "unavailable"; | 257 status = "unavailable"; |
275 if (gpu_feature_info.fallback_to_software) | 258 if (gpu_feature_info.fallback_to_software) |
276 status += "_software"; | 259 status += "_software"; |
277 else | 260 else |
278 status += "_off"; | 261 status += "_off"; |
279 } else { | 262 } else { |
280 status = "enabled"; | 263 status = "enabled"; |
281 if (gpu_feature_info.name == "webgl" && | 264 if (gpu_feature_info.name == "webgl" && |
282 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING)) | 265 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING)) |
283 status += "_readback"; | 266 status += "_readback"; |
284 if (gpu_feature_info.name == "css_animation") { | 267 if (gpu_feature_info.name == "raster") { |
285 if (IsThreadedCompositingEnabled()) | |
286 status = "accelerated_threaded"; | |
287 else | |
288 status = "accelerated"; | |
289 } else if (gpu_feature_info.name == "raster") { | |
290 if (IsForceGpuRasterizationEnabled()) | 268 if (IsForceGpuRasterizationEnabled()) |
291 status += "_force"; | 269 status += "_force"; |
292 } | 270 } |
293 } | 271 } |
294 if (gpu_feature_info.name == "gpu_compositing") { | 272 if (gpu_feature_info.name == "gpu_compositing") { |
295 if (IsThreadedCompositingEnabled()) | 273 if (IsThreadedCompositingEnabled()) |
296 status += "_threaded"; | 274 status += "_threaded"; |
297 } | 275 } |
298 feature_status_dict->SetString( | 276 feature_status_dict->SetString( |
299 gpu_feature_info.name.c_str(), status.c_str()); | 277 gpu_feature_info.name.c_str(), status.c_str()); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 return problem_list; | 320 return problem_list; |
343 } | 321 } |
344 | 322 |
345 base::Value* GetDriverBugWorkarounds() { | 323 base::Value* GetDriverBugWorkarounds() { |
346 base::ListValue* workaround_list = new base::ListValue(); | 324 base::ListValue* workaround_list = new base::ListValue(); |
347 GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(workaround_list); | 325 GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(workaround_list); |
348 return workaround_list; | 326 return workaround_list; |
349 } | 327 } |
350 | 328 |
351 } // namespace content | 329 } // namespace content |
OLD | NEW |