Chromium Code Reviews| Index: gpu/command_buffer/service/gles2_cmd_decoder.cc |
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| index 5e26477a6d6b2a6823ef80c3ef78545a47c47b18..f54b8ff149bc3bcffa970d07a8a7f796e37302d9 100644 |
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| @@ -987,6 +987,9 @@ class GLES2DecoderImpl : public GLES2Decoder, |
| void DoLoseContextCHROMIUM(GLenum current, GLenum other); |
| + void DoMatrixLoadfCHROMIUM(GLenum matrix_mode, const GLfloat* matrix); |
| + void DoMatrixLoadIdentityCHROMIUM(GLenum matrix_mode); |
| + |
| // Creates a Program for the given program. |
| Program* CreateProgram( |
| GLuint client_id, GLuint service_id) { |
| @@ -10648,6 +10651,45 @@ void GLES2DecoderImpl::DoLoseContextCHROMIUM(GLenum current, GLenum other) { |
| current_decoder_error_ = error::kLostContext; |
| } |
| +void GLES2DecoderImpl::DoMatrixLoadfCHROMIUM(GLenum matrix_mode, |
| + const GLfloat* matrix) { |
| + DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM || |
| + matrix_mode == GL_PATH_MODELVIEW_CHROMIUM); |
| + if (!features().chromium_path_rendering) { |
| + LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, |
| + "glMatrixLoadfCHROMIUM", |
| + "function not available"); |
| + return; |
| + } |
| + |
| + GLfloat* target_matrix = matrix_mode == GL_PATH_PROJECTION_CHROMIUM |
| + ? state_.projection_matrix |
| + : state_.modelview_matrix; |
| + memcpy(target_matrix, matrix, sizeof(GLfloat) * 16); |
| + glMatrixLoadfEXT(matrix_mode, matrix); |
|
vmiura
2014/08/25 19:42:22
We're using GL_PATH_MODELVIEW_CHROMIUM/GL_PATH_PRO
Kimmo Kinnunen
2014/08/26 06:48:33
Done.
I added comments here and in gl_bindings.h
|
| +} |
| + |
| +void GLES2DecoderImpl::DoMatrixLoadIdentityCHROMIUM(GLenum matrix_mode) { |
| + DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM || |
| + matrix_mode == GL_PATH_MODELVIEW_CHROMIUM); |
| + if (!features().chromium_path_rendering) { |
| + LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, |
| + "glMatrixLoadIdentityCHROMIUM", |
| + "function not available"); |
| + return; |
| + } |
| + |
| + static GLfloat kIdentityMatrix[16] = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, |
| + 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, |
| + 0.0f, 0.0f, 0.0f, 1.0f}; |
| + |
| + GLfloat* target_matrix = matrix_mode == GL_PATH_PROJECTION_CHROMIUM |
| + ? state_.projection_matrix |
| + : state_.modelview_matrix; |
| + memcpy(target_matrix, kIdentityMatrix, sizeof(kIdentityMatrix)); |
| + glMatrixLoadIdentityEXT(matrix_mode); |
| +} |
| + |
| bool GLES2DecoderImpl::ValidateAsyncTransfer( |
| const char* function_name, |
| TextureRef* texture_ref, |