Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 169603002: Add initial support for NV_path_rendering extension to gpu command buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comment Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,
« no previous file with comments | « gpu/command_buffer/service/feature_info_unittest.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698