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 "gpu/config/gpu_info_collector.h" | 5 #include "gpu/config/gpu_info_collector.h" |
6 | 6 |
7 // This has to be included before windows.h. | 7 // This has to be included before windows.h. |
8 #include "third_party/re2/re2/re2.h" | 8 #include "third_party/re2/re2/re2.h" |
9 | 9 |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 TRACE_EVENT0("gpu", "CollectDriverInfoD3D"); | 400 TRACE_EVENT0("gpu", "CollectDriverInfoD3D"); |
401 | 401 |
402 // Display adapter class GUID from | 402 // Display adapter class GUID from |
403 // https://msdn.microsoft.com/en-us/library/windows/hardware/ff553426%28v=vs.8
5%29.aspx | 403 // https://msdn.microsoft.com/en-us/library/windows/hardware/ff553426%28v=vs.8
5%29.aspx |
404 GUID display_class = {0x4d36e968, | 404 GUID display_class = {0x4d36e968, |
405 0xe325, | 405 0xe325, |
406 0x11ce, | 406 0x11ce, |
407 {0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18}}; | 407 {0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18}}; |
408 | 408 |
409 // create device info for the display device | 409 // create device info for the display device |
410 HDEVINFO device_info = | 410 HDEVINFO device_info; |
411 SetupDiGetClassDevsW(&display_class, NULL, NULL, DIGCF_PRESENT); | 411 if (base::win::GetVersion() <= base::win::VERSION_XP) { |
| 412 // Collection of information on all adapters is much slower on XP (almost |
| 413 // 100ms), and not very useful (as it's not going to use the GPU anyway), so |
| 414 // just collect information on the current device. http://crbug.com/456178 |
| 415 device_info = |
| 416 SetupDiGetClassDevsW(NULL, device_id.c_str(), NULL, |
| 417 DIGCF_PRESENT | DIGCF_PROFILE | DIGCF_ALLCLASSES); |
| 418 } else { |
| 419 device_info = |
| 420 SetupDiGetClassDevsW(&display_class, NULL, NULL, DIGCF_PRESENT); |
| 421 } |
412 if (device_info == INVALID_HANDLE_VALUE) { | 422 if (device_info == INVALID_HANDLE_VALUE) { |
413 LOG(ERROR) << "Creating device info failed"; | 423 LOG(ERROR) << "Creating device info failed"; |
414 return kCollectInfoNonFatalFailure; | 424 return kCollectInfoNonFatalFailure; |
415 } | 425 } |
416 | 426 |
417 struct GPUDriver { | 427 struct GPUDriver { |
418 GPUInfo::GPUDevice device; | 428 GPUInfo::GPUDevice device; |
419 std::string driver_vendor; | 429 std::string driver_vendor; |
420 std::string driver_version; | 430 std::string driver_version; |
421 std::string driver_date; | 431 std::string driver_date; |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 shader_model, | 790 shader_model, |
781 NUM_SHADER_MODELS); | 791 NUM_SHADER_MODELS); |
782 } | 792 } |
783 | 793 |
784 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); | 794 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); |
785 | 795 |
786 basic_gpu_info->dx_diagnostics = context_gpu_info.dx_diagnostics; | 796 basic_gpu_info->dx_diagnostics = context_gpu_info.dx_diagnostics; |
787 } | 797 } |
788 | 798 |
789 } // namespace gpu | 799 } // namespace gpu |
OLD | NEW |