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 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 void DoReleaseTexImage2DCHROMIUM( | 1091 void DoReleaseTexImage2DCHROMIUM( |
1092 GLenum target, | 1092 GLenum target, |
1093 GLint image_id); | 1093 GLint image_id); |
1094 | 1094 |
1095 void DoTraceEndCHROMIUM(void); | 1095 void DoTraceEndCHROMIUM(void); |
1096 | 1096 |
1097 void DoDrawBuffersEXT(GLsizei count, const GLenum* bufs); | 1097 void DoDrawBuffersEXT(GLsizei count, const GLenum* bufs); |
1098 | 1098 |
1099 void DoLoseContextCHROMIUM(GLenum current, GLenum other); | 1099 void DoLoseContextCHROMIUM(GLenum current, GLenum other); |
1100 | 1100 |
| 1101 void DoFlushDriverCachesCHROMIUM(void); |
| 1102 |
1101 void DoMatrixLoadfCHROMIUM(GLenum matrix_mode, const GLfloat* matrix); | 1103 void DoMatrixLoadfCHROMIUM(GLenum matrix_mode, const GLfloat* matrix); |
1102 void DoMatrixLoadIdentityCHROMIUM(GLenum matrix_mode); | 1104 void DoMatrixLoadIdentityCHROMIUM(GLenum matrix_mode); |
1103 | 1105 |
1104 // Creates a Program for the given program. | 1106 // Creates a Program for the given program. |
1105 Program* CreateProgram( | 1107 Program* CreateProgram( |
1106 GLuint client_id, GLuint service_id) { | 1108 GLuint client_id, GLuint service_id) { |
1107 return program_manager()->CreateProgram(client_id, service_id); | 1109 return program_manager()->CreateProgram(client_id, service_id); |
1108 } | 1110 } |
1109 | 1111 |
1110 // Gets the program info for the given program. Returns NULL if none exists. | 1112 // Gets the program info for the given program. Returns NULL if none exists. |
(...skipping 11964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13075 group_->set_draw_buffer(bufs[0]); | 13077 group_->set_draw_buffer(bufs[0]); |
13076 } | 13078 } |
13077 } | 13079 } |
13078 | 13080 |
13079 void GLES2DecoderImpl::DoLoseContextCHROMIUM(GLenum current, GLenum other) { | 13081 void GLES2DecoderImpl::DoLoseContextCHROMIUM(GLenum current, GLenum other) { |
13080 MarkContextLost(GetContextLostReasonFromResetStatus(current)); | 13082 MarkContextLost(GetContextLostReasonFromResetStatus(current)); |
13081 group_->LoseContexts(GetContextLostReasonFromResetStatus(other)); | 13083 group_->LoseContexts(GetContextLostReasonFromResetStatus(other)); |
13082 reset_by_robustness_extension_ = true; | 13084 reset_by_robustness_extension_ = true; |
13083 } | 13085 } |
13084 | 13086 |
| 13087 void GLES2DecoderImpl::DoFlushDriverCachesCHROMIUM(void) { |
| 13088 // On Adreno Android devices we need to use a workaround to force caches to |
| 13089 // clear. |
| 13090 if (feature_info_->workarounds().unbind_egl_context_to_flush_driver_caches) { |
| 13091 context_->ReleaseCurrent(nullptr); |
| 13092 context_->MakeCurrent(surface_.get()); |
| 13093 } |
| 13094 } |
| 13095 |
13085 void GLES2DecoderImpl::DoMatrixLoadfCHROMIUM(GLenum matrix_mode, | 13096 void GLES2DecoderImpl::DoMatrixLoadfCHROMIUM(GLenum matrix_mode, |
13086 const GLfloat* matrix) { | 13097 const GLfloat* matrix) { |
13087 DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM || | 13098 DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM || |
13088 matrix_mode == GL_PATH_MODELVIEW_CHROMIUM); | 13099 matrix_mode == GL_PATH_MODELVIEW_CHROMIUM); |
13089 if (!features().chromium_path_rendering) { | 13100 if (!features().chromium_path_rendering) { |
13090 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, | 13101 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, |
13091 "glMatrixLoadfCHROMIUM", | 13102 "glMatrixLoadfCHROMIUM", |
13092 "function not available"); | 13103 "function not available"); |
13093 return; | 13104 return; |
13094 } | 13105 } |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13688 } | 13699 } |
13689 } | 13700 } |
13690 | 13701 |
13691 // Include the auto-generated part of this file. We split this because it means | 13702 // Include the auto-generated part of this file. We split this because it means |
13692 // we can easily edit the non-auto generated parts right here in this file | 13703 // we can easily edit the non-auto generated parts right here in this file |
13693 // instead of having to edit some template or the code generator. | 13704 // instead of having to edit some template or the code generator. |
13694 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 13705 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
13695 | 13706 |
13696 } // namespace gles2 | 13707 } // namespace gles2 |
13697 } // namespace gpu | 13708 } // namespace gpu |
OLD | NEW |