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

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: rebase and cleanup ids Created 6 years, 2 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 projection_matrix[6] = 0.0f; 93 projection_matrix[6] = 0.0f;
94 projection_matrix[7] = 0.0f; 94 projection_matrix[7] = 0.0f;
95 projection_matrix[8] = 0.0f; 95 projection_matrix[8] = 0.0f;
96 projection_matrix[9] = 0.0f; 96 projection_matrix[9] = 0.0f;
97 projection_matrix[10] = 1.0f; 97 projection_matrix[10] = 1.0f;
98 projection_matrix[11] = 0.0f; 98 projection_matrix[11] = 0.0f;
99 projection_matrix[12] = 0.0f; 99 projection_matrix[12] = 0.0f;
100 projection_matrix[13] = 0.0f; 100 projection_matrix[13] = 0.0f;
101 projection_matrix[14] = 0.0f; 101 projection_matrix[14] = 0.0f;
102 projection_matrix[15] = 1.0f; 102 projection_matrix[15] = 1.0f;
103 stencil_path_func = GL_ALWAYS;
104 stencil_path_ref = 0;
105 stencil_path_mask = 0xFFFFFFFFU;
103 pack_alignment = 4; 106 pack_alignment = 4;
104 unpack_alignment = 4; 107 unpack_alignment = 4;
105 polygon_offset_factor = 0.0f; 108 polygon_offset_factor = 0.0f;
106 polygon_offset_units = 0.0f; 109 polygon_offset_units = 0.0f;
107 sample_coverage_value = 1.0f; 110 sample_coverage_value = 1.0f;
108 sample_coverage_invert = false; 111 sample_coverage_invert = false;
109 scissor_x = 0; 112 scissor_x = 0;
110 scissor_y = 0; 113 scissor_y = 0;
111 scissor_width = 1; 114 scissor_width = 1;
112 scissor_height = 1; 115 scissor_height = 1;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 glMatrixLoadfEXT(GL_PATH_MODELVIEW_CHROMIUM, modelview_matrix); 249 glMatrixLoadfEXT(GL_PATH_MODELVIEW_CHROMIUM, modelview_matrix);
247 } 250 }
248 } 251 }
249 if (feature_info_->feature_flags().chromium_path_rendering) { 252 if (feature_info_->feature_flags().chromium_path_rendering) {
250 if (memcmp(prev_state->projection_matrix, 253 if (memcmp(prev_state->projection_matrix,
251 projection_matrix, 254 projection_matrix,
252 sizeof(GLfloat) * 16)) { 255 sizeof(GLfloat) * 16)) {
253 glMatrixLoadfEXT(GL_PATH_PROJECTION_CHROMIUM, projection_matrix); 256 glMatrixLoadfEXT(GL_PATH_PROJECTION_CHROMIUM, projection_matrix);
254 } 257 }
255 } 258 }
259 if (feature_info_->feature_flags().chromium_path_rendering)
260 if ((stencil_path_func != prev_state->stencil_path_func) ||
261 (stencil_path_ref != prev_state->stencil_path_ref) ||
262 (stencil_path_mask != prev_state->stencil_path_mask))
263 glPathStencilFuncNV(
264 stencil_path_func, stencil_path_ref, stencil_path_mask);
256 if (prev_state->pack_alignment != pack_alignment) { 265 if (prev_state->pack_alignment != pack_alignment) {
257 glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment); 266 glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment);
258 } 267 }
259 if (prev_state->unpack_alignment != unpack_alignment) { 268 if (prev_state->unpack_alignment != unpack_alignment) {
260 glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment); 269 glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment);
261 } 270 }
262 if ((polygon_offset_factor != prev_state->polygon_offset_factor) || 271 if ((polygon_offset_factor != prev_state->polygon_offset_factor) ||
263 (polygon_offset_units != prev_state->polygon_offset_units)) 272 (polygon_offset_units != prev_state->polygon_offset_units))
264 glPolygonOffset(polygon_offset_factor, polygon_offset_units); 273 glPolygonOffset(polygon_offset_factor, polygon_offset_units);
265 if ((sample_coverage_value != prev_state->sample_coverage_value) || 274 if ((sample_coverage_value != prev_state->sample_coverage_value) ||
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 glHint(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES, 342 glHint(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES,
334 hint_fragment_shader_derivative); 343 hint_fragment_shader_derivative);
335 } 344 }
336 glLineWidth(line_width); 345 glLineWidth(line_width);
337 if (feature_info_->feature_flags().chromium_path_rendering) { 346 if (feature_info_->feature_flags().chromium_path_rendering) {
338 glMatrixLoadfEXT(GL_PATH_MODELVIEW_CHROMIUM, modelview_matrix); 347 glMatrixLoadfEXT(GL_PATH_MODELVIEW_CHROMIUM, modelview_matrix);
339 } 348 }
340 if (feature_info_->feature_flags().chromium_path_rendering) { 349 if (feature_info_->feature_flags().chromium_path_rendering) {
341 glMatrixLoadfEXT(GL_PATH_PROJECTION_CHROMIUM, projection_matrix); 350 glMatrixLoadfEXT(GL_PATH_PROJECTION_CHROMIUM, projection_matrix);
342 } 351 }
352 if (feature_info_->feature_flags().chromium_path_rendering)
353 glPathStencilFuncNV(
354 stencil_path_func, stencil_path_ref, stencil_path_mask);
343 glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment); 355 glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment);
344 glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment); 356 glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment);
345 glPolygonOffset(polygon_offset_factor, polygon_offset_units); 357 glPolygonOffset(polygon_offset_factor, polygon_offset_units);
346 glSampleCoverage(sample_coverage_value, sample_coverage_invert); 358 glSampleCoverage(sample_coverage_value, sample_coverage_invert);
347 glScissor(scissor_x, scissor_y, scissor_width, scissor_height); 359 glScissor(scissor_x, scissor_y, scissor_width, scissor_height);
348 glStencilFuncSeparate( 360 glStencilFuncSeparate(
349 GL_FRONT, stencil_front_func, stencil_front_ref, stencil_front_mask); 361 GL_FRONT, stencil_front_func, stencil_front_ref, stencil_front_mask);
350 glStencilFuncSeparate( 362 glStencilFuncSeparate(
351 GL_BACK, stencil_back_func, stencil_back_ref, stencil_back_mask); 363 GL_BACK, stencil_back_func, stencil_back_ref, stencil_back_mask);
352 glStencilMaskSeparate(GL_FRONT, cached_stencil_front_writemask); 364 glStencilMaskSeparate(GL_FRONT, cached_stencil_front_writemask);
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 } 537 }
526 return true; 538 return true;
527 case GL_PATH_PROJECTION_MATRIX_CHROMIUM: 539 case GL_PATH_PROJECTION_MATRIX_CHROMIUM:
528 *num_written = 16; 540 *num_written = 16;
529 if (params) { 541 if (params) {
530 for (size_t i = 0; i < 16; ++i) { 542 for (size_t i = 0; i < 16; ++i) {
531 params[i] = static_cast<GLint>(round(projection_matrix[i])); 543 params[i] = static_cast<GLint>(round(projection_matrix[i]));
532 } 544 }
533 } 545 }
534 return true; 546 return true;
547 case GL_PATH_STENCIL_FUNC_CHROMIUM:
548 *num_written = 1;
549 if (params) {
550 params[0] = static_cast<GLint>(stencil_path_func);
551 }
552 return true;
553 case GL_PATH_STENCIL_REF_CHROMIUM:
554 *num_written = 1;
555 if (params) {
556 params[0] = static_cast<GLint>(stencil_path_ref);
557 }
558 return true;
559 case GL_PATH_STENCIL_VALUE_MASK_CHROMIUM:
560 *num_written = 1;
561 if (params) {
562 params[0] = static_cast<GLint>(stencil_path_mask);
563 }
564 return true;
535 case GL_PACK_ALIGNMENT: 565 case GL_PACK_ALIGNMENT:
536 *num_written = 1; 566 *num_written = 1;
537 if (params) { 567 if (params) {
538 params[0] = static_cast<GLint>(pack_alignment); 568 params[0] = static_cast<GLint>(pack_alignment);
539 } 569 }
540 return true; 570 return true;
541 case GL_UNPACK_ALIGNMENT: 571 case GL_UNPACK_ALIGNMENT:
542 *num_written = 1; 572 *num_written = 1;
543 if (params) { 573 if (params) {
544 params[0] = static_cast<GLint>(unpack_alignment); 574 params[0] = static_cast<GLint>(unpack_alignment);
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 if (params) { 892 if (params) {
863 memcpy(params, modelview_matrix, sizeof(GLfloat) * 16); 893 memcpy(params, modelview_matrix, sizeof(GLfloat) * 16);
864 } 894 }
865 return true; 895 return true;
866 case GL_PATH_PROJECTION_MATRIX_CHROMIUM: 896 case GL_PATH_PROJECTION_MATRIX_CHROMIUM:
867 *num_written = 16; 897 *num_written = 16;
868 if (params) { 898 if (params) {
869 memcpy(params, projection_matrix, sizeof(GLfloat) * 16); 899 memcpy(params, projection_matrix, sizeof(GLfloat) * 16);
870 } 900 }
871 return true; 901 return true;
902 case GL_PATH_STENCIL_FUNC_CHROMIUM:
903 *num_written = 1;
904 if (params) {
905 params[0] = static_cast<GLfloat>(stencil_path_func);
906 }
907 return true;
908 case GL_PATH_STENCIL_REF_CHROMIUM:
909 *num_written = 1;
910 if (params) {
911 params[0] = static_cast<GLfloat>(stencil_path_ref);
912 }
913 return true;
914 case GL_PATH_STENCIL_VALUE_MASK_CHROMIUM:
915 *num_written = 1;
916 if (params) {
917 params[0] = static_cast<GLfloat>(stencil_path_mask);
918 }
919 return true;
872 case GL_PACK_ALIGNMENT: 920 case GL_PACK_ALIGNMENT:
873 *num_written = 1; 921 *num_written = 1;
874 if (params) { 922 if (params) {
875 params[0] = static_cast<GLfloat>(pack_alignment); 923 params[0] = static_cast<GLfloat>(pack_alignment);
876 } 924 }
877 return true; 925 return true;
878 case GL_UNPACK_ALIGNMENT: 926 case GL_UNPACK_ALIGNMENT:
879 *num_written = 1; 927 *num_written = 1;
880 if (params) { 928 if (params) {
881 params[0] = static_cast<GLfloat>(unpack_alignment); 929 params[0] = static_cast<GLfloat>(unpack_alignment);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 *num_written = 1; 1107 *num_written = 1;
1060 if (params) { 1108 if (params) {
1061 params[0] = static_cast<GLfloat>(enable_flags.stencil_test); 1109 params[0] = static_cast<GLfloat>(enable_flags.stencil_test);
1062 } 1110 }
1063 return true; 1111 return true;
1064 default: 1112 default:
1065 return false; 1113 return false;
1066 } 1114 }
1067 } 1115 }
1068 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ 1116 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698