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

Side by Side Diff: ui/gl/gpu_switching_manager.h

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 | « content/browser/gpu/gpu_data_manager_impl_private.cc ('k') | ui/gl/gpu_switching_manager.cc » ('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) 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 18 matching lines...) Expand all
29 // If no GPU is forced, return the original GpuPreference; otherwise, return 29 // If no GPU is forced, return the original GpuPreference; otherwise, return
30 // the forced GPU. 30 // the forced GPU.
31 gfx::GpuPreference AdjustGpuPreference(gfx::GpuPreference gpu_preference); 31 gfx::GpuPreference AdjustGpuPreference(gfx::GpuPreference gpu_preference);
32 32
33 // In the browser process, the value for this flag is computed the first time 33 // In the browser process, the value for this flag is computed the first time
34 // this function is called. 34 // this function is called.
35 // In the GPU process, the value is passed from the browser process using the 35 // In the GPU process, the value is passed from the browser process using the
36 // --supports-dual-gpus commandline switch. 36 // --supports-dual-gpus commandline switch.
37 bool SupportsDualGpus(); 37 bool SupportsDualGpus();
38 38
39 void SetGpuCount(size_t gpu_count); 39 // Sets the vendor IDs of the GPUs on the system. The length of this
40 // vector defines the count of GPUs.
41 void SetGpuVendorIds(const std::vector<uint32>& vendor_ids);
40 42
41 void AddObserver(GpuSwitchingObserver* observer); 43 void AddObserver(GpuSwitchingObserver* observer);
42 void RemoveObserver(GpuSwitchingObserver* observer); 44 void RemoveObserver(GpuSwitchingObserver* observer);
43 45
44 // 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
45 // 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
46 // 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
47 // 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
48 // be applied there. 50 // be applied there.
49 void NotifyGpuSwitched(); 51 void NotifyGpuSwitched();
50 52
51 private: 53 private:
52 friend struct DefaultSingletonTraits<GpuSwitchingManager>; 54 friend struct DefaultSingletonTraits<GpuSwitchingManager>;
53 55
54 GpuSwitchingManager(); 56 GpuSwitchingManager();
55 virtual ~GpuSwitchingManager(); 57 virtual ~GpuSwitchingManager();
56 58
57 #if defined(OS_MACOSX) 59 #if defined(OS_MACOSX)
58 void SwitchToDiscreteGpuMac(); 60 void SwitchToDiscreteGpuMac();
59 #endif // OS_MACOSX 61 #endif // OS_MACOSX
60 62
61 gfx::GpuPreference gpu_switching_option_; 63 gfx::GpuPreference gpu_switching_option_;
62 bool gpu_switching_option_set_; 64 bool gpu_switching_option_set_;
63 65
66 std::vector<uint32> vendor_ids_;
67
64 bool supports_dual_gpus_; 68 bool supports_dual_gpus_;
65 bool supports_dual_gpus_set_; 69 bool supports_dual_gpus_set_;
66 70
67 size_t gpu_count_;
68
69 struct PlatformSpecific; 71 struct PlatformSpecific;
70 scoped_ptr<PlatformSpecific> platform_specific_; 72 scoped_ptr<PlatformSpecific> platform_specific_;
71 73
72 ObserverList<GpuSwitchingObserver> observer_list_; 74 ObserverList<GpuSwitchingObserver> observer_list_;
73 75
74 DISALLOW_COPY_AND_ASSIGN(GpuSwitchingManager); 76 DISALLOW_COPY_AND_ASSIGN(GpuSwitchingManager);
75 }; 77 };
76 78
77 } // namespace ui 79 } // namespace ui
78 80
79 #endif // UI_GL_GPU_SWITCHING_MANAGER_H_ 81 #endif // UI_GL_GPU_SWITCHING_MANAGER_H_
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.cc ('k') | ui/gl/gpu_switching_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698