OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/logging.h" | 6 #include "base/logging.h" |
7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
8 #include "base/memory/scoped_generic_obj.h" | 8 #include "base/memory/scoped_generic_obj.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "third_party/mesa/MesaLib/include/GL/osmesa.h" | 10 #include "third_party/mesa/MesaLib/include/GL/osmesa.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 namespace gfx { | 34 namespace gfx { |
35 | 35 |
36 class GLShareGroup; | 36 class GLShareGroup; |
37 | 37 |
38 scoped_refptr<GLContext> GLContext::CreateGLContext( | 38 scoped_refptr<GLContext> GLContext::CreateGLContext( |
39 GLShareGroup* share_group, | 39 GLShareGroup* share_group, |
40 GLSurface* compatible_surface, | 40 GLSurface* compatible_surface, |
41 GpuPreference gpu_preference) { | 41 GpuPreference gpu_preference) { |
42 switch (GetGLImplementation()) { | 42 switch (GetGLImplementation()) { |
43 case kGLImplementationDesktopGL: { | 43 case kGLImplementationDesktopGL: |
| 44 case kGLImplementationAppleGL: { |
44 scoped_refptr<GLContext> context; | 45 scoped_refptr<GLContext> context; |
45 #if defined(USE_AURA) | 46 #if defined(USE_AURA) |
46 if (compatible_surface->IsOffscreen()) | 47 if (compatible_surface->IsOffscreen()) |
47 context = new GLContextCGL(share_group); | 48 context = new GLContextCGL(share_group); |
48 else | 49 else |
49 context = new GLContextNSView(share_group); | 50 context = new GLContextNSView(share_group); |
50 #else | 51 #else |
51 context = new GLContextCGL(share_group); | 52 context = new GLContextCGL(share_group); |
52 #endif // USE_AURA | 53 #endif // USE_AURA |
53 if (!context->Initialize(compatible_surface, gpu_preference)) | 54 if (!context->Initialize(compatible_surface, gpu_preference)) |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 146 } |
146 | 147 |
147 if (found_online && found_offline) { | 148 if (found_online && found_offline) { |
148 supports_dual_gpus = true; | 149 supports_dual_gpus = true; |
149 } | 150 } |
150 | 151 |
151 return supports_dual_gpus; | 152 return supports_dual_gpus; |
152 } | 153 } |
153 | 154 |
154 } // namespace gfx | 155 } // namespace gfx |
OLD | NEW |