OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/mac/scoped_nsautorelease_pool.h" | 5 #include "base/mac/scoped_nsautorelease_pool.h" |
6 #include "ui/gl/gl_surface_ios.h" | 6 #include "ui/gl/gl_surface_ios.h" |
7 #include "ui/gl/gl_context.h" | 7 #include "ui/gl/gl_context.h" |
8 #include "ui/gl/gl_enums.h" | 8 #include "ui/gl/gl_enums.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 }; | 211 }; |
212 | 212 |
213 framebuffer_setup_complete_ = true; | 213 framebuffer_setup_complete_ = true; |
214 } | 214 } |
215 | 215 |
216 bool GLSurfaceIOS::SwapBuffers() { | 216 bool GLSurfaceIOS::SwapBuffers() { |
217 glBindRenderbuffer(GL_RENDERBUFFER, colorbuffer_); | 217 glBindRenderbuffer(GL_RENDERBUFFER, colorbuffer_); |
218 return [[EAGLContext currentContext] presentRenderbuffer:GL_RENDERBUFFER]; | 218 return [[EAGLContext currentContext] presentRenderbuffer:GL_RENDERBUFFER]; |
219 } | 219 } |
220 | 220 |
| 221 unsigned int GLSurfaceIOS::GetBackingFrameBufferObject() { |
| 222 return framebuffer_; |
| 223 } |
| 224 |
221 void GLSurfaceIOS::Destroy() { | 225 void GLSurfaceIOS::Destroy() { |
222 DCHECK(glGetError() == GL_NO_ERROR); | 226 DCHECK(glGetError() == GL_NO_ERROR); |
223 | 227 |
224 glDeleteFramebuffers(1, &framebuffer_); | 228 glDeleteFramebuffers(1, &framebuffer_); |
225 glDeleteRenderbuffers(1, &colorbuffer_); | 229 glDeleteRenderbuffers(1, &colorbuffer_); |
226 // Deletes on GL_NONEs are ignored | 230 // Deletes on GL_NONEs are ignored |
227 glDeleteRenderbuffers(1, &depthbuffer_); | 231 glDeleteRenderbuffers(1, &depthbuffer_); |
228 glDeleteRenderbuffers(1, &stencilbuffer_); | 232 glDeleteRenderbuffers(1, &stencilbuffer_); |
229 glDeleteRenderbuffers(1, &depth_stencil_packed_buffer_); | 233 glDeleteRenderbuffers(1, &depth_stencil_packed_buffer_); |
230 | 234 |
(...skipping 28 matching lines...) Expand all Loading... |
259 scoped_refptr<GLSurfaceIOS> surface = | 263 scoped_refptr<GLSurfaceIOS> surface = |
260 new GLSurfaceIOS(window, requested_configuration); | 264 new GLSurfaceIOS(window, requested_configuration); |
261 | 265 |
262 if (!surface->Initialize()) | 266 if (!surface->Initialize()) |
263 return NULL; | 267 return NULL; |
264 | 268 |
265 return surface; | 269 return surface; |
266 } | 270 } |
267 | 271 |
268 } // namespace gfx | 272 } // namespace gfx |
OLD | NEW |