Chromium Code Reviews| 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 // Normally, we should just need to call glFinish to flush driver caches. | |
| 13089 glFinish(); | |
| 13090 | |
| 13091 // On Adreno Android devices we need to use a workaround to force more caches | |
| 13092 // to clear. | |
| 13093 if (feature_info_->workarounds().unbind_egl_context_to_flush_driver_caches) { | |
| 13094 context_->MakeCurrent(nullptr); | |
|
piman
2015/07/13 21:25:29
How about context_->ReleaseCurrent() here, instead
ericrk
2015/07/13 22:11:11
good point.
| |
| 13095 context_->MakeCurrent(surface_.get()); | |
| 13096 } | |
| 13097 } | |
| 13098 | |
| 13085 void GLES2DecoderImpl::DoMatrixLoadfCHROMIUM(GLenum matrix_mode, | 13099 void GLES2DecoderImpl::DoMatrixLoadfCHROMIUM(GLenum matrix_mode, |
| 13086 const GLfloat* matrix) { | 13100 const GLfloat* matrix) { |
| 13087 DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM || | 13101 DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM || |
| 13088 matrix_mode == GL_PATH_MODELVIEW_CHROMIUM); | 13102 matrix_mode == GL_PATH_MODELVIEW_CHROMIUM); |
| 13089 if (!features().chromium_path_rendering) { | 13103 if (!features().chromium_path_rendering) { |
| 13090 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, | 13104 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, |
| 13091 "glMatrixLoadfCHROMIUM", | 13105 "glMatrixLoadfCHROMIUM", |
| 13092 "function not available"); | 13106 "function not available"); |
| 13093 return; | 13107 return; |
| 13094 } | 13108 } |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 13688 } | 13702 } |
| 13689 } | 13703 } |
| 13690 | 13704 |
| 13691 // Include the auto-generated part of this file. We split this because it means | 13705 // 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 | 13706 // 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. | 13707 // instead of having to edit some template or the code generator. |
| 13694 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 13708 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 13695 | 13709 |
| 13696 } // namespace gles2 | 13710 } // namespace gles2 |
| 13697 } // namespace gpu | 13711 } // namespace gpu |
| OLD | NEW |