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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 #include "ui/gl/gl_switches.h" | 43 #include "ui/gl/gl_switches.h" |
| 44 #include "ui/gl/gpu_switching_manager.h" | 44 #include "ui/gl/gpu_switching_manager.h" |
| 45 | 45 |
| 46 #if defined(OS_MACOSX) | 46 #if defined(OS_MACOSX) |
| 47 #include <ApplicationServices/ApplicationServices.h> | 47 #include <ApplicationServices/ApplicationServices.h> |
| 48 #endif // OS_MACOSX | 48 #endif // OS_MACOSX |
| 49 #if defined(OS_WIN) | 49 #if defined(OS_WIN) |
| 50 #include "base/win/windows_version.h" | 50 #include "base/win/windows_version.h" |
| 51 #endif // OS_WIN | 51 #endif // OS_WIN |
| 52 | 52 |
| 53 #if defined(USE_X11) && !defined(OS_CHROMEOS) | |
| 54 #include "ui/base/x/x11_util_internal.h" // nogncheck | |
| 55 #endif | |
| 56 | |
| 53 namespace content { | 57 namespace content { |
| 54 | 58 |
| 55 namespace { | 59 namespace { |
| 56 | 60 |
| 57 enum GpuFeatureStatus { | 61 enum GpuFeatureStatus { |
| 58 kGpuFeatureEnabled = 0, | 62 kGpuFeatureEnabled = 0, |
| 59 kGpuFeatureBlacklisted = 1, | 63 kGpuFeatureBlacklisted = 1, |
| 60 kGpuFeatureDisabled = 2, // disabled by user but not blacklisted | 64 kGpuFeatureDisabled = 2, // disabled by user but not blacklisted |
| 61 kGpuFeatureNumStatus | 65 kGpuFeatureNumStatus |
| 62 }; | 66 }; |
| (...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1164 std::vector<uint32_t> vendor_ids; | 1168 std::vector<uint32_t> vendor_ids; |
| 1165 vendor_ids.push_back(gpu_info.gpu.vendor_id); | 1169 vendor_ids.push_back(gpu_info.gpu.vendor_id); |
| 1166 for (const auto& device : gpu_info.secondary_gpus) { | 1170 for (const auto& device : gpu_info.secondary_gpus) { |
| 1167 vendor_ids.push_back(device.vendor_id); | 1171 vendor_ids.push_back(device.vendor_id); |
| 1168 } | 1172 } |
| 1169 ui::GpuSwitchingManager::GetInstance()->SetGpuVendorIds(vendor_ids); | 1173 ui::GpuSwitchingManager::GetInstance()->SetGpuVendorIds(vendor_ids); |
| 1170 gpu::InitializeDualGpusIfSupported(gpu_driver_bugs_); | 1174 gpu::InitializeDualGpusIfSupported(gpu_driver_bugs_); |
| 1171 } | 1175 } |
| 1172 | 1176 |
| 1173 void GpuDataManagerImplPrivate::NotifyGpuInfoUpdate() { | 1177 void GpuDataManagerImplPrivate::NotifyGpuInfoUpdate() { |
| 1178 #if defined(USE_X11) && !defined(OS_CHROMEOS) | |
| 1179 // TODO(thomasanderson): figure out what to do with this | |
|
Tom (Use chromium acct)
2016/09/22 19:53:29
I left this here as a placeholder but I'm not quit
| |
| 1180 ui::XVisualManager::GetInstance()->OnGPUInfoChanged( | |
|
piman
2016/09/22 21:24:54
This function is called on the IO thread (and some
Tom (Use chromium acct)
2016/09/23 20:00:37
Done. Added GpuDataManagerVisualProxy in browser_
piman
2016/09/26 21:13:29
I think I'm ok if we punt on --single-process.
Dir
| |
| 1181 gpu_info_.software_rendering || card_blacklisted_, | |
| 1182 gpu_info_.system_visual, gpu_info_.rgba_visual); | |
| 1183 #endif | |
| 1174 observer_list_->Notify(FROM_HERE, &GpuDataManagerObserver::OnGpuInfoUpdate); | 1184 observer_list_->Notify(FROM_HERE, &GpuDataManagerObserver::OnGpuInfoUpdate); |
| 1175 } | 1185 } |
| 1176 | 1186 |
| 1177 void GpuDataManagerImplPrivate::EnableSwiftShaderIfNecessary() { | 1187 void GpuDataManagerImplPrivate::EnableSwiftShaderIfNecessary() { |
| 1178 if (!GpuAccessAllowed(NULL) || | 1188 if (!GpuAccessAllowed(NULL) || |
| 1179 blacklisted_features_.count(gpu::GPU_FEATURE_TYPE_WEBGL)) { | 1189 blacklisted_features_.count(gpu::GPU_FEATURE_TYPE_WEBGL)) { |
| 1180 if (!swiftshader_path_.empty() && | 1190 if (!swiftshader_path_.empty() && |
| 1181 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 1191 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1182 switches::kDisableSoftwareRasterizer)) | 1192 switches::kDisableSoftwareRasterizer)) |
| 1183 use_swiftshader_ = true; | 1193 use_swiftshader_ = true; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1290 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1300 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
| 1291 #if defined(OS_WIN) | 1301 #if defined(OS_WIN) |
| 1292 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1302 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
| 1293 #endif | 1303 #endif |
| 1294 complete_gpu_info_already_requested_ = true; | 1304 complete_gpu_info_already_requested_ = true; |
| 1295 // Some observers might be waiting. | 1305 // Some observers might be waiting. |
| 1296 NotifyGpuInfoUpdate(); | 1306 NotifyGpuInfoUpdate(); |
| 1297 } | 1307 } |
| 1298 | 1308 |
| 1299 } // namespace content | 1309 } // namespace content |
| OLD | NEW |