Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1040)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 657003002: Cause GPU process to exit upon lost context in more circumstances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698