OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """code generator for GLES2 command buffers.""" | 6 """code generator for GLES2 command buffers.""" |
7 | 7 |
8 import itertools | 8 import itertools |
9 import os | 9 import os |
10 import os.path | 10 import os.path |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 'default': [ | 502 'default': [ |
503 '1.0f', '0.0f','0.0f','0.0f', | 503 '1.0f', '0.0f','0.0f','0.0f', |
504 '0.0f', '1.0f','0.0f','0.0f', | 504 '0.0f', '1.0f','0.0f','0.0f', |
505 '0.0f', '0.0f','1.0f','0.0f', | 505 '0.0f', '0.0f','1.0f','0.0f', |
506 '0.0f', '0.0f','0.0f','1.0f', | 506 '0.0f', '0.0f','0.0f','1.0f', |
507 ], | 507 ], |
508 'extension_flag': 'chromium_path_rendering', | 508 'extension_flag': 'chromium_path_rendering', |
509 }, | 509 }, |
510 ], | 510 ], |
511 }, | 511 }, |
| 512 'PathStencilFuncCHROMIUM': { |
| 513 'type': 'Normal', |
| 514 'func': 'PathStencilFuncNV', |
| 515 'extension_flag': 'chromium_path_rendering', |
| 516 'states': [ |
| 517 { |
| 518 'name': 'stencil_path_func', |
| 519 'type': 'GLenum', |
| 520 'enum': 'GL_PATH_STENCIL_FUNC_CHROMIUM', |
| 521 'default': 'GL_ALWAYS', |
| 522 }, |
| 523 { |
| 524 'name': 'stencil_path_ref', |
| 525 'type': 'GLint', |
| 526 'enum': 'GL_PATH_STENCIL_REF_CHROMIUM', |
| 527 'default': '0', |
| 528 }, |
| 529 { |
| 530 'name': 'stencil_path_mask', |
| 531 'type': 'GLuint', |
| 532 'enum': 'GL_PATH_STENCIL_VALUE_MASK_CHROMIUM', |
| 533 'default': '0xFFFFFFFFU', |
| 534 }, |
| 535 ], |
| 536 }, |
512 } | 537 } |
513 | 538 |
514 # This is a list of enum names and their valid values. It is used to map | 539 # This is a list of enum names and their valid values. It is used to map |
515 # GLenum arguments to a specific set of valid values. | 540 # GLenum arguments to a specific set of valid values. |
516 _ENUM_LISTS = { | 541 _ENUM_LISTS = { |
517 'BlitFilter': { | 542 'BlitFilter': { |
518 'type': 'GLenum', | 543 'type': 'GLenum', |
519 'valid': [ | 544 'valid': [ |
520 'GL_NEAREST', | 545 'GL_NEAREST', |
521 'GL_LINEAR', | 546 'GL_LINEAR', |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 'GL_UNSIGNED_BYTE', | 1083 'GL_UNSIGNED_BYTE', |
1059 'GL_UNSIGNED_SHORT_5_6_5', | 1084 'GL_UNSIGNED_SHORT_5_6_5', |
1060 'GL_UNSIGNED_SHORT_4_4_4_4', | 1085 'GL_UNSIGNED_SHORT_4_4_4_4', |
1061 'GL_UNSIGNED_SHORT_5_5_5_1', | 1086 'GL_UNSIGNED_SHORT_5_5_5_1', |
1062 ], | 1087 ], |
1063 'invalid': [ | 1088 'invalid': [ |
1064 'GL_SHORT', | 1089 'GL_SHORT', |
1065 'GL_INT', | 1090 'GL_INT', |
1066 ], | 1091 ], |
1067 }, | 1092 }, |
| 1093 'PathCoverMode': { |
| 1094 'type': 'GLenum', |
| 1095 'valid': [ |
| 1096 'GL_BOUNDING_BOX_CHROMIUM', |
| 1097 ], |
| 1098 }, |
| 1099 'PathCoverModeInstanced': { |
| 1100 'type': 'GLenum', |
| 1101 'valid': [ |
| 1102 'GL_BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM', |
| 1103 ], |
| 1104 }, |
| 1105 'PathFillMode': { |
| 1106 'type': 'GLenum', |
| 1107 'valid': [ |
| 1108 'GL_INVERT', |
| 1109 'GL_COUNT_UP_CHROMIUM', |
| 1110 'GL_COUNT_DOWN_CHROMIUM', |
| 1111 ], |
| 1112 }, |
| 1113 'PathGenMode': { |
| 1114 'type': 'GLenum', |
| 1115 'valid': [ |
| 1116 'GL_OBJECT_LINEAR_CHROMIUM', |
| 1117 'GL_EYE_LINEAR_CHROMIUM', |
| 1118 ], |
| 1119 }, |
| 1120 'PathNameType': { |
| 1121 'type': 'GLenum', |
| 1122 'valid': [ |
| 1123 'GL_UNSIGNED_INT' |
| 1124 ], |
| 1125 }, |
| 1126 'PathParameter': { |
| 1127 'type': 'GLenum', |
| 1128 'valid': [ |
| 1129 'GL_PATH_STROKE_WIDTH_CHROMIUM', |
| 1130 'GL_PATH_INITIAL_END_CAP_CHROMIUM', |
| 1131 'GL_PATH_TERMINAL_END_CAP_CHROMIUM', |
| 1132 'GL_PATH_JOIN_STYLE_CHROMIUM', |
| 1133 'GL_PATH_MITER_LIMIT_CHROMIUM', |
| 1134 ] |
| 1135 }, |
| 1136 'PathTransformType': { |
| 1137 'type': 'GLenum', |
| 1138 'valid': [ |
| 1139 'GL_TRANSLATE_X_CHROMIUM', |
| 1140 'GL_TRANSLATE_Y_CHROMIUM', |
| 1141 'GL_TRANSLATE_2D_CHROMIUM', |
| 1142 'GL_TRANSLATE_3D_CHROMIUM', |
| 1143 'GL_AFFINE_2D_CHROMIUM', |
| 1144 'GL_AFFINE_3D_CHROMIUM', |
| 1145 'GL_TRANSPOSE_AFFINE_2D_CHROMIUM', |
| 1146 'GL_TRANSPOSE_AFFINE_3D_CHROMIUM', |
| 1147 ], |
| 1148 }, |
1068 'ReadPixelType': { | 1149 'ReadPixelType': { |
1069 'type': 'GLenum', | 1150 'type': 'GLenum', |
1070 'valid': [ | 1151 'valid': [ |
1071 'GL_UNSIGNED_BYTE', | 1152 'GL_UNSIGNED_BYTE', |
1072 'GL_UNSIGNED_SHORT_5_6_5', | 1153 'GL_UNSIGNED_SHORT_5_6_5', |
1073 'GL_UNSIGNED_SHORT_4_4_4_4', | 1154 'GL_UNSIGNED_SHORT_4_4_4_4', |
1074 'GL_UNSIGNED_SHORT_5_5_5_1', | 1155 'GL_UNSIGNED_SHORT_5_5_5_1', |
1075 ], | 1156 ], |
1076 'invalid': [ | 1157 'invalid': [ |
1077 'GL_SHORT', | 1158 'GL_SHORT', |
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2592 'unit_test': False, | 2673 'unit_test': False, |
2593 'chromium': True, | 2674 'chromium': True, |
2594 'extension': True, | 2675 'extension': True, |
2595 }, | 2676 }, |
2596 'MatrixLoadIdentityCHROMIUM': { | 2677 'MatrixLoadIdentityCHROMIUM': { |
2597 'decoder_func': 'DoMatrixLoadIdentityCHROMIUM', | 2678 'decoder_func': 'DoMatrixLoadIdentityCHROMIUM', |
2598 'unit_test': False, | 2679 'unit_test': False, |
2599 'chromium': True, | 2680 'chromium': True, |
2600 'extension': True, | 2681 'extension': True, |
2601 }, | 2682 }, |
| 2683 'GenPathsCHROMIUM': { |
| 2684 'type': 'Custom', |
| 2685 'cmd_args': |
| 2686 'GLsizei range, GLuint* client_ids', |
| 2687 'immediate': False, # FIXME: cannot create immediate command |
| 2688 # because it will use original args instead of |
| 2689 # cmd_args |
| 2690 'unit_test': False, # FIXME: see above |
| 2691 'chromium': True, |
| 2692 'extension': True, |
| 2693 }, |
| 2694 'DeletePathsCHROMIUM': { |
| 2695 'decoder_func': 'DeletePathsCHROMIUMHelper', |
| 2696 'unit_test': False, # FIXME: see above |
| 2697 'chromium': True, |
| 2698 'extension': True, |
| 2699 }, |
| 2700 'PathCommandsCHROMIUM': { |
| 2701 'type': 'Manual', |
| 2702 'immediate': False, |
| 2703 'chromium': True, |
| 2704 'extension': True, |
| 2705 }, |
| 2706 'PathParameterfCHROMIUM': { |
| 2707 'type': 'Custom', |
| 2708 'chromium': True, |
| 2709 'extension': True, |
| 2710 }, |
| 2711 'PathParameteriCHROMIUM': { |
| 2712 'type': 'Custom', |
| 2713 'chromium': True, |
| 2714 'extension': True, |
| 2715 }, |
| 2716 'PathStencilFuncCHROMIUM': { |
| 2717 'type': 'StateSet', |
| 2718 'state': 'PathStencilFuncCHROMIUM', |
| 2719 'decoder_func': 'glPathStencilFuncNV', |
| 2720 'chromium': True, |
| 2721 'extension': True, |
| 2722 }, |
| 2723 'StencilFillPathCHROMIUM': { |
| 2724 'type': 'Custom', |
| 2725 'chromium': True, |
| 2726 'extension': True, |
| 2727 }, |
| 2728 'StencilFillPathInstancedCHROMIUM': { |
| 2729 'type': 'Custom', |
| 2730 'chromium': True, |
| 2731 'extension': True, |
| 2732 }, |
| 2733 'StencilStrokePathCHROMIUM': { |
| 2734 'type': 'Custom', |
| 2735 'chromium': True, |
| 2736 'extension': True, |
| 2737 }, |
| 2738 'StencilStrokePathInstancedCHROMIUM': { |
| 2739 'type': 'Custom', |
| 2740 'chromium': True, |
| 2741 'extension': True, |
| 2742 }, |
| 2743 'PathTexGenCHROMIUM': { |
| 2744 'type': 'Manual', |
| 2745 'immediate': False, |
| 2746 'chromium': True, |
| 2747 'extension': True, |
| 2748 }, |
| 2749 'CoverFillPathCHROMIUM': { |
| 2750 'type': 'Custom', |
| 2751 'chromium': True, |
| 2752 'extension': True, |
| 2753 }, |
| 2754 'CoverFillPathInstancedCHROMIUM': { |
| 2755 'type': 'Custom', |
| 2756 'chromium': True, |
| 2757 'extension': True, |
| 2758 }, |
| 2759 'CoverStrokePathCHROMIUM': { |
| 2760 'type': 'Custom', |
| 2761 'chromium': True, |
| 2762 'extension': True, |
| 2763 }, |
| 2764 'CoverStrokePathInstancedCHROMIUM': { |
| 2765 'type': 'Custom', |
| 2766 'chromium': True, |
| 2767 'extension': True, |
| 2768 }, |
2602 } | 2769 } |
2603 | 2770 |
2604 def Grouper(n, iterable, fillvalue=None): | 2771 def Grouper(n, iterable, fillvalue=None): |
2605 """Collect data into fixed-length chunks or blocks""" | 2772 """Collect data into fixed-length chunks or blocks""" |
2606 args = [iter(iterable)] * n | 2773 args = [iter(iterable)] * n |
2607 return itertools.izip_longest(fillvalue=fillvalue, *args) | 2774 return itertools.izip_longest(fillvalue=fillvalue, *args) |
2608 | 2775 |
2609 | 2776 |
2610 def SplitWords(input_string): | 2777 def SplitWords(input_string): |
2611 """Transforms a input_string into a list of lower-case components. | 2778 """Transforms a input_string into a list of lower-case components. |
(...skipping 5457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8069 "ppapi/shared_impl/ppb_opengles2_shared.cc"]) | 8236 "ppapi/shared_impl/ppb_opengles2_shared.cc"]) |
8070 | 8237 |
8071 if gen.errors > 0: | 8238 if gen.errors > 0: |
8072 print "%d errors" % gen.errors | 8239 print "%d errors" % gen.errors |
8073 return 1 | 8240 return 1 |
8074 return 0 | 8241 return 0 |
8075 | 8242 |
8076 | 8243 |
8077 if __name__ == '__main__': | 8244 if __name__ == '__main__': |
8078 sys.exit(main(sys.argv[1:])) | 8245 sys.exit(main(sys.argv[1:])) |
OLD | NEW |