| 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 #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" |
| 11 #include "third_party/mesa/MesaLib/include/GL/osmesa.h" | 11 #include "third_party/mesa/MesaLib/include/GL/osmesa.h" |
| 12 #include "ui/gl/gl_bindings.h" | 12 #include "ui/gl/gl_bindings.h" |
| 13 #include "ui/gl/gl_context_cgl.h" | 13 #include "ui/gl/gl_context_cgl.h" |
| 14 #include "ui/gl/gl_context_osmesa.h" | 14 #include "ui/gl/gl_context_osmesa.h" |
| 15 #include "ui/gl/gl_context_stub.h" | 15 #include "ui/gl/gl_context_stub.h" |
| 16 #include "ui/gl/gl_implementation.h" | 16 #include "ui/gl/gl_implementation.h" |
| 17 #include "ui/gl/gl_surface.h" | 17 #include "ui/gl/gl_surface.h" |
| 18 #include "ui/gl/gl_switches.h" | 18 #include "ui/gl/gl_switches.h" |
| 19 #include "ui/gl/gpu_switching_manager.h" | |
| 20 | 19 |
| 21 #if defined(USE_AURA) | 20 #if defined(USE_AURA) |
| 22 #include "ui/gl/gl_context_nsview.h" | 21 #include "ui/gl/gl_context_nsview.h" |
| 23 #endif | 22 #endif |
| 24 | 23 |
| 25 namespace gfx { | 24 namespace gfx { |
| 26 | 25 |
| 27 class GLShareGroup; | 26 class GLShareGroup; |
| 28 | 27 |
| 29 scoped_refptr<GLContext> GLContext::CreateGLContext( | 28 scoped_refptr<GLContext> GLContext::CreateGLContext( |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 149 |
| 151 const int kMacBookProFirstDualAMDIntelGPUModel = 8; | 150 const int kMacBookProFirstDualAMDIntelGPUModel = 8; |
| 152 | 151 |
| 153 // Do not overwrite commandline switches to honor a user's decision. | 152 // Do not overwrite commandline switches to honor a user's decision. |
| 154 bool forcibly_disable = | 153 bool forcibly_disable = |
| 155 ((model == "MacBookPro") && | 154 ((model == "MacBookPro") && |
| 156 (model_major < kMacBookProFirstDualAMDIntelGPUModel)) && | 155 (model_major < kMacBookProFirstDualAMDIntelGPUModel)) && |
| 157 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kGpuSwitching); | 156 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kGpuSwitching); |
| 158 | 157 |
| 159 if (forcibly_disable) { | 158 if (forcibly_disable) { |
| 160 GpuSwitchingManager::GetInstance()->ForceUseOfDiscreteGpu(); | 159 GLContextCGL::ForceUseOfDiscreteGPU(); |
| 161 return false; | 160 return false; |
| 162 } | 161 } |
| 163 | 162 |
| 164 supports_dual_gpus = true; | 163 supports_dual_gpus = true; |
| 165 } | 164 } |
| 166 | 165 |
| 167 return supports_dual_gpus; | 166 return supports_dual_gpus; |
| 168 } | 167 } |
| 169 | 168 |
| 170 } // namespace gfx | 169 } // namespace gfx |
| OLD | NEW |