Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: content/browser/gpu/gpu_data_manager_impl_private.cc

Issue 1142423005: [M44 Merge] Refine dual-GPU detection on Mac OS X. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2403
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/gl/gpu_switching_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 EnableWarpIfNecessary(); 1025 EnableWarpIfNecessary();
1026 EnableSwiftShaderIfNecessary(); 1026 EnableSwiftShaderIfNecessary();
1027 } 1027 }
1028 1028
1029 void GpuDataManagerImplPrivate::UpdatePreliminaryBlacklistedFeatures() { 1029 void GpuDataManagerImplPrivate::UpdatePreliminaryBlacklistedFeatures() {
1030 preliminary_blacklisted_features_ = blacklisted_features_; 1030 preliminary_blacklisted_features_ = blacklisted_features_;
1031 } 1031 }
1032 1032
1033 void GpuDataManagerImplPrivate::UpdateGpuSwitchingManager( 1033 void GpuDataManagerImplPrivate::UpdateGpuSwitchingManager(
1034 const gpu::GPUInfo& gpu_info) { 1034 const gpu::GPUInfo& gpu_info) {
1035 ui::GpuSwitchingManager::GetInstance()->SetGpuCount( 1035 // The vendor IDs might be 0 on non-PCI devices (like Android), but
1036 gpu_info.secondary_gpus.size() + 1); 1036 // the length of the vector is all we care about in most cases.
1037 std::vector<uint32> vendor_ids;
1038 vendor_ids.push_back(gpu_info.gpu.vendor_id);
1039 for (const auto& device : gpu_info.secondary_gpus) {
1040 vendor_ids.push_back(device.vendor_id);
1041 }
1042 ui::GpuSwitchingManager::GetInstance()->SetGpuVendorIds(vendor_ids);
1037 1043
1038 if (ui::GpuSwitchingManager::GetInstance()->SupportsDualGpus()) { 1044 if (ui::GpuSwitchingManager::GetInstance()->SupportsDualGpus()) {
1039 if (gpu_driver_bugs_.count(gpu::FORCE_DISCRETE_GPU) == 1) 1045 if (gpu_driver_bugs_.count(gpu::FORCE_DISCRETE_GPU) == 1)
1040 ui::GpuSwitchingManager::GetInstance()->ForceUseOfDiscreteGpu(); 1046 ui::GpuSwitchingManager::GetInstance()->ForceUseOfDiscreteGpu();
1041 else if (gpu_driver_bugs_.count(gpu::FORCE_INTEGRATED_GPU) == 1) 1047 else if (gpu_driver_bugs_.count(gpu::FORCE_INTEGRATED_GPU) == 1)
1042 ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu(); 1048 ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu();
1043 } 1049 }
1044 } 1050 }
1045 1051
1046 void GpuDataManagerImplPrivate::NotifyGpuInfoUpdate() { 1052 void GpuDataManagerImplPrivate::NotifyGpuInfoUpdate() {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; 1192 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure;
1187 #if defined(OS_WIN) 1193 #if defined(OS_WIN)
1188 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; 1194 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure;
1189 #endif 1195 #endif
1190 complete_gpu_info_already_requested_ = true; 1196 complete_gpu_info_already_requested_ = true;
1191 // Some observers might be waiting. 1197 // Some observers might be waiting.
1192 NotifyGpuInfoUpdate(); 1198 NotifyGpuInfoUpdate();
1193 } 1199 }
1194 1200
1195 } // namespace content 1201 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | ui/gl/gpu_switching_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698