| OLD | NEW |
| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 cull_mode = GL_BACK; | 61 cull_mode = GL_BACK; |
| 62 depth_func = GL_LESS; | 62 depth_func = GL_LESS; |
| 63 depth_mask = true; | 63 depth_mask = true; |
| 64 cached_depth_mask = true; | 64 cached_depth_mask = true; |
| 65 z_near = 0.0f; | 65 z_near = 0.0f; |
| 66 z_far = 1.0f; | 66 z_far = 1.0f; |
| 67 front_face = GL_CCW; | 67 front_face = GL_CCW; |
| 68 hint_generate_mipmap = GL_DONT_CARE; | 68 hint_generate_mipmap = GL_DONT_CARE; |
| 69 hint_fragment_shader_derivative = GL_DONT_CARE; | 69 hint_fragment_shader_derivative = GL_DONT_CARE; |
| 70 line_width = 1.0f; | 70 line_width = 1.0f; |
| 71 modelview_matrix[0] = 1.0f; |
| 72 modelview_matrix[1] = 0.0f; |
| 73 modelview_matrix[2] = 0.0f; |
| 74 modelview_matrix[3] = 0.0f; |
| 75 modelview_matrix[4] = 0.0f; |
| 76 modelview_matrix[5] = 1.0f; |
| 77 modelview_matrix[6] = 0.0f; |
| 78 modelview_matrix[7] = 0.0f; |
| 79 modelview_matrix[8] = 0.0f; |
| 80 modelview_matrix[9] = 0.0f; |
| 81 modelview_matrix[10] = 1.0f; |
| 82 modelview_matrix[11] = 0.0f; |
| 83 modelview_matrix[12] = 0.0f; |
| 84 modelview_matrix[13] = 0.0f; |
| 85 modelview_matrix[14] = 0.0f; |
| 86 modelview_matrix[15] = 1.0f; |
| 87 projection_matrix[0] = 1.0f; |
| 88 projection_matrix[1] = 0.0f; |
| 89 projection_matrix[2] = 0.0f; |
| 90 projection_matrix[3] = 0.0f; |
| 91 projection_matrix[4] = 0.0f; |
| 92 projection_matrix[5] = 1.0f; |
| 93 projection_matrix[6] = 0.0f; |
| 94 projection_matrix[7] = 0.0f; |
| 95 projection_matrix[8] = 0.0f; |
| 96 projection_matrix[9] = 0.0f; |
| 97 projection_matrix[10] = 1.0f; |
| 98 projection_matrix[11] = 0.0f; |
| 99 projection_matrix[12] = 0.0f; |
| 100 projection_matrix[13] = 0.0f; |
| 101 projection_matrix[14] = 0.0f; |
| 102 projection_matrix[15] = 1.0f; |
| 71 pack_alignment = 4; | 103 pack_alignment = 4; |
| 72 unpack_alignment = 4; | 104 unpack_alignment = 4; |
| 73 polygon_offset_factor = 0.0f; | 105 polygon_offset_factor = 0.0f; |
| 74 polygon_offset_units = 0.0f; | 106 polygon_offset_units = 0.0f; |
| 75 sample_coverage_value = 1.0f; | 107 sample_coverage_value = 1.0f; |
| 76 sample_coverage_invert = false; | 108 sample_coverage_invert = false; |
| 77 scissor_x = 0; | 109 scissor_x = 0; |
| 78 scissor_y = 0; | 110 scissor_y = 0; |
| 79 scissor_width = 1; | 111 scissor_width = 1; |
| 80 scissor_height = 1; | 112 scissor_height = 1; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 if ((cull_mode != prev_state->cull_mode)) | 220 if ((cull_mode != prev_state->cull_mode)) |
| 189 glCullFace(cull_mode); | 221 glCullFace(cull_mode); |
| 190 if ((depth_func != prev_state->depth_func)) | 222 if ((depth_func != prev_state->depth_func)) |
| 191 glDepthFunc(depth_func); | 223 glDepthFunc(depth_func); |
| 192 if ((cached_depth_mask != prev_state->cached_depth_mask)) | 224 if ((cached_depth_mask != prev_state->cached_depth_mask)) |
| 193 glDepthMask(cached_depth_mask); | 225 glDepthMask(cached_depth_mask); |
| 194 if ((z_near != prev_state->z_near) || (z_far != prev_state->z_far)) | 226 if ((z_near != prev_state->z_near) || (z_far != prev_state->z_far)) |
| 195 glDepthRange(z_near, z_far); | 227 glDepthRange(z_near, z_far); |
| 196 if ((front_face != prev_state->front_face)) | 228 if ((front_face != prev_state->front_face)) |
| 197 glFrontFace(front_face); | 229 glFrontFace(front_face); |
| 198 if (prev_state->hint_generate_mipmap != hint_generate_mipmap) | 230 if (prev_state->hint_generate_mipmap != hint_generate_mipmap) { |
| 199 glHint(GL_GENERATE_MIPMAP_HINT, hint_generate_mipmap); | 231 glHint(GL_GENERATE_MIPMAP_HINT, hint_generate_mipmap); |
| 200 if (feature_info_->feature_flags().oes_standard_derivatives) | 232 } |
| 233 if (feature_info_->feature_flags().oes_standard_derivatives) { |
| 201 if (prev_state->hint_fragment_shader_derivative != | 234 if (prev_state->hint_fragment_shader_derivative != |
| 202 hint_fragment_shader_derivative) | 235 hint_fragment_shader_derivative) { |
| 203 glHint(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES, | 236 glHint(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES, |
| 204 hint_fragment_shader_derivative); | 237 hint_fragment_shader_derivative); |
| 238 } |
| 239 } |
| 205 if ((line_width != prev_state->line_width)) | 240 if ((line_width != prev_state->line_width)) |
| 206 glLineWidth(line_width); | 241 glLineWidth(line_width); |
| 207 if (prev_state->pack_alignment != pack_alignment) | 242 if (feature_info_->feature_flags().chromium_path_rendering) { |
| 243 if (memcmp(prev_state->modelview_matrix, |
| 244 modelview_matrix, |
| 245 sizeof(GLfloat) * 16)) { |
| 246 glMatrixLoadfEXT(GL_PATH_MODELVIEW_CHROMIUM, modelview_matrix); |
| 247 } |
| 248 } |
| 249 if (feature_info_->feature_flags().chromium_path_rendering) { |
| 250 if (memcmp(prev_state->projection_matrix, |
| 251 projection_matrix, |
| 252 sizeof(GLfloat) * 16)) { |
| 253 glMatrixLoadfEXT(GL_PATH_PROJECTION_CHROMIUM, projection_matrix); |
| 254 } |
| 255 } |
| 256 if (prev_state->pack_alignment != pack_alignment) { |
| 208 glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment); | 257 glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment); |
| 209 if (prev_state->unpack_alignment != unpack_alignment) | 258 } |
| 259 if (prev_state->unpack_alignment != unpack_alignment) { |
| 210 glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment); | 260 glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment); |
| 261 } |
| 211 if ((polygon_offset_factor != prev_state->polygon_offset_factor) || | 262 if ((polygon_offset_factor != prev_state->polygon_offset_factor) || |
| 212 (polygon_offset_units != prev_state->polygon_offset_units)) | 263 (polygon_offset_units != prev_state->polygon_offset_units)) |
| 213 glPolygonOffset(polygon_offset_factor, polygon_offset_units); | 264 glPolygonOffset(polygon_offset_factor, polygon_offset_units); |
| 214 if ((sample_coverage_value != prev_state->sample_coverage_value) || | 265 if ((sample_coverage_value != prev_state->sample_coverage_value) || |
| 215 (sample_coverage_invert != prev_state->sample_coverage_invert)) | 266 (sample_coverage_invert != prev_state->sample_coverage_invert)) |
| 216 glSampleCoverage(sample_coverage_value, sample_coverage_invert); | 267 glSampleCoverage(sample_coverage_value, sample_coverage_invert); |
| 217 if ((scissor_x != prev_state->scissor_x) || | 268 if ((scissor_x != prev_state->scissor_x) || |
| 218 (scissor_y != prev_state->scissor_y) || | 269 (scissor_y != prev_state->scissor_y) || |
| 219 (scissor_width != prev_state->scissor_width) || | 270 (scissor_width != prev_state->scissor_width) || |
| 220 (scissor_height != prev_state->scissor_height)) | 271 (scissor_height != prev_state->scissor_height)) |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 glColorMask(cached_color_mask_red, | 322 glColorMask(cached_color_mask_red, |
| 272 cached_color_mask_green, | 323 cached_color_mask_green, |
| 273 cached_color_mask_blue, | 324 cached_color_mask_blue, |
| 274 cached_color_mask_alpha); | 325 cached_color_mask_alpha); |
| 275 glCullFace(cull_mode); | 326 glCullFace(cull_mode); |
| 276 glDepthFunc(depth_func); | 327 glDepthFunc(depth_func); |
| 277 glDepthMask(cached_depth_mask); | 328 glDepthMask(cached_depth_mask); |
| 278 glDepthRange(z_near, z_far); | 329 glDepthRange(z_near, z_far); |
| 279 glFrontFace(front_face); | 330 glFrontFace(front_face); |
| 280 glHint(GL_GENERATE_MIPMAP_HINT, hint_generate_mipmap); | 331 glHint(GL_GENERATE_MIPMAP_HINT, hint_generate_mipmap); |
| 281 if (feature_info_->feature_flags().oes_standard_derivatives) | 332 if (feature_info_->feature_flags().oes_standard_derivatives) { |
| 282 glHint(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES, | 333 glHint(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES, |
| 283 hint_fragment_shader_derivative); | 334 hint_fragment_shader_derivative); |
| 335 } |
| 284 glLineWidth(line_width); | 336 glLineWidth(line_width); |
| 337 if (feature_info_->feature_flags().chromium_path_rendering) { |
| 338 glMatrixLoadfEXT(GL_PATH_MODELVIEW_CHROMIUM, modelview_matrix); |
| 339 } |
| 340 if (feature_info_->feature_flags().chromium_path_rendering) { |
| 341 glMatrixLoadfEXT(GL_PATH_PROJECTION_CHROMIUM, projection_matrix); |
| 342 } |
| 285 glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment); | 343 glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment); |
| 286 glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment); | 344 glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment); |
| 287 glPolygonOffset(polygon_offset_factor, polygon_offset_units); | 345 glPolygonOffset(polygon_offset_factor, polygon_offset_units); |
| 288 glSampleCoverage(sample_coverage_value, sample_coverage_invert); | 346 glSampleCoverage(sample_coverage_value, sample_coverage_invert); |
| 289 glScissor(scissor_x, scissor_y, scissor_width, scissor_height); | 347 glScissor(scissor_x, scissor_y, scissor_width, scissor_height); |
| 290 glStencilFuncSeparate( | 348 glStencilFuncSeparate( |
| 291 GL_FRONT, stencil_front_func, stencil_front_ref, stencil_front_mask); | 349 GL_FRONT, stencil_front_func, stencil_front_ref, stencil_front_mask); |
| 292 glStencilFuncSeparate( | 350 glStencilFuncSeparate( |
| 293 GL_BACK, stencil_back_func, stencil_back_ref, stencil_back_mask); | 351 GL_BACK, stencil_back_func, stencil_back_ref, stencil_back_mask); |
| 294 glStencilMaskSeparate(GL_FRONT, cached_stencil_front_writemask); | 352 glStencilMaskSeparate(GL_FRONT, cached_stencil_front_writemask); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 if (params) { | 509 if (params) { |
| 452 params[0] = static_cast<GLint>(hint_fragment_shader_derivative); | 510 params[0] = static_cast<GLint>(hint_fragment_shader_derivative); |
| 453 } | 511 } |
| 454 return true; | 512 return true; |
| 455 case GL_LINE_WIDTH: | 513 case GL_LINE_WIDTH: |
| 456 *num_written = 1; | 514 *num_written = 1; |
| 457 if (params) { | 515 if (params) { |
| 458 params[0] = static_cast<GLint>(line_width); | 516 params[0] = static_cast<GLint>(line_width); |
| 459 } | 517 } |
| 460 return true; | 518 return true; |
| 519 case GL_PATH_MODELVIEW_MATRIX_CHROMIUM: |
| 520 *num_written = 16; |
| 521 if (params) { |
| 522 for (size_t i = 0; i < 16; ++i) { |
| 523 params[i] = static_cast<GLint>(round(modelview_matrix[i])); |
| 524 } |
| 525 } |
| 526 return true; |
| 527 case GL_PATH_PROJECTION_MATRIX_CHROMIUM: |
| 528 *num_written = 16; |
| 529 if (params) { |
| 530 for (size_t i = 0; i < 16; ++i) { |
| 531 params[i] = static_cast<GLint>(round(projection_matrix[i])); |
| 532 } |
| 533 } |
| 534 return true; |
| 461 case GL_PACK_ALIGNMENT: | 535 case GL_PACK_ALIGNMENT: |
| 462 *num_written = 1; | 536 *num_written = 1; |
| 463 if (params) { | 537 if (params) { |
| 464 params[0] = static_cast<GLint>(pack_alignment); | 538 params[0] = static_cast<GLint>(pack_alignment); |
| 465 } | 539 } |
| 466 return true; | 540 return true; |
| 467 case GL_UNPACK_ALIGNMENT: | 541 case GL_UNPACK_ALIGNMENT: |
| 468 *num_written = 1; | 542 *num_written = 1; |
| 469 if (params) { | 543 if (params) { |
| 470 params[0] = static_cast<GLint>(unpack_alignment); | 544 params[0] = static_cast<GLint>(unpack_alignment); |
| 471 } | 545 } |
| 472 return true; | 546 return true; |
| 473 case GL_POLYGON_OFFSET_FACTOR: | 547 case GL_POLYGON_OFFSET_FACTOR: |
| 474 *num_written = 1; | 548 *num_written = 1; |
| 475 if (params) { | 549 if (params) { |
| 476 params[0] = static_cast<GLint>(polygon_offset_factor); | 550 params[0] = static_cast<GLint>(round(polygon_offset_factor)); |
| 477 } | 551 } |
| 478 return true; | 552 return true; |
| 479 case GL_POLYGON_OFFSET_UNITS: | 553 case GL_POLYGON_OFFSET_UNITS: |
| 480 *num_written = 1; | 554 *num_written = 1; |
| 481 if (params) { | 555 if (params) { |
| 482 params[0] = static_cast<GLint>(polygon_offset_units); | 556 params[0] = static_cast<GLint>(round(polygon_offset_units)); |
| 483 } | 557 } |
| 484 return true; | 558 return true; |
| 485 case GL_SAMPLE_COVERAGE_VALUE: | 559 case GL_SAMPLE_COVERAGE_VALUE: |
| 486 *num_written = 1; | 560 *num_written = 1; |
| 487 if (params) { | 561 if (params) { |
| 488 params[0] = static_cast<GLint>(sample_coverage_value); | 562 params[0] = static_cast<GLint>(sample_coverage_value); |
| 489 } | 563 } |
| 490 return true; | 564 return true; |
| 491 case GL_SAMPLE_COVERAGE_INVERT: | 565 case GL_SAMPLE_COVERAGE_INVERT: |
| 492 *num_written = 1; | 566 *num_written = 1; |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 if (params) { | 850 if (params) { |
| 777 params[0] = static_cast<GLfloat>(hint_fragment_shader_derivative); | 851 params[0] = static_cast<GLfloat>(hint_fragment_shader_derivative); |
| 778 } | 852 } |
| 779 return true; | 853 return true; |
| 780 case GL_LINE_WIDTH: | 854 case GL_LINE_WIDTH: |
| 781 *num_written = 1; | 855 *num_written = 1; |
| 782 if (params) { | 856 if (params) { |
| 783 params[0] = static_cast<GLfloat>(line_width); | 857 params[0] = static_cast<GLfloat>(line_width); |
| 784 } | 858 } |
| 785 return true; | 859 return true; |
| 860 case GL_PATH_MODELVIEW_MATRIX_CHROMIUM: |
| 861 *num_written = 16; |
| 862 if (params) { |
| 863 memcpy(params, modelview_matrix, sizeof(GLfloat) * 16); |
| 864 } |
| 865 return true; |
| 866 case GL_PATH_PROJECTION_MATRIX_CHROMIUM: |
| 867 *num_written = 16; |
| 868 if (params) { |
| 869 memcpy(params, projection_matrix, sizeof(GLfloat) * 16); |
| 870 } |
| 871 return true; |
| 786 case GL_PACK_ALIGNMENT: | 872 case GL_PACK_ALIGNMENT: |
| 787 *num_written = 1; | 873 *num_written = 1; |
| 788 if (params) { | 874 if (params) { |
| 789 params[0] = static_cast<GLfloat>(pack_alignment); | 875 params[0] = static_cast<GLfloat>(pack_alignment); |
| 790 } | 876 } |
| 791 return true; | 877 return true; |
| 792 case GL_UNPACK_ALIGNMENT: | 878 case GL_UNPACK_ALIGNMENT: |
| 793 *num_written = 1; | 879 *num_written = 1; |
| 794 if (params) { | 880 if (params) { |
| 795 params[0] = static_cast<GLfloat>(unpack_alignment); | 881 params[0] = static_cast<GLfloat>(unpack_alignment); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 *num_written = 1; | 1059 *num_written = 1; |
| 974 if (params) { | 1060 if (params) { |
| 975 params[0] = static_cast<GLfloat>(enable_flags.stencil_test); | 1061 params[0] = static_cast<GLfloat>(enable_flags.stencil_test); |
| 976 } | 1062 } |
| 977 return true; | 1063 return true; |
| 978 default: | 1064 default: |
| 979 return false; | 1065 return false; |
| 980 } | 1066 } |
| 981 } | 1067 } |
| 982 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ | 1068 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_IMPL_AUTOGEN_H_ |
| OLD | NEW |