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
diff --git a/opengl/libs/GLES_trace/src/gltrace_egl.cpp b/opengl/libs/GLES_trace/src/gltrace_egl.cpp
index 50743ff..9d1682a 100644
--- a/opengl/libs/GLES_trace/src/gltrace_egl.cpp
+++ b/opengl/libs/GLES_trace/src/gltrace_egl.cpp
@@ -78,8 +78,10 @@
     glmessage.set_context_id(glContext->getId());
     glmessage.set_function(GLMessage::eglSwapBuffers);
 
-    // read FB0 since that is what is displayed on the screen
-    fixup_addFBContents(glContext, &glmessage, FB0);
+    if (glContext->getGlobalTraceState()->shouldCollectFbOnEglSwap()) {
+        // read FB0 since that is what is displayed on the screen
+        fixup_addFBContents(glContext, &glmessage, FB0);
+    }
 
     // set start time and duration
     glmessage.set_start_time(systemTime());