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 b46c252b25905f205a24d3cafc60571fb4ee8a2e..ff0a04f74cd9a4a81c26171d1c248bc7857d6951 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) { |
@@ -10660,6 +10663,50 @@ 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); |
+ // The matrix_mode is either GL_PATH_MODELVIEW_NV or GL_PATH_PROJECTION_NV |
+ // since the values of the _NV and _CHROMIUM tokens match. |
+ glMatrixLoadfEXT(matrix_mode, matrix); |
+} |
+ |
+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)); |
+ // The matrix_mode is either GL_PATH_MODELVIEW_NV or GL_PATH_PROJECTION_NV |
+ // since the values of the _NV and _CHROMIUM tokens match. |
+ glMatrixLoadIdentityEXT(matrix_mode); |
+} |
+ |
bool GLES2DecoderImpl::ValidateAsyncTransfer( |
const char* function_name, |
TextureRef* texture_ref, |