summaryrefslogtreecommitdiffstats
path: root/opengl/libs/GLES2_dbg/src/header.h
diff options
context:
space:
mode:
authorDavid Li <davidxli@google.com>2011-03-01 16:08:10 -0800
committerDavid Li <davidxli@google.com>2011-03-03 18:28:43 -0800
commit28ca2abb1ab92b2cc3a5c9119ec2f697ec3401b2 (patch)
treef6bcb82ff2a68a5bd30218326def0f95fb6734f2 /opengl/libs/GLES2_dbg/src/header.h
parente5f823ccf1cce4cab5699f1a07c1ee2290a69169 (diff)
downloadframeworks_base-28ca2abb1ab92b2cc3a5c9119ec2f697ec3401b2.zip
frameworks_base-28ca2abb1ab92b2cc3a5c9119ec2f697ec3401b2.tar.gz
frameworks_base-28ca2abb1ab92b2cc3a5c9119ec2f697ec3401b2.tar.bz2
Initial commit of GLESv2 debugger server
Use debug.egl.debug_proc property to match process cmdline. Binds to TCP:5039 and waits for client connection. Sends function call parameters, textures and shaders using Protobuf. Java Eclipse client plug-in is next. Change-Id: I183b755263663f87e86dde1ad12f527d0445fd57 Signed-off-by: David Li <davidxli@google.com>
Diffstat (limited to 'opengl/libs/GLES2_dbg/src/header.h')
-rw-r--r--opengl/libs/GLES2_dbg/src/header.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/opengl/libs/GLES2_dbg/src/header.h b/opengl/libs/GLES2_dbg/src/header.h
new file mode 100644
index 0000000..e1b194d
--- /dev/null
+++ b/opengl/libs/GLES2_dbg/src/header.h
@@ -0,0 +1,65 @@
+/*
+ ** Copyright 2011, The Android Open Source Project
+ **
+ ** Licensed under the Apache License, Version 2.0 (the "License");
+ ** you may not use this file except in compliance with the License.
+ ** You may obtain a copy of the License at
+ **
+ ** http://www.apache.org/licenses/LICENSE-2.0
+ **
+ ** Unless required by applicable law or agreed to in writing, software
+ ** distributed under the License is distributed on an "AS IS" BASIS,
+ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ** See the License for the specific language governing permissions and
+ ** limitations under the License.
+ */
+
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <errno.h>
+
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <sys/socket.h>
+
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#include <cutils/log.h>
+#include <cutils/properties.h>
+#include <../../../libcore/include/StaticAssert.h>
+
+#define EGL_TRACE 1
+#include "hooks.h"
+
+#define GL_ENTRY(_r, _api, ...) _r Debug_##_api ( __VA_ARGS__ );
+#include "../include/glesv2_dbg.h"
+
+#include "DebuggerMessage.pb.h"
+
+using namespace android;
+
+#define API_ENTRY(_api) Debug_##_api
+
+#ifndef __location__
+#define __HIERALLOC_STRING_0__(s) #s
+#define __HIERALLOC_STRING_1__(s) __HIERALLOC_STRING_0__(s)
+#define __HIERALLOC_STRING_2__ __HIERALLOC_STRING_1__(__LINE__)
+#define __location__ __FILE__ ":" __HIERALLOC_STRING_2__
+#endif
+
+#define ASSERT(expr) if (!(expr)) { LOGD("\n*\n*\n* ASSERT FAILED: %s at %s \n*\n*", #expr, __location__); exit(1); }
+#undef assert
+#define assert(expr) ASSERT(expr)
+//#undef LOGD
+//#define LOGD(...)
+
+namespace android
+{
+extern int clientSock, serverSock;
+#define BUFFSIZE 256
+extern char sockBuff [BUFFSIZE];
+
+void Send(const GLESv2Debugger::Message & msg, GLESv2Debugger::Message & cmd);
+}; // namespace android {