Loading opengl/libs/GLES_trace/src/gltrace_context.cpp +8 −2 Original line number Original line Diff line number Diff line Loading @@ -119,7 +119,7 @@ GLTraceContext *GLTraceState::createTraceContext(int version, EGLContext eglCont const size_t DEFAULT_BUFFER_SIZE = 8192; const size_t DEFAULT_BUFFER_SIZE = 8192; BufferedOutputStream *stream = new BufferedOutputStream(mStream, DEFAULT_BUFFER_SIZE); BufferedOutputStream *stream = new BufferedOutputStream(mStream, DEFAULT_BUFFER_SIZE); GLTraceContext *traceContext = new GLTraceContext(id, this, stream); GLTraceContext *traceContext = new GLTraceContext(id, version, this, stream); mPerContextState[eglContext] = traceContext; mPerContextState[eglContext] = traceContext; return traceContext; return traceContext; Loading @@ -129,8 +129,10 @@ GLTraceContext *GLTraceState::getTraceContext(EGLContext c) { return mPerContextState[c]; return mPerContextState[c]; } } GLTraceContext::GLTraceContext(int id, GLTraceState *state, BufferedOutputStream *stream) : GLTraceContext::GLTraceContext(int id, int version, GLTraceState *state, BufferedOutputStream *stream) : mId(id), mId(id), mVersion(version), mState(state), mState(state), mBufferedOutputStream(stream), mBufferedOutputStream(stream), mElementArrayBuffers(DefaultKeyedVector<GLuint, ElementArrayBuffer*>(NULL)) mElementArrayBuffers(DefaultKeyedVector<GLuint, ElementArrayBuffer*>(NULL)) Loading @@ -143,6 +145,10 @@ int GLTraceContext::getId() { return mId; return mId; } } int GLTraceContext::getVersion() { return mVersion; } GLTraceState *GLTraceContext::getGlobalTraceState() { GLTraceState *GLTraceContext::getGlobalTraceState() { return mState; return mState; } } Loading opengl/libs/GLES_trace/src/gltrace_context.h +3 −1 Original line number Original line Diff line number Diff line Loading @@ -50,6 +50,7 @@ public: /** GL Trace Context info associated with each EGLContext */ /** GL Trace Context info associated with each EGLContext */ class GLTraceContext { class GLTraceContext { int mId; /* unique context id */ int mId; /* unique context id */ int mVersion; /* GL version, e.g: egl_connection_t::GLESv2_INDEX */ GLTraceState *mState; /* parent GL Trace state (for per process GL Trace State Info) */ GLTraceState *mState; /* parent GL Trace state (for per process GL Trace State Info) */ void *fbcontents; /* memory area to read framebuffer contents */ void *fbcontents; /* memory area to read framebuffer contents */ Loading @@ -65,8 +66,9 @@ class GLTraceContext { public: public: gl_hooks_t *hooks; gl_hooks_t *hooks; GLTraceContext(int id, GLTraceState *state, BufferedOutputStream *stream); GLTraceContext(int id, int version, GLTraceState *state, BufferedOutputStream *stream); int getId(); int getId(); int getVersion(); GLTraceState *getGlobalTraceState(); GLTraceState *getGlobalTraceState(); void getCompressedFB(void **fb, unsigned *fbsize, void getCompressedFB(void **fb, unsigned *fbsize, unsigned *fbwidth, unsigned *fbheight, unsigned *fbwidth, unsigned *fbheight, Loading opengl/libs/GLES_trace/src/gltrace_fixup.cpp +11 −0 Original line number Original line Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ */ #include <cutils/log.h> #include <cutils/log.h> #include <EGL/egldefs.h> #include <GLES/gl.h> #include <GLES/gl.h> #include <GLES/glext.h> #include <GLES/glext.h> #include <GLES2/gl2.h> #include <GLES2/gl2.h> Loading Loading @@ -592,6 +593,11 @@ void trace_VertexAttribPointerData(GLTraceContext *context, } } void trace_VertexAttribPointerDataForGlDrawArrays(GLTraceContext *context, GLMessage *glmsg) { void trace_VertexAttribPointerDataForGlDrawArrays(GLTraceContext *context, GLMessage *glmsg) { if (context->getVersion() == egl_connection_t::GLESv1_INDEX) { // only supported for GLES2 and above return; } /* void glDrawArrays(GLenum mode, GLint first, GLsizei count) */ /* void glDrawArrays(GLenum mode, GLint first, GLsizei count) */ GLsizei count = glmsg->args(2).intvalue(0); GLsizei count = glmsg->args(2).intvalue(0); Loading @@ -604,6 +610,11 @@ void trace_VertexAttribPointerDataForGlDrawArrays(GLTraceContext *context, GLMes void trace_VertexAttribPointerDataForGlDrawElements(GLTraceContext *context, GLMessage *glmsg, void trace_VertexAttribPointerDataForGlDrawElements(GLTraceContext *context, GLMessage *glmsg, GLvoid *indices) { GLvoid *indices) { if (context->getVersion() == egl_connection_t::GLESv1_INDEX) { // only supported for GLES2 and above return; } /* void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) */ /* void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) */ GLsizei count = glmsg->args(1).intvalue(0); GLsizei count = glmsg->args(1).intvalue(0); GLenum type = glmsg->args(2).intvalue(0); GLenum type = glmsg->args(2).intvalue(0); Loading Loading
opengl/libs/GLES_trace/src/gltrace_context.cpp +8 −2 Original line number Original line Diff line number Diff line Loading @@ -119,7 +119,7 @@ GLTraceContext *GLTraceState::createTraceContext(int version, EGLContext eglCont const size_t DEFAULT_BUFFER_SIZE = 8192; const size_t DEFAULT_BUFFER_SIZE = 8192; BufferedOutputStream *stream = new BufferedOutputStream(mStream, DEFAULT_BUFFER_SIZE); BufferedOutputStream *stream = new BufferedOutputStream(mStream, DEFAULT_BUFFER_SIZE); GLTraceContext *traceContext = new GLTraceContext(id, this, stream); GLTraceContext *traceContext = new GLTraceContext(id, version, this, stream); mPerContextState[eglContext] = traceContext; mPerContextState[eglContext] = traceContext; return traceContext; return traceContext; Loading @@ -129,8 +129,10 @@ GLTraceContext *GLTraceState::getTraceContext(EGLContext c) { return mPerContextState[c]; return mPerContextState[c]; } } GLTraceContext::GLTraceContext(int id, GLTraceState *state, BufferedOutputStream *stream) : GLTraceContext::GLTraceContext(int id, int version, GLTraceState *state, BufferedOutputStream *stream) : mId(id), mId(id), mVersion(version), mState(state), mState(state), mBufferedOutputStream(stream), mBufferedOutputStream(stream), mElementArrayBuffers(DefaultKeyedVector<GLuint, ElementArrayBuffer*>(NULL)) mElementArrayBuffers(DefaultKeyedVector<GLuint, ElementArrayBuffer*>(NULL)) Loading @@ -143,6 +145,10 @@ int GLTraceContext::getId() { return mId; return mId; } } int GLTraceContext::getVersion() { return mVersion; } GLTraceState *GLTraceContext::getGlobalTraceState() { GLTraceState *GLTraceContext::getGlobalTraceState() { return mState; return mState; } } Loading
opengl/libs/GLES_trace/src/gltrace_context.h +3 −1 Original line number Original line Diff line number Diff line Loading @@ -50,6 +50,7 @@ public: /** GL Trace Context info associated with each EGLContext */ /** GL Trace Context info associated with each EGLContext */ class GLTraceContext { class GLTraceContext { int mId; /* unique context id */ int mId; /* unique context id */ int mVersion; /* GL version, e.g: egl_connection_t::GLESv2_INDEX */ GLTraceState *mState; /* parent GL Trace state (for per process GL Trace State Info) */ GLTraceState *mState; /* parent GL Trace state (for per process GL Trace State Info) */ void *fbcontents; /* memory area to read framebuffer contents */ void *fbcontents; /* memory area to read framebuffer contents */ Loading @@ -65,8 +66,9 @@ class GLTraceContext { public: public: gl_hooks_t *hooks; gl_hooks_t *hooks; GLTraceContext(int id, GLTraceState *state, BufferedOutputStream *stream); GLTraceContext(int id, int version, GLTraceState *state, BufferedOutputStream *stream); int getId(); int getId(); int getVersion(); GLTraceState *getGlobalTraceState(); GLTraceState *getGlobalTraceState(); void getCompressedFB(void **fb, unsigned *fbsize, void getCompressedFB(void **fb, unsigned *fbsize, unsigned *fbwidth, unsigned *fbheight, unsigned *fbwidth, unsigned *fbheight, Loading
opengl/libs/GLES_trace/src/gltrace_fixup.cpp +11 −0 Original line number Original line Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ */ #include <cutils/log.h> #include <cutils/log.h> #include <EGL/egldefs.h> #include <GLES/gl.h> #include <GLES/gl.h> #include <GLES/glext.h> #include <GLES/glext.h> #include <GLES2/gl2.h> #include <GLES2/gl2.h> Loading Loading @@ -592,6 +593,11 @@ void trace_VertexAttribPointerData(GLTraceContext *context, } } void trace_VertexAttribPointerDataForGlDrawArrays(GLTraceContext *context, GLMessage *glmsg) { void trace_VertexAttribPointerDataForGlDrawArrays(GLTraceContext *context, GLMessage *glmsg) { if (context->getVersion() == egl_connection_t::GLESv1_INDEX) { // only supported for GLES2 and above return; } /* void glDrawArrays(GLenum mode, GLint first, GLsizei count) */ /* void glDrawArrays(GLenum mode, GLint first, GLsizei count) */ GLsizei count = glmsg->args(2).intvalue(0); GLsizei count = glmsg->args(2).intvalue(0); Loading @@ -604,6 +610,11 @@ void trace_VertexAttribPointerDataForGlDrawArrays(GLTraceContext *context, GLMes void trace_VertexAttribPointerDataForGlDrawElements(GLTraceContext *context, GLMessage *glmsg, void trace_VertexAttribPointerDataForGlDrawElements(GLTraceContext *context, GLMessage *glmsg, GLvoid *indices) { GLvoid *indices) { if (context->getVersion() == egl_connection_t::GLESv1_INDEX) { // only supported for GLES2 and above return; } /* void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) */ /* void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) */ GLsizei count = glmsg->args(1).intvalue(0); GLsizei count = glmsg->args(1).intvalue(0); GLenum type = glmsg->args(2).intvalue(0); GLenum type = glmsg->args(2).intvalue(0); Loading