OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/gl/gpu_switching_manager.h" | 5 #include "ui/gl/gpu_switching_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "ui/gl/gl_switches.h" | 9 #include "ui/gl/gl_switches.h" |
10 | 10 |
11 namespace ui { | 11 namespace ui { |
12 | 12 |
13 // static | 13 // static |
14 GpuSwitchingManager* GpuSwitchingManager::GetInstance() { | 14 GpuSwitchingManager* GpuSwitchingManager::GetInstance() { |
15 return Singleton<GpuSwitchingManager>::get(); | 15 return base::Singleton<GpuSwitchingManager>::get(); |
16 } | 16 } |
17 | 17 |
18 GpuSwitchingManager::GpuSwitchingManager() | 18 GpuSwitchingManager::GpuSwitchingManager() |
19 : gpu_switching_option_(gfx::PreferIntegratedGpu), | 19 : gpu_switching_option_(gfx::PreferIntegratedGpu), |
20 gpu_switching_option_set_(false), | 20 gpu_switching_option_set_(false), |
21 supports_dual_gpus_(false), | 21 supports_dual_gpus_(false), |
22 supports_dual_gpus_set_(false), | 22 supports_dual_gpus_set_(false), |
23 gpu_count_(0) { | 23 gpu_count_(0) { |
24 } | 24 } |
25 | 25 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 } | 86 } |
87 | 87 |
88 gfx::GpuPreference GpuSwitchingManager::AdjustGpuPreference( | 88 gfx::GpuPreference GpuSwitchingManager::AdjustGpuPreference( |
89 gfx::GpuPreference gpu_preference) { | 89 gfx::GpuPreference gpu_preference) { |
90 if (!gpu_switching_option_set_) | 90 if (!gpu_switching_option_set_) |
91 return gpu_preference; | 91 return gpu_preference; |
92 return gpu_switching_option_; | 92 return gpu_switching_option_; |
93 } | 93 } |
94 | 94 |
95 } // namespace ui | 95 } // namespace ui |
OLD | NEW |