| 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 "ui/gl/gl_surface.h" | 5 #include "ui/gl/gl_surface.h" |
| 6 | 6 |
| 7 #include <OpenGL/CGLRenderers.h> | 7 #include <OpenGL/CGLRenderers.h> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface( | 110 scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface( |
| 111 gfx::AcceleratedWidget window) { | 111 gfx::AcceleratedWidget window) { |
| 112 TRACE_EVENT0("gpu", "GLSurface::CreateViewGLSurface"); | 112 TRACE_EVENT0("gpu", "GLSurface::CreateViewGLSurface"); |
| 113 switch (GetGLImplementation()) { | 113 switch (GetGLImplementation()) { |
| 114 case kGLImplementationDesktopGL: | 114 case kGLImplementationDesktopGL: |
| 115 case kGLImplementationAppleGL: { | 115 case kGLImplementationAppleGL: { |
| 116 NOTIMPLEMENTED() << "No onscreen support on Mac."; | 116 NOTIMPLEMENTED() << "No onscreen support on Mac."; |
| 117 return NULL; | 117 return NULL; |
| 118 } | 118 } |
| 119 case kGLImplementationOSMesaGL: { |
| 120 scoped_refptr<GLSurface> surface(new GLSurfaceOSMesaHeadless()); |
| 121 if (!surface->Initialize()) |
| 122 return NULL; |
| 123 return surface; |
| 124 } |
| 119 case kGLImplementationMockGL: | 125 case kGLImplementationMockGL: |
| 120 return new GLSurfaceStub; | 126 return new GLSurfaceStub; |
| 121 default: | 127 default: |
| 122 NOTREACHED(); | 128 NOTREACHED(); |
| 123 return NULL; | 129 return NULL; |
| 124 } | 130 } |
| 125 } | 131 } |
| 126 | 132 |
| 127 scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface( | 133 scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface( |
| 128 const gfx::Size& size) { | 134 const gfx::Size& size) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 146 } | 152 } |
| 147 case kGLImplementationMockGL: | 153 case kGLImplementationMockGL: |
| 148 return new GLSurfaceStub; | 154 return new GLSurfaceStub; |
| 149 default: | 155 default: |
| 150 NOTREACHED(); | 156 NOTREACHED(); |
| 151 return NULL; | 157 return NULL; |
| 152 } | 158 } |
| 153 } | 159 } |
| 154 | 160 |
| 155 } // namespace gfx | 161 } // namespace gfx |
| OLD | NEW |