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

Unified Diff: gpu/command_buffer/service/context_state_impl_autogen.h

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: Created 6 years, 8 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/context_state_impl_autogen.h
diff --git a/gpu/command_buffer/service/context_state_impl_autogen.h b/gpu/command_buffer/service/context_state_impl_autogen.h
index 2e4d28a2d59522d84a5367df1e7e4708d61ad90d..426a51f4e6d1a0528f5ef2549855bffe38a9f83c 100644
--- a/gpu/command_buffer/service/context_state_impl_autogen.h
+++ b/gpu/command_buffer/service/context_state_impl_autogen.h
@@ -53,6 +53,38 @@ void ContextState::Initialize() {
hint_generate_mipmap = GL_DONT_CARE;
hint_fragment_shader_derivative = GL_DONT_CARE;
line_width = 1.0f;
+ modelview_matrix[0] = 0.0f;
+ modelview_matrix[1] = 0.0f;
+ modelview_matrix[2] = 0.0f;
+ modelview_matrix[3] = 0.0f;
+ modelview_matrix[4] = 0.0f;
+ modelview_matrix[5] = 0.0f;
+ modelview_matrix[6] = 0.0f;
+ modelview_matrix[7] = 0.0f;
+ modelview_matrix[8] = 0.0f;
+ modelview_matrix[9] = 0.0f;
+ modelview_matrix[10] = 0.0f;
+ modelview_matrix[11] = 0.0f;
+ modelview_matrix[12] = 0.0f;
+ modelview_matrix[13] = 0.0f;
+ modelview_matrix[14] = 0.0f;
+ modelview_matrix[15] = 0.0f;
+ projection_matrix[0] = 0.0f;
+ projection_matrix[1] = 0.0f;
+ projection_matrix[2] = 0.0f;
+ projection_matrix[3] = 0.0f;
+ projection_matrix[4] = 0.0f;
+ projection_matrix[5] = 0.0f;
+ projection_matrix[6] = 0.0f;
+ projection_matrix[7] = 0.0f;
+ projection_matrix[8] = 0.0f;
+ projection_matrix[9] = 0.0f;
+ projection_matrix[10] = 0.0f;
+ projection_matrix[11] = 0.0f;
+ projection_matrix[12] = 0.0f;
+ projection_matrix[13] = 0.0f;
+ projection_matrix[14] = 0.0f;
+ projection_matrix[15] = 0.0f;
pack_alignment = 4;
unpack_alignment = 4;
polygon_offset_factor = 0.0f;
@@ -179,6 +211,16 @@ void ContextState::InitState(const ContextState* prev_state) const {
hint_fragment_shader_derivative);
if ((line_width != prev_state->line_width))
glLineWidth(line_width);
+ if (feature_info_->feature_flags().chromium_path_rendering)
+ if (memcmp(prev_state->modelview_matrix,
+ modelview_matrix,
+ sizeof(GLfloat) * 16))
+ glMatrixLoadfEXT(GL_MODELVIEW_CHROMIUM, modelview_matrix);
+ if (feature_info_->feature_flags().chromium_path_rendering)
+ if (memcmp(prev_state->projection_matrix,
+ projection_matrix,
+ sizeof(GLfloat) * 16))
+ glMatrixLoadfEXT(GL_PROJECTION_CHROMIUM, projection_matrix);
if (prev_state->pack_alignment != pack_alignment)
glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment);
if (prev_state->unpack_alignment != unpack_alignment)
@@ -253,6 +295,10 @@ void ContextState::InitState(const ContextState* prev_state) const {
glHint(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES,
hint_fragment_shader_derivative);
glLineWidth(line_width);
+ if (feature_info_->feature_flags().chromium_path_rendering)
+ glMatrixLoadfEXT(GL_MODELVIEW_CHROMIUM, modelview_matrix);
+ if (feature_info_->feature_flags().chromium_path_rendering)
+ glMatrixLoadfEXT(GL_PROJECTION_CHROMIUM, projection_matrix);
glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment);
glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment);
glPolygonOffset(polygon_offset_factor, polygon_offset_units);
@@ -429,6 +475,22 @@ bool ContextState::GetStateAsGLint(GLenum pname,
params[0] = static_cast<GLint>(line_width);
}
return true;
+ case GL_MODELVIEW_MATRIX_CHROMIUM:
+ *num_written = 16;
+ if (params) {
+ for (size_t i = 0; i < 16; ++i) {
+ params[i] = static_cast<GLint>(modelview_matrix[i]);
+ }
+ }
+ return true;
+ case GL_PROJECTION_MATRIX_CHROMIUM:
+ *num_written = 16;
+ if (params) {
+ for (size_t i = 0; i < 16; ++i) {
+ params[i] = static_cast<GLint>(projection_matrix[i]);
+ }
+ }
+ return true;
case GL_PACK_ALIGNMENT:
*num_written = 1;
if (params) {
@@ -754,6 +816,18 @@ bool ContextState::GetStateAsGLfloat(GLenum pname,
params[0] = static_cast<GLfloat>(line_width);
}
return true;
+ case GL_MODELVIEW_MATRIX_CHROMIUM:
+ *num_written = 16;
+ if (params) {
+ memcpy(params, modelview_matrix, sizeof(GLfloat) * 16);
+ }
+ return true;
+ case GL_PROJECTION_MATRIX_CHROMIUM:
+ *num_written = 16;
+ if (params) {
+ memcpy(params, projection_matrix, sizeof(GLfloat) * 16);
+ }
+ return true;
case GL_PACK_ALIGNMENT:
*num_written = 1;
if (params) {

Powered by Google App Engine
This is Rietveld 408576698