summaryrefslogtreecommitdiff
path: root/wrappers/egltrace.py
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2012-05-21 13:55:40 +0300
committerImre Deak <imre.deak@intel.com>2012-05-23 11:28:24 +0300
commitbf1f242397b87c2d501b1ca7a8045f7f3649ca3b (patch)
tree3a380b68d5137e42ee0b7cf9372424e10a76647b /wrappers/egltrace.py
parenta4c698dfae954d04b459a9b9543d0404a4c80660 (diff)
check for error in eglMakeCurrent wrapper
In case of error we shouldn't update our book-keeping. Signed-off-by: Imre Deak <imre.deak@intel.com>
Diffstat (limited to 'wrappers/egltrace.py')
-rw-r--r--wrappers/egltrace.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/wrappers/egltrace.py b/wrappers/egltrace.py
index 81ae3c2e..f40b8a06 100644
--- a/wrappers/egltrace.py
+++ b/wrappers/egltrace.py
@@ -53,18 +53,20 @@ class EglTracer(GlTracer):
GlTracer.traceFunctionImplBody(self, function)
if function.name == 'eglMakeCurrent':
- print ' // update the profile'
- print ' if (ctx != EGL_NO_CONTEXT) {'
- print ' EGLint api = EGL_OPENGL_ES_API, version = 1;'
- print ' gltrace::Context *tr = gltrace::getContext();'
- print ' _eglQueryContext(dpy, ctx, EGL_CONTEXT_CLIENT_TYPE, &api);'
- print ' _eglQueryContext(dpy, ctx, EGL_CONTEXT_CLIENT_VERSION, &version);'
- print ' if (api == EGL_OPENGL_API)'
- print ' tr->profile = gltrace::PROFILE_COMPAT;'
- print ' else if (version == 1)'
- print ' tr->profile = gltrace::PROFILE_ES1;'
- print ' else'
- print ' tr->profile = gltrace::PROFILE_ES2;'
+ print ' if (_result) {'
+ print ' // update the profile'
+ print ' if (ctx != EGL_NO_CONTEXT) {'
+ print ' EGLint api = EGL_OPENGL_ES_API, version = 1;'
+ print ' gltrace::Context *tr = gltrace::getContext();'
+ print ' _eglQueryContext(dpy, ctx, EGL_CONTEXT_CLIENT_TYPE, &api);'
+ print ' _eglQueryContext(dpy, ctx, EGL_CONTEXT_CLIENT_VERSION, &version);'
+ print ' if (api == EGL_OPENGL_API)'
+ print ' tr->profile = gltrace::PROFILE_COMPAT;'
+ print ' else if (version == 1)'
+ print ' tr->profile = gltrace::PROFILE_ES1;'
+ print ' else'
+ print ' tr->profile = gltrace::PROFILE_ES2;'
+ print ' }'
print ' }'