]> git.cworth.org Git - apitrace/commitdiff
check for error in eglMakeCurrent wrapper
authorImre Deak <imre.deak@intel.com>
Mon, 21 May 2012 10:55:40 +0000 (13:55 +0300)
committerImre Deak <imre.deak@intel.com>
Wed, 23 May 2012 08:28:24 +0000 (11:28 +0300)
In case of error we shouldn't update our book-keeping.

Signed-off-by: Imre Deak <imre.deak@intel.com>
wrappers/egltrace.py

index 81ae3c2ec16717ab49c524733dd892f52d5792d7..f40b8a06a863e2875d8704d6c8f64d4f03d1e82c 100644 (file)
@@ -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 '    }'