| 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 GLenum error, const char* function_name, const char* msg); | 507 GLenum error, const char* function_name, const char* msg); |
| 508 virtual void SetResizeCallback( | 508 virtual void SetResizeCallback( |
| 509 const base::Callback<void(gfx::Size)>& callback); | 509 const base::Callback<void(gfx::Size)>& callback); |
| 510 | 510 |
| 511 virtual void SetMsgCallback(const MsgCallback& callback); | 511 virtual void SetMsgCallback(const MsgCallback& callback); |
| 512 | 512 |
| 513 virtual void SetStreamTextureManager(StreamTextureManager* manager); | 513 virtual void SetStreamTextureManager(StreamTextureManager* manager); |
| 514 virtual bool GetServiceTextureId(uint32 client_texture_id, | 514 virtual bool GetServiceTextureId(uint32 client_texture_id, |
| 515 uint32* service_texture_id); | 515 uint32* service_texture_id); |
| 516 | 516 |
| 517 virtual uint32 GetGLError() OVERRIDE; |
| 518 |
| 517 // Restores the current state to the user's settings. | 519 // Restores the current state to the user's settings. |
| 518 void RestoreCurrentFramebufferBindings(); | 520 void RestoreCurrentFramebufferBindings(); |
| 519 void RestoreCurrentRenderbufferBindings(); | 521 void RestoreCurrentRenderbufferBindings(); |
| 520 void RestoreCurrentTexture2DBindings(); | 522 void RestoreCurrentTexture2DBindings(); |
| 521 | 523 |
| 522 // Sets DEPTH_TEST, STENCIL_TEST and color mask for the current framebuffer. | 524 // Sets DEPTH_TEST, STENCIL_TEST and color mask for the current framebuffer. |
| 523 void ApplyDirtyState(); | 525 void ApplyDirtyState(); |
| 524 | 526 |
| 525 // Reapply the texture parameters to the given texture. | 527 // Reapply the texture parameters to the given texture. |
| 526 void BindAndApplyTextureParameters(TextureManager::TextureInfo* info); | 528 void BindAndApplyTextureParameters(TextureManager::TextureInfo* info); |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 // Wrapper for glUseProgram | 1171 // Wrapper for glUseProgram |
| 1170 void DoUseProgram(GLuint program); | 1172 void DoUseProgram(GLuint program); |
| 1171 | 1173 |
| 1172 // Wrapper for glValidateProgram. | 1174 // Wrapper for glValidateProgram. |
| 1173 void DoValidateProgram(GLuint program_client_id); | 1175 void DoValidateProgram(GLuint program_client_id); |
| 1174 | 1176 |
| 1175 // Gets the number of values that will be returned by glGetXXX. Returns | 1177 // Gets the number of values that will be returned by glGetXXX. Returns |
| 1176 // false if pname is unknown. | 1178 // false if pname is unknown. |
| 1177 bool GetNumValuesReturnedForGLGet(GLenum pname, GLsizei* num_values); | 1179 bool GetNumValuesReturnedForGLGet(GLenum pname, GLsizei* num_values); |
| 1178 | 1180 |
| 1179 // Gets the GLError through our wrapper. | |
| 1180 GLenum GetGLError(); | |
| 1181 | |
| 1182 // Gets the GLError and stores it in our wrapper. Effectively | 1181 // Gets the GLError and stores it in our wrapper. Effectively |
| 1183 // this lets us peek at the error without losing it. | 1182 // this lets us peek at the error without losing it. |
| 1184 GLenum PeekGLError(); | 1183 GLenum PeekGLError(); |
| 1185 | 1184 |
| 1186 // Copies the real GL errors to the wrapper. This is so we can | 1185 // Copies the real GL errors to the wrapper. This is so we can |
| 1187 // make sure there are no native GL errors before calling some GL function | 1186 // make sure there are no native GL errors before calling some GL function |
| 1188 // so that on return we know any error generated was for that specific | 1187 // so that on return we know any error generated was for that specific |
| 1189 // command. | 1188 // command. |
| 1190 void CopyRealGLErrorsToWrapper(); | 1189 void CopyRealGLErrorsToWrapper(); |
| 1191 | 1190 |
| (...skipping 3847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5039 if (current_program_) { | 5038 if (current_program_) { |
| 5040 program_manager()->UnuseProgram(shader_manager(), current_program_); | 5039 program_manager()->UnuseProgram(shader_manager(), current_program_); |
| 5041 } | 5040 } |
| 5042 current_program_ = info; | 5041 current_program_ = info; |
| 5043 glUseProgram(service_id); | 5042 glUseProgram(service_id); |
| 5044 if (current_program_) { | 5043 if (current_program_) { |
| 5045 program_manager()->UseProgram(current_program_); | 5044 program_manager()->UseProgram(current_program_); |
| 5046 } | 5045 } |
| 5047 } | 5046 } |
| 5048 | 5047 |
| 5049 GLenum GLES2DecoderImpl::GetGLError() { | 5048 uint32 GLES2DecoderImpl::GetGLError() { |
| 5050 // Check the GL error first, then our wrapped error. | 5049 // Check the GL error first, then our wrapped error. |
| 5051 GLenum error = glGetError(); | 5050 GLenum error = glGetError(); |
| 5052 if (error == GL_NO_ERROR && error_bits_ != 0) { | 5051 if (error == GL_NO_ERROR && error_bits_ != 0) { |
| 5053 for (uint32 mask = 1; mask != 0; mask = mask << 1) { | 5052 for (uint32 mask = 1; mask != 0; mask = mask << 1) { |
| 5054 if ((error_bits_ & mask) != 0) { | 5053 if ((error_bits_ & mask) != 0) { |
| 5055 error = GLES2Util::GLErrorBitToGLError(mask); | 5054 error = GLES2Util::GLErrorBitToGLError(mask); |
| 5056 break; | 5055 break; |
| 5057 } | 5056 } |
| 5058 } | 5057 } |
| 5059 } | 5058 } |
| (...skipping 4130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9190 BindAndApplyTextureParameters(info); | 9189 BindAndApplyTextureParameters(info); |
| 9191 } | 9190 } |
| 9192 | 9191 |
| 9193 // Include the auto-generated part of this file. We split this because it means | 9192 // Include the auto-generated part of this file. We split this because it means |
| 9194 // we can easily edit the non-auto generated parts right here in this file | 9193 // we can easily edit the non-auto generated parts right here in this file |
| 9195 // instead of having to edit some template or the code generator. | 9194 // instead of having to edit some template or the code generator. |
| 9196 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 9195 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 9197 | 9196 |
| 9198 } // namespace gles2 | 9197 } // namespace gles2 |
| 9199 } // namespace gpu | 9198 } // namespace gpu |
| OLD | NEW |