summaryrefslogtreecommitdiffstats
path: root/opengl/libs/GLES_trace/src/gltrace_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'opengl/libs/GLES_trace/src/gltrace_context.h')
-rw-r--r--opengl/libs/GLES_trace/src/gltrace_context.h30
1 files changed, 27 insertions, 3 deletions
diff --git a/opengl/libs/GLES_trace/src/gltrace_context.h b/opengl/libs/GLES_trace/src/gltrace_context.h
index 35436cb..0680a9b 100644
--- a/opengl/libs/GLES_trace/src/gltrace_context.h
+++ b/opengl/libs/GLES_trace/src/gltrace_context.h
@@ -17,7 +17,10 @@
#ifndef __GLTRACE_CONTEXT_H_
#define __GLTRACE_CONTEXT_H_
+#include <map>
+
#include "hooks.h"
+#include "gltrace_transport.h"
namespace android {
namespace gltrace {
@@ -26,24 +29,45 @@ using ::android::gl_hooks_t;
enum FBBinding {CURRENTLY_BOUND_FB, FB0};
+/** GL Trace Context info associated with each EGLContext */
class GLTraceContext {
+ int mId; /* unique context id */
+
void *fbcontents; /* memory area to read framebuffer contents */
void *fbcompressed; /* destination for lzf compressed framebuffer */
unsigned fbcontentsSize; /* size of fbcontents & fbcompressed buffers */
+ BufferedOutputStream *mBufferedOutputStream; /* stream where trace info is sent */
+
void resizeFBMemory(unsigned minSize);
public:
gl_hooks_t *hooks;
- GLTraceContext();
+ GLTraceContext(int id, BufferedOutputStream *stream);
+ int getId();
void getCompressedFB(void **fb, unsigned *fbsize,
unsigned *fbwidth, unsigned *fbheight,
FBBinding fbToRead);
+ void traceGLMessage(GLMessage *msg);
+};
+
+/** Per process trace state. */
+class GLTraceState {
+ int mTraceContextIds;
+ TCPStream *mStream;
+ std::map<EGLContext, GLTraceContext*> mPerContextState;
+public:
+ GLTraceState(TCPStream *stream);
+ ~GLTraceState();
+
+ GLTraceContext *createTraceContext(int version, EGLContext c);
+ GLTraceContext *getTraceContext(EGLContext c);
+
+ TCPStream *getStream();
};
+void setupTraceContextThreadSpecific(GLTraceContext *context);
GLTraceContext *getGLTraceContext();
-void setGLTraceContext(GLTraceContext *c);
-void initContext(unsigned version, gl_hooks_t *hooks);
void releaseContext();
};