]> git.cworth.org Git - apitrace/blobdiff - egltrace.py
Don't abuse NotImplementedError.
[apitrace] / egltrace.py
index 27edc5a5c6926894981aa680ac7795bf65841ad2..5d5c7593a9f51b8663b901e9fe969786d7fa2115 100644 (file)
@@ -42,30 +42,30 @@ from dispatch import function_pointer_type, function_pointer_value
 
 class EglTracer(GlTracer):
 
-    def is_public_function(self, function):
+    def isFunctionPublic(self, function):
         # The symbols visible in libEGL.so can vary, so expose them all
         return True
 
-    def trace_function_impl_body(self, function):
-        GlTracer.trace_function_impl_body(self, function)
+    def traceFunctionImplBody(self, function):
+        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 '        tracer_context *tr = __get_context();'
+            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 = PROFILE_COMPAT;'
+            print '            tr->profile = gltrace::PROFILE_COMPAT;'
             print '        else if (version == 1)'
-            print '            tr->profile = PROFILE_ES1;'
+            print '            tr->profile = gltrace::PROFILE_ES1;'
             print '        else'
-            print '            tr->profile = PROFILE_ES2;'
+            print '            tr->profile = gltrace::PROFILE_ES2;'
             print '    }'
 
-    def wrap_ret(self, function, instance):
-        GlTracer.wrap_ret(self, function, instance)
+    def wrapRet(self, function, instance):
+        GlTracer.wrapRet(self, function, instance)
 
         if function.name == "eglGetProcAddress":
             print '    %s = __unwrap_proc_addr(procname, %s);' % (instance, instance)
@@ -89,9 +89,9 @@ if __name__ == '__main__':
     print
 
     api = API()
-    api.add_api(eglapi)
-    api.add_api(glapi)
-    api.add_api(glesapi)
+    api.addApi(eglapi)
+    api.addApi(glapi)
+    api.addApi(glesapi)
     tracer = EglTracer()
     tracer.trace_api(api)
 
@@ -113,6 +113,12 @@ if __name__ == '__main__':
     print r'''
 
 
+/*
+ * Android does not support LD_PRELOAD.
+ */
+#if !defined(ANDROID)
+
+
 /*
  * Invoke the true dlopen() function.
  */
@@ -186,5 +192,8 @@ void * dlopen(const char *filename, int flag)
 }
 
 
+#endif /* !ANDROID */
+
+
 
 '''