Permalink
Browse files

Eliminate destroyContext.

Same as releaseContext.
  • Loading branch information...
1 parent 2f7a65c commit 5c298db8fe117e0a445af051335aa0da91c3a31b @jrfonseca jrfonseca committed Jul 11, 2012
Showing with 15 additions and 22 deletions.
  1. +1 −1 wrappers/cgltrace.py
  2. +3 −2 wrappers/egltrace.py
  3. +7 −6 wrappers/gltrace.hpp
  4. +0 −9 wrappers/gltrace_state.cpp
  5. +3 −3 wrappers/glxtrace.py
  6. +1 −1 wrappers/wgltrace.py
@@ -53,7 +53,7 @@ def traceFunctionImplBody(self, function):
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 ' }'
@@ -77,8 +77,9 @@ def traceFunctionImplBody(self, function):
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>'
View
@@ -47,17 +47,18 @@ class Context {
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);
@@ -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();
@@ -46,6 +46,9 @@ def isFunctionPublic(self, function):
]
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 @@ def traceFunctionImplBody(self, function):
print ' gltrace::clearContext();'
print ' }'
- if function.name == 'glXDestroyContext':
- print ' gltrace::destroyContext((uintptr_t)ctx);'
-
if __name__ == '__main__':
print
@@ -46,7 +46,7 @@ def traceFunctionImplBody(self, function):
print ' if (_wglGetCurrentContext() == hglrc) {'
print ' gltrace::clearContext();'
print ' }'
- print ' gltrace::destroyContext((uintptr_t)hglrc);'
+ print ' gltrace::releaseContext((uintptr_t)hglrc);'
GlTracer.traceFunctionImplBody(self, function)

0 comments on commit 5c298db

Please sign in to comment.