| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 void GpuDataManagerImplPrivate::UpdateGpuSwitchingManager( | 1172 void GpuDataManagerImplPrivate::UpdateGpuSwitchingManager( |
| 1173 const gpu::GPUInfo& gpu_info) { | 1173 const gpu::GPUInfo& gpu_info) { |
| 1174 // The vendor IDs might be 0 on non-PCI devices (like Android), but | 1174 // The vendor IDs might be 0 on non-PCI devices (like Android), but |
| 1175 // the length of the vector is all we care about in most cases. | 1175 // the length of the vector is all we care about in most cases. |
| 1176 std::vector<uint32_t> vendor_ids; | 1176 std::vector<uint32_t> vendor_ids; |
| 1177 vendor_ids.push_back(gpu_info.gpu.vendor_id); | 1177 vendor_ids.push_back(gpu_info.gpu.vendor_id); |
| 1178 for (const auto& device : gpu_info.secondary_gpus) { | 1178 for (const auto& device : gpu_info.secondary_gpus) { |
| 1179 vendor_ids.push_back(device.vendor_id); | 1179 vendor_ids.push_back(device.vendor_id); |
| 1180 } | 1180 } |
| 1181 ui::GpuSwitchingManager::GetInstance()->SetGpuVendorIds(vendor_ids); | 1181 ui::GpuSwitchingManager::GetInstance()->SetGpuVendorIds(vendor_ids); |
| 1182 | 1182 gpu::InitializeDualGpusIfSupported(gpu_driver_bugs_); |
| 1183 if (ui::GpuSwitchingManager::GetInstance()->SupportsDualGpus()) { | |
| 1184 if (gpu_driver_bugs_.count(gpu::FORCE_DISCRETE_GPU) == 1) | |
| 1185 ui::GpuSwitchingManager::GetInstance()->ForceUseOfDiscreteGpu(); | |
| 1186 else if (gpu_driver_bugs_.count(gpu::FORCE_INTEGRATED_GPU) == 1) | |
| 1187 ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu(); | |
| 1188 } | |
| 1189 } | 1183 } |
| 1190 | 1184 |
| 1191 void GpuDataManagerImplPrivate::NotifyGpuInfoUpdate() { | 1185 void GpuDataManagerImplPrivate::NotifyGpuInfoUpdate() { |
| 1192 observer_list_->Notify(FROM_HERE, &GpuDataManagerObserver::OnGpuInfoUpdate); | 1186 observer_list_->Notify(FROM_HERE, &GpuDataManagerObserver::OnGpuInfoUpdate); |
| 1193 } | 1187 } |
| 1194 | 1188 |
| 1195 void GpuDataManagerImplPrivate::EnableSwiftShaderIfNecessary() { | 1189 void GpuDataManagerImplPrivate::EnableSwiftShaderIfNecessary() { |
| 1196 if (!GpuAccessAllowed(NULL) || | 1190 if (!GpuAccessAllowed(NULL) || |
| 1197 blacklisted_features_.count(gpu::GPU_FEATURE_TYPE_WEBGL)) { | 1191 blacklisted_features_.count(gpu::GPU_FEATURE_TYPE_WEBGL)) { |
| 1198 if (!swiftshader_path_.empty() && | 1192 if (!swiftshader_path_.empty() && |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1313 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1307 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
| 1314 #if defined(OS_WIN) | 1308 #if defined(OS_WIN) |
| 1315 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1309 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
| 1316 #endif | 1310 #endif |
| 1317 complete_gpu_info_already_requested_ = true; | 1311 complete_gpu_info_already_requested_ = true; |
| 1318 // Some observers might be waiting. | 1312 // Some observers might be waiting. |
| 1319 NotifyGpuInfoUpdate(); | 1313 NotifyGpuInfoUpdate(); |
| 1320 } | 1314 } |
| 1321 | 1315 |
| 1322 } // namespace content | 1316 } // namespace content |
| OLD | NEW |