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 4251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4262 state_.RestoreVertexAttribs(); | 4262 state_.RestoreVertexAttribs(); |
4263 } | 4263 } |
4264 | 4264 |
4265 void GLES2DecoderImpl::SetIgnoreCachedStateForTest(bool ignore) { | 4265 void GLES2DecoderImpl::SetIgnoreCachedStateForTest(bool ignore) { |
4266 state_.SetIgnoreCachedStateForTest(ignore); | 4266 state_.SetIgnoreCachedStateForTest(ignore); |
4267 } | 4267 } |
4268 | 4268 |
4269 void GLES2DecoderImpl::OnFboChanged() const { | 4269 void GLES2DecoderImpl::OnFboChanged() const { |
4270 if (workarounds().restore_scissor_on_fbo_change) | 4270 if (workarounds().restore_scissor_on_fbo_change) |
4271 state_.fbo_binding_for_scissor_workaround_dirty_ = true; | 4271 state_.fbo_binding_for_scissor_workaround_dirty_ = true; |
| 4272 |
| 4273 if (workarounds().gl_begin_gl_end_on_fbo_change_to_backbuffer) { |
| 4274 GLint bound_fbo_unsigned = -1; |
| 4275 glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &bound_fbo_unsigned); |
| 4276 GLuint bound_fbo = static_cast<GLuint>(bound_fbo_unsigned); |
| 4277 if (surface_ && surface_->GetBackingFrameBufferObject() == bound_fbo) |
| 4278 surface_->WasBound(); |
| 4279 } |
4272 } | 4280 } |
4273 | 4281 |
4274 // Called after the FBO is checked for completeness. | 4282 // Called after the FBO is checked for completeness. |
4275 void GLES2DecoderImpl::OnUseFramebuffer() const { | 4283 void GLES2DecoderImpl::OnUseFramebuffer() const { |
4276 if (state_.fbo_binding_for_scissor_workaround_dirty_) { | 4284 if (state_.fbo_binding_for_scissor_workaround_dirty_) { |
4277 state_.fbo_binding_for_scissor_workaround_dirty_ = false; | 4285 state_.fbo_binding_for_scissor_workaround_dirty_ = false; |
4278 // The driver forgets the correct scissor when modifying the FBO binding. | 4286 // The driver forgets the correct scissor when modifying the FBO binding. |
4279 glScissor(state_.scissor_x, | 4287 glScissor(state_.scissor_x, |
4280 state_.scissor_y, | 4288 state_.scissor_y, |
4281 state_.scissor_width, | 4289 state_.scissor_width, |
(...skipping 7250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11532 } | 11540 } |
11533 } | 11541 } |
11534 | 11542 |
11535 // Include the auto-generated part of this file. We split this because it means | 11543 // Include the auto-generated part of this file. We split this because it means |
11536 // we can easily edit the non-auto generated parts right here in this file | 11544 // we can easily edit the non-auto generated parts right here in this file |
11537 // instead of having to edit some template or the code generator. | 11545 // instead of having to edit some template or the code generator. |
11538 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 11546 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
11539 | 11547 |
11540 } // namespace gles2 | 11548 } // namespace gles2 |
11541 } // namespace gpu | 11549 } // namespace gpu |
OLD | NEW |