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

Side by Side Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

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 #!/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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 'default': [ 533 'default': [
534 '1.0f', '0.0f','0.0f','0.0f', 534 '1.0f', '0.0f','0.0f','0.0f',
535 '0.0f', '1.0f','0.0f','0.0f', 535 '0.0f', '1.0f','0.0f','0.0f',
536 '0.0f', '0.0f','1.0f','0.0f', 536 '0.0f', '0.0f','1.0f','0.0f',
537 '0.0f', '0.0f','0.0f','1.0f', 537 '0.0f', '0.0f','0.0f','1.0f',
538 ], 538 ],
539 'extension_flag': 'chromium_path_rendering', 539 'extension_flag': 'chromium_path_rendering',
540 }, 540 },
541 ], 541 ],
542 }, 542 },
543 'PathStencilFuncCHROMIUM': {
544 'type': 'Normal',
545 'func': 'PathStencilFuncNV',
546 'extension_flag': 'chromium_path_rendering',
547 'states': [
548 {
549 'name': 'stencil_path_func',
550 'type': 'GLenum',
551 'enum': 'GL_PATH_STENCIL_FUNC_CHROMIUM',
552 'default': 'GL_ALWAYS',
553 },
554 {
555 'name': 'stencil_path_ref',
556 'type': 'GLint',
557 'enum': 'GL_PATH_STENCIL_REF_CHROMIUM',
558 'default': '0',
559 },
560 {
561 'name': 'stencil_path_mask',
562 'type': 'GLuint',
563 'enum': 'GL_PATH_STENCIL_VALUE_MASK_CHROMIUM',
564 'default': '0xFFFFFFFFU',
565 },
566 ],
567 },
543 } 568 }
544 569
545 # Named type info object represents a named type that is used in OpenGL call 570 # Named type info object represents a named type that is used in OpenGL call
546 # arguments. Each named type defines a set of valid OpenGL call arguments. The 571 # arguments. Each named type defines a set of valid OpenGL call arguments. The
547 # named types are used in 'cmd_buffer_functions.txt'. 572 # named types are used in 'cmd_buffer_functions.txt'.
548 # type: The actual GL type of the named type. 573 # type: The actual GL type of the named type.
549 # valid: The list of values that are valid for both the client and the service. 574 # valid: The list of values that are valid for both the client and the service.
550 # valid_es3: The list of values that are valid in OpenGL ES 3, but not ES 2. 575 # valid_es3: The list of values that are valid in OpenGL ES 3, but not ES 2.
551 # invalid: Examples of invalid values for the type. At least these values 576 # invalid: Examples of invalid values for the type. At least these values
552 # should be tested to be invalid. 577 # should be tested to be invalid.
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 'GL_UNSIGNED_INT_2_10_10_10_REV', 1497 'GL_UNSIGNED_INT_2_10_10_10_REV',
1473 'GL_UNSIGNED_INT_10F_11F_11F_REV', 1498 'GL_UNSIGNED_INT_10F_11F_11F_REV',
1474 'GL_UNSIGNED_INT_5_9_9_9_REV', 1499 'GL_UNSIGNED_INT_5_9_9_9_REV',
1475 'GL_UNSIGNED_INT_24_8', 1500 'GL_UNSIGNED_INT_24_8',
1476 'GL_FLOAT_32_UNSIGNED_INT_24_8_REV', 1501 'GL_FLOAT_32_UNSIGNED_INT_24_8_REV',
1477 ], 1502 ],
1478 'invalid': [ 1503 'invalid': [
1479 'GL_UNSIGNED_BYTE_3_3_2', 1504 'GL_UNSIGNED_BYTE_3_3_2',
1480 ], 1505 ],
1481 }, 1506 },
1507 'PathCoordType': {
1508 'type': 'GLenum',
1509 'valid': [
1510 'GL_BYTE',
1511 'GL_UNSIGNED_BYTE',
1512 'GL_SHORT',
1513 'GL_UNSIGNED_SHORT',
1514 'GL_FLOAT',
1515 ],
1516 },
1517 'PathCoverMode': {
1518 'type': 'GLenum',
1519 'valid': [
1520 'GL_CONVEX_HULL_CHROMIUM',
1521 'GL_BOUNDING_BOX_CHROMIUM',
1522 ],
1523 },
1524 'PathFillMode': {
1525 'type': 'GLenum',
1526 'valid': [
1527 'GL_INVERT',
1528 'GL_COUNT_UP_CHROMIUM',
1529 'GL_COUNT_DOWN_CHROMIUM',
1530 ],
1531 },
1532 'PathParameter': {
1533 'type': 'GLenum',
1534 'valid': [
1535 'GL_PATH_STROKE_WIDTH_CHROMIUM',
1536 'GL_PATH_END_CAPS_CHROMIUM',
1537 'GL_PATH_JOIN_STYLE_CHROMIUM',
1538 'GL_PATH_MITER_LIMIT_CHROMIUM',
1539 'GL_PATH_STROKE_BOUND_CHROMIUM',
1540 ]
1541 },
1542 'PathParameterCapValues': {
1543 'type': 'GLint',
1544 'valid': [
1545 'GL_FLAT',
1546 'GL_SQUARE_CHROMIUM',
1547 'GL_ROUND_CHROMIUM',
1548 ]
1549 },
1550 'PathParameterJoinValues': {
1551 'type': 'GLint',
1552 'valid': [
1553 'GL_MITER_REVERT_CHROMIUM',
1554 'GL_BEVEL_CHROMIUM',
1555 'GL_ROUND_CHROMIUM',
1556 ]
1557 },
1482 'ReadPixelType': { 1558 'ReadPixelType': {
1483 'type': 'GLenum', 1559 'type': 'GLenum',
1484 'valid': [ 1560 'valid': [
1485 'GL_UNSIGNED_BYTE', 1561 'GL_UNSIGNED_BYTE',
1486 'GL_UNSIGNED_SHORT_5_6_5', 1562 'GL_UNSIGNED_SHORT_5_6_5',
1487 'GL_UNSIGNED_SHORT_4_4_4_4', 1563 'GL_UNSIGNED_SHORT_4_4_4_4',
1488 'GL_UNSIGNED_SHORT_5_5_5_1', 1564 'GL_UNSIGNED_SHORT_5_5_5_1',
1489 ], 1565 ],
1490 'invalid': [ 1566 'invalid': [
1491 'GL_SHORT', 1567 'GL_SHORT',
(...skipping 2468 matching lines...) Expand 10 before | Expand all | Expand 10 after
3960 'extension': True, 4036 'extension': True,
3961 'extension_flag': 'chromium_path_rendering', 4037 'extension_flag': 'chromium_path_rendering',
3962 }, 4038 },
3963 'MatrixLoadIdentityCHROMIUM': { 4039 'MatrixLoadIdentityCHROMIUM': {
3964 'decoder_func': 'DoMatrixLoadIdentityCHROMIUM', 4040 'decoder_func': 'DoMatrixLoadIdentityCHROMIUM',
3965 'gl_test_func': 'glMatrixLoadIdentityEXT', 4041 'gl_test_func': 'glMatrixLoadIdentityEXT',
3966 'chromium': True, 4042 'chromium': True,
3967 'extension': True, 4043 'extension': True,
3968 'extension_flag': 'chromium_path_rendering', 4044 'extension_flag': 'chromium_path_rendering',
3969 }, 4045 },
4046 'GenPathsCHROMIUM': {
4047 'type': 'Custom',
4048 'cmd_args': 'GLuint first_client_id, GLsizei range',
4049 'chromium': True,
4050 'extension': True,
4051 'extension_flag': 'chromium_path_rendering',
4052 },
4053 'DeletePathsCHROMIUM': {
4054 'type': 'Custom',
4055 'cmd_args': 'GLuint first_client_id, GLsizei range',
4056 'impl_func': False,
4057 'unit_test': False,
4058 'chromium': True,
4059 'extension': True,
4060 'extension_flag': 'chromium_path_rendering',
4061 },
4062 'IsPathCHROMIUM': {
4063 'type': 'Is',
4064 'decoder_func': 'DoIsPathCHROMIUM',
4065 'gl_test_func': 'glIsPathNV',
4066 'chromium': True,
4067 'extension': True,
4068 'extension_flag': 'chromium_path_rendering',
4069 },
4070 'PathCommandsCHROMIUM': {
4071 'type': 'Manual',
4072 'immediate': False,
4073 'chromium': True,
4074 'extension': True,
4075 'extension_flag': 'chromium_path_rendering',
4076 },
4077 'PathParameterfCHROMIUM': {
4078 'type': 'Custom',
4079 'chromium': True,
4080 'extension': True,
4081 'extension_flag': 'chromium_path_rendering',
4082 },
4083 'PathParameteriCHROMIUM': {
4084 'type': 'Custom',
4085 'chromium': True,
4086 'extension': True,
4087 'extension_flag': 'chromium_path_rendering',
4088 },
4089 'PathStencilFuncCHROMIUM': {
4090 'type': 'StateSet',
4091 'state': 'PathStencilFuncCHROMIUM',
4092 'decoder_func': 'glPathStencilFuncNV',
4093 'chromium': True,
4094 'extension': True,
4095 'extension_flag': 'chromium_path_rendering',
4096 },
4097 'StencilFillPathCHROMIUM': {
4098 'type': 'Custom',
4099 'chromium': True,
4100 'extension': True,
4101 'extension_flag': 'chromium_path_rendering',
4102 },
4103 'StencilStrokePathCHROMIUM': {
4104 'type': 'Custom',
4105 'chromium': True,
4106 'extension': True,
4107 'extension_flag': 'chromium_path_rendering',
4108 },
4109 'CoverFillPathCHROMIUM': {
4110 'type': 'Custom',
4111 'chromium': True,
4112 'extension': True,
4113 'extension_flag': 'chromium_path_rendering',
4114 },
4115 'CoverStrokePathCHROMIUM': {
4116 'type': 'Custom',
4117 'chromium': True,
4118 'extension': True,
4119 'extension_flag': 'chromium_path_rendering',
4120 },
4121 'StencilThenCoverFillPathCHROMIUM': {
4122 'type': 'Custom',
4123 'chromium': True,
4124 'extension': True,
4125 'extension_flag': 'chromium_path_rendering',
4126 },
4127 'StencilThenCoverStrokePathCHROMIUM': {
4128 'type': 'Custom',
4129 'chromium': True,
4130 'extension': True,
4131 'extension_flag': 'chromium_path_rendering',
4132 },
4133
3970 } 4134 }
3971 4135
3972 4136
3973 def Grouper(n, iterable, fillvalue=None): 4137 def Grouper(n, iterable, fillvalue=None):
3974 """Collect data into fixed-length chunks or blocks""" 4138 """Collect data into fixed-length chunks or blocks"""
3975 args = [iter(iterable)] * n 4139 args = [iter(iterable)] * n
3976 return itertools.izip_longest(fillvalue=fillvalue, *args) 4140 return itertools.izip_longest(fillvalue=fillvalue, *args)
3977 4141
3978 4142
3979 def SplitWords(input_string): 4143 def SplitWords(input_string):
(...skipping 3950 matching lines...) Expand 10 before | Expand all | Expand 10 after
7930 invalid_test += """ 8094 invalid_test += """
7931 } 8095 }
7932 """ 8096 """
7933 self.WriteValidUnitTest(func, file, invalid_test, { 8097 self.WriteValidUnitTest(func, file, invalid_test, {
7934 'comma': comma, 8098 'comma': comma,
7935 }, *extras) 8099 }, *extras)
7936 8100
7937 def WriteServiceImplementation(self, func, file): 8101 def WriteServiceImplementation(self, func, file):
7938 """Overrriden from TypeHandler.""" 8102 """Overrriden from TypeHandler."""
7939 self.WriteServiceHandlerFunctionHeader(func, file) 8103 self.WriteServiceHandlerFunctionHeader(func, file)
8104 self.WriteHandlerExtensionCheck(func, file)
7940 args = func.GetOriginalArgs() 8105 args = func.GetOriginalArgs()
7941 for arg in args: 8106 for arg in args:
7942 arg.WriteGetCode(file) 8107 arg.WriteGetCode(file)
7943 8108
7944 code = """ typedef cmds::%(func_name)s::Result Result; 8109 code = """ typedef cmds::%(func_name)s::Result Result;
7945 Result* result_dst = GetSharedMemoryAs<Result*>( 8110 Result* result_dst = GetSharedMemoryAs<Result*>(
7946 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); 8111 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst));
7947 if (!result_dst) { 8112 if (!result_dst) {
7948 return error::kOutOfBounds; 8113 return error::kOutOfBounds;
7949 } 8114 }
(...skipping 3149 matching lines...) Expand 10 before | Expand all | Expand 10 after
11099 Format(gen.generated_cpp_filenames) 11264 Format(gen.generated_cpp_filenames)
11100 11265
11101 if gen.errors > 0: 11266 if gen.errors > 0:
11102 print "%d errors" % gen.errors 11267 print "%d errors" % gen.errors
11103 return 1 11268 return 1
11104 return 0 11269 return 0
11105 11270
11106 11271
11107 if __name__ == '__main__': 11272 if __name__ == '__main__':
11108 sys.exit(main(sys.argv[1:])) 11273 sys.exit(main(sys.argv[1:]))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698