Skip to content

Commit

Permalink
Eliminate destroyContext.
Browse files Browse the repository at this point in the history
Same as releaseContext.
  • Loading branch information
jrfonseca committed Jul 11, 2012
1 parent 2f7a65c commit 5c298db
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 22 deletions.
2 changes: 1 addition & 1 deletion wrappers/cgltrace.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def traceFunctionImplBody(self, function):


if function.name == 'CGLDestroyContext': if function.name == 'CGLDestroyContext':
# The same rule applies here about the as for CGLReleaseContext. # 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 ' if (_CGLGetCurrentContext() == ctx) {'
print ' gltrace::clearContext();' print ' gltrace::clearContext();'
print ' }' print ' }'
Expand Down
5 changes: 3 additions & 2 deletions wrappers/egltrace.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ def traceFunctionImplBody(self, function):
print ' }' print ' }'


if function.name == 'eglDestroyContext': if function.name == 'eglDestroyContext':
print ' if (_result)' print ' if (_result) {'
print ' gltrace::destroyContext((uintptr_t)ctx);' print ' gltrace::releaseContext((uintptr_t)ctx);'
print ' }'


if __name__ == '__main__': if __name__ == '__main__':
print '#include <stdlib.h>' print '#include <stdlib.h>'
Expand Down
13 changes: 7 additions & 6 deletions wrappers/gltrace.hpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -47,17 +47,18 @@ class Context {
bool user_arrays_nv; bool user_arrays_nv;
unsigned retain_count; unsigned retain_count;


Context(void) : profile(PROFILE_COMPAT), user_arrays(false), Context(void) :
user_arrays_arb(false), user_arrays_nv(false), profile(PROFILE_COMPAT),
retain_count(0) { } user_arrays(false),
user_arrays_arb(false),
user_arrays_nv(false),
retain_count(0)
{ }
}; };


void void
createContext(uintptr_t context_id); createContext(uintptr_t context_id);


bool
destroyContext(uintptr_t context_id);

void void
retainContext(uintptr_t context_id); retainContext(uintptr_t context_id);


Expand Down
9 changes: 0 additions & 9 deletions wrappers/gltrace_state.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -126,15 +126,6 @@ void createContext(uintptr_t context_id)
context_map_mutex.unlock(); 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) void setContext(uintptr_t context_id)
{ {
ThreadState *ts = get_ts(); ThreadState *ts = get_ts();
Expand Down
6 changes: 3 additions & 3 deletions wrappers/glxtrace.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def isFunctionPublic(self, function):
] ]


def traceFunctionImplBody(self, function): def traceFunctionImplBody(self, function):
if function.name == 'glXDestroyContext':
print ' gltrace::releaseContext((uintptr_t)ctx);'

GlTracer.traceFunctionImplBody(self, function) GlTracer.traceFunctionImplBody(self, function)


if function.name == 'glXCreateContext': if function.name == 'glXCreateContext':
Expand All @@ -60,9 +63,6 @@ def traceFunctionImplBody(self, function):
print ' gltrace::clearContext();' print ' gltrace::clearContext();'
print ' }' print ' }'


if function.name == 'glXDestroyContext':
print ' gltrace::destroyContext((uintptr_t)ctx);'



if __name__ == '__main__': if __name__ == '__main__':
print print
Expand Down
2 changes: 1 addition & 1 deletion wrappers/wgltrace.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def traceFunctionImplBody(self, function):
print ' if (_wglGetCurrentContext() == hglrc) {' print ' if (_wglGetCurrentContext() == hglrc) {'
print ' gltrace::clearContext();' print ' gltrace::clearContext();'
print ' }' print ' }'
print ' gltrace::destroyContext((uintptr_t)hglrc);' print ' gltrace::releaseContext((uintptr_t)hglrc);'


GlTracer.traceFunctionImplBody(self, function) GlTracer.traceFunctionImplBody(self, function)


Expand Down

0 comments on commit 5c298db

Please sign in to comment.