Chromium Code Reviews| 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 472 'expected': 'kViewportWidth', | 472 'expected': 'kViewportWidth', |
| 473 }, | 473 }, |
| 474 { | 474 { |
| 475 'name': 'viewport_height', | 475 'name': 'viewport_height', |
| 476 'type': 'GLsizei', | 476 'type': 'GLsizei', |
| 477 'default': '1', | 477 'default': '1', |
| 478 'expected': 'kViewportHeight', | 478 'expected': 'kViewportHeight', |
| 479 }, | 479 }, |
| 480 ], | 480 ], |
| 481 }, | 481 }, |
| 482 'MatrixValuesCHROMIUM': { | |
| 483 'type': 'NamedParameter', | |
| 484 'func': 'MatrixLoadfEXT', | |
| 485 'states': [ | |
| 486 { 'enum': 'GL_MODELVIEW_MATRIX_CHROMIUM', | |
| 487 'enum_set': 'GL_MODELVIEW_CHROMIUM', | |
| 488 'name': 'modelview_matrix', | |
| 489 'type': 'GLfloat', | |
| 490 'default': ['0.0f'] * 16, | |
|
Kimmo Kinnunen
2014/04/15 17:52:27
This is a mistake, the these defaults should be id
Kimmo Kinnunen
2014/04/23 12:26:55
Done.
| |
| 491 'extension_flag': 'chromium_path_rendering', | |
| 492 }, | |
| 493 { 'enum': 'GL_PROJECTION_MATRIX_CHROMIUM', | |
| 494 'enum_set': 'GL_PROJECTION_CHROMIUM', | |
| 495 'name': 'projection_matrix', | |
| 496 'type': 'GLfloat', | |
| 497 'default': ['0.0f'] * 16, | |
| 498 'extension_flag': 'chromium_path_rendering', | |
| 499 }, | |
| 500 ], | |
| 501 }, | |
| 482 } | 502 } |
| 483 | 503 |
| 484 # This is a list of enum names and their valid values. It is used to map | 504 # This is a list of enum names and their valid values. It is used to map |
| 485 # GLenum arguments to a specific set of valid values. | 505 # GLenum arguments to a specific set of valid values. |
| 486 _ENUM_LISTS = { | 506 _ENUM_LISTS = { |
| 487 'BlitFilter': { | 507 'BlitFilter': { |
| 488 'type': 'GLenum', | 508 'type': 'GLenum', |
| 489 'valid': [ | 509 'valid': [ |
| 490 'GL_NEAREST', | 510 'GL_NEAREST', |
| 491 'GL_LINEAR', | 511 'GL_LINEAR', |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 798 }, | 818 }, |
| 799 'FrameBufferParameter': { | 819 'FrameBufferParameter': { |
| 800 'type': 'GLenum', | 820 'type': 'GLenum', |
| 801 'valid': [ | 821 'valid': [ |
| 802 'GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE', | 822 'GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE', |
| 803 'GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME', | 823 'GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME', |
| 804 'GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL', | 824 'GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL', |
| 805 'GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE', | 825 'GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE', |
| 806 ], | 826 ], |
| 807 }, | 827 }, |
| 828 'MatrixMode': { | |
| 829 'type': 'GLenum', | |
| 830 'valid': [ | |
| 831 'GL_PROJECTION_CHROMIUM', | |
| 832 'GL_MODELVIEW_CHROMIUM', | |
| 833 ], | |
| 834 }, | |
| 808 'ProgramParameter': { | 835 'ProgramParameter': { |
| 809 'type': 'GLenum', | 836 'type': 'GLenum', |
| 810 'valid': [ | 837 'valid': [ |
| 811 'GL_DELETE_STATUS', | 838 'GL_DELETE_STATUS', |
| 812 'GL_LINK_STATUS', | 839 'GL_LINK_STATUS', |
| 813 'GL_VALIDATE_STATUS', | 840 'GL_VALIDATE_STATUS', |
| 814 'GL_INFO_LOG_LENGTH', | 841 'GL_INFO_LOG_LENGTH', |
| 815 'GL_ATTACHED_SHADERS', | 842 'GL_ATTACHED_SHADERS', |
| 816 'GL_ACTIVE_ATTRIBUTES', | 843 'GL_ACTIVE_ATTRIBUTES', |
| 817 'GL_ACTIVE_ATTRIBUTE_MAX_LENGTH', | 844 'GL_ACTIVE_ATTRIBUTE_MAX_LENGTH', |
| (...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2539 'chromium': True, | 2566 'chromium': True, |
| 2540 }, | 2567 }, |
| 2541 'ScheduleOverlayPlaneCHROMIUM': { | 2568 'ScheduleOverlayPlaneCHROMIUM': { |
| 2542 'type': 'Custom', | 2569 'type': 'Custom', |
| 2543 'impl_func': True, | 2570 'impl_func': True, |
| 2544 'unit_test': False, | 2571 'unit_test': False, |
| 2545 'client_test': False, | 2572 'client_test': False, |
| 2546 'extension': True, | 2573 'extension': True, |
| 2547 'chromium': True, | 2574 'chromium': True, |
| 2548 }, | 2575 }, |
| 2576 'MatrixLoadfCHROMIUM': { | |
| 2577 'type': 'PUT', | |
| 2578 'count': 16, | |
| 2579 'data_type': 'GLfloat', | |
| 2580 'decoder_func': 'DoMatrixLoadfCHROMIUM', | |
| 2581 'unit_test': False, | |
| 2582 'chromium': True, | |
| 2583 'extension': True, | |
| 2584 }, | |
| 2585 'MatrixLoadIdentityCHROMIUM': { | |
| 2586 'decoder_func': 'DoMatrixLoadIdentityCHROMIUM', | |
| 2587 'unit_test': False, | |
| 2588 'chromium': True, | |
| 2589 'extension': True, | |
| 2590 }, | |
| 2549 } | 2591 } |
| 2550 | 2592 |
| 2551 | |
| 2552 def Grouper(n, iterable, fillvalue=None): | 2593 def Grouper(n, iterable, fillvalue=None): |
| 2553 """Collect data into fixed-length chunks or blocks""" | 2594 """Collect data into fixed-length chunks or blocks""" |
| 2554 args = [iter(iterable)] * n | 2595 args = [iter(iterable)] * n |
| 2555 return itertools.izip_longest(fillvalue=fillvalue, *args) | 2596 return itertools.izip_longest(fillvalue=fillvalue, *args) |
| 2556 | 2597 |
| 2557 | 2598 |
| 2558 def SplitWords(input_string): | 2599 def SplitWords(input_string): |
| 2559 """Transforms a input_string into a list of lower-case components. | 2600 """Transforms a input_string into a list of lower-case components. |
| 2560 | 2601 |
| 2561 Args: | 2602 Args: |
| (...skipping 4514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7076 "// It is included by context_state.h\n") | 7117 "// It is included by context_state.h\n") |
| 7077 file.Write("struct EnableFlags {\n") | 7118 file.Write("struct EnableFlags {\n") |
| 7078 file.Write(" EnableFlags();\n") | 7119 file.Write(" EnableFlags();\n") |
| 7079 for capability in _CAPABILITY_FLAGS: | 7120 for capability in _CAPABILITY_FLAGS: |
| 7080 file.Write(" bool %s;\n" % capability['name']) | 7121 file.Write(" bool %s;\n" % capability['name']) |
| 7081 file.Write("};\n\n") | 7122 file.Write("};\n\n") |
| 7082 | 7123 |
| 7083 for state_name in sorted(_STATES.keys()): | 7124 for state_name in sorted(_STATES.keys()): |
| 7084 state = _STATES[state_name] | 7125 state = _STATES[state_name] |
| 7085 for item in state['states']: | 7126 for item in state['states']: |
| 7086 file.Write("%s %s;\n" % (item['type'], item['name'])) | 7127 if isinstance(item['default'], list): |
| 7128 file.Write("%s %s[%s];\n" % (item['type'], item['name'], | |
| 7129 len(item['default']))) | |
|
vmiura
2014/04/15 18:02:43
nit: %d for len(..)
Kimmo Kinnunen
2014/04/23 12:26:55
Done.
| |
| 7130 else: | |
| 7131 file.Write("%s %s;\n" % (item['type'], item['name'])) | |
| 7087 file.Write("\n") | 7132 file.Write("\n") |
| 7088 | 7133 |
| 7089 file.Close() | 7134 file.Close() |
| 7090 | 7135 |
| 7091 def WriteClientContextStateHeader(self, filename): | 7136 def WriteClientContextStateHeader(self, filename): |
| 7092 """Writes the client context state header.""" | 7137 """Writes the client context state header.""" |
| 7093 file = CHeaderWriter( | 7138 file = CHeaderWriter( |
| 7094 filename, | 7139 filename, |
| 7095 "// It is included by client_context_state.h\n") | 7140 "// It is included by client_context_state.h\n") |
| 7096 file.Write("struct EnableFlags {\n") | 7141 file.Write("struct EnableFlags {\n") |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 7116 file.Write(" *num_written = %d;\n" % len(state['states'])) | 7161 file.Write(" *num_written = %d;\n" % len(state['states'])) |
| 7117 file.Write(" if (params) {\n") | 7162 file.Write(" if (params) {\n") |
| 7118 for ndx,item in enumerate(state['states']): | 7163 for ndx,item in enumerate(state['states']): |
| 7119 file.Write(" params[%d] = static_cast<%s>(%s);\n" % | 7164 file.Write(" params[%d] = static_cast<%s>(%s);\n" % |
| 7120 (ndx, gl_type, item['name'])) | 7165 (ndx, gl_type, item['name'])) |
| 7121 file.Write(" }\n") | 7166 file.Write(" }\n") |
| 7122 file.Write(" return true;\n") | 7167 file.Write(" return true;\n") |
| 7123 else: | 7168 else: |
| 7124 for item in state['states']: | 7169 for item in state['states']: |
| 7125 file.Write(" case %s:\n" % item['enum']) | 7170 file.Write(" case %s:\n" % item['enum']) |
| 7126 file.Write(" *num_written = 1;\n") | 7171 if isinstance(item['default'], list): |
| 7127 file.Write(" if (params) {\n") | 7172 item_len = len(item['default']) |
| 7128 file.Write(" params[0] = static_cast<%s>(%s);\n" % | 7173 file.Write(" *num_written = %s;\n" % item_len) |
|
vmiura
2014/04/15 18:02:43
nit: %d for item_len
Kimmo Kinnunen
2014/04/23 12:26:55
Done.
| |
| 7129 (gl_type, item['name'])) | 7174 file.Write(" if (params) {\n") |
| 7175 if item['type'] == gl_type: | |
| 7176 file.Write(" memcpy(params, %s, sizeof(%s) * %s);\n" % | |
| 7177 (item['name'], item['type'], item_len)) | |
|
vmiura
2014/04/15 18:02:43
nit: %d for item_len
Kimmo Kinnunen
2014/04/23 12:26:55
Done.
| |
| 7178 else: | |
| 7179 file.Write(" for (size_t i = 0; i < %s; ++i) {\n" % | |
| 7180 item_len) | |
| 7181 file.Write(" params[i] = static_cast<%s>(%s[i]);\n" % | |
| 7182 (gl_type, item['name'])) | |
| 7183 file.Write(" }\n"); | |
| 7184 else: | |
| 7185 file.Write(" *num_written = 1;\n") | |
| 7186 file.Write(" if (params) {\n") | |
| 7187 file.Write(" params[0] = static_cast<%s>(%s);\n" % | |
| 7188 (gl_type, item['name'])) | |
| 7130 file.Write(" }\n") | 7189 file.Write(" }\n") |
| 7131 file.Write(" return true;\n") | 7190 file.Write(" return true;\n") |
| 7132 for capability in _CAPABILITY_FLAGS: | 7191 for capability in _CAPABILITY_FLAGS: |
| 7133 file.Write(" case GL_%s:\n" % capability['name'].upper()) | 7192 file.Write(" case GL_%s:\n" % capability['name'].upper()) |
| 7134 file.Write(" *num_written = 1;\n") | 7193 file.Write(" *num_written = 1;\n") |
| 7135 file.Write(" if (params) {\n") | 7194 file.Write(" if (params) {\n") |
| 7136 file.Write( | 7195 file.Write( |
| 7137 " params[0] = static_cast<%s>(enable_flags.%s);\n" % | 7196 " params[0] = static_cast<%s>(enable_flags.%s);\n" % |
| 7138 (gl_type, capability['name'])) | 7197 (gl_type, capability['name'])) |
| 7139 file.Write(" }\n") | 7198 file.Write(" }\n") |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 7155 (capability['name'], | 7214 (capability['name'], |
| 7156 ('false', 'true')['default' in capability])) | 7215 ('false', 'true')['default' in capability])) |
| 7157 file.Write("ContextState::EnableFlags::EnableFlags()\n : %s {\n}\n" % | 7216 file.Write("ContextState::EnableFlags::EnableFlags()\n : %s {\n}\n" % |
| 7158 ",\n ".join(code)) | 7217 ",\n ".join(code)) |
| 7159 file.Write("\n") | 7218 file.Write("\n") |
| 7160 | 7219 |
| 7161 file.Write("void ContextState::Initialize() {\n") | 7220 file.Write("void ContextState::Initialize() {\n") |
| 7162 for state_name in sorted(_STATES.keys()): | 7221 for state_name in sorted(_STATES.keys()): |
| 7163 state = _STATES[state_name] | 7222 state = _STATES[state_name] |
| 7164 for item in state['states']: | 7223 for item in state['states']: |
| 7165 file.Write(" %s = %s;\n" % (item['name'], item['default'])) | 7224 if isinstance(item['default'], list): |
| 7225 for ndx, value in enumerate(item['default']): | |
| 7226 file.Write(" %s[%s] = %s;\n" % (item['name'], ndx, value)) | |
|
vmiura
2014/04/15 18:02:43
nit: %d for ndx
Kimmo Kinnunen
2014/04/23 12:26:55
Done.
| |
| 7227 else: | |
| 7228 file.Write(" %s = %s;\n" % (item['name'], item['default'])) | |
| 7166 file.Write("}\n") | 7229 file.Write("}\n") |
| 7167 | 7230 |
| 7168 file.Write(""" | 7231 file.Write(""" |
| 7169 void ContextState::InitCapabilities(const ContextState* prev_state) const { | 7232 void ContextState::InitCapabilities(const ContextState* prev_state) const { |
| 7170 """) | 7233 """) |
| 7171 def WriteCapabilities(test_prev): | 7234 def WriteCapabilities(test_prev): |
| 7172 for capability in _CAPABILITY_FLAGS: | 7235 for capability in _CAPABILITY_FLAGS: |
| 7173 capability_name = capability['name'] | 7236 capability_name = capability['name'] |
| 7174 if test_prev: | 7237 if test_prev: |
| 7175 file.Write(" if (prev_state->enable_flags.%s != enable_flags.%s)\n" % | 7238 file.Write(" if (prev_state->enable_flags.%s != enable_flags.%s)\n" % |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7209 file.Write(")\n") | 7272 file.Write(")\n") |
| 7210 file.Write( | 7273 file.Write( |
| 7211 " gl%s(%s, %s);\n" % | 7274 " gl%s(%s, %s);\n" % |
| 7212 (state['func'], ('GL_FRONT', 'GL_BACK')[ndx], ", ".join(args))) | 7275 (state['func'], ('GL_FRONT', 'GL_BACK')[ndx], ", ".join(args))) |
| 7213 elif state['type'] == 'NamedParameter': | 7276 elif state['type'] == 'NamedParameter': |
| 7214 for item in state['states']: | 7277 for item in state['states']: |
| 7215 if 'extension_flag' in item: | 7278 if 'extension_flag' in item: |
| 7216 file.Write(" if (feature_info_->feature_flags().%s)\n " % | 7279 file.Write(" if (feature_info_->feature_flags().%s)\n " % |
| 7217 item['extension_flag']) | 7280 item['extension_flag']) |
| 7218 if test_prev: | 7281 if test_prev: |
| 7219 file.Write(" if (prev_state->%s != %s)\n" % | 7282 if isinstance(item['default'], list): |
| 7220 (item['name'], item['name'])) | 7283 file.Write(" if (memcmp(prev_state->%s, %s, " |
| 7284 "sizeof(%s) * %s))\n" % | |
| 7285 (item['name'], item['name'], item['type'], | |
| 7286 len(item['default']))) | |
|
vmiura
2014/04/15 18:02:43
nit: %d
Kimmo Kinnunen
2014/04/23 12:26:55
Done.
| |
| 7287 else: | |
| 7288 file.Write(" if (prev_state->%s != %s)\n" % | |
| 7289 (item['name'], item['name'])) | |
| 7221 file.Write(" gl%s(%s, %s);\n" % | 7290 file.Write(" gl%s(%s, %s);\n" % |
| 7222 (state['func'], item['enum'], item['name'])) | 7291 (state['func'], |
| 7292 (item['enum_set'] | |
| 7293 if 'enum_set' in item else item['enum']), | |
| 7294 item['name'])) | |
| 7223 else: | 7295 else: |
| 7296 if 'extension_flag' in state: | |
| 7297 file.Write(" if (feature_info_->feature_flags().%s)\n " % | |
| 7298 state['extension_flag']) | |
| 7224 if test_prev: | 7299 if test_prev: |
| 7225 file.Write(" if (") | 7300 file.Write(" if (") |
| 7226 args = [] | 7301 args = [] |
| 7227 for place, item in enumerate(state['states']): | 7302 for place, item in enumerate(state['states']): |
| 7228 item_name = item['name'] | 7303 item_name = item['name'] |
| 7229 args.append('%s' % item_name) | 7304 args.append('%s' % item_name) |
| 7230 if test_prev: | 7305 if test_prev: |
| 7231 if place > 0: | 7306 if place > 0: |
| 7232 file.Write(' ||\n') | 7307 file.Write(' ||\n') |
| 7233 file.Write("(%s != prev_state->%s)" % | 7308 file.Write("(%s != prev_state->%s)" % |
| 7234 (item_name, item_name)) | 7309 (item_name, item_name)) |
| 7235 if test_prev: | 7310 if test_prev: |
| 7236 file.Write(" )\n") | 7311 file.Write(" )\n") |
| 7237 file.Write(" gl%s(%s);\n" % (state['func'], ", ".join(args))) | 7312 file.Write(" gl%s(%s);\n" % (state['func'], ", ".join(args))) |
| 7238 | 7313 |
| 7239 file.Write(" if (prev_state) {") | 7314 file.Write(" if (prev_state) {") |
| 7240 WriteStates(True) | 7315 WriteStates(True) |
| 7241 file.Write(" } else {") | 7316 file.Write(" } else {") |
| 7242 WriteStates(False) | 7317 WriteStates(False) |
| 7243 file.Write(" }") | 7318 file.Write(" }") |
| 7244 | |
| 7245 file.Write("}\n") | 7319 file.Write("}\n") |
| 7246 | 7320 |
| 7247 file.Write("""bool ContextState::GetEnabled(GLenum cap) const { | 7321 file.Write("""bool ContextState::GetEnabled(GLenum cap) const { |
| 7248 switch (cap) { | 7322 switch (cap) { |
| 7249 """) | 7323 """) |
| 7250 for capability in _CAPABILITY_FLAGS: | 7324 for capability in _CAPABILITY_FLAGS: |
| 7251 file.Write(" case GL_%s:\n" % capability['name'].upper()) | 7325 file.Write(" case GL_%s:\n" % capability['name'].upper()) |
| 7252 file.Write(" return enable_flags.%s;\n" % capability['name']) | 7326 file.Write(" return enable_flags.%s;\n" % capability['name']) |
| 7253 file.Write(""" default: | 7327 file.Write(""" default: |
| 7254 NOTREACHED(); | 7328 NOTREACHED(); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7403 " EXPECT_CALL(*gl_, %s(%s, %s))\n" % | 7477 " EXPECT_CALL(*gl_, %s(%s, %s))\n" % |
| 7404 (state['func'], ('GL_FRONT', 'GL_BACK')[ndx], ", ".join(args))) | 7478 (state['func'], ('GL_FRONT', 'GL_BACK')[ndx], ", ".join(args))) |
| 7405 file.Write(" .Times(1)\n") | 7479 file.Write(" .Times(1)\n") |
| 7406 file.Write(" .RetiresOnSaturation();\n") | 7480 file.Write(" .RetiresOnSaturation();\n") |
| 7407 elif state['type'] == 'NamedParameter': | 7481 elif state['type'] == 'NamedParameter': |
| 7408 for item in state['states']: | 7482 for item in state['states']: |
| 7409 if 'extension_flag' in item: | 7483 if 'extension_flag' in item: |
| 7410 continue | 7484 continue |
| 7411 file.Write( | 7485 file.Write( |
| 7412 " EXPECT_CALL(*gl_, %s(%s, %s))\n" % | 7486 " EXPECT_CALL(*gl_, %s(%s, %s))\n" % |
| 7413 (state['func'], item['enum'], item['default'])) | 7487 (state['func'], |
| 7488 (item['enum_set'] | |
| 7489 if 'enum_set' in item else item['enum']), | |
| 7490 item['default'])) | |
| 7414 file.Write(" .Times(1)\n") | 7491 file.Write(" .Times(1)\n") |
| 7415 file.Write(" .RetiresOnSaturation();\n") | 7492 file.Write(" .RetiresOnSaturation();\n") |
| 7416 else: | 7493 else: |
| 7417 args = [] | 7494 args = [] |
| 7418 for item in state['states']: | 7495 for item in state['states']: |
| 7419 if 'expected' in item: | 7496 if 'expected' in item: |
| 7420 args.append(item['expected']) | 7497 args.append(item['expected']) |
| 7421 else: | 7498 else: |
| 7422 args.append(item['default']) | 7499 args.append(item['default']) |
| 7423 file.Write(" EXPECT_CALL(*gl_, %s(%s))\n" % | 7500 file.Write(" EXPECT_CALL(*gl_, %s(%s))\n" % |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7852 "empty. Use this if you want the result stored under gen.") | 7929 "empty. Use this if you want the result stored under gen.") |
| 7853 parser.add_option( | 7930 parser.add_option( |
| 7854 "-v", "--verbose", action="store_true", | 7931 "-v", "--verbose", action="store_true", |
| 7855 help="prints more output.") | 7932 help="prints more output.") |
| 7856 | 7933 |
| 7857 (options, args) = parser.parse_args(args=argv) | 7934 (options, args) = parser.parse_args(args=argv) |
| 7858 | 7935 |
| 7859 # Add in states and capabilites to GLState | 7936 # Add in states and capabilites to GLState |
| 7860 for state_name in sorted(_STATES.keys()): | 7937 for state_name in sorted(_STATES.keys()): |
| 7861 state = _STATES[state_name] | 7938 state = _STATES[state_name] |
| 7939 if 'extension_flag' in state: | |
| 7940 continue | |
| 7862 if 'enum' in state: | 7941 if 'enum' in state: |
| 7863 _ENUM_LISTS['GLState']['valid'].append(state['enum']) | 7942 _ENUM_LISTS['GLState']['valid'].append(state['enum']) |
| 7864 else: | 7943 else: |
| 7865 for item in state['states']: | 7944 for item in state['states']: |
| 7866 if 'extension_flag' in item: | 7945 if 'extension_flag' in item: |
| 7867 continue | 7946 continue |
| 7868 _ENUM_LISTS['GLState']['valid'].append(item['enum']) | 7947 _ENUM_LISTS['GLState']['valid'].append(item['enum']) |
| 7869 for capability in _CAPABILITY_FLAGS: | 7948 for capability in _CAPABILITY_FLAGS: |
| 7870 _ENUM_LISTS['GLState']['valid'].append("GL_%s" % capability['name'].upper()) | 7949 _ENUM_LISTS['GLState']['valid'].append("GL_%s" % capability['name'].upper()) |
| 7871 | 7950 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7955 "ppapi/shared_impl/ppb_opengles2_shared.cc"]) | 8034 "ppapi/shared_impl/ppb_opengles2_shared.cc"]) |
| 7956 | 8035 |
| 7957 if gen.errors > 0: | 8036 if gen.errors > 0: |
| 7958 print "%d errors" % gen.errors | 8037 print "%d errors" % gen.errors |
| 7959 return 1 | 8038 return 1 |
| 7960 return 0 | 8039 return 0 |
| 7961 | 8040 |
| 7962 | 8041 |
| 7963 if __name__ == '__main__': | 8042 if __name__ == '__main__': |
| 7964 sys.exit(main(sys.argv[1:])) | 8043 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |