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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
299 // crash. | 299 // crash. |
300 // By skipping the following code on Mac, we don't really lose anything, | 300 // By skipping the following code on Mac, we don't really lose anything, |
301 // because the basic GPU information is passed down from browser process | 301 // because the basic GPU information is passed down from browser process |
302 // and we already registered them through SetGpuInfo() above. | 302 // and we already registered them through SetGpuInfo() above. |
303 base::TimeTicks before_collect_context_graphics_info = | 303 base::TimeTicks before_collect_context_graphics_info = |
304 base::TimeTicks::Now(); | 304 base::TimeTicks::Now(); |
305 #if !defined(OS_MACOSX) | 305 #if !defined(OS_MACOSX) |
306 if (!CollectGraphicsInfo(gpu_info)) | 306 if (!CollectGraphicsInfo(gpu_info)) |
307 dead_on_arrival = true; | 307 dead_on_arrival = true; |
308 | 308 |
309 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_LINUX) | 309 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_LINUX) || \ |
310 defined(OS_WIN) | |
piman
2016/04/27 22:14:05
We're in the !(OS_MACOSX), I don't think there's a
Julien Isorce Samsung
2016/04/27 23:02:50
Good point I think you are right. Since the next f
| |
310 // Recompute gpu driver bug workarounds. | 311 // Recompute gpu driver bug workarounds. |
311 // This is necessary on systems where vendor_id/device_id aren't available | 312 // This is necessary on systems where vendor_id/device_id aren't available |
312 // (Chrome OS, Android) or where workarounds may be dependent on GL_VENDOR | 313 // (Chrome OS, Android) or where workarounds may be dependent on GL_VENDOR |
313 // and GL_RENDERER strings which are lazily computed (Linux). | 314 // and GL_RENDERER strings which are lazily computed (Linux). |
314 if (!command_line.HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { | 315 if (!command_line.HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { |
315 // TODO: this can not affect disabled extensions, since they're already | 316 // TODO: this can not affect disabled extensions, since they're already |
316 // initialized in the bindings. This should be moved before bindings | 317 // initialized in the bindings. This should be moved before bindings |
317 // initialization. However, populating GPUInfo fully works only on | 318 // initialization. However, populating GPUInfo fully works only on |
318 // Android. Other platforms would need the bindings to query GL strings. | 319 // Android. Other platforms would need the bindings to query GL strings. |
319 gpu::ApplyGpuDriverBugWorkarounds( | 320 gpu::ApplyGpuDriverBugWorkarounds( |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
431 &gpu_info.gpu.vendor_id); | 432 &gpu_info.gpu.vendor_id); |
432 DCHECK(success); | 433 DCHECK(success); |
433 success = base::HexStringToUInt( | 434 success = base::HexStringToUInt( |
434 command_line.GetSwitchValueASCII(switches::kGpuDeviceID), | 435 command_line.GetSwitchValueASCII(switches::kGpuDeviceID), |
435 &gpu_info.gpu.device_id); | 436 &gpu_info.gpu.device_id); |
436 DCHECK(success); | 437 DCHECK(success); |
437 gpu_info.driver_vendor = | 438 gpu_info.driver_vendor = |
438 command_line.GetSwitchValueASCII(switches::kGpuDriverVendor); | 439 command_line.GetSwitchValueASCII(switches::kGpuDriverVendor); |
439 gpu_info.driver_version = | 440 gpu_info.driver_version = |
440 command_line.GetSwitchValueASCII(switches::kGpuDriverVersion); | 441 command_line.GetSwitchValueASCII(switches::kGpuDriverVersion); |
442 gpu_info.driver_date = | |
443 command_line.GetSwitchValueASCII(switches::kGpuDriverDate); | |
441 gpu::ParseSecondaryGpuDevicesFromCommandLine(command_line, &gpu_info); | 444 gpu::ParseSecondaryGpuDevicesFromCommandLine(command_line, &gpu_info); |
442 | 445 |
443 // Set active gpu device. | 446 // Set active gpu device. |
444 if (command_line.HasSwitch(switches::kGpuActiveVendorID) && | 447 if (command_line.HasSwitch(switches::kGpuActiveVendorID) && |
445 command_line.HasSwitch(switches::kGpuActiveDeviceID)) { | 448 command_line.HasSwitch(switches::kGpuActiveDeviceID)) { |
446 uint32_t active_vendor_id = 0; | 449 uint32_t active_vendor_id = 0; |
447 uint32_t active_device_id = 0; | 450 uint32_t active_device_id = 0; |
448 success = base::HexStringToUInt( | 451 success = base::HexStringToUInt( |
449 command_line.GetSwitchValueASCII(switches::kGpuActiveVendorID), | 452 command_line.GetSwitchValueASCII(switches::kGpuActiveVendorID), |
450 &active_vendor_id); | 453 &active_vendor_id); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
610 return true; | 613 return true; |
611 } | 614 } |
612 | 615 |
613 return false; | 616 return false; |
614 } | 617 } |
615 #endif // defined(OS_WIN) | 618 #endif // defined(OS_WIN) |
616 | 619 |
617 } // namespace. | 620 } // namespace. |
618 | 621 |
619 } // namespace content | 622 } // namespace content |
OLD | NEW |