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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 126 } |
127 case kGLImplementationMockGL: | 127 case kGLImplementationMockGL: |
128 return new GLSurfaceStub; | 128 return new GLSurfaceStub; |
129 default: | 129 default: |
130 NOTREACHED(); | 130 NOTREACHED(); |
131 return NULL; | 131 return NULL; |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface( | 135 scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface( |
136 const gfx::Size& size, | 136 const gfx::Size& size) { |
137 GLSurface::Format format) { | |
138 TRACE_EVENT0("gpu", "GLSurface::CreateOffscreenGLSurface"); | 137 TRACE_EVENT0("gpu", "GLSurface::CreateOffscreenGLSurface"); |
139 switch (GetGLImplementation()) { | 138 switch (GetGLImplementation()) { |
140 case kGLImplementationOSMesaGL: { | 139 case kGLImplementationOSMesaGL: { |
141 scoped_refptr<GLSurface> surface( | 140 scoped_refptr<GLSurface> surface( |
142 new GLSurfaceOSMesa(OSMesaSurfaceFormatRGBA, size)); | 141 new GLSurfaceOSMesa(SURFACE_OSMESA_RGBA, size)); |
143 if (!surface->Initialize(format)) | 142 if (!surface->Initialize()) |
144 return NULL; | 143 return NULL; |
145 | 144 |
146 return surface; | 145 return surface; |
147 } | 146 } |
148 case kGLImplementationDesktopGL: | 147 case kGLImplementationDesktopGL: |
149 case kGLImplementationDesktopGLCoreProfile: | 148 case kGLImplementationDesktopGLCoreProfile: |
150 case kGLImplementationAppleGL: { | 149 case kGLImplementationAppleGL: { |
151 scoped_refptr<GLSurface> surface(new NoOpGLSurface(size)); | 150 scoped_refptr<GLSurface> surface(new NoOpGLSurface(size)); |
152 if (!surface->Initialize(format)) | 151 if (!surface->Initialize()) |
153 return NULL; | 152 return NULL; |
154 | 153 |
155 return surface; | 154 return surface; |
156 } | 155 } |
157 case kGLImplementationMockGL: | 156 case kGLImplementationMockGL: |
158 return new GLSurfaceStub; | 157 return new GLSurfaceStub; |
159 default: | 158 default: |
160 NOTREACHED(); | 159 NOTREACHED(); |
161 return NULL; | 160 return NULL; |
162 } | 161 } |
163 } | 162 } |
164 | 163 |
165 } // namespace gfx | 164 } // namespace gfx |
OLD | NEW |