mapi: remove old, unused ES* generator code
authorEmil Velikov <emil.velikov@collabora.com>
Wed, 21 Nov 2018 05:21:58 +0000 (05:21 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 24 Jan 2019 18:13:25 +0000 (18:13 +0000)
As of earlier commit, everyone has switched to the new script for the ES
dispatch.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
src/mapi/glapi/gen/gl_XML.py
src/mapi/mapi_abi.py

index d297299..478f82c 100644 (file)
@@ -611,21 +611,11 @@ class gl_function( gl_item ):
         self.deprecated = None
         self.has_no_error_variant = False
 
-        # self.entry_point_api_map[name][api] is a decimal value
-        # indicating the earliest version of the given API in which
-        # each entry point exists.  Every entry point is included in
-        # the first level of the map; the second level of the map only
-        # lists APIs which contain the entry point in at least one
-        # version.  For example,
-        # self.entry_point_api_map['ClipPlanex'] == { 'es1':
-        # Decimal('1.1') }.
-        self.entry_point_api_map = {}
-
         # self.api_map[api] is a decimal value indicating the earliest
         # version of the given API in which ANY alias for the function
         # exists.  The map only lists APIs which contain the function
         # in at least one version.  For example, for the ClipPlanex
-        # function, self.entry_point_api_map == { 'es1':
+        # function, self.api_map == { 'es1':
         # Decimal('1.1') }.
         self.api_map = {}
 
@@ -658,13 +648,11 @@ class gl_function( gl_item ):
 
         self.entry_points.append( name )
 
-        self.entry_point_api_map[name] = {}
         for api in ('es1', 'es2'):
             version_str = element.get(api, 'none')
             assert version_str is not None
             if version_str != 'none':
                 version_decimal = Decimal(version_str)
-                self.entry_point_api_map[name][api] = version_decimal
                 if api not in self.api_map or \
                         version_decimal < self.api_map[api]:
                     self.api_map[api] = version_decimal
@@ -826,23 +814,6 @@ class gl_function( gl_item ):
         else:
             return "_dispatch_stub_%u" % (self.offset)
 
-    def entry_points_for_api_version(self, api, version = None):
-        """Return a list of the entry point names for this function
-        which are supported in the given API (and optionally, version).
-
-        Use the decimal.Decimal type to precisely express non-integer
-        versions.
-        """
-        result = []
-        for entry_point, api_to_ver in self.entry_point_api_map.items():
-            if api not in api_to_ver:
-                continue
-            if version is not None and version < api_to_ver[api]:
-                continue
-            result.append(entry_point)
-        return result
-
-
 class gl_item_factory(object):
     """Factory to create objects derived from gl_item."""
 
@@ -878,31 +849,6 @@ class gl_api(object):
         typeexpr.create_initial_types()
         return
 
-    def filter_functions(self, entry_point_list):
-        """Filter out entry points not in entry_point_list."""
-        functions_by_name = {}
-        for func in self.functions_by_name.values():
-            entry_points = [ent for ent in func.entry_points if ent in entry_point_list]
-            if entry_points:
-                func.filter_entry_points(entry_points)
-                functions_by_name[func.name] = func
-
-        self.functions_by_name = functions_by_name
-
-    def filter_functions_by_api(self, api, version = None):
-        """Filter out entry points not in the given API (or
-        optionally, not in the given version of the given API).
-        """
-        functions_by_name = {}
-        for func in self.functions_by_name.values():
-            entry_points = func.entry_points_for_api_version(api, version)
-            if entry_points:
-                func.filter_entry_points(entry_points)
-                functions_by_name[func.name] = func
-
-        self.functions_by_name = functions_by_name
-
-
     def parse_file(self, file_name):
         doc = ET.parse( file_name )
         self.process_element(file_name, doc)
index 1ce3fd3..e4142a2 100644 (file)
@@ -685,62 +685,6 @@ typedef int GLclampx;
 
         return header
 
-class ES1APIPrinter(GLAPIPrinter):
-    """OpenGL ES 1.x API Printer"""
-
-    def __init__(self, entries):
-        super(ES1APIPrinter, self).__init__(entries)
-        self.prefix_lib = 'gl'
-        self.prefix_warn = 'gl'
-
-    def _override_for_api(self, ent):
-        if ent.xml_data is None:
-            raise Exception('ES2 API printer requires XML input')
-        ent.hidden = (ent.name not in \
-            ent.xml_data.entry_points_for_api_version('es1')) \
-            or ent.hidden
-        ent.handcode = False
-
-    def _get_c_header(self):
-        header = """#ifndef _GLAPI_TMP_H_
-#define _GLAPI_TMP_H_
-typedef int GLclampx;
-#endif /* _GLAPI_TMP_H_ */"""
-
-        return header
-
-class ES2APIPrinter(GLAPIPrinter):
-    """OpenGL ES 2.x API Printer"""
-
-    def __init__(self, entries):
-        super(ES2APIPrinter, self).__init__(entries)
-        self.prefix_lib = 'gl'
-        self.prefix_warn = 'gl'
-
-    def _override_for_api(self, ent):
-        if ent.xml_data is None:
-            raise Exception('ES2 API printer requires XML input')
-        ent.hidden = (ent.name not in \
-            ent.xml_data.entry_points_for_api_version('es2')) \
-            or ent.hidden
-
-        # This is hella ugly.  The same-named function in desktop OpenGL is
-        # hidden, but it needs to be exposed by libGLESv2 for OpenGL ES 3.0.
-        # There's no way to express in the XML that a function should be be
-        # hidden in one API but exposed in another.
-        if ent.name == 'GetInternalformativ':
-            ent.hidden = False
-
-        ent.handcode = False
-
-    def _get_c_header(self):
-        header = """#ifndef _GLAPI_TMP_H_
-#define _GLAPI_TMP_H_
-typedef int GLclampx;
-#endif /* _GLAPI_TMP_H_ */"""
-
-        return header
-
 class SharedGLAPIPrinter(GLAPIPrinter):
     """Shared GLAPI API Printer"""
 
@@ -785,8 +729,6 @@ def parse_args():
 def main():
     printers = {
         'glapi': GLAPIPrinter,
-        'es1api': ES1APIPrinter,
-        'es2api': ES2APIPrinter,
         'shared-glapi': SharedGLAPIPrinter,
     }