| 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 "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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 CGGetActiveDisplayList(0, NULL, &displayCount); | 219 CGGetActiveDisplayList(0, NULL, &displayCount); |
| 220 if (displayCount != manager->GetDisplayCount()) { | 220 if (displayCount != manager->GetDisplayCount()) { |
| 221 manager->SetDisplayCount(displayCount); | 221 manager->SetDisplayCount(displayCount); |
| 222 display_changed = true; | 222 display_changed = true; |
| 223 } | 223 } |
| 224 | 224 |
| 225 // Gpu change. | 225 // Gpu change. |
| 226 bool gpu_changed = false; | 226 bool gpu_changed = false; |
| 227 if (flags & kCGDisplayAddFlag) { | 227 if (flags & kCGDisplayAddFlag) { |
| 228 uint32 vendor_id, device_id; | 228 uint32 vendor_id, device_id; |
| 229 if (gpu::CollectGpuID(&vendor_id, &device_id) == gpu::kGpuIDSuccess) { | 229 if (gpu::CollectGpuID(&vendor_id, &device_id) == gpu::kCollectInfoSuccess) { |
| 230 gpu_changed = manager->UpdateActiveGpu(vendor_id, device_id); | 230 gpu_changed = manager->UpdateActiveGpu(vendor_id, device_id); |
| 231 } | 231 } |
| 232 } | 232 } |
| 233 | 233 |
| 234 if (display_changed || gpu_changed) | 234 if (display_changed || gpu_changed) |
| 235 manager->HandleGpuSwitch(); | 235 manager->HandleGpuSwitch(); |
| 236 } | 236 } |
| 237 #endif // OS_MACOSX | 237 #endif // OS_MACOSX |
| 238 | 238 |
| 239 // Block all domains' use of 3D APIs for this many milliseconds if | 239 // Block all domains' use of 3D APIs for this many milliseconds if |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 | 1073 |
| 1074 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { | 1074 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { |
| 1075 gpu_process_accessible_ = false; | 1075 gpu_process_accessible_ = false; |
| 1076 gpu_info_.finalized = true; | 1076 gpu_info_.finalized = true; |
| 1077 complete_gpu_info_already_requested_ = true; | 1077 complete_gpu_info_already_requested_ = true; |
| 1078 // Some observers might be waiting. | 1078 // Some observers might be waiting. |
| 1079 NotifyGpuInfoUpdate(); | 1079 NotifyGpuInfoUpdate(); |
| 1080 } | 1080 } |
| 1081 | 1081 |
| 1082 } // namespace content | 1082 } // namespace content |
| OLD | NEW |