Index: webkit/gpu/webgraphicscontext3d_in_process_impl.cc |
=================================================================== |
--- webkit/gpu/webgraphicscontext3d_in_process_impl.cc (revision 85357) |
+++ webkit/gpu/webgraphicscontext3d_in_process_impl.cc (working copy) |
@@ -90,6 +90,7 @@ |
glDeleteFramebuffersEXT(1, &fbo_); |
gl_context_->Destroy(); |
+ gl_surface_->Destroy(); |
for (ShaderSourceMap::iterator ii = shader_source_map_.begin(); |
ii != shader_source_map_.end(); ++ii) { |
@@ -133,9 +134,9 @@ |
// and from there to the window, and WebViewImpl::paint already |
// correctly handles the case where the compositor is active but |
// the output needs to go to a WebCanvas. |
- scoped_ptr<gfx::GLSurface> surface(gfx::GLSurface::CreateOffscreenGLSurface( |
+ gl_surface_.reset(gfx::GLSurface::CreateOffscreenGLSurface( |
gfx::Size(1, 1))); |
- if (!surface.get()) { |
+ if (!gl_surface_.get()) { |
if (!is_gles2_) |
return false; |
@@ -147,13 +148,13 @@ |
// and force them to drop their contexts, sending a context lost event if |
// necessary. |
webView->mainFrame()->collectGarbage(); |
- surface.reset(gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1))); |
- if (!surface.get()) |
+ gl_surface_.reset( |
+ gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1))); |
+ if (!gl_surface_.get()) |
return false; |
} |
- gl_context_.reset(gfx::GLContext::CreateGLContext(surface.release(), |
- share_context)); |
+ gl_context_.reset(gfx::GLContext::CreateGLContext(share_context)); |
if (!gl_context_.get()) |
return false; |
@@ -170,7 +171,7 @@ |
if (render_directly_to_web_view) |
attributes_.antialias = false; |
- if (!gl_context_->MakeCurrent()) { |
+ if (!gl_context_->MakeCurrent(gl_surface_.get())) { |
gl_context_.reset(); |
return false; |
} |
@@ -265,7 +266,7 @@ |
} |
bool WebGraphicsContext3DInProcessImpl::makeContextCurrent() { |
- return gl_context_->MakeCurrent(); |
+ return gl_context_->MakeCurrent(gl_surface_.get()); |
} |
int WebGraphicsContext3DInProcessImpl::width() { |