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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2783203004: Correctly destroy returned front buffer after resize (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 4920 matching lines...) Expand 10 before | Expand all | Expand 10 after
4931 void GLES2DecoderImpl::ReturnFrontBuffer(const Mailbox& mailbox, bool is_lost) { 4931 void GLES2DecoderImpl::ReturnFrontBuffer(const Mailbox& mailbox, bool is_lost) {
4932 Texture* texture = 4932 Texture* texture =
4933 static_cast<Texture*>(group_->mailbox_manager()->ConsumeTexture(mailbox)); 4933 static_cast<Texture*>(group_->mailbox_manager()->ConsumeTexture(mailbox));
4934 4934
4935 for (auto it = saved_back_textures_.begin(); it != saved_back_textures_.end(); 4935 for (auto it = saved_back_textures_.begin(); it != saved_back_textures_.end();
4936 ++it) { 4936 ++it) {
4937 if (texture != it->back_texture->texture_ref()->texture()) 4937 if (texture != it->back_texture->texture_ref()->texture())
4938 continue; 4938 continue;
4939 4939
4940 if (is_lost || it->back_texture->size() != offscreen_size_) { 4940 if (is_lost || it->back_texture->size() != offscreen_size_) {
4941 it->back_texture->Invalidate(); 4941 if (is_lost)
4942 it->back_texture->Invalidate();
4943 else
4944 it->back_texture->Destroy();
4942 saved_back_textures_.erase(it); 4945 saved_back_textures_.erase(it);
4943 return; 4946 return;
4944 } 4947 }
4945 4948
4946 it->in_use = false; 4949 it->in_use = false;
4947 return; 4950 return;
4948 } 4951 }
4949 4952
4950 DLOG(ERROR) << "Attempting to return a frontbuffer that was not saved."; 4953 DLOG(ERROR) << "Attempting to return a frontbuffer that was not saved.";
4951 } 4954 }
(...skipping 14371 matching lines...) Expand 10 before | Expand all | Expand 10 after
19323 } 19326 }
19324 19327
19325 // Include the auto-generated part of this file. We split this because it means 19328 // Include the auto-generated part of this file. We split this because it means
19326 // we can easily edit the non-auto generated parts right here in this file 19329 // we can easily edit the non-auto generated parts right here in this file
19327 // instead of having to edit some template or the code generator. 19330 // instead of having to edit some template or the code generator.
19328 #include "base/macros.h" 19331 #include "base/macros.h"
19329 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 19332 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
19330 19333
19331 } // namespace gles2 19334 } // namespace gles2
19332 } // namespace gpu 19335 } // namespace gpu
OLDNEW
« 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