| 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 <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 3081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3092 void GLES2DecoderImpl::DeleteFramebuffersHelper( | 3092 void GLES2DecoderImpl::DeleteFramebuffersHelper( |
| 3093 GLsizei n, const GLuint* client_ids) { | 3093 GLsizei n, const GLuint* client_ids) { |
| 3094 bool supports_separate_framebuffer_binds = | 3094 bool supports_separate_framebuffer_binds = |
| 3095 features().chromium_framebuffer_multisample; | 3095 features().chromium_framebuffer_multisample; |
| 3096 | 3096 |
| 3097 for (GLsizei ii = 0; ii < n; ++ii) { | 3097 for (GLsizei ii = 0; ii < n; ++ii) { |
| 3098 Framebuffer* framebuffer = | 3098 Framebuffer* framebuffer = |
| 3099 GetFramebuffer(client_ids[ii]); | 3099 GetFramebuffer(client_ids[ii]); |
| 3100 if (framebuffer && !framebuffer->IsDeleted()) { | 3100 if (framebuffer && !framebuffer->IsDeleted()) { |
| 3101 if (framebuffer == framebuffer_state_.bound_draw_framebuffer.get()) { | 3101 if (framebuffer == framebuffer_state_.bound_draw_framebuffer.get()) { |
| 3102 GLenum target = supports_separate_framebuffer_binds ? |
| 3103 GL_DRAW_FRAMEBUFFER_EXT : GL_FRAMEBUFFER; |
| 3104 |
| 3105 // Unbind attachments on FBO before deletion. |
| 3106 if (workarounds().unbind_attachments_on_bound_render_fbo_delete) |
| 3107 framebuffer->DoUnbindGLAttachmentsForWorkaround(target); |
| 3108 |
| 3109 glBindFramebufferEXT(target, GetBackbufferServiceId()); |
| 3102 framebuffer_state_.bound_draw_framebuffer = NULL; | 3110 framebuffer_state_.bound_draw_framebuffer = NULL; |
| 3103 framebuffer_state_.clear_state_dirty = true; | 3111 framebuffer_state_.clear_state_dirty = true; |
| 3104 GLenum target = supports_separate_framebuffer_binds ? | |
| 3105 GL_DRAW_FRAMEBUFFER_EXT : GL_FRAMEBUFFER; | |
| 3106 glBindFramebufferEXT(target, GetBackbufferServiceId()); | |
| 3107 } | 3112 } |
| 3108 if (framebuffer == framebuffer_state_.bound_read_framebuffer.get()) { | 3113 if (framebuffer == framebuffer_state_.bound_read_framebuffer.get()) { |
| 3109 framebuffer_state_.bound_read_framebuffer = NULL; | 3114 framebuffer_state_.bound_read_framebuffer = NULL; |
| 3110 GLenum target = supports_separate_framebuffer_binds ? | 3115 GLenum target = supports_separate_framebuffer_binds ? |
| 3111 GL_READ_FRAMEBUFFER_EXT : GL_FRAMEBUFFER; | 3116 GL_READ_FRAMEBUFFER_EXT : GL_FRAMEBUFFER; |
| 3112 glBindFramebufferEXT(target, GetBackbufferServiceId()); | 3117 glBindFramebufferEXT(target, GetBackbufferServiceId()); |
| 3113 } | 3118 } |
| 3114 OnFboChanged(); | 3119 OnFboChanged(); |
| 3115 RemoveFramebuffer(client_ids[ii]); | 3120 RemoveFramebuffer(client_ids[ii]); |
| 3116 } | 3121 } |
| (...skipping 8886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12003 } | 12008 } |
| 12004 } | 12009 } |
| 12005 | 12010 |
| 12006 // Include the auto-generated part of this file. We split this because it means | 12011 // Include the auto-generated part of this file. We split this because it means |
| 12007 // we can easily edit the non-auto generated parts right here in this file | 12012 // we can easily edit the non-auto generated parts right here in this file |
| 12008 // instead of having to edit some template or the code generator. | 12013 // instead of having to edit some template or the code generator. |
| 12009 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 12014 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 12010 | 12015 |
| 12011 } // namespace gles2 | 12016 } // namespace gles2 |
| 12012 } // namespace gpu | 12017 } // namespace gpu |
| OLD | NEW |