blob: e1b194dd9871552c3dd15bb1503b79086f5cc29a [file] [log] [blame]
David Li28ca2ab2011-03-01 16:08:10 -08001/*
2 ** Copyright 2011, The Android Open Source Project
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16
17#include <stdlib.h>
18#include <ctype.h>
19#include <string.h>
20#include <errno.h>
21
22#include <sys/ioctl.h>
23#include <unistd.h>
24#include <sys/socket.h>
25
26#include <GLES2/gl2.h>
27#include <GLES2/gl2ext.h>
28
29#include <cutils/log.h>
30#include <cutils/properties.h>
31#include <../../../libcore/include/StaticAssert.h>
32
33#define EGL_TRACE 1
34#include "hooks.h"
35
36#define GL_ENTRY(_r, _api, ...) _r Debug_##_api ( __VA_ARGS__ );
37#include "../include/glesv2_dbg.h"
38
39#include "DebuggerMessage.pb.h"
40
41using namespace android;
42
43#define API_ENTRY(_api) Debug_##_api
44
45#ifndef __location__
46#define __HIERALLOC_STRING_0__(s) #s
47#define __HIERALLOC_STRING_1__(s) __HIERALLOC_STRING_0__(s)
48#define __HIERALLOC_STRING_2__ __HIERALLOC_STRING_1__(__LINE__)
49#define __location__ __FILE__ ":" __HIERALLOC_STRING_2__
50#endif
51
52#define ASSERT(expr) if (!(expr)) { LOGD("\n*\n*\n* ASSERT FAILED: %s at %s \n*\n*", #expr, __location__); exit(1); }
53#undef assert
54#define assert(expr) ASSERT(expr)
55//#undef LOGD
56//#define LOGD(...)
57
58namespace android
59{
60extern int clientSock, serverSock;
61#define BUFFSIZE 256
62extern char sockBuff [BUFFSIZE];
63
64void Send(const GLESv2Debugger::Message & msg, GLESv2Debugger::Message & cmd);
65}; // namespace android {