]> git.cworth.org Git - apitrace/commitdiff
cgltrace: Fix CGLChoosePixelFormat prototype.
authorJosé Fonseca <jfonseca@vmware.com>
Sat, 20 Jul 2013 14:27:29 +0000 (15:27 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Sat, 20 Jul 2013 14:27:29 +0000 (15:27 +0100)
And implify AttribList in the process.

specs/eglapi.py
specs/stdapi.py
specs/wglapi.py
wrappers/trace.py

index 569481b025b48a70254d79542cd45d77eed9a20f..c4db7da9a4ff57b61915163b3d9bc0d62defd29e 100644 (file)
@@ -88,7 +88,7 @@ EGLSurfaceFlags = Flags(Int, [
 
 EGLConformantFlags = Flags(Int, ['EGL_OPENGL_BIT','EGL_OPENGL_ES_BIT', 'EGL_OPENGL_ES2_BIT', 'EGL_OPENVG_BIT',])
 
-EGLConfigAttribs = AttribArray(EGLenum, [
+EGLConfigAttribs = AttribArray(EGLint_enum, [
     ('EGL_ALPHA_MASK_SIZE', UInt),
     ('EGL_ALPHA_SIZE', UInt),
     ('EGL_BIND_TO_TEXTURE_RGB', EGLBoolean),
@@ -125,7 +125,7 @@ EGLTextureFormat = FakeEnum(Int, ['EGL_NO_TEXTURE', 'EGL_TEXTURE_RGB', 'EGL_TEXT
 EGLTextureTarget = FakeEnum(Int, ['EGL_TEXTURE_2D', 'EGL_NO_TEXTURE' ])
 
 def EGLAttribArray(values):
-    return AttribArray(EGLenum, values, terminator = 'EGL_NONE')
+    return AttribArray(EGLint_enum, values, terminator = 'EGL_NONE')
 
 EGLWindowsSurfaceAttribs = EGLAttribArray([
     ('EGL_RENDER_BUFFER', FakeEnum(Int, ['EGL_SINGLE_BUFFER', 'EGL_BACK_BUFFER'])),
@@ -209,7 +209,7 @@ eglapi.addFunctions([
 
     Function(EGLBoolean, "eglSwapInterval", [(EGLDisplay, "dpy"), (EGLint, "interval")]),
 
-    Function(EGLContext, "eglCreateContext", [(EGLDisplay, "dpy"), (EGLConfig, "config"), (EGLContext, "share_context"), (AttribArray(EGLenum, [('EGL_CONTEXT_CLIENT_VERSION', Int)]), "attrib_list")]),
+    Function(EGLContext, "eglCreateContext", [(EGLDisplay, "dpy"), (EGLConfig, "config"), (EGLContext, "share_context"), (AttribArray(EGLint_enum, [('EGL_CONTEXT_CLIENT_VERSION', Int)]), "attrib_list")]),
     Function(EGLBoolean, "eglDestroyContext", [(EGLDisplay, "dpy"), (EGLContext, "ctx")]),
     Function(EGLBoolean, "eglMakeCurrent", [(EGLDisplay, "dpy"), (EGLSurface, "draw"), (EGLSurface, "read"), (EGLContext, "ctx")]),
 
@@ -232,7 +232,7 @@ eglapi.addFunctions([
     Function(EGLBoolean, "eglUnlockSurfaceKHR", [(EGLDisplay, "display"), (EGLSurface, "surface")]),
 
     # EGL_KHR_image_base
-    Function(EGLImageKHR, "eglCreateImageKHR", [(EGLDisplay, "dpy"), (EGLContext, "ctx"), (EGLenum, "target"), (EGLClientBuffer, "buffer"), (AttribArray(EGLenum, [('EGL_IMAGE_PRESERVED_KHR', EGLBoolean)]), "attrib_list")]),
+    Function(EGLImageKHR, "eglCreateImageKHR", [(EGLDisplay, "dpy"), (EGLContext, "ctx"), (EGLenum, "target"), (EGLClientBuffer, "buffer"), (AttribArray(EGLint_enum, [('EGL_IMAGE_PRESERVED_KHR', EGLBoolean)]), "attrib_list")]),
     Function(EGLBoolean, "eglDestroyImageKHR", [(EGLDisplay, "dpy"), (EGLImageKHR, "image")]),
 
     # EGL_KHR_fence_sync
index 5cf1a37def1295c08620014332487f5539298876..1988c6588068389304a2dcf6d22488959782a049 100644 (file)
@@ -272,15 +272,12 @@ class Array(Type):
 
 class AttribArray(Type):
 
-    def __init__(self, keyType, valueTypes, isConst = True, punType = None, terminator = '0'):
-        self.baseType = Int
-        if punType is not None:
-            self.baseType = punType
+    def __init__(self, baseType, valueTypes, isConst = True, terminator = '0'):
+        self.baseType = baseType
         if isConst:
             Type.__init__(self, (Pointer(Const(self.baseType))).expr)
         else:
             Type.__init__(self, (Pointer(self.baseType)).expr)
-        self.keyType = keyType
         self.valueTypes = valueTypes
         self.terminator = terminator
         self.hasKeysWithoutValues = False
index 32172a8e4945226033759c2aa29dcae599a5ccc7..9c4b13b47a56c2c356f1d8cfa8ee6b2d17176dbb 100644 (file)
@@ -188,7 +188,7 @@ WGLPixelFormatAttribsList = [
 ]
 
 WGLPixelFormatAttribs = AttribArray(WGLenum, WGLPixelFormatAttribsList)
-WGLPixelFormatFloatAttribs = AttribArray(WGLenum, WGLPixelFormatAttribsList, punType = FLOAT)
+WGLPixelFormatFloatAttribs = AttribArray(FLOAT, WGLPixelFormatAttribsList)
 
 WGLCreatePbufferARBAttribs = AttribArray(WGLenum, [
     ('WGL_PBUFFER_LARGEST_ARB', Int)
index 70b5e95978d0e4733d6a8a298849cf477161491c..4b25607879b587c42d39ad97ddb665c47707ae65 100644 (file)
@@ -212,7 +212,7 @@ class ValueSerializer(stdapi.Visitor, stdapi.ExpanderMixin):
         # It is currently assumed that an unknown key means that it is followed by an int value.
 
         # determine the array length which must be passed to writeArray() up front
-        count = '_c' + array.keyType.tag
+        count = '_c' + array.baseType.tag
         print '    {'
         print '    int %s;' % count
         print '    for (%(c)s = 0; %(array)s && %(array)s[%(c)s] != %(terminator)s; %(c)s += 2) {' \
@@ -231,10 +231,10 @@ class ValueSerializer(stdapi.Visitor, stdapi.ExpanderMixin):
 
         # for each key / key-value pair write the key and the value, if the key requires one
 
-        index = '_i' + array.keyType.tag
+        index = '_i' + array.baseType.tag
         print '    for (int %(i)s = 0; %(i)s < %(count)s; %(i)s++) {' % {'i': index, 'count': count}
         print '        trace::localWriter.beginElement();'
-        self.visitEnum(array.keyType, "%(array)s[%(i)s]" % {'array': instance, 'i': index})
+        self.visit(array.baseType, "%(array)s[%(i)s]" % {'array': instance, 'i': index})
         print '        trace::localWriter.endElement();'
         print '        if (%(i)s + 1 >= %(count)s) {' % {'i': index, 'count': count}
         print '            break;'