]> git.cworth.org Git - apitrace/blobdiff - wrappers/trace.py
stash: Trace and replay of gnome-shell works
[apitrace] / wrappers / trace.py
index de020869db76089b3abc2caefbbb7e0139fc736a..e48a703d796c2ceee3700ec97f38218ed2524a02 100644 (file)
@@ -138,7 +138,7 @@ class ComplexValueSerializer(stdapi.OnceVisitor):
     def visitPolymorphic(self, polymorphic):
         if not polymorphic.contextLess:
             return
-        print 'static void _write__%s(int selector, const %s & value) {' % (polymorphic.tag, polymorphic.expr)
+        print 'static void _write__%s(int selector, %s const & value) {' % (polymorphic.tag, polymorphic.expr)
         print '    switch (selector) {'
         for cases, type in polymorphic.iterSwitch():
             for case in cases:
@@ -488,14 +488,22 @@ class Tracer:
         print
 
     def traceFunctionImplBody(self, function):
+        if function.name == 'glXCreatePixmap':
+            print '    emit_fake_x_create_pixmap(dpy, pixmap);'
+        if function.name == 'glXBindTexImageEXT':
+            print '    emit_fake_put_image_data(display, underlying_x_pixmaps[drawable]);'
         if not function.internal:
             print '    unsigned _call = trace::localWriter.beginEnter(&_%s_sig);' % (function.name,)
             for arg in function.args:
                 if not arg.output:
                     self.unwrapArg(function, arg)
+            for arg in function.args:
+                if not arg.output:
                     self.serializeArg(function, arg)
             print '    trace::localWriter.endEnter();'
         self.invokeFunction(function)
+        if function.name == 'glXCreatePixmap':
+            print '    underlying_x_pixmaps[_result] = pixmap;'
         if not function.internal:
             print '    trace::localWriter.beginLeave(_call);'
             print '    if (%s) {' % self.wasFunctionSuccessful(function)
@@ -564,9 +572,6 @@ class Tracer:
     def wrapRet(self, function, instance):
         self.wrapValue(function.type, instance)
 
-    def unwrapRet(self, function, instance):
-        self.unwrapValue(function.type, instance)
-
     def needsWrapping(self, type):
         visitor = WrapDecider()
         visitor.visit(type)
@@ -697,6 +702,8 @@ class Tracer:
         for arg in method.args:
             if not arg.output:
                 self.unwrapArg(method, arg)
+        for arg in method.args:
+            if not arg.output:
                 self.serializeArg(method, arg)
         print '    trace::localWriter.endEnter();'