| Index: android_webview/browser/scoped_app_gl_state_restore.cc
|
| diff --git a/android_webview/browser/scoped_app_gl_state_restore.cc b/android_webview/browser/scoped_app_gl_state_restore.cc
|
| index 71a5711a26f7967fdbef4830738e810a673b98c3..1f948d254cd38f668e50d89cda89c3a598789c6d 100644
|
| --- a/android_webview/browser/scoped_app_gl_state_restore.cc
|
| +++ b/android_webview/browser/scoped_app_gl_state_restore.cc
|
| @@ -148,6 +148,11 @@ ScopedAppGLStateRestoreImpl::ScopedAppGLStateRestoreImpl(
|
| TRACE_EVENT0("android_webview", "AppGLStateSave");
|
| MakeAppContextCurrent();
|
|
|
| + // Ignore incoming GL errors.
|
| + GLenum error = glGetError();
|
| + DLOG_IF(WARNING, error != static_cast<GLenum>(GL_NO_ERROR))
|
| + << "Incoming GLError " << error;
|
| +
|
| if (!g_globals_initialized) {
|
| g_globals_initialized = true;
|
|
|
| @@ -251,12 +256,15 @@ ScopedAppGLStateRestoreImpl::ScopedAppGLStateRestoreImpl(
|
| glGetVertexAttribfv(
|
| i, GL_CURRENT_VERTEX_ATTRIB, vertex_attrib_[i].current_vertex_attrib);
|
| }
|
| + DCHECK_EQ(glGetError(), static_cast<GLenum>(GL_NO_ERROR));
|
| }
|
|
|
| ScopedAppGLStateRestoreImpl::~ScopedAppGLStateRestoreImpl() {
|
| TRACE_EVENT0("android_webview", "AppGLStateRestore");
|
| MakeAppContextCurrent();
|
|
|
| + DCHECK_EQ(glGetError(), static_cast<GLenum>(GL_NO_ERROR));
|
| +
|
| glBindFramebufferEXT(GL_FRAMEBUFFER, framebuffer_binding_ext_);
|
| glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index_array_buffer_binding_);
|
|
|
| @@ -347,6 +355,11 @@ ScopedAppGLStateRestoreImpl::~ScopedAppGLStateRestoreImpl() {
|
|
|
| GLEnableDisable(GL_STENCIL_TEST, stencil_test_);
|
| glStencilFunc(stencil_func_, stencil_mask_, stencil_ref_);
|
| +
|
| + // Do not leak GLError out of chromium.
|
| + GLenum error = glGetError();
|
| + DLOG_IF(WARNING, error != static_cast<GLenum>(GL_NO_ERROR))
|
| + << "Chromium produced GLError " << error;
|
| }
|
|
|
| } // namespace internal
|
|
|