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

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

Issue 7841047: Destroy resolved framebuffers on resize, not swap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | « 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 d6e8cfd99205dfebc204c025c24b9674b91c3935..a92cb6ebf5c12ff4051faba67effbba2a8c46098 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -2525,6 +2525,15 @@ bool GLES2DecoderImpl::ResizeOffscreenFrameBuffer(const gfx::Size& size) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
RestoreClearState();
}
+
+ // Destroy the offscreen resolved framebuffers.
+ if (offscreen_resolved_frame_buffer_.get())
+ offscreen_resolved_frame_buffer_->Destroy();
+ if (offscreen_resolved_color_texture_.get())
+ offscreen_resolved_color_texture_->Destroy();
+ offscreen_resolved_color_texture_.reset();
+ offscreen_resolved_frame_buffer_.reset();
+
return true;
}
@@ -6545,14 +6554,6 @@ error::Error GLES2DecoderImpl::HandleSwapBuffers(
return error::kLostContext;
}
- // Destroy the offscreen resolved framebuffers.
- if (offscreen_resolved_frame_buffer_.get())
- offscreen_resolved_frame_buffer_->Destroy();
- if (offscreen_resolved_color_texture_.get())
- offscreen_resolved_color_texture_->Destroy();
- offscreen_resolved_color_texture_.reset();
- offscreen_resolved_frame_buffer_.reset();
-
// Clear the offscreen color texture.
// TODO(piman): Is this still necessary?
{
« 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