summaryrefslogtreecommitdiffstats
path: root/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2012-01-03 14:39:31 -0800
committerSiva Velusamy <vsiva@google.com>2012-01-04 12:50:13 -0800
commit3f194e6e3a62cbb846e8948eac8e4ce9aa7444a6 (patch)
tree197a1bd990333021bf7e1dcf4f030b521b902fce /opengl/libs/GLES_trace/src/gltrace_fixup.cpp
parent875bdea8be31e31408ab972e2a073b215c13ca63 (diff)
downloadframeworks_native-3f194e6e3a62cbb846e8948eac8e4ce9aa7444a6.zip
frameworks_native-3f194e6e3a62cbb846e8948eac8e4ce9aa7444a6.tar.gz
frameworks_native-3f194e6e3a62cbb846e8948eac8e4ce9aa7444a6.tar.bz2
gltrace: add user settings to control data captured.
Currently users do not have control over the amount of data captured during tracing. This patch adds 3 settings that users can enable/disable at runtime: - capture framebuffer on eglSwap() calls - capture framebuffer on glDraw*() calls - capture texture data passed to glTexImage*() calls Disabling these options when not needed signficantly decreases the size of the trace file, and reduces performance overhead for the running application. These settings are stored in the per process GLTraceState. A separate thread listens for commands from the host, and updates the state based on the user commands. Change-Id: Ic4518b94e8bcbc5330ac7138153721caa98b365d
Diffstat (limited to 'opengl/libs/GLES_trace/src/gltrace_fixup.cpp')
-rw-r--r--opengl/libs/GLES_trace/src/gltrace_fixup.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/opengl/libs/GLES_trace/src/gltrace_fixup.cpp b/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
index 7fbae1d..5a439e3 100644
--- a/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
+++ b/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
@@ -283,7 +283,9 @@ void fixupGLMessage(GLTraceContext *context, nsecs_t start, nsecs_t end, GLMessa
fixup_glGetString(glmsg);
break;
case GLMessage::glTexImage2D:
- fixup_glTexImage2D(glmsg);
+ if (context->getGlobalTraceState()->shouldCollectTextureDataOnGlTexImage()) {
+ fixup_glTexImage2D(glmsg);
+ }
break;
case GLMessage::glShaderSource:
fixup_glShaderSource(glmsg);
@@ -304,10 +306,16 @@ void fixupGLMessage(GLTraceContext *context, nsecs_t start, nsecs_t end, GLMessa
fixup_glUniformMatrixGeneric(4, glmsg);
break;
case GLMessage::glDrawArrays:
- case GLMessage::glDrawElements:
/* void glDrawArrays(GLenum mode, GLint first, GLsizei count) */
+ if (context->getGlobalTraceState()->shouldCollectFbOnGlDraw()) {
+ fixup_addFBContents(context, glmsg, CURRENTLY_BOUND_FB);
+ }
+ break;
+ case GLMessage::glDrawElements:
/* void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) */
- fixup_addFBContents(context, glmsg, CURRENTLY_BOUND_FB);
+ if (context->getGlobalTraceState()->shouldCollectFbOnGlDraw()) {
+ fixup_addFBContents(context, glmsg, CURRENTLY_BOUND_FB);
+ }
break;
default:
break;