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

Side by Side Diff: ui/gl/gl_context_mac.mm

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/gl_context_cgl.cc ('k') | ui/gl/gl_switches.h » ('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 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/mac/mac_util.h" 9 #include "base/mac/mac_util.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // system stability issues. http://crbug.com/113703 143 // system stability issues. http://crbug.com/113703
144 std::string model; 144 std::string model;
145 int32 model_major, model_minor; 145 int32 model_major, model_minor;
146 if (!base::mac::ParseModelIdentifier(base::mac::GetModelIdentifier(), 146 if (!base::mac::ParseModelIdentifier(base::mac::GetModelIdentifier(),
147 &model, &model_major, &model_minor)) { 147 &model, &model_major, &model_minor)) {
148 return false; 148 return false;
149 } 149 }
150 150
151 const int kMacBookProFirstDualAMDIntelGPUModel = 8; 151 const int kMacBookProFirstDualAMDIntelGPUModel = 8;
152 152
153 // Do not overwrite commandline switches to honor a user's decision.
153 bool forcibly_disable = 154 bool forcibly_disable =
154 ((model == "MacBookPro") && 155 ((model == "MacBookPro") &&
155 (model_major < kMacBookProFirstDualAMDIntelGPUModel)) || 156 (model_major < kMacBookProFirstDualAMDIntelGPUModel)) &&
156 CommandLine::ForCurrentProcess()->HasSwitch( 157 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kGpuSwitching);
157 switches::kDisableGpuSwitching);
158 158
159 if (forcibly_disable) { 159 if (forcibly_disable) {
160 GpuSwitchingManager::GetInstance()->ForceUseOfDiscreteGpu(); 160 GpuSwitchingManager::GetInstance()->ForceUseOfDiscreteGpu();
161 return false; 161 return false;
162 } 162 }
163 163
164 supports_dual_gpus = true; 164 supports_dual_gpus = true;
165 } 165 }
166 166
167 return supports_dual_gpus; 167 return supports_dual_gpus;
168 } 168 }
169 169
170 } // namespace gfx 170 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_context_cgl.cc ('k') | ui/gl/gl_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698