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

Unified Diff: mojo/ui/gl_renderer.cc

Issue 1993073005: Mozart: Avoid blocking in glCheckFramebufferStatus(). (Closed) Base URL: git@github.com:domokit/mojo.git@moz-jank3
Patch Set: Created 4 years, 7 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 | « mojo/ui/gl_renderer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/ui/gl_renderer.cc
diff --git a/mojo/ui/gl_renderer.cc b/mojo/ui/gl_renderer.cc
index ef0d24bb8742185a814e341ad4aa50a853e2398c..4b1ff3617afa66aea3e78288647924fd7aef4038 100644
--- a/mojo/ui/gl_renderer.cc
+++ b/mojo/ui/gl_renderer.cc
@@ -103,8 +103,15 @@ mojo::gfx::composition::ResourcePtr GLRenderer::DrawGL(
GL_RENDERBUFFER, depth_buffer);
}
- DCHECK_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE),
- glCheckFramebufferStatus(GL_FRAMEBUFFER));
+#if DCHECK_IS_ON()
+ // This check causes a flush of the GL pipeline which is too expensive
+ // even in debug mode so only check it the first time as a sanity check.
+ if (!checked_framebuffer_status_) {
+ DCHECK_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE),
+ glCheckFramebufferStatus(GL_FRAMEBUFFER));
+ checked_framebuffer_status_ = true;
+ }
+#endif
glViewport(0, 0, size.width, size.height);
callback.Run(gl_scope, size);
« no previous file with comments | « mojo/ui/gl_renderer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698