Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_data_manager_impl_private.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl_private.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 234 void* gpu_data_manager) { | 234 void* gpu_data_manager) { |
| 235 if (flags == kCGDisplayBeginConfigurationFlag) | 235 if (flags == kCGDisplayBeginConfigurationFlag) |
| 236 return; // This call contains no information about the display change | 236 return; // This call contains no information about the display change |
| 237 | 237 |
| 238 GpuDataManagerImpl* manager = | 238 GpuDataManagerImpl* manager = |
| 239 reinterpret_cast<GpuDataManagerImpl*>(gpu_data_manager); | 239 reinterpret_cast<GpuDataManagerImpl*>(gpu_data_manager); |
| 240 DCHECK(manager); | 240 DCHECK(manager); |
| 241 | 241 |
| 242 bool gpu_changed = false; | 242 bool gpu_changed = false; |
| 243 if (flags & kCGDisplayAddFlag) { | 243 if (flags & kCGDisplayAddFlag) { |
| 244 uint32_t vendor_id, device_id; | 244 gpu::GPUInfo gpu_info; |
| 245 if (gpu::CollectGpuID(&vendor_id, &device_id) == gpu::kCollectInfoSuccess) { | 245 if (gpu::CollectBasicGraphicsInfo(&gpu_info) == gpu::kCollectInfoSuccess) { |
| 246 gpu_changed = manager->UpdateActiveGpu(vendor_id, device_id); | 246 gpu_changed = manager->UpdateActiveGpu(gpu_info.gpu.vendor_id, |
| 247 gpu_info.gpu.device_id); | |
|
ccameron
2017/05/12 23:46:10
For dual-GPU macs, gpu_info.gpu always refers to t
| |
| 247 } | 248 } |
| 248 } | 249 } |
| 249 | 250 |
| 250 if (gpu_changed) | 251 if (gpu_changed) |
| 251 manager->HandleGpuSwitch(); | 252 manager->HandleGpuSwitch(); |
| 252 } | 253 } |
| 253 #endif // OS_MACOSX | 254 #endif // OS_MACOSX |
| 254 | 255 |
| 255 // Block all domains' use of 3D APIs for this many milliseconds if | 256 // Block all domains' use of 3D APIs for this many milliseconds if |
| 256 // approaching a threshold where system stability might be compromised. | 257 // approaching a threshold where system stability might be compromised. |
| (...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1367 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1368 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
| 1368 #if defined(OS_WIN) | 1369 #if defined(OS_WIN) |
| 1369 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1370 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
| 1370 #endif | 1371 #endif |
| 1371 complete_gpu_info_already_requested_ = true; | 1372 complete_gpu_info_already_requested_ = true; |
| 1372 // Some observers might be waiting. | 1373 // Some observers might be waiting. |
| 1373 NotifyGpuInfoUpdate(); | 1374 NotifyGpuInfoUpdate(); |
| 1374 } | 1375 } |
| 1375 | 1376 |
| 1376 } // namespace content | 1377 } // namespace content |
| OLD | NEW |