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 4260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4271 state_.RestoreVertexAttribs(); | 4271 state_.RestoreVertexAttribs(); |
4272 } | 4272 } |
4273 | 4273 |
4274 void GLES2DecoderImpl::SetIgnoreCachedStateForTest(bool ignore) { | 4274 void GLES2DecoderImpl::SetIgnoreCachedStateForTest(bool ignore) { |
4275 state_.SetIgnoreCachedStateForTest(ignore); | 4275 state_.SetIgnoreCachedStateForTest(ignore); |
4276 } | 4276 } |
4277 | 4277 |
4278 void GLES2DecoderImpl::OnFboChanged() const { | 4278 void GLES2DecoderImpl::OnFboChanged() const { |
4279 if (workarounds().restore_scissor_on_fbo_change) | 4279 if (workarounds().restore_scissor_on_fbo_change) |
4280 state_.fbo_binding_for_scissor_workaround_dirty_ = true; | 4280 state_.fbo_binding_for_scissor_workaround_dirty_ = true; |
| 4281 |
| 4282 if (workarounds().gl_begin_gl_end_on_fbo_change_to_backbuffer) { |
| 4283 GLint bound_fbo_unsigned = -1; |
| 4284 glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &bound_fbo_unsigned); |
| 4285 GLuint bound_fbo = static_cast<GLuint>(bound_fbo_unsigned); |
| 4286 if (surface_ && surface_->GetBackingFrameBufferObject() == bound_fbo) |
| 4287 surface_->NotifyWasBound(); |
| 4288 } |
4281 } | 4289 } |
4282 | 4290 |
4283 // Called after the FBO is checked for completeness. | 4291 // Called after the FBO is checked for completeness. |
4284 void GLES2DecoderImpl::OnUseFramebuffer() const { | 4292 void GLES2DecoderImpl::OnUseFramebuffer() const { |
4285 if (state_.fbo_binding_for_scissor_workaround_dirty_) { | 4293 if (state_.fbo_binding_for_scissor_workaround_dirty_) { |
4286 state_.fbo_binding_for_scissor_workaround_dirty_ = false; | 4294 state_.fbo_binding_for_scissor_workaround_dirty_ = false; |
4287 // The driver forgets the correct scissor when modifying the FBO binding. | 4295 // The driver forgets the correct scissor when modifying the FBO binding. |
4288 glScissor(state_.scissor_x, | 4296 glScissor(state_.scissor_x, |
4289 state_.scissor_y, | 4297 state_.scissor_y, |
4290 state_.scissor_width, | 4298 state_.scissor_width, |
(...skipping 7262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11553 } | 11561 } |
11554 } | 11562 } |
11555 | 11563 |
11556 // Include the auto-generated part of this file. We split this because it means | 11564 // Include the auto-generated part of this file. We split this because it means |
11557 // we can easily edit the non-auto generated parts right here in this file | 11565 // we can easily edit the non-auto generated parts right here in this file |
11558 // instead of having to edit some template or the code generator. | 11566 // instead of having to edit some template or the code generator. |
11559 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 11567 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
11560 | 11568 |
11561 } // namespace gles2 | 11569 } // namespace gles2 |
11562 } // namespace gpu | 11570 } // namespace gpu |
OLD | NEW |