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 4348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4359 attachment = GL_STENCIL_ATTACHMENT; | 4359 attachment = GL_STENCIL_ATTACHMENT; |
4360 break; | 4360 break; |
4361 default: | 4361 default: |
4362 NOTREACHED(); | 4362 NOTREACHED(); |
4363 return; | 4363 return; |
4364 } | 4364 } |
4365 } | 4365 } |
4366 translated_attachments[i] = attachment; | 4366 translated_attachments[i] = attachment; |
4367 } | 4367 } |
4368 | 4368 |
4369 ScopedRenderTo do_render(framebuffer_state_.bound_draw_framebuffer.get()); | |
no sievers
2014/10/16 18:53:18
ScopedRenderTo do_render(framebuffer);
boliu
2014/10/16 19:04:50
Done.
| |
4369 glDiscardFramebufferEXT(target, numAttachments, translated_attachments.get()); | 4370 glDiscardFramebufferEXT(target, numAttachments, translated_attachments.get()); |
4370 } | 4371 } |
4371 | 4372 |
4372 void GLES2DecoderImpl::DoEnableVertexAttribArray(GLuint index) { | 4373 void GLES2DecoderImpl::DoEnableVertexAttribArray(GLuint index) { |
4373 if (state_.vertex_attrib_manager->Enable(index, true)) { | 4374 if (state_.vertex_attrib_manager->Enable(index, true)) { |
4374 glEnableVertexAttribArray(index); | 4375 glEnableVertexAttribArray(index); |
4375 } else { | 4376 } else { |
4376 LOCAL_SET_GL_ERROR( | 4377 LOCAL_SET_GL_ERROR( |
4377 GL_INVALID_VALUE, "glEnableVertexAttribArray", "index out of range"); | 4378 GL_INVALID_VALUE, "glEnableVertexAttribArray", "index out of range"); |
4378 } | 4379 } |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5000 GL_INVALID_VALUE, "glDeleteProgram", "unknown program"); | 5001 GL_INVALID_VALUE, "glDeleteProgram", "unknown program"); |
5001 } | 5002 } |
5002 } | 5003 } |
5003 return error::kNoError; | 5004 return error::kNoError; |
5004 } | 5005 } |
5005 | 5006 |
5006 error::Error GLES2DecoderImpl::DoClear(GLbitfield mask) { | 5007 error::Error GLES2DecoderImpl::DoClear(GLbitfield mask) { |
5007 DCHECK(!ShouldDeferDraws()); | 5008 DCHECK(!ShouldDeferDraws()); |
5008 if (CheckBoundFramebuffersValid("glClear")) { | 5009 if (CheckBoundFramebuffersValid("glClear")) { |
5009 ApplyDirtyState(); | 5010 ApplyDirtyState(); |
5011 ScopedRenderTo do_render(framebuffer_state_.bound_draw_framebuffer.get()); | |
5010 glClear(mask); | 5012 glClear(mask); |
5011 } | 5013 } |
5012 return error::kNoError; | 5014 return error::kNoError; |
5013 } | 5015 } |
5014 | 5016 |
5015 void GLES2DecoderImpl::DoFramebufferRenderbuffer( | 5017 void GLES2DecoderImpl::DoFramebufferRenderbuffer( |
5016 GLenum target, GLenum attachment, GLenum renderbuffertarget, | 5018 GLenum target, GLenum attachment, GLenum renderbuffertarget, |
5017 GLuint client_renderbuffer_id) { | 5019 GLuint client_renderbuffer_id) { |
5018 Framebuffer* framebuffer = GetFramebufferInfoForTarget(target); | 5020 Framebuffer* framebuffer = GetFramebufferInfoForTarget(target); |
5019 if (!framebuffer) { | 5021 if (!framebuffer) { |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5301 GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, | 5303 GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, |
5302 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, | 5304 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, |
5303 GLbitfield mask, GLenum filter) { | 5305 GLbitfield mask, GLenum filter) { |
5304 DCHECK(!ShouldDeferReads() && !ShouldDeferDraws()); | 5306 DCHECK(!ShouldDeferReads() && !ShouldDeferDraws()); |
5305 | 5307 |
5306 if (!CheckBoundFramebuffersValid("glBlitFramebufferCHROMIUM")) { | 5308 if (!CheckBoundFramebuffersValid("glBlitFramebufferCHROMIUM")) { |
5307 return; | 5309 return; |
5308 } | 5310 } |
5309 | 5311 |
5310 state_.SetDeviceCapabilityState(GL_SCISSOR_TEST, false); | 5312 state_.SetDeviceCapabilityState(GL_SCISSOR_TEST, false); |
5313 ScopedRenderTo do_render(framebuffer_state_.bound_draw_framebuffer.get()); | |
5311 BlitFramebufferHelper( | 5314 BlitFramebufferHelper( |
5312 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); | 5315 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); |
5313 state_.SetDeviceCapabilityState(GL_SCISSOR_TEST, | 5316 state_.SetDeviceCapabilityState(GL_SCISSOR_TEST, |
5314 state_.enable_flags.scissor_test); | 5317 state_.enable_flags.scissor_test); |
5315 } | 5318 } |
5316 | 5319 |
5317 void GLES2DecoderImpl::EnsureRenderbufferBound() { | 5320 void GLES2DecoderImpl::EnsureRenderbufferBound() { |
5318 if (!state_.bound_renderbuffer_valid) { | 5321 if (!state_.bound_renderbuffer_valid) { |
5319 state_.bound_renderbuffer_valid = true; | 5322 state_.bound_renderbuffer_valid = true; |
5320 glBindRenderbufferEXT(GL_RENDERBUFFER, | 5323 glBindRenderbufferEXT(GL_RENDERBUFFER, |
(...skipping 5868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11189 } | 11192 } |
11190 } | 11193 } |
11191 | 11194 |
11192 // Include the auto-generated part of this file. We split this because it means | 11195 // Include the auto-generated part of this file. We split this because it means |
11193 // we can easily edit the non-auto generated parts right here in this file | 11196 // we can easily edit the non-auto generated parts right here in this file |
11194 // instead of having to edit some template or the code generator. | 11197 // instead of having to edit some template or the code generator. |
11195 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 11198 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
11196 | 11199 |
11197 } // namespace gles2 | 11200 } // namespace gles2 |
11198 } // namespace gpu | 11201 } // namespace gpu |
OLD | NEW |