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 #ifndef UI_GL_GPU_SWITCHING_MANAGER_H_ | 5 #ifndef UI_GL_GPU_SWITCHING_MANAGER_H_ |
6 #define UI_GL_GPU_SWITCHING_MANAGER_H_ | 6 #define UI_GL_GPU_SWITCHING_MANAGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 void RemoveObserver(GpuSwitchingObserver* observer); | 44 void RemoveObserver(GpuSwitchingObserver* observer); |
45 | 45 |
46 // Called when a GPU switch is noticed by the system. In the browser process | 46 // Called when a GPU switch is noticed by the system. In the browser process |
47 // this is occurs as a result of a system observer. In the GPU process, this | 47 // this is occurs as a result of a system observer. In the GPU process, this |
48 // occurs as a result of an IPC from the browser. The system observer is kept | 48 // occurs as a result of an IPC from the browser. The system observer is kept |
49 // in the browser process only so that any workarounds or blacklisting can | 49 // in the browser process only so that any workarounds or blacklisting can |
50 // be applied there. | 50 // be applied there. |
51 void NotifyGpuSwitched(); | 51 void NotifyGpuSwitched(); |
52 | 52 |
53 private: | 53 private: |
54 friend struct DefaultSingletonTraits<GpuSwitchingManager>; | 54 friend struct base::DefaultSingletonTraits<GpuSwitchingManager>; |
55 | 55 |
56 GpuSwitchingManager(); | 56 GpuSwitchingManager(); |
57 virtual ~GpuSwitchingManager(); | 57 virtual ~GpuSwitchingManager(); |
58 | 58 |
59 #if defined(OS_MACOSX) | 59 #if defined(OS_MACOSX) |
60 void SwitchToDiscreteGpuMac(); | 60 void SwitchToDiscreteGpuMac(); |
61 #endif // OS_MACOSX | 61 #endif // OS_MACOSX |
62 | 62 |
63 gfx::GpuPreference gpu_switching_option_; | 63 gfx::GpuPreference gpu_switching_option_; |
64 bool gpu_switching_option_set_; | 64 bool gpu_switching_option_set_; |
65 | 65 |
66 std::vector<uint32> vendor_ids_; | 66 std::vector<uint32> vendor_ids_; |
67 | 67 |
68 bool supports_dual_gpus_; | 68 bool supports_dual_gpus_; |
69 bool supports_dual_gpus_set_; | 69 bool supports_dual_gpus_set_; |
70 | 70 |
71 struct PlatformSpecific; | 71 struct PlatformSpecific; |
72 scoped_ptr<PlatformSpecific> platform_specific_; | 72 scoped_ptr<PlatformSpecific> platform_specific_; |
73 | 73 |
74 base::ObserverList<GpuSwitchingObserver> observer_list_; | 74 base::ObserverList<GpuSwitchingObserver> observer_list_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(GpuSwitchingManager); | 76 DISALLOW_COPY_AND_ASSIGN(GpuSwitchingManager); |
77 }; | 77 }; |
78 | 78 |
79 } // namespace ui | 79 } // namespace ui |
80 | 80 |
81 #endif // UI_GL_GPU_SWITCHING_MANAGER_H_ | 81 #endif // UI_GL_GPU_SWITCHING_MANAGER_H_ |
OLD | NEW |