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

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

Issue 8687016: GLContextNSView should not assume concrete type GLSurface is GLSurfaceNSView (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | « no previous file | ui/gfx/gl/gl_context_nsview.mm » ('j') | ui/gfx/gl/gl_surface_nsview.mm » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 25 matching lines...) Expand all
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 scoped_refptr<GLContext> context; 44 scoped_refptr<GLContext> context;
45 #if defined(USE_AURA) 45 #if defined(USE_AURA)
46 DCHECK(!compatible_surface->IsOffscreen()); 46 if (compatible_surface->IsOffscreen())
47 context = new GLContextNSView(share_group); 47 context = new GLContextCGL(share_group);
48 else
49 context = new GLContextNSView(share_group);
50 #else
51 context = new GLContextCGL(share_group);
52 #endif // USE_AURA
48 if (!context->Initialize(compatible_surface, gpu_preference)) 53 if (!context->Initialize(compatible_surface, gpu_preference))
49 return NULL; 54 return NULL;
50 #else
51 context = new GLContextCGL(share_group);
52 if (!context->Initialize(compatible_surface, gpu_preference))
53 return NULL;
54 #endif // USE_AURA
55 55
56 return context; 56 return context;
57 } 57 }
58 case kGLImplementationOSMesaGL: { 58 case kGLImplementationOSMesaGL: {
59 scoped_refptr<GLContext> context(new GLContextOSMesa(share_group)); 59 scoped_refptr<GLContext> context(new GLContextOSMesa(share_group));
60 if (!context->Initialize(compatible_surface, gpu_preference)) 60 if (!context->Initialize(compatible_surface, gpu_preference))
61 return NULL; 61 return NULL;
62 62
63 return context; 63 return context;
64 } 64 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } 145 }
146 146
147 if (found_online && found_offline) { 147 if (found_online && found_offline) {
148 supports_dual_gpus = true; 148 supports_dual_gpus = true;
149 } 149 }
150 150
151 return supports_dual_gpus; 151 return supports_dual_gpus;
152 } 152 }
153 153
154 } // namespace gfx 154 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/gl/gl_context_nsview.mm » ('j') | ui/gfx/gl/gl_surface_nsview.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698