Chromium Code Reviews| Index: gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc |
| diff --git a/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc b/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc |
| index f8680781beff9246f84df2bf3e7f8de26f47858a..c7b24de9edc235c27637ef9927aed357a0ae7e51 100644 |
| --- a/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc |
| +++ b/gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc |
| @@ -68,6 +68,11 @@ WebGraphicsContext3DInProcessCommandBufferImpl:: |
| WebGraphicsContext3DInProcessCommandBufferImpl:: |
| ~WebGraphicsContext3DInProcessCommandBufferImpl() { |
| + if (real_gl_) { |
| + real_gl_->SetErrorMessageCallback( |
| + base::Callback<void(const char*, int32_t)>()); |
| + real_gl_->SetLostContextCallback(base::Closure()); |
| + } |
| } |
| size_t WebGraphicsContext3DInProcessCommandBufferImpl::GetMappedMemoryLimit() { |
| @@ -96,12 +101,7 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() { |
| ::gpu::GLInProcessContextSharedMemoryLimits(), nullptr, nullptr)); |
| } |
| - if (context_) { |
| - base::Closure context_lost_callback = base::Bind( |
| - &WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost, |
| - base::Unretained(this)); |
| - context_->SetContextLostCallback(context_lost_callback); |
| - } else { |
| + if (!context_) { |
| initialize_failed_ = true; |
| return false; |
| } |
| @@ -109,6 +109,16 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() { |
| real_gl_ = context_->GetImplementation(); |
| SetGLInterface(real_gl_); |
| + real_gl_->SetErrorMessageCallback(base::Bind( |
| + // This method is in WebGraphicsContext3DImpl. |
| + &WebGraphicsContext3DInProcessCommandBufferImpl::OnErrorMessage, |
|
danakj
2016/04/06 02:14:15
I started setting this here, but I don't think thi
|
| + // The callback is unset in the destructor. |
| + base::Unretained(this))); |
| + real_gl_->SetLostContextCallback( |
| + base::Bind(&WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost, |
| + // The callback is unset in the destructor. |
| + base::Unretained(this))); |
| + |
| real_gl_->TraceBeginCHROMIUM("WebGraphicsContext3D", |
| "InProcessContext"); |