summaryrefslogtreecommitdiffstats
path: root/opengl/libs/EGL
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2011-12-02 15:49:01 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-12-02 15:49:01 -0800
commit3d53e57e31535b8422ec22013e4a2d7ef6ea7249 (patch)
tree177ac1b9e347614b83668d1c42a217321d62d80d /opengl/libs/EGL
parent29f1c32eea12ab33547af73fb0e5dcf432e6979c (diff)
parentdb97468fd241cecce62366b4f0962a9572161e95 (diff)
downloadframeworks_base-3d53e57e31535b8422ec22013e4a2d7ef6ea7249.zip
frameworks_base-3d53e57e31535b8422ec22013e4a2d7ef6ea7249.tar.gz
frameworks_base-3d53e57e31535b8422ec22013e4a2d7ef6ea7249.tar.bz2
Merge "glestrace: Framework for GLES tracing library"
Diffstat (limited to 'opengl/libs/EGL')
-rw-r--r--opengl/libs/EGL/Loader.cpp4
-rw-r--r--opengl/libs/EGL/egl.cpp23
-rw-r--r--opengl/libs/EGL/eglApi.cpp34
-rw-r--r--opengl/libs/EGL/egl_tls.cpp2
-rw-r--r--opengl/libs/EGL/egl_tls.h1
-rw-r--r--opengl/libs/EGL/trace.cpp16
6 files changed, 32 insertions, 48 deletions
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp
index 325193c..8a8898b 100644
--- a/opengl/libs/EGL/Loader.cpp
+++ b/opengl/libs/EGL/Loader.cpp
@@ -28,7 +28,7 @@
#include <EGL/egl.h>
#include "egldefs.h"
-#include "glesv2dbg.h"
+#include "glestrace.h"
#include "hooks.h"
#include "Loader.h"
@@ -157,7 +157,7 @@ Loader::Loader()
Loader::~Loader()
{
- StopDebugServer();
+ GLTrace_stop();
}
const char* Loader::getTag(int dpy, int impl)
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index 6ad06af..14745b3 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -37,7 +37,7 @@
#include "egldefs.h"
#include "egl_impl.h"
#include "egl_tls.h"
-#include "glesv2dbg.h"
+#include "glestrace.h"
#include "hooks.h"
#include "Loader.h"
@@ -67,7 +67,6 @@ static int sEGLTraceLevel;
static int sEGLApplicationTraceLevel;
extern gl_hooks_t gHooksTrace;
-extern gl_hooks_t gHooksDebug;
static inline void setGlTraceThreadSpecific(gl_hooks_t const *value) {
pthread_setspecific(gGLTraceKey, value);
@@ -89,27 +88,17 @@ void initEglTraceLevel() {
char procPath[128] = {};
sprintf(procPath, "/proc/%ld/cmdline", pid);
FILE * file = fopen(procPath, "r");
- if (file)
- {
+ if (file) {
char cmdline[256] = {};
- if (fgets(cmdline, sizeof(cmdline) - 1, file))
- {
+ if (fgets(cmdline, sizeof(cmdline) - 1, file)) {
if (!strcmp(value, cmdline))
gEGLDebugLevel = 1;
}
fclose(file);
}
- if (gEGLDebugLevel > 0)
- {
- property_get("debug.egl.debug_port", value, "5039");
- const unsigned short port = (unsigned short)atoi(value);
- property_get("debug.egl.debug_forceUseFile", value, "0");
- const bool forceUseFile = (bool)atoi(value);
- property_get("debug.egl.debug_maxFileSize", value, "8");
- const unsigned int maxFileSize = atoi(value) << 20;
- property_get("debug.egl.debug_filePath", value, "/data/local/tmp/dump.gles2dbg");
- StartDebugServer(port, forceUseFile, maxFileSize, value);
+ if (gEGLDebugLevel > 0) {
+ GLTrace_start();
}
}
@@ -119,7 +108,7 @@ void setGLHooksThreadSpecific(gl_hooks_t const *value) {
setGlThreadSpecific(&gHooksTrace);
} else if (gEGLDebugLevel > 0 && value != &gHooksNoContext) {
setGlTraceThreadSpecific(value);
- setGlThreadSpecific(&gHooksDebug);
+ setGlThreadSpecific(GLTrace_getGLHooks());
} else {
setGlThreadSpecific(value);
}
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index 2b0ed5d..1dbba3f 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -37,7 +37,7 @@
#include "egl_impl.h"
#include "egl_tls.h"
-#include "glesv2dbg.h"
+#include "glestrace.h"
#include "hooks.h"
#include "egl_display.h"
@@ -112,7 +112,6 @@ extern EGLBoolean egl_init_drivers();
extern const __eglMustCastToProperFunctionPointerType gExtensionForwarders[MAX_NUMBER_OF_GL_EXTENSIONS];
extern int gEGLDebugLevel;
extern gl_hooks_t gHooksTrace;
-extern gl_hooks_t gHooksDebug;
} // namespace android;
// ----------------------------------------------------------------------------
@@ -516,6 +515,10 @@ EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config,
}
egl_context_t* c = new egl_context_t(dpy, context, config,
dp->configs[intptr_t(config)].impl, cnx, version);
+#if EGL_TRACE
+ if (gEGLDebugLevel > 0)
+ GLTrace_eglCreateContext(version, c);
+#endif
return c;
}
}
@@ -657,9 +660,10 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw,
if (ctx != EGL_NO_CONTEXT) {
setGLHooksThreadSpecific(c->cnx->hooks[c->version]);
egl_tls_t::setContext(ctx);
- if (gEGLDebugLevel > 0) {
- CreateDbgContext(c->version, c->cnx->hooks[c->version]);
- }
+#if EGL_TRACE
+ if (gEGLDebugLevel > 0)
+ GLTrace_eglMakeCurrent(c->version, c->cnx->hooks[c->version]);
+#endif
_c.acquire();
_r.acquire();
_d.acquire();
@@ -886,6 +890,10 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
"no more slots for eglGetProcAddress(\"%s\")",
procname);
+#if EGL_TRACE
+ gl_hooks_t *debugHooks = GLTrace_getGLHooks();
+#endif
+
if (!addr && (slot < MAX_NUMBER_OF_GL_EXTENSIONS)) {
bool found = false;
for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) {
@@ -896,7 +904,7 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
cnx->hooks[GLESv1_INDEX]->ext.extensions[slot] =
cnx->hooks[GLESv2_INDEX]->ext.extensions[slot] =
#if EGL_TRACE
- gHooksDebug.ext.extensions[slot] = gHooksTrace.ext.extensions[slot] =
+ debugHooks->ext.extensions[slot] = gHooksTrace.ext.extensions[slot] =
#endif
cnx->egl.eglGetProcAddress(procname);
}
@@ -924,10 +932,6 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw)
{
- EGLBoolean Debug_eglSwapBuffers(EGLDisplay dpy, EGLSurface draw);
- if (gEGLDebugLevel > 0)
- Debug_eglSwapBuffers(dpy, draw);
-
clearError();
egl_display_t const * const dp = validate_display(dpy);
@@ -937,6 +941,11 @@ EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw)
if (!_s.get())
return setError(EGL_BAD_SURFACE, EGL_FALSE);
+#if EGL_TRACE
+ if (gEGLDebugLevel > 0)
+ GLTrace_eglSwapBuffers(dpy, draw);
+#endif
+
egl_surface_t const * const s = get_surface(draw);
return s->cnx->egl.eglSwapBuffers(dp->disp[s->impl].dpy, s->surface);
}
@@ -1162,7 +1171,10 @@ EGLBoolean eglReleaseThread(void)
}
}
egl_tls_t::clearTLS();
- dbgReleaseThread();
+#if EGL_TRACE
+ if (gEGLDebugLevel > 0)
+ GLTrace_eglReleaseThread();
+#endif
return EGL_TRUE;
}
diff --git a/opengl/libs/EGL/egl_tls.cpp b/opengl/libs/EGL/egl_tls.cpp
index b341ddb..6946ecd 100644
--- a/opengl/libs/EGL/egl_tls.cpp
+++ b/opengl/libs/EGL/egl_tls.cpp
@@ -33,7 +33,7 @@ pthread_key_t egl_tls_t::sKey = -1;
pthread_mutex_t egl_tls_t::sLockKey = PTHREAD_MUTEX_INITIALIZER;
egl_tls_t::egl_tls_t()
- : error(EGL_SUCCESS), ctx(0), logCallWithNoContext(EGL_TRUE), dbg(0) {
+ : error(EGL_SUCCESS), ctx(0), logCallWithNoContext(EGL_TRUE) {
}
const char *egl_tls_t::egl_strerror(EGLint err) {
diff --git a/opengl/libs/EGL/egl_tls.h b/opengl/libs/EGL/egl_tls.h
index 78b0b2f..2442ca0 100644
--- a/opengl/libs/EGL/egl_tls.h
+++ b/opengl/libs/EGL/egl_tls.h
@@ -37,7 +37,6 @@ class egl_tls_t {
EGLint error;
EGLContext ctx;
EGLBoolean logCallWithNoContext;
- DbgContext* dbg;
egl_tls_t();
static void validateTLSKey();
diff --git a/opengl/libs/EGL/trace.cpp b/opengl/libs/EGL/trace.cpp
index 0e934e2..bd6c348 100644
--- a/opengl/libs/EGL/trace.cpp
+++ b/opengl/libs/EGL/trace.cpp
@@ -375,22 +375,6 @@ extern "C" {
#undef TRACE_GL_VOID
#undef TRACE_GL
-// declare all Debug_gl* functions
-#define GL_ENTRY(_r, _api, ...) _r Debug_##_api ( __VA_ARGS__ );
-#include "glesv2dbg_functions.h"
-#undef GL_ENTRY
-
-#define GL_ENTRY(_r, _api, ...) Debug_ ## _api,
-EGLAPI gl_hooks_t gHooksDebug = {
- {
- #include "entries.in"
- },
- {
- {0}
- }
-};
-#undef GL_ENTRY
-
// ----------------------------------------------------------------------------
}; // namespace android
// ----------------------------------------------------------------------------