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

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

Issue 10959050: Honor --gpu-switching=force_discrete to always stay on discrete GPU. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « ui/gl/gpu_switching_manager.h ('k') | no next file » | 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 #include "ui/gl/gpu_switching_manager.h" 5 #include "ui/gl/gpu_switching_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace gfx { 9 namespace gfx {
10 10
(...skipping 16 matching lines...) Expand all
27 void GpuSwitchingManager::ForceUseOfDiscreteGpu() { 27 void GpuSwitchingManager::ForceUseOfDiscreteGpu() {
28 gpu_switching_option_.clear(); 28 gpu_switching_option_.clear();
29 gpu_switching_option_.push_back(PreferDiscreteGpu); 29 gpu_switching_option_.push_back(PreferDiscreteGpu);
30 } 30 }
31 31
32 GpuPreference GpuSwitchingManager::AdjustGpuPreference( 32 GpuPreference GpuSwitchingManager::AdjustGpuPreference(
33 GpuPreference gpu_preference) { 33 GpuPreference gpu_preference) {
34 if (gpu_switching_option_.size() == 0) 34 if (gpu_switching_option_.size() == 0)
35 return gpu_preference; 35 return gpu_preference;
36 DCHECK_EQ(gpu_switching_option_.size(), 1u); 36 DCHECK_EQ(gpu_switching_option_.size(), 1u);
37 #if defined(OS_MACOSX)
38 // Create a pixel format that lasts the lifespan of Chrome, so Chrome
39 // stays on the discrete GPU.
40 if (gpu_switching_option_[0] == PreferDiscreteGpu)
41 GLContextCGL::ForceUseOfDiscreteGPU();
42 #endif // OS_MACOSX
37 return gpu_switching_option_[0]; 43 return gpu_switching_option_[0];
38 } 44 }
39 45
40 } // namespace gfx 46 } // namespace gfx
47
OLDNEW
« no previous file with comments | « ui/gl/gpu_switching_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698