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

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

Issue 1998723002: Move code in ui/gl/* from gfx:: to gl:: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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 | « ui/gl/gpu_preference.h ('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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 15 matching lines...) Expand all
26 static GpuSwitchingManager* GetInstance(); 26 static GpuSwitchingManager* GetInstance();
27 27
28 // Set the switching option to PreferIntegratedGpu. 28 // Set the switching option to PreferIntegratedGpu.
29 void ForceUseOfIntegratedGpu(); 29 void ForceUseOfIntegratedGpu();
30 // Set the switching option to PreferDiscreteGpu; switch to discrete GPU 30 // Set the switching option to PreferDiscreteGpu; switch to discrete GPU
31 // immediately on Mac where dual GPU switching is supported. 31 // immediately on Mac where dual GPU switching is supported.
32 void ForceUseOfDiscreteGpu(); 32 void ForceUseOfDiscreteGpu();
33 33
34 // If no GPU is forced, return the original GpuPreference; otherwise, return 34 // If no GPU is forced, return the original GpuPreference; otherwise, return
35 // the forced GPU. 35 // the forced GPU.
36 gfx::GpuPreference AdjustGpuPreference(gfx::GpuPreference gpu_preference); 36 gl::GpuPreference AdjustGpuPreference(gl::GpuPreference gpu_preference);
37 37
38 // In the browser process, the value for this flag is computed the first time 38 // In the browser process, the value for this flag is computed the first time
39 // this function is called. 39 // this function is called.
40 // In the GPU process, the value is passed from the browser process using the 40 // In the GPU process, the value is passed from the browser process using the
41 // --supports-dual-gpus commandline switch. 41 // --supports-dual-gpus commandline switch.
42 bool SupportsDualGpus(); 42 bool SupportsDualGpus();
43 43
44 // Sets the vendor IDs of the GPUs on the system. The length of this 44 // Sets the vendor IDs of the GPUs on the system. The length of this
45 // vector defines the count of GPUs. 45 // vector defines the count of GPUs.
46 void SetGpuVendorIds(const std::vector<uint32_t>& vendor_ids); 46 void SetGpuVendorIds(const std::vector<uint32_t>& vendor_ids);
(...skipping 11 matching lines...) Expand all
58 private: 58 private:
59 friend struct base::DefaultSingletonTraits<GpuSwitchingManager>; 59 friend struct base::DefaultSingletonTraits<GpuSwitchingManager>;
60 60
61 GpuSwitchingManager(); 61 GpuSwitchingManager();
62 virtual ~GpuSwitchingManager(); 62 virtual ~GpuSwitchingManager();
63 63
64 #if defined(OS_MACOSX) 64 #if defined(OS_MACOSX)
65 void SwitchToDiscreteGpuMac(); 65 void SwitchToDiscreteGpuMac();
66 #endif // OS_MACOSX 66 #endif // OS_MACOSX
67 67
68 gfx::GpuPreference gpu_switching_option_; 68 gl::GpuPreference gpu_switching_option_;
69 bool gpu_switching_option_set_; 69 bool gpu_switching_option_set_;
70 70
71 std::vector<uint32_t> vendor_ids_; 71 std::vector<uint32_t> vendor_ids_;
72 72
73 bool supports_dual_gpus_; 73 bool supports_dual_gpus_;
74 bool supports_dual_gpus_set_; 74 bool supports_dual_gpus_set_;
75 75
76 struct PlatformSpecific; 76 struct PlatformSpecific;
77 std::unique_ptr<PlatformSpecific> platform_specific_; 77 std::unique_ptr<PlatformSpecific> platform_specific_;
78 78
79 base::ObserverList<GpuSwitchingObserver> observer_list_; 79 base::ObserverList<GpuSwitchingObserver> observer_list_;
80 80
81 DISALLOW_COPY_AND_ASSIGN(GpuSwitchingManager); 81 DISALLOW_COPY_AND_ASSIGN(GpuSwitchingManager);
82 }; 82 };
83 83
84 } // namespace ui 84 } // namespace ui
85 85
86 #endif // UI_GL_GPU_SWITCHING_MANAGER_H_ 86 #endif // UI_GL_GPU_SWITCHING_MANAGER_H_
OLDNEW
« no previous file with comments | « ui/gl/gpu_preference.h ('k') | ui/gl/gpu_switching_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698