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

Unified Diff: content/common/gpu/client/gl_helper_scaling.cc

Issue 1160863007: DCHECK if shader compilation fails that it's due to context loss. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: glhelperlost: . Created 5 years, 6 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 | « content/common/gpu/client/command_buffer_proxy_impl.cc ('k') | gpu/GLES2/gl2chromium_autogen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/client/gl_helper_scaling.cc
diff --git a/content/common/gpu/client/gl_helper_scaling.cc b/content/common/gpu/client/gl_helper_scaling.cc
index b248d9d92048e0ebbde1ef2490405963a0b9c18a..7b7338dc07e1ec5db68e7b31ec664a6588f47c57 100644
--- a/content/common/gpu/client/gl_helper_scaling.cc
+++ b/content/common/gpu/client/gl_helper_scaling.cc
@@ -870,15 +870,8 @@ void ShaderProgram::Setup(const GLchar* vertex_shader_text,
// The only reason fetching these attribute locations should fail is
// if the context was spontaneously lost (i.e., because the GPU
// process crashed, perhaps deliberately for testing).
- // Unfortunately, the only way to reliably detect context loss from
- // GLES2Interface would be to repeatedly call GetError(), and this
- // seems fragile. Most of the APIs in GLHelper should be updated to
- // be able to return an error. Fortunately, many users of this code
- // check for context loss at a higher level.
- if (!Initialized()) {
- LOG(ERROR) << "ShaderProgram::Setup: initialization failed (context lost?)";
- }
- return;
+ DCHECK_IMPLIES(!Initialized(),
+ gl_->GetGraphicsResetStatusKHR() != GL_NO_ERROR);
}
void ShaderProgram::UseProgram(const gfx::Size& src_size,
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.cc ('k') | gpu/GLES2/gl2chromium_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698