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

Side by Side 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: Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file is auto-generated from 5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py 6 // gpu/command_buffer/build_gles2_cmd_buffer.py
7 // It's formatted by clang-format using chromium coding style: 7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename 8 // clang-format -i -style=chromium filename
9 // DO NOT EDIT! 9 // DO NOT EDIT!
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 projection_matrix[6] = 0.0f; 97 projection_matrix[6] = 0.0f;
98 projection_matrix[7] = 0.0f; 98 projection_matrix[7] = 0.0f;
99 projection_matrix[8] = 0.0f; 99 projection_matrix[8] = 0.0f;
100 projection_matrix[9] = 0.0f; 100 projection_matrix[9] = 0.0f;
101 projection_matrix[10] = 1.0f; 101 projection_matrix[10] = 1.0f;
102 projection_matrix[11] = 0.0f; 102 projection_matrix[11] = 0.0f;
103 projection_matrix[12] = 0.0f; 103 projection_matrix[12] = 0.0f;
104 projection_matrix[13] = 0.0f; 104 projection_matrix[13] = 0.0f;
105 projection_matrix[14] = 0.0f; 105 projection_matrix[14] = 0.0f;
106 projection_matrix[15] = 1.0f; 106 projection_matrix[15] = 1.0f;
107 stencil_path_func = GL_ALWAYS;
108 stencil_path_ref = 0;
109 stencil_path_mask = 0xFFFFFFFFU;
107 pack_alignment = 4; 110 pack_alignment = 4;
108 unpack_alignment = 4; 111 unpack_alignment = 4;
109 polygon_offset_factor = 0.0f; 112 polygon_offset_factor = 0.0f;
110 polygon_offset_units = 0.0f; 113 polygon_offset_units = 0.0f;
111 sample_coverage_value = 1.0f; 114 sample_coverage_value = 1.0f;
112 sample_coverage_invert = false; 115 sample_coverage_invert = false;
113 scissor_x = 0; 116 scissor_x = 0;
114 scissor_y = 0; 117 scissor_y = 0;
115 scissor_width = 1; 118 scissor_width = 1;
116 scissor_height = 1; 119 scissor_height = 1;
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 sizeof(GLfloat) * 16)) { 272 sizeof(GLfloat) * 16)) {
270 glMatrixLoadfEXT(GL_PATH_MODELVIEW_CHROMIUM, modelview_matrix); 273 glMatrixLoadfEXT(GL_PATH_MODELVIEW_CHROMIUM, modelview_matrix);
271 } 274 }
272 } 275 }
273 if (feature_info_->feature_flags().chromium_path_rendering) { 276 if (feature_info_->feature_flags().chromium_path_rendering) {
274 if (memcmp(prev_state->projection_matrix, projection_matrix, 277 if (memcmp(prev_state->projection_matrix, projection_matrix,
275 sizeof(GLfloat) * 16)) { 278 sizeof(GLfloat) * 16)) {
276 glMatrixLoadfEXT(GL_PATH_PROJECTION_CHROMIUM, projection_matrix); 279 glMatrixLoadfEXT(GL_PATH_PROJECTION_CHROMIUM, projection_matrix);
277 } 280 }
278 } 281 }
282 if (feature_info_->feature_flags().chromium_path_rendering)
283 if ((stencil_path_func != prev_state->stencil_path_func) ||
284 (stencil_path_ref != prev_state->stencil_path_ref) ||
285 (stencil_path_mask != prev_state->stencil_path_mask))
286 glPathStencilFuncNV(stencil_path_func, stencil_path_ref,
287 stencil_path_mask);
279 if (prev_state->pack_alignment != pack_alignment) { 288 if (prev_state->pack_alignment != pack_alignment) {
280 glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment); 289 glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment);
281 } 290 }
282 if (prev_state->unpack_alignment != unpack_alignment) { 291 if (prev_state->unpack_alignment != unpack_alignment) {
283 glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment); 292 glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment);
284 } 293 }
285 if ((polygon_offset_factor != prev_state->polygon_offset_factor) || 294 if ((polygon_offset_factor != prev_state->polygon_offset_factor) ||
286 (polygon_offset_units != prev_state->polygon_offset_units)) 295 (polygon_offset_units != prev_state->polygon_offset_units))
287 glPolygonOffset(polygon_offset_factor, polygon_offset_units); 296 glPolygonOffset(polygon_offset_factor, polygon_offset_units);
288 if ((sample_coverage_value != prev_state->sample_coverage_value) || 297 if ((sample_coverage_value != prev_state->sample_coverage_value) ||
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 glHint(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES, 357 glHint(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES,
349 hint_fragment_shader_derivative); 358 hint_fragment_shader_derivative);
350 } 359 }
351 glLineWidth(line_width); 360 glLineWidth(line_width);
352 if (feature_info_->feature_flags().chromium_path_rendering) { 361 if (feature_info_->feature_flags().chromium_path_rendering) {
353 glMatrixLoadfEXT(GL_PATH_MODELVIEW_CHROMIUM, modelview_matrix); 362 glMatrixLoadfEXT(GL_PATH_MODELVIEW_CHROMIUM, modelview_matrix);
354 } 363 }
355 if (feature_info_->feature_flags().chromium_path_rendering) { 364 if (feature_info_->feature_flags().chromium_path_rendering) {
356 glMatrixLoadfEXT(GL_PATH_PROJECTION_CHROMIUM, projection_matrix); 365 glMatrixLoadfEXT(GL_PATH_PROJECTION_CHROMIUM, projection_matrix);
357 } 366 }
367 if (feature_info_->feature_flags().chromium_path_rendering)
368 glPathStencilFuncNV(stencil_path_func, stencil_path_ref,
369 stencil_path_mask);
358 glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment); 370 glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment);
359 glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment); 371 glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment);
360 glPolygonOffset(polygon_offset_factor, polygon_offset_units); 372 glPolygonOffset(polygon_offset_factor, polygon_offset_units);
361 glSampleCoverage(sample_coverage_value, sample_coverage_invert); 373 glSampleCoverage(sample_coverage_value, sample_coverage_invert);
362 glScissor(scissor_x, scissor_y, scissor_width, scissor_height); 374 glScissor(scissor_x, scissor_y, scissor_width, scissor_height);
363 glStencilFuncSeparate(GL_FRONT, stencil_front_func, stencil_front_ref, 375 glStencilFuncSeparate(GL_FRONT, stencil_front_func, stencil_front_ref,
364 stencil_front_mask); 376 stencil_front_mask);
365 glStencilFuncSeparate(GL_BACK, stencil_back_func, stencil_back_ref, 377 glStencilFuncSeparate(GL_BACK, stencil_back_func, stencil_back_ref,
366 stencil_back_mask); 378 stencil_back_mask);
367 glStencilMaskSeparate(GL_FRONT, cached_stencil_front_writemask); 379 glStencilMaskSeparate(GL_FRONT, cached_stencil_front_writemask);
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 } 552 }
541 return true; 553 return true;
542 case GL_PATH_PROJECTION_MATRIX_CHROMIUM: 554 case GL_PATH_PROJECTION_MATRIX_CHROMIUM:
543 *num_written = 16; 555 *num_written = 16;
544 if (params) { 556 if (params) {
545 for (size_t i = 0; i < 16; ++i) { 557 for (size_t i = 0; i < 16; ++i) {
546 params[i] = static_cast<GLint>(round(projection_matrix[i])); 558 params[i] = static_cast<GLint>(round(projection_matrix[i]));
547 } 559 }
548 } 560 }
549 return true; 561 return true;
562 case GL_PATH_STENCIL_FUNC_CHROMIUM:
563 *num_written = 1;
564 if (params) {
565 params[0] = static_cast<GLint>(stencil_path_func);
566 }
567 return true;
568 case GL_PATH_STENCIL_REF_CHROMIUM:
569 *num_written = 1;
570 if (params) {
571 params[0] = static_cast<GLint>(stencil_path_ref);
572 }
573 return true;
574 case GL_PATH_STENCIL_VALUE_MASK_CHROMIUM:
575 *num_written = 1;
576 if (params) {
577 params[0] = static_cast<GLint>(stencil_path_mask);
578 }
579 return true;
550 case GL_PACK_ALIGNMENT: 580 case GL_PACK_ALIGNMENT:
551 *num_written = 1; 581 *num_written = 1;
552 if (params) { 582 if (params) {
553 params[0] = static_cast<GLint>(pack_alignment); 583 params[0] = static_cast<GLint>(pack_alignment);
554 } 584 }
555 return true; 585 return true;
556 case GL_UNPACK_ALIGNMENT: 586 case GL_UNPACK_ALIGNMENT:
557 *num_written = 1; 587 *num_written = 1;
558 if (params) { 588 if (params) {
559 params[0] = static_cast<GLint>(unpack_alignment); 589 params[0] = static_cast<GLint>(unpack_alignment);
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 if (params) { 920 if (params) {
891 memcpy(params, modelview_matrix, sizeof(GLfloat) * 16); 921 memcpy(params, modelview_matrix, sizeof(GLfloat) * 16);
892 } 922 }
893 return true; 923 return true;
894 case GL_PATH_PROJECTION_MATRIX_CHROMIUM: 924 case GL_PATH_PROJECTION_MATRIX_CHROMIUM:
895 *num_written = 16; 925 *num_written = 16;
896 if (params) { 926 if (params) {
897 memcpy(params, projection_matrix, sizeof(GLfloat) * 16); 927 memcpy(params, projection_matrix, sizeof(GLfloat) * 16);
898 } 928 }
899 return true; 929 return true;
930 case GL_PATH_STENCIL_FUNC_CHROMIUM:
931 *num_written = 1;
932 if (params) {
933 params[0] = static_cast<GLfloat>(stencil_path_func);
934 }
935 return true;
936 case GL_PATH_STENCIL_REF_CHROMIUM:
937 *num_written = 1;
938 if (params) {
939 params[0] = static_cast<GLfloat>(stencil_path_ref);
940 }
941 return true;
942 case GL_PATH_STENCIL_VALUE_MASK_CHROMIUM:
943 *num_written = 1;
944 if (params) {
945 params[0] = static_cast<GLfloat>(stencil_path_mask);
946 }
947 return true;
900 case GL_PACK_ALIGNMENT: 948 case GL_PACK_ALIGNMENT:
901 *num_written = 1; 949 *num_written = 1;
902 if (params) { 950 if (params) {
903 params[0] = static_cast<GLfloat>(pack_alignment); 951 params[0] = static_cast<GLfloat>(pack_alignment);
904 } 952 }
905 return true; 953 return true;
906 case GL_UNPACK_ALIGNMENT: 954 case GL_UNPACK_ALIGNMENT:
907 *num_written = 1; 955 *num_written = 1;
908 if (params) { 956 if (params) {
909 params[0] = static_cast<GLfloat>(unpack_alignment); 957 params[0] = static_cast<GLfloat>(unpack_alignment);
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 if (params) { 1148 if (params) {
1101 params[0] = 1149 params[0] =
1102 static_cast<GLfloat>(enable_flags.primitive_restart_fixed_index); 1150 static_cast<GLfloat>(enable_flags.primitive_restart_fixed_index);
1103 } 1151 }
1104 return true; 1152 return true;
1105 default: 1153 default:
1106 return false; 1154 return false;
1107 } 1155 }
1108 } 1156 }
1109 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ 1157 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698