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

Side by Side Diff: ui/gl/gl_surface_ios.mm

Issue 1183213007: Fix offscreen rendering on iOS by not assuming that the default window bound framebuffer is 0 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 months 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
« ui/gl/gl_surface_ios.h ('K') | « ui/gl/gl_surface_ios.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« ui/gl/gl_surface_ios.h ('K') | « ui/gl/gl_surface_ios.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698