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/gpu_internals_ui.h" | 5 #include "content/browser/gpu/gpu_internals_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/i18n/time_formatting.h" | 12 #include "base/i18n/time_formatting.h" |
13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "base/sys_info.h" | 15 #include "base/sys_info.h" |
16 #include "base/values.h" | 16 #include "base/values.h" |
17 #include "cc/base/switches.h" | 17 #include "cc/base/switches.h" |
18 #include "content/browser/gpu/gpu_data_manager_impl.h" | 18 #include "content/browser/gpu/gpu_data_manager_impl.h" |
19 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
20 #include "content/public/browser/compositor_util.h" | 20 #include "content/public/browser/compositor_util.h" |
21 #include "content/public/browser/gpu_data_manager_observer.h" | 21 #include "content/public/browser/gpu_data_manager_observer.h" |
22 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
23 #include "content/public/browser/web_ui.h" | 23 #include "content/public/browser/web_ui.h" |
24 #include "content/public/browser/web_ui_data_source.h" | 24 #include "content/public/browser/web_ui_data_source.h" |
25 #include "content/public/browser/web_ui_message_handler.h" | 25 #include "content/public/browser/web_ui_message_handler.h" |
26 #include "content/public/common/content_client.h" | 26 #include "content/public/common/content_client.h" |
27 #include "content/public/common/content_switches.h" | 27 #include "content/public/common/content_switches.h" |
28 #include "content/public/common/gpu_feature_type.h" | |
29 #include "content/public/common/gpu_info.h" | |
30 #include "content/public/common/url_constants.h" | 28 #include "content/public/common/url_constants.h" |
| 29 #include "gpu/config/gpu_feature_type.h" |
| 30 #include "gpu/config/gpu_info.h" |
31 #include "grit/content_resources.h" | 31 #include "grit/content_resources.h" |
32 #include "third_party/angle/src/common/version.h" | 32 #include "third_party/angle/src/common/version.h" |
33 | 33 |
34 namespace content { | 34 namespace content { |
35 namespace { | 35 namespace { |
36 | 36 |
37 struct GpuFeatureInfo { | 37 struct GpuFeatureInfo { |
38 std::string name; | 38 std::string name; |
39 uint32 blocked; | 39 uint32 blocked; |
40 bool disabled; | 40 bool disabled; |
(...skipping 28 matching lines...) Expand all Loading... |
69 | 69 |
70 base::Value* NewStatusValue(const char* name, const char* status) { | 70 base::Value* NewStatusValue(const char* name, const char* status) { |
71 base::DictionaryValue* value = new base::DictionaryValue(); | 71 base::DictionaryValue* value = new base::DictionaryValue(); |
72 value->SetString("name", name); | 72 value->SetString("name", name); |
73 value->SetString("status", status); | 73 value->SetString("status", status); |
74 return value; | 74 return value; |
75 } | 75 } |
76 | 76 |
77 #if defined(OS_WIN) | 77 #if defined(OS_WIN) |
78 // Output DxDiagNode tree as nested array of {description,value} pairs | 78 // Output DxDiagNode tree as nested array of {description,value} pairs |
79 base::ListValue* DxDiagNodeToList(const DxDiagNode& node) { | 79 base::ListValue* DxDiagNodeToList(const gpu::DxDiagNode& node) { |
80 base::ListValue* list = new ListValue(); | 80 base::ListValue* list = new ListValue(); |
81 for (std::map<std::string, std::string>::const_iterator it = | 81 for (std::map<std::string, std::string>::const_iterator it = |
82 node.values.begin(); | 82 node.values.begin(); |
83 it != node.values.end(); | 83 it != node.values.end(); |
84 ++it) { | 84 ++it) { |
85 list->Append(NewDescriptionValuePair(it->first, it->second)); | 85 list->Append(NewDescriptionValuePair(it->first, it->second)); |
86 } | 86 } |
87 | 87 |
88 for (std::map<std::string, DxDiagNode>::const_iterator it = | 88 for (std::map<std::string, gpu::DxDiagNode>::const_iterator it = |
89 node.children.begin(); | 89 node.children.begin(); |
90 it != node.children.end(); | 90 it != node.children.end(); |
91 ++it) { | 91 ++it) { |
92 base::ListValue* sublist = DxDiagNodeToList(it->second); | 92 base::ListValue* sublist = DxDiagNodeToList(it->second); |
93 list->Append(NewDescriptionValuePair(it->first, sublist)); | 93 list->Append(NewDescriptionValuePair(it->first, sublist)); |
94 } | 94 } |
95 return list; | 95 return list; |
96 } | 96 } |
97 #endif | 97 #endif |
98 | 98 |
99 std::string GPUDeviceToString(const GPUInfo::GPUDevice& gpu) { | 99 std::string GPUDeviceToString(const gpu::GPUInfo::GPUDevice& gpu) { |
100 std::string vendor = base::StringPrintf("0x%04x", gpu.vendor_id); | 100 std::string vendor = base::StringPrintf("0x%04x", gpu.vendor_id); |
101 if (!gpu.vendor_string.empty()) | 101 if (!gpu.vendor_string.empty()) |
102 vendor += " [" + gpu.vendor_string + "]"; | 102 vendor += " [" + gpu.vendor_string + "]"; |
103 std::string device = base::StringPrintf("0x%04x", gpu.device_id); | 103 std::string device = base::StringPrintf("0x%04x", gpu.device_id); |
104 if (!gpu.device_string.empty()) | 104 if (!gpu.device_string.empty()) |
105 device += " [" + gpu.device_string + "]"; | 105 device += " [" + gpu.device_string + "]"; |
106 return base::StringPrintf( | 106 return base::StringPrintf( |
107 "VENDOR = %s, DEVICE= %s", vendor.c_str(), device.c_str()); | 107 "VENDOR = %s, DEVICE= %s", vendor.c_str(), device.c_str()); |
108 } | 108 } |
109 | 109 |
110 base::DictionaryValue* GpuInfoAsDictionaryValue() { | 110 base::DictionaryValue* GpuInfoAsDictionaryValue() { |
111 GPUInfo gpu_info = GpuDataManagerImpl::GetInstance()->GetGPUInfo(); | 111 gpu::GPUInfo gpu_info = GpuDataManagerImpl::GetInstance()->GetGPUInfo(); |
112 base::ListValue* basic_info = new base::ListValue(); | 112 base::ListValue* basic_info = new base::ListValue(); |
113 basic_info->Append(NewDescriptionValuePair( | 113 basic_info->Append(NewDescriptionValuePair( |
114 "Initialization time", | 114 "Initialization time", |
115 base::Int64ToString(gpu_info.initialization_time.InMilliseconds()))); | 115 base::Int64ToString(gpu_info.initialization_time.InMilliseconds()))); |
116 basic_info->Append(NewDescriptionValuePair( | 116 basic_info->Append(NewDescriptionValuePair( |
117 "Sandboxed", new base::FundamentalValue(gpu_info.sandboxed))); | 117 "Sandboxed", new base::FundamentalValue(gpu_info.sandboxed))); |
118 basic_info->Append(NewDescriptionValuePair( | 118 basic_info->Append(NewDescriptionValuePair( |
119 "GPU0", GPUDeviceToString(gpu_info.gpu))); | 119 "GPU0", GPUDeviceToString(gpu_info.gpu))); |
120 for (size_t i = 0; i < gpu_info.secondary_gpus.size(); ++i) { | 120 for (size_t i = 0; i < gpu_info.secondary_gpus.size(); ++i) { |
121 basic_info->Append(NewDescriptionValuePair( | 121 basic_info->Append(NewDescriptionValuePair( |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); | 195 GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); |
196 std::string gpu_access_blocked_reason; | 196 std::string gpu_access_blocked_reason; |
197 bool gpu_access_blocked = | 197 bool gpu_access_blocked = |
198 !manager->GpuAccessAllowed(&gpu_access_blocked_reason); | 198 !manager->GpuAccessAllowed(&gpu_access_blocked_reason); |
199 | 199 |
200 base::DictionaryValue* status = new base::DictionaryValue(); | 200 base::DictionaryValue* status = new base::DictionaryValue(); |
201 | 201 |
202 const GpuFeatureInfo kGpuFeatureInfo[] = { | 202 const GpuFeatureInfo kGpuFeatureInfo[] = { |
203 { | 203 { |
204 "2d_canvas", | 204 "2d_canvas", |
205 manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS), | 205 manager->IsFeatureBlacklisted( |
| 206 gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS), |
206 command_line.HasSwitch(switches::kDisableAccelerated2dCanvas) || | 207 command_line.HasSwitch(switches::kDisableAccelerated2dCanvas) || |
207 !SupportsAccelerated2dCanvas(), | 208 !SupportsAccelerated2dCanvas(), |
208 "Accelerated 2D canvas is unavailable: either disabled at the command" | 209 "Accelerated 2D canvas is unavailable: either disabled at the command" |
209 " line or not supported by the current system.", | 210 " line or not supported by the current system.", |
210 true | 211 true |
211 }, | 212 }, |
212 { | 213 { |
213 "compositing", | 214 "compositing", |
214 manager->IsFeatureBlacklisted( | 215 manager->IsFeatureBlacklisted( |
215 GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING), | 216 gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING), |
216 command_line.HasSwitch(switches::kDisableAcceleratedCompositing), | 217 command_line.HasSwitch(switches::kDisableAcceleratedCompositing), |
217 "Accelerated compositing has been disabled, either via about:flags or" | 218 "Accelerated compositing has been disabled, either via about:flags or" |
218 " command line. This adversely affects performance of all hardware" | 219 " command line. This adversely affects performance of all hardware" |
219 " accelerated features.", | 220 " accelerated features.", |
220 true | 221 true |
221 }, | 222 }, |
222 { | 223 { |
223 "3d_css", | 224 "3d_css", |
224 manager->IsFeatureBlacklisted( | 225 manager->IsFeatureBlacklisted( |
225 GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) || | 226 gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) || |
226 manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_3D_CSS), | 227 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_3D_CSS), |
227 command_line.HasSwitch(switches::kDisableAcceleratedLayers), | 228 command_line.HasSwitch(switches::kDisableAcceleratedLayers), |
228 "Accelerated layers have been disabled at the command line.", | 229 "Accelerated layers have been disabled at the command line.", |
229 false | 230 false |
230 }, | 231 }, |
231 { | 232 { |
232 "css_animation", | 233 "css_animation", |
233 manager->IsFeatureBlacklisted( | 234 manager->IsFeatureBlacklisted( |
234 GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) || | 235 gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) || |
235 manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_3D_CSS), | 236 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_3D_CSS), |
236 command_line.HasSwitch(cc::switches::kDisableThreadedAnimation) || | 237 command_line.HasSwitch(cc::switches::kDisableThreadedAnimation) || |
237 command_line.HasSwitch(switches::kDisableAcceleratedCompositing) || | 238 command_line.HasSwitch(switches::kDisableAcceleratedCompositing) || |
238 command_line.HasSwitch(switches::kDisableAcceleratedLayers), | 239 command_line.HasSwitch(switches::kDisableAcceleratedLayers), |
239 "Accelerated CSS animation has been disabled at the command line.", | 240 "Accelerated CSS animation has been disabled at the command line.", |
240 true | 241 true |
241 }, | 242 }, |
242 { | 243 { |
243 "webgl", | 244 "webgl", |
244 manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_WEBGL), | 245 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL), |
245 #if defined(OS_ANDROID) | 246 #if defined(OS_ANDROID) |
246 !command_line.HasSwitch(switches::kEnableExperimentalWebGL), | 247 !command_line.HasSwitch(switches::kEnableExperimentalWebGL), |
247 #else | 248 #else |
248 command_line.HasSwitch(switches::kDisableExperimentalWebGL), | 249 command_line.HasSwitch(switches::kDisableExperimentalWebGL), |
249 #endif | 250 #endif |
250 "WebGL has been disabled, either via about:flags or command line.", | 251 "WebGL has been disabled, either via about:flags or command line.", |
251 false | 252 false |
252 }, | 253 }, |
253 { | 254 { |
254 "multisampling", | 255 "multisampling", |
255 manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_MULTISAMPLING), | 256 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_MULTISAMPLING), |
256 command_line.HasSwitch(switches::kDisableGLMultisampling), | 257 command_line.HasSwitch(switches::kDisableGLMultisampling), |
257 "Multisampling has been disabled, either via about:flags or command" | 258 "Multisampling has been disabled, either via about:flags or command" |
258 " line.", | 259 " line.", |
259 false | 260 false |
260 }, | 261 }, |
261 { | 262 { |
262 "flash_3d", | 263 "flash_3d", |
263 manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_FLASH3D), | 264 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH3D), |
264 command_line.HasSwitch(switches::kDisableFlash3d), | 265 command_line.HasSwitch(switches::kDisableFlash3d), |
265 "Using 3d in flash has been disabled, either via about:flags or" | 266 "Using 3d in flash has been disabled, either via about:flags or" |
266 " command line.", | 267 " command line.", |
267 false | 268 false |
268 }, | 269 }, |
269 { | 270 { |
270 "flash_stage3d", | 271 "flash_stage3d", |
271 manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_FLASH_STAGE3D), | 272 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D), |
272 command_line.HasSwitch(switches::kDisableFlashStage3d), | 273 command_line.HasSwitch(switches::kDisableFlashStage3d), |
273 "Using Stage3d in Flash has been disabled, either via about:flags or" | 274 "Using Stage3d in Flash has been disabled, either via about:flags or" |
274 " command line.", | 275 " command line.", |
275 false | 276 false |
276 }, | 277 }, |
277 { | 278 { |
278 "flash_stage3d_baseline", | 279 "flash_stage3d_baseline", |
279 manager->IsFeatureBlacklisted( | 280 manager->IsFeatureBlacklisted( |
280 GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE) || | 281 gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE) || |
281 manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_FLASH_STAGE3D), | 282 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D), |
282 command_line.HasSwitch(switches::kDisableFlashStage3d), | 283 command_line.HasSwitch(switches::kDisableFlashStage3d), |
283 "Using Stage3d Baseline profile in Flash has been disabled, either" | 284 "Using Stage3d Baseline profile in Flash has been disabled, either" |
284 " via about:flags or command line.", | 285 " via about:flags or command line.", |
285 false | 286 false |
286 }, | 287 }, |
287 { | 288 { |
288 "texture_sharing", | 289 "texture_sharing", |
289 manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_TEXTURE_SHARING), | 290 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_TEXTURE_SHARING), |
290 command_line.HasSwitch(switches::kDisableImageTransportSurface), | 291 command_line.HasSwitch(switches::kDisableImageTransportSurface), |
291 "Sharing textures between processes has been disabled, either via" | 292 "Sharing textures between processes has been disabled, either via" |
292 " about:flags or command line.", | 293 " about:flags or command line.", |
293 false | 294 false |
294 }, | 295 }, |
295 { | 296 { |
296 "video_decode", | 297 "video_decode", |
297 manager->IsFeatureBlacklisted( | 298 manager->IsFeatureBlacklisted( |
298 GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE), | 299 gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE), |
299 command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode), | 300 command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode), |
300 "Accelerated video decode has been disabled, either via about:flags" | 301 "Accelerated video decode has been disabled, either via about:flags" |
301 " or command line.", | 302 " or command line.", |
302 true | 303 true |
303 }, | 304 }, |
304 { | 305 { |
305 "video", | 306 "video", |
306 manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_ACCELERATED_VIDEO), | 307 manager->IsFeatureBlacklisted( |
| 308 gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO), |
307 command_line.HasSwitch(switches::kDisableAcceleratedVideo) || | 309 command_line.HasSwitch(switches::kDisableAcceleratedVideo) || |
308 command_line.HasSwitch(switches::kDisableAcceleratedCompositing), | 310 command_line.HasSwitch(switches::kDisableAcceleratedCompositing), |
309 "Accelerated video presentation has been disabled, either via" | 311 "Accelerated video presentation has been disabled, either via" |
310 " about:flags or command line.", | 312 " about:flags or command line.", |
311 true | 313 true |
312 }, | 314 }, |
313 { | 315 { |
314 "panel_fitting", | 316 "panel_fitting", |
315 manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_PANEL_FITTING), | 317 manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_PANEL_FITTING), |
316 #if defined(OS_CHROMEOS) | 318 #if defined(OS_CHROMEOS) |
317 command_line.HasSwitch(switches::kDisablePanelFitting), | 319 command_line.HasSwitch(switches::kDisablePanelFitting), |
318 #else | 320 #else |
319 true, | 321 true, |
320 #endif | 322 #endif |
321 "Panel fitting is unavailable, either disabled at the command" | 323 "Panel fitting is unavailable, either disabled at the command" |
322 " line or not supported by the current system.", | 324 " line or not supported by the current system.", |
323 false | 325 false |
324 }, | 326 }, |
325 { | 327 { |
326 "force_compositing_mode", | 328 "force_compositing_mode", |
327 manager->IsFeatureBlacklisted( | 329 manager->IsFeatureBlacklisted( |
328 GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE) && | 330 gpu::GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE) && |
329 !IsForceCompositingModeEnabled(), | 331 !IsForceCompositingModeEnabled(), |
330 !IsForceCompositingModeEnabled() && | 332 !IsForceCompositingModeEnabled() && |
331 !manager->IsFeatureBlacklisted( | 333 !manager->IsFeatureBlacklisted( |
332 GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE), | 334 gpu::GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE), |
333 "Force compositing mode is off, either disabled at the command" | 335 "Force compositing mode is off, either disabled at the command" |
334 " line or not supported by the current system.", | 336 " line or not supported by the current system.", |
335 false | 337 false |
336 }, | 338 }, |
337 { | 339 { |
338 "raster", | 340 "raster", |
339 false, | 341 false, |
340 !command_line.HasSwitch(switches::kEnableAcceleratedPainting), | 342 !command_line.HasSwitch(switches::kEnableAcceleratedPainting), |
341 "Accelerated rasterization has not been enabled or" | 343 "Accelerated rasterization has not been enabled or" |
342 " is not supported by the current system.", | 344 " is not supported by the current system.", |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 status = "unavailable"; | 379 status = "unavailable"; |
378 if (kGpuFeatureInfo[i].fallback_to_software) | 380 if (kGpuFeatureInfo[i].fallback_to_software) |
379 status += "_software"; | 381 status += "_software"; |
380 else | 382 else |
381 status += "_off"; | 383 status += "_off"; |
382 } else { | 384 } else { |
383 status = "enabled"; | 385 status = "enabled"; |
384 if (kGpuFeatureInfo[i].name == "webgl" && | 386 if (kGpuFeatureInfo[i].name == "webgl" && |
385 (command_line.HasSwitch(switches::kDisableAcceleratedCompositing) || | 387 (command_line.HasSwitch(switches::kDisableAcceleratedCompositing) || |
386 manager->IsFeatureBlacklisted( | 388 manager->IsFeatureBlacklisted( |
387 GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING))) | 389 gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING))) |
388 status += "_readback"; | 390 status += "_readback"; |
389 bool has_thread = IsThreadedCompositingEnabled(); | 391 bool has_thread = IsThreadedCompositingEnabled(); |
390 if (kGpuFeatureInfo[i].name == "compositing") { | 392 if (kGpuFeatureInfo[i].name == "compositing") { |
391 bool force_compositing = IsForceCompositingModeEnabled(); | 393 bool force_compositing = IsForceCompositingModeEnabled(); |
392 if (force_compositing) | 394 if (force_compositing) |
393 status += "_force"; | 395 status += "_force"; |
394 if (has_thread) | 396 if (has_thread) |
395 status += "_threaded"; | 397 status += "_threaded"; |
396 } | 398 } |
397 if (kGpuFeatureInfo[i].name == "css_animation") { | 399 if (kGpuFeatureInfo[i].name == "css_animation") { |
398 if (has_thread) | 400 if (has_thread) |
399 status = "accelerated_threaded"; | 401 status = "accelerated_threaded"; |
400 else | 402 else |
401 status = "accelerated"; | 403 status = "accelerated"; |
402 } | 404 } |
403 } | 405 } |
404 // TODO(reveman): Remove this when crbug.com/223286 has been fixed. | 406 // TODO(reveman): Remove this when crbug.com/223286 has been fixed. |
405 if (kGpuFeatureInfo[i].name == "raster" && | 407 if (kGpuFeatureInfo[i].name == "raster" && |
406 cc::switches::IsImplSidePaintingEnabled()) { | 408 cc::switches::IsImplSidePaintingEnabled()) { |
407 status = "disabled_software_multithreaded"; | 409 status = "disabled_software_multithreaded"; |
408 } | 410 } |
409 feature_status_list->Append( | 411 feature_status_list->Append( |
410 NewStatusValue(kGpuFeatureInfo[i].name.c_str(), status.c_str())); | 412 NewStatusValue(kGpuFeatureInfo[i].name.c_str(), status.c_str())); |
411 } | 413 } |
412 GpuSwitchingOption gpu_switching_option = | 414 gpu::GpuSwitchingOption gpu_switching_option = |
413 GpuDataManagerImpl::GetInstance()->GetGpuSwitchingOption(); | 415 GpuDataManagerImpl::GetInstance()->GetGpuSwitchingOption(); |
414 if (gpu_switching_option != GPU_SWITCHING_OPTION_UNKNOWN) { | 416 if (gpu_switching_option != gpu::GPU_SWITCHING_OPTION_UNKNOWN) { |
415 std::string gpu_switching; | 417 std::string gpu_switching; |
416 switch (gpu_switching_option) { | 418 switch (gpu_switching_option) { |
417 case GPU_SWITCHING_OPTION_AUTOMATIC: | 419 case gpu::GPU_SWITCHING_OPTION_AUTOMATIC: |
418 gpu_switching = "gpu_switching_automatic"; | 420 gpu_switching = "gpu_switching_automatic"; |
419 break; | 421 break; |
420 case GPU_SWITCHING_OPTION_FORCE_DISCRETE: | 422 case gpu::GPU_SWITCHING_OPTION_FORCE_DISCRETE: |
421 gpu_switching = "gpu_switching_force_discrete"; | 423 gpu_switching = "gpu_switching_force_discrete"; |
422 break; | 424 break; |
423 case GPU_SWITCHING_OPTION_FORCE_INTEGRATED: | 425 case gpu::GPU_SWITCHING_OPTION_FORCE_INTEGRATED: |
424 gpu_switching = "gpu_switching_force_integrated"; | 426 gpu_switching = "gpu_switching_force_integrated"; |
425 break; | 427 break; |
426 default: | 428 default: |
427 break; | 429 break; |
428 } | 430 } |
429 feature_status_list->Append( | 431 feature_status_list->Append( |
430 NewStatusValue("gpu_switching", gpu_switching.c_str())); | 432 NewStatusValue("gpu_switching", gpu_switching.c_str())); |
431 } | 433 } |
432 status->Set("featureStatus", feature_status_list); | 434 status->Set("featureStatus", feature_status_list); |
433 } | 435 } |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 : WebUIController(web_ui) { | 647 : WebUIController(web_ui) { |
646 web_ui->AddMessageHandler(new GpuMessageHandler()); | 648 web_ui->AddMessageHandler(new GpuMessageHandler()); |
647 | 649 |
648 // Set up the chrome://gpu/ source. | 650 // Set up the chrome://gpu/ source. |
649 BrowserContext* browser_context = | 651 BrowserContext* browser_context = |
650 web_ui->GetWebContents()->GetBrowserContext(); | 652 web_ui->GetWebContents()->GetBrowserContext(); |
651 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 653 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
652 } | 654 } |
653 | 655 |
654 } // namespace content | 656 } // namespace content |
OLD | NEW |