summaryrefslogtreecommitdiff
path: root/src/mesa/glapi/glX_proto_size.py
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2005-02-02 00:54:45 +0000
committerIan Romanick <idr@us.ibm.com>2005-02-02 00:54:45 +0000
commit3fec8c24ec14a5e07953828beba7e03d6367ae34 (patch)
tree78c75edd264ddfa0d6225348af8faa9e5872400b /src/mesa/glapi/glX_proto_size.py
parent6b158a7d23b8d2c290589a53d604f2e50d435922 (diff)
Small refactor. Add glXFunctionIterator, which derrives from
glFunctionIterator and is used by GlxProto. The difference between the two iterator classes is that glXFunctionIterator skips functions that the GLX protocol code does not care about. Replace all the remaining occurances of glParameter::p_count_parameters and glFunction::count_parameters with the count_parameter_list. Add GlxProto::size_call to generate the C code to calculate 'compsize'. These trivially modify the generated code.
Diffstat (limited to 'src/mesa/glapi/glX_proto_size.py')
-rw-r--r--src/mesa/glapi/glX_proto_size.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/mesa/glapi/glX_proto_size.py b/src/mesa/glapi/glX_proto_size.py
index 3030e7462b..404b526b85 100644
--- a/src/mesa/glapi/glX_proto_size.py
+++ b/src/mesa/glapi/glX_proto_size.py
@@ -35,9 +35,9 @@ import license
import sys, getopt, copy
-class SizeStubFunctionIterator:
+class SizeStubFunctionIterator(glX_XML.glXFunctionIterator):
"""Iterate over functions that need "size" information.
-
+
Iterate over the functions that have variable sized data. First the
"set"-type functions are iterated followed by the "get"-type
functions.
@@ -52,8 +52,6 @@ class SizeStubFunctionIterator:
extra_data = []
for f in gl_XML.glFunctionIterator(context):
- if f.fn_offset < 0: break
-
if context.glx_enum_functions.has_key(f.name):
ef = context.glx_enum_functions[f.name]
if ef.is_set():
@@ -80,10 +78,6 @@ class SizeStubFunctionIterator:
return
- def __iter__(self):
- return self
-
-
def next(self):
if self.index == len(self.data):
raise StopIteration
@@ -132,7 +126,7 @@ class glXServerEnumFunction(glX_XML.glXEnumFunction):
self.context.common_emit_fixups(fixup)
print ''
- print ' compsize = __gl%s_size(%s);' % (self.name, f.count_parameters)
+ print ' compsize = %s;' % (context.size_call(context, f))
p = f.variable_length_parameter()
print ' return __GLX_PAD(%s);' % (p.size_string())
@@ -251,7 +245,7 @@ class PrintGlxReqSize_h(glX_XML.GlxProto):
def printFunction(self, f):
- if f.glx_rop == 0 or f.ignore: return
+ if f.glx_rop == 0: return
has_counter = 0
for p in f.parameterIterator(1,2):
@@ -310,7 +304,7 @@ class PrintGlxReqSize_c(glX_XML.GlxProto):
def printFunction(self, f):
- if f.glx_rop == 0 or f.server_handcode or f.ignore: return
+ if f.glx_rop == 0 or f.server_handcode: return
if self.glx_enum_functions.has_key(f.name):
ef = self.glx_enum_functions[f.name]