]> git.cworth.org Git - apitrace/commitdiff
Drop TRACE_EGL.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 29 Mar 2012 23:18:16 +0000 (00:18 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 29 Mar 2012 23:18:16 +0000 (00:18 +0100)
Also unnecessary.

CMakeLists.txt
glproc.py
glstate_images.cpp

index 5c637b4d47d237719e1386b77ef880c1164623bc..412dd41cffda884b51264037d973a6c1a1e28d66 100755 (executable)
@@ -506,12 +506,6 @@ if (ENABLE_EGL AND NOT WIN32 AND NOT APPLE)
 
     add_dependencies (egltrace glproc)
 
-    set_property (
-        TARGET egltrace
-        APPEND
-        PROPERTY COMPILE_DEFINITIONS "TRACE_EGL"
-    )
-
     set_target_properties (egltrace PROPERTIES
         # avoid the default "lib" prefix
         PREFIX ""
@@ -628,7 +622,6 @@ if (ENABLE_EGL AND X11_FOUND AND NOT WIN32 AND NOT APPLE)
         TARGET eglretrace
         APPEND
         PROPERTY COMPILE_DEFINITIONS "RETRACE"
-        PROPERTY COMPILE_DEFINITIONS "TRACE_EGL"
     )
 
     target_link_libraries (eglretrace
index 95ab80f50c27870a6d83dbf04abbcdbea38c6f02..0f03d8d113007426e0a883bfa593b8474634bfd4 100644 (file)
--- a/glproc.py
+++ b/glproc.py
@@ -515,20 +515,24 @@ if __name__ == '__main__':
     print '#include "glimports.hpp"'
     print '#include "os.hpp"'
     print
-    print
     dispatcher = GlDispatcher()
+    print
     dispatcher.header()
-    print '#if defined(TRACE_EGL)'
     print
     dispatcher.dispatch_api(eglapi)
-    print '#elif defined(_WIN32)'
+    print
+    print '#if defined(_WIN32)'
     print
     dispatcher.dispatch_api(wglapi)
+    print
     print '#elif defined(__APPLE__)'
+    print
     dispatcher.dispatch_api(cglapi)
+    print
     print '#else'
     print
     dispatcher.dispatch_api(glxapi)
+    print
     print '#endif'
     print
     dispatcher.dispatch_api(glapi)
index 2c4d933c430e3dabd13e6dfa89fb4dd1caf718c4..2c7c66b407dae4192199b09f72bb05d51e8e98f4 100644 (file)
 #include "glstate_internal.hpp"
 
 
+#ifdef __linux__
+#include <dlfcn.h>
+#endif
+
 #ifdef __APPLE__
 
 #include <Carbon/Carbon.h>
@@ -443,31 +447,33 @@ dumpTextures(JSONWriter &json, Context &context)
 
 static bool
 getDrawableBounds(GLint *width, GLint *height) {
-#if defined(TRACE_EGL)
+#if defined(__linux__)
+    if (dlsym(RTLD_DEFAULT, "eglGetCurrentContext")) {
+        EGLContext currentContext = eglGetCurrentContext();
+        if (currentContext == EGL_NO_CONTEXT) {
+            return false;
+        }
 
-    EGLContext currentContext = eglGetCurrentContext();
-    if (currentContext == EGL_NO_CONTEXT) {
-        return false;
-    }
+        EGLSurface currentSurface = eglGetCurrentSurface(EGL_DRAW);
+        if (currentSurface == EGL_NO_SURFACE) {
+            return false;
+        }
 
-    EGLSurface currentSurface = eglGetCurrentSurface(EGL_DRAW);
-    if (currentSurface == EGL_NO_SURFACE) {
-        return false;
-    }
+        EGLDisplay currentDisplay = eglGetCurrentDisplay();
+        if (currentDisplay == EGL_NO_DISPLAY) {
+            return false;
+        }
 
-    EGLDisplay currentDisplay = eglGetCurrentDisplay();
-    if (currentDisplay == EGL_NO_DISPLAY) {
-        return false;
-    }
+        if (!eglQuerySurface(currentDisplay, currentSurface, EGL_WIDTH, width) ||
+            !eglQuerySurface(currentDisplay, currentSurface, EGL_HEIGHT, height)) {
+            return false;
+        }
 
-    if (!eglQuerySurface(currentDisplay, currentSurface, EGL_WIDTH, width) ||
-        !eglQuerySurface(currentDisplay, currentSurface, EGL_HEIGHT, height)) {
-        return false;
+        return true;
     }
+#endif
 
-    return true;
-
-#elif defined(_WIN32)
+#if defined(_WIN32)
 
     HDC hDC = wglGetCurrentDC();
     if (!hDC) {