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 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 } | 119 } |
120 } | 120 } |
121 if (integrated >= 0 && discrete >= 0) { | 121 if (integrated >= 0 && discrete >= 0) { |
122 // We always put discrete GPU as primary for blacklisting purpose. | 122 // We always put discrete GPU as primary for blacklisting purpose. |
123 gpu_info->gpu = gpu_list[discrete]; | 123 gpu_info->gpu = gpu_list[discrete]; |
124 gpu_info->secondary_gpus.push_back(gpu_list[integrated]); | 124 gpu_info->secondary_gpus.push_back(gpu_list[integrated]); |
125 break; | 125 break; |
126 } | 126 } |
127 // If it's not optimus or amd_switchable, we put the current GPU as | 127 // If it's not optimus or amd_switchable, we put the current GPU as |
128 // primary. Fall through to default. | 128 // primary. Fall through to default. |
| 129 FALLTHROUGH_INTENDED; |
129 } | 130 } |
130 default: | 131 default: |
131 { | 132 { |
132 GPUInfo::GPUDevice active_gpu = GetActiveGPU(); | 133 GPUInfo::GPUDevice active_gpu = GetActiveGPU(); |
133 size_t current = gpu_list.size(); | 134 size_t current = gpu_list.size(); |
134 if (active_gpu.vendor_id && active_gpu.device_id) { | 135 if (active_gpu.vendor_id && active_gpu.device_id) { |
135 for (size_t i = 0; i < gpu_list.size(); ++i) { | 136 for (size_t i = 0; i < gpu_list.size(); ++i) { |
136 if (gpu_list[i].vendor_id == active_gpu.vendor_id && | 137 if (gpu_list[i].vendor_id == active_gpu.vendor_id && |
137 gpu_list[i].device_id == active_gpu.device_id) { | 138 gpu_list[i].device_id == active_gpu.device_id) { |
138 current = i; | 139 current = i; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 gpu_info->driver_version = gl_version_string.substr(pos + 1); | 212 gpu_info->driver_version = gl_version_string.substr(pos + 1); |
212 return true; | 213 return true; |
213 } | 214 } |
214 | 215 |
215 void MergeGPUInfo(GPUInfo* basic_gpu_info, | 216 void MergeGPUInfo(GPUInfo* basic_gpu_info, |
216 const GPUInfo& context_gpu_info) { | 217 const GPUInfo& context_gpu_info) { |
217 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); | 218 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); |
218 } | 219 } |
219 | 220 |
220 } // namespace gpu | 221 } // namespace gpu |
OLD | NEW |