| Index: ui/gl/gpu_switching_manager.cc
|
| diff --git a/ui/gl/gpu_switching_manager.cc b/ui/gl/gpu_switching_manager.cc
|
| index 23fc2ffade4f86c1c6f4801196b448a997a1ea54..36ad7adde2ab26bd31c8628c5075511f5430c947 100644
|
| --- a/ui/gl/gpu_switching_manager.cc
|
| +++ b/ui/gl/gpu_switching_manager.cc
|
| @@ -32,7 +32,6 @@ GpuSwitchingManager::GpuSwitchingManager()
|
| gpu_switching_option_set_(false),
|
| supports_dual_gpus_(false),
|
| supports_dual_gpus_set_(false),
|
| - gpu_count_(0),
|
| platform_specific_(new PlatformSpecific) {
|
| #if defined(OS_MACOSX)
|
| platform_specific_->discrete_pixel_format = nullptr;
|
| @@ -91,7 +90,7 @@ bool GpuSwitchingManager::SupportsDualGpus() {
|
| // Browser process.
|
| // We only compute this flag in the browser process.
|
| #if defined(OS_MACOSX)
|
| - flag = (gpu_count_ == 2);
|
| + flag = (vendor_ids_.size() == 2);
|
| if (flag && command_line.HasSwitch(switches::kUseGL) &&
|
| command_line.GetSwitchValueASCII(switches::kUseGL) !=
|
| gfx::kGLImplementationDesktopName)
|
| @@ -99,6 +98,17 @@ bool GpuSwitchingManager::SupportsDualGpus() {
|
|
|
| if (flag && !base::mac::IsOSLionOrLater())
|
| flag = false;
|
| +
|
| + if (flag) {
|
| + // Only advertise that we have two GPUs to the rest of
|
| + // Chrome's code if we find an Intel GPU and some other
|
| + // vendor's GPU. Otherwise we don't understand the
|
| + // configuration and don't deal well with it (an example being
|
| + // the dual AMD GPUs in recent Mac Pros).
|
| + const uint32 intel = 0x8086;
|
| + flag = ((vendor_ids_[0] == intel && vendor_ids_[1] != intel) ||
|
| + (vendor_ids_[0] != intel && vendor_ids_[1] == intel));
|
| + }
|
| #endif // OS_MACOSX
|
| }
|
| supports_dual_gpus_ = flag;
|
| @@ -107,8 +117,9 @@ bool GpuSwitchingManager::SupportsDualGpus() {
|
| return supports_dual_gpus_;
|
| }
|
|
|
| -void GpuSwitchingManager::SetGpuCount(size_t gpu_count) {
|
| - gpu_count_ = gpu_count;
|
| +void GpuSwitchingManager::SetGpuVendorIds(
|
| + const std::vector<uint32>& vendor_ids) {
|
| + vendor_ids_ = vendor_ids;
|
| }
|
|
|
| void GpuSwitchingManager::AddObserver(GpuSwitchingObserver* observer) {
|
|
|