Loading opengl/libs/EGL/egl.cpp +10 −4 Original line number Diff line number Diff line Loading @@ -331,7 +331,13 @@ static void initEglTraceLevel() { if (gEGLDebugLevel > 0) { property_get("debug.egl.debug_port", value, "5039"); StartDebugServer(atoi(value)); 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); } } Loading opengl/libs/GLES2_dbg/generate_debugger_message_proto.py +1 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ message Message AfterCall = 1; AfterGeneratedCall = 2; Response = 3; // currently used for misc messages CompleteCall = 4; // BeforeCall and AfterCall merged } required Type type = 3; required bool expect_response = 4; Loading opengl/libs/GLES2_dbg/src/api.h +5 −8 Original line number Diff line number Diff line Loading @@ -16,16 +16,13 @@ #define EXTEND_Debug_glCopyTexImage2D \ DbgContext * const dbg = getDbgContextThreadSpecific(); \ GLint readFormat, readType; \ dbg->hooks->gl.glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &readFormat); \ dbg->hooks->gl.glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &readType); \ unsigned readSize = GetBytesPerPixel(readFormat, readType) * width * height; \ void * readData = dbg->GetReadPixelsBuffer(readSize); \ dbg->hooks->gl.glReadPixels(x, y, width, height, readFormat, readType, readData); \ void * readData = dbg->GetReadPixelsBuffer(4 * width * height); \ /* pick easy format for client to convert */ \ dbg->hooks->gl.glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, readData); \ dbg->CompressReadPixelBuffer(msg.mutable_data()); \ msg.set_data_type(msg.ReferencedImage); \ msg.set_pixel_format(readFormat); \ msg.set_pixel_type(readType); msg.set_pixel_format(GL_RGBA); \ msg.set_pixel_type(GL_UNSIGNED_BYTE); #define EXTEND_Debug_glCopyTexSubImage2D EXTEND_Debug_glCopyTexImage2D Loading opengl/libs/GLES2_dbg/src/dbgcontext.cpp +11 −7 Original line number Diff line number Diff line Loading @@ -195,10 +195,12 @@ unsigned int DbgContext::GetBufferSize() void DbgContext::glUseProgram(GLuint program) { while (GLenum error = hooks->gl.glGetError()) LOGD("DbgContext::glUseProgram: before glGetError() = 0x%.4X", error); LOGD("DbgContext::glUseProgram(%u): before glGetError() = 0x%.4X", program, error); this->program = program; maxAttrib = 0; if (program == 0) return; GLint activeAttributes = 0; hooks->gl.glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &activeAttributes); maxAttrib = 0; Loading Loading @@ -236,9 +238,9 @@ void DbgContext::glUseProgram(GLuint program) maxAttrib = slot; } delete name; while (GLenum error = hooks->gl.glGetError()) LOGD("DbgContext::glUseProgram: after glGetError() = 0x%.4X", error); LOGD("DbgContext::glUseProgram(%u): after glGetError() = 0x%.4X", program, error); } static bool HasNonVBOAttribs(const DbgContext * const ctx) Loading Loading @@ -288,14 +290,16 @@ void DbgContext::glVertexAttribPointer(GLuint indx, GLint size, GLenum type, void DbgContext::glEnableVertexAttribArray(GLuint index) { assert(index < MAX_VERTEX_ATTRIBS); if (index >= MAX_VERTEX_ATTRIBS) return; vertexAttribs[index].enabled = true; hasNonVBOAttribs = HasNonVBOAttribs(this); } void DbgContext::glDisableVertexAttribArray(GLuint index) { assert(index < MAX_VERTEX_ATTRIBS); if (index >= MAX_VERTEX_ATTRIBS) return; vertexAttribs[index].enabled = false; hasNonVBOAttribs = HasNonVBOAttribs(this); } Loading opengl/libs/GLES2_dbg/src/debugger_message.pb.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -437,6 +437,7 @@ bool Message_Type_IsValid(int value) { case 1: case 2: case 3: case 4: return true; default: return false; Loading @@ -448,6 +449,7 @@ const Message_Type Message::BeforeCall; const Message_Type Message::AfterCall; const Message_Type Message::AfterGeneratedCall; const Message_Type Message::Response; const Message_Type Message::CompleteCall; const Message_Type Message::Type_MIN; const Message_Type Message::Type_MAX; const int Message::Type_ARRAYSIZE; Loading Loading
opengl/libs/EGL/egl.cpp +10 −4 Original line number Diff line number Diff line Loading @@ -331,7 +331,13 @@ static void initEglTraceLevel() { if (gEGLDebugLevel > 0) { property_get("debug.egl.debug_port", value, "5039"); StartDebugServer(atoi(value)); 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); } } Loading
opengl/libs/GLES2_dbg/generate_debugger_message_proto.py +1 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ message Message AfterCall = 1; AfterGeneratedCall = 2; Response = 3; // currently used for misc messages CompleteCall = 4; // BeforeCall and AfterCall merged } required Type type = 3; required bool expect_response = 4; Loading
opengl/libs/GLES2_dbg/src/api.h +5 −8 Original line number Diff line number Diff line Loading @@ -16,16 +16,13 @@ #define EXTEND_Debug_glCopyTexImage2D \ DbgContext * const dbg = getDbgContextThreadSpecific(); \ GLint readFormat, readType; \ dbg->hooks->gl.glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &readFormat); \ dbg->hooks->gl.glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &readType); \ unsigned readSize = GetBytesPerPixel(readFormat, readType) * width * height; \ void * readData = dbg->GetReadPixelsBuffer(readSize); \ dbg->hooks->gl.glReadPixels(x, y, width, height, readFormat, readType, readData); \ void * readData = dbg->GetReadPixelsBuffer(4 * width * height); \ /* pick easy format for client to convert */ \ dbg->hooks->gl.glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, readData); \ dbg->CompressReadPixelBuffer(msg.mutable_data()); \ msg.set_data_type(msg.ReferencedImage); \ msg.set_pixel_format(readFormat); \ msg.set_pixel_type(readType); msg.set_pixel_format(GL_RGBA); \ msg.set_pixel_type(GL_UNSIGNED_BYTE); #define EXTEND_Debug_glCopyTexSubImage2D EXTEND_Debug_glCopyTexImage2D Loading
opengl/libs/GLES2_dbg/src/dbgcontext.cpp +11 −7 Original line number Diff line number Diff line Loading @@ -195,10 +195,12 @@ unsigned int DbgContext::GetBufferSize() void DbgContext::glUseProgram(GLuint program) { while (GLenum error = hooks->gl.glGetError()) LOGD("DbgContext::glUseProgram: before glGetError() = 0x%.4X", error); LOGD("DbgContext::glUseProgram(%u): before glGetError() = 0x%.4X", program, error); this->program = program; maxAttrib = 0; if (program == 0) return; GLint activeAttributes = 0; hooks->gl.glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &activeAttributes); maxAttrib = 0; Loading Loading @@ -236,9 +238,9 @@ void DbgContext::glUseProgram(GLuint program) maxAttrib = slot; } delete name; while (GLenum error = hooks->gl.glGetError()) LOGD("DbgContext::glUseProgram: after glGetError() = 0x%.4X", error); LOGD("DbgContext::glUseProgram(%u): after glGetError() = 0x%.4X", program, error); } static bool HasNonVBOAttribs(const DbgContext * const ctx) Loading Loading @@ -288,14 +290,16 @@ void DbgContext::glVertexAttribPointer(GLuint indx, GLint size, GLenum type, void DbgContext::glEnableVertexAttribArray(GLuint index) { assert(index < MAX_VERTEX_ATTRIBS); if (index >= MAX_VERTEX_ATTRIBS) return; vertexAttribs[index].enabled = true; hasNonVBOAttribs = HasNonVBOAttribs(this); } void DbgContext::glDisableVertexAttribArray(GLuint index) { assert(index < MAX_VERTEX_ATTRIBS); if (index >= MAX_VERTEX_ATTRIBS) return; vertexAttribs[index].enabled = false; hasNonVBOAttribs = HasNonVBOAttribs(this); } Loading
opengl/libs/GLES2_dbg/src/debugger_message.pb.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -437,6 +437,7 @@ bool Message_Type_IsValid(int value) { case 1: case 2: case 3: case 4: return true; default: return false; Loading @@ -448,6 +449,7 @@ const Message_Type Message::BeforeCall; const Message_Type Message::AfterCall; const Message_Type Message::AfterGeneratedCall; const Message_Type Message::Response; const Message_Type Message::CompleteCall; const Message_Type Message::Type_MIN; const Message_Type Message::Type_MAX; const int Message::Type_ARRAYSIZE; Loading