| 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 14283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14294 if (feature_info_->workarounds().unbind_egl_context_to_flush_driver_caches) { | 14294 if (feature_info_->workarounds().unbind_egl_context_to_flush_driver_caches) { |
| 14295 context_->ReleaseCurrent(nullptr); | 14295 context_->ReleaseCurrent(nullptr); |
| 14296 context_->MakeCurrent(surface_.get()); | 14296 context_->MakeCurrent(surface_.get()); |
| 14297 } | 14297 } |
| 14298 } | 14298 } |
| 14299 | 14299 |
| 14300 void GLES2DecoderImpl::DoMatrixLoadfCHROMIUM(GLenum matrix_mode, | 14300 void GLES2DecoderImpl::DoMatrixLoadfCHROMIUM(GLenum matrix_mode, |
| 14301 const GLfloat* matrix) { | 14301 const GLfloat* matrix) { |
| 14302 DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM || | 14302 DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM || |
| 14303 matrix_mode == GL_PATH_MODELVIEW_CHROMIUM); | 14303 matrix_mode == GL_PATH_MODELVIEW_CHROMIUM); |
| 14304 if (!features().chromium_path_rendering) { | |
| 14305 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, | |
| 14306 "glMatrixLoadfCHROMIUM", | |
| 14307 "function not available"); | |
| 14308 return; | |
| 14309 } | |
| 14310 | 14304 |
| 14311 GLfloat* target_matrix = matrix_mode == GL_PATH_PROJECTION_CHROMIUM | 14305 GLfloat* target_matrix = matrix_mode == GL_PATH_PROJECTION_CHROMIUM |
| 14312 ? state_.projection_matrix | 14306 ? state_.projection_matrix |
| 14313 : state_.modelview_matrix; | 14307 : state_.modelview_matrix; |
| 14314 memcpy(target_matrix, matrix, sizeof(GLfloat) * 16); | 14308 memcpy(target_matrix, matrix, sizeof(GLfloat) * 16); |
| 14315 // The matrix_mode is either GL_PATH_MODELVIEW_NV or GL_PATH_PROJECTION_NV | 14309 // The matrix_mode is either GL_PATH_MODELVIEW_NV or GL_PATH_PROJECTION_NV |
| 14316 // since the values of the _NV and _CHROMIUM tokens match. | 14310 // since the values of the _NV and _CHROMIUM tokens match. |
| 14317 glMatrixLoadfEXT(matrix_mode, matrix); | 14311 glMatrixLoadfEXT(matrix_mode, matrix); |
| 14318 } | 14312 } |
| 14319 | 14313 |
| 14320 void GLES2DecoderImpl::DoMatrixLoadIdentityCHROMIUM(GLenum matrix_mode) { | 14314 void GLES2DecoderImpl::DoMatrixLoadIdentityCHROMIUM(GLenum matrix_mode) { |
| 14321 DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM || | 14315 DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM || |
| 14322 matrix_mode == GL_PATH_MODELVIEW_CHROMIUM); | 14316 matrix_mode == GL_PATH_MODELVIEW_CHROMIUM); |
| 14323 | 14317 |
| 14324 if (!features().chromium_path_rendering) { | |
| 14325 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, | |
| 14326 "glMatrixLoadIdentityCHROMIUM", | |
| 14327 "function not available"); | |
| 14328 return; | |
| 14329 } | |
| 14330 | |
| 14331 GLfloat* target_matrix = matrix_mode == GL_PATH_PROJECTION_CHROMIUM | 14318 GLfloat* target_matrix = matrix_mode == GL_PATH_PROJECTION_CHROMIUM |
| 14332 ? state_.projection_matrix | 14319 ? state_.projection_matrix |
| 14333 : state_.modelview_matrix; | 14320 : state_.modelview_matrix; |
| 14334 memcpy(target_matrix, kIdentityMatrix, sizeof(kIdentityMatrix)); | 14321 memcpy(target_matrix, kIdentityMatrix, sizeof(kIdentityMatrix)); |
| 14335 // The matrix_mode is either GL_PATH_MODELVIEW_NV or GL_PATH_PROJECTION_NV | 14322 // The matrix_mode is either GL_PATH_MODELVIEW_NV or GL_PATH_PROJECTION_NV |
| 14336 // since the values of the _NV and _CHROMIUM tokens match. | 14323 // since the values of the _NV and _CHROMIUM tokens match. |
| 14337 glMatrixLoadIdentityEXT(matrix_mode); | 14324 glMatrixLoadIdentityEXT(matrix_mode); |
| 14338 } | 14325 } |
| 14339 | 14326 |
| 14340 error::Error GLES2DecoderImpl::HandleUniformBlockBinding( | 14327 error::Error GLES2DecoderImpl::HandleUniformBlockBinding( |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15046 return error::kNoError; | 15033 return error::kNoError; |
| 15047 } | 15034 } |
| 15048 | 15035 |
| 15049 // Include the auto-generated part of this file. We split this because it means | 15036 // Include the auto-generated part of this file. We split this because it means |
| 15050 // we can easily edit the non-auto generated parts right here in this file | 15037 // we can easily edit the non-auto generated parts right here in this file |
| 15051 // instead of having to edit some template or the code generator. | 15038 // instead of having to edit some template or the code generator. |
| 15052 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 15039 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 15053 | 15040 |
| 15054 } // namespace gles2 | 15041 } // namespace gles2 |
| 15055 } // namespace gpu | 15042 } // namespace gpu |
| OLD | NEW |