Chromium Code Reviews| Index: webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc |
| diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc |
| index d7ae282dc66a01a7dbbc9120c943596c3c627af3..b4b665a9faadfea446def688ad242f157d859ec3 100644 |
| --- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc |
| +++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc |
| @@ -144,6 +144,10 @@ class GLInProcessContext : public base::SupportsWeakPtr<GLInProcessContext> { |
| CommandBufferService* GetCommandBufferService(); |
| + void set_context_lost_reason(WGC3Denum reason) { |
| + context_lost_reason_ = reason; |
| + } |
| + |
| private: |
| explicit GLInProcessContext(GLInProcessContext* parent); |
| @@ -169,6 +173,7 @@ class GLInProcessContext : public base::SupportsWeakPtr<GLInProcessContext> { |
| scoped_ptr<TransferBuffer> transfer_buffer_; |
| scoped_ptr<GLES2Implementation> gles2_implementation_; |
| Error last_error_; |
| + WGC3Denum context_lost_reason_; |
| DISALLOW_COPY_AND_ASSIGN(GLInProcessContext); |
| }; |
| @@ -246,7 +251,8 @@ void GLInProcessContext::PumpCommands() { |
| decoder_->MakeCurrent(); |
| gpu_scheduler_->PutChanged(); |
| ::gpu::CommandBuffer::State state = command_buffer_->GetState(); |
| - CHECK(state.error == ::gpu::error::kNoError); |
| + if (!context_lost_reason_) |
| + CHECK(state.error == ::gpu::error::kNoError); |
| } |
| bool GLInProcessContext::GetBufferChanged(int32 transfer_buffer_id) { |
| @@ -1657,6 +1663,14 @@ WGC3Dboolean WebGraphicsContext3DInProcessCommandBufferImpl:: |
| return gl_->UnmapBufferCHROMIUM(target); |
| } |
| +void WebGraphicsContext3DInProcessCommandBufferImpl::loseContextCHROMIUM( |
| + WGC3Denum current, WGC3Denum other) { |
| + ClearContext(); |
| + gl_->LoseContextCHROMIUM(current, other); |
| + context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; |
| + context_->set_context_lost_reason(context_lost_reason_); |
|
jamesr
2012/12/18 05:40:11
why do we need to store the context loss reason on
danakj
2012/12/18 21:26:59
Done.
|
| +} |
| + |
| GrGLInterface* WebGraphicsContext3DInProcessCommandBufferImpl:: |
| onCreateGrGLInterface() { |
| return CreateCommandBufferSkiaGLBinding(); |