| OLD | NEW |
| 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 4950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4961 void GLES2DecoderImpl::ReturnFrontBuffer(const Mailbox& mailbox, bool is_lost) { | 4961 void GLES2DecoderImpl::ReturnFrontBuffer(const Mailbox& mailbox, bool is_lost) { |
| 4962 Texture* texture = | 4962 Texture* texture = |
| 4963 static_cast<Texture*>(group_->mailbox_manager()->ConsumeTexture(mailbox)); | 4963 static_cast<Texture*>(group_->mailbox_manager()->ConsumeTexture(mailbox)); |
| 4964 | 4964 |
| 4965 for (auto it = saved_back_textures_.begin(); it != saved_back_textures_.end(); | 4965 for (auto it = saved_back_textures_.begin(); it != saved_back_textures_.end(); |
| 4966 ++it) { | 4966 ++it) { |
| 4967 if (texture != it->back_texture->texture_ref()->texture()) | 4967 if (texture != it->back_texture->texture_ref()->texture()) |
| 4968 continue; | 4968 continue; |
| 4969 | 4969 |
| 4970 if (is_lost || it->back_texture->size() != offscreen_size_) { | 4970 if (is_lost || it->back_texture->size() != offscreen_size_) { |
| 4971 it->back_texture->Invalidate(); | 4971 if (is_lost) |
| 4972 it->back_texture->Invalidate(); |
| 4973 else |
| 4974 it->back_texture->Destroy(); |
| 4972 saved_back_textures_.erase(it); | 4975 saved_back_textures_.erase(it); |
| 4973 return; | 4976 return; |
| 4974 } | 4977 } |
| 4975 | 4978 |
| 4976 it->in_use = false; | 4979 it->in_use = false; |
| 4977 return; | 4980 return; |
| 4978 } | 4981 } |
| 4979 | 4982 |
| 4980 DLOG(ERROR) << "Attempting to return a frontbuffer that was not saved."; | 4983 DLOG(ERROR) << "Attempting to return a frontbuffer that was not saved."; |
| 4981 } | 4984 } |
| (...skipping 14547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19529 } | 19532 } |
| 19530 | 19533 |
| 19531 // Include the auto-generated part of this file. We split this because it means | 19534 // Include the auto-generated part of this file. We split this because it means |
| 19532 // we can easily edit the non-auto generated parts right here in this file | 19535 // we can easily edit the non-auto generated parts right here in this file |
| 19533 // instead of having to edit some template or the code generator. | 19536 // instead of having to edit some template or the code generator. |
| 19534 #include "base/macros.h" | 19537 #include "base/macros.h" |
| 19535 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 19538 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 19536 | 19539 |
| 19537 } // namespace gles2 | 19540 } // namespace gles2 |
| 19538 } // namespace gpu | 19541 } // namespace gpu |
| OLD | NEW |