| 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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 } | 538 } |
| 539 | 539 |
| 540 if (id.length() > 20) { | 540 if (id.length() > 20) { |
| 541 int vendor = 0, device = 0; | 541 int vendor = 0, device = 0; |
| 542 std::wstring vendor_string = id.substr(8, 4); | 542 std::wstring vendor_string = id.substr(8, 4); |
| 543 std::wstring device_string = id.substr(17, 4); | 543 std::wstring device_string = id.substr(17, 4); |
| 544 base::HexStringToInt(base::UTF16ToASCII(vendor_string), &vendor); | 544 base::HexStringToInt(base::UTF16ToASCII(vendor_string), &vendor); |
| 545 base::HexStringToInt(base::UTF16ToASCII(device_string), &device); | 545 base::HexStringToInt(base::UTF16ToASCII(device_string), &device); |
| 546 *vendor_id = vendor; | 546 *vendor_id = vendor; |
| 547 *device_id = device; | 547 *device_id = device; |
| 548 return kGpuIDSuccess; | 548 if (*vendor_id != 0 && *device_id != 0) |
| 549 return kGpuIDSuccess; |
| 549 } | 550 } |
| 550 return kGpuIDFailure; | 551 return kGpuIDFailure; |
| 551 } | 552 } |
| 552 | 553 |
| 553 CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) { | 554 CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) { |
| 554 TRACE_EVENT0("gpu", "CollectPreliminaryGraphicsInfo"); | 555 TRACE_EVENT0("gpu", "CollectPreliminaryGraphicsInfo"); |
| 555 | 556 |
| 556 DCHECK(gpu_info); | 557 DCHECK(gpu_info); |
| 557 | 558 |
| 558 gpu_info->performance_stats = RetrieveGpuPerformanceStatsWithHistograms(); | 559 gpu_info->performance_stats = RetrieveGpuPerformanceStatsWithHistograms(); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 basic_gpu_info->software_rendering = true; | 647 basic_gpu_info->software_rendering = true; |
| 647 return; | 648 return; |
| 648 } | 649 } |
| 649 | 650 |
| 650 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); | 651 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); |
| 651 | 652 |
| 652 basic_gpu_info->dx_diagnostics = context_gpu_info.dx_diagnostics; | 653 basic_gpu_info->dx_diagnostics = context_gpu_info.dx_diagnostics; |
| 653 } | 654 } |
| 654 | 655 |
| 655 } // namespace gpu | 656 } // namespace gpu |
| OLD | NEW |