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

Unified Diff: cc/output/gl_renderer.cc

Issue 23601013: cc: Invalidate framebuffer contents when clearing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use arraysize. Created 7 years, 3 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 | « cc/output/context_provider.cc ('k') | cc/output/gl_renderer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index a80feac4ecc9f97f3fd5e731d99a43cc7ea98a99..35cca80bc6532384986c8934632cac2d7b6bfdc7 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -204,6 +204,9 @@ bool GLRenderer::Initialize() {
capabilities_.using_map_image =
Settings().use_map_image && context_caps.map_image;
+ capabilities_.using_discard_framebuffer =
+ context_caps.discard_framebuffer;
+
is_using_bind_uniform_ = context_caps.bind_uniform_location;
if (!InitializeSharedObjects())
@@ -293,6 +296,14 @@ void GLRenderer::ClearFramebuffer(DrawingFrame* frame) {
return;
}
+ if (capabilities_.using_discard_framebuffer) {
+ GLenum attachments[] = {
+ GL_COLOR_EXT
+ };
+ context_->discardFramebufferEXT(
+ GL_FRAMEBUFFER, arraysize(attachments), attachments);
+ }
+
// On DEBUG builds, opaque render passes are cleared to blue to easily see
// regions that were not drawn on the screen.
if (frame->current_render_pass->has_transparent_background)
« no previous file with comments | « cc/output/context_provider.cc ('k') | cc/output/gl_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698