| Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| index 20c4da8efce5dea9ded6e230dde087e69c9cf0b9..93b8517714c3cdf48a5bef0282909178a6c01007 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| @@ -1571,6 +1571,7 @@ class GLES2DecoderImpl : public GLES2Decoder,
|
| error::Error* error, GLint* real_location, GLuint* service_id,
|
| void** result, GLenum* result_type);
|
|
|
| + void MaybeExitOnContextLost();
|
| virtual bool WasContextLost() override;
|
| virtual bool WasContextLostByRobustnessExtension() override;
|
| virtual void LoseContext(uint32 reset_status) override;
|
| @@ -3051,16 +3052,7 @@ bool GLES2DecoderImpl::MakeCurrent() {
|
| if (!context_->MakeCurrent(surface_.get()) || WasContextLost()) {
|
| LOG(ERROR) << " GLES2DecoderImpl: Context lost during MakeCurrent.";
|
|
|
| - // Some D3D drivers cannot recover from device lost in the GPU process
|
| - // sandbox. Allow a new GPU process to launch.
|
| - if (workarounds().exit_on_context_lost) {
|
| - LOG(ERROR) << "Exiting GPU process because some drivers cannot reset"
|
| - << " a D3D device in the Chrome GPU process sandbox.";
|
| -#if defined(OS_WIN)
|
| - base::win::SetShouldCrashOnProcessDetach(false);
|
| -#endif
|
| - exit(0);
|
| - }
|
| + MaybeExitOnContextLost();
|
|
|
| return false;
|
| }
|
| @@ -9660,8 +9652,22 @@ error::ContextLostReason GLES2DecoderImpl::GetContextLostReason() {
|
| return error::kUnknown;
|
| }
|
|
|
| +void GLES2DecoderImpl::MaybeExitOnContextLost() {
|
| + // Some D3D drivers cannot recover from device lost in the GPU process
|
| + // sandbox. Allow a new GPU process to launch.
|
| + if (workarounds().exit_on_context_lost) {
|
| + LOG(ERROR) << "Exiting GPU process because some drivers cannot reset"
|
| + << " a D3D device in the Chrome GPU process sandbox.";
|
| +#if defined(OS_WIN)
|
| + base::win::SetShouldCrashOnProcessDetach(false);
|
| +#endif
|
| + exit(0);
|
| + }
|
| +}
|
| +
|
| bool GLES2DecoderImpl::WasContextLost() {
|
| if (reset_status_ != GL_NO_ERROR) {
|
| + MaybeExitOnContextLost();
|
| return true;
|
| }
|
| if (context_->WasAllocatedUsingRobustnessExtension()) {
|
| @@ -9675,6 +9681,7 @@ bool GLES2DecoderImpl::WasContextLost() {
|
| LOG(ERROR) << (surface_->IsOffscreen() ? "Offscreen" : "Onscreen")
|
| << " context lost via ARB/EXT_robustness. Reset status = "
|
| << GLES2Util::GetStringEnum(status);
|
| + MaybeExitOnContextLost();
|
| return true;
|
| }
|
| }
|
|
|