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 <cmath> | 10 #include <cmath> |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
886 const ContextState* GetContextState() override { return &state_; } | 886 const ContextState* GetContextState() override { return &state_; } |
887 | 887 |
888 void SetShaderCacheCallback(const ShaderCacheCallback& callback) override; | 888 void SetShaderCacheCallback(const ShaderCacheCallback& callback) override; |
889 void SetWaitSyncPointCallback(const WaitSyncPointCallback& callback) override; | 889 void SetWaitSyncPointCallback(const WaitSyncPointCallback& callback) override; |
890 void SetFenceSyncReleaseCallback( | 890 void SetFenceSyncReleaseCallback( |
891 const FenceSyncReleaseCallback& callback) override; | 891 const FenceSyncReleaseCallback& callback) override; |
892 void SetWaitFenceSyncCallback(const WaitFenceSyncCallback& callback) override; | 892 void SetWaitFenceSyncCallback(const WaitFenceSyncCallback& callback) override; |
893 | 893 |
894 void SetIgnoreCachedStateForTest(bool ignore) override; | 894 void SetIgnoreCachedStateForTest(bool ignore) override; |
895 void SetForceShaderNameHashingForTest(bool force) override; | 895 void SetForceShaderNameHashingForTest(bool force) override; |
896 int32 GetAndClearBackbufferClearBitsForTest() override; | |
vmiura
2015/11/11 19:51:21
uint32
r.kasibhatla
2015/11/11 20:13:21
uint32 return value fails the build in Android. GL
piman
2015/11/11 22:54:43
please use a static_cast<uint32_t>(GL_COLOR_BUFFE
| |
896 void ProcessFinishedAsyncTransfers(); | 897 void ProcessFinishedAsyncTransfers(); |
897 | 898 |
898 bool GetServiceTextureId(uint32 client_texture_id, | 899 bool GetServiceTextureId(uint32 client_texture_id, |
899 uint32* service_texture_id) override; | 900 uint32* service_texture_id) override; |
900 | 901 |
901 uint32 GetTextureUploadCount() override; | 902 uint32 GetTextureUploadCount() override; |
902 base::TimeDelta GetTotalTextureUploadTime() override; | 903 base::TimeDelta GetTotalTextureUploadTime() override; |
903 base::TimeDelta GetTotalProcessingCommandsTime() override; | 904 base::TimeDelta GetTotalProcessingCommandsTime() override; |
904 void AddProcessingCommandsTime(base::TimeDelta) override; | 905 void AddProcessingCommandsTime(base::TimeDelta) override; |
905 | 906 |
(...skipping 4023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4929 } | 4930 } |
4930 | 4931 |
4931 void GLES2DecoderImpl::SetIgnoreCachedStateForTest(bool ignore) { | 4932 void GLES2DecoderImpl::SetIgnoreCachedStateForTest(bool ignore) { |
4932 state_.SetIgnoreCachedStateForTest(ignore); | 4933 state_.SetIgnoreCachedStateForTest(ignore); |
4933 } | 4934 } |
4934 | 4935 |
4935 void GLES2DecoderImpl::SetForceShaderNameHashingForTest(bool force) { | 4936 void GLES2DecoderImpl::SetForceShaderNameHashingForTest(bool force) { |
4936 force_shader_name_hashing_for_test = force; | 4937 force_shader_name_hashing_for_test = force; |
4937 } | 4938 } |
4938 | 4939 |
4940 // Added specifically for testing backbuffer_needs_clear_bits unittests. | |
4941 int32 GLES2DecoderImpl::GetAndClearBackbufferClearBitsForTest() { | |
4942 uint32 clear_bits = backbuffer_needs_clear_bits_; | |
4943 backbuffer_needs_clear_bits_ = 0; | |
4944 return clear_bits; | |
4945 } | |
4946 | |
4939 void GLES2DecoderImpl::OnFboChanged() const { | 4947 void GLES2DecoderImpl::OnFboChanged() const { |
4940 if (workarounds().restore_scissor_on_fbo_change) | 4948 if (workarounds().restore_scissor_on_fbo_change) |
4941 state_.fbo_binding_for_scissor_workaround_dirty = true; | 4949 state_.fbo_binding_for_scissor_workaround_dirty = true; |
4942 | 4950 |
4943 if (workarounds().gl_begin_gl_end_on_fbo_change_to_backbuffer) { | 4951 if (workarounds().gl_begin_gl_end_on_fbo_change_to_backbuffer) { |
4944 GLint bound_fbo_unsigned = -1; | 4952 GLint bound_fbo_unsigned = -1; |
4945 glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &bound_fbo_unsigned); | 4953 glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &bound_fbo_unsigned); |
4946 GLuint bound_fbo = static_cast<GLuint>(bound_fbo_unsigned); | 4954 GLuint bound_fbo = static_cast<GLuint>(bound_fbo_unsigned); |
4947 if (surface_ && surface_->GetBackingFrameBufferObject() == bound_fbo) | 4955 if (surface_ && surface_->GetBackingFrameBufferObject() == bound_fbo) |
4948 surface_->NotifyWasBound(); | 4956 surface_->NotifyWasBound(); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5149 texture_manager(), | 5157 texture_manager(), |
5150 attachments[i], | 5158 attachments[i], |
5151 false); | 5159 false); |
5152 } else { | 5160 } else { |
5153 switch (attachments[i]) { | 5161 switch (attachments[i]) { |
5154 case GL_COLOR_EXT: | 5162 case GL_COLOR_EXT: |
5155 backbuffer_needs_clear_bits_ |= GL_COLOR_BUFFER_BIT; | 5163 backbuffer_needs_clear_bits_ |= GL_COLOR_BUFFER_BIT; |
5156 break; | 5164 break; |
5157 case GL_DEPTH_EXT: | 5165 case GL_DEPTH_EXT: |
5158 backbuffer_needs_clear_bits_ |= GL_DEPTH_BUFFER_BIT; | 5166 backbuffer_needs_clear_bits_ |= GL_DEPTH_BUFFER_BIT; |
5167 break; | |
5159 case GL_STENCIL_EXT: | 5168 case GL_STENCIL_EXT: |
5160 backbuffer_needs_clear_bits_ |= GL_STENCIL_BUFFER_BIT; | 5169 backbuffer_needs_clear_bits_ |= GL_STENCIL_BUFFER_BIT; |
5161 break; | 5170 break; |
5162 default: | 5171 default: |
5163 NOTREACHED(); | 5172 NOTREACHED(); |
5164 break; | 5173 break; |
5165 } | 5174 } |
5166 } | 5175 } |
5167 } | 5176 } |
5168 | 5177 |
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6490 *params = renderbuffer->height(); | 6499 *params = renderbuffer->height(); |
6491 break; | 6500 break; |
6492 case GL_RENDERBUFFER_SAMPLES_EXT: | 6501 case GL_RENDERBUFFER_SAMPLES_EXT: |
6493 if (features().use_img_for_multisampled_render_to_texture) { | 6502 if (features().use_img_for_multisampled_render_to_texture) { |
6494 glGetRenderbufferParameterivEXT(target, GL_RENDERBUFFER_SAMPLES_IMG, | 6503 glGetRenderbufferParameterivEXT(target, GL_RENDERBUFFER_SAMPLES_IMG, |
6495 params); | 6504 params); |
6496 } else { | 6505 } else { |
6497 glGetRenderbufferParameterivEXT(target, GL_RENDERBUFFER_SAMPLES_EXT, | 6506 glGetRenderbufferParameterivEXT(target, GL_RENDERBUFFER_SAMPLES_EXT, |
6498 params); | 6507 params); |
6499 } | 6508 } |
6509 break; | |
6500 default: | 6510 default: |
6501 glGetRenderbufferParameterivEXT(target, pname, params); | 6511 glGetRenderbufferParameterivEXT(target, pname, params); |
6502 break; | 6512 break; |
6503 } | 6513 } |
6504 } | 6514 } |
6505 | 6515 |
6506 void GLES2DecoderImpl::DoBlitFramebufferCHROMIUM( | 6516 void GLES2DecoderImpl::DoBlitFramebufferCHROMIUM( |
6507 GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, | 6517 GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, |
6508 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, | 6518 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, |
6509 GLbitfield mask, GLenum filter) { | 6519 GLbitfield mask, GLenum filter) { |
(...skipping 9090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
15600 return error::kNoError; | 15610 return error::kNoError; |
15601 } | 15611 } |
15602 | 15612 |
15603 // Include the auto-generated part of this file. We split this because it means | 15613 // Include the auto-generated part of this file. We split this because it means |
15604 // we can easily edit the non-auto generated parts right here in this file | 15614 // we can easily edit the non-auto generated parts right here in this file |
15605 // instead of having to edit some template or the code generator. | 15615 // instead of having to edit some template or the code generator. |
15606 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 15616 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
15607 | 15617 |
15608 } // namespace gles2 | 15618 } // namespace gles2 |
15609 } // namespace gpu | 15619 } // namespace gpu |
OLD | NEW |