From: Imre Deak Date: Mon, 21 May 2012 10:55:40 +0000 (+0300) Subject: check for error in eglMakeCurrent wrapper X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=bf1f242397b87c2d501b1ca7a8045f7f3649ca3b;p=apitrace check for error in eglMakeCurrent wrapper In case of error we shouldn't update our book-keeping. Signed-off-by: Imre Deak --- diff --git a/wrappers/egltrace.py b/wrappers/egltrace.py index 81ae3c2..f40b8a0 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 ' }'