Index: ui/gfx/compositor/compositor_gl.cc |
=================================================================== |
--- ui/gfx/compositor/compositor_gl.cc (revision 85357) |
+++ ui/gfx/compositor/compositor_gl.cc (working copy) |
@@ -30,6 +30,7 @@ |
virtual void NotifyEnd() OVERRIDE; |
// The GL context used for compositing. |
+ scoped_ptr<gfx::GLSurface> gl_surface_; |
scoped_ptr<gfx::GLContext> gl_context_; |
// Keep track of whether compositing has started or not. |
@@ -40,9 +41,8 @@ |
CompositorGL::CompositorGL(gfx::AcceleratedWidget widget) |
: started_(false) { |
- scoped_ptr<gfx::GLSurface> surface( |
- gfx::GLSurface::CreateViewGLSurface(widget)); |
- gl_context_.reset(gfx::GLContext::CreateGLContext(surface.release(), NULL)), |
+ gl_surface_.reset(gfx::GLSurface::CreateViewGLSurface(widget)); |
+ gl_context_.reset(gfx::GLContext::CreateGLContext(NULL)), |
} |
Texture* CompositorGL::CreateTexture() { |
@@ -51,12 +51,12 @@ |
void CompositorGL::NotifyStart() { |
started_ = true; |
- gl_context_->MakeCurrent(); |
+ gl_context_->MakeCurrent(gl_surface_.get()); |
} |
void CompositorGL::NotifyEnd() { |
DCHECK(started_); |
- gl_context_->SwapBuffers(); |
+ gl_surface_->SwapBuffers(); |
started_ = false; |
} |
@@ -83,6 +83,7 @@ |
void RestoreTransform() OVERRIDE; |
// The GL context used for compositing. |
+ scoped_ptr<gfx::GLSurface> gl_surface_; |
scoped_ptr<gfx::GLContext> gl_context_; |
// Keep track of whether compositing has started or not. |
@@ -93,19 +94,18 @@ |
CompositorGL::CompositorGL(gfx::AcceleratedWidget widget) |
: started_(false) { |
- scoped_ptr<gfx::GLSurface> surface( |
- gfx::GLSurface::CreateViewGLSurface(widget)); |
- gl_context_.reset(gfx::GLContext::CreateGLContext(surface.release(), NULL)); |
+ gl_surface_.reset(gfx::GLSurface::CreateViewGLSurface(widget)); |
+ gl_context_.reset(gfx::GLContext::CreateGLContext(NULL)); |
} |
void CompositorGL::NotifyStart() { |
started_ = true; |
- gl_context_->MakeCurrent(); |
+ gl_context_->MakeCurrent(gl_surface_.get()); |
} |
void CompositorGL::NotifyEnd() { |
DCHECK(started_); |
- gl_context_->SwapBuffers(); |
+ gl_surface_->SwapBuffers(); |
started_ = false; |
} |