OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ui/gfx/gl/gl_context.h" | |
6 | |
7 #include "base/logging.h" | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "ui/gfx/gl/gl_bindings.h" | |
10 #include "ui/gfx/gl/gl_context_egl.h" | |
11 #include "ui/gfx/gl/gl_context_stub.h" | |
12 #include "ui/gfx/gl/gl_implementation.h" | |
13 #include "ui/gfx/gl/gl_surface_egl.h" | |
14 #include "ui/gfx/gl/gl_surface_stub.h" | |
15 | |
jonathan.backer
2011/07/26 14:56:27
Do you need all of these includes? I doubt you nee
| |
16 namespace gfx { | |
17 | |
18 class GLShareGroup; | |
19 | |
20 scoped_refptr<GLContext> GLContext::CreateGLContext( | |
21 GLShareGroup* share_group, | |
22 GLSurface* compatible_surface) { | |
23 switch (GetGLImplementation()) { | |
24 case kGLImplementationEGLGLES2: { | |
25 scoped_refptr<GLContext> context(new GLContextEGL(share_group)); | |
26 if (!context->Initialize(compatible_surface)) | |
27 return NULL; | |
28 | |
29 return context; | |
30 } | |
31 case kGLImplementationMockGL: | |
32 return new GLContextStub; | |
33 default: | |
34 NOTREACHED(); | |
35 return NULL; | |
36 } | |
37 } | |
38 | |
39 } // namespace gfx | |
OLD | NEW |