]> git.cworth.org Git - apitrace/commitdiff
Eliminate destroyContext.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 11 Jul 2012 11:14:31 +0000 (12:14 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 11 Jul 2012 11:14:31 +0000 (12:14 +0100)
Same as releaseContext.

wrappers/cgltrace.py
wrappers/egltrace.py
wrappers/gltrace.hpp
wrappers/gltrace_state.cpp
wrappers/glxtrace.py
wrappers/wgltrace.py

index 4bb0c4c304a9ed3cead8f697480f6267d34b0bd9..e7cbd7b123fa6c834e2180f04bcd769071ac2237 100644 (file)
@@ -53,7 +53,7 @@ class CglTracer(GlTracer):
 
         if function.name == 'CGLDestroyContext':
             # The same rule applies here about the  as for CGLReleaseContext.
-            print '    if (gltrace::destroyContext((uintptr_t)ctx)) {'
+            print '    if (gltrace::releaseContext((uintptr_t)ctx)) {'
             print '        if (_CGLGetCurrentContext() == ctx) {'
             print '            gltrace::clearContext();'
             print '        }'
index fb8a3a0b3b362ff4fd61e0a5bff65909f2f7daec..18058468049154acf0eb2d78d77a9d13368424ed 100644 (file)
@@ -77,8 +77,9 @@ class EglTracer(GlTracer):
             print '    }'
 
         if function.name == 'eglDestroyContext':
-            print '    if (_result)'
-            print '        gltrace::destroyContext((uintptr_t)ctx);'
+            print '    if (_result) {'
+            print '        gltrace::releaseContext((uintptr_t)ctx);'
+            print '    }'
 
 if __name__ == '__main__':
     print '#include <stdlib.h>'
index 49d86312f4e7619b67ccfc03afb70d9736bdc7c7..db824bb315ffd5f1044b3752104b83e7de466fac 100644 (file)
@@ -47,17 +47,18 @@ public:
     bool user_arrays_nv;
     unsigned retain_count;
 
-    Context(void) : profile(PROFILE_COMPAT), user_arrays(false),
-                    user_arrays_arb(false), user_arrays_nv(false),
-                    retain_count(0) { }
+    Context(void) :
+        profile(PROFILE_COMPAT),
+        user_arrays(false),
+        user_arrays_arb(false),
+        user_arrays_nv(false),
+        retain_count(0)
+    { }
 };
 
 void
 createContext(uintptr_t context_id);
 
-bool
-destroyContext(uintptr_t context_id);
-
 void
 retainContext(uintptr_t context_id);
 
index 9fcc56e2e5a68c7e67902aacf5001937fef388b3..cb8e08b1accce6b7818a55528f74809f7da1cd53 100644 (file)
@@ -126,15 +126,6 @@ void createContext(uintptr_t context_id)
     context_map_mutex.unlock();
 }
 
-/*
- * return true if the context has been destroyed, false otherwise. See
- * the note at releaseContext about the actual ccontext lifetime.
- */
-bool destroyContext(uintptr_t context_id)
-{
-    return releaseContext(context_id);
-}
-
 void setContext(uintptr_t context_id)
 {
     ThreadState *ts = get_ts();
index 73e41b3641222e09fdaead8048685431b7062da5..ff3eb4cd62652ec216b0e83e516aefd011c41241 100644 (file)
@@ -46,6 +46,9 @@ class GlxTracer(GlTracer):
     ]
 
     def traceFunctionImplBody(self, function):
+        if function.name == 'glXDestroyContext':
+            print '    gltrace::releaseContext((uintptr_t)ctx);'
+
         GlTracer.traceFunctionImplBody(self, function)
 
         if function.name == 'glXCreateContext':
@@ -60,9 +63,6 @@ class GlxTracer(GlTracer):
             print '            gltrace::clearContext();'
             print '    }'
 
-        if function.name == 'glXDestroyContext':
-            print '    gltrace::destroyContext((uintptr_t)ctx);'
-
 
 if __name__ == '__main__':
     print
index b3a29e24584a0007afbc1f714ae1fec2050936e4..1b0035799fdd648f32bda397b2e4ddb5f86c67e4 100644 (file)
@@ -46,7 +46,7 @@ class WglTracer(GlTracer):
             print '    if (_wglGetCurrentContext() == hglrc) {'
             print '        gltrace::clearContext();'
             print '    }'
-            print '    gltrace::destroyContext((uintptr_t)hglrc);'
+            print '    gltrace::releaseContext((uintptr_t)hglrc);'
 
         GlTracer.traceFunctionImplBody(self, function)