]> git.cworth.org Git - apitrace/blobdiff - retrace.py
Add a simple viewer for surfaces.
[apitrace] / retrace.py
index c68179b7a6a0a9156ac4c2cb784bbb57ad1cce92..1cdb10a8fd5d6c3de4e621d4e376718418dda231 100644 (file)
@@ -174,6 +174,11 @@ class Retracer:
 
     def retrace_function(self, function):
         print 'static void retrace_%s(Trace::Call &call) {' % function.name
+        self.retrace_function_body(function)
+        print '}'
+        print
+
+    def retrace_function_body(self, function):
         success = True
         for arg in function.args:
             arg_type = ConstRemover().visit(arg.type)
@@ -205,8 +210,6 @@ class Retracer:
                 ValueWrapper().visit(function.type, lvalue, rvalue)
             except NotImplementedError:
                 print '   // FIXME: result'
-        print '}'
-        print
 
     def fail_function(self, function):
         print '    if (verbosity >= 0)'
@@ -263,6 +266,7 @@ class Retracer:
     def retrace_api(self, api):
 
         print '#include "trace_parser.hpp"'
+        print '#include "retrace.hpp"'
         print
 
         types = api.all_types()
@@ -271,10 +275,10 @@ class Retracer:
         for handle in handles:
             if handle.name not in handle_names:
                 if handle.key is None:
-                    print 'static std::map<%s, %s> __%s_map;' % (handle.type, handle.type, handle.name)
+                    print 'static retrace::map<%s> __%s_map;' % (handle.type, handle.name)
                 else:
                     key_name, key_type = handle.key
-                    print 'static std::map<%s, std::map<%s, %s> > __%s_map;' % (key_type, handle.type, handle.type, handle.name)
+                    print 'static std::map<%s, retrace::map<%s> > __%s_map;' % (key_type, handle.type, handle.name)
                 handle_names.add(handle.name)
         print