Commit 7b7e5cad by Jamie Madill Committed by Commit Bot

Clean up entry point generation script.

The main refactor from this change is to replace statements like this: decls, defs, export_defs, _, _, _, _ = get_entry_points( apis.EGL, eglxml.all_commands, egl_version_commands, False, egl_param_types, cmd_packed_egl_enums, EGL_PACKED_TYPES, egl_ep_to_object, TEMPLATE_EGL_ENTRY_POINT_EXPORT) With statements like this: eps = EGLEntryPoints(eglxml, egl_version_commands) This will make the script easier to maintain and extend. Bug: angleproject:5653 Change-Id: Ibd0930d45b8629702b7782f43a2d7ebfa4dac9b8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2705156Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent f19f319a
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"0b4f3476d76a5ccc40af342d6c08739d", "0b4f3476d76a5ccc40af342d6c08739d",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"c85875a215dcf74e2ed363684f18c26c", "574c34b93db348eb2e13d8026c3014ff",
"scripts/wgl.xml": "scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db", "c36001431919e1c435f1215a85f7e1db",
"src/libEGL/egl_loader_autogen.cpp": "src/libEGL/egl_loader_autogen.cpp":
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
"scripts/entry_point_packed_gl_enums.json": "scripts/entry_point_packed_gl_enums.json":
"4f7b43863a5e61991bba4010db463679", "4f7b43863a5e61991bba4010db463679",
"scripts/generate_entry_points.py": "scripts/generate_entry_points.py":
"195ba6eaeb6dcf6596720976f73755a5", "09729fe8be0f242cc97058c2b5ab7310",
"scripts/gl.xml": "scripts/gl.xml":
"f66967f3f3d696b5d8306fd80bbd49a8", "f66967f3f3d696b5d8306fd80bbd49a8",
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"0b4f3476d76a5ccc40af342d6c08739d", "0b4f3476d76a5ccc40af342d6c08739d",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"c85875a215dcf74e2ed363684f18c26c", "574c34b93db348eb2e13d8026c3014ff",
"scripts/wgl.xml": "scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db", "c36001431919e1c435f1215a85f7e1db",
"src/common/entry_points_enum_autogen.cpp": "src/common/entry_points_enum_autogen.cpp":
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"0b4f3476d76a5ccc40af342d6c08739d", "0b4f3476d76a5ccc40af342d6c08739d",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"c85875a215dcf74e2ed363684f18c26c", "574c34b93db348eb2e13d8026c3014ff",
"src/libANGLE/capture/gl_enum_utils_autogen.cpp": "src/libANGLE/capture/gl_enum_utils_autogen.cpp":
"ab1a59ecc7d292db6cc2840280f86a59", "ab1a59ecc7d292db6cc2840280f86a59",
"src/libANGLE/capture/gl_enum_utils_autogen.h": "src/libANGLE/capture/gl_enum_utils_autogen.h":
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"0b4f3476d76a5ccc40af342d6c08739d", "0b4f3476d76a5ccc40af342d6c08739d",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"c85875a215dcf74e2ed363684f18c26c", "574c34b93db348eb2e13d8026c3014ff",
"scripts/wgl.xml": "scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db", "c36001431919e1c435f1215a85f7e1db",
"src/libGL/proc_table_wgl_autogen.cpp": "src/libGL/proc_table_wgl_autogen.cpp":
......
...@@ -238,6 +238,10 @@ def path_to(folder, file): ...@@ -238,6 +238,10 @@ def path_to(folder, file):
return os.path.join(script_relative(".."), "src", folder, file) return os.path.join(script_relative(".."), "src", folder, file)
def strip_api_prefix(cmd_name):
return cmd_name.lstrip("wegl")
class CommandNames: class CommandNames:
def __init__(self): def __init__(self):
...@@ -365,6 +369,24 @@ class RegistryXML: ...@@ -365,6 +369,24 @@ class RegistryXML:
class EntryPoints: class EntryPoints:
def __init__(self, api, xml): def __init__(self, api, xml, commands):
for command in xml.all_commands: self.api = api
pass self._cmd_info = []
for command_node in xml.all_commands:
proto = command_node.find('proto')
cmd_name = proto.find('name').text
if api == apis.WGL:
cmd_name = cmd_name if cmd_name[:3] == 'wgl' else 'wgl' + cmd_name
if cmd_name not in commands:
continue
param_text = ["".join(param.itertext()) for param in command_node.findall('param')]
proto_text = "".join(proto.itertext())
self._cmd_info.append((cmd_name, command_node, param_text, proto_text))
def get_infos(self):
return self._cmd_info
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment