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

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

Issue 169403005: command_buffer: Implement path rendering functions for CHROMIUM_path_rendering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nv-pr-02-texgen
Patch Set: improve parameter validation and write up the extension .txt file 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 60d2b39e1a29859e0b00125f4bd206894c5deacb..d6234e4d5b57543d7e967a38ca7f1a8425e98bb1 100644
--- a/gpu/command_buffer/service/context_state_impl_autogen.h
+++ b/gpu/command_buffer/service/context_state_impl_autogen.h
@@ -86,6 +86,9 @@ void ContextState::Initialize() {
projection_matrix[13] = 0.0f;
projection_matrix[14] = 0.0f;
projection_matrix[15] = 1.0f;
+ stencil_path_func = GL_ALWAYS;
+ stencil_path_ref = 0;
+ stencil_path_mask = 0xFFFFFFFFU;
pack_alignment = 4;
unpack_alignment = 4;
polygon_offset_factor = 0.0f;
@@ -222,6 +225,12 @@ void ContextState::InitState(const ContextState* prev_state) const {
projection_matrix,
sizeof(GLfloat) * 16))
glMatrixLoadfEXT(GL_PROJECTION_CHROMIUM, projection_matrix);
+ if (feature_info_->feature_flags().chromium_path_rendering)
+ if ((stencil_path_func != prev_state->stencil_path_func) ||
+ (stencil_path_ref != prev_state->stencil_path_ref) ||
+ (stencil_path_mask != prev_state->stencil_path_mask))
+ glPathStencilFuncNV(
+ stencil_path_func, stencil_path_ref, stencil_path_mask);
if (prev_state->pack_alignment != pack_alignment)
glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment);
if (prev_state->unpack_alignment != unpack_alignment)
@@ -300,6 +309,9 @@ void ContextState::InitState(const ContextState* prev_state) const {
glMatrixLoadfEXT(GL_MODELVIEW_CHROMIUM, modelview_matrix);
if (feature_info_->feature_flags().chromium_path_rendering)
glMatrixLoadfEXT(GL_PROJECTION_CHROMIUM, projection_matrix);
+ if (feature_info_->feature_flags().chromium_path_rendering)
+ glPathStencilFuncNV(
+ stencil_path_func, stencil_path_ref, stencil_path_mask);
glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment);
glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment);
glPolygonOffset(polygon_offset_factor, polygon_offset_units);
@@ -492,6 +504,24 @@ bool ContextState::GetStateAsGLint(GLenum pname,
}
}
return true;
+ case GL_PATH_STENCIL_FUNC_CHROMIUM:
+ *num_written = 1;
+ if (params) {
+ params[0] = static_cast<GLint>(stencil_path_func);
+ }
+ return true;
+ case GL_PATH_STENCIL_REF_CHROMIUM:
+ *num_written = 1;
+ if (params) {
+ params[0] = static_cast<GLint>(stencil_path_ref);
+ }
+ return true;
+ case GL_PATH_STENCIL_VALUE_MASK_CHROMIUM:
+ *num_written = 1;
+ if (params) {
+ params[0] = static_cast<GLint>(stencil_path_mask);
+ }
+ return true;
case GL_PACK_ALIGNMENT:
*num_written = 1;
if (params) {
@@ -829,6 +859,24 @@ bool ContextState::GetStateAsGLfloat(GLenum pname,
memcpy(params, projection_matrix, sizeof(GLfloat) * 16);
}
return true;
+ case GL_PATH_STENCIL_FUNC_CHROMIUM:
+ *num_written = 1;
+ if (params) {
+ params[0] = static_cast<GLfloat>(stencil_path_func);
+ }
+ return true;
+ case GL_PATH_STENCIL_REF_CHROMIUM:
+ *num_written = 1;
+ if (params) {
+ params[0] = static_cast<GLfloat>(stencil_path_ref);
+ }
+ return true;
+ case GL_PATH_STENCIL_VALUE_MASK_CHROMIUM:
+ *num_written = 1;
+ if (params) {
+ params[0] = static_cast<GLfloat>(stencil_path_mask);
+ }
+ return true;
case GL_PACK_ALIGNMENT:
*num_written = 1;
if (params) {

Powered by Google App Engine
This is Rietveld 408576698