am ef1c17ae: SurfaceFlinger: Make log message 64-bit compatible

* commit 'ef1c17ae9417abc1e21e49dbc629e448efc947dc':
  SurfaceFlinger: Make log message 64-bit compatible
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c
index 76bc9d5..42422e7 100644
--- a/cmds/installd/commands.c
+++ b/cmds/installd/commands.c
@@ -145,7 +145,6 @@
 {
     char pkgdir[PKG_PATH_MAX];
     struct stat s;
-    int rc = 0;
 
     if ((uid < AID_SYSTEM) || (gid < AID_SYSTEM)) {
         ALOGE("invalid uid/gid: %d %d\n", uid, gid);
@@ -625,30 +624,40 @@
     return 0;
 }
 
-static void run_dexopt(int zip_fd, int odex_fd, const char* input_file_name,
-    const char* output_file_name)
+static int split_count(const char *str)
 {
-    /* platform-specific flags affecting optimization and verification */
-    char dexopt_flags[PROPERTY_VALUE_MAX];
-    property_get("dalvik.vm.dexopt-flags", dexopt_flags, "");
-    ALOGV("dalvik.vm.dexopt-flags=%s\n", dexopt_flags);
+  char *ctx;
+  int count = 0;
+  char buf[PROPERTY_VALUE_MAX];
 
-    static const char* DEX_OPT_BIN = "/system/bin/dexopt";
-    static const int MAX_INT_LEN = 12;      // '-'+10dig+'\0' -OR- 0x+8dig
-    char zip_num[MAX_INT_LEN];
-    char odex_num[MAX_INT_LEN];
+  strncpy(buf, str, sizeof(buf));
+  char *pBuf = buf;
 
-    sprintf(zip_num, "%d", zip_fd);
-    sprintf(odex_num, "%d", odex_fd);
+  while(strtok_r(pBuf, " ", &ctx) != NULL) {
+    count++;
+    pBuf = NULL;
+  }
 
-    ALOGV("Running %s in=%s out=%s\n", DEX_OPT_BIN, input_file_name, output_file_name);
-    execl(DEX_OPT_BIN, DEX_OPT_BIN, "--zip", zip_num, odex_num, input_file_name,
-        dexopt_flags, (char*) NULL);
-    ALOGE("execl(%s) failed: %s\n", DEX_OPT_BIN, strerror(errno));
+  return count;
+}
+
+static int split(char *buf, const char **argv)
+{
+  char *ctx;
+  int count = 0;
+  char *tok;
+  char *pBuf = buf;
+
+  while((tok = strtok_r(pBuf, " ", &ctx)) != NULL) {
+    argv[count++] = tok;
+    pBuf = NULL;
+  }
+
+  return count;
 }
 
 static void run_patchoat(int input_fd, int oat_fd, const char* input_file_name,
-    const char* output_file_name, const char *pkgname, const char *instruction_set)
+    const char* output_file_name, const char *pkgname __unused, const char *instruction_set)
 {
     static const int MAX_INT_LEN = 12;      // '-'+10dig+'\0' -OR- 0x+8dig
     static const unsigned int MAX_INSTRUCTION_SET_LEN = 7;
@@ -670,7 +679,7 @@
     sprintf(instruction_set_arg, "--instruction-set=%s", instruction_set);
     sprintf(output_oat_fd_arg, "--output-oat-fd=%d", oat_fd);
     sprintf(input_oat_fd_arg, "--input-oat-fd=%d", input_fd);
-    ALOGE("Running %s isa=%s in-fd=%d (%s) out-fd=%d (%s)\n",
+    ALOGV("Running %s isa=%s in-fd=%d (%s) out-fd=%d (%s)\n",
           PATCHOAT_BIN, instruction_set, input_fd, input_file_name, oat_fd, output_file_name);
 
     /* patchoat, patched-image-location, no-lock, isa, input-fd, output-fd */
@@ -718,8 +727,18 @@
     bool have_dex2oat_isa_features = property_get(dex2oat_isa_features_key,
                                                   dex2oat_isa_features, NULL) > 0;
 
+    char dex2oat_isa_variant_key[PROPERTY_KEY_MAX];
+    sprintf(dex2oat_isa_variant_key, "dalvik.vm.isa.%s.variant", instruction_set);
+    char dex2oat_isa_variant[PROPERTY_VALUE_MAX];
+    bool have_dex2oat_isa_variant = property_get(dex2oat_isa_variant_key,
+                                                 dex2oat_isa_variant, NULL) > 0;
+
+    const char *dex2oat_norelocation = "-Xnorelocate";
+    bool have_dex2oat_relocation_skip_flag = false;
+
     char dex2oat_flags[PROPERTY_VALUE_MAX];
-    bool have_dex2oat_flags = property_get("dalvik.vm.dex2oat-flags", dex2oat_flags, NULL) > 0;
+    int dex2oat_flags_count = property_get("dalvik.vm.dex2oat-flags",
+                                 dex2oat_flags, NULL) <= 0 ? 0 : split_count(dex2oat_flags);
     ALOGV("dalvik.vm.dex2oat-flags=%s\n", dex2oat_flags);
 
     // If we booting without the real /data, don't spend time compiling.
@@ -740,6 +759,7 @@
     char oat_fd_arg[strlen("--oat-fd=") + MAX_INT_LEN];
     char oat_location_arg[strlen("--oat-location=") + PKG_PATH_MAX];
     char instruction_set_arg[strlen("--instruction-set=") + MAX_INSTRUCTION_SET_LEN];
+    char instruction_set_variant_arg[strlen("--instruction-set-variant=") + PROPERTY_VALUE_MAX];
     char instruction_set_features_arg[strlen("--instruction-set-features=") + PROPERTY_VALUE_MAX];
     char profile_file_arg[strlen("--profile-file=") + PKG_PATH_MAX];
     char top_k_profile_threshold_arg[strlen("--top-k-profile-threshold=") + PROPERTY_VALUE_MAX];
@@ -754,6 +774,7 @@
     sprintf(oat_fd_arg, "--oat-fd=%d", oat_fd);
     sprintf(oat_location_arg, "--oat-location=%s", output_file_name);
     sprintf(instruction_set_arg, "--instruction-set=%s", instruction_set);
+    sprintf(instruction_set_variant_arg, "--instruction-set-variant=%s", dex2oat_isa_variant);
     sprintf(instruction_set_features_arg, "--instruction-set-features=%s", dex2oat_isa_features);
     if (swap_fd >= 0) {
         have_dex2oat_swap_fd = true;
@@ -787,6 +808,7 @@
     if (skip_compilation) {
         strcpy(dex2oat_compiler_filter_arg, "--compiler-filter=verify-none");
         have_dex2oat_compiler_filter_flag = true;
+        have_dex2oat_relocation_skip_flag = true;
     } else if (vm_safe_mode) {
         strcpy(dex2oat_compiler_filter_arg, "--compiler-filter=interpret-only");
         have_dex2oat_compiler_filter_flag = true;
@@ -796,22 +818,27 @@
 
     ALOGV("Running %s in=%s out=%s\n", DEX2OAT_BIN, input_file_name, output_file_name);
 
-    char* argv[7  // program name, mandatory arguments and the final NULL
-               + (have_dex2oat_isa_features ? 1 : 0)
-               + (have_profile_file ? 1 : 0)
-               + (have_top_k_profile_threshold ? 1 : 0)
-               + (have_dex2oat_Xms_flag ? 2 : 0)
-               + (have_dex2oat_Xmx_flag ? 2 : 0)
-               + (have_dex2oat_compiler_filter_flag ? 1 : 0)
-               + (have_dex2oat_flags ? 1 : 0)
-               + (have_dex2oat_swap_fd ? 1 : 0)];
+    const char* argv[7  // program name, mandatory arguments and the final NULL
+                     + (have_dex2oat_isa_variant ? 1 : 0)
+                     + (have_dex2oat_isa_features ? 1 : 0)
+                     + (have_profile_file ? 1 : 0)
+                     + (have_top_k_profile_threshold ? 1 : 0)
+                     + (have_dex2oat_Xms_flag ? 2 : 0)
+                     + (have_dex2oat_Xmx_flag ? 2 : 0)
+                     + (have_dex2oat_compiler_filter_flag ? 1 : 0)
+                     + (have_dex2oat_swap_fd ? 1 : 0)
+                     + (have_dex2oat_relocation_skip_flag ? 2 : 0)
+                     + dex2oat_flags_count];
     int i = 0;
-    argv[i++] = (char*)DEX2OAT_BIN;
+    argv[i++] = DEX2OAT_BIN;
     argv[i++] = zip_fd_arg;
     argv[i++] = zip_location_arg;
     argv[i++] = oat_fd_arg;
     argv[i++] = oat_location_arg;
     argv[i++] = instruction_set_arg;
+    if (have_dex2oat_isa_variant) {
+        argv[i++] = instruction_set_variant_arg;
+    }
     if (have_dex2oat_isa_features) {
         argv[i++] = instruction_set_features_arg;
     }
@@ -822,27 +849,31 @@
         argv[i++] = top_k_profile_threshold_arg;
     }
     if (have_dex2oat_Xms_flag) {
-        argv[i++] = (char*)RUNTIME_ARG;
+        argv[i++] = RUNTIME_ARG;
         argv[i++] = dex2oat_Xms_arg;
     }
     if (have_dex2oat_Xmx_flag) {
-        argv[i++] = (char*)RUNTIME_ARG;
+        argv[i++] = RUNTIME_ARG;
         argv[i++] = dex2oat_Xmx_arg;
     }
     if (have_dex2oat_compiler_filter_flag) {
         argv[i++] = dex2oat_compiler_filter_arg;
     }
-    if (have_dex2oat_flags) {
-        argv[i++] = dex2oat_flags;
-    }
     if (have_dex2oat_swap_fd) {
         argv[i++] = dex2oat_swap_fd;
     }
+    if (dex2oat_flags_count) {
+        i += split(dex2oat_flags, argv + i);
+    }
+    if (have_dex2oat_relocation_skip_flag) {
+        argv[i++] = RUNTIME_ARG;
+        argv[i++] = dex2oat_norelocation;
+    }
     // Do not add after dex2oat_flags, they should override others for debugging.
     argv[i] = NULL;
 
-    execv(DEX2OAT_BIN, (char* const *)argv);
-    ALOGE("execl(%s) failed: %s\n", DEX2OAT_BIN, strerror(errno));
+    execv(DEX2OAT_BIN, (char * const *)argv);
+    ALOGE("execv(%s) failed: %s\n", DEX2OAT_BIN, strerror(errno));
 }
 
 static int wait_child(pid_t pid)
@@ -895,7 +926,6 @@
     struct utimbuf ut;
     struct stat input_stat, dex_stat;
     char out_path[PKG_PATH_MAX];
-    char persist_sys_dalvik_vm_lib[PROPERTY_VALUE_MAX];
     char swap_file_name[PKG_PATH_MAX];
     char *end;
     const char *input_file;
@@ -909,15 +939,6 @@
         return -1;
     }
 
-    /* The command to run depend on the value of persist.sys.dalvik.vm.lib */
-    property_get("persist.sys.dalvik.vm.lib.2", persist_sys_dalvik_vm_lib, "libart.so");
-
-    if (is_patchoat && strncmp(persist_sys_dalvik_vm_lib, "libart", 6) != 0) {
-        /* We may only patch if we are libart */
-        ALOGE("Patching is only supported in libart\n");
-        return -1;
-    }
-
     /* Before anything else: is there a .odex file?  If so, we have
      * precompiled the apk and there is nothing to do here.
      *
@@ -1048,17 +1069,11 @@
             exit(67);
         }
 
-        if (strncmp(persist_sys_dalvik_vm_lib, "libdvm", 6) == 0) {
-            run_dexopt(input_fd, out_fd, input_file, out_path);
-        } else if (strncmp(persist_sys_dalvik_vm_lib, "libart", 6) == 0) {
-            if (is_patchoat) {
-                run_patchoat(input_fd, out_fd, input_file, out_path, pkgname, instruction_set);
-            } else {
-                run_dex2oat(input_fd, out_fd, input_file, out_path, swap_fd, pkgname,
-                            instruction_set, vm_safe_mode);
-            }
+        if (is_patchoat) {
+            run_patchoat(input_fd, out_fd, input_file, out_path, pkgname, instruction_set);
         } else {
-            exit(69);   /* Unexpected persist.sys.dalvik.vm.lib value */
+            run_dex2oat(input_fd, out_fd, input_file, out_path, swap_fd, pkgname, instruction_set,
+                        vm_safe_mode);
         }
         exit(68);   /* only get here on exec failure */
     } else {
@@ -1618,7 +1633,7 @@
             continue;
         }
 
-        if (selinux_android_restorecon_pkgdir(pkgdir, seinfo, uid, flags) < 0) {
+        if (selinux_android_restorecon_pkgdir(pkgdir, seinfo, s.st_uid, flags) < 0) {
             ALOGE("restorecon failed for %s: %s\n", pkgdir, strerror(errno));
             ret |= -1;
         }
diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c
index 5b8a1e3..4dd83ae 100644
--- a/cmds/installd/installd.c
+++ b/cmds/installd/installd.c
@@ -26,63 +26,63 @@
 #define TOKEN_MAX     8     /* max number of arguments in buffer */
 #define REPLY_MAX     256   /* largest reply allowed */
 
-static int do_ping(char **arg, char reply[REPLY_MAX])
+static int do_ping(char **arg __unused, char reply[REPLY_MAX] __unused)
 {
     return 0;
 }
 
-static int do_install(char **arg, char reply[REPLY_MAX])
+static int do_install(char **arg, char reply[REPLY_MAX] __unused)
 {
     return install(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3]); /* pkgname, uid, gid, seinfo */
 }
 
-static int do_dexopt(char **arg, char reply[REPLY_MAX])
+static int do_dexopt(char **arg, char reply[REPLY_MAX] __unused)
 {
     /* apk_path, uid, is_public, pkgname, instruction_set, vm_safe_mode, should_relocate */
     return dexopt(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3], arg[4], atoi(arg[5]), 0);
 }
 
-static int do_mark_boot_complete(char **arg, char reply[REPLY_MAX])
+static int do_mark_boot_complete(char **arg, char reply[REPLY_MAX] __unused)
 {
     return mark_boot_complete(arg[0] /* instruction set */);
 }
 
-static int do_move_dex(char **arg, char reply[REPLY_MAX])
+static int do_move_dex(char **arg, char reply[REPLY_MAX] __unused)
 {
     return move_dex(arg[0], arg[1], arg[2]); /* src, dst, instruction_set */
 }
 
-static int do_rm_dex(char **arg, char reply[REPLY_MAX])
+static int do_rm_dex(char **arg, char reply[REPLY_MAX] __unused)
 {
     return rm_dex(arg[0], arg[1]); /* pkgname, instruction_set */
 }
 
-static int do_remove(char **arg, char reply[REPLY_MAX])
+static int do_remove(char **arg, char reply[REPLY_MAX] __unused)
 {
     return uninstall(arg[0], atoi(arg[1])); /* pkgname, userid */
 }
 
-static int do_rename(char **arg, char reply[REPLY_MAX])
+static int do_rename(char **arg, char reply[REPLY_MAX] __unused)
 {
     return renamepkg(arg[0], arg[1]); /* oldpkgname, newpkgname */
 }
 
-static int do_fixuid(char **arg, char reply[REPLY_MAX])
+static int do_fixuid(char **arg, char reply[REPLY_MAX] __unused)
 {
     return fix_uid(arg[0], atoi(arg[1]), atoi(arg[2])); /* pkgname, uid, gid */
 }
 
-static int do_free_cache(char **arg, char reply[REPLY_MAX]) /* TODO int:free_size */
+static int do_free_cache(char **arg, char reply[REPLY_MAX] __unused) /* TODO int:free_size */
 {
     return free_cache((int64_t)atoll(arg[0])); /* free_size */
 }
 
-static int do_rm_cache(char **arg, char reply[REPLY_MAX])
+static int do_rm_cache(char **arg, char reply[REPLY_MAX] __unused)
 {
     return delete_cache(arg[0], atoi(arg[1])); /* pkgname, userid */
 }
 
-static int do_rm_code_cache(char **arg, char reply[REPLY_MAX])
+static int do_rm_code_cache(char **arg, char reply[REPLY_MAX] __unused)
 {
     return delete_code_cache(arg[0], atoi(arg[1])); /* pkgname, userid */
 }
@@ -108,38 +108,38 @@
     return res;
 }
 
-static int do_rm_user_data(char **arg, char reply[REPLY_MAX])
+static int do_rm_user_data(char **arg, char reply[REPLY_MAX] __unused)
 {
     return delete_user_data(arg[0], atoi(arg[1])); /* pkgname, userid */
 }
 
-static int do_mk_user_data(char **arg, char reply[REPLY_MAX])
+static int do_mk_user_data(char **arg, char reply[REPLY_MAX] __unused)
 {
     return make_user_data(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3]);
                              /* pkgname, uid, userid, seinfo */
 }
 
-static int do_mk_user_config(char **arg, char reply[REPLY_MAX])
+static int do_mk_user_config(char **arg, char reply[REPLY_MAX] __unused)
 {
     return make_user_config(atoi(arg[0])); /* userid */
 }
 
-static int do_rm_user(char **arg, char reply[REPLY_MAX])
+static int do_rm_user(char **arg, char reply[REPLY_MAX] __unused)
 {
     return delete_user(atoi(arg[0])); /* userid */
 }
 
-static int do_movefiles(char **arg, char reply[REPLY_MAX])
+static int do_movefiles(char **arg __unused, char reply[REPLY_MAX] __unused)
 {
     return movefiles();
 }
 
-static int do_linklib(char **arg, char reply[REPLY_MAX])
+static int do_linklib(char **arg, char reply[REPLY_MAX] __unused)
 {
     return linklib(arg[0], arg[1], atoi(arg[2]));
 }
 
-static int do_idmap(char **arg, char reply[REPLY_MAX])
+static int do_idmap(char **arg, char reply[REPLY_MAX] __unused)
 {
     return idmap(arg[0], arg[1], atoi(arg[2]));
 }
@@ -150,7 +150,7 @@
                              /* pkgName, seinfo, uid*/
 }
 
-static int do_patchoat(char **arg, char reply[REPLY_MAX]) {
+static int do_patchoat(char **arg, char reply[REPLY_MAX] __unused) {
     /* apk_path, uid, is_public, pkgname, instruction_set, vm_safe_mode, should_relocate */
     return dexopt(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3], arg[4], 0, 1);
 }
@@ -255,7 +255,9 @@
                 goto done;
             }
         }
-        cmd++;
+        if (*cmd) {
+          cmd++;
+        }
     }
 
     for (i = 0; i < sizeof(cmds) / sizeof(cmds[0]); i++) {
@@ -657,11 +659,11 @@
     return 0;
 }
 
-int main(const int argc, const char *argv[]) {
+int main(const int argc __unused, const char *argv[] __unused) {
     char buf[BUFFER_MAX];
     struct sockaddr addr;
     socklen_t alen;
-    int lsocket, s, count;
+    int lsocket, s;
     int selinux_enabled = (is_selinux_enabled() > 0);
 
     ALOGI("installd firing up\n");
diff --git a/cmds/installd/installd.h b/cmds/installd/installd.h
index a3a5c16..a9a1999 100644
--- a/cmds/installd/installd.h
+++ b/cmds/installd/installd.h
@@ -40,7 +40,7 @@
 
 #include <private/android_filesystem_config.h>
 
-#if INCLUDE_SYS_MOUNT_FOR_STATFS
+#if defined(__APPLE__)
 #include <sys/mount.h>
 #else
 #include <sys/statfs.h>
diff --git a/cmds/installd/tests/Android.mk b/cmds/installd/tests/Android.mk
index 4faf3c0..7300b29 100644
--- a/cmds/installd/tests/Android.mk
+++ b/cmds/installd/tests/Android.mk
@@ -1,6 +1,7 @@
 # Build the unit tests for installd
 LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 
 # Build the unit tests.
 test_src_files := \
@@ -9,13 +10,10 @@
 shared_libraries := \
     libutils \
     libcutils \
-    libstlport
 
 static_libraries := \
     libinstalld \
     libdiskusage \
-    libgtest \
-    libgtest_main
 
 c_includes := \
     frameworks/native/cmds/installd
diff --git a/cmds/installd/utils.c b/cmds/installd/utils.c
index e381aef..8f366a0 100644
--- a/cmds/installd/utils.c
+++ b/cmds/installd/utils.c
@@ -163,7 +163,7 @@
 int create_move_path(char path[PKG_PATH_MAX],
     const char* pkgname,
     const char* leaf,
-    userid_t userid)
+    userid_t userid __unused)
 {
     if ((android_data_dir.len + strlen(PRIMARY_USER_PREFIX) + strlen(pkgname) + strlen(leaf) + 1)
             >= PKG_PATH_MAX) {
@@ -239,7 +239,7 @@
         }
 
         if (de->d_type == DT_DIR) {
-            int r, subfd;
+            int subfd;
             DIR *subdir;
 
                 /* always skip "." and ".." */
@@ -881,7 +881,7 @@
 
 void finish_cache_collection(cache_t* cache)
 {
-    size_t i;
+    CACHE_NOISY(size_t i;)
 
     CACHE_NOISY(ALOGI("clear_cache_files: %d dirs, %d files\n", cache->numDirs, cache->numFiles));
     CACHE_NOISY(
@@ -1101,7 +1101,6 @@
 /* Ensure that /data/media directories are prepared for given user. */
 int ensure_media_user_dirs(userid_t userid) {
     char media_user_path[PATH_MAX];
-    char path[PATH_MAX];
 
     // Ensure /data/media/<userid> exists
     create_user_media_path(media_user_path, userid);
@@ -1114,7 +1113,6 @@
 
 int ensure_config_user_dirs(userid_t userid) {
     char config_user_path[PATH_MAX];
-    char path[PATH_MAX];
 
     // writable by system, readable by any app within the same user
     const int uid = multiuser_get_uid(userid, AID_SYSTEM);
diff --git a/include/binder/IInterface.h b/include/binder/IInterface.h
index 5f9f69c..4ce3613 100644
--- a/include/binder/IInterface.h
+++ b/include/binder/IInterface.h
@@ -28,9 +28,9 @@
 {
 public:
             IInterface();
-            sp<IBinder>         asBinder();
-            sp<const IBinder>   asBinder() const;
-            
+            static sp<IBinder>  asBinder(const IInterface*);
+            static sp<IBinder>  asBinder(const sp<IInterface>&);
+
 protected:
     virtual                     ~IInterface();
     virtual IBinder*            onAsBinder() = 0;
diff --git a/include/binder/IPCThreadState.h b/include/binder/IPCThreadState.h
index 6e0c01b..60c2242 100644
--- a/include/binder/IPCThreadState.h
+++ b/include/binder/IPCThreadState.h
@@ -22,7 +22,7 @@
 #include <binder/ProcessState.h>
 #include <utils/Vector.h>
 
-#ifdef HAVE_WIN32_PROC
+#if defined(_WIN32)
 typedef  int  uid_t;
 #endif
 
@@ -39,8 +39,8 @@
             
             status_t            clearLastError();
 
-            int                 getCallingPid() const;
-            int                 getCallingUid() const;
+            pid_t               getCallingPid() const;
+            uid_t               getCallingUid() const;
 
             void                setStrictModePolicy(int32_t policy);
             int32_t             getStrictModePolicy() const;
diff --git a/include/binder/Parcel.h b/include/binder/Parcel.h
index 6a69761..a52e044 100644
--- a/include/binder/Parcel.h
+++ b/include/binder/Parcel.h
@@ -94,6 +94,7 @@
     void*               writeInplace(size_t len);
     status_t            writeUnpadded(const void* data, size_t len);
     status_t            writeInt32(int32_t val);
+    status_t            writeUint32(uint32_t val);
     status_t            writeInt64(int64_t val);
     status_t            writeFloat(float val);
     status_t            writeDouble(double val);
@@ -152,6 +153,8 @@
     const void*         readInplace(size_t len) const;
     int32_t             readInt32() const;
     status_t            readInt32(int32_t *pArg) const;
+    uint32_t            readUint32() const;
+    status_t            readUint32(uint32_t *pArg) const;
     int64_t             readInt64() const;
     status_t            readInt64(int64_t *pArg) const;
     float               readFloat() const;
diff --git a/include/gui/BufferQueueCore.h b/include/gui/BufferQueueCore.h
index 1050e3b..1d975c0 100644
--- a/include/gui/BufferQueueCore.h
+++ b/include/gui/BufferQueueCore.h
@@ -29,11 +29,11 @@
 #include <utils/Trace.h>
 #include <utils/Vector.h>
 
-#define BQ_LOGV(x, ...) ALOGV("[%s] "x, mConsumerName.string(), ##__VA_ARGS__)
-#define BQ_LOGD(x, ...) ALOGD("[%s] "x, mConsumerName.string(), ##__VA_ARGS__)
-#define BQ_LOGI(x, ...) ALOGI("[%s] "x, mConsumerName.string(), ##__VA_ARGS__)
-#define BQ_LOGW(x, ...) ALOGW("[%s] "x, mConsumerName.string(), ##__VA_ARGS__)
-#define BQ_LOGE(x, ...) ALOGE("[%s] "x, mConsumerName.string(), ##__VA_ARGS__)
+#define BQ_LOGV(x, ...) ALOGV("[%s] " x, mConsumerName.string(), ##__VA_ARGS__)
+#define BQ_LOGD(x, ...) ALOGD("[%s] " x, mConsumerName.string(), ##__VA_ARGS__)
+#define BQ_LOGI(x, ...) ALOGI("[%s] " x, mConsumerName.string(), ##__VA_ARGS__)
+#define BQ_LOGW(x, ...) ALOGW("[%s] " x, mConsumerName.string(), ##__VA_ARGS__)
+#define BQ_LOGE(x, ...) ALOGE("[%s] " x, mConsumerName.string(), ##__VA_ARGS__)
 
 #define ATRACE_BUFFER_INDEX(index)                                   \
     if (ATRACE_ENABLED()) {                                          \
diff --git a/include/gui/ISurfaceComposer.h b/include/gui/ISurfaceComposer.h
index 51717a4..f04a848 100644
--- a/include/gui/ISurfaceComposer.h
+++ b/include/gui/ISurfaceComposer.h
@@ -39,7 +39,7 @@
 class ComposerState;
 class DisplayState;
 struct DisplayInfo;
-class DisplayStatInfo;
+struct DisplayStatInfo;
 class IDisplayEventConnection;
 class IMemoryHeap;
 class Rect;
diff --git a/include/gui/Sensor.h b/include/gui/Sensor.h
index 28a08e2..59b4d4d 100644
--- a/include/gui/Sensor.h
+++ b/include/gui/Sensor.h
@@ -98,7 +98,7 @@
     String8 mStringType;
     String8 mRequiredPermission;
     int32_t mMaxDelay;
-    int32_t mFlags;
+    uint32_t mFlags;
     static void flattenString8(void*& buffer, size_t& size, const String8& string8);
     static bool unflattenString8(void const*& buffer, size_t& size, String8& outputString8);
 };
diff --git a/include/ui/Fence.h b/include/ui/Fence.h
index 20466b6..b431bd5 100644
--- a/include/ui/Fence.h
+++ b/include/ui/Fence.h
@@ -65,7 +65,7 @@
     // before the fence signals then -ETIME is returned.  A timeout of
     // TIMEOUT_NEVER may be used to indicate that the call should wait
     // indefinitely for the fence to signal.
-    status_t wait(unsigned int timeout);
+    status_t wait(int timeout);
 
     // waitForever is a convenience function for waiting forever for a fence to
     // signal (just like wait(TIMEOUT_NEVER)), but issuing an error to the
diff --git a/include/ui/FramebufferNativeWindow.h b/include/ui/FramebufferNativeWindow.h
index 5cd8101..6b66d5f 100644
--- a/include/ui/FramebufferNativeWindow.h
+++ b/include/ui/FramebufferNativeWindow.h
@@ -14,11 +14,13 @@
  * limitations under the License.
  */
 
+#ifndef INCLUDED_FROM_FRAMEBUFFER_NATIVE_WINDOW_CPP
+#warning "FramebufferNativeWindow is deprecated"
+#endif
+
 #ifndef ANDROID_FRAMEBUFFER_NATIVE_WINDOW_H
 #define ANDROID_FRAMEBUFFER_NATIVE_WINDOW_H
 
-#warning "FramebufferNativeWindow is deprecated"
-
 #include <stdint.h>
 #include <sys/types.h>
 
diff --git a/include/ui/GraphicBuffer.h b/include/ui/GraphicBuffer.h
index 7630faa..cea94fc 100644
--- a/include/ui/GraphicBuffer.h
+++ b/include/ui/GraphicBuffer.h
@@ -49,7 +49,7 @@
         USAGE_SW_READ_RARELY    = GRALLOC_USAGE_SW_READ_RARELY,
         USAGE_SW_READ_OFTEN     = GRALLOC_USAGE_SW_READ_OFTEN,
         USAGE_SW_READ_MASK      = GRALLOC_USAGE_SW_READ_MASK,
-        
+
         USAGE_SW_WRITE_NEVER    = GRALLOC_USAGE_SW_WRITE_NEVER,
         USAGE_SW_WRITE_RARELY   = GRALLOC_USAGE_SW_WRITE_RARELY,
         USAGE_SW_WRITE_OFTEN    = GRALLOC_USAGE_SW_WRITE_OFTEN,
@@ -72,11 +72,13 @@
     GraphicBuffer();
 
     // creates w * h buffer
-    GraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage);
+    GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat,
+            uint32_t inUsage);
 
     // create a buffer from an existing handle
-    GraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage,
-            uint32_t stride, native_handle_t* handle, bool keepOwnership);
+    GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat,
+            uint32_t inUsage, uint32_t inStride, native_handle_t* inHandle,
+            bool keepOwnership);
 
     // create a buffer from an existing ANativeWindowBuffer
     GraphicBuffer(ANativeWindowBuffer* buffer, bool keepOwnership);
@@ -84,26 +86,31 @@
     // return status
     status_t initCheck() const;
 
-    uint32_t getWidth() const           { return width; }
-    uint32_t getHeight() const          { return height; }
-    uint32_t getStride() const          { return stride; }
-    uint32_t getUsage() const           { return usage; }
+    uint32_t getWidth() const           { return static_cast<uint32_t>(width); }
+    uint32_t getHeight() const          { return static_cast<uint32_t>(height); }
+    uint32_t getStride() const          { return static_cast<uint32_t>(stride); }
+    uint32_t getUsage() const           { return static_cast<uint32_t>(usage); }
     PixelFormat getPixelFormat() const  { return format; }
     Rect getBounds() const              { return Rect(width, height); }
     uint64_t getId() const              { return mId; }
 
-    status_t reallocate(uint32_t w, uint32_t h, PixelFormat f, uint32_t usage);
+    status_t reallocate(uint32_t inWidth, uint32_t inHeight,
+            PixelFormat inFormat, uint32_t inUsage);
 
-    status_t lock(uint32_t usage, void** vaddr);
-    status_t lock(uint32_t usage, const Rect& rect, void** vaddr);
+    status_t lock(uint32_t inUsage, void** vaddr);
+    status_t lock(uint32_t inUsage, const Rect& rect, void** vaddr);
     // For HAL_PIXEL_FORMAT_YCbCr_420_888
-    status_t lockYCbCr(uint32_t usage, android_ycbcr *ycbcr);
-    status_t lockYCbCr(uint32_t usage, const Rect& rect, android_ycbcr *ycbcr);
+    status_t lockYCbCr(uint32_t inUsage, android_ycbcr *ycbcr);
+    status_t lockYCbCr(uint32_t inUsage, const Rect& rect,
+            android_ycbcr *ycbcr);
     status_t unlock();
-    status_t lockAsync(uint32_t usage, void** vaddr, int fenceFd);
-    status_t lockAsync(uint32_t usage, const Rect& rect, void** vaddr, int fenceFd);
-    status_t lockAsyncYCbCr(uint32_t usage, android_ycbcr *ycbcr, int fenceFd);
-    status_t lockAsyncYCbCr(uint32_t usage, const Rect& rect, android_ycbcr *ycbcr, int fenceFd);
+    status_t lockAsync(uint32_t inUsage, void** vaddr, int fenceFd);
+    status_t lockAsync(uint32_t inUsage, const Rect& rect, void** vaddr,
+            int fenceFd);
+    status_t lockAsyncYCbCr(uint32_t inUsage, android_ycbcr *ycbcr,
+            int fenceFd);
+    status_t lockAsyncYCbCr(uint32_t inUsage, const Rect& rect,
+            android_ycbcr *ycbcr, int fenceFd);
     status_t unlockAsync(int *fenceFd);
 
     ANativeWindowBuffer* getNativeBuffer() const;
@@ -143,8 +150,8 @@
     GraphicBuffer& operator = (const GraphicBuffer& rhs);
     const GraphicBuffer& operator = (const GraphicBuffer& rhs) const;
 
-    status_t initSize(uint32_t w, uint32_t h, PixelFormat format, 
-            uint32_t usage);
+    status_t initSize(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat,
+            uint32_t inUsage);
 
     void free_handle();
 
diff --git a/include/ui/GraphicBufferAllocator.h b/include/ui/GraphicBufferAllocator.h
index dffa788..5443f09 100644
--- a/include/ui/GraphicBufferAllocator.h
+++ b/include/ui/GraphicBufferAllocator.h
@@ -1,17 +1,17 @@
-/* 
+/*
 **
 ** Copyright 2009, The Android Open Source Project
 **
-** Licensed under the Apache License, Version 2.0 (the "License"); 
-** you may not use this file except in compliance with the License. 
-** You may obtain a copy of the License at 
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
 **
-**     http://www.apache.org/licenses/LICENSE-2.0 
+**     http://www.apache.org/licenses/LICENSE-2.0
 **
-** Unless required by applicable law or agreed to in writing, software 
-** distributed under the License is distributed on an "AS IS" BASIS, 
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-** See the License for the specific language governing permissions and 
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
 ** limitations under the License.
 */
 
@@ -45,14 +45,14 @@
         USAGE_SW_READ_RARELY    = GRALLOC_USAGE_SW_READ_RARELY,
         USAGE_SW_READ_OFTEN     = GRALLOC_USAGE_SW_READ_OFTEN,
         USAGE_SW_READ_MASK      = GRALLOC_USAGE_SW_READ_MASK,
-        
+
         USAGE_SW_WRITE_NEVER    = GRALLOC_USAGE_SW_WRITE_NEVER,
         USAGE_SW_WRITE_RARELY   = GRALLOC_USAGE_SW_WRITE_RARELY,
         USAGE_SW_WRITE_OFTEN    = GRALLOC_USAGE_SW_WRITE_OFTEN,
         USAGE_SW_WRITE_MASK     = GRALLOC_USAGE_SW_WRITE_MASK,
-        
+
         USAGE_SOFTWARE_MASK     = USAGE_SW_READ_MASK|USAGE_SW_WRITE_MASK,
-        
+
         USAGE_HW_TEXTURE        = GRALLOC_USAGE_HW_TEXTURE,
         USAGE_HW_RENDER         = GRALLOC_USAGE_HW_RENDER,
         USAGE_HW_2D             = GRALLOC_USAGE_HW_2D,
@@ -60,10 +60,9 @@
     };
 
     static inline GraphicBufferAllocator& get() { return getInstance(); }
-    
 
-    status_t alloc(uint32_t w, uint32_t h, PixelFormat format, int usage,
-            buffer_handle_t* handle, int32_t* stride);
+    status_t alloc(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage,
+            buffer_handle_t* handle, uint32_t* stride);
 
     status_t free(buffer_handle_t handle);
 
@@ -72,21 +71,21 @@
 
 private:
     struct alloc_rec_t {
-        uint32_t w;
-        uint32_t h;
-        uint32_t s;
+        uint32_t width;
+        uint32_t height;
+        uint32_t stride;
         PixelFormat format;
         uint32_t usage;
         size_t size;
     };
-    
+
     static Mutex sLock;
     static KeyedVector<buffer_handle_t, alloc_rec_t> sAllocList;
-    
+
     friend class Singleton<GraphicBufferAllocator>;
     GraphicBufferAllocator();
     ~GraphicBufferAllocator();
-    
+
     alloc_device_t  *mAllocDev;
 };
 
diff --git a/include/ui/GraphicBufferMapper.h b/include/ui/GraphicBufferMapper.h
index 98fff0e..6099548 100644
--- a/include/ui/GraphicBufferMapper.h
+++ b/include/ui/GraphicBufferMapper.h
@@ -41,23 +41,24 @@
     status_t registerBuffer(buffer_handle_t handle);
 
     status_t unregisterBuffer(buffer_handle_t handle);
-    
+
     status_t lock(buffer_handle_t handle,
-            int usage, const Rect& bounds, void** vaddr);
+            uint32_t usage, const Rect& bounds, void** vaddr);
 
     status_t lockYCbCr(buffer_handle_t handle,
-            int usage, const Rect& bounds, android_ycbcr *ycbcr);
+            uint32_t usage, const Rect& bounds, android_ycbcr *ycbcr);
 
     status_t unlock(buffer_handle_t handle);
 
     status_t lockAsync(buffer_handle_t handle,
-            int usage, const Rect& bounds, void** vaddr, int fenceFd);
+            uint32_t usage, const Rect& bounds, void** vaddr, int fenceFd);
 
     status_t lockAsyncYCbCr(buffer_handle_t handle,
-            int usage, const Rect& bounds, android_ycbcr *ycbcr, int fenceFd);
+            uint32_t usage, const Rect& bounds, android_ycbcr *ycbcr,
+            int fenceFd);
 
     status_t unlockAsync(buffer_handle_t handle, int *fenceFd);
-    
+
     // dumps information about the mapping of this handle
     void dump(buffer_handle_t handle);
 
diff --git a/include/ui/PixelFormat.h b/include/ui/PixelFormat.h
index 7e46945..e7e8ffc 100644
--- a/include/ui/PixelFormat.h
+++ b/include/ui/PixelFormat.h
@@ -25,9 +25,6 @@
 #ifndef UI_PIXELFORMAT_H
 #define UI_PIXELFORMAT_H
 
-#include <stdint.h>
-#include <sys/types.h>
-#include <utils/Errors.h>
 #include <hardware/hardware.h>
 
 namespace android {
@@ -69,8 +66,8 @@
 
 typedef int32_t PixelFormat;
 
-ssize_t bytesPerPixel(PixelFormat format);
-ssize_t bitsPerPixel(PixelFormat format);
+uint32_t bytesPerPixel(PixelFormat format);
+uint32_t bitsPerPixel(PixelFormat format);
 
 }; // namespace android
 
diff --git a/include/ui/Region.h b/include/ui/Region.h
index 0d1c68c..873cd34 100644
--- a/include/ui/Region.h
+++ b/include/ui/Region.h
@@ -55,11 +55,11 @@
 
             // the region becomes its bounds
             Region&     makeBoundsSelf();
-    
+
             void        clear();
             void        set(const Rect& r);
-            void        set(uint32_t w, uint32_t h);
-        
+            void        set(int32_t w, int32_t h);
+
             Region&     orSelf(const Rect& rhs);
             Region&     xorSelf(const Rect& rhs);
             Region&     andSelf(const Rect& rhs);
@@ -110,14 +110,14 @@
     inline  Region&     operator -= (const Region& rhs);
     inline  Region&     operator += (const Point& pt);
 
-    
+
     // returns true if the regions share the same underlying storage
     bool isTriviallyEqual(const Region& region) const;
 
 
     /* various ways to access the rectangle list */
 
-    
+
     // STL-like iterators
     typedef Rect const* const_iterator;
     const_iterator begin() const;
@@ -133,7 +133,7 @@
     SharedBuffer const* getSharedBuffer(size_t* count) const;
 
     /* no user serviceable parts here... */
-            
+
             // add a rectangle to the internal list. This rectangle must
             // be sorted in Y and X and must not make the region invalid.
             void        addRectUnchecked(int l, int t, int r, int b);
@@ -149,7 +149,7 @@
 private:
     class rasterizer;
     friend class rasterizer;
-    
+
     Region& operationSelf(const Rect& r, int op);
     Region& operationSelf(const Region& r, int op);
     Region& operationSelf(const Region& r, int dx, int dy, int op);
@@ -172,7 +172,7 @@
 
     static bool validate(const Region& reg,
             const char* name, bool silent = false);
-    
+
     // mStorage is a (manually) sorted array of Rects describing the region
     // with an extra Rect as the last element which is set to the
     // bounds of the region. However, if the region is
diff --git a/libs/binder/AppOpsManager.cpp b/libs/binder/AppOpsManager.cpp
index 61b4f7d..c562c30 100644
--- a/libs/binder/AppOpsManager.cpp
+++ b/libs/binder/AppOpsManager.cpp
@@ -44,7 +44,7 @@
     int64_t startTime = 0;
     mLock.lock();
     sp<IAppOpsService> service = mService;
-    while (service == NULL || !service->asBinder()->isBinderAlive()) {
+    while (service == NULL || !IInterface::asBinder(service)->isBinderAlive()) {
         sp<IBinder> binder = defaultServiceManager()->checkService(_appops);
         if (binder == NULL) {
             // Wait for the app ops service to come back...
diff --git a/libs/binder/Binder.cpp b/libs/binder/Binder.cpp
index 2554351..9d200fb 100644
--- a/libs/binder/Binder.cpp
+++ b/libs/binder/Binder.cpp
@@ -72,7 +72,7 @@
 
 BBinder::BBinder()
 {
-    atomic_init(&mExtras, 0);
+  atomic_init(&mExtras, static_cast<uintptr_t>(0));
 }
 
 bool BBinder::isBinderAlive() const
@@ -160,10 +160,18 @@
     e->mObjects.attach(objectID, object, cleanupCookie, func);
 }
 
+// The C11 standard doesn't allow atomic loads from const fields,
+// though C++11 does.  Fudge it until standards get straightened out.
+static inline uintptr_t load_const_atomic(const atomic_uintptr_t* p,
+                                          memory_order mo) {
+    atomic_uintptr_t* non_const_p = const_cast<atomic_uintptr_t*>(p);
+    return atomic_load_explicit(non_const_p, mo);
+}
+
 void* BBinder::findObject(const void* objectID) const
 {
     Extras* e = reinterpret_cast<Extras*>(
-                    atomic_load_explicit(&mExtras, memory_order_acquire));
+                    load_const_atomic(&mExtras, memory_order_acquire));
     if (!e) return NULL;
 
     AutoMutex _l(e->mLock);
diff --git a/libs/binder/BpBinder.cpp b/libs/binder/BpBinder.cpp
index 101de7e..345ba20 100644
--- a/libs/binder/BpBinder.cpp
+++ b/libs/binder/BpBinder.cpp
@@ -220,7 +220,6 @@
         if ((obit.recipient == recipient
                     || (recipient == NULL && obit.cookie == cookie))
                 && obit.flags == flags) {
-            const uint32_t allFlags = obit.flags|flags;
             if (outRecipient != NULL) {
                 *outRecipient = mObituaries->itemAt(i).recipient;
             }
diff --git a/libs/binder/Debug.cpp b/libs/binder/Debug.cpp
index 0ffafbb..bdb7182 100644
--- a/libs/binder/Debug.cpp
+++ b/libs/binder/Debug.cpp
@@ -220,13 +220,8 @@
         
         for (word = 0; word < bytesPerLine; ) {
 
-#ifdef HAVE_LITTLE_ENDIAN
             const size_t startIndex = word+(alignment-(alignment?1:0));
             const ssize_t dir = -1;
-#else
-            const size_t startIndex = word;
-            const ssize_t dir = 1;
-#endif
 
             for (index = 0; index < alignment || (alignment == 0 && index < bytesPerLine); index++) {
             
diff --git a/libs/binder/IAppOpsService.cpp b/libs/binder/IAppOpsService.cpp
index f58a352..86abdc0 100644
--- a/libs/binder/IAppOpsService.cpp
+++ b/libs/binder/IAppOpsService.cpp
@@ -91,14 +91,14 @@
         data.writeInterfaceToken(IAppOpsService::getInterfaceDescriptor());
         data.writeInt32(op);
         data.writeString16(packageName);
-        data.writeStrongBinder(callback->asBinder());
+        data.writeStrongBinder(IInterface::asBinder(callback));
         remote()->transact(START_WATCHING_MODE_TRANSACTION, data, &reply);
     }
 
     virtual void stopWatchingMode(const sp<IAppOpsCallback>& callback) {
         Parcel data, reply;
         data.writeInterfaceToken(IAppOpsService::getInterfaceDescriptor());
-        data.writeStrongBinder(callback->asBinder());
+        data.writeStrongBinder(IInterface::asBinder(callback));
         remote()->transact(STOP_WATCHING_MODE_TRANSACTION, data, &reply);
     }
 
diff --git a/libs/binder/IInterface.cpp b/libs/binder/IInterface.cpp
index 29acf5d..8c60dc4 100644
--- a/libs/binder/IInterface.cpp
+++ b/libs/binder/IInterface.cpp
@@ -27,14 +27,18 @@
 IInterface::~IInterface() {
 }
 
-sp<IBinder> IInterface::asBinder()
+// static
+sp<IBinder> IInterface::asBinder(const IInterface* iface)
 {
-    return this ? onAsBinder() : NULL;
+    if (iface == NULL) return NULL;
+    return const_cast<IInterface*>(iface)->onAsBinder();
 }
 
-sp<const IBinder> IInterface::asBinder() const
+// static
+sp<IBinder> IInterface::asBinder(const sp<IInterface>& iface)
 {
-    return this ? const_cast<IInterface*>(this)->onAsBinder() : NULL;
+    if (iface == NULL) return NULL;
+    return iface->onAsBinder();
 }
 
 // ---------------------------------------------------------------------------
diff --git a/libs/binder/IMemory.cpp b/libs/binder/IMemory.cpp
index d8ed995..e9891a8 100644
--- a/libs/binder/IMemory.cpp
+++ b/libs/binder/IMemory.cpp
@@ -216,7 +216,7 @@
             CHECK_INTERFACE(IMemory, data, reply);
             ssize_t offset;
             size_t size;
-            reply->writeStrongBinder( getMemory(&offset, &size)->asBinder() );
+            reply->writeStrongBinder( IInterface::asBinder(getMemory(&offset, &size)) );
             reply->writeInt32(offset);
             reply->writeInt32(size);
             return NO_ERROR;
@@ -241,7 +241,7 @@
         if (mRealHeap) {
             // by construction we're the last one
             if (mBase != MAP_FAILED) {
-                sp<IBinder> binder = const_cast<BpMemoryHeap*>(this)->asBinder();
+                sp<IBinder> binder = IInterface::asBinder(this);
 
                 if (VERBOSE) {
                     ALOGD("UNMAPPING binder=%p, heap=%p, size=%zu, fd=%d",
@@ -253,7 +253,7 @@
             }
         } else {
             // remove from list only if it was mapped before
-            sp<IBinder> binder = const_cast<BpMemoryHeap*>(this)->asBinder();
+            sp<IBinder> binder = IInterface::asBinder(this);
             free_heap(binder);
         }
     }
@@ -262,7 +262,7 @@
 void BpMemoryHeap::assertMapped() const
 {
     if (mHeapId == -1) {
-        sp<IBinder> binder(const_cast<BpMemoryHeap*>(this)->asBinder());
+        sp<IBinder> binder(IInterface::asBinder(const_cast<BpMemoryHeap*>(this)));
         sp<BpMemoryHeap> heap(static_cast<BpMemoryHeap*>(find_heap(binder).get()));
         heap->assertReallyMapped();
         if (heap->mBase != MAP_FAILED) {
@@ -297,7 +297,8 @@
         uint32_t offset = reply.readInt32();
 
         ALOGE_IF(err, "binder=%p transaction failed fd=%d, size=%zd, err=%d (%s)",
-                asBinder().get(), parcel_fd, size, err, strerror(-err));
+                IInterface::asBinder(this).get(),
+                parcel_fd, size, err, strerror(-err));
 
         int fd = dup( parcel_fd );
         ALOGE_IF(fd==-1, "cannot dup fd=%d, size=%zd, err=%d (%s)",
@@ -314,7 +315,7 @@
             mBase = mmap(0, size, access, MAP_SHARED, fd, offset);
             if (mBase == MAP_FAILED) {
                 ALOGE("cannot map BpMemoryHeap (binder=%p), size=%zd, fd=%d (%s)",
-                        asBinder().get(), size, fd, strerror(errno));
+                        IInterface::asBinder(this).get(), size, fd, strerror(errno));
                 close(fd);
             } else {
                 mSize = size;
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp
index dd04dcf..2043d54 100644
--- a/libs/binder/IPCThreadState.cpp
+++ b/libs/binder/IPCThreadState.cpp
@@ -70,13 +70,11 @@
 namespace android {
 
 static const char* getReturnString(size_t idx);
-static const char* getCommandString(size_t idx);
 static const void* printReturnCommand(TextOutput& out, const void* _cmd);
 static const void* printCommand(TextOutput& out, const void* _cmd);
 
-// This will result in a missing symbol failure if the IF_LOG_COMMANDS()
-// conditionals don't get stripped...  but that is probably what we want.
-#if !LOG_NDEBUG
+// Static const and functions will be optimized out if not used,
+// when LOG_NDEBUG and references in IF_LOG_COMMANDS() are optimized out.
 static const char *kReturnStrings[] = {
     "BR_ERROR",
     "BR_OK",
@@ -126,14 +124,6 @@
         return "unknown";
 }
 
-static const char* getCommandString(size_t idx)
-{
-    if (idx < sizeof(kCommandStrings) / sizeof(kCommandStrings[0]))
-        return kCommandStrings[idx];
-    else
-        return "unknown";
-}
-
 static const void* printBinderTransactionData(TextOutput& out, const void* data)
 {
     const binder_transaction_data* btd =
@@ -145,7 +135,7 @@
         out << "target.ptr=" << btd->target.ptr;
     }
     out << " (cookie " << btd->cookie << ")" << endl
-        << "code=" << TypeCode(btd->code) << ", flags=" << (void*)btd->flags << endl
+        << "code=" << TypeCode(btd->code) << ", flags=" << (void*)(long)btd->flags << endl
         << "data=" << btd->data.ptr.buffer << " (" << (void*)btd->data_size
         << " bytes)" << endl
         << "offsets=" << btd->data.ptr.offsets << " (" << (void*)btd->offsets_size
@@ -157,10 +147,10 @@
 {
     static const size_t N = sizeof(kReturnStrings)/sizeof(kReturnStrings[0]);
     const int32_t* cmd = (const int32_t*)_cmd;
-    int32_t code = *cmd++;
+    uint32_t code = (uint32_t)*cmd++;
     size_t cmdIndex = code & 0xff;
-    if (code == (int32_t) BR_ERROR) {
-        out << "BR_ERROR: " << (void*)(*cmd++) << endl;
+    if (code == BR_ERROR) {
+        out << "BR_ERROR: " << (void*)(long)(*cmd++) << endl;
         return cmd;
     } else if (cmdIndex >= N) {
         out << "Unknown reply: " << code << endl;
@@ -187,21 +177,21 @@
         case BR_DECREFS: {
             const int32_t b = *cmd++;
             const int32_t c = *cmd++;
-            out << ": target=" << (void*)b << " (cookie " << (void*)c << ")";
+            out << ": target=" << (void*)(long)b << " (cookie " << (void*)(long)c << ")";
         } break;
     
         case BR_ATTEMPT_ACQUIRE: {
             const int32_t p = *cmd++;
             const int32_t b = *cmd++;
             const int32_t c = *cmd++;
-            out << ": target=" << (void*)b << " (cookie " << (void*)c
+            out << ": target=" << (void*)(long)b << " (cookie " << (void*)(long)c
                 << "), pri=" << p;
         } break;
 
         case BR_DEAD_BINDER:
         case BR_CLEAR_DEATH_NOTIFICATION_DONE: {
             const int32_t c = *cmd++;
-            out << ": death cookie " << (void*)c;
+            out << ": death cookie " << (void*)(long)c;
         } break;
 
         default:
@@ -218,7 +208,7 @@
 {
     static const size_t N = sizeof(kCommandStrings)/sizeof(kCommandStrings[0]);
     const int32_t* cmd = (const int32_t*)_cmd;
-    int32_t code = *cmd++;
+    uint32_t code = (uint32_t)*cmd++;
     size_t cmdIndex = code & 0xff;
 
     if (cmdIndex >= N) {
@@ -242,7 +232,7 @@
         
         case BC_FREE_BUFFER: {
             const int32_t buf = *cmd++;
-            out << ": buffer=" << (void*)buf;
+            out << ": buffer=" << (void*)(long)buf;
         } break;
         
         case BC_INCREFS:
@@ -257,7 +247,7 @@
         case BC_ACQUIRE_DONE: {
             const int32_t b = *cmd++;
             const int32_t c = *cmd++;
-            out << ": target=" << (void*)b << " (cookie " << (void*)c << ")";
+            out << ": target=" << (void*)(long)b << " (cookie " << (void*)(long)c << ")";
         } break;
         
         case BC_ATTEMPT_ACQUIRE: {
@@ -270,12 +260,12 @@
         case BC_CLEAR_DEATH_NOTIFICATION: {
             const int32_t h = *cmd++;
             const int32_t c = *cmd++;
-            out << ": handle=" << h << " (death cookie " << (void*)c << ")";
+            out << ": handle=" << h << " (death cookie " << (void*)(long)c << ")";
         } break;
 
         case BC_DEAD_BINDER_DONE: {
             const int32_t c = *cmd++;
-            out << ": death cookie " << (void*)c;
+            out << ": death cookie " << (void*)(long)c;
         } break;
 
         default:
@@ -287,7 +277,6 @@
     out << endl;
     return cmd;
 }
-#endif
 
 static pthread_mutex_t gTLSMutex = PTHREAD_MUTEX_INITIALIZER;
 static bool gHaveTLS = false;
@@ -361,12 +350,12 @@
     return err;
 }
 
-int IPCThreadState::getCallingPid() const
+pid_t IPCThreadState::getCallingPid() const
 {
     return mCallingPid;
 }
 
-int IPCThreadState::getCallingUid() const
+uid_t IPCThreadState::getCallingUid() const
 {
     return mCallingUid;
 }
@@ -682,7 +671,7 @@
 
 IPCThreadState::IPCThreadState()
     : mProcess(ProcessState::self()),
-      mMyThreadId(androidGetTid()),
+      mMyThreadId(gettid()),
       mStrictModePolicy(0),
       mLastTransactionBinderFlags(0)
 {
@@ -708,7 +697,7 @@
 
 status_t IPCThreadState::waitForResponse(Parcel *reply, status_t *acquireResult)
 {
-    int32_t cmd;
+    uint32_t cmd;
     int32_t err;
 
     while (1) {
@@ -717,7 +706,7 @@
         if (err < NO_ERROR) break;
         if (mIn.dataAvail() == 0) continue;
         
-        cmd = mIn.readInt32();
+        cmd = (uint32_t)mIn.readInt32();
         
         IF_LOG_COMMANDS() {
             alog << "Processing waitForResponse Command: "
@@ -947,7 +936,7 @@
     RefBase::weakref_type* refs;
     status_t result = NO_ERROR;
     
-    switch (cmd) {
+    switch ((uint32_t)cmd) {
     case BR_ERROR:
         result = mIn.readInt32();
         break;
diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp
index 7b1b0e7..3c716df 100644
--- a/libs/binder/IServiceManager.cpp
+++ b/libs/binder/IServiceManager.cpp
@@ -87,7 +87,7 @@
             }
             
             // Is this a permission failure, or did the controller go away?
-            if (pc->asBinder()->isBinderAlive()) {
+            if (IInterface::asBinder(pc)->isBinderAlive()) {
                 ALOGW("Permission failure: %s from uid=%d pid=%d",
                         String8(permission).string(), uid, pid);
                 return false;
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index e7589b1..2c566f9 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -57,7 +57,7 @@
 #define PAD_SIZE(s) (((s)+3)&~3)
 
 // Note: must be kept in sync with android/os/StrictMode.java's PENALTY_GATHER
-#define STRICT_MODE_PENALTY_GATHER 0x100
+#define STRICT_MODE_PENALTY_GATHER (0x40 << 16)
 
 // Note: must be kept in sync with android/os/Parcel.java's EX_HAS_REPLY_HEADER
 #define EX_HAS_REPLY_HEADER -128
@@ -645,6 +645,12 @@
 {
     return writeAligned(val);
 }
+
+status_t Parcel::writeUint32(uint32_t val)
+{
+    return writeAligned(val);
+}
+
 status_t Parcel::writeInt32Array(size_t len, const int32_t *val) {
     if (!val) {
         return writeAligned(-1);
@@ -1033,6 +1039,15 @@
     return readAligned<int32_t>();
 }
 
+status_t Parcel::readUint32(uint32_t *pArg) const
+{
+    return readAligned(pArg);
+}
+
+uint32_t Parcel::readUint32() const
+{
+    return readAligned<uint32_t>();
+}
 
 status_t Parcel::readInt64(int64_t *pArg) const
 {
@@ -1438,7 +1453,7 @@
     for (size_t i = 0; i < mObjectsSize; i++) {
         binder_size_t offset = mObjects[i];
         if (offset < minOffset) {
-            ALOGE("%s: bad object offset %"PRIu64" < %"PRIu64"\n",
+            ALOGE("%s: bad object offset %" PRIu64 " < %" PRIu64 "\n",
                   __func__, (uint64_t)offset, (uint64_t)minOffset);
             mObjectsSize = 0;
             break;
diff --git a/libs/binder/tests/Android.mk b/libs/binder/tests/Android.mk
new file mode 100644
index 0000000..3668729
--- /dev/null
+++ b/libs/binder/tests/Android.mk
@@ -0,0 +1,34 @@
+#
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+ifneq ($(TARGET_USES_64_BIT_BINDER),true)
+ifneq ($(TARGET_IS_64_BIT),true)
+LOCAL_CFLAGS += -DBINDER_IPC_32BIT=1
+endif
+endif
+
+LOCAL_MODULE := binderDriverInterfaceTest
+LOCAL_SRC_FILES := binderDriverInterfaceTest.cpp
+include $(BUILD_NATIVE_TEST)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := binderLibTest
+LOCAL_SRC_FILES := binderLibTest.cpp
+LOCAL_SHARED_LIBRARIES := libbinder libutils
+include $(BUILD_NATIVE_TEST)
diff --git a/libs/binder/tests/binderDriverInterfaceTest.cpp b/libs/binder/tests/binderDriverInterfaceTest.cpp
new file mode 100644
index 0000000..315f349
--- /dev/null
+++ b/libs/binder/tests/binderDriverInterfaceTest.cpp
@@ -0,0 +1,353 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <gtest/gtest.h>
+#include <linux/binder.h>
+#include <binder/IBinder.h>
+#include <sys/mman.h>
+#include <poll.h>
+
+#define BINDER_DEV_NAME "/dev/binder"
+
+testing::Environment* binder_env;
+
+class BinderDriverInterfaceTestEnv : public ::testing::Environment {
+        virtual void SetUp() {
+            int ret;
+            uint32_t max_threads = 0;
+
+            m_binderFd = open(BINDER_DEV_NAME, O_RDWR | O_NONBLOCK);
+            ASSERT_GE(m_binderFd, 0);
+            m_buffer = mmap(NULL, 64*1024, PROT_READ, MAP_SHARED, m_binderFd, 0);
+            ASSERT_NE(m_buffer, (void *)NULL);
+            ret = ioctl(m_binderFd, BINDER_SET_MAX_THREADS, &max_threads);
+            EXPECT_EQ(0, ret);
+            EnterLooper();
+        }
+        virtual void TearDown() {
+            close(m_binderFd);
+        }
+    private:
+        int m_binderFd;
+        void *m_buffer;
+    public:
+        int getBinderFd(void) {
+            return m_binderFd;
+        }
+        void EnterLooper(void) {
+            int ret;
+            const uint32_t bc[] = {
+                BC_ENTER_LOOPER,
+            };
+            struct binder_write_read bwr = binder_write_read();
+            bwr.write_buffer = (uintptr_t)bc;
+            bwr.write_size = sizeof(bc);
+            ret = ioctl(m_binderFd, BINDER_WRITE_READ, &bwr);
+            EXPECT_EQ(0, ret);
+            if (ret < 0) {
+                    EXPECT_EQ(0, errno);
+            }
+            EXPECT_EQ(sizeof(bc), bwr.write_consumed);
+        }
+};
+
+class BinderDriverInterfaceTest : public ::testing::Test {
+    public:
+        virtual void SetUp() {
+            m_binderFd = static_cast<BinderDriverInterfaceTestEnv *>(binder_env)->getBinderFd();
+        }
+        virtual void TearDown() {
+        }
+    protected:
+        void binderTestIoctlRetErr2(int cmd, void *arg, int expect_ret, int expect_errno, int accept_errno) {
+            int ret;
+
+            ret = ioctl(m_binderFd, cmd, arg);
+            EXPECT_EQ(expect_ret, ret);
+            if (ret < 0) {
+                if (errno != accept_errno)
+                    EXPECT_EQ(expect_errno, errno);
+            }
+        }
+        void binderTestIoctlErr2(int cmd, void *arg, int expect_errno, int accept_errno) {
+            binderTestIoctlRetErr2(cmd, arg, -1, expect_errno, accept_errno);
+        }
+        void binderTestIoctlErr1(int cmd, void *arg, int expect_errno) {
+            binderTestIoctlErr2(cmd, arg, expect_errno, expect_errno);
+        }
+        void binderTestIoctl(int cmd, void *arg) {
+            binderTestIoctlRetErr2(cmd, arg, 0, 0, 0);
+        }
+        void binderTestIoctlUnimplemented(int cmd, void *arg) {
+            int ret;
+
+            ret = ioctl(m_binderFd, cmd, arg);
+            if (ret < 0) {
+                /* Not currently implmented. Allow ret == -1, errno == EINVAL */
+                EXPECT_EQ(-1, ret);
+                EXPECT_EQ(EINVAL, errno);
+            }
+        }
+        void binderTestReadEmpty(void) {
+            size_t i;
+            uint32_t br[32];
+            struct binder_write_read bwr = binder_write_read();
+            SCOPED_TRACE("TestReadEmpty");
+            bwr.read_buffer = (uintptr_t)br;
+            bwr.read_size = sizeof(br);
+            binderTestIoctlErr1(BINDER_WRITE_READ, &bwr, EAGAIN);
+            EXPECT_EQ(0u, bwr.read_consumed);
+            for (i = 0; i * sizeof(uint32_t) < bwr.read_consumed; i++) {
+                SCOPED_TRACE(testing::Message() << "i = " << i);
+                EXPECT_EQ(BR_NOOP, br[i]);
+            }
+        }
+        void binderWaitForReadData(int timeout_ms) {
+            int ret;
+            pollfd pfd = pollfd();
+
+            pfd.fd = m_binderFd;
+            pfd.events = POLLIN;
+            ret = poll(&pfd, 1, timeout_ms);
+            EXPECT_EQ(1, ret);
+        }
+    private:
+        int m_binderFd;
+};
+
+TEST_F(BinderDriverInterfaceTest, Version) {
+    struct binder_version version;
+    binderTestIoctl(BINDER_VERSION, &version);
+    ASSERT_EQ(BINDER_CURRENT_PROTOCOL_VERSION, version.protocol_version);
+}
+
+TEST_F(BinderDriverInterfaceTest, WriteReadNull) {
+    binderTestIoctlErr1(BINDER_WRITE_READ, NULL, EFAULT);
+}
+
+TEST_F(BinderDriverInterfaceTest, SetIdleTimeoutNull) {
+    binderTestIoctlErr2(BINDER_SET_IDLE_TIMEOUT, NULL, EFAULT, EINVAL);
+}
+
+TEST_F(BinderDriverInterfaceTest, SetMaxThreadsNull) {
+    binderTestIoctlErr2(BINDER_SET_MAX_THREADS, NULL, EFAULT, EINVAL); /* TODO: don't accept EINVAL */
+}
+
+TEST_F(BinderDriverInterfaceTest, SetIdlePriorityNull) {
+    binderTestIoctlErr2(BINDER_SET_IDLE_PRIORITY, NULL, EFAULT, EINVAL);
+}
+
+TEST_F(BinderDriverInterfaceTest, VersionNull) {
+    binderTestIoctlErr2(BINDER_VERSION, NULL, EFAULT, EINVAL); /* TODO: don't accept EINVAL */
+}
+
+TEST_F(BinderDriverInterfaceTest, SetIdleTimeoutNoTest) {
+    int64_t idle_timeout = 100000;
+    binderTestIoctlUnimplemented(BINDER_SET_IDLE_TIMEOUT, &idle_timeout);
+}
+
+TEST_F(BinderDriverInterfaceTest, SetMaxThreads) {
+    uint32_t max_threads = 0;
+    binderTestIoctl(BINDER_SET_MAX_THREADS, &max_threads);
+}
+
+TEST_F(BinderDriverInterfaceTest, SetIdlePriorityNoTest) {
+    int idle_priority = 0;
+    binderTestIoctlUnimplemented(BINDER_SET_IDLE_PRIORITY, &idle_priority);
+}
+
+TEST_F(BinderDriverInterfaceTest, SetContextMgrBusy) {
+    int32_t dummy = 0;
+    binderTestIoctlErr1(BINDER_SET_CONTEXT_MGR, &dummy, EBUSY);
+}
+
+TEST_F(BinderDriverInterfaceTest, ThreadExit) {
+    int32_t dummy = 0;
+    binderTestIoctl(BINDER_THREAD_EXIT, &dummy);
+    static_cast<BinderDriverInterfaceTestEnv *>(binder_env)->EnterLooper();
+}
+
+TEST_F(BinderDriverInterfaceTest, WriteReadEmpty) {
+    struct binder_write_read bwr = binder_write_read();
+    binderTestIoctl(BINDER_WRITE_READ, &bwr);
+}
+
+TEST_F(BinderDriverInterfaceTest, Read) {
+    binderTestReadEmpty();
+}
+
+TEST_F(BinderDriverInterfaceTest, IncRefsAcquireReleaseDecRefs) {
+    const uint32_t bc[] = {
+        BC_INCREFS,
+        0,
+        BC_ACQUIRE,
+        0,
+        BC_RELEASE,
+        0,
+        BC_DECREFS,
+        0,
+    };
+    struct binder_write_read bwr = binder_write_read();
+    bwr.write_buffer = (uintptr_t)bc;
+    bwr.write_size = sizeof(bc);
+    binderTestIoctl(BINDER_WRITE_READ, &bwr);
+    EXPECT_EQ(sizeof(bc), bwr.write_consumed);
+    binderTestReadEmpty();
+}
+
+TEST_F(BinderDriverInterfaceTest, Transaction) {
+    binder_uintptr_t cookie = 1234;
+    struct {
+        uint32_t cmd1;
+        struct binder_transaction_data arg1;
+    } __attribute__((packed)) bc1 = {
+        .cmd1 = BC_TRANSACTION,
+        .arg1 = {
+            .target = { 0 },
+            .cookie = 0,
+            .code = android::IBinder::PING_TRANSACTION,
+            .flags = 0,
+            .sender_pid = 0,
+            .sender_euid = 0,
+            .data_size = 0,
+            .offsets_size = 0,
+            .data = {0, 0},
+        },
+    };
+    struct {
+        uint32_t cmd0;
+        uint32_t cmd1;
+        uint32_t cmd2;
+        binder_transaction_data arg2;
+        uint32_t pad[16];
+    } __attribute__((packed)) br;
+    struct binder_write_read bwr = binder_write_read();
+
+    bwr.write_buffer = (uintptr_t)&bc1;
+    bwr.write_size = sizeof(bc1);
+    bwr.read_buffer = (uintptr_t)&br;
+    bwr.read_size = sizeof(br);
+
+    {
+        SCOPED_TRACE("1st WriteRead");
+        binderTestIoctl(BINDER_WRITE_READ, &bwr);
+    }
+    EXPECT_EQ(sizeof(bc1), bwr.write_consumed);
+    if (bwr.read_consumed < offsetof(typeof(br), pad)) {
+        SCOPED_TRACE("2nd WriteRead");
+        binderWaitForReadData(10000);
+        binderTestIoctl(BINDER_WRITE_READ, &bwr);
+    }
+    EXPECT_EQ(offsetof(typeof(br), pad), bwr.read_consumed);
+    if (bwr.read_consumed > offsetof(typeof(br), cmd0))
+        EXPECT_EQ(BR_NOOP, br.cmd0);
+    if (bwr.read_consumed > offsetof(typeof(br), cmd1))
+        EXPECT_EQ(BR_TRANSACTION_COMPLETE, br.cmd1);
+    if (bwr.read_consumed > offsetof(typeof(br), cmd2))
+        EXPECT_EQ(BR_REPLY, br.cmd2);
+    if (bwr.read_consumed >= offsetof(typeof(br), pad)) {
+        EXPECT_EQ(0u, br.arg2.target.ptr);
+        EXPECT_EQ(0u, br.arg2.cookie);
+        EXPECT_EQ(0u, br.arg2.code);
+        EXPECT_EQ(0u, br.arg2.flags);
+        EXPECT_EQ(0u, br.arg2.data_size);
+        EXPECT_EQ(0u, br.arg2.offsets_size);
+
+        SCOPED_TRACE("3rd WriteRead");
+
+        binderTestReadEmpty();
+
+        struct {
+            uint32_t cmd1;
+            binder_uintptr_t arg1;
+        } __attribute__((packed)) bc2 = {
+            .cmd1 = BC_FREE_BUFFER,
+            .arg1 = br.arg2.data.ptr.buffer,
+        };
+
+        bwr.write_buffer = (uintptr_t)&bc2;
+        bwr.write_size = sizeof(bc2);
+        bwr.write_consumed = 0;
+        bwr.read_size = 0;
+
+        binderTestIoctl(BINDER_WRITE_READ, &bwr);
+        EXPECT_EQ(sizeof(bc2), bwr.write_consumed);
+    }
+    binderTestReadEmpty();
+}
+
+TEST_F(BinderDriverInterfaceTest, RequestDeathNotification) {
+    binder_uintptr_t cookie = 1234;
+    struct {
+        uint32_t cmd0;
+        uint32_t arg0;
+        uint32_t cmd1;
+        struct binder_handle_cookie arg1;
+        uint32_t cmd2;
+        struct binder_handle_cookie arg2;
+        uint32_t cmd3;
+        uint32_t arg3;
+    } __attribute__((packed)) bc = {
+        .cmd0 = BC_INCREFS,
+        .arg0 = 0,
+        .cmd1 = BC_REQUEST_DEATH_NOTIFICATION,
+        .arg1 = {
+            .handle = 0,
+            .cookie = cookie,
+        },
+        .cmd2 = BC_CLEAR_DEATH_NOTIFICATION,
+        .arg2 = {
+            .handle = 0,
+            .cookie = cookie,
+        },
+        .cmd3 = BC_DECREFS,
+        .arg3 = 0,
+    };
+    struct {
+        uint32_t cmd0;
+        uint32_t cmd1;
+        binder_uintptr_t arg1;
+        uint32_t pad[16];
+    } __attribute__((packed)) br;
+    struct binder_write_read bwr = binder_write_read();
+
+    bwr.write_buffer = (uintptr_t)&bc;
+    bwr.write_size = sizeof(bc);
+    bwr.read_buffer = (uintptr_t)&br;
+    bwr.read_size = sizeof(br);
+
+    binderTestIoctl(BINDER_WRITE_READ, &bwr);
+    EXPECT_EQ(sizeof(bc), bwr.write_consumed);
+    EXPECT_EQ(sizeof(br) - sizeof(br.pad), bwr.read_consumed);
+    EXPECT_EQ(BR_NOOP, br.cmd0);
+    EXPECT_EQ(BR_CLEAR_DEATH_NOTIFICATION_DONE, br.cmd1);
+    EXPECT_EQ(cookie, br.arg1);
+    binderTestReadEmpty();
+}
+
+int main(int argc, char **argv) {
+    ::testing::InitGoogleTest(&argc, argv);
+
+    binder_env = AddGlobalTestEnvironment(new BinderDriverInterfaceTestEnv());
+
+    return RUN_ALL_TESTS();
+}
+
diff --git a/libs/binder/tests/binderLibTest.cpp b/libs/binder/tests/binderLibTest.cpp
new file mode 100644
index 0000000..3df3acf
--- /dev/null
+++ b/libs/binder/tests/binderLibTest.cpp
@@ -0,0 +1,954 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <poll.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <gtest/gtest.h>
+
+#include <binder/Binder.h>
+#include <binder/IBinder.h>
+#include <binder/IPCThreadState.h>
+#include <binder/IServiceManager.h>
+
+#define ARRAY_SIZE(array) (sizeof array / sizeof array[0])
+
+using namespace android;
+
+static testing::Environment* binder_env;
+static char *binderservername;
+static char binderserverarg[] = "--binderserver";
+
+static String16 binderLibTestServiceName = String16("test.binderLib");
+
+enum BinderLibTestTranscationCode {
+    BINDER_LIB_TEST_NOP_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION,
+    BINDER_LIB_TEST_REGISTER_SERVER,
+    BINDER_LIB_TEST_ADD_SERVER,
+    BINDER_LIB_TEST_CALL_BACK,
+    BINDER_LIB_TEST_NOP_CALL_BACK,
+    BINDER_LIB_TEST_GET_ID_TRANSACTION,
+    BINDER_LIB_TEST_INDIRECT_TRANSACTION,
+    BINDER_LIB_TEST_SET_ERROR_TRANSACTION,
+    BINDER_LIB_TEST_GET_STATUS_TRANSACTION,
+    BINDER_LIB_TEST_ADD_STRONG_REF_TRANSACTION,
+    BINDER_LIB_TEST_LINK_DEATH_TRANSACTION,
+    BINDER_LIB_TEST_WRITE_FILE_TRANSACTION,
+    BINDER_LIB_TEST_PROMOTE_WEAK_REF_TRANSACTION,
+    BINDER_LIB_TEST_EXIT_TRANSACTION,
+    BINDER_LIB_TEST_DELAYED_EXIT_TRANSACTION,
+    BINDER_LIB_TEST_GET_PTR_SIZE_TRANSACTION,
+};
+
+pid_t start_server_process(int arg2)
+{
+    int ret;
+    pid_t pid;
+    status_t status;
+    int pipefd[2];
+    char stri[16];
+    char strpipefd1[16];
+    char *childargv[] = {
+        binderservername,
+        binderserverarg,
+        stri,
+        strpipefd1,
+        NULL
+    };
+
+    ret = pipe(pipefd);
+    if (ret < 0)
+        return ret;
+
+    snprintf(stri, sizeof(stri), "%d", arg2);
+    snprintf(strpipefd1, sizeof(strpipefd1), "%d", pipefd[1]);
+
+    pid = fork();
+    if (pid == -1)
+        return pid;
+    if (pid == 0) {
+        close(pipefd[0]);
+        execv(binderservername, childargv);
+        status = -errno;
+        write(pipefd[1], &status, sizeof(status));
+        fprintf(stderr, "execv failed, %s\n", strerror(errno));
+        _exit(EXIT_FAILURE);
+    }
+    close(pipefd[1]);
+    ret = read(pipefd[0], &status, sizeof(status));
+    //printf("pipe read returned %d, status %d\n", ret, status);
+    close(pipefd[0]);
+    if (ret == sizeof(status)) {
+        ret = status;
+    } else {
+        kill(pid, SIGKILL);
+        if (ret >= 0) {
+            ret = NO_INIT;
+        }
+    }
+    if (ret < 0) {
+        wait(NULL);
+        return ret;
+    }
+    return pid;
+}
+
+class BinderLibTestEnv : public ::testing::Environment {
+    public:
+        BinderLibTestEnv() {}
+        sp<IBinder> getServer(void) {
+            return m_server;
+        }
+
+    private:
+        virtual void SetUp() {
+            m_serverpid = start_server_process(0);
+            //printf("m_serverpid %d\n", m_serverpid);
+            ASSERT_GT(m_serverpid, 0);
+
+            sp<IServiceManager> sm = defaultServiceManager();
+            //printf("%s: pid %d, get service\n", __func__, m_pid);
+            m_server = sm->getService(binderLibTestServiceName);
+            ASSERT_TRUE(m_server != NULL);
+            //printf("%s: pid %d, get service done\n", __func__, m_pid);
+        }
+        virtual void TearDown() {
+            status_t ret;
+            Parcel data, reply;
+            int exitStatus;
+            pid_t pid;
+
+            //printf("%s: pid %d\n", __func__, m_pid);
+            if (m_server != NULL) {
+                ret = m_server->transact(BINDER_LIB_TEST_GET_STATUS_TRANSACTION, data, &reply);
+                EXPECT_EQ(0, ret);
+                ret = m_server->transact(BINDER_LIB_TEST_EXIT_TRANSACTION, data, &reply, TF_ONE_WAY);
+                EXPECT_EQ(0, ret);
+            }
+            if (m_serverpid > 0) {
+                //printf("wait for %d\n", m_pids[i]);
+                pid = wait(&exitStatus);
+                EXPECT_EQ(m_serverpid, pid);
+                EXPECT_TRUE(WIFEXITED(exitStatus));
+                EXPECT_EQ(0, WEXITSTATUS(exitStatus));
+            }
+        }
+
+        pid_t m_serverpid;
+        sp<IBinder> m_server;
+};
+
+class BinderLibTest : public ::testing::Test {
+    public:
+        virtual void SetUp() {
+            m_server = static_cast<BinderLibTestEnv *>(binder_env)->getServer();
+        }
+        virtual void TearDown() {
+        }
+    protected:
+        sp<IBinder> addServer(int32_t *idPtr = NULL)
+        {
+            int ret;
+            int32_t id;
+            Parcel data, reply;
+            sp<IBinder> binder;
+
+            ret = m_server->transact(BINDER_LIB_TEST_ADD_SERVER, data, &reply);
+            EXPECT_EQ(NO_ERROR, ret);
+
+            EXPECT_FALSE(binder != NULL);
+            binder = reply.readStrongBinder();
+            EXPECT_TRUE(binder != NULL);
+            ret = reply.readInt32(&id);
+            EXPECT_EQ(NO_ERROR, ret);
+            if (idPtr)
+                *idPtr = id;
+            return binder;
+        }
+        void waitForReadData(int fd, int timeout_ms) {
+            int ret;
+            pollfd pfd = pollfd();
+
+            pfd.fd = fd;
+            pfd.events = POLLIN;
+            ret = poll(&pfd, 1, timeout_ms);
+            EXPECT_EQ(1, ret);
+        }
+
+        sp<IBinder> m_server;
+};
+
+class BinderLibTestBundle : public Parcel
+{
+    public:
+        BinderLibTestBundle(void) {}
+        BinderLibTestBundle(const Parcel *source) : m_isValid(false) {
+            int32_t mark;
+            int32_t bundleLen;
+            size_t pos;
+
+            if (source->readInt32(&mark))
+                return;
+            if (mark != MARK_START)
+                return;
+            if (source->readInt32(&bundleLen))
+                return;
+            pos = source->dataPosition();
+            if (Parcel::appendFrom(source, pos, bundleLen))
+                return;
+            source->setDataPosition(pos + bundleLen);
+            if (source->readInt32(&mark))
+                return;
+            if (mark != MARK_END)
+                return;
+            m_isValid = true;
+            setDataPosition(0);
+        }
+        void appendTo(Parcel *dest) {
+            dest->writeInt32(MARK_START);
+            dest->writeInt32(dataSize());
+            dest->appendFrom(this, 0, dataSize());
+            dest->writeInt32(MARK_END);
+        };
+        bool isValid(void) {
+            return m_isValid;
+        }
+    private:
+        enum {
+            MARK_START  = B_PACK_CHARS('B','T','B','S'),
+            MARK_END    = B_PACK_CHARS('B','T','B','E'),
+        };
+        bool m_isValid;
+};
+
+class BinderLibTestEvent
+{
+    public:
+        BinderLibTestEvent(void)
+            : m_eventTriggered(false)
+        {
+            pthread_mutex_init(&m_waitMutex, NULL);
+            pthread_cond_init(&m_waitCond, NULL);
+        }
+        int waitEvent(int timeout_s)
+        {
+            int ret;
+            pthread_mutex_lock(&m_waitMutex);
+            if (!m_eventTriggered) {
+#if defined(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE)
+                pthread_cond_timeout_np(&m_waitCond, &m_waitMutex, timeout_s * 1000);
+#else
+                struct timespec ts;
+                clock_gettime(CLOCK_REALTIME, &ts);
+                ts.tv_sec += timeout_s;
+                pthread_cond_timedwait(&m_waitCond, &m_waitMutex, &ts);
+#endif
+            }
+            ret = m_eventTriggered ? NO_ERROR : TIMED_OUT;
+            pthread_mutex_unlock(&m_waitMutex);
+            return ret;
+        }
+    protected:
+        void triggerEvent(void) {
+            pthread_mutex_lock(&m_waitMutex);
+            pthread_cond_signal(&m_waitCond);
+            m_eventTriggered = true;
+            pthread_mutex_unlock(&m_waitMutex);
+        };
+    private:
+        pthread_mutex_t m_waitMutex;
+        pthread_cond_t m_waitCond;
+        bool m_eventTriggered;
+};
+
+class BinderLibTestCallBack : public BBinder, public BinderLibTestEvent
+{
+    public:
+        BinderLibTestCallBack()
+            : m_result(NOT_ENOUGH_DATA)
+        {
+        }
+        status_t getResult(void)
+        {
+            return m_result;
+        }
+
+    private:
+        virtual status_t onTransact(uint32_t code,
+                                    const Parcel& data, Parcel* reply,
+                                    uint32_t flags = 0)
+        {
+            (void)reply;
+            (void)flags;
+            switch(code) {
+            case BINDER_LIB_TEST_CALL_BACK:
+                m_result = data.readInt32();
+                triggerEvent();
+                return NO_ERROR;
+            default:
+                return UNKNOWN_TRANSACTION;
+            }
+        }
+
+        status_t m_result;
+};
+
+class TestDeathRecipient : public IBinder::DeathRecipient, public BinderLibTestEvent
+{
+    private:
+        virtual void binderDied(const wp<IBinder>& who) {
+            (void)who;
+            triggerEvent();
+        };
+};
+
+TEST_F(BinderLibTest, NopTransaction) {
+    status_t ret;
+    Parcel data, reply;
+    ret = m_server->transact(BINDER_LIB_TEST_NOP_TRANSACTION, data, &reply);
+    EXPECT_EQ(NO_ERROR, ret);
+}
+
+TEST_F(BinderLibTest, SetError) {
+    int32_t testValue[] = { 0, -123, 123 };
+    for (size_t i = 0; i < ARRAY_SIZE(testValue); i++) {
+        status_t ret;
+        Parcel data, reply;
+        data.writeInt32(testValue[i]);
+        ret = m_server->transact(BINDER_LIB_TEST_SET_ERROR_TRANSACTION, data, &reply);
+        EXPECT_EQ(testValue[i], ret);
+    }
+}
+
+TEST_F(BinderLibTest, GetId) {
+    status_t ret;
+    int32_t id;
+    Parcel data, reply;
+    ret = m_server->transact(BINDER_LIB_TEST_GET_ID_TRANSACTION, data, &reply);
+    EXPECT_EQ(NO_ERROR, ret);
+    ret = reply.readInt32(&id);
+    EXPECT_EQ(NO_ERROR, ret);
+    EXPECT_EQ(0, id);
+}
+
+TEST_F(BinderLibTest, PtrSize) {
+    status_t ret;
+    int32_t ptrsize;
+    Parcel data, reply;
+    sp<IBinder> server = addServer();
+    ASSERT_TRUE(server != NULL);
+    ret = server->transact(BINDER_LIB_TEST_GET_PTR_SIZE_TRANSACTION, data, &reply);
+    EXPECT_EQ(NO_ERROR, ret);
+    ret = reply.readInt32(&ptrsize);
+    EXPECT_EQ(NO_ERROR, ret);
+    RecordProperty("TestPtrSize", sizeof(void *));
+    RecordProperty("ServerPtrSize", sizeof(void *));
+}
+
+TEST_F(BinderLibTest, IndirectGetId2)
+{
+    status_t ret;
+    int32_t id;
+    int32_t count;
+    Parcel data, reply;
+    int32_t serverId[3];
+
+    data.writeInt32(ARRAY_SIZE(serverId));
+    for (size_t i = 0; i < ARRAY_SIZE(serverId); i++) {
+        sp<IBinder> server;
+        BinderLibTestBundle datai;
+
+        server = addServer(&serverId[i]);
+        ASSERT_TRUE(server != NULL);
+        data.writeStrongBinder(server);
+        data.writeInt32(BINDER_LIB_TEST_GET_ID_TRANSACTION);
+        datai.appendTo(&data);
+    }
+
+    ret = m_server->transact(BINDER_LIB_TEST_INDIRECT_TRANSACTION, data, &reply);
+    ASSERT_EQ(NO_ERROR, ret);
+
+    ret = reply.readInt32(&id);
+    ASSERT_EQ(NO_ERROR, ret);
+    EXPECT_EQ(0, id);
+
+    ret = reply.readInt32(&count);
+    ASSERT_EQ(NO_ERROR, ret);
+    EXPECT_EQ(ARRAY_SIZE(serverId), count);
+
+    for (size_t i = 0; i < (size_t)count; i++) {
+        BinderLibTestBundle replyi(&reply);
+        EXPECT_TRUE(replyi.isValid());
+        ret = replyi.readInt32(&id);
+        EXPECT_EQ(NO_ERROR, ret);
+        EXPECT_EQ(serverId[i], id);
+        EXPECT_EQ(replyi.dataSize(), replyi.dataPosition());
+    }
+
+    EXPECT_EQ(reply.dataSize(), reply.dataPosition());
+}
+
+TEST_F(BinderLibTest, IndirectGetId3)
+{
+    status_t ret;
+    int32_t id;
+    int32_t count;
+    Parcel data, reply;
+    int32_t serverId[3];
+
+    data.writeInt32(ARRAY_SIZE(serverId));
+    for (size_t i = 0; i < ARRAY_SIZE(serverId); i++) {
+        sp<IBinder> server;
+        BinderLibTestBundle datai;
+        BinderLibTestBundle datai2;
+
+        server = addServer(&serverId[i]);
+        ASSERT_TRUE(server != NULL);
+        data.writeStrongBinder(server);
+        data.writeInt32(BINDER_LIB_TEST_INDIRECT_TRANSACTION);
+
+        datai.writeInt32(1);
+        datai.writeStrongBinder(m_server);
+        datai.writeInt32(BINDER_LIB_TEST_GET_ID_TRANSACTION);
+        datai2.appendTo(&datai);
+
+        datai.appendTo(&data);
+    }
+
+    ret = m_server->transact(BINDER_LIB_TEST_INDIRECT_TRANSACTION, data, &reply);
+    ASSERT_EQ(NO_ERROR, ret);
+
+    ret = reply.readInt32(&id);
+    ASSERT_EQ(NO_ERROR, ret);
+    EXPECT_EQ(0, id);
+
+    ret = reply.readInt32(&count);
+    ASSERT_EQ(NO_ERROR, ret);
+    EXPECT_EQ(ARRAY_SIZE(serverId), count);
+
+    for (size_t i = 0; i < (size_t)count; i++) {
+        int32_t counti;
+
+        BinderLibTestBundle replyi(&reply);
+        EXPECT_TRUE(replyi.isValid());
+        ret = replyi.readInt32(&id);
+        EXPECT_EQ(NO_ERROR, ret);
+        EXPECT_EQ(serverId[i], id);
+
+        ret = replyi.readInt32(&counti);
+        ASSERT_EQ(NO_ERROR, ret);
+        EXPECT_EQ(1, counti);
+
+        BinderLibTestBundle replyi2(&replyi);
+        EXPECT_TRUE(replyi2.isValid());
+        ret = replyi2.readInt32(&id);
+        EXPECT_EQ(NO_ERROR, ret);
+        EXPECT_EQ(0, id);
+        EXPECT_EQ(replyi2.dataSize(), replyi2.dataPosition());
+
+        EXPECT_EQ(replyi.dataSize(), replyi.dataPosition());
+    }
+
+    EXPECT_EQ(reply.dataSize(), reply.dataPosition());
+}
+
+TEST_F(BinderLibTest, CallBack)
+{
+    status_t ret;
+    Parcel data, reply;
+    sp<BinderLibTestCallBack> callBack = new BinderLibTestCallBack();
+    data.writeStrongBinder(callBack);
+    ret = m_server->transact(BINDER_LIB_TEST_NOP_CALL_BACK, data, &reply, TF_ONE_WAY);
+    EXPECT_EQ(NO_ERROR, ret);
+    ret = callBack->waitEvent(5);
+    EXPECT_EQ(NO_ERROR, ret);
+    ret = callBack->getResult();
+    EXPECT_EQ(NO_ERROR, ret);
+}
+
+TEST_F(BinderLibTest, AddServer)
+{
+    sp<IBinder> server = addServer();
+    ASSERT_TRUE(server != NULL);
+}
+
+TEST_F(BinderLibTest, DeathNotificationNoRefs)
+{
+    status_t ret;
+
+    sp<TestDeathRecipient> testDeathRecipient = new TestDeathRecipient();
+
+    {
+        sp<IBinder> binder = addServer();
+        ASSERT_TRUE(binder != NULL);
+        ret = binder->linkToDeath(testDeathRecipient);
+        EXPECT_EQ(NO_ERROR, ret);
+    }
+    IPCThreadState::self()->flushCommands();
+    ret = testDeathRecipient->waitEvent(5);
+    EXPECT_EQ(NO_ERROR, ret);
+#if 0 /* Is there an unlink api that does not require a strong reference? */
+    ret = binder->unlinkToDeath(testDeathRecipient);
+    EXPECT_EQ(NO_ERROR, ret);
+#endif
+}
+
+TEST_F(BinderLibTest, DeathNotificationWeakRef)
+{
+    status_t ret;
+    wp<IBinder> wbinder;
+
+    sp<TestDeathRecipient> testDeathRecipient = new TestDeathRecipient();
+
+    {
+        sp<IBinder> binder = addServer();
+        ASSERT_TRUE(binder != NULL);
+        ret = binder->linkToDeath(testDeathRecipient);
+        EXPECT_EQ(NO_ERROR, ret);
+        wbinder = binder;
+    }
+    IPCThreadState::self()->flushCommands();
+    ret = testDeathRecipient->waitEvent(5);
+    EXPECT_EQ(NO_ERROR, ret);
+#if 0 /* Is there an unlink api that does not require a strong reference? */
+    ret = binder->unlinkToDeath(testDeathRecipient);
+    EXPECT_EQ(NO_ERROR, ret);
+#endif
+}
+
+TEST_F(BinderLibTest, DeathNotificationStrongRef)
+{
+    status_t ret;
+    sp<IBinder> sbinder;
+
+    sp<TestDeathRecipient> testDeathRecipient = new TestDeathRecipient();
+
+    {
+        sp<IBinder> binder = addServer();
+        ASSERT_TRUE(binder != NULL);
+        ret = binder->linkToDeath(testDeathRecipient);
+        EXPECT_EQ(NO_ERROR, ret);
+        sbinder = binder;
+    }
+    {
+        Parcel data, reply;
+        ret = sbinder->transact(BINDER_LIB_TEST_EXIT_TRANSACTION, data, &reply, TF_ONE_WAY);
+        EXPECT_EQ(0, ret);
+    }
+    IPCThreadState::self()->flushCommands();
+    ret = testDeathRecipient->waitEvent(5);
+    EXPECT_EQ(NO_ERROR, ret);
+    ret = sbinder->unlinkToDeath(testDeathRecipient);
+    EXPECT_EQ(DEAD_OBJECT, ret);
+}
+
+TEST_F(BinderLibTest, DeathNotificationMultiple)
+{
+    status_t ret;
+    const int clientcount = 2;
+    sp<IBinder> target;
+    sp<IBinder> linkedclient[clientcount];
+    sp<BinderLibTestCallBack> callBack[clientcount];
+    sp<IBinder> passiveclient[clientcount];
+
+    target = addServer();
+    ASSERT_TRUE(target != NULL);
+    for (int i = 0; i < clientcount; i++) {
+        {
+            Parcel data, reply;
+
+            linkedclient[i] = addServer();
+            ASSERT_TRUE(linkedclient[i] != NULL);
+            callBack[i] = new BinderLibTestCallBack();
+            data.writeStrongBinder(target);
+            data.writeStrongBinder(callBack[i]);
+            ret = linkedclient[i]->transact(BINDER_LIB_TEST_LINK_DEATH_TRANSACTION, data, &reply, TF_ONE_WAY);
+            EXPECT_EQ(NO_ERROR, ret);
+        }
+        {
+            Parcel data, reply;
+
+            passiveclient[i] = addServer();
+            ASSERT_TRUE(passiveclient[i] != NULL);
+            data.writeStrongBinder(target);
+            ret = passiveclient[i]->transact(BINDER_LIB_TEST_ADD_STRONG_REF_TRANSACTION, data, &reply, TF_ONE_WAY);
+            EXPECT_EQ(NO_ERROR, ret);
+        }
+    }
+    {
+        Parcel data, reply;
+        ret = target->transact(BINDER_LIB_TEST_EXIT_TRANSACTION, data, &reply, TF_ONE_WAY);
+        EXPECT_EQ(0, ret);
+    }
+
+    for (int i = 0; i < clientcount; i++) {
+        ret = callBack[i]->waitEvent(5);
+        EXPECT_EQ(NO_ERROR, ret);
+        ret = callBack[i]->getResult();
+        EXPECT_EQ(NO_ERROR, ret);
+    }
+}
+
+TEST_F(BinderLibTest, PassFile) {
+    int ret;
+    int pipefd[2];
+    uint8_t buf[1] = { 0 };
+    uint8_t write_value = 123;
+
+    ret = pipe2(pipefd, O_NONBLOCK);
+    ASSERT_EQ(0, ret);
+
+    {
+        Parcel data, reply;
+        uint8_t writebuf[1] = { write_value };
+
+        ret = data.writeFileDescriptor(pipefd[1], true);
+        EXPECT_EQ(NO_ERROR, ret);
+
+        ret = data.writeInt32(sizeof(writebuf));
+        EXPECT_EQ(NO_ERROR, ret);
+
+        ret = data.write(writebuf, sizeof(writebuf));
+        EXPECT_EQ(NO_ERROR, ret);
+
+        ret = m_server->transact(BINDER_LIB_TEST_WRITE_FILE_TRANSACTION, data, &reply);
+        EXPECT_EQ(NO_ERROR, ret);
+    }
+
+    ret = read(pipefd[0], buf, sizeof(buf));
+    EXPECT_EQ(sizeof(buf), ret);
+    EXPECT_EQ(write_value, buf[0]);
+
+    waitForReadData(pipefd[0], 5000); /* wait for other proccess to close pipe */
+
+    ret = read(pipefd[0], buf, sizeof(buf));
+    EXPECT_EQ(0, ret);
+
+    close(pipefd[0]);
+}
+
+TEST_F(BinderLibTest, PromoteLocal) {
+    sp<IBinder> strong = new BBinder();
+    wp<IBinder> weak = strong;
+    sp<IBinder> strong_from_weak = weak.promote();
+    EXPECT_TRUE(strong != NULL);
+    EXPECT_EQ(strong, strong_from_weak);
+    strong = NULL;
+    strong_from_weak = NULL;
+    strong_from_weak = weak.promote();
+    EXPECT_TRUE(strong_from_weak == NULL);
+}
+
+TEST_F(BinderLibTest, PromoteRemote) {
+    int ret;
+    Parcel data, reply;
+    sp<IBinder> strong = new BBinder();
+    sp<IBinder> server = addServer();
+
+    ASSERT_TRUE(server != NULL);
+    ASSERT_TRUE(strong != NULL);
+
+    ret = data.writeWeakBinder(strong);
+    EXPECT_EQ(NO_ERROR, ret);
+
+    ret = server->transact(BINDER_LIB_TEST_PROMOTE_WEAK_REF_TRANSACTION, data, &reply);
+    EXPECT_GE(ret, 0);
+}
+
+class BinderLibTestService : public BBinder
+{
+    public:
+        BinderLibTestService(int32_t id)
+            : m_id(id)
+            , m_nextServerId(id + 1)
+            , m_serverStartRequested(false)
+        {
+            pthread_mutex_init(&m_serverWaitMutex, NULL);
+            pthread_cond_init(&m_serverWaitCond, NULL);
+        }
+        ~BinderLibTestService()
+        {
+            exit(EXIT_SUCCESS);
+        }
+        virtual status_t onTransact(uint32_t code,
+                                    const Parcel& data, Parcel* reply,
+                                    uint32_t flags = 0) {
+            //printf("%s: code %d\n", __func__, code);
+            (void)flags;
+
+            if (getuid() != (uid_t)IPCThreadState::self()->getCallingUid()) {
+                return PERMISSION_DENIED;
+            }
+            switch (code) {
+            case BINDER_LIB_TEST_REGISTER_SERVER: {
+                int32_t id;
+                sp<IBinder> binder;
+                id = data.readInt32();
+                binder = data.readStrongBinder();
+                if (binder == NULL) {
+                    return BAD_VALUE;
+                }
+
+                if (m_id != 0)
+                    return INVALID_OPERATION;
+
+                pthread_mutex_lock(&m_serverWaitMutex);
+                if (m_serverStartRequested) {
+                    m_serverStartRequested = false;
+                    m_serverStarted = binder;
+                    pthread_cond_signal(&m_serverWaitCond);
+                }
+                pthread_mutex_unlock(&m_serverWaitMutex);
+                return NO_ERROR;
+            }
+            case BINDER_LIB_TEST_ADD_SERVER: {
+                int ret;
+                uint8_t buf[1] = { 0 };
+                int serverid;
+
+                if (m_id != 0) {
+                    return INVALID_OPERATION;
+                }
+                pthread_mutex_lock(&m_serverWaitMutex);
+                if (m_serverStartRequested) {
+                    ret = -EBUSY;
+                } else {
+                    serverid = m_nextServerId++;
+                    m_serverStartRequested = true;
+
+                    pthread_mutex_unlock(&m_serverWaitMutex);
+                    ret = start_server_process(serverid);
+                    pthread_mutex_lock(&m_serverWaitMutex);
+                }
+                if (ret > 0) {
+                    if (m_serverStartRequested) {
+#if defined(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE)
+                        ret = pthread_cond_timeout_np(&m_serverWaitCond, &m_serverWaitMutex, 5000);
+#else
+                        struct timespec ts;
+                        clock_gettime(CLOCK_REALTIME, &ts);
+                        ts.tv_sec += 5;
+                        ret = pthread_cond_timedwait(&m_serverWaitCond, &m_serverWaitMutex, &ts);
+#endif
+                    }
+                    if (m_serverStartRequested) {
+                        m_serverStartRequested = false;
+                        ret = -ETIMEDOUT;
+                    } else {
+                        reply->writeStrongBinder(m_serverStarted);
+                        reply->writeInt32(serverid);
+                        m_serverStarted = NULL;
+                        ret = NO_ERROR;
+                    }
+                } else if (ret >= 0) {
+                    m_serverStartRequested = false;
+                    ret = UNKNOWN_ERROR;
+                }
+                pthread_mutex_unlock(&m_serverWaitMutex);
+                return ret;
+            }
+            case BINDER_LIB_TEST_NOP_TRANSACTION:
+                return NO_ERROR;
+            case BINDER_LIB_TEST_NOP_CALL_BACK: {
+                Parcel data2, reply2;
+                sp<IBinder> binder;
+                binder = data.readStrongBinder();
+                if (binder == NULL) {
+                    return BAD_VALUE;
+                }
+                reply2.writeInt32(NO_ERROR);
+                binder->transact(BINDER_LIB_TEST_CALL_BACK, data2, &reply2);
+                return NO_ERROR;
+            }
+            case BINDER_LIB_TEST_GET_ID_TRANSACTION:
+                reply->writeInt32(m_id);
+                return NO_ERROR;
+            case BINDER_LIB_TEST_INDIRECT_TRANSACTION: {
+                int32_t count;
+                uint32_t indirect_code;
+                sp<IBinder> binder;
+
+                count = data.readInt32();
+                reply->writeInt32(m_id);
+                reply->writeInt32(count);
+                for (int i = 0; i < count; i++) {
+                    binder = data.readStrongBinder();
+                    if (binder == NULL) {
+                        return BAD_VALUE;
+                    }
+                    indirect_code = data.readInt32();
+                    BinderLibTestBundle data2(&data);
+                    if (!data2.isValid()) {
+                        return BAD_VALUE;
+                    }
+                    BinderLibTestBundle reply2;
+                    binder->transact(indirect_code, data2, &reply2);
+                    reply2.appendTo(reply);
+                }
+                return NO_ERROR;
+            }
+            case BINDER_LIB_TEST_SET_ERROR_TRANSACTION:
+                reply->setError(data.readInt32());
+                return NO_ERROR;
+            case BINDER_LIB_TEST_GET_PTR_SIZE_TRANSACTION:
+                reply->writeInt32(sizeof(void *));
+                return NO_ERROR;
+            case BINDER_LIB_TEST_GET_STATUS_TRANSACTION:
+                return NO_ERROR;
+            case BINDER_LIB_TEST_ADD_STRONG_REF_TRANSACTION:
+                m_strongRef = data.readStrongBinder();
+                return NO_ERROR;
+            case BINDER_LIB_TEST_LINK_DEATH_TRANSACTION: {
+                int ret;
+                Parcel data2, reply2;
+                sp<TestDeathRecipient> testDeathRecipient = new TestDeathRecipient();
+                sp<IBinder> target;
+                sp<IBinder> callback;
+
+                target = data.readStrongBinder();
+                if (target == NULL) {
+                    return BAD_VALUE;
+                }
+                callback = data.readStrongBinder();
+                if (callback == NULL) {
+                    return BAD_VALUE;
+                }
+                ret = target->linkToDeath(testDeathRecipient);
+                if (ret == NO_ERROR)
+                    ret = testDeathRecipient->waitEvent(5);
+                data2.writeInt32(ret);
+                callback->transact(BINDER_LIB_TEST_CALL_BACK, data2, &reply2);
+                return NO_ERROR;
+            }
+            case BINDER_LIB_TEST_WRITE_FILE_TRANSACTION: {
+                int ret;
+                int32_t size;
+                const void *buf;
+                int fd;
+
+                fd = data.readFileDescriptor();
+                if (fd < 0) {
+                    return BAD_VALUE;
+                }
+                ret = data.readInt32(&size);
+                if (ret != NO_ERROR) {
+                    return ret;
+                }
+                buf = data.readInplace(size);
+                if (buf == NULL) {
+                    return BAD_VALUE;
+                }
+                ret = write(fd, buf, size);
+                if (ret != size)
+                    return UNKNOWN_ERROR;
+                return NO_ERROR;
+            }
+            case BINDER_LIB_TEST_PROMOTE_WEAK_REF_TRANSACTION: {
+                int ret;
+                wp<IBinder> weak;
+                sp<IBinder> strong;
+                Parcel data2, reply2;
+                sp<IServiceManager> sm = defaultServiceManager();
+                sp<IBinder> server = sm->getService(binderLibTestServiceName);
+
+                weak = data.readWeakBinder();
+                if (weak == NULL) {
+                    return BAD_VALUE;
+                }
+                strong = weak.promote();
+
+                ret = server->transact(BINDER_LIB_TEST_NOP_TRANSACTION, data2, &reply2);
+                if (ret != NO_ERROR)
+                    exit(EXIT_FAILURE);
+
+                if (strong == NULL) {
+                    reply->setError(1);
+                }
+                return NO_ERROR;
+            }
+            case BINDER_LIB_TEST_DELAYED_EXIT_TRANSACTION:
+                alarm(10);
+                return NO_ERROR;
+            case BINDER_LIB_TEST_EXIT_TRANSACTION:
+                while (wait(NULL) != -1 || errno != ECHILD)
+                    ;
+                exit(EXIT_SUCCESS);
+            default:
+                return UNKNOWN_TRANSACTION;
+            };
+        }
+    private:
+        int32_t m_id;
+        int32_t m_nextServerId;
+        pthread_mutex_t m_serverWaitMutex;
+        pthread_cond_t m_serverWaitCond;
+        bool m_serverStartRequested;
+        sp<IBinder> m_serverStarted;
+        sp<IBinder> m_strongRef;
+};
+
+int run_server(int index, int readypipefd)
+{
+    status_t ret;
+    sp<IServiceManager> sm = defaultServiceManager();
+    {
+        sp<BinderLibTestService> testService = new BinderLibTestService(index);
+        if (index == 0) {
+            ret = sm->addService(binderLibTestServiceName, testService);
+        } else {
+            sp<IBinder> server = sm->getService(binderLibTestServiceName);
+            Parcel data, reply;
+            data.writeInt32(index);
+            data.writeStrongBinder(testService);
+
+            ret = server->transact(BINDER_LIB_TEST_REGISTER_SERVER, data, &reply);
+        }
+    }
+    write(readypipefd, &ret, sizeof(ret));
+    close(readypipefd);
+    //printf("%s: ret %d\n", __func__, ret);
+    if (ret)
+        return 1;
+    //printf("%s: joinThreadPool\n", __func__);
+    ProcessState::self()->startThreadPool();
+    IPCThreadState::self()->joinThreadPool();
+    //printf("%s: joinThreadPool returned\n", __func__);
+    return 1; /* joinThreadPool should not return */
+}
+
+int main(int argc, char **argv) {
+    int ret;
+
+    if (argc == 3 && !strcmp(argv[1], "--servername")) {
+        binderservername = argv[2];
+    } else {
+        binderservername = argv[0];
+    }
+
+    if (argc == 4 && !strcmp(argv[1], binderserverarg)) {
+        return run_server(atoi(argv[2]), atoi(argv[3]));
+    }
+
+    ::testing::InitGoogleTest(&argc, argv);
+    binder_env = AddGlobalTestEnvironment(new BinderLibTestEnv());
+    ProcessState::self()->startThreadPool();
+    return RUN_ALL_TESTS();
+}
+
diff --git a/libs/gui/Android.mk b/libs/gui/Android.mk
index ca94aa3..fffe28a 100644
--- a/libs/gui/Android.mk
+++ b/libs/gui/Android.mk
@@ -1,7 +1,10 @@
-LOCAL_PATH:= $(call my-dir)
+LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
-LOCAL_SRC_FILES:= \
+LOCAL_CLANG := true
+LOCAL_CPPFLAGS := -std=c++11
+
+LOCAL_SRC_FILES := \
 	IGraphicBufferConsumer.cpp \
 	IConsumerListener.cpp \
 	BitTube.cpp \
@@ -47,7 +50,7 @@
 	liblog
 
 
-LOCAL_MODULE:= libgui
+LOCAL_MODULE := libgui
 
 ifeq ($(TARGET_BOARD_PLATFORM), tegra)
 	LOCAL_CFLAGS += -DDONT_USE_FENCE_SYNC
diff --git a/libs/gui/BufferItemConsumer.cpp b/libs/gui/BufferItemConsumer.cpp
index fe50c55..2d976e5 100644
--- a/libs/gui/BufferItemConsumer.cpp
+++ b/libs/gui/BufferItemConsumer.cpp
@@ -21,11 +21,11 @@
 
 #include <gui/BufferItemConsumer.h>
 
-#define BI_LOGV(x, ...) ALOGV("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define BI_LOGD(x, ...) ALOGD("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define BI_LOGI(x, ...) ALOGI("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define BI_LOGW(x, ...) ALOGW("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define BI_LOGE(x, ...) ALOGE("[%s] "x, mName.string(), ##__VA_ARGS__)
+#define BI_LOGV(x, ...) ALOGV("[%s] " x, mName.string(), ##__VA_ARGS__)
+#define BI_LOGD(x, ...) ALOGD("[%s] " x, mName.string(), ##__VA_ARGS__)
+#define BI_LOGI(x, ...) ALOGI("[%s] " x, mName.string(), ##__VA_ARGS__)
+#define BI_LOGW(x, ...) ALOGW("[%s] " x, mName.string(), ##__VA_ARGS__)
+#define BI_LOGE(x, ...) ALOGE("[%s] " x, mName.string(), ##__VA_ARGS__)
 
 namespace android {
 
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp
index 16b9747..bf9c84d 100644
--- a/libs/gui/BufferQueueProducer.cpp
+++ b/libs/gui/BufferQueueProducer.cpp
@@ -807,8 +807,8 @@
             // Set up a death notification so that we can disconnect
             // automatically if the remote producer dies
             if (listener != NULL &&
-                    listener->asBinder()->remoteBinder() != NULL) {
-                status = listener->asBinder()->linkToDeath(
+                    IInterface::asBinder(listener)->remoteBinder() != NULL) {
+                status = IInterface::asBinder(listener)->linkToDeath(
                         static_cast<IBinder::DeathRecipient*>(this));
                 if (status != NO_ERROR) {
                     BQ_LOGE("connect(P): linkToDeath failed: %s (%d)",
@@ -857,7 +857,7 @@
                     // Remove our death notification callback if we have one
                     if (mCore->mConnectedProducerListener != NULL) {
                         sp<IBinder> token =
-                                mCore->mConnectedProducerListener->asBinder();
+                                IInterface::asBinder(mCore->mConnectedProducerListener);
                         // This can fail if we're here because of the death
                         // notification, but we just ignore it
                         token->unlinkToDeath(
diff --git a/libs/gui/ConsumerBase.cpp b/libs/gui/ConsumerBase.cpp
index 210e98e..95f5507 100644
--- a/libs/gui/ConsumerBase.cpp
+++ b/libs/gui/ConsumerBase.cpp
@@ -39,11 +39,11 @@
 #include <utils/Trace.h>
 
 // Macros for including the ConsumerBase name in log messages
-#define CB_LOGV(x, ...) ALOGV("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define CB_LOGD(x, ...) ALOGD("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define CB_LOGI(x, ...) ALOGI("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define CB_LOGW(x, ...) ALOGW("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define CB_LOGE(x, ...) ALOGE("[%s] "x, mName.string(), ##__VA_ARGS__)
+#define CB_LOGV(x, ...) ALOGV("[%s] " x, mName.string(), ##__VA_ARGS__)
+#define CB_LOGD(x, ...) ALOGD("[%s] " x, mName.string(), ##__VA_ARGS__)
+#define CB_LOGI(x, ...) ALOGI("[%s] " x, mName.string(), ##__VA_ARGS__)
+#define CB_LOGW(x, ...) ALOGW("[%s] " x, mName.string(), ##__VA_ARGS__)
+#define CB_LOGE(x, ...) ALOGE("[%s] " x, mName.string(), ##__VA_ARGS__)
 
 namespace android {
 
diff --git a/libs/gui/CpuConsumer.cpp b/libs/gui/CpuConsumer.cpp
index cefd7f1..48c159d 100644
--- a/libs/gui/CpuConsumer.cpp
+++ b/libs/gui/CpuConsumer.cpp
@@ -22,11 +22,11 @@
 #include <utils/Log.h>
 #include <gui/CpuConsumer.h>
 
-#define CC_LOGV(x, ...) ALOGV("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define CC_LOGD(x, ...) ALOGD("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define CC_LOGI(x, ...) ALOGI("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define CC_LOGW(x, ...) ALOGW("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define CC_LOGE(x, ...) ALOGE("[%s] "x, mName.string(), ##__VA_ARGS__)
+#define CC_LOGV(x, ...) ALOGV("[%s] " x, mName.string(), ##__VA_ARGS__)
+#define CC_LOGD(x, ...) ALOGD("[%s] " x, mName.string(), ##__VA_ARGS__)
+#define CC_LOGI(x, ...) ALOGI("[%s] " x, mName.string(), ##__VA_ARGS__)
+#define CC_LOGW(x, ...) ALOGW("[%s] " x, mName.string(), ##__VA_ARGS__)
+#define CC_LOGE(x, ...) ALOGE("[%s] " x, mName.string(), ##__VA_ARGS__)
 
 namespace android {
 
@@ -194,7 +194,6 @@
 status_t CpuConsumer::unlockBuffer(const LockedBuffer &nativeBuffer) {
     Mutex::Autolock _l(mMutex);
     size_t lockedIdx = 0;
-    status_t err;
 
     void *bufPtr = reinterpret_cast<void *>(nativeBuffer.data);
     for (; lockedIdx < mMaxLockedBuffers; lockedIdx++) {
diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp
index 318c087..b886c5b 100644
--- a/libs/gui/GLConsumer.cpp
+++ b/libs/gui/GLConsumer.cpp
@@ -47,11 +47,11 @@
 namespace android {
 
 // Macros for including the GLConsumer name in log messages
-#define ST_LOGV(x, ...) ALOGV("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define ST_LOGD(x, ...) ALOGD("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define ST_LOGI(x, ...) ALOGI("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define ST_LOGW(x, ...) ALOGW("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define ST_LOGE(x, ...) ALOGE("[%s] "x, mName.string(), ##__VA_ARGS__)
+#define ST_LOGV(x, ...) ALOGV("[%s] " x, mName.string(), ##__VA_ARGS__)
+#define ST_LOGD(x, ...) ALOGD("[%s] " x, mName.string(), ##__VA_ARGS__)
+#define ST_LOGI(x, ...) ALOGI("[%s] " x, mName.string(), ##__VA_ARGS__)
+#define ST_LOGW(x, ...) ALOGW("[%s] " x, mName.string(), ##__VA_ARGS__)
+#define ST_LOGE(x, ...) ALOGE("[%s] " x, mName.string(), ##__VA_ARGS__)
 
 static const struct {
     size_t width, height;
diff --git a/libs/gui/IGraphicBufferConsumer.cpp b/libs/gui/IGraphicBufferConsumer.cpp
index f6d087d..cc581a3 100644
--- a/libs/gui/IGraphicBufferConsumer.cpp
+++ b/libs/gui/IGraphicBufferConsumer.cpp
@@ -273,7 +273,7 @@
     virtual status_t consumerConnect(const sp<IConsumerListener>& consumer, bool controlledByApp) {
         Parcel data, reply;
         data.writeInterfaceToken(IGraphicBufferConsumer::getInterfaceDescriptor());
-        data.writeStrongBinder(consumer->asBinder());
+        data.writeStrongBinder(IInterface::asBinder(consumer));
         data.writeInt32(controlledByApp);
         status_t result = remote()->transact(CONSUMER_CONNECT, data, &reply);
         if (result != NO_ERROR) {
diff --git a/libs/gui/IGraphicBufferProducer.cpp b/libs/gui/IGraphicBufferProducer.cpp
index 1e28f9b..bcdf368 100644
--- a/libs/gui/IGraphicBufferProducer.cpp
+++ b/libs/gui/IGraphicBufferProducer.cpp
@@ -211,7 +211,7 @@
         data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
         if (listener != NULL) {
             data.writeInt32(1);
-            data.writeStrongBinder(listener->asBinder());
+            data.writeStrongBinder(IInterface::asBinder(listener));
         } else {
             data.writeInt32(0);
         }
diff --git a/libs/gui/ISensorServer.cpp b/libs/gui/ISensorServer.cpp
index 0b76f37..a8464a2 100644
--- a/libs/gui/ISensorServer.cpp
+++ b/libs/gui/ISensorServer.cpp
@@ -91,7 +91,7 @@
         case CREATE_SENSOR_EVENT_CONNECTION: {
             CHECK_INTERFACE(ISensorServer, data, reply);
             sp<ISensorEventConnection> connection(createSensorEventConnection());
-            reply->writeStrongBinder(connection->asBinder());
+            reply->writeStrongBinder(IInterface::asBinder(connection));
             return NO_ERROR;
         } break;
     }
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp
index ebb687a..00173c7 100644
--- a/libs/gui/ISurfaceComposer.cpp
+++ b/libs/gui/ISurfaceComposer.cpp
@@ -53,7 +53,6 @@
 
     virtual sp<ISurfaceComposerClient> createConnection()
     {
-        uint32_t n;
         Parcel data, reply;
         data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
         remote()->transact(BnSurfaceComposer::CREATE_CONNECTION, data, &reply);
@@ -62,7 +61,6 @@
 
     virtual sp<IGraphicBufferAlloc> createGraphicBufferAlloc()
     {
-        uint32_t n;
         Parcel data, reply;
         data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
         remote()->transact(BnSurfaceComposer::CREATE_GRAPHIC_BUFFER_ALLOC, data, &reply);
@@ -113,7 +111,7 @@
         Parcel data, reply;
         data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
         data.writeStrongBinder(display);
-        data.writeStrongBinder(producer->asBinder());
+        data.writeStrongBinder(IInterface::asBinder(producer));
         data.write(sourceCrop);
         data.writeInt32(reqWidth);
         data.writeInt32(reqHeight);
@@ -137,7 +135,7 @@
                     "interface descriptor: %s (%d)", strerror(-err), -err);
             return false;
         }
-        err = data.writeStrongBinder(bufferProducer->asBinder());
+        err = data.writeStrongBinder(IInterface::asBinder(bufferProducer));
         if (err != NO_ERROR) {
             ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing "
                     "strong binder to parcel: %s (%d)", strerror(-err), -err);
@@ -299,13 +297,13 @@
     switch(code) {
         case CREATE_CONNECTION: {
             CHECK_INTERFACE(ISurfaceComposer, data, reply);
-            sp<IBinder> b = createConnection()->asBinder();
+            sp<IBinder> b = IInterface::asBinder(createConnection());
             reply->writeStrongBinder(b);
             return NO_ERROR;
         }
         case CREATE_GRAPHIC_BUFFER_ALLOC: {
             CHECK_INTERFACE(ISurfaceComposer, data, reply);
-            sp<IBinder> b = createGraphicBufferAlloc()->asBinder();
+            sp<IBinder> b = IInterface::asBinder(createGraphicBufferAlloc());
             reply->writeStrongBinder(b);
             return NO_ERROR;
         }
@@ -378,7 +376,7 @@
         case CREATE_DISPLAY_EVENT_CONNECTION: {
             CHECK_INTERFACE(ISurfaceComposer, data, reply);
             sp<IDisplayEventConnection> connection(createDisplayEventConnection());
-            reply->writeStrongBinder(connection->asBinder());
+            reply->writeStrongBinder(IInterface::asBinder(connection));
             return NO_ERROR;
         }
         case CREATE_DISPLAY: {
diff --git a/libs/gui/ISurfaceComposerClient.cpp b/libs/gui/ISurfaceComposerClient.cpp
index 3da6423..de4d8c1 100644
--- a/libs/gui/ISurfaceComposerClient.cpp
+++ b/libs/gui/ISurfaceComposerClient.cpp
@@ -114,7 +114,7 @@
             status_t result = createSurface(name, w, h, format, flags,
                     &handle, &gbp);
             reply->writeStrongBinder(handle);
-            reply->writeStrongBinder(gbp->asBinder());
+            reply->writeStrongBinder(IInterface::asBinder(gbp));
             reply->writeInt32(result);
             return NO_ERROR;
         } break;
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index 1183d59..ccf8b78 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -67,7 +67,7 @@
 }
 
 status_t ComposerState::write(Parcel& output) const {
-    output.writeStrongBinder(client->asBinder());
+    output.writeStrongBinder(IInterface::asBinder(client));
     return state.write(output);
 }
 
@@ -79,7 +79,7 @@
 
 status_t DisplayState::write(Parcel& output) const {
     output.writeStrongBinder(token);
-    output.writeStrongBinder(surface->asBinder());
+    output.writeStrongBinder(IInterface::asBinder(surface));
     output.writeInt32(what);
     output.writeInt32(layerStack);
     output.writeInt32(orientation);
diff --git a/libs/gui/SensorEventQueue.cpp b/libs/gui/SensorEventQueue.cpp
index 1305e9f..6f5f204 100644
--- a/libs/gui/SensorEventQueue.cpp
+++ b/libs/gui/SensorEventQueue.cpp
@@ -157,7 +157,7 @@
         ssize_t size = ::send(mSensorChannel->getFd(), &mNumAcksToSend, sizeof(mNumAcksToSend),
                 MSG_DONTWAIT | MSG_NOSIGNAL);
         if (size < 0) {
-            ALOGE("sendAck failure %d %d", size, mNumAcksToSend);
+            ALOGE("sendAck failure %zd %d", size, mNumAcksToSend);
         } else {
             mNumAcksToSend = 0;
         }
diff --git a/libs/gui/SensorManager.cpp b/libs/gui/SensorManager.cpp
index 7b4fa2f..17960ff 100644
--- a/libs/gui/SensorManager.cpp
+++ b/libs/gui/SensorManager.cpp
@@ -86,7 +86,7 @@
         };
 
         mDeathObserver = new DeathObserver(*const_cast<SensorManager *>(this));
-        mSensorServer->asBinder()->linkToDeath(mDeathObserver);
+        IInterface::asBinder(mSensorServer)->linkToDeath(mDeathObserver);
 
         mSensors = mSensorServer->getSensorList();
         size_t count = mSensors.size();
diff --git a/libs/gui/StreamSplitter.cpp b/libs/gui/StreamSplitter.cpp
index 5f39905..25e6cab 100644
--- a/libs/gui/StreamSplitter.cpp
+++ b/libs/gui/StreamSplitter.cpp
@@ -80,7 +80,7 @@
 
     IGraphicBufferProducer::QueueBufferOutput queueBufferOutput;
     sp<OutputListener> listener(new OutputListener(this, outputQueue));
-    outputQueue->asBinder()->linkToDeath(listener);
+    IInterface::asBinder(outputQueue)->linkToDeath(listener);
     status_t status = outputQueue->connect(listener, NATIVE_WINDOW_API_CPU,
             /* producerControlledByApp */ false, &queueBufferOutput);
     if (status != NO_ERROR) {
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index 0e2baa2..ab984de 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -96,8 +96,8 @@
 void Surface::allocateBuffers() {
     uint32_t reqWidth = mReqWidth ? mReqWidth : mUserWidth;
     uint32_t reqHeight = mReqHeight ? mReqHeight : mUserHeight;
-    mGraphicBufferProducer->allocateBuffers(mSwapIntervalZero, mReqWidth,
-            mReqHeight, mReqFormat, mReqUsage);
+    mGraphicBufferProducer->allocateBuffers(mSwapIntervalZero, reqWidth,
+            reqHeight, mReqFormat, mReqUsage);
 }
 
 int Surface::hook_setSwapInterval(ANativeWindow* window, int interval) {
@@ -274,7 +274,6 @@
 
 int Surface::getSlotFromBufferLocked(
         android_native_buffer_t* buffer) const {
-    bool dumpedState = false;
     for (int i = 0; i < NUM_BUFFER_SLOTS; i++) {
         if (mSlots[i].buffer != NULL &&
                 mSlots[i].buffer->handle == buffer->handle) {
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 6446926..1be7895 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -71,7 +71,7 @@
     };
 
     mDeathObserver = new DeathObserver(*const_cast<ComposerService*>(this));
-    mComposerService->asBinder()->linkToDeath(mDeathObserver);
+    IInterface::asBinder(mComposerService)->linkToDeath(mDeathObserver);
 }
 
 /*static*/ sp<ISurfaceComposer> ComposerService::getComposerService() {
@@ -462,14 +462,14 @@
 }
 
 sp<IBinder> SurfaceComposerClient::connection() const {
-    return (mClient != 0) ? mClient->asBinder() : 0;
+    return IInterface::asBinder(mClient);
 }
 
 status_t SurfaceComposerClient::linkToComposerDeath(
         const sp<IBinder::DeathRecipient>& recipient,
         void* cookie, uint32_t flags) {
     sp<ISurfaceComposer> sm(ComposerService::getComposerService());
-    return sm->asBinder()->linkToDeath(recipient, cookie, flags);
+    return IInterface::asBinder(sm)->linkToDeath(recipient, cookie, flags);
 }
 
 void SurfaceComposerClient::dispose() {
@@ -752,14 +752,14 @@
 
 status_t ScreenshotClient::update(const sp<IBinder>& display, Rect sourceCrop,
         bool useIdentityTransform) {
-    return ScreenshotClient::update(display, sourceCrop, 0, 0, 0, -1UL,
+    return ScreenshotClient::update(display, sourceCrop, 0, 0, 0, -1U,
             useIdentityTransform, ISurfaceComposer::eRotateNone);
 }
 
 status_t ScreenshotClient::update(const sp<IBinder>& display, Rect sourceCrop,
         uint32_t reqWidth, uint32_t reqHeight, bool useIdentityTransform) {
     return ScreenshotClient::update(display, sourceCrop, reqWidth, reqHeight,
-            0, -1UL, useIdentityTransform, ISurfaceComposer::eRotateNone);
+            0, -1U, useIdentityTransform, ISurfaceComposer::eRotateNone);
 }
 
 void ScreenshotClient::release() {
diff --git a/libs/gui/SurfaceControl.cpp b/libs/gui/SurfaceControl.cpp
index 7597c99..61011b9 100644
--- a/libs/gui/SurfaceControl.cpp
+++ b/libs/gui/SurfaceControl.cpp
@@ -176,7 +176,7 @@
     if (control != NULL) {
         bp = control->mGraphicBufferProducer;
     }
-    return parcel->writeStrongBinder(bp->asBinder());
+    return parcel->writeStrongBinder(IInterface::asBinder(bp));
 }
 
 sp<Surface> SurfaceControl::getSurface() const
diff --git a/libs/gui/tests/Android.mk b/libs/gui/tests/Android.mk
index e460290..128a32a 100644
--- a/libs/gui/tests/Android.mk
+++ b/libs/gui/tests/Android.mk
@@ -1,6 +1,7 @@
 # Build the unit tests,
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 
 LOCAL_MODULE := libgui_test
 
@@ -31,17 +32,10 @@
 	libbinder \
 	libcutils \
 	libgui \
-	libstlport \
 	libsync \
 	libui \
 	libutils \
 
-LOCAL_C_INCLUDES := \
-    bionic \
-    bionic/libstdc++/include \
-    external/gtest/include \
-    external/stlport/stlport \
-
 # Build the binary to $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)
 # to integrate with auto-test framework.
 include $(BUILD_NATIVE_TEST)
diff --git a/libs/gui/tests/BufferQueue_test.cpp b/libs/gui/tests/BufferQueue_test.cpp
index 96de11f..838ad90 100644
--- a/libs/gui/tests/BufferQueue_test.cpp
+++ b/libs/gui/tests/BufferQueue_test.cpp
@@ -87,8 +87,8 @@
         sp<IGraphicBufferConsumer> consumer;
         BufferQueue::createBufferQueue(&producer, &consumer);
         sp<IServiceManager> serviceManager = defaultServiceManager();
-        serviceManager->addService(PRODUCER_NAME, producer->asBinder());
-        serviceManager->addService(CONSUMER_NAME, consumer->asBinder());
+        serviceManager->addService(PRODUCER_NAME, IInterface::asBinder(producer));
+        serviceManager->addService(CONSUMER_NAME, IInterface::asBinder(consumer));
         ProcessState::self()->startThreadPool();
         IPCThreadState::self()->joinThreadPool();
         LOG_ALWAYS_FATAL("Shouldn't be here");
diff --git a/libs/gui/tests/SRGB_test.cpp b/libs/gui/tests/SRGB_test.cpp
index 2d5b8aa..da2add7 100644
--- a/libs/gui/tests/SRGB_test.cpp
+++ b/libs/gui/tests/SRGB_test.cpp
@@ -19,6 +19,8 @@
 
 #include "GLTest.h"
 
+#include <math.h>
+
 #include <gui/CpuConsumer.h>
 #include <gui/Surface.h>
 #include <gui/SurfaceComposerClient.h>
diff --git a/libs/input/tests/Android.mk b/libs/input/tests/Android.mk
index 9612a65..5bfa3d4 100644
--- a/libs/input/tests/Android.mk
+++ b/libs/input/tests/Android.mk
@@ -1,6 +1,5 @@
 # Build the unit tests.
 LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
 
 # Build the unit tests.
 test_src_files := \
@@ -14,14 +13,10 @@
     libutils \
     libbinder \
     libui \
-    libstlport
-
-static_libraries := \
-    libgtest \
-    libgtest_main
 
 $(foreach file,$(test_src_files), \
     $(eval include $(CLEAR_VARS)) \
+    $(eval LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk) \
     $(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \
     $(eval LOCAL_STATIC_LIBRARIES := $(static_libraries)) \
     $(eval LOCAL_SRC_FILES := $(file)) \
@@ -33,6 +28,7 @@
 # run. All assertions are static_asserts and will fail during
 # buildtime if something's wrong.
 include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 LOCAL_SRC_FILES := StructLayout_test.cpp
 LOCAL_MODULE := StructLayout_test
 LOCAL_CFLAGS := -std=c++11 -O0
diff --git a/libs/ui/Android.mk b/libs/ui/Android.mk
index eec97be..1ce8626 100644
--- a/libs/ui/Android.mk
+++ b/libs/ui/Android.mk
@@ -12,10 +12,28 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-LOCAL_PATH:= $(call my-dir)
+LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
-LOCAL_SRC_FILES:= \
+LOCAL_CLANG := true
+LOCAL_CPPFLAGS := -std=c++1y -Weverything -Werror
+
+# The static constructors and destructors in this library have not been noted to
+# introduce significant overheads
+LOCAL_CPPFLAGS += -Wno-exit-time-destructors
+LOCAL_CPPFLAGS += -Wno-global-constructors
+
+# We only care about compiling as C++14
+LOCAL_CPPFLAGS += -Wno-c++98-compat-pedantic
+
+# We use four-character constants for the GraphicBuffer header, and don't care
+# that they're non-portable as long as they're consistent within one execution
+LOCAL_CPPFLAGS += -Wno-four-char-constants
+
+# Don't warn about struct padding
+LOCAL_CPPFLAGS += -Wno-padded
+
+LOCAL_SRC_FILES := \
 	Fence.cpp \
 	FramebufferNativeWindow.cpp \
 	FrameStats.cpp \
@@ -38,7 +56,7 @@
 LOCAL_CFLAGS += -DFRAMEBUFFER_FORCE_FORMAT=$(BOARD_FRAMEBUFFER_FORCE_FORMAT)
 endif
 
-LOCAL_MODULE:= libui
+LOCAL_MODULE := libui
 
 include $(BUILD_SHARED_LIBRARY)
 
diff --git a/libs/ui/Fence.cpp b/libs/ui/Fence.cpp
index 3c0306c..9cf2881 100644
--- a/libs/ui/Fence.cpp
+++ b/libs/ui/Fence.cpp
@@ -18,10 +18,13 @@
 #define ATRACE_TAG ATRACE_TAG_GRAPHICS
 //#define LOG_NDEBUG 0
 
- // This is needed for stdint.h to define INT64_MAX in C++
- #define __STDC_LIMIT_MACROS
-
+// We would eliminate the non-conforming zero-length array, but we can't since
+// this is effectively included from the Linux kernel
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wzero-length-array"
 #include <sync/sync.h>
+#pragma clang diagnostic pop
+
 #include <ui/Fence.h>
 #include <unistd.h>
 #include <utils/Log.h>
@@ -45,7 +48,7 @@
     }
 }
 
-status_t Fence::wait(unsigned int timeout) {
+status_t Fence::wait(int timeout) {
     ATRACE_CALL();
     if (mFenceFd == -1) {
         return NO_ERROR;
@@ -59,7 +62,7 @@
     if (mFenceFd == -1) {
         return NO_ERROR;
     }
-    unsigned int warningTimeout = 3000;
+    int warningTimeout = 3000;
     int err = sync_wait(mFenceFd, warningTimeout);
     if (err < 0 && errno == ETIME) {
         ALOGE("%s: fence %d didn't signal in %u ms", logname, mFenceFd,
@@ -138,7 +141,7 @@
     if (size < getFlattenedSize() || count < getFdCount()) {
         return NO_MEMORY;
     }
-    FlattenableUtils::write(buffer, size, (uint32_t)getFdCount());
+    FlattenableUtils::write(buffer, size, getFdCount());
     if (isValid()) {
         *fds++ = mFenceFd;
         count--;
diff --git a/libs/ui/FramebufferNativeWindow.cpp b/libs/ui/FramebufferNativeWindow.cpp
index 918f2e7..3ead25c 100644
--- a/libs/ui/FramebufferNativeWindow.cpp
+++ b/libs/ui/FramebufferNativeWindow.cpp
@@ -1,17 +1,17 @@
-/* 
+/*
 **
 ** Copyright 2007 The Android Open Source Project
 **
-** Licensed under the Apache License Version 2.0(the "License"); 
-** you may not use this file except in compliance with the License. 
-** You may obtain a copy of the License at 
+** Licensed under the Apache License Version 2.0(the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
 **
-**     http://www.apache.org/licenses/LICENSE-2.0 
+**     http://www.apache.org/licenses/LICENSE-2.0
 **
-** Unless required by applicable law or agreed to in writing software 
-** distributed under the License is distributed on an "AS IS" BASIS 
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied. 
-** See the License for the specific language governing permissions and 
+** Unless required by applicable law or agreed to in writing software
+** distributed under the License is distributed on an "AS IS" BASIS
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
+** See the License for the specific language governing permissions and
 ** limitations under the License.
 */
 
@@ -29,7 +29,9 @@
 
 #include <ui/ANativeObjectBase.h>
 #include <ui/Fence.h>
+#define INCLUDED_FROM_FRAMEBUFFER_NATIVE_WINDOW_CPP
 #include <ui/FramebufferNativeWindow.h>
+#undef INCLUDED_FROM_FRAMEBUFFER_NATIVE_WINDOW_CPP
 #include <ui/Rect.h>
 
 #include <EGL/egl.h>
@@ -41,11 +43,11 @@
 namespace android {
 // ----------------------------------------------------------------------------
 
-class NativeBuffer 
+class NativeBuffer final
     : public ANativeObjectBase<
-        ANativeWindowBuffer, 
-        NativeBuffer, 
-        LightRefBase<NativeBuffer> >
+        ANativeWindowBuffer,
+        NativeBuffer,
+        LightRefBase<NativeBuffer>>
 {
 public:
     NativeBuffer(int w, int h, int f, int u) : BASE() {
@@ -55,43 +57,41 @@
         ANativeWindowBuffer::usage  = u;
     }
 private:
-    friend class LightRefBase<NativeBuffer>;    
-    ~NativeBuffer() { }; // this class cannot be overloaded
+    friend class LightRefBase<NativeBuffer>;
 };
 
 
 /*
  * This implements the (main) framebuffer management. This class is used
  * mostly by SurfaceFlinger, but also by command line GL application.
- * 
+ *
  * In fact this is an implementation of ANativeWindow on top of
  * the framebuffer.
- * 
- * Currently it is pretty simple, it manages only two buffers (the front and 
+ *
+ * Currently it is pretty simple, it manages only two buffers (the front and
  * back buffer).
- * 
+ *
  */
 
-FramebufferNativeWindow::FramebufferNativeWindow() 
+FramebufferNativeWindow::FramebufferNativeWindow()
     : BASE(), fbDev(0), grDev(0), mUpdateOnDemand(false)
 {
     hw_module_t const* module;
     if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module) == 0) {
-        int stride;
         int err;
         int i;
         err = framebuffer_open(module, &fbDev);
         ALOGE_IF(err, "couldn't open framebuffer HAL (%s)", strerror(-err));
-        
+
         err = gralloc_open(module, &grDev);
         ALOGE_IF(err, "couldn't open gralloc HAL (%s)", strerror(-err));
 
         // bail out if we can't initialize the modules
         if (!fbDev || !grDev)
             return;
-        
+
         mUpdateOnDemand = (fbDev->setUpdateRect != 0);
-        
+
         // initialize the buffer FIFO
         if(fbDev->numFramebuffers >= MIN_NUM_FRAME_BUFFERS &&
            fbDev->numFramebuffers <= MAX_NUM_FRAME_BUFFERS){
@@ -114,36 +114,37 @@
         *((uint32_t *)&fbDev->format) = FRAMEBUFFER_FORCE_FORMAT;
 #endif
 
-        for (i = 0; i < mNumBuffers; i++)
-        {
-                buffers[i] = new NativeBuffer(
-                        fbDev->width, fbDev->height, fbDev->format, GRALLOC_USAGE_HW_FB);
+        for (i = 0; i < mNumBuffers; i++) {
+            buffers[i] = new NativeBuffer(
+                    static_cast<int>(fbDev->width),
+                    static_cast<int>(fbDev->height),
+                    fbDev->format, GRALLOC_USAGE_HW_FB);
         }
 
-        for (i = 0; i < mNumBuffers; i++)
-        {
-                err = grDev->alloc(grDev,
-                        fbDev->width, fbDev->height, fbDev->format,
-                        GRALLOC_USAGE_HW_FB, &buffers[i]->handle, &buffers[i]->stride);
+        for (i = 0; i < mNumBuffers; i++) {
+            err = grDev->alloc(grDev,
+                    static_cast<int>(fbDev->width),
+                    static_cast<int>(fbDev->height),
+                    fbDev->format, GRALLOC_USAGE_HW_FB,
+                    &buffers[i]->handle, &buffers[i]->stride);
 
-                ALOGE_IF(err, "fb buffer %d allocation failed w=%d, h=%d, err=%s",
-                        i, fbDev->width, fbDev->height, strerror(-err));
+            ALOGE_IF(err, "fb buffer %d allocation failed w=%d, h=%d, err=%s",
+                    i, fbDev->width, fbDev->height, strerror(-err));
 
-                if (err)
-                {
-                        mNumBuffers = i;
-                        mNumFreeBuffers = i;
-                        mBufferHead = mNumBuffers-1;
-                        break;
-                }
+            if (err) {
+                mNumBuffers = i;
+                mNumFreeBuffers = i;
+                mBufferHead = mNumBuffers-1;
+                break;
+            }
         }
 
-        const_cast<uint32_t&>(ANativeWindow::flags) = fbDev->flags; 
+        const_cast<uint32_t&>(ANativeWindow::flags) = fbDev->flags;
         const_cast<float&>(ANativeWindow::xdpi) = fbDev->xdpi;
         const_cast<float&>(ANativeWindow::ydpi) = fbDev->ydpi;
-        const_cast<int&>(ANativeWindow::minSwapInterval) = 
+        const_cast<int&>(ANativeWindow::minSwapInterval) =
             fbDev->minSwapInterval;
-        const_cast<int&>(ANativeWindow::maxSwapInterval) = 
+        const_cast<int&>(ANativeWindow::maxSwapInterval) =
             fbDev->maxSwapInterval;
     } else {
         ALOGE("Couldn't get gralloc module");
@@ -160,7 +161,7 @@
     ANativeWindow::queueBuffer_DEPRECATED = queueBuffer_DEPRECATED;
 }
 
-FramebufferNativeWindow::~FramebufferNativeWindow() 
+FramebufferNativeWindow::~FramebufferNativeWindow()
 {
     if (grDev) {
         for(int i = 0; i < mNumBuffers; i++) {
@@ -176,7 +177,7 @@
     }
 }
 
-status_t FramebufferNativeWindow::setUpdateRectangle(const Rect& r) 
+status_t FramebufferNativeWindow::setUpdateRectangle(const Rect& r)
 {
     if (!mUpdateOnDemand) {
         return INVALID_OPERATION;
@@ -193,7 +194,7 @@
 }
 
 int FramebufferNativeWindow::setSwapInterval(
-        ANativeWindow* window, int interval) 
+        ANativeWindow* window, int interval)
 {
     framebuffer_device_t* fb = getSelf(window)->fbDev;
     return fb->setSwapInterval(fb, interval);
@@ -217,7 +218,7 @@
     return index;
 }
 
-int FramebufferNativeWindow::dequeueBuffer_DEPRECATED(ANativeWindow* window, 
+int FramebufferNativeWindow::dequeueBuffer_DEPRECATED(ANativeWindow* window,
         ANativeWindowBuffer** buffer)
 {
     int fenceFd = -1;
@@ -232,12 +233,11 @@
     return result;
 }
 
-int FramebufferNativeWindow::dequeueBuffer(ANativeWindow* window, 
+int FramebufferNativeWindow::dequeueBuffer(ANativeWindow* window,
         ANativeWindowBuffer** buffer, int* fenceFd)
 {
     FramebufferNativeWindow* self = getSelf(window);
     Mutex::Autolock _l(self->mutex);
-    framebuffer_device_t* fb = self->fbDev;
 
     int index = self->mBufferHead++;
     if (self->mBufferHead >= self->mNumBuffers)
@@ -247,7 +247,7 @@
     while (self->mNumFreeBuffers < 2) {
         self->mCondition.wait(self->mutex);
     }
-    ALOG_ASSERT(self->buffers[index] != self->front);
+    ALOG_ASSERT(self->buffers[index] != self->front, "");
 
     // get this buffer
     self->mNumFreeBuffers--;
@@ -259,19 +259,19 @@
     return 0;
 }
 
-int FramebufferNativeWindow::lockBuffer_DEPRECATED(ANativeWindow* /*window*/, 
+int FramebufferNativeWindow::lockBuffer_DEPRECATED(ANativeWindow* /*window*/,
         ANativeWindowBuffer* /*buffer*/)
 {
     return NO_ERROR;
 }
 
-int FramebufferNativeWindow::queueBuffer_DEPRECATED(ANativeWindow* window, 
+int FramebufferNativeWindow::queueBuffer_DEPRECATED(ANativeWindow* window,
         ANativeWindowBuffer* buffer)
 {
     return queueBuffer(window, buffer, -1);
 }
 
-int FramebufferNativeWindow::queueBuffer(ANativeWindow* window, 
+int FramebufferNativeWindow::queueBuffer(ANativeWindow* window,
         ANativeWindowBuffer* buffer, int fenceFd)
 {
     FramebufferNativeWindow* self = getSelf(window);
@@ -282,7 +282,6 @@
     sp<Fence> fence(new Fence(fenceFd));
     fence->wait(Fence::TIMEOUT_NEVER);
 
-    const int index = self->mCurrentBufferIndex;
     int res = fb->post(fb, handle);
     self->front = static_cast<NativeBuffer*>(buffer);
     self->mNumFreeBuffers++;
@@ -291,17 +290,17 @@
 }
 
 int FramebufferNativeWindow::query(const ANativeWindow* window,
-        int what, int* value) 
+        int what, int* value)
 {
     const FramebufferNativeWindow* self = getSelf(window);
     Mutex::Autolock _l(self->mutex);
     framebuffer_device_t* fb = self->fbDev;
     switch (what) {
         case NATIVE_WINDOW_WIDTH:
-            *value = fb->width;
+            *value = static_cast<int>(fb->width);
             return NO_ERROR;
         case NATIVE_WINDOW_HEIGHT:
-            *value = fb->height;
+            *value = static_cast<int>(fb->height);
             return NO_ERROR;
         case NATIVE_WINDOW_FORMAT:
             *value = fb->format;
@@ -313,10 +312,10 @@
             *value = 0;
             return NO_ERROR;
         case NATIVE_WINDOW_DEFAULT_WIDTH:
-            *value = fb->width;
+            *value = static_cast<int>(fb->width);
             return NO_ERROR;
         case NATIVE_WINDOW_DEFAULT_HEIGHT:
-            *value = fb->height;
+            *value = static_cast<int>(fb->height);
             return NO_ERROR;
         case NATIVE_WINDOW_TRANSFORM_HINT:
             *value = 0;
@@ -357,7 +356,8 @@
 }; // namespace android
 // ----------------------------------------------------------------------------
 
-using namespace android;
+using android::sp;
+using android::FramebufferNativeWindow;
 
 EGLNativeWindowType android_createDisplaySurface(void)
 {
@@ -368,5 +368,5 @@
         sp<FramebufferNativeWindow> ref(w);
         return NULL;
     }
-    return (EGLNativeWindowType)w;
+    return static_cast<EGLNativeWindowType>(w);
 }
diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp
index e768f13..425df38 100644
--- a/libs/ui/GraphicBuffer.cpp
+++ b/libs/ui/GraphicBuffer.cpp
@@ -45,40 +45,40 @@
     : BASE(), mOwner(ownData), mBufferMapper(GraphicBufferMapper::get()),
       mInitCheck(NO_ERROR), mId(getUniqueId())
 {
-    width  = 
-    height = 
-    stride = 
-    format = 
+    width  =
+    height =
+    stride =
+    format =
     usage  = 0;
     handle = NULL;
 }
 
-GraphicBuffer::GraphicBuffer(uint32_t w, uint32_t h, 
-        PixelFormat reqFormat, uint32_t reqUsage)
+GraphicBuffer::GraphicBuffer(uint32_t inWidth, uint32_t inHeight,
+        PixelFormat inFormat, uint32_t inUsage)
     : BASE(), mOwner(ownData), mBufferMapper(GraphicBufferMapper::get()),
       mInitCheck(NO_ERROR), mId(getUniqueId())
 {
-    width  = 
-    height = 
-    stride = 
-    format = 
+    width  =
+    height =
+    stride =
+    format =
     usage  = 0;
     handle = NULL;
-    mInitCheck = initSize(w, h, reqFormat, reqUsage);
+    mInitCheck = initSize(inWidth, inHeight, inFormat, inUsage);
 }
 
-GraphicBuffer::GraphicBuffer(uint32_t w, uint32_t h,
-        PixelFormat inFormat, uint32_t inUsage,
-        uint32_t inStride, native_handle_t* inHandle, bool keepOwnership)
+GraphicBuffer::GraphicBuffer(uint32_t inWidth, uint32_t inHeight,
+        PixelFormat inFormat, uint32_t inUsage, uint32_t inStride,
+        native_handle_t* inHandle, bool keepOwnership)
     : BASE(), mOwner(keepOwnership ? ownHandle : ownNone),
       mBufferMapper(GraphicBufferMapper::get()),
       mInitCheck(NO_ERROR), mId(getUniqueId())
 {
-    width  = w;
-    height = h;
-    stride = inStride;
+    width  = static_cast<int>(inWidth);
+    height = static_cast<int>(inHeight);
+    stride = static_cast<int>(inStride);
     format = inFormat;
-    usage  = inUsage;
+    usage  = static_cast<int>(inUsage);
     handle = inHandle;
 }
 
@@ -116,7 +116,7 @@
 }
 
 status_t GraphicBuffer::initCheck() const {
-    return mInitCheck;
+    return static_cast<status_t>(mInitCheck);
 }
 
 void GraphicBuffer::dumpAllocationsToSystemLog()
@@ -131,13 +131,17 @@
             const_cast<GraphicBuffer*>(this));
 }
 
-status_t GraphicBuffer::reallocate(uint32_t w, uint32_t h, PixelFormat f,
-        uint32_t reqUsage)
+status_t GraphicBuffer::reallocate(uint32_t inWidth, uint32_t inHeight,
+        PixelFormat inFormat, uint32_t inUsage)
 {
     if (mOwner != ownData)
         return INVALID_OPERATION;
 
-    if (handle && w==width && h==height && f==format && reqUsage==usage)
+    if (handle &&
+            static_cast<int>(inWidth) == width &&
+            static_cast<int>(inHeight) == height &&
+            inFormat == format &&
+            static_cast<int>(inUsage) == usage)
         return NO_ERROR;
 
     if (handle) {
@@ -145,61 +149,64 @@
         allocator.free(handle);
         handle = 0;
     }
-    return initSize(w, h, f, reqUsage);
+    return initSize(inWidth, inHeight, inFormat, inUsage);
 }
 
-status_t GraphicBuffer::initSize(uint32_t w, uint32_t h, PixelFormat format,
-        uint32_t reqUsage)
+status_t GraphicBuffer::initSize(uint32_t inWidth, uint32_t inHeight,
+        PixelFormat inFormat, uint32_t inUsage)
 {
     GraphicBufferAllocator& allocator = GraphicBufferAllocator::get();
-    status_t err = allocator.alloc(w, h, format, reqUsage, &handle, &stride);
+    uint32_t outStride = 0;
+    status_t err = allocator.alloc(inWidth, inHeight, inFormat, inUsage,
+            &handle, &outStride);
     if (err == NO_ERROR) {
-        this->width  = w;
-        this->height = h;
-        this->format = format;
-        this->usage  = reqUsage;
+        width = static_cast<int>(inWidth);
+        height = static_cast<int>(inHeight);
+        format = inFormat;
+        usage = static_cast<int>(inUsage);
+        stride = static_cast<int>(outStride);
     }
     return err;
 }
 
-status_t GraphicBuffer::lock(uint32_t usage, void** vaddr)
+status_t GraphicBuffer::lock(uint32_t inUsage, void** vaddr)
 {
     const Rect lockBounds(width, height);
-    status_t res = lock(usage, lockBounds, vaddr);
+    status_t res = lock(inUsage, lockBounds, vaddr);
     return res;
 }
 
-status_t GraphicBuffer::lock(uint32_t usage, const Rect& rect, void** vaddr)
+status_t GraphicBuffer::lock(uint32_t inUsage, const Rect& rect, void** vaddr)
 {
-    if (rect.left < 0 || rect.right  > this->width || 
-        rect.top  < 0 || rect.bottom > this->height) {
-        ALOGE("locking pixels (%d,%d,%d,%d) outside of buffer (w=%d, h=%d)",
-                rect.left, rect.top, rect.right, rect.bottom, 
-                this->width, this->height);
-        return BAD_VALUE;
-    }
-    status_t res = getBufferMapper().lock(handle, usage, rect, vaddr);
-    return res;
-}
-
-status_t GraphicBuffer::lockYCbCr(uint32_t usage, android_ycbcr *ycbcr)
-{
-    const Rect lockBounds(width, height);
-    status_t res = lockYCbCr(usage, lockBounds, ycbcr);
-    return res;
-}
-
-status_t GraphicBuffer::lockYCbCr(uint32_t usage, const Rect& rect,
-        android_ycbcr *ycbcr)
-{
-    if (rect.left < 0 || rect.right  > this->width ||
-        rect.top  < 0 || rect.bottom > this->height) {
+    if (rect.left < 0 || rect.right  > width ||
+        rect.top  < 0 || rect.bottom > height) {
         ALOGE("locking pixels (%d,%d,%d,%d) outside of buffer (w=%d, h=%d)",
                 rect.left, rect.top, rect.right, rect.bottom,
-                this->width, this->height);
+                width, height);
         return BAD_VALUE;
     }
-    status_t res = getBufferMapper().lockYCbCr(handle, usage, rect, ycbcr);
+    status_t res = getBufferMapper().lock(handle, inUsage, rect, vaddr);
+    return res;
+}
+
+status_t GraphicBuffer::lockYCbCr(uint32_t inUsage, android_ycbcr* ycbcr)
+{
+    const Rect lockBounds(width, height);
+    status_t res = lockYCbCr(inUsage, lockBounds, ycbcr);
+    return res;
+}
+
+status_t GraphicBuffer::lockYCbCr(uint32_t inUsage, const Rect& rect,
+        android_ycbcr* ycbcr)
+{
+    if (rect.left < 0 || rect.right  > width ||
+        rect.top  < 0 || rect.bottom > height) {
+        ALOGE("locking pixels (%d,%d,%d,%d) outside of buffer (w=%d, h=%d)",
+                rect.left, rect.top, rect.right, rect.bottom,
+                width, height);
+        return BAD_VALUE;
+    }
+    status_t res = getBufferMapper().lockYCbCr(handle, inUsage, rect, ycbcr);
     return res;
 }
 
@@ -209,43 +216,48 @@
     return res;
 }
 
-status_t GraphicBuffer::lockAsync(uint32_t usage, void** vaddr, int fenceFd)
+status_t GraphicBuffer::lockAsync(uint32_t inUsage, void** vaddr, int fenceFd)
 {
     const Rect lockBounds(width, height);
-    status_t res = lockAsync(usage, lockBounds, vaddr, fenceFd);
+    status_t res = lockAsync(inUsage, lockBounds, vaddr, fenceFd);
     return res;
 }
 
-status_t GraphicBuffer::lockAsync(uint32_t usage, const Rect& rect, void** vaddr, int fenceFd)
+status_t GraphicBuffer::lockAsync(uint32_t inUsage, const Rect& rect,
+        void** vaddr, int fenceFd)
 {
-    if (rect.left < 0 || rect.right  > this->width ||
-        rect.top  < 0 || rect.bottom > this->height) {
+    if (rect.left < 0 || rect.right  > width ||
+        rect.top  < 0 || rect.bottom > height) {
         ALOGE("locking pixels (%d,%d,%d,%d) outside of buffer (w=%d, h=%d)",
                 rect.left, rect.top, rect.right, rect.bottom,
-                this->width, this->height);
+                width, height);
         return BAD_VALUE;
     }
-    status_t res = getBufferMapper().lockAsync(handle, usage, rect, vaddr, fenceFd);
+    status_t res = getBufferMapper().lockAsync(handle, inUsage, rect, vaddr,
+            fenceFd);
     return res;
 }
 
-status_t GraphicBuffer::lockAsyncYCbCr(uint32_t usage, android_ycbcr *ycbcr, int fenceFd)
+status_t GraphicBuffer::lockAsyncYCbCr(uint32_t inUsage, android_ycbcr* ycbcr,
+        int fenceFd)
 {
     const Rect lockBounds(width, height);
-    status_t res = lockAsyncYCbCr(usage, lockBounds, ycbcr, fenceFd);
+    status_t res = lockAsyncYCbCr(inUsage, lockBounds, ycbcr, fenceFd);
     return res;
 }
 
-status_t GraphicBuffer::lockAsyncYCbCr(uint32_t usage, const Rect& rect, android_ycbcr *ycbcr, int fenceFd)
+status_t GraphicBuffer::lockAsyncYCbCr(uint32_t inUsage, const Rect& rect,
+        android_ycbcr* ycbcr, int fenceFd)
 {
-    if (rect.left < 0 || rect.right  > this->width ||
-        rect.top  < 0 || rect.bottom > this->height) {
+    if (rect.left < 0 || rect.right  > width ||
+        rect.top  < 0 || rect.bottom > height) {
         ALOGE("locking pixels (%d,%d,%d,%d) outside of buffer (w=%d, h=%d)",
                 rect.left, rect.top, rect.right, rect.bottom,
-                this->width, this->height);
+                width, height);
         return BAD_VALUE;
     }
-    status_t res = getBufferMapper().lockAsyncYCbCr(handle, usage, rect, ycbcr, fenceFd);
+    status_t res = getBufferMapper().lockAsyncYCbCr(handle, inUsage, rect,
+            ycbcr, fenceFd);
     return res;
 }
 
@@ -256,11 +268,11 @@
 }
 
 size_t GraphicBuffer::getFlattenedSize() const {
-    return (10 + (handle ? handle->numInts : 0))*sizeof(int);
+    return static_cast<size_t>(10 + (handle ? handle->numInts : 0)) * sizeof(int);
 }
 
 size_t GraphicBuffer::getFdCount() const {
-    return handle ? handle->numFds : 0;
+    return static_cast<size_t>(handle ? handle->numFds : 0);
 }
 
 status_t GraphicBuffer::flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const {
@@ -285,16 +297,17 @@
     if (handle) {
         buf[8] = handle->numFds;
         buf[9] = handle->numInts;
-        native_handle_t const* const h = handle;
-        memcpy(fds,     h->data,             h->numFds*sizeof(int));
-        memcpy(&buf[10], h->data + h->numFds, h->numInts*sizeof(int));
+        memcpy(fds, handle->data,
+                static_cast<size_t>(handle->numFds) * sizeof(int));
+        memcpy(&buf[10], handle->data + handle->numFds,
+                static_cast<size_t>(handle->numInts) * sizeof(int));
     }
 
     buffer = reinterpret_cast<void*>(static_cast<int*>(buffer) + sizeNeeded);
     size -= sizeNeeded;
     if (handle) {
         fds += handle->numFds;
-        count -= handle->numFds;
+        count -= static_cast<size_t>(handle->numFds);
     }
 
     return NO_ERROR;
@@ -307,14 +320,14 @@
     int const* buf = static_cast<int const*>(buffer);
     if (buf[0] != 'GBFR') return BAD_TYPE;
 
-    const size_t numFds  = buf[8];
-    const size_t numInts = buf[9];
+    const size_t numFds  = static_cast<size_t>(buf[8]);
+    const size_t numInts = static_cast<size_t>(buf[9]);
 
     const size_t maxNumber = UINT_MAX / sizeof(int);
     if (numFds >= maxNumber || numInts >= (maxNumber - 10)) {
         width = height = stride = format = usage = 0;
         handle = NULL;
-        ALOGE("unflatten: numFds or numInts is too large: %d, %d",
+        ALOGE("unflatten: numFds or numInts is too large: %zd, %zd",
                 numFds, numInts);
         return BAD_VALUE;
     }
@@ -336,15 +349,16 @@
         stride = buf[3];
         format = buf[4];
         usage  = buf[5];
-        native_handle* h = native_handle_create(numFds, numInts);
+        native_handle* h = native_handle_create(
+                static_cast<int>(numFds), static_cast<int>(numInts));
         if (!h) {
             width = height = stride = format = usage = 0;
             handle = NULL;
             ALOGE("unflatten: native_handle_create failed");
             return NO_MEMORY;
         }
-        memcpy(h->data,          fds,     numFds*sizeof(int));
-        memcpy(h->data + numFds, &buf[10], numInts*sizeof(int));
+        memcpy(h->data, fds, numFds * sizeof(int));
+        memcpy(h->data + numFds, &buf[10], numInts * sizeof(int));
         handle = h;
     } else {
         width = height = stride = format = usage = 0;
diff --git a/libs/ui/GraphicBufferAllocator.cpp b/libs/ui/GraphicBufferAllocator.cpp
index ff550d9..85e9675 100644
--- a/libs/ui/GraphicBufferAllocator.cpp
+++ b/libs/ui/GraphicBufferAllocator.cpp
@@ -1,17 +1,17 @@
-/* 
+/*
 **
 ** Copyright 2009, The Android Open Source Project
 **
-** Licensed under the Apache License, Version 2.0 (the "License"); 
-** you may not use this file except in compliance with the License. 
-** You may obtain a copy of the License at 
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
 **
-**     http://www.apache.org/licenses/LICENSE-2.0 
+**     http://www.apache.org/licenses/LICENSE-2.0
 **
-** Unless required by applicable law or agreed to in writing, software 
-** distributed under the License is distributed on an "AS IS" BASIS, 
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-** See the License for the specific language governing permissions and 
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
 ** limitations under the License.
 */
 
@@ -66,11 +66,11 @@
         if (rec.size) {
             snprintf(buffer, SIZE, "%10p: %7.2f KiB | %4u (%4u) x %4u | %8X | 0x%08x\n",
                     list.keyAt(i), rec.size/1024.0f,
-                    rec.w, rec.s, rec.h, rec.format, rec.usage);
+                    rec.width, rec.stride, rec.height, rec.format, rec.usage);
         } else {
             snprintf(buffer, SIZE, "%10p: unknown     | %4u (%4u) x %4u | %8X | 0x%08x\n",
                     list.keyAt(i),
-                    rec.w, rec.s, rec.h, rec.format, rec.usage);
+                    rec.width, rec.stride, rec.height, rec.format, rec.usage);
         }
         result.append(buffer);
         total += rec.size;
@@ -90,39 +90,40 @@
     ALOGD("%s", s.string());
 }
 
-status_t GraphicBufferAllocator::alloc(uint32_t w, uint32_t h, PixelFormat format,
-        int usage, buffer_handle_t* handle, int32_t* stride)
+status_t GraphicBufferAllocator::alloc(uint32_t width, uint32_t height,
+        PixelFormat format, uint32_t usage, buffer_handle_t* handle,
+        uint32_t* stride)
 {
     ATRACE_CALL();
+
     // make sure to not allocate a N x 0 or 0 x N buffer, since this is
     // allowed from an API stand-point allocate a 1x1 buffer instead.
-    if (!w || !h)
-        w = h = 1;
+    if (!width || !height)
+        width = height = 1;
 
     // we have a h/w allocator and h/w buffer is requested
-    status_t err; 
-    
-    err = mAllocDev->alloc(mAllocDev, w, h, format, usage, handle, stride);
+    status_t err;
+
+    int outStride = 0;
+    err = mAllocDev->alloc(mAllocDev, static_cast<int>(width),
+            static_cast<int>(height), format, static_cast<int>(usage), handle,
+            &outStride);
+    *stride = static_cast<uint32_t>(outStride);
 
     ALOGW_IF(err, "alloc(%u, %u, %d, %08x, ...) failed %d (%s)",
-            w, h, format, usage, err, strerror(-err));
-    
+            width, height, format, usage, err, strerror(-err));
+
     if (err == NO_ERROR) {
         Mutex::Autolock _l(sLock);
         KeyedVector<buffer_handle_t, alloc_rec_t>& list(sAllocList);
-        int bpp = bytesPerPixel(format);
-        if (bpp < 0) {
-            // probably a HAL custom format. in any case, we don't know
-            // what its pixel size is.
-            bpp = 0;
-        }
+        uint32_t bpp = bytesPerPixel(format);
         alloc_rec_t rec;
-        rec.w = w;
-        rec.h = h;
-        rec.s = *stride;
+        rec.width = width;
+        rec.height = height;
+        rec.stride = *stride;
         rec.format = format;
         rec.usage = usage;
-        rec.size = h * stride[0] * bpp;
+        rec.size = static_cast<size_t>(height * (*stride) * bpp);
         list.add(*handle, rec);
     }
 
diff --git a/libs/ui/GraphicBufferMapper.cpp b/libs/ui/GraphicBufferMapper.cpp
index 320b6c0..01acdc8 100644
--- a/libs/ui/GraphicBufferMapper.cpp
+++ b/libs/ui/GraphicBufferMapper.cpp
@@ -20,7 +20,12 @@
 #include <stdint.h>
 #include <errno.h>
 
+// We would eliminate the non-conforming zero-length array, but we can't since
+// this is effectively included from the Linux kernel
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wzero-length-array"
 #include <sync/sync.h>
+#pragma clang diagnostic pop
 
 #include <utils/Errors.h>
 #include <utils/Log.h>
@@ -44,7 +49,7 @@
     int err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
     ALOGE_IF(err, "FATAL: can't find the %s module", GRALLOC_HARDWARE_MODULE_ID);
     if (err == 0) {
-        mAllocMod = (gralloc_module_t const *)module;
+        mAllocMod = reinterpret_cast<gralloc_module_t const *>(module);
     }
 }
 
@@ -72,13 +77,13 @@
     return err;
 }
 
-status_t GraphicBufferMapper::lock(buffer_handle_t handle, 
-        int usage, const Rect& bounds, void** vaddr)
+status_t GraphicBufferMapper::lock(buffer_handle_t handle,
+        uint32_t usage, const Rect& bounds, void** vaddr)
 {
     ATRACE_CALL();
     status_t err;
 
-    err = mAllocMod->lock(mAllocMod, handle, usage,
+    err = mAllocMod->lock(mAllocMod, handle, static_cast<int>(usage),
             bounds.left, bounds.top, bounds.width(), bounds.height(),
             vaddr);
 
@@ -87,12 +92,12 @@
 }
 
 status_t GraphicBufferMapper::lockYCbCr(buffer_handle_t handle,
-        int usage, const Rect& bounds, android_ycbcr *ycbcr)
+        uint32_t usage, const Rect& bounds, android_ycbcr *ycbcr)
 {
     ATRACE_CALL();
     status_t err;
 
-    err = mAllocMod->lock_ycbcr(mAllocMod, handle, usage,
+    err = mAllocMod->lock_ycbcr(mAllocMod, handle, static_cast<int>(usage),
             bounds.left, bounds.top, bounds.width(), bounds.height(),
             ycbcr);
 
@@ -112,19 +117,19 @@
 }
 
 status_t GraphicBufferMapper::lockAsync(buffer_handle_t handle,
-        int usage, const Rect& bounds, void** vaddr, int fenceFd)
+        uint32_t usage, const Rect& bounds, void** vaddr, int fenceFd)
 {
     ATRACE_CALL();
     status_t err;
 
     if (mAllocMod->common.module_api_version >= GRALLOC_MODULE_API_VERSION_0_3) {
-        err = mAllocMod->lockAsync(mAllocMod, handle, usage,
+        err = mAllocMod->lockAsync(mAllocMod, handle, static_cast<int>(usage),
                 bounds.left, bounds.top, bounds.width(), bounds.height(),
                 vaddr, fenceFd);
     } else {
         sync_wait(fenceFd, -1);
         close(fenceFd);
-        err = mAllocMod->lock(mAllocMod, handle, usage,
+        err = mAllocMod->lock(mAllocMod, handle, static_cast<int>(usage),
                 bounds.left, bounds.top, bounds.width(), bounds.height(),
                 vaddr);
     }
@@ -134,19 +139,19 @@
 }
 
 status_t GraphicBufferMapper::lockAsyncYCbCr(buffer_handle_t handle,
-        int usage, const Rect& bounds, android_ycbcr *ycbcr, int fenceFd)
+        uint32_t usage, const Rect& bounds, android_ycbcr *ycbcr, int fenceFd)
 {
     ATRACE_CALL();
     status_t err;
 
     if (mAllocMod->common.module_api_version >= GRALLOC_MODULE_API_VERSION_0_3) {
-        err = mAllocMod->lockAsync_ycbcr(mAllocMod, handle, usage,
-                bounds.left, bounds.top, bounds.width(), bounds.height(),
-                ycbcr, fenceFd);
+        err = mAllocMod->lockAsync_ycbcr(mAllocMod, handle,
+                static_cast<int>(usage), bounds.left, bounds.top,
+                bounds.width(), bounds.height(), ycbcr, fenceFd);
     } else {
         sync_wait(fenceFd, -1);
         close(fenceFd);
-        err = mAllocMod->lock_ycbcr(mAllocMod, handle, usage,
+        err = mAllocMod->lock_ycbcr(mAllocMod, handle, static_cast<int>(usage),
                 bounds.left, bounds.top, bounds.width(), bounds.height(),
                 ycbcr);
     }
diff --git a/libs/ui/PixelFormat.cpp b/libs/ui/PixelFormat.cpp
index 5ce7fba..99ed6f7 100644
--- a/libs/ui/PixelFormat.cpp
+++ b/libs/ui/PixelFormat.cpp
@@ -15,13 +15,12 @@
  */
 
 #include <ui/PixelFormat.h>
-#include <hardware/hardware.h>
 
 // ----------------------------------------------------------------------------
 namespace android {
 // ----------------------------------------------------------------------------
 
-ssize_t bytesPerPixel(PixelFormat format) {
+uint32_t bytesPerPixel(PixelFormat format) {
     switch (format) {
         case PIXEL_FORMAT_RGBA_8888:
         case PIXEL_FORMAT_RGBX_8888:
@@ -36,10 +35,10 @@
         case PIXEL_FORMAT_RGBA_4444:
             return 2;
     }
-    return BAD_VALUE;
+    return 0;
 }
 
-ssize_t bitsPerPixel(PixelFormat format) {
+uint32_t bitsPerPixel(PixelFormat format) {
     switch (format) {
         case PIXEL_FORMAT_RGBA_8888:
         case PIXEL_FORMAT_RGBX_8888:
@@ -52,7 +51,7 @@
         case PIXEL_FORMAT_RGBA_4444:
             return 16;
     }
-    return BAD_VALUE;
+    return 0;
 }
 
 // ----------------------------------------------------------------------------
diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp
index fa812f4..06ab3d0 100644
--- a/libs/ui/Region.cpp
+++ b/libs/ui/Region.cpp
@@ -102,8 +102,8 @@
         current--;
     } while (current->top == lastTop && current >= begin);
 
-    unsigned int beginLastSpan = -1;
-    unsigned int endLastSpan = -1;
+    int beginLastSpan = -1;
+    int endLastSpan = -1;
     int top = -1;
     int bottom = -1;
 
@@ -118,7 +118,7 @@
             } else {
                 beginLastSpan = endLastSpan + 1;
             }
-            endLastSpan = dst.size() - 1;
+            endLastSpan = static_cast<int>(dst.size()) - 1;
 
             top = current->top;
             bottom = current->bottom;
@@ -126,8 +126,12 @@
         int left = current->left;
         int right = current->right;
 
-        for (unsigned int prevIndex = beginLastSpan; prevIndex <= endLastSpan; prevIndex++) {
-            const Rect* prev = &dst[prevIndex];
+        for (int prevIndex = beginLastSpan; prevIndex <= endLastSpan; prevIndex++) {
+            // prevIndex can't be -1 here because if endLastSpan is set to a
+            // value greater than -1 (allowing the loop to execute),
+            // beginLastSpan (and therefore prevIndex) will also be increased
+            const Rect* prev = &dst[static_cast<size_t>(prevIndex)];
+
             if (spanDirection == direction_RTL) {
                 // iterating over previous span RTL, quit if it's too far left
                 if (prev->right <= left) break;
@@ -250,10 +254,10 @@
     mStorage.add(r);
 }
 
-void Region::set(uint32_t w, uint32_t h)
+void Region::set(int32_t w, int32_t h)
 {
     mStorage.clear();
-    mStorage.add(Rect(w,h));
+    mStorage.add(Rect(w, h));
 }
 
 bool Region::isTriviallyEqual(const Region& region) const {
@@ -404,7 +408,7 @@
 
 // This is our region rasterizer, which merges rects and spans together
 // to obtain an optimal region.
-class Region::rasterizer : public region_operator<Rect>::region_rasterizer 
+class Region::rasterizer : public region_operator<Rect>::region_rasterizer
 {
     Rect bounds;
     Vector<Rect>& storage;
@@ -413,81 +417,92 @@
     Vector<Rect> span;
     Rect* cur;
 public:
-    rasterizer(Region& reg) 
+    rasterizer(Region& reg)
         : bounds(INT_MAX, 0, INT_MIN, 0), storage(reg.mStorage), head(), tail(), cur() {
         storage.clear();
     }
 
-    ~rasterizer() {
-        if (span.size()) {
-            flushSpan();
-        }
-        if (storage.size()) {
-            bounds.top = storage.itemAt(0).top;
-            bounds.bottom = storage.top().bottom;
-            if (storage.size() == 1) {
-                storage.clear();
-            }
-        } else {
-            bounds.left  = 0;
-            bounds.right = 0;
-        }
-        storage.add(bounds);
-    }
-    
-    virtual void operator()(const Rect& rect) {
-        //ALOGD(">>> %3d, %3d, %3d, %3d",
-        //        rect.left, rect.top, rect.right, rect.bottom);
-        if (span.size()) {
-            if (cur->top != rect.top) {
-                flushSpan();
-            } else if (cur->right == rect.left) {
-                cur->right = rect.right;
-                return;
-            }
-        }
-        span.add(rect);
-        cur = span.editArray() + (span.size() - 1);
-    }
+    virtual ~rasterizer();
+
+    virtual void operator()(const Rect& rect);
+
 private:
-    template<typename T> 
+    template<typename T>
     static inline T min(T rhs, T lhs) { return rhs < lhs ? rhs : lhs; }
-    template<typename T> 
+    template<typename T>
     static inline T max(T rhs, T lhs) { return rhs > lhs ? rhs : lhs; }
-    void flushSpan() {
-        bool merge = false;
-        if (tail-head == ssize_t(span.size())) {
-            Rect const* p = span.editArray();
-            Rect const* q = head;
-            if (p->top == q->bottom) {
-                merge = true;
-                while (q != tail) {
-                    if ((p->left != q->left) || (p->right != q->right)) {
-                        merge = false;
-                        break;
-                    }
-                    p++, q++;
-                }
-            }
-        }
-        if (merge) {
-            const int bottom = span[0].bottom;
-            Rect* r = head;
-            while (r != tail) {
-                r->bottom = bottom;
-                r++;
-            }
-        } else {
-            bounds.left = min(span.itemAt(0).left, bounds.left);
-            bounds.right = max(span.top().right, bounds.right);
-            storage.appendVector(span);
-            tail = storage.editArray() + storage.size();
-            head = tail - span.size();
-        }
-        span.clear();
-    }
+
+    void flushSpan();
 };
 
+Region::rasterizer::~rasterizer()
+{
+    if (span.size()) {
+        flushSpan();
+    }
+    if (storage.size()) {
+        bounds.top = storage.itemAt(0).top;
+        bounds.bottom = storage.top().bottom;
+        if (storage.size() == 1) {
+            storage.clear();
+        }
+    } else {
+        bounds.left  = 0;
+        bounds.right = 0;
+    }
+    storage.add(bounds);
+}
+
+void Region::rasterizer::operator()(const Rect& rect)
+{
+    //ALOGD(">>> %3d, %3d, %3d, %3d",
+    //        rect.left, rect.top, rect.right, rect.bottom);
+    if (span.size()) {
+        if (cur->top != rect.top) {
+            flushSpan();
+        } else if (cur->right == rect.left) {
+            cur->right = rect.right;
+            return;
+        }
+    }
+    span.add(rect);
+    cur = span.editArray() + (span.size() - 1);
+}
+
+void Region::rasterizer::flushSpan()
+{
+    bool merge = false;
+    if (tail-head == ssize_t(span.size())) {
+        Rect const* p = span.editArray();
+        Rect const* q = head;
+        if (p->top == q->bottom) {
+            merge = true;
+            while (q != tail) {
+                if ((p->left != q->left) || (p->right != q->right)) {
+                    merge = false;
+                    break;
+                }
+                p++, q++;
+            }
+        }
+    }
+    if (merge) {
+        const int bottom = span[0].bottom;
+        Rect* r = head;
+        while (r != tail) {
+            r->bottom = bottom;
+            r++;
+        }
+    } else {
+        bounds.left = min(span.itemAt(0).left, bounds.left);
+        bounds.right = max(span.top().right, bounds.right);
+        storage.appendVector(span);
+        tail = storage.editArray() + storage.size();
+        head = tail - span.size();
+    }
+    span.clear();
+}
+
 bool Region::validate(const Region& reg, const char* name, bool silent)
 {
     bool result = true;
@@ -786,10 +801,8 @@
 }
 
 Rect const* Region::getArray(size_t* count) const {
-    const_iterator const b(begin());
-    const_iterator const e(end());
-    if (count) *count = e-b;
-    return b;
+    if (count) *count = static_cast<size_t>(end() - begin());
+    return begin();
 }
 
 SharedBuffer const* Region::getSharedBuffer(size_t* count) const {
@@ -806,29 +819,22 @@
 
 // ----------------------------------------------------------------------------
 
-void Region::dump(String8& out, const char* what, uint32_t flags) const
+void Region::dump(String8& out, const char* what, uint32_t /* flags */) const
 {
-    (void)flags;
     const_iterator head = begin();
     const_iterator const tail = end();
 
-    size_t SIZE = 256;
-    char buffer[SIZE];
-
-    snprintf(buffer, SIZE, "  Region %s (this=%p, count=%" PRIdPTR ")\n",
-            what, this, tail-head);
-    out.append(buffer);
+    out.appendFormat("  Region %s (this=%p, count=%" PRIdPTR ")\n",
+            what, this, tail - head);
     while (head != tail) {
-        snprintf(buffer, SIZE, "    [%3d, %3d, %3d, %3d]\n",
-                head->left, head->top, head->right, head->bottom);
-        out.append(buffer);
-        head++;
+        out.appendFormat("    [%3d, %3d, %3d, %3d]\n", head->left, head->top,
+                head->right, head->bottom);
+        ++head;
     }
 }
 
-void Region::dump(const char* what, uint32_t flags) const
+void Region::dump(const char* what, uint32_t /* flags */) const
 {
-    (void)flags;
     const_iterator head = begin();
     const_iterator const tail = end();
     ALOGD("  Region %s (this=%p, count=%" PRIdPTR ")\n", what, this, tail-head);
diff --git a/libs/ui/UiConfig.cpp b/libs/ui/UiConfig.cpp
index 8b2130e..9e7ba8e 100644
--- a/libs/ui/UiConfig.cpp
+++ b/libs/ui/UiConfig.cpp
@@ -18,8 +18,11 @@
 
 namespace android {
 
+#ifdef FRAMEBUFFER_FORCE_FORMAT
+// We need the two-level macro to stringify the contents of a macro argument
 #define STRINGIFY(x) #x
 #define TOSTRING(x) STRINGIFY(x)
+#endif
 
 void appendUiConfigString(String8& configStr)
 {
diff --git a/libs/ui/tests/Android.mk b/libs/ui/tests/Android.mk
index b0c57db..6438b1f 100644
--- a/libs/ui/tests/Android.mk
+++ b/libs/ui/tests/Android.mk
@@ -1,31 +1,36 @@
-# Build the unit tests.
+#
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 LOCAL_PATH := $(call my-dir)
+
 include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_SHARED_LIBRARIES := libui
+LOCAL_SRC_FILES := Region_test.cpp
+LOCAL_MODULE := Region_test
+include $(BUILD_NATIVE_TEST)
 
-# Build the unit tests.
-test_src_files := \
-    Region_test.cpp \
-    vec_test.cpp \
-    mat_test.cpp
+include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_SRC_FILES := vec_test.cpp
+LOCAL_MODULE := vec_test
+include $(BUILD_NATIVE_TEST)
 
-shared_libraries := \
-    libutils \
-    libui
-
-static_libraries := \
-    libgtest \
-    libgtest_main
-
-$(foreach file,$(test_src_files), \
-    $(eval include $(CLEAR_VARS)) \
-    $(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \
-    $(eval LOCAL_STATIC_LIBRARIES := $(static_libraries)) \
-    $(eval LOCAL_SRC_FILES := $(file)) \
-    $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \
-    $(eval include $(BUILD_NATIVE_TEST)) \
-)
-
-# Build the unit tests.
-
-# Build the manual test programs.
-include $(call all-makefiles-under, $(LOCAL_PATH))
+include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_SRC_FILES := mat_test.cpp
+LOCAL_MODULE := mat_test
+include $(BUILD_NATIVE_TEST)
diff --git a/libs/ui/tests/vec_test.cpp b/libs/ui/tests/vec_test.cpp
index 00f737e..454c999 100644
--- a/libs/ui/tests/vec_test.cpp
+++ b/libs/ui/tests/vec_test.cpp
@@ -16,17 +16,18 @@
 
 #define LOG_TAG "RegionTest"
 
+#include <math.h>
 #include <stdlib.h>
+
 #include <ui/Region.h>
 #include <ui/Rect.h>
-#include <gtest/gtest.h>
-
 #include <ui/vec4.h>
 
+#include <gtest/gtest.h>
+
 namespace android {
 
 class VecTest : public testing::Test {
-protected:
 };
 
 TEST_F(VecTest, Basics) {
diff --git a/opengl/libagl/Android.mk b/opengl/libagl/Android.mk
index 64320cf..4b08749 100644
--- a/opengl/libagl/Android.mk
+++ b/opengl/libagl/Android.mk
@@ -31,7 +31,9 @@
 LOCAL_SRC_FILES_arm += fixed_asm.S iterators.S
 LOCAL_CFLAGS_arm += -fstrict-aliasing
 
+ifndef ARCH_MIPS_REV6
 LOCAL_SRC_FILES_mips += arch-mips/fixed_asm.S
+endif
 LOCAL_CFLAGS_mips += -fstrict-aliasing
 # The graphics code can generate division by zero
 LOCAL_CFLAGS_mips += -mno-check-zero-division
diff --git a/opengl/libagl/fp.cpp b/opengl/libagl/fp.cpp
index aea4449..a7a4f7b 100644
--- a/opengl/libagl/fp.cpp
+++ b/opengl/libagl/fp.cpp
@@ -19,7 +19,7 @@
 
 // ----------------------------------------------------------------------------
 
-#if !defined(__arm__) && !defined(__mips__)
+#if !(defined(__arm__) || (defined(__mips__) && !defined(__LP64__) && __mips_isa_rev < 6))
 GGLfixed gglFloatToFixed(float v) {   
     return GGLfixed(floorf(v * 65536.0f + 0.5f));
 }
diff --git a/opengl/libagl/matrix.h b/opengl/libagl/matrix.h
index 5bd717a..cafc119 100644
--- a/opengl/libagl/matrix.h
+++ b/opengl/libagl/matrix.h
@@ -74,7 +74,7 @@
         ); 
     return r;
 
-#elif defined(__mips__)
+#elif defined(__mips__) && !defined(__LP64__) && __mips_isa_rev < 6
 
     GLfixed res;
     int32_t t1,t2,t3;
@@ -160,7 +160,7 @@
         ); 
     return r;
     
-#elif defined(__mips__)
+#elif defined(__mips__)  && !defined(__LP64__) && __mips_isa_rev < 6
 
     GLfixed res;
     int32_t t1,t2;
diff --git a/opengl/libs/Android.mk b/opengl/libs/Android.mk
index cc5d544..2c66f3d 100644
--- a/opengl/libs/Android.mk
+++ b/opengl/libs/Android.mk
@@ -77,6 +77,7 @@
 	GLES_CM/gl.cpp.arm 	\
 #
 
+LOCAL_CLANG := false
 LOCAL_SHARED_LIBRARIES += libcutils liblog libEGL
 LOCAL_MODULE:= libGLESv1_CM
 
@@ -101,6 +102,7 @@
 	GLES2/gl2.cpp.arm 	\
 #
 
+LOCAL_CLANG := false
 LOCAL_SHARED_LIBRARIES += libcutils libutils liblog libEGL
 LOCAL_MODULE:= libGLESv2
 
diff --git a/opengl/libs/EGL/egl_display.h b/opengl/libs/EGL/egl_display.h
index 87f27f8..0a6e425 100644
--- a/opengl/libs/EGL/egl_display.h
+++ b/opengl/libs/EGL/egl_display.h
@@ -39,7 +39,7 @@
 
 class egl_object_t;
 class egl_context_t;
-class egl_connection_t;
+struct egl_connection_t;
 
 // ----------------------------------------------------------------------------
 
diff --git a/opengl/libs/EGL/getProcAddress.cpp b/opengl/libs/EGL/getProcAddress.cpp
index fc61134..dcac2b2 100644
--- a/opengl/libs/EGL/getProcAddress.cpp
+++ b/opengl/libs/EGL/getProcAddress.cpp
@@ -78,7 +78,7 @@
 
 #elif defined(__i386__)
 
-    #define API_ENTRY(_api) __attribute__((noinline)) _api
+    #define API_ENTRY(_api) __attribute__((noinline,optimize("omit-frame-pointer"))) _api
 
     #define CALL_GL_EXTENSION_API(_api)                         \
          register void** fn;                                    \
@@ -100,7 +100,7 @@
 
 #elif defined(__x86_64__)
 
-    #define API_ENTRY(_api) __attribute__((noinline)) _api
+    #define API_ENTRY(_api) __attribute__((noinline,optimize("omit-frame-pointer"))) _api
 
     #define CALL_GL_EXTENSION_API(_api)                         \
          register void** fn;                                    \
diff --git a/opengl/libs/GLES2/gl2.cpp b/opengl/libs/GLES2/gl2.cpp
index b07228f..0fb8965 100644
--- a/opengl/libs/GLES2/gl2.cpp
+++ b/opengl/libs/GLES2/gl2.cpp
@@ -82,7 +82,7 @@
 
 #elif defined(__i386__)
 
-    #define API_ENTRY(_api) __attribute__((noinline)) _api
+    #define API_ENTRY(_api) __attribute__((noinline,optimize("omit-frame-pointer"))) _api
 
     #define CALL_GL_API(_api, ...)                                  \
         register void** fn;                                         \
@@ -101,7 +101,7 @@
 
 #elif defined(__x86_64__)
 
-    #define API_ENTRY(_api) __attribute__((noinline)) _api
+    #define API_ENTRY(_api) __attribute__((noinline,optimize("omit-frame-pointer"))) _api
 
     #define CALL_GL_API(_api, ...)                                  \
          register void** fn;                                        \
@@ -180,7 +180,7 @@
     const GLubyte * ret = egl_get_string_for_current_context(name);
     if (ret == NULL) {
         gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl;
-        ret = _c->glGetString(name);
+        if(_c) ret = _c->glGetString(name);
     }
     return ret;
 }
diff --git a/opengl/libs/GLES_CM/gl.cpp b/opengl/libs/GLES_CM/gl.cpp
index f05983c..7896a6f 100644
--- a/opengl/libs/GLES_CM/gl.cpp
+++ b/opengl/libs/GLES_CM/gl.cpp
@@ -138,7 +138,7 @@
 
 #elif defined(__i386__)
 
-    #define API_ENTRY(_api) __attribute__((noinline)) _api
+    #define API_ENTRY(_api) __attribute__((noinline,optimize("omit-frame-pointer"))) _api
 
     #define CALL_GL_API(_api, ...)                                  \
         register void* fn;                                          \
@@ -157,7 +157,7 @@
 
 #elif defined(__x86_64__)
 
-    #define API_ENTRY(_api) __attribute__((noinline)) _api
+    #define API_ENTRY(_api) __attribute__((noinline,optimize("omit-frame-pointer"))) _api
 
     #define CALL_GL_API(_api, ...)                                  \
          register void** fn;                                        \
diff --git a/opengl/libs/GLES_trace/Android.mk b/opengl/libs/GLES_trace/Android.mk
index 846932d..24c4be2 100644
--- a/opengl/libs/GLES_trace/Android.mk
+++ b/opengl/libs/GLES_trace/Android.mk
@@ -1,6 +1,7 @@
 LOCAL_PATH:= $(call my-dir)
 
 include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 
 LOCAL_SRC_FILES := \
     src/gltrace_api.cpp \
@@ -9,20 +10,18 @@
     src/gltrace_eglapi.cpp \
     src/gltrace_fixup.cpp \
     src/gltrace_hooks.cpp \
-    src/gltrace.pb.cpp \
-    src/gltrace_transport.cpp
+    src/gltrace_transport.cpp \
+    $(call all-proto-files-under, proto)
 
 LOCAL_C_INCLUDES := \
     $(LOCAL_PATH) \
     $(LOCAL_PATH)/../ \
-    external/stlport/stlport \
-    external/protobuf/src \
-    external \
-    bionic
+    external
 
-LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI
-LOCAL_STATIC_LIBRARIES := libprotobuf-cpp-2.3.0-lite liblzf
-LOCAL_SHARED_LIBRARIES := libcutils libutils liblog libstlport
+LOCAL_STATIC_LIBRARIES := liblzf
+LOCAL_SHARED_LIBRARIES := libcutils libutils liblog
+
+LOCAL_PROTOC_OPTIMIZE_TYPE := lite
 
 LOCAL_CFLAGS += -DLOG_TAG=\"libGLES_trace\"
 
diff --git a/opengl/libs/GLES_trace/dev.make b/opengl/libs/GLES_trace/dev.make
index a46260c..3405d8e 100644
--- a/opengl/libs/GLES_trace/dev.make
+++ b/opengl/libs/GLES_trace/dev.make
@@ -1,11 +1,6 @@
 ## NOTE
 ## This file is used for development purposes only. It is not used by the build system.
 
-# generate protocol buffer files
-genproto: gltrace.proto
-	aprotoc --cpp_out=src --java_out=java gltrace.proto
-	mv src/gltrace.pb.cc src/gltrace.pb.cpp
-
 sync:
 	adb root
 	adb remount
diff --git a/opengl/libs/GLES_trace/gltrace.proto b/opengl/libs/GLES_trace/proto/gltrace.proto
similarity index 99%
rename from opengl/libs/GLES_trace/gltrace.proto
rename to opengl/libs/GLES_trace/proto/gltrace.proto
index 00303c2..0344787 100644
--- a/opengl/libs/GLES_trace/gltrace.proto
+++ b/opengl/libs/GLES_trace/proto/gltrace.proto
@@ -23,6 +23,8 @@
 
 message GLMessage {
     enum Function {
+        option allow_alias = true;
+
         glActiveTexture = 0;
         glAlphaFunc = 1;
         glAlphaFuncx = 2;
diff --git a/opengl/libs/GLES_trace/src/gltrace.pb.cpp b/opengl/libs/GLES_trace/src/gltrace.pb.cpp
deleted file mode 100644
index c0867cd..0000000
--- a/opengl/libs/GLES_trace/src/gltrace.pb.cpp
+++ /dev/null
@@ -1,2715 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-
-#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
-#include "gltrace.pb.h"
-#include <google/protobuf/stubs/once.h>
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/wire_format_lite_inl.h>
-// @@protoc_insertion_point(includes)
-
-namespace android {
-namespace gltrace {
-
-void protobuf_ShutdownFile_gltrace_2eproto() {
-  delete GLMessage::default_instance_;
-  delete GLMessage_DataType::default_instance_;
-  delete GLMessage_FrameBuffer::default_instance_;
-}
-
-void protobuf_AddDesc_gltrace_2eproto() {
-  static bool already_here = false;
-  if (already_here) return;
-  already_here = true;
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-  GLMessage::default_instance_ = new GLMessage();
-  GLMessage_DataType::default_instance_ = new GLMessage_DataType();
-  GLMessage_FrameBuffer::default_instance_ = new GLMessage_FrameBuffer();
-  GLMessage::default_instance_->InitAsDefaultInstance();
-  GLMessage_DataType::default_instance_->InitAsDefaultInstance();
-  GLMessage_FrameBuffer::default_instance_->InitAsDefaultInstance();
-  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_gltrace_2eproto);
-}
-
-// Force AddDescriptors() to be called at static initialization time.
-struct StaticDescriptorInitializer_gltrace_2eproto {
-  StaticDescriptorInitializer_gltrace_2eproto() {
-    protobuf_AddDesc_gltrace_2eproto();
-  }
-} static_descriptor_initializer_gltrace_2eproto_;
-
-
-// ===================================================================
-
-bool GLMessage_Function_IsValid(int value) {
-  switch(value) {
-    case 0:
-    case 1:
-    case 2:
-    case 3:
-    case 4:
-    case 5:
-    case 6:
-    case 7:
-    case 8:
-    case 9:
-    case 10:
-    case 11:
-    case 12:
-    case 13:
-    case 14:
-    case 15:
-    case 16:
-    case 17:
-    case 18:
-    case 19:
-    case 20:
-    case 21:
-    case 22:
-    case 23:
-    case 24:
-    case 25:
-    case 26:
-    case 27:
-    case 28:
-    case 29:
-    case 30:
-    case 31:
-    case 32:
-    case 33:
-    case 34:
-    case 35:
-    case 36:
-    case 37:
-    case 38:
-    case 39:
-    case 40:
-    case 41:
-    case 42:
-    case 43:
-    case 44:
-    case 45:
-    case 46:
-    case 47:
-    case 48:
-    case 49:
-    case 50:
-    case 51:
-    case 52:
-    case 53:
-    case 54:
-    case 55:
-    case 56:
-    case 57:
-    case 58:
-    case 59:
-    case 60:
-    case 61:
-    case 62:
-    case 63:
-    case 64:
-    case 65:
-    case 66:
-    case 67:
-    case 68:
-    case 69:
-    case 70:
-    case 71:
-    case 72:
-    case 73:
-    case 74:
-    case 75:
-    case 76:
-    case 77:
-    case 78:
-    case 79:
-    case 80:
-    case 81:
-    case 82:
-    case 83:
-    case 84:
-    case 85:
-    case 86:
-    case 87:
-    case 88:
-    case 89:
-    case 90:
-    case 91:
-    case 92:
-    case 93:
-    case 94:
-    case 95:
-    case 96:
-    case 97:
-    case 98:
-    case 99:
-    case 100:
-    case 101:
-    case 102:
-    case 103:
-    case 104:
-    case 105:
-    case 106:
-    case 107:
-    case 108:
-    case 109:
-    case 110:
-    case 111:
-    case 112:
-    case 113:
-    case 114:
-    case 115:
-    case 116:
-    case 117:
-    case 118:
-    case 119:
-    case 120:
-    case 121:
-    case 122:
-    case 123:
-    case 124:
-    case 125:
-    case 126:
-    case 127:
-    case 128:
-    case 129:
-    case 130:
-    case 131:
-    case 132:
-    case 133:
-    case 134:
-    case 135:
-    case 136:
-    case 137:
-    case 138:
-    case 139:
-    case 140:
-    case 141:
-    case 142:
-    case 143:
-    case 144:
-    case 145:
-    case 146:
-    case 147:
-    case 148:
-    case 149:
-    case 150:
-    case 151:
-    case 152:
-    case 153:
-    case 154:
-    case 155:
-    case 156:
-    case 157:
-    case 158:
-    case 159:
-    case 160:
-    case 161:
-    case 162:
-    case 163:
-    case 164:
-    case 165:
-    case 166:
-    case 167:
-    case 168:
-    case 169:
-    case 170:
-    case 171:
-    case 172:
-    case 173:
-    case 174:
-    case 175:
-    case 176:
-    case 177:
-    case 178:
-    case 179:
-    case 180:
-    case 181:
-    case 182:
-    case 183:
-    case 184:
-    case 185:
-    case 186:
-    case 187:
-    case 188:
-    case 189:
-    case 190:
-    case 191:
-    case 192:
-    case 193:
-    case 194:
-    case 195:
-    case 196:
-    case 197:
-    case 198:
-    case 199:
-    case 200:
-    case 201:
-    case 202:
-    case 203:
-    case 204:
-    case 205:
-    case 206:
-    case 207:
-    case 208:
-    case 209:
-    case 210:
-    case 211:
-    case 212:
-    case 213:
-    case 214:
-    case 215:
-    case 216:
-    case 217:
-    case 218:
-    case 219:
-    case 220:
-    case 221:
-    case 222:
-    case 223:
-    case 224:
-    case 225:
-    case 226:
-    case 227:
-    case 228:
-    case 229:
-    case 230:
-    case 231:
-    case 232:
-    case 233:
-    case 234:
-    case 235:
-    case 236:
-    case 237:
-    case 238:
-    case 239:
-    case 240:
-    case 241:
-    case 242:
-    case 243:
-    case 244:
-    case 245:
-    case 246:
-    case 247:
-    case 248:
-    case 249:
-    case 250:
-    case 251:
-    case 252:
-    case 253:
-    case 254:
-    case 255:
-    case 256:
-    case 257:
-    case 258:
-    case 259:
-    case 260:
-    case 261:
-    case 262:
-    case 263:
-    case 264:
-    case 265:
-    case 266:
-    case 267:
-    case 268:
-    case 269:
-    case 270:
-    case 271:
-    case 272:
-    case 273:
-    case 274:
-    case 275:
-    case 276:
-    case 277:
-    case 278:
-    case 279:
-    case 280:
-    case 281:
-    case 282:
-    case 283:
-    case 284:
-    case 285:
-    case 286:
-    case 287:
-    case 288:
-    case 289:
-    case 290:
-    case 291:
-    case 292:
-    case 293:
-    case 294:
-    case 295:
-    case 296:
-    case 297:
-    case 298:
-    case 299:
-    case 300:
-    case 301:
-    case 302:
-    case 303:
-    case 304:
-    case 305:
-    case 306:
-    case 307:
-    case 308:
-    case 309:
-    case 310:
-    case 311:
-    case 312:
-    case 313:
-    case 314:
-    case 315:
-    case 316:
-    case 317:
-    case 318:
-    case 319:
-    case 320:
-    case 321:
-    case 322:
-    case 323:
-    case 324:
-    case 325:
-    case 326:
-    case 327:
-    case 328:
-    case 329:
-    case 330:
-    case 331:
-    case 332:
-    case 333:
-    case 334:
-    case 335:
-    case 336:
-    case 337:
-    case 338:
-    case 339:
-    case 340:
-    case 341:
-    case 342:
-    case 343:
-    case 344:
-    case 345:
-    case 346:
-    case 347:
-    case 348:
-    case 349:
-    case 350:
-    case 351:
-    case 352:
-    case 353:
-    case 354:
-    case 355:
-    case 356:
-    case 357:
-    case 358:
-    case 359:
-    case 360:
-    case 361:
-    case 362:
-    case 363:
-    case 364:
-    case 365:
-    case 366:
-    case 367:
-    case 368:
-    case 369:
-    case 370:
-    case 371:
-    case 372:
-    case 373:
-    case 374:
-    case 375:
-    case 376:
-    case 377:
-    case 378:
-    case 379:
-    case 380:
-    case 381:
-    case 382:
-    case 383:
-    case 384:
-    case 385:
-    case 386:
-    case 387:
-    case 388:
-    case 389:
-    case 390:
-    case 391:
-    case 392:
-    case 393:
-    case 394:
-    case 395:
-    case 396:
-    case 397:
-    case 398:
-    case 399:
-    case 400:
-    case 401:
-    case 402:
-    case 403:
-    case 404:
-    case 405:
-    case 406:
-    case 407:
-    case 408:
-    case 409:
-    case 410:
-    case 411:
-    case 412:
-    case 413:
-    case 414:
-    case 415:
-    case 416:
-    case 417:
-    case 418:
-    case 419:
-    case 420:
-    case 421:
-    case 422:
-    case 423:
-    case 424:
-    case 425:
-    case 426:
-    case 427:
-    case 428:
-    case 429:
-    case 430:
-    case 431:
-    case 432:
-    case 433:
-    case 434:
-    case 435:
-    case 436:
-    case 437:
-    case 438:
-    case 439:
-    case 440:
-    case 441:
-    case 442:
-    case 443:
-    case 444:
-    case 445:
-    case 446:
-    case 447:
-    case 448:
-    case 449:
-    case 450:
-    case 451:
-    case 452:
-    case 453:
-    case 454:
-    case 455:
-    case 456:
-    case 457:
-    case 458:
-    case 459:
-    case 460:
-    case 461:
-    case 462:
-    case 463:
-    case 464:
-    case 465:
-    case 466:
-    case 467:
-    case 468:
-    case 469:
-    case 470:
-    case 471:
-    case 472:
-    case 473:
-    case 474:
-    case 475:
-    case 476:
-    case 477:
-    case 478:
-    case 479:
-    case 480:
-    case 481:
-    case 482:
-    case 483:
-    case 484:
-    case 485:
-    case 486:
-    case 487:
-    case 488:
-    case 489:
-    case 490:
-    case 491:
-    case 492:
-    case 493:
-    case 494:
-    case 495:
-    case 496:
-    case 497:
-    case 498:
-    case 499:
-    case 500:
-    case 501:
-    case 502:
-    case 503:
-    case 504:
-    case 505:
-    case 506:
-    case 507:
-    case 508:
-    case 509:
-    case 510:
-    case 511:
-    case 512:
-    case 513:
-    case 514:
-    case 515:
-    case 516:
-    case 517:
-    case 518:
-    case 519:
-    case 520:
-    case 521:
-    case 522:
-    case 523:
-    case 524:
-    case 525:
-    case 526:
-    case 527:
-    case 528:
-    case 529:
-    case 530:
-    case 531:
-    case 532:
-    case 533:
-    case 534:
-    case 535:
-    case 536:
-    case 537:
-    case 538:
-    case 539:
-    case 540:
-    case 541:
-    case 542:
-    case 543:
-    case 544:
-    case 545:
-    case 546:
-    case 547:
-    case 548:
-    case 549:
-    case 550:
-    case 551:
-    case 552:
-    case 553:
-    case 554:
-    case 555:
-    case 556:
-    case 557:
-    case 558:
-    case 559:
-    case 560:
-    case 561:
-    case 562:
-    case 563:
-    case 564:
-    case 565:
-    case 566:
-    case 567:
-    case 568:
-    case 569:
-    case 570:
-    case 571:
-    case 572:
-    case 573:
-    case 574:
-    case 575:
-    case 576:
-    case 577:
-    case 578:
-    case 579:
-    case 580:
-    case 581:
-    case 582:
-    case 583:
-    case 584:
-    case 585:
-    case 586:
-    case 587:
-    case 588:
-    case 589:
-    case 590:
-    case 591:
-    case 592:
-    case 593:
-    case 594:
-    case 595:
-    case 596:
-    case 597:
-    case 598:
-    case 599:
-    case 600:
-    case 601:
-    case 602:
-    case 603:
-    case 604:
-    case 605:
-    case 606:
-    case 607:
-    case 608:
-    case 609:
-    case 610:
-    case 611:
-    case 612:
-    case 613:
-    case 614:
-    case 615:
-    case 616:
-    case 617:
-    case 618:
-    case 619:
-    case 620:
-    case 621:
-    case 622:
-    case 623:
-    case 624:
-    case 625:
-    case 626:
-    case 627:
-    case 628:
-    case 629:
-    case 630:
-    case 631:
-    case 632:
-    case 633:
-    case 634:
-    case 635:
-    case 636:
-    case 637:
-    case 638:
-    case 639:
-    case 640:
-    case 641:
-    case 642:
-    case 643:
-    case 644:
-    case 645:
-    case 646:
-    case 647:
-    case 648:
-    case 649:
-    case 650:
-    case 651:
-    case 652:
-    case 653:
-    case 654:
-    case 655:
-    case 656:
-    case 657:
-    case 658:
-    case 659:
-    case 660:
-    case 661:
-    case 662:
-    case 663:
-    case 664:
-    case 665:
-    case 666:
-    case 667:
-    case 668:
-    case 669:
-    case 670:
-    case 671:
-    case 672:
-    case 673:
-    case 674:
-    case 675:
-    case 676:
-    case 677:
-    case 678:
-    case 679:
-    case 680:
-    case 681:
-    case 682:
-    case 683:
-    case 684:
-    case 685:
-    case 686:
-    case 687:
-    case 688:
-    case 689:
-    case 690:
-    case 691:
-    case 692:
-    case 693:
-    case 694:
-    case 695:
-    case 696:
-    case 697:
-    case 698:
-    case 699:
-    case 700:
-    case 701:
-    case 702:
-    case 703:
-    case 704:
-    case 705:
-    case 706:
-    case 707:
-    case 708:
-    case 709:
-    case 710:
-    case 711:
-    case 712:
-    case 713:
-    case 714:
-    case 715:
-    case 716:
-    case 717:
-    case 718:
-    case 719:
-    case 720:
-    case 721:
-    case 722:
-    case 723:
-    case 724:
-    case 725:
-    case 726:
-    case 727:
-    case 728:
-    case 729:
-    case 730:
-    case 2000:
-    case 2001:
-    case 2002:
-    case 2003:
-    case 2004:
-    case 2005:
-    case 2006:
-    case 2007:
-    case 2008:
-    case 2009:
-    case 2010:
-    case 2011:
-    case 2012:
-    case 2013:
-    case 2014:
-    case 2015:
-    case 2016:
-    case 2017:
-    case 2018:
-    case 2019:
-    case 2020:
-    case 2021:
-    case 2022:
-    case 2023:
-    case 2024:
-    case 2025:
-    case 2026:
-    case 2027:
-    case 2028:
-    case 2029:
-    case 2030:
-    case 2031:
-    case 2032:
-    case 2033:
-    case 2034:
-    case 2035:
-    case 2036:
-    case 2037:
-    case 2038:
-    case 2039:
-    case 2040:
-    case 2041:
-    case 2042:
-    case 2043:
-    case 2044:
-    case 2045:
-    case 3000:
-    case 3001:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#ifndef _MSC_VER
-const GLMessage_Function GLMessage::glActiveTexture;
-const GLMessage_Function GLMessage::glAlphaFunc;
-const GLMessage_Function GLMessage::glAlphaFuncx;
-const GLMessage_Function GLMessage::glAlphaFuncxOES;
-const GLMessage_Function GLMessage::glAttachShader;
-const GLMessage_Function GLMessage::glBeginPerfMonitorAMD;
-const GLMessage_Function GLMessage::glBindAttribLocation;
-const GLMessage_Function GLMessage::glBindBuffer;
-const GLMessage_Function GLMessage::glBindFramebuffer;
-const GLMessage_Function GLMessage::glBindFramebufferOES;
-const GLMessage_Function GLMessage::glBindRenderbuffer;
-const GLMessage_Function GLMessage::glBindRenderbufferOES;
-const GLMessage_Function GLMessage::glBindTexture;
-const GLMessage_Function GLMessage::glBindVertexArrayOES;
-const GLMessage_Function GLMessage::glBlendColor;
-const GLMessage_Function GLMessage::glBlendEquation;
-const GLMessage_Function GLMessage::glBlendEquationOES;
-const GLMessage_Function GLMessage::glBlendEquationSeparate;
-const GLMessage_Function GLMessage::glBlendEquationSeparateOES;
-const GLMessage_Function GLMessage::glBlendFunc;
-const GLMessage_Function GLMessage::glBlendFuncSeparate;
-const GLMessage_Function GLMessage::glBlendFuncSeparateOES;
-const GLMessage_Function GLMessage::glBufferData;
-const GLMessage_Function GLMessage::glBufferSubData;
-const GLMessage_Function GLMessage::glCheckFramebufferStatus;
-const GLMessage_Function GLMessage::glCheckFramebufferStatusOES;
-const GLMessage_Function GLMessage::glClearColor;
-const GLMessage_Function GLMessage::glClearColorx;
-const GLMessage_Function GLMessage::glClearColorxOES;
-const GLMessage_Function GLMessage::glClearDepthf;
-const GLMessage_Function GLMessage::glClearDepthfOES;
-const GLMessage_Function GLMessage::glClearDepthx;
-const GLMessage_Function GLMessage::glClearDepthxOES;
-const GLMessage_Function GLMessage::glClear;
-const GLMessage_Function GLMessage::glClearStencil;
-const GLMessage_Function GLMessage::glClientActiveTexture;
-const GLMessage_Function GLMessage::glClipPlanef;
-const GLMessage_Function GLMessage::glClipPlanefIMG;
-const GLMessage_Function GLMessage::glClipPlanefOES;
-const GLMessage_Function GLMessage::glClipPlanex;
-const GLMessage_Function GLMessage::glClipPlanexIMG;
-const GLMessage_Function GLMessage::glClipPlanexOES;
-const GLMessage_Function GLMessage::glColor4f;
-const GLMessage_Function GLMessage::glColor4ub;
-const GLMessage_Function GLMessage::glColor4x;
-const GLMessage_Function GLMessage::glColor4xOES;
-const GLMessage_Function GLMessage::glColorMask;
-const GLMessage_Function GLMessage::glColorPointer;
-const GLMessage_Function GLMessage::glCompileShader;
-const GLMessage_Function GLMessage::glCompressedTexImage2D;
-const GLMessage_Function GLMessage::glCompressedTexImage3DOES;
-const GLMessage_Function GLMessage::glCompressedTexSubImage2D;
-const GLMessage_Function GLMessage::glCompressedTexSubImage3DOES;
-const GLMessage_Function GLMessage::glCopyTexImage2D;
-const GLMessage_Function GLMessage::glCopyTexSubImage2D;
-const GLMessage_Function GLMessage::glCopyTexSubImage3DOES;
-const GLMessage_Function GLMessage::glCoverageMaskNV;
-const GLMessage_Function GLMessage::glCoverageOperationNV;
-const GLMessage_Function GLMessage::glCreateProgram;
-const GLMessage_Function GLMessage::glCreateShader;
-const GLMessage_Function GLMessage::glCullFace;
-const GLMessage_Function GLMessage::glCurrentPaletteMatrixOES;
-const GLMessage_Function GLMessage::glDeleteBuffers;
-const GLMessage_Function GLMessage::glDeleteFencesNV;
-const GLMessage_Function GLMessage::glDeleteFramebuffers;
-const GLMessage_Function GLMessage::glDeleteFramebuffersOES;
-const GLMessage_Function GLMessage::glDeletePerfMonitorsAMD;
-const GLMessage_Function GLMessage::glDeleteProgram;
-const GLMessage_Function GLMessage::glDeleteRenderbuffers;
-const GLMessage_Function GLMessage::glDeleteRenderbuffersOES;
-const GLMessage_Function GLMessage::glDeleteShader;
-const GLMessage_Function GLMessage::glDeleteTextures;
-const GLMessage_Function GLMessage::glDeleteVertexArraysOES;
-const GLMessage_Function GLMessage::glDepthFunc;
-const GLMessage_Function GLMessage::glDepthMask;
-const GLMessage_Function GLMessage::glDepthRangef;
-const GLMessage_Function GLMessage::glDepthRangefOES;
-const GLMessage_Function GLMessage::glDepthRangex;
-const GLMessage_Function GLMessage::glDepthRangexOES;
-const GLMessage_Function GLMessage::glDetachShader;
-const GLMessage_Function GLMessage::glDisableClientState;
-const GLMessage_Function GLMessage::glDisableDriverControlQCOM;
-const GLMessage_Function GLMessage::glDisable;
-const GLMessage_Function GLMessage::glDisableVertexAttribArray;
-const GLMessage_Function GLMessage::glDiscardFramebufferEXT;
-const GLMessage_Function GLMessage::glDrawArrays;
-const GLMessage_Function GLMessage::glDrawElements;
-const GLMessage_Function GLMessage::glDrawTexfOES;
-const GLMessage_Function GLMessage::glDrawTexfvOES;
-const GLMessage_Function GLMessage::glDrawTexiOES;
-const GLMessage_Function GLMessage::glDrawTexivOES;
-const GLMessage_Function GLMessage::glDrawTexsOES;
-const GLMessage_Function GLMessage::glDrawTexsvOES;
-const GLMessage_Function GLMessage::glDrawTexxOES;
-const GLMessage_Function GLMessage::glDrawTexxvOES;
-const GLMessage_Function GLMessage::glEGLImageTargetRenderbufferStorageOES;
-const GLMessage_Function GLMessage::glEGLImageTargetTexture2DOES;
-const GLMessage_Function GLMessage::glEnableClientState;
-const GLMessage_Function GLMessage::glEnableDriverControlQCOM;
-const GLMessage_Function GLMessage::glEnable;
-const GLMessage_Function GLMessage::glEnableVertexAttribArray;
-const GLMessage_Function GLMessage::glEndPerfMonitorAMD;
-const GLMessage_Function GLMessage::glEndTilingQCOM;
-const GLMessage_Function GLMessage::glExtGetBufferPointervQCOM;
-const GLMessage_Function GLMessage::glExtGetBuffersQCOM;
-const GLMessage_Function GLMessage::glExtGetFramebuffersQCOM;
-const GLMessage_Function GLMessage::glExtGetProgramBinarySourceQCOM;
-const GLMessage_Function GLMessage::glExtGetProgramsQCOM;
-const GLMessage_Function GLMessage::glExtGetRenderbuffersQCOM;
-const GLMessage_Function GLMessage::glExtGetShadersQCOM;
-const GLMessage_Function GLMessage::glExtGetTexLevelParameterivQCOM;
-const GLMessage_Function GLMessage::glExtGetTexSubImageQCOM;
-const GLMessage_Function GLMessage::glExtGetTexturesQCOM;
-const GLMessage_Function GLMessage::glExtIsProgramBinaryQCOM;
-const GLMessage_Function GLMessage::glExtTexObjectStateOverrideiQCOM;
-const GLMessage_Function GLMessage::glFinishFenceNV;
-const GLMessage_Function GLMessage::glFinish;
-const GLMessage_Function GLMessage::glFlush;
-const GLMessage_Function GLMessage::glFogf;
-const GLMessage_Function GLMessage::glFogfv;
-const GLMessage_Function GLMessage::glFogx;
-const GLMessage_Function GLMessage::glFogxOES;
-const GLMessage_Function GLMessage::glFogxv;
-const GLMessage_Function GLMessage::glFogxvOES;
-const GLMessage_Function GLMessage::glFramebufferRenderbuffer;
-const GLMessage_Function GLMessage::glFramebufferRenderbufferOES;
-const GLMessage_Function GLMessage::glFramebufferTexture2D;
-const GLMessage_Function GLMessage::glFramebufferTexture2DMultisampleIMG;
-const GLMessage_Function GLMessage::glFramebufferTexture2DOES;
-const GLMessage_Function GLMessage::glFramebufferTexture3DOES;
-const GLMessage_Function GLMessage::glFrontFace;
-const GLMessage_Function GLMessage::glFrustumf;
-const GLMessage_Function GLMessage::glFrustumfOES;
-const GLMessage_Function GLMessage::glFrustumx;
-const GLMessage_Function GLMessage::glFrustumxOES;
-const GLMessage_Function GLMessage::glGenBuffers;
-const GLMessage_Function GLMessage::glGenerateMipmap;
-const GLMessage_Function GLMessage::glGenerateMipmapOES;
-const GLMessage_Function GLMessage::glGenFencesNV;
-const GLMessage_Function GLMessage::glGenFramebuffers;
-const GLMessage_Function GLMessage::glGenFramebuffersOES;
-const GLMessage_Function GLMessage::glGenPerfMonitorsAMD;
-const GLMessage_Function GLMessage::glGenRenderbuffers;
-const GLMessage_Function GLMessage::glGenRenderbuffersOES;
-const GLMessage_Function GLMessage::glGenTextures;
-const GLMessage_Function GLMessage::glGenVertexArraysOES;
-const GLMessage_Function GLMessage::glGetActiveAttrib;
-const GLMessage_Function GLMessage::glGetActiveUniform;
-const GLMessage_Function GLMessage::glGetAttachedShaders;
-const GLMessage_Function GLMessage::glGetAttribLocation;
-const GLMessage_Function GLMessage::glGetBooleanv;
-const GLMessage_Function GLMessage::glGetBufferParameteriv;
-const GLMessage_Function GLMessage::glGetBufferPointervOES;
-const GLMessage_Function GLMessage::glGetClipPlanef;
-const GLMessage_Function GLMessage::glGetClipPlanefOES;
-const GLMessage_Function GLMessage::glGetClipPlanex;
-const GLMessage_Function GLMessage::glGetClipPlanexOES;
-const GLMessage_Function GLMessage::glGetDriverControlsQCOM;
-const GLMessage_Function GLMessage::glGetDriverControlStringQCOM;
-const GLMessage_Function GLMessage::glGetError;
-const GLMessage_Function GLMessage::glGetFenceivNV;
-const GLMessage_Function GLMessage::glGetFixedv;
-const GLMessage_Function GLMessage::glGetFixedvOES;
-const GLMessage_Function GLMessage::glGetFloatv;
-const GLMessage_Function GLMessage::glGetFramebufferAttachmentParameteriv;
-const GLMessage_Function GLMessage::glGetFramebufferAttachmentParameterivOES;
-const GLMessage_Function GLMessage::glGetIntegerv;
-const GLMessage_Function GLMessage::glGetLightfv;
-const GLMessage_Function GLMessage::glGetLightxv;
-const GLMessage_Function GLMessage::glGetLightxvOES;
-const GLMessage_Function GLMessage::glGetMaterialfv;
-const GLMessage_Function GLMessage::glGetMaterialxv;
-const GLMessage_Function GLMessage::glGetMaterialxvOES;
-const GLMessage_Function GLMessage::glGetPerfMonitorCounterDataAMD;
-const GLMessage_Function GLMessage::glGetPerfMonitorCounterInfoAMD;
-const GLMessage_Function GLMessage::glGetPerfMonitorCountersAMD;
-const GLMessage_Function GLMessage::glGetPerfMonitorCounterStringAMD;
-const GLMessage_Function GLMessage::glGetPerfMonitorGroupsAMD;
-const GLMessage_Function GLMessage::glGetPerfMonitorGroupStringAMD;
-const GLMessage_Function GLMessage::glGetPointerv;
-const GLMessage_Function GLMessage::glGetProgramBinaryOES;
-const GLMessage_Function GLMessage::glGetProgramInfoLog;
-const GLMessage_Function GLMessage::glGetProgramiv;
-const GLMessage_Function GLMessage::glGetRenderbufferParameteriv;
-const GLMessage_Function GLMessage::glGetRenderbufferParameterivOES;
-const GLMessage_Function GLMessage::glGetShaderInfoLog;
-const GLMessage_Function GLMessage::glGetShaderiv;
-const GLMessage_Function GLMessage::glGetShaderPrecisionFormat;
-const GLMessage_Function GLMessage::glGetShaderSource;
-const GLMessage_Function GLMessage::glGetString;
-const GLMessage_Function GLMessage::glGetTexEnvfv;
-const GLMessage_Function GLMessage::glGetTexEnviv;
-const GLMessage_Function GLMessage::glGetTexEnvxv;
-const GLMessage_Function GLMessage::glGetTexEnvxvOES;
-const GLMessage_Function GLMessage::glGetTexGenfvOES;
-const GLMessage_Function GLMessage::glGetTexGenivOES;
-const GLMessage_Function GLMessage::glGetTexGenxvOES;
-const GLMessage_Function GLMessage::glGetTexParameterfv;
-const GLMessage_Function GLMessage::glGetTexParameteriv;
-const GLMessage_Function GLMessage::glGetTexParameterxv;
-const GLMessage_Function GLMessage::glGetTexParameterxvOES;
-const GLMessage_Function GLMessage::glGetUniformfv;
-const GLMessage_Function GLMessage::glGetUniformiv;
-const GLMessage_Function GLMessage::glGetUniformLocation;
-const GLMessage_Function GLMessage::glGetVertexAttribfv;
-const GLMessage_Function GLMessage::glGetVertexAttribiv;
-const GLMessage_Function GLMessage::glGetVertexAttribPointerv;
-const GLMessage_Function GLMessage::glHint;
-const GLMessage_Function GLMessage::glIsBuffer;
-const GLMessage_Function GLMessage::glIsEnabled;
-const GLMessage_Function GLMessage::glIsFenceNV;
-const GLMessage_Function GLMessage::glIsFramebuffer;
-const GLMessage_Function GLMessage::glIsFramebufferOES;
-const GLMessage_Function GLMessage::glIsProgram;
-const GLMessage_Function GLMessage::glIsRenderbuffer;
-const GLMessage_Function GLMessage::glIsRenderbufferOES;
-const GLMessage_Function GLMessage::glIsShader;
-const GLMessage_Function GLMessage::glIsTexture;
-const GLMessage_Function GLMessage::glIsVertexArrayOES;
-const GLMessage_Function GLMessage::glLightf;
-const GLMessage_Function GLMessage::glLightfv;
-const GLMessage_Function GLMessage::glLightModelf;
-const GLMessage_Function GLMessage::glLightModelfv;
-const GLMessage_Function GLMessage::glLightModelx;
-const GLMessage_Function GLMessage::glLightModelxOES;
-const GLMessage_Function GLMessage::glLightModelxv;
-const GLMessage_Function GLMessage::glLightModelxvOES;
-const GLMessage_Function GLMessage::glLightx;
-const GLMessage_Function GLMessage::glLightxOES;
-const GLMessage_Function GLMessage::glLightxv;
-const GLMessage_Function GLMessage::glLightxvOES;
-const GLMessage_Function GLMessage::glLineWidth;
-const GLMessage_Function GLMessage::glLineWidthx;
-const GLMessage_Function GLMessage::glLineWidthxOES;
-const GLMessage_Function GLMessage::glLinkProgram;
-const GLMessage_Function GLMessage::glLoadIdentity;
-const GLMessage_Function GLMessage::glLoadMatrixf;
-const GLMessage_Function GLMessage::glLoadMatrixx;
-const GLMessage_Function GLMessage::glLoadMatrixxOES;
-const GLMessage_Function GLMessage::glLoadPaletteFromModelViewMatrixOES;
-const GLMessage_Function GLMessage::glLogicOp;
-const GLMessage_Function GLMessage::glMapBufferOES;
-const GLMessage_Function GLMessage::glMaterialf;
-const GLMessage_Function GLMessage::glMaterialfv;
-const GLMessage_Function GLMessage::glMaterialx;
-const GLMessage_Function GLMessage::glMaterialxOES;
-const GLMessage_Function GLMessage::glMaterialxv;
-const GLMessage_Function GLMessage::glMaterialxvOES;
-const GLMessage_Function GLMessage::glMatrixIndexPointerOES;
-const GLMessage_Function GLMessage::glMatrixMode;
-const GLMessage_Function GLMessage::glMultiDrawArraysEXT;
-const GLMessage_Function GLMessage::glMultiDrawElementsEXT;
-const GLMessage_Function GLMessage::glMultiTexCoord4f;
-const GLMessage_Function GLMessage::glMultiTexCoord4x;
-const GLMessage_Function GLMessage::glMultiTexCoord4xOES;
-const GLMessage_Function GLMessage::glMultMatrixf;
-const GLMessage_Function GLMessage::glMultMatrixx;
-const GLMessage_Function GLMessage::glMultMatrixxOES;
-const GLMessage_Function GLMessage::glNormal3f;
-const GLMessage_Function GLMessage::glNormal3x;
-const GLMessage_Function GLMessage::glNormal3xOES;
-const GLMessage_Function GLMessage::glNormalPointer;
-const GLMessage_Function GLMessage::glOrthof;
-const GLMessage_Function GLMessage::glOrthofOES;
-const GLMessage_Function GLMessage::glOrthox;
-const GLMessage_Function GLMessage::glOrthoxOES;
-const GLMessage_Function GLMessage::glPixelStorei;
-const GLMessage_Function GLMessage::glPointParameterf;
-const GLMessage_Function GLMessage::glPointParameterfv;
-const GLMessage_Function GLMessage::glPointParameterx;
-const GLMessage_Function GLMessage::glPointParameterxOES;
-const GLMessage_Function GLMessage::glPointParameterxv;
-const GLMessage_Function GLMessage::glPointParameterxvOES;
-const GLMessage_Function GLMessage::glPointSize;
-const GLMessage_Function GLMessage::glPointSizePointerOES;
-const GLMessage_Function GLMessage::glPointSizex;
-const GLMessage_Function GLMessage::glPointSizexOES;
-const GLMessage_Function GLMessage::glPolygonOffset;
-const GLMessage_Function GLMessage::glPolygonOffsetx;
-const GLMessage_Function GLMessage::glPolygonOffsetxOES;
-const GLMessage_Function GLMessage::glPopMatrix;
-const GLMessage_Function GLMessage::glProgramBinaryOES;
-const GLMessage_Function GLMessage::glPushMatrix;
-const GLMessage_Function GLMessage::glQueryMatrixxOES;
-const GLMessage_Function GLMessage::glReadPixels;
-const GLMessage_Function GLMessage::glReleaseShaderCompiler;
-const GLMessage_Function GLMessage::glRenderbufferStorage;
-const GLMessage_Function GLMessage::glRenderbufferStorageMultisampleIMG;
-const GLMessage_Function GLMessage::glRenderbufferStorageOES;
-const GLMessage_Function GLMessage::glRotatef;
-const GLMessage_Function GLMessage::glRotatex;
-const GLMessage_Function GLMessage::glRotatexOES;
-const GLMessage_Function GLMessage::glSampleCoverage;
-const GLMessage_Function GLMessage::glSampleCoveragex;
-const GLMessage_Function GLMessage::glSampleCoveragexOES;
-const GLMessage_Function GLMessage::glScalef;
-const GLMessage_Function GLMessage::glScalex;
-const GLMessage_Function GLMessage::glScalexOES;
-const GLMessage_Function GLMessage::glScissor;
-const GLMessage_Function GLMessage::glSelectPerfMonitorCountersAMD;
-const GLMessage_Function GLMessage::glSetFenceNV;
-const GLMessage_Function GLMessage::glShadeModel;
-const GLMessage_Function GLMessage::glShaderBinary;
-const GLMessage_Function GLMessage::glShaderSource;
-const GLMessage_Function GLMessage::glStartTilingQCOM;
-const GLMessage_Function GLMessage::glStencilFunc;
-const GLMessage_Function GLMessage::glStencilFuncSeparate;
-const GLMessage_Function GLMessage::glStencilMask;
-const GLMessage_Function GLMessage::glStencilMaskSeparate;
-const GLMessage_Function GLMessage::glStencilOp;
-const GLMessage_Function GLMessage::glStencilOpSeparate;
-const GLMessage_Function GLMessage::glTestFenceNV;
-const GLMessage_Function GLMessage::glTexCoordPointer;
-const GLMessage_Function GLMessage::glTexEnvf;
-const GLMessage_Function GLMessage::glTexEnvfv;
-const GLMessage_Function GLMessage::glTexEnvi;
-const GLMessage_Function GLMessage::glTexEnviv;
-const GLMessage_Function GLMessage::glTexEnvx;
-const GLMessage_Function GLMessage::glTexEnvxOES;
-const GLMessage_Function GLMessage::glTexEnvxv;
-const GLMessage_Function GLMessage::glTexEnvxvOES;
-const GLMessage_Function GLMessage::glTexGenfOES;
-const GLMessage_Function GLMessage::glTexGenfvOES;
-const GLMessage_Function GLMessage::glTexGeniOES;
-const GLMessage_Function GLMessage::glTexGenivOES;
-const GLMessage_Function GLMessage::glTexGenxOES;
-const GLMessage_Function GLMessage::glTexGenxvOES;
-const GLMessage_Function GLMessage::glTexImage2D;
-const GLMessage_Function GLMessage::glTexImage3DOES;
-const GLMessage_Function GLMessage::glTexParameterf;
-const GLMessage_Function GLMessage::glTexParameterfv;
-const GLMessage_Function GLMessage::glTexParameteri;
-const GLMessage_Function GLMessage::glTexParameteriv;
-const GLMessage_Function GLMessage::glTexParameterx;
-const GLMessage_Function GLMessage::glTexParameterxOES;
-const GLMessage_Function GLMessage::glTexParameterxv;
-const GLMessage_Function GLMessage::glTexParameterxvOES;
-const GLMessage_Function GLMessage::glTexSubImage2D;
-const GLMessage_Function GLMessage::glTexSubImage3DOES;
-const GLMessage_Function GLMessage::glTranslatef;
-const GLMessage_Function GLMessage::glTranslatex;
-const GLMessage_Function GLMessage::glTranslatexOES;
-const GLMessage_Function GLMessage::glUniform1f;
-const GLMessage_Function GLMessage::glUniform1fv;
-const GLMessage_Function GLMessage::glUniform1i;
-const GLMessage_Function GLMessage::glUniform1iv;
-const GLMessage_Function GLMessage::glUniform2f;
-const GLMessage_Function GLMessage::glUniform2fv;
-const GLMessage_Function GLMessage::glUniform2i;
-const GLMessage_Function GLMessage::glUniform2iv;
-const GLMessage_Function GLMessage::glUniform3f;
-const GLMessage_Function GLMessage::glUniform3fv;
-const GLMessage_Function GLMessage::glUniform3i;
-const GLMessage_Function GLMessage::glUniform3iv;
-const GLMessage_Function GLMessage::glUniform4f;
-const GLMessage_Function GLMessage::glUniform4fv;
-const GLMessage_Function GLMessage::glUniform4i;
-const GLMessage_Function GLMessage::glUniform4iv;
-const GLMessage_Function GLMessage::glUniformMatrix2fv;
-const GLMessage_Function GLMessage::glUniformMatrix3fv;
-const GLMessage_Function GLMessage::glUniformMatrix4fv;
-const GLMessage_Function GLMessage::glUnmapBufferOES;
-const GLMessage_Function GLMessage::glUseProgram;
-const GLMessage_Function GLMessage::glValidateProgram;
-const GLMessage_Function GLMessage::glVertexAttrib1f;
-const GLMessage_Function GLMessage::glVertexAttrib1fv;
-const GLMessage_Function GLMessage::glVertexAttrib2f;
-const GLMessage_Function GLMessage::glVertexAttrib2fv;
-const GLMessage_Function GLMessage::glVertexAttrib3f;
-const GLMessage_Function GLMessage::glVertexAttrib3fv;
-const GLMessage_Function GLMessage::glVertexAttrib4f;
-const GLMessage_Function GLMessage::glVertexAttrib4fv;
-const GLMessage_Function GLMessage::glVertexAttribPointer;
-const GLMessage_Function GLMessage::glVertexPointer;
-const GLMessage_Function GLMessage::glViewport;
-const GLMessage_Function GLMessage::glWeightPointerOES;
-const GLMessage_Function GLMessage::glReadBuffer;
-const GLMessage_Function GLMessage::glDrawRangeElements;
-const GLMessage_Function GLMessage::glTexImage3D;
-const GLMessage_Function GLMessage::glTexSubImage3D;
-const GLMessage_Function GLMessage::glCopyTexSubImage3D;
-const GLMessage_Function GLMessage::glCompressedTexImage3D;
-const GLMessage_Function GLMessage::glCompressedTexSubImage3D;
-const GLMessage_Function GLMessage::glGenQueries;
-const GLMessage_Function GLMessage::glDeleteQueries;
-const GLMessage_Function GLMessage::glIsQuery;
-const GLMessage_Function GLMessage::glBeginQuery;
-const GLMessage_Function GLMessage::glEndQuery;
-const GLMessage_Function GLMessage::glGetQueryiv;
-const GLMessage_Function GLMessage::glGetQueryObjectuiv;
-const GLMessage_Function GLMessage::glUnmapBuffer;
-const GLMessage_Function GLMessage::glGetBufferPointerv;
-const GLMessage_Function GLMessage::glDrawBuffers;
-const GLMessage_Function GLMessage::glUniformMatrix2x3fv;
-const GLMessage_Function GLMessage::glUniformMatrix3x2fv;
-const GLMessage_Function GLMessage::glUniformMatrix2x4fv;
-const GLMessage_Function GLMessage::glUniformMatrix4x2fv;
-const GLMessage_Function GLMessage::glUniformMatrix3x4fv;
-const GLMessage_Function GLMessage::glUniformMatrix4x3fv;
-const GLMessage_Function GLMessage::glBlitFramebuffer;
-const GLMessage_Function GLMessage::glRenderbufferStorageMultisample;
-const GLMessage_Function GLMessage::glFramebufferTextureLayer;
-const GLMessage_Function GLMessage::glMapBufferRange;
-const GLMessage_Function GLMessage::glFlushMappedBufferRange;
-const GLMessage_Function GLMessage::glBindVertexArray;
-const GLMessage_Function GLMessage::glDeleteVertexArrays;
-const GLMessage_Function GLMessage::glGenVertexArrays;
-const GLMessage_Function GLMessage::glIsVertexArray;
-const GLMessage_Function GLMessage::glGetIntegeri_v;
-const GLMessage_Function GLMessage::glBeginTransformFeedback;
-const GLMessage_Function GLMessage::glEndTransformFeedback;
-const GLMessage_Function GLMessage::glBindBufferRange;
-const GLMessage_Function GLMessage::glBindBufferBase;
-const GLMessage_Function GLMessage::glTransformFeedbackVaryings;
-const GLMessage_Function GLMessage::glGetTransformFeedbackVarying;
-const GLMessage_Function GLMessage::glVertexAttribIPointer;
-const GLMessage_Function GLMessage::glGetVertexAttribIiv;
-const GLMessage_Function GLMessage::glGetVertexAttribIuiv;
-const GLMessage_Function GLMessage::glVertexAttribI4i;
-const GLMessage_Function GLMessage::glVertexAttribI4ui;
-const GLMessage_Function GLMessage::glVertexAttribI4iv;
-const GLMessage_Function GLMessage::glVertexAttribI4uiv;
-const GLMessage_Function GLMessage::glGetUniformuiv;
-const GLMessage_Function GLMessage::glGetFragDataLocation;
-const GLMessage_Function GLMessage::glUniform1ui;
-const GLMessage_Function GLMessage::glUniform2ui;
-const GLMessage_Function GLMessage::glUniform3ui;
-const GLMessage_Function GLMessage::glUniform4ui;
-const GLMessage_Function GLMessage::glUniform1uiv;
-const GLMessage_Function GLMessage::glUniform2uiv;
-const GLMessage_Function GLMessage::glUniform3uiv;
-const GLMessage_Function GLMessage::glUniform4uiv;
-const GLMessage_Function GLMessage::glClearBufferiv;
-const GLMessage_Function GLMessage::glClearBufferuiv;
-const GLMessage_Function GLMessage::glClearBufferfv;
-const GLMessage_Function GLMessage::glClearBufferfi;
-const GLMessage_Function GLMessage::glGetStringi;
-const GLMessage_Function GLMessage::glCopyBufferSubData;
-const GLMessage_Function GLMessage::glGetUniformIndices;
-const GLMessage_Function GLMessage::glGetActiveUniformsiv;
-const GLMessage_Function GLMessage::glGetUniformBlockIndex;
-const GLMessage_Function GLMessage::glGetActiveUniformBlockiv;
-const GLMessage_Function GLMessage::glGetActiveUniformBlockName;
-const GLMessage_Function GLMessage::glUniformBlockBinding;
-const GLMessage_Function GLMessage::glDrawArraysInstanced;
-const GLMessage_Function GLMessage::glDrawElementsInstanced;
-const GLMessage_Function GLMessage::glFenceSync;
-const GLMessage_Function GLMessage::glIsSync;
-const GLMessage_Function GLMessage::glDeleteSync;
-const GLMessage_Function GLMessage::glClientWaitSync;
-const GLMessage_Function GLMessage::glWaitSync;
-const GLMessage_Function GLMessage::glGetInteger64v;
-const GLMessage_Function GLMessage::glGetSynciv;
-const GLMessage_Function GLMessage::glGetInteger64i_v;
-const GLMessage_Function GLMessage::glGetBufferParameteri64v;
-const GLMessage_Function GLMessage::glGenSamplers;
-const GLMessage_Function GLMessage::glDeleteSamplers;
-const GLMessage_Function GLMessage::glIsSampler;
-const GLMessage_Function GLMessage::glBindSampler;
-const GLMessage_Function GLMessage::glSamplerParameteri;
-const GLMessage_Function GLMessage::glSamplerParameteriv;
-const GLMessage_Function GLMessage::glSamplerParameterf;
-const GLMessage_Function GLMessage::glSamplerParameterfv;
-const GLMessage_Function GLMessage::glGetSamplerParameteriv;
-const GLMessage_Function GLMessage::glGetSamplerParameterfv;
-const GLMessage_Function GLMessage::glVertexAttribDivisor;
-const GLMessage_Function GLMessage::glBindTransformFeedback;
-const GLMessage_Function GLMessage::glDeleteTransformFeedbacks;
-const GLMessage_Function GLMessage::glGenTransformFeedbacks;
-const GLMessage_Function GLMessage::glIsTransformFeedback;
-const GLMessage_Function GLMessage::glPauseTransformFeedback;
-const GLMessage_Function GLMessage::glResumeTransformFeedback;
-const GLMessage_Function GLMessage::glGetProgramBinary;
-const GLMessage_Function GLMessage::glProgramBinary;
-const GLMessage_Function GLMessage::glProgramParameteri;
-const GLMessage_Function GLMessage::glInvalidateFramebuffer;
-const GLMessage_Function GLMessage::glInvalidateSubFramebuffer;
-const GLMessage_Function GLMessage::glTexStorage2D;
-const GLMessage_Function GLMessage::glTexStorage3D;
-const GLMessage_Function GLMessage::glGetInternalformativ;
-const GLMessage_Function GLMessage::glBeginPerfQueryINTEL;
-const GLMessage_Function GLMessage::glCreatePerfQueryINTEL;
-const GLMessage_Function GLMessage::glDeletePerfQueryINTEL;
-const GLMessage_Function GLMessage::glEndPerfQueryINTEL;
-const GLMessage_Function GLMessage::glGetFirstPerfQueryIdINTEL;
-const GLMessage_Function GLMessage::glGetNextPerfQueryIdINTEL;
-const GLMessage_Function GLMessage::glGetPerfCounterInfoINTEL;
-const GLMessage_Function GLMessage::glGetPerfQueryDataINTEL;
-const GLMessage_Function GLMessage::glGetPerfQueryIdByNameINTEL;
-const GLMessage_Function GLMessage::glGetPerfQueryInfoINTEL;
-const GLMessage_Function GLMessage::glBlendBarrierKHR;
-const GLMessage_Function GLMessage::glBlendBarrierNV;
-const GLMessage_Function GLMessage::glBlendParameteriNV;
-const GLMessage_Function GLMessage::glBlitFramebufferNV;
-const GLMessage_Function GLMessage::glFenceSyncAPPLE;
-const GLMessage_Function GLMessage::glIsSyncAPPLE;
-const GLMessage_Function GLMessage::glDeleteSyncAPPLE;
-const GLMessage_Function GLMessage::glClientWaitSyncAPPLE;
-const GLMessage_Function GLMessage::glWaitSyncAPPLE;
-const GLMessage_Function GLMessage::glGetInteger64vAPPLE;
-const GLMessage_Function GLMessage::glGetSyncivAPPLE;
-const GLMessage_Function GLMessage::glCopyBufferSubDataNV;
-const GLMessage_Function GLMessage::glActiveShaderProgramEXT;
-const GLMessage_Function GLMessage::glAlphaFuncQCOM;
-const GLMessage_Function GLMessage::glBeginQueryEXT;
-const GLMessage_Function GLMessage::glBindProgramPipelineEXT;
-const GLMessage_Function GLMessage::glBlitFramebufferANGLE;
-const GLMessage_Function GLMessage::glCreateShaderProgramvEXT;
-const GLMessage_Function GLMessage::glDeleteProgramPipelinesEXT;
-const GLMessage_Function GLMessage::glDeleteQueriesEXT;
-const GLMessage_Function GLMessage::glDrawBuffersNV;
-const GLMessage_Function GLMessage::glEndQueryEXT;
-const GLMessage_Function GLMessage::glFramebufferTexture2DMultisampleEXT;
-const GLMessage_Function GLMessage::glGenProgramPipelinesEXT;
-const GLMessage_Function GLMessage::glGenQueriesEXT;
-const GLMessage_Function GLMessage::glGetGraphicsResetStatusEXT;
-const GLMessage_Function GLMessage::glGetObjectLabelEXT;
-const GLMessage_Function GLMessage::glGetProgramPipelineInfoLogEXT;
-const GLMessage_Function GLMessage::glGetProgramPipelineivEXT;
-const GLMessage_Function GLMessage::glGetQueryObjectuivEXT;
-const GLMessage_Function GLMessage::glGetQueryivEXT;
-const GLMessage_Function GLMessage::glGetnUniformfvEXT;
-const GLMessage_Function GLMessage::glGetnUniformivEXT;
-const GLMessage_Function GLMessage::glInsertEventMarkerEXT;
-const GLMessage_Function GLMessage::glIsProgramPipelineEXT;
-const GLMessage_Function GLMessage::glIsQueryEXT;
-const GLMessage_Function GLMessage::glLabelObjectEXT;
-const GLMessage_Function GLMessage::glPopGroupMarkerEXT;
-const GLMessage_Function GLMessage::glProgramParameteriEXT;
-const GLMessage_Function GLMessage::glProgramUniform1fEXT;
-const GLMessage_Function GLMessage::glProgramUniform1fvEXT;
-const GLMessage_Function GLMessage::glProgramUniform1iEXT;
-const GLMessage_Function GLMessage::glProgramUniform1ivEXT;
-const GLMessage_Function GLMessage::glProgramUniform2fEXT;
-const GLMessage_Function GLMessage::glProgramUniform2fvEXT;
-const GLMessage_Function GLMessage::glProgramUniform2iEXT;
-const GLMessage_Function GLMessage::glProgramUniform2ivEXT;
-const GLMessage_Function GLMessage::glProgramUniform3fEXT;
-const GLMessage_Function GLMessage::glProgramUniform3fvEXT;
-const GLMessage_Function GLMessage::glProgramUniform3iEXT;
-const GLMessage_Function GLMessage::glProgramUniform3ivEXT;
-const GLMessage_Function GLMessage::glProgramUniform4fEXT;
-const GLMessage_Function GLMessage::glProgramUniform4fvEXT;
-const GLMessage_Function GLMessage::glProgramUniform4iEXT;
-const GLMessage_Function GLMessage::glProgramUniform4ivEXT;
-const GLMessage_Function GLMessage::glProgramUniformMatrix2fvEXT;
-const GLMessage_Function GLMessage::glProgramUniformMatrix3fvEXT;
-const GLMessage_Function GLMessage::glProgramUniformMatrix4fvEXT;
-const GLMessage_Function GLMessage::glPushGroupMarkerEXT;
-const GLMessage_Function GLMessage::glReadBufferNV;
-const GLMessage_Function GLMessage::glReadnPixelsEXT;
-const GLMessage_Function GLMessage::glRenderbufferStorageMultisampleANGLE;
-const GLMessage_Function GLMessage::glRenderbufferStorageMultisampleAPPLE;
-const GLMessage_Function GLMessage::glRenderbufferStorageMultisampleEXT;
-const GLMessage_Function GLMessage::glResolveMultisampleFramebufferAPPLE;
-const GLMessage_Function GLMessage::glTexStorage1DEXT;
-const GLMessage_Function GLMessage::glTexStorage2DEXT;
-const GLMessage_Function GLMessage::glTexStorage3DEXT;
-const GLMessage_Function GLMessage::glTextureStorage1DEXT;
-const GLMessage_Function GLMessage::glTextureStorage2DEXT;
-const GLMessage_Function GLMessage::glTextureStorage3DEXT;
-const GLMessage_Function GLMessage::glUseProgramStagesEXT;
-const GLMessage_Function GLMessage::glValidateProgramPipelineEXT;
-const GLMessage_Function GLMessage::glCopyTextureLevelsAPPLE;
-const GLMessage_Function GLMessage::glDebugMessageControlKHR;
-const GLMessage_Function GLMessage::glDebugMessageInsertKHR;
-const GLMessage_Function GLMessage::glDebugMessageCallbackKHR;
-const GLMessage_Function GLMessage::glGetDebugMessageLogKHR;
-const GLMessage_Function GLMessage::glPushDebugGroupKHR;
-const GLMessage_Function GLMessage::glPopDebugGroupKHR;
-const GLMessage_Function GLMessage::glObjectLabelKHR;
-const GLMessage_Function GLMessage::glGetObjectLabelKHR;
-const GLMessage_Function GLMessage::glObjectPtrLabelKHR;
-const GLMessage_Function GLMessage::glGetObjectPtrLabelKHR;
-const GLMessage_Function GLMessage::glGetPointervKHR;
-const GLMessage_Function GLMessage::glDrawArraysInstancedANGLE;
-const GLMessage_Function GLMessage::glDrawElementsInstancedANGLE;
-const GLMessage_Function GLMessage::glVertexAttribDivisorANGLE;
-const GLMessage_Function GLMessage::glDrawArraysInstancedEXT;
-const GLMessage_Function GLMessage::glDrawElementsInstancedEXT;
-const GLMessage_Function GLMessage::glVertexAttribDivisorEXT;
-const GLMessage_Function GLMessage::glDrawArraysInstancedNV;
-const GLMessage_Function GLMessage::glDrawElementsInstancedNV;
-const GLMessage_Function GLMessage::glVertexAttribDivisorNV;
-const GLMessage_Function GLMessage::glDrawBuffersEXT;
-const GLMessage_Function GLMessage::glReadBufferIndexedEXT;
-const GLMessage_Function GLMessage::glDrawBuffersIndexedEXT;
-const GLMessage_Function GLMessage::glGetIntegeri_vEXT;
-const GLMessage_Function GLMessage::glMapBufferRangeEXT;
-const GLMessage_Function GLMessage::glFlushMappedBufferRangeEXT;
-const GLMessage_Function GLMessage::glQueryCounterEXT;
-const GLMessage_Function GLMessage::glGetQueryObjecti64vEXT;
-const GLMessage_Function GLMessage::glGetQueryObjectivEXT;
-const GLMessage_Function GLMessage::glGetQueryObjectui64vEXT;
-const GLMessage_Function GLMessage::glGetTranslatedShaderSourceANGLE;
-const GLMessage_Function GLMessage::glMinSampleShadingOES;
-const GLMessage_Function GLMessage::glMultiTexCoord1bOES;
-const GLMessage_Function GLMessage::glMultiTexCoord1bvOES;
-const GLMessage_Function GLMessage::glMultiTexCoord2bOES;
-const GLMessage_Function GLMessage::glMultiTexCoord2bvOES;
-const GLMessage_Function GLMessage::glMultiTexCoord3bOES;
-const GLMessage_Function GLMessage::glMultiTexCoord3bvOES;
-const GLMessage_Function GLMessage::glMultiTexCoord4bOES;
-const GLMessage_Function GLMessage::glMultiTexCoord4bvOES;
-const GLMessage_Function GLMessage::glTexCoord1bOES;
-const GLMessage_Function GLMessage::glTexCoord1bvOES;
-const GLMessage_Function GLMessage::glTexCoord2bOES;
-const GLMessage_Function GLMessage::glTexCoord2bvOES;
-const GLMessage_Function GLMessage::glTexCoord3bOES;
-const GLMessage_Function GLMessage::glTexCoord3bvOES;
-const GLMessage_Function GLMessage::glTexCoord4bOES;
-const GLMessage_Function GLMessage::glTexCoord4bvOES;
-const GLMessage_Function GLMessage::glVertex2bOES;
-const GLMessage_Function GLMessage::glVertex2bvOES;
-const GLMessage_Function GLMessage::glVertex3bOES;
-const GLMessage_Function GLMessage::glVertex3bvOES;
-const GLMessage_Function GLMessage::glVertex4bOES;
-const GLMessage_Function GLMessage::glVertex4bvOES;
-const GLMessage_Function GLMessage::glProgramUniform1uiEXT;
-const GLMessage_Function GLMessage::glProgramUniform2uiEXT;
-const GLMessage_Function GLMessage::glProgramUniform3uiEXT;
-const GLMessage_Function GLMessage::glProgramUniform4uiEXT;
-const GLMessage_Function GLMessage::glProgramUniform1uivEXT;
-const GLMessage_Function GLMessage::glProgramUniform2uivEXT;
-const GLMessage_Function GLMessage::glProgramUniform3uivEXT;
-const GLMessage_Function GLMessage::glProgramUniform4uivEXT;
-const GLMessage_Function GLMessage::glProgramUniformMatrix2x3fvEXT;
-const GLMessage_Function GLMessage::glProgramUniformMatrix3x2fvEXT;
-const GLMessage_Function GLMessage::glProgramUniformMatrix2x4fvEXT;
-const GLMessage_Function GLMessage::glProgramUniformMatrix4x2fvEXT;
-const GLMessage_Function GLMessage::glProgramUniformMatrix3x4fvEXT;
-const GLMessage_Function GLMessage::glProgramUniformMatrix4x3fvEXT;
-const GLMessage_Function GLMessage::glRenderbufferStorageMultisampleNV;
-const GLMessage_Function GLMessage::glSampleCoverageOES;
-const GLMessage_Function GLMessage::glTexStorage3DMultisampleOES;
-const GLMessage_Function GLMessage::glUniformMatrix2x3fvNV;
-const GLMessage_Function GLMessage::glUniformMatrix3x2fvNV;
-const GLMessage_Function GLMessage::glUniformMatrix2x4fvNV;
-const GLMessage_Function GLMessage::glUniformMatrix4x2fvNV;
-const GLMessage_Function GLMessage::glUniformMatrix3x4fvNV;
-const GLMessage_Function GLMessage::glUniformMatrix4x3fvNV;
-const GLMessage_Function GLMessage::glActiveShaderProgram;
-const GLMessage_Function GLMessage::glBindImageTexture;
-const GLMessage_Function GLMessage::glBindProgramPipeline;
-const GLMessage_Function GLMessage::glBindVertexBuffer;
-const GLMessage_Function GLMessage::glCreateShaderProgramv;
-const GLMessage_Function GLMessage::glDeleteProgramPipelines;
-const GLMessage_Function GLMessage::glDispatchCompute;
-const GLMessage_Function GLMessage::glDispatchComputeIndirect;
-const GLMessage_Function GLMessage::glDrawArraysIndirect;
-const GLMessage_Function GLMessage::glDrawElementsIndirect;
-const GLMessage_Function GLMessage::glFramebufferParameteri;
-const GLMessage_Function GLMessage::glGenProgramPipelines;
-const GLMessage_Function GLMessage::glGetBooleani_v;
-const GLMessage_Function GLMessage::glGetFramebufferParameteriv;
-const GLMessage_Function GLMessage::glGetMultisamplefv;
-const GLMessage_Function GLMessage::glGetProgramInterfaceiv;
-const GLMessage_Function GLMessage::glGetProgramPipelineInfoLog;
-const GLMessage_Function GLMessage::glGetProgramPipelineiv;
-const GLMessage_Function GLMessage::glGetProgramResourceIndex;
-const GLMessage_Function GLMessage::glGetProgramResourceLocation;
-const GLMessage_Function GLMessage::glGetProgramResourceName;
-const GLMessage_Function GLMessage::glGetProgramResourceiv;
-const GLMessage_Function GLMessage::glGetTexLevelParameterfv;
-const GLMessage_Function GLMessage::glGetTexLevelParameteriv;
-const GLMessage_Function GLMessage::glIsProgramPipeline;
-const GLMessage_Function GLMessage::glMemoryBarrier;
-const GLMessage_Function GLMessage::glMemoryBarrierByRegion;
-const GLMessage_Function GLMessage::glProgramUniform1f;
-const GLMessage_Function GLMessage::glProgramUniform1fv;
-const GLMessage_Function GLMessage::glProgramUniform1i;
-const GLMessage_Function GLMessage::glProgramUniform1iv;
-const GLMessage_Function GLMessage::glProgramUniform1ui;
-const GLMessage_Function GLMessage::glProgramUniform1uiv;
-const GLMessage_Function GLMessage::glProgramUniform2f;
-const GLMessage_Function GLMessage::glProgramUniform2fv;
-const GLMessage_Function GLMessage::glProgramUniform2i;
-const GLMessage_Function GLMessage::glProgramUniform2iv;
-const GLMessage_Function GLMessage::glProgramUniform2ui;
-const GLMessage_Function GLMessage::glProgramUniform2uiv;
-const GLMessage_Function GLMessage::glProgramUniform3f;
-const GLMessage_Function GLMessage::glProgramUniform3fv;
-const GLMessage_Function GLMessage::glProgramUniform3i;
-const GLMessage_Function GLMessage::glProgramUniform3iv;
-const GLMessage_Function GLMessage::glProgramUniform3ui;
-const GLMessage_Function GLMessage::glProgramUniform3uiv;
-const GLMessage_Function GLMessage::glProgramUniform4f;
-const GLMessage_Function GLMessage::glProgramUniform4fv;
-const GLMessage_Function GLMessage::glProgramUniform4i;
-const GLMessage_Function GLMessage::glProgramUniform4iv;
-const GLMessage_Function GLMessage::glProgramUniform4ui;
-const GLMessage_Function GLMessage::glProgramUniform4uiv;
-const GLMessage_Function GLMessage::glProgramUniformMatrix2fv;
-const GLMessage_Function GLMessage::glProgramUniformMatrix2x3fv;
-const GLMessage_Function GLMessage::glProgramUniformMatrix2x4fv;
-const GLMessage_Function GLMessage::glProgramUniformMatrix3fv;
-const GLMessage_Function GLMessage::glProgramUniformMatrix3x2fv;
-const GLMessage_Function GLMessage::glProgramUniformMatrix3x4fv;
-const GLMessage_Function GLMessage::glProgramUniformMatrix4fv;
-const GLMessage_Function GLMessage::glProgramUniformMatrix4x2fv;
-const GLMessage_Function GLMessage::glProgramUniformMatrix4x3fv;
-const GLMessage_Function GLMessage::glSampleMaski;
-const GLMessage_Function GLMessage::glTexStorage2DMultisample;
-const GLMessage_Function GLMessage::glUseProgramStages;
-const GLMessage_Function GLMessage::glValidateProgramPipeline;
-const GLMessage_Function GLMessage::glVertexAttribBinding;
-const GLMessage_Function GLMessage::glVertexAttribFormat;
-const GLMessage_Function GLMessage::glVertexAttribIFormat;
-const GLMessage_Function GLMessage::glVertexBindingDivisor;
-const GLMessage_Function GLMessage::glBlendEquationSeparateiEXT;
-const GLMessage_Function GLMessage::glBlendEquationiEXT;
-const GLMessage_Function GLMessage::glBlendFuncSeparateiEXT;
-const GLMessage_Function GLMessage::glBlendFunciEXT;
-const GLMessage_Function GLMessage::glColorMaskiEXT;
-const GLMessage_Function GLMessage::glCopyImageSubDataEXT;
-const GLMessage_Function GLMessage::glDisableiEXT;
-const GLMessage_Function GLMessage::glEnableiEXT;
-const GLMessage_Function GLMessage::glFramebufferTextureEXT;
-const GLMessage_Function GLMessage::glGetSamplerParameterIivEXT;
-const GLMessage_Function GLMessage::glGetSamplerParameterIuivEXT;
-const GLMessage_Function GLMessage::glGetTexParameterIivEXT;
-const GLMessage_Function GLMessage::glGetTexParameterIuivEXT;
-const GLMessage_Function GLMessage::glIsEnablediEXT;
-const GLMessage_Function GLMessage::glPatchParameteriEXT;
-const GLMessage_Function GLMessage::glPrimitiveBoundingBoxEXT;
-const GLMessage_Function GLMessage::glSamplerParameterIivEXT;
-const GLMessage_Function GLMessage::glSamplerParameterIuivEXT;
-const GLMessage_Function GLMessage::glTexBufferEXT;
-const GLMessage_Function GLMessage::glTexBufferRangeEXT;
-const GLMessage_Function GLMessage::glTexParameterIivEXT;
-const GLMessage_Function GLMessage::glTexParameterIuivEXT;
-const GLMessage_Function GLMessage::glTextureViewEXT;
-const GLMessage_Function GLMessage::eglGetDisplay;
-const GLMessage_Function GLMessage::eglInitialize;
-const GLMessage_Function GLMessage::eglTerminate;
-const GLMessage_Function GLMessage::eglGetConfigs;
-const GLMessage_Function GLMessage::eglChooseConfig;
-const GLMessage_Function GLMessage::eglGetConfigAttrib;
-const GLMessage_Function GLMessage::eglCreateWindowSurface;
-const GLMessage_Function GLMessage::eglCreatePixmapSurface;
-const GLMessage_Function GLMessage::eglCreatePbufferSurface;
-const GLMessage_Function GLMessage::eglDestroySurface;
-const GLMessage_Function GLMessage::eglQuerySurface;
-const GLMessage_Function GLMessage::eglCreateContext;
-const GLMessage_Function GLMessage::eglDestroyContext;
-const GLMessage_Function GLMessage::eglMakeCurrent;
-const GLMessage_Function GLMessage::eglGetCurrentContext;
-const GLMessage_Function GLMessage::eglGetCurrentSurface;
-const GLMessage_Function GLMessage::eglGetCurrentDisplay;
-const GLMessage_Function GLMessage::eglQueryContext;
-const GLMessage_Function GLMessage::eglWaitGL;
-const GLMessage_Function GLMessage::eglWaitNative;
-const GLMessage_Function GLMessage::eglSwapBuffers;
-const GLMessage_Function GLMessage::eglCopyBuffers;
-const GLMessage_Function GLMessage::eglGetError;
-const GLMessage_Function GLMessage::eglQueryString;
-const GLMessage_Function GLMessage::eglGetProcAddress;
-const GLMessage_Function GLMessage::eglSurfaceAttrib;
-const GLMessage_Function GLMessage::eglBindTexImage;
-const GLMessage_Function GLMessage::eglReleaseTexImage;
-const GLMessage_Function GLMessage::eglSwapInterval;
-const GLMessage_Function GLMessage::eglBindAPI;
-const GLMessage_Function GLMessage::eglQueryAPI;
-const GLMessage_Function GLMessage::eglWaitClient;
-const GLMessage_Function GLMessage::eglReleaseThread;
-const GLMessage_Function GLMessage::eglCreatePbufferFromClientBuffer;
-const GLMessage_Function GLMessage::eglLockSurfaceKHR;
-const GLMessage_Function GLMessage::eglUnlockSurfaceKHR;
-const GLMessage_Function GLMessage::eglCreateImageKHR;
-const GLMessage_Function GLMessage::eglDestroyImageKHR;
-const GLMessage_Function GLMessage::eglCreateSyncKHR;
-const GLMessage_Function GLMessage::eglDestroySyncKHR;
-const GLMessage_Function GLMessage::eglClientWaitSyncKHR;
-const GLMessage_Function GLMessage::eglGetSyncAttribKHR;
-const GLMessage_Function GLMessage::eglSetSwapRectangleANDROID;
-const GLMessage_Function GLMessage::eglGetRenderBufferANDROID;
-const GLMessage_Function GLMessage::eglGetSystemTimeFrequencyNV;
-const GLMessage_Function GLMessage::eglGetSystemTimeNV;
-const GLMessage_Function GLMessage::invalid;
-const GLMessage_Function GLMessage::glVertexAttribPointerData;
-const GLMessage_Function GLMessage::Function_MIN;
-const GLMessage_Function GLMessage::Function_MAX;
-const int GLMessage::Function_ARRAYSIZE;
-#endif  // _MSC_VER
-bool GLMessage_DataType_Type_IsValid(int value) {
-  switch(value) {
-    case 1:
-    case 2:
-    case 3:
-    case 4:
-    case 5:
-    case 6:
-    case 7:
-    case 8:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#ifndef _MSC_VER
-const GLMessage_DataType_Type GLMessage_DataType::VOID;
-const GLMessage_DataType_Type GLMessage_DataType::CHAR;
-const GLMessage_DataType_Type GLMessage_DataType::BYTE;
-const GLMessage_DataType_Type GLMessage_DataType::INT;
-const GLMessage_DataType_Type GLMessage_DataType::FLOAT;
-const GLMessage_DataType_Type GLMessage_DataType::BOOL;
-const GLMessage_DataType_Type GLMessage_DataType::ENUM;
-const GLMessage_DataType_Type GLMessage_DataType::INT64;
-const GLMessage_DataType_Type GLMessage_DataType::Type_MIN;
-const GLMessage_DataType_Type GLMessage_DataType::Type_MAX;
-const int GLMessage_DataType::Type_ARRAYSIZE;
-#endif  // _MSC_VER
-#ifndef _MSC_VER
-const int GLMessage_DataType::kTypeFieldNumber;
-const int GLMessage_DataType::kIsArrayFieldNumber;
-const int GLMessage_DataType::kIntValueFieldNumber;
-const int GLMessage_DataType::kFloatValueFieldNumber;
-const int GLMessage_DataType::kCharValueFieldNumber;
-const int GLMessage_DataType::kRawBytesFieldNumber;
-const int GLMessage_DataType::kBoolValueFieldNumber;
-const int GLMessage_DataType::kInt64ValueFieldNumber;
-#endif  // !_MSC_VER
-
-GLMessage_DataType::GLMessage_DataType()
-  : ::google::protobuf::MessageLite() {
-  SharedCtor();
-}
-
-void GLMessage_DataType::InitAsDefaultInstance() {
-}
-
-GLMessage_DataType::GLMessage_DataType(const GLMessage_DataType& from)
-  : ::google::protobuf::MessageLite() {
-  SharedCtor();
-  MergeFrom(from);
-}
-
-void GLMessage_DataType::SharedCtor() {
-  _cached_size_ = 0;
-  type_ = 1;
-  isarray_ = false;
-  ::memset(_has_bits_, 0, sizeof(_has_bits_));
-}
-
-GLMessage_DataType::~GLMessage_DataType() {
-  SharedDtor();
-}
-
-void GLMessage_DataType::SharedDtor() {
-  if (this != default_instance_) {
-  }
-}
-
-void GLMessage_DataType::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const GLMessage_DataType& GLMessage_DataType::default_instance() {
-  if (default_instance_ == NULL) protobuf_AddDesc_gltrace_2eproto();  return *default_instance_;
-}
-
-GLMessage_DataType* GLMessage_DataType::default_instance_ = NULL;
-
-GLMessage_DataType* GLMessage_DataType::New() const {
-  return new GLMessage_DataType;
-}
-
-void GLMessage_DataType::Clear() {
-  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
-    type_ = 1;
-    isarray_ = false;
-  }
-  intvalue_.Clear();
-  floatvalue_.Clear();
-  charvalue_.Clear();
-  rawbytes_.Clear();
-  boolvalue_.Clear();
-  int64value_.Clear();
-  ::memset(_has_bits_, 0, sizeof(_has_bits_));
-}
-
-bool GLMessage_DataType::MergePartialFromCodedStream(
-    ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
-  ::google::protobuf::uint32 tag;
-  while ((tag = input->ReadTag()) != 0) {
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // required .android.gltrace.GLMessage.DataType.Type type = 1 [default = VOID];
-      case 1: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::android::gltrace::GLMessage_DataType_Type_IsValid(value)) {
-            set_type(static_cast< ::android::gltrace::GLMessage_DataType_Type >(value));
-          }
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(16)) goto parse_isArray;
-        break;
-      }
-      
-      // required bool isArray = 2 [default = false];
-      case 2: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_isArray:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &isarray_)));
-          _set_bit(1);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(24)) goto parse_intValue;
-        break;
-      }
-      
-      // repeated int32 intValue = 3;
-      case 3: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_intValue:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 1, 24, input, this->mutable_intvalue())));
-        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
-                   == ::google::protobuf::internal::WireFormatLite::
-                      WIRETYPE_LENGTH_DELIMITED) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, this->mutable_intvalue())));
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(24)) goto parse_intValue;
-        if (input->ExpectTag(37)) goto parse_floatValue;
-        break;
-      }
-      
-      // repeated float floatValue = 4;
-      case 4: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
-         parse_floatValue:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 1, 37, input, this->mutable_floatvalue())));
-        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
-                   == ::google::protobuf::internal::WireFormatLite::
-                      WIRETYPE_LENGTH_DELIMITED) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, this->mutable_floatvalue())));
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(37)) goto parse_floatValue;
-        if (input->ExpectTag(42)) goto parse_charValue;
-        break;
-      }
-      
-      // repeated bytes charValue = 5;
-      case 5: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
-         parse_charValue:
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->add_charvalue()));
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(42)) goto parse_charValue;
-        if (input->ExpectTag(50)) goto parse_rawBytes;
-        break;
-      }
-      
-      // repeated bytes rawBytes = 6;
-      case 6: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
-         parse_rawBytes:
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->add_rawbytes()));
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(50)) goto parse_rawBytes;
-        if (input->ExpectTag(56)) goto parse_boolValue;
-        break;
-      }
-      
-      // repeated bool boolValue = 7;
-      case 7: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_boolValue:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 1, 56, input, this->mutable_boolvalue())));
-        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
-                   == ::google::protobuf::internal::WireFormatLite::
-                      WIRETYPE_LENGTH_DELIMITED) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, this->mutable_boolvalue())));
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(56)) goto parse_boolValue;
-        if (input->ExpectTag(64)) goto parse_int64Value;
-        break;
-      }
-      
-      // repeated int64 int64Value = 8;
-      case 8: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_int64Value:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 1, 64, input, this->mutable_int64value())));
-        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
-                   == ::google::protobuf::internal::WireFormatLite::
-                      WIRETYPE_LENGTH_DELIMITED) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, this->mutable_int64value())));
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(64)) goto parse_int64Value;
-        if (input->ExpectAtEnd()) return true;
-        break;
-      }
-      
-      default: {
-      handle_uninterpreted:
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
-          return true;
-        }
-        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
-        break;
-      }
-    }
-  }
-  return true;
-#undef DO_
-}
-
-void GLMessage_DataType::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // required .android.gltrace.GLMessage.DataType.Type type = 1 [default = VOID];
-  if (_has_bit(0)) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      1, this->type(), output);
-  }
-  
-  // required bool isArray = 2 [default = false];
-  if (_has_bit(1)) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->isarray(), output);
-  }
-  
-  // repeated int32 intValue = 3;
-  for (int i = 0; i < this->intvalue_size(); i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(
-      3, this->intvalue(i), output);
-  }
-  
-  // repeated float floatValue = 4;
-  for (int i = 0; i < this->floatvalue_size(); i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(
-      4, this->floatvalue(i), output);
-  }
-  
-  // repeated bytes charValue = 5;
-  for (int i = 0; i < this->charvalue_size(); i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytes(
-      5, this->charvalue(i), output);
-  }
-  
-  // repeated bytes rawBytes = 6;
-  for (int i = 0; i < this->rawbytes_size(); i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytes(
-      6, this->rawbytes(i), output);
-  }
-  
-  // repeated bool boolValue = 7;
-  for (int i = 0; i < this->boolvalue_size(); i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(
-      7, this->boolvalue(i), output);
-  }
-  
-  // repeated int64 int64Value = 8;
-  for (int i = 0; i < this->int64value_size(); i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(
-      8, this->int64value(i), output);
-  }
-  
-}
-
-int GLMessage_DataType::ByteSize() const {
-  int total_size = 0;
-  
-  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
-    // required .android.gltrace.GLMessage.DataType.Type type = 1 [default = VOID];
-    if (has_type()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->type());
-    }
-    
-    // required bool isArray = 2 [default = false];
-    if (has_isarray()) {
-      total_size += 1 + 1;
-    }
-    
-  }
-  // repeated int32 intValue = 3;
-  {
-    int data_size = 0;
-    for (int i = 0; i < this->intvalue_size(); i++) {
-      data_size += ::google::protobuf::internal::WireFormatLite::
-        Int32Size(this->intvalue(i));
-    }
-    total_size += 1 * this->intvalue_size() + data_size;
-  }
-  
-  // repeated float floatValue = 4;
-  {
-    int data_size = 0;
-    data_size = 4 * this->floatvalue_size();
-    total_size += 1 * this->floatvalue_size() + data_size;
-  }
-  
-  // repeated bytes charValue = 5;
-  total_size += 1 * this->charvalue_size();
-  for (int i = 0; i < this->charvalue_size(); i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
-      this->charvalue(i));
-  }
-  
-  // repeated bytes rawBytes = 6;
-  total_size += 1 * this->rawbytes_size();
-  for (int i = 0; i < this->rawbytes_size(); i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
-      this->rawbytes(i));
-  }
-  
-  // repeated bool boolValue = 7;
-  {
-    int data_size = 0;
-    data_size = 1 * this->boolvalue_size();
-    total_size += 1 * this->boolvalue_size() + data_size;
-  }
-  
-  // repeated int64 int64Value = 8;
-  {
-    int data_size = 0;
-    for (int i = 0; i < this->int64value_size(); i++) {
-      data_size += ::google::protobuf::internal::WireFormatLite::
-        Int64Size(this->int64value(i));
-    }
-    total_size += 1 * this->int64value_size() + data_size;
-  }
-  
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = total_size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-  return total_size;
-}
-
-void GLMessage_DataType::CheckTypeAndMergeFrom(
-    const ::google::protobuf::MessageLite& from) {
-  MergeFrom(*::google::protobuf::down_cast<const GLMessage_DataType*>(&from));
-}
-
-void GLMessage_DataType::MergeFrom(const GLMessage_DataType& from) {
-  GOOGLE_CHECK_NE(&from, this);
-  intvalue_.MergeFrom(from.intvalue_);
-  floatvalue_.MergeFrom(from.floatvalue_);
-  charvalue_.MergeFrom(from.charvalue_);
-  rawbytes_.MergeFrom(from.rawbytes_);
-  boolvalue_.MergeFrom(from.boolvalue_);
-  int64value_.MergeFrom(from.int64value_);
-  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
-    if (from._has_bit(0)) {
-      set_type(from.type());
-    }
-    if (from._has_bit(1)) {
-      set_isarray(from.isarray());
-    }
-  }
-}
-
-void GLMessage_DataType::CopyFrom(const GLMessage_DataType& from) {
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool GLMessage_DataType::IsInitialized() const {
-  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
-  
-  return true;
-}
-
-void GLMessage_DataType::Swap(GLMessage_DataType* other) {
-  if (other != this) {
-    std::swap(type_, other->type_);
-    std::swap(isarray_, other->isarray_);
-    intvalue_.Swap(&other->intvalue_);
-    floatvalue_.Swap(&other->floatvalue_);
-    charvalue_.Swap(&other->charvalue_);
-    rawbytes_.Swap(&other->rawbytes_);
-    boolvalue_.Swap(&other->boolvalue_);
-    int64value_.Swap(&other->int64value_);
-    std::swap(_has_bits_[0], other->_has_bits_[0]);
-    std::swap(_cached_size_, other->_cached_size_);
-  }
-}
-
-::std::string GLMessage_DataType::GetTypeName() const {
-  return "android.gltrace.GLMessage.DataType";
-}
-
-
-// -------------------------------------------------------------------
-
-#ifndef _MSC_VER
-const int GLMessage_FrameBuffer::kWidthFieldNumber;
-const int GLMessage_FrameBuffer::kHeightFieldNumber;
-const int GLMessage_FrameBuffer::kContentsFieldNumber;
-#endif  // !_MSC_VER
-
-GLMessage_FrameBuffer::GLMessage_FrameBuffer()
-  : ::google::protobuf::MessageLite() {
-  SharedCtor();
-}
-
-void GLMessage_FrameBuffer::InitAsDefaultInstance() {
-}
-
-GLMessage_FrameBuffer::GLMessage_FrameBuffer(const GLMessage_FrameBuffer& from)
-  : ::google::protobuf::MessageLite() {
-  SharedCtor();
-  MergeFrom(from);
-}
-
-void GLMessage_FrameBuffer::SharedCtor() {
-  _cached_size_ = 0;
-  width_ = 0;
-  height_ = 0;
-  ::memset(_has_bits_, 0, sizeof(_has_bits_));
-}
-
-GLMessage_FrameBuffer::~GLMessage_FrameBuffer() {
-  SharedDtor();
-}
-
-void GLMessage_FrameBuffer::SharedDtor() {
-  if (this != default_instance_) {
-  }
-}
-
-void GLMessage_FrameBuffer::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const GLMessage_FrameBuffer& GLMessage_FrameBuffer::default_instance() {
-  if (default_instance_ == NULL) protobuf_AddDesc_gltrace_2eproto();  return *default_instance_;
-}
-
-GLMessage_FrameBuffer* GLMessage_FrameBuffer::default_instance_ = NULL;
-
-GLMessage_FrameBuffer* GLMessage_FrameBuffer::New() const {
-  return new GLMessage_FrameBuffer;
-}
-
-void GLMessage_FrameBuffer::Clear() {
-  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
-    width_ = 0;
-    height_ = 0;
-  }
-  contents_.Clear();
-  ::memset(_has_bits_, 0, sizeof(_has_bits_));
-}
-
-bool GLMessage_FrameBuffer::MergePartialFromCodedStream(
-    ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
-  ::google::protobuf::uint32 tag;
-  while ((tag = input->ReadTag()) != 0) {
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // required int32 width = 1;
-      case 1: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &width_)));
-          _set_bit(0);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(16)) goto parse_height;
-        break;
-      }
-      
-      // required int32 height = 2;
-      case 2: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_height:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &height_)));
-          _set_bit(1);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(26)) goto parse_contents;
-        break;
-      }
-      
-      // repeated bytes contents = 3;
-      case 3: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
-         parse_contents:
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->add_contents()));
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(26)) goto parse_contents;
-        if (input->ExpectAtEnd()) return true;
-        break;
-      }
-      
-      default: {
-      handle_uninterpreted:
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
-          return true;
-        }
-        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
-        break;
-      }
-    }
-  }
-  return true;
-#undef DO_
-}
-
-void GLMessage_FrameBuffer::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // required int32 width = 1;
-  if (_has_bit(0)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->width(), output);
-  }
-  
-  // required int32 height = 2;
-  if (_has_bit(1)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->height(), output);
-  }
-  
-  // repeated bytes contents = 3;
-  for (int i = 0; i < this->contents_size(); i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytes(
-      3, this->contents(i), output);
-  }
-  
-}
-
-int GLMessage_FrameBuffer::ByteSize() const {
-  int total_size = 0;
-  
-  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
-    // required int32 width = 1;
-    if (has_width()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->width());
-    }
-    
-    // required int32 height = 2;
-    if (has_height()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->height());
-    }
-    
-  }
-  // repeated bytes contents = 3;
-  total_size += 1 * this->contents_size();
-  for (int i = 0; i < this->contents_size(); i++) {
-    total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
-      this->contents(i));
-  }
-  
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = total_size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-  return total_size;
-}
-
-void GLMessage_FrameBuffer::CheckTypeAndMergeFrom(
-    const ::google::protobuf::MessageLite& from) {
-  MergeFrom(*::google::protobuf::down_cast<const GLMessage_FrameBuffer*>(&from));
-}
-
-void GLMessage_FrameBuffer::MergeFrom(const GLMessage_FrameBuffer& from) {
-  GOOGLE_CHECK_NE(&from, this);
-  contents_.MergeFrom(from.contents_);
-  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
-    if (from._has_bit(0)) {
-      set_width(from.width());
-    }
-    if (from._has_bit(1)) {
-      set_height(from.height());
-    }
-  }
-}
-
-void GLMessage_FrameBuffer::CopyFrom(const GLMessage_FrameBuffer& from) {
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool GLMessage_FrameBuffer::IsInitialized() const {
-  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
-  
-  return true;
-}
-
-void GLMessage_FrameBuffer::Swap(GLMessage_FrameBuffer* other) {
-  if (other != this) {
-    std::swap(width_, other->width_);
-    std::swap(height_, other->height_);
-    contents_.Swap(&other->contents_);
-    std::swap(_has_bits_[0], other->_has_bits_[0]);
-    std::swap(_cached_size_, other->_cached_size_);
-  }
-}
-
-::std::string GLMessage_FrameBuffer::GetTypeName() const {
-  return "android.gltrace.GLMessage.FrameBuffer";
-}
-
-
-// -------------------------------------------------------------------
-
-#ifndef _MSC_VER
-const int GLMessage::kContextIdFieldNumber;
-const int GLMessage::kStartTimeFieldNumber;
-const int GLMessage::kDurationFieldNumber;
-const int GLMessage::kFunctionFieldNumber;
-const int GLMessage::kArgsFieldNumber;
-const int GLMessage::kReturnValueFieldNumber;
-const int GLMessage::kFbFieldNumber;
-const int GLMessage::kThreadtimeFieldNumber;
-#endif  // !_MSC_VER
-
-GLMessage::GLMessage()
-  : ::google::protobuf::MessageLite() {
-  SharedCtor();
-}
-
-void GLMessage::InitAsDefaultInstance() {
-  returnvalue_ = const_cast< ::android::gltrace::GLMessage_DataType*>(&::android::gltrace::GLMessage_DataType::default_instance());
-  fb_ = const_cast< ::android::gltrace::GLMessage_FrameBuffer*>(&::android::gltrace::GLMessage_FrameBuffer::default_instance());
-}
-
-GLMessage::GLMessage(const GLMessage& from)
-  : ::google::protobuf::MessageLite() {
-  SharedCtor();
-  MergeFrom(from);
-}
-
-void GLMessage::SharedCtor() {
-  _cached_size_ = 0;
-  context_id_ = 0;
-  start_time_ = GOOGLE_LONGLONG(0);
-  duration_ = 0;
-  function_ = 3000;
-  returnvalue_ = NULL;
-  fb_ = NULL;
-  threadtime_ = 0;
-  ::memset(_has_bits_, 0, sizeof(_has_bits_));
-}
-
-GLMessage::~GLMessage() {
-  SharedDtor();
-}
-
-void GLMessage::SharedDtor() {
-  if (this != default_instance_) {
-    delete returnvalue_;
-    delete fb_;
-  }
-}
-
-void GLMessage::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const GLMessage& GLMessage::default_instance() {
-  if (default_instance_ == NULL) protobuf_AddDesc_gltrace_2eproto();  return *default_instance_;
-}
-
-GLMessage* GLMessage::default_instance_ = NULL;
-
-GLMessage* GLMessage::New() const {
-  return new GLMessage;
-}
-
-void GLMessage::Clear() {
-  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
-    context_id_ = 0;
-    start_time_ = GOOGLE_LONGLONG(0);
-    duration_ = 0;
-    function_ = 3000;
-    if (_has_bit(5)) {
-      if (returnvalue_ != NULL) returnvalue_->::android::gltrace::GLMessage_DataType::Clear();
-    }
-    if (_has_bit(6)) {
-      if (fb_ != NULL) fb_->::android::gltrace::GLMessage_FrameBuffer::Clear();
-    }
-    threadtime_ = 0;
-  }
-  args_.Clear();
-  ::memset(_has_bits_, 0, sizeof(_has_bits_));
-}
-
-bool GLMessage::MergePartialFromCodedStream(
-    ::google::protobuf::io::CodedInputStream* input) {
-#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
-  ::google::protobuf::uint32 tag;
-  while ((tag = input->ReadTag()) != 0) {
-    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // required int32 context_id = 1;
-      case 1: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &context_id_)));
-          _set_bit(0);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(16)) goto parse_start_time;
-        break;
-      }
-      
-      // required int64 start_time = 2;
-      case 2: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_start_time:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
-                 input, &start_time_)));
-          _set_bit(1);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(24)) goto parse_duration;
-        break;
-      }
-      
-      // required int32 duration = 3;
-      case 3: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_duration:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &duration_)));
-          _set_bit(2);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(32)) goto parse_function;
-        break;
-      }
-      
-      // required .android.gltrace.GLMessage.Function function = 4 [default = invalid];
-      case 4: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_function:
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::android::gltrace::GLMessage_Function_IsValid(value)) {
-            set_function(static_cast< ::android::gltrace::GLMessage_Function >(value));
-          }
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(42)) goto parse_args;
-        break;
-      }
-      
-      // repeated .android.gltrace.GLMessage.DataType args = 5;
-      case 5: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
-         parse_args:
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
-                input, add_args()));
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(42)) goto parse_args;
-        if (input->ExpectTag(50)) goto parse_returnValue;
-        break;
-      }
-      
-      // optional .android.gltrace.GLMessage.DataType returnValue = 6;
-      case 6: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
-         parse_returnValue:
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
-               input, mutable_returnvalue()));
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(58)) goto parse_fb;
-        break;
-      }
-      
-      // optional .android.gltrace.GLMessage.FrameBuffer fb = 7;
-      case 7: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
-         parse_fb:
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
-               input, mutable_fb()));
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(64)) goto parse_threadtime;
-        break;
-      }
-      
-      // optional int32 threadtime = 8;
-      case 8: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_threadtime:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &threadtime_)));
-          _set_bit(7);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectAtEnd()) return true;
-        break;
-      }
-      
-      default: {
-      handle_uninterpreted:
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
-          return true;
-        }
-        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
-        break;
-      }
-    }
-  }
-  return true;
-#undef DO_
-}
-
-void GLMessage::SerializeWithCachedSizes(
-    ::google::protobuf::io::CodedOutputStream* output) const {
-  // required int32 context_id = 1;
-  if (_has_bit(0)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->context_id(), output);
-  }
-  
-  // required int64 start_time = 2;
-  if (_has_bit(1)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->start_time(), output);
-  }
-  
-  // required int32 duration = 3;
-  if (_has_bit(2)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->duration(), output);
-  }
-  
-  // required .android.gltrace.GLMessage.Function function = 4 [default = invalid];
-  if (_has_bit(3)) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      4, this->function(), output);
-  }
-  
-  // repeated .android.gltrace.GLMessage.DataType args = 5;
-  for (int i = 0; i < this->args_size(); i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessage(
-      5, this->args(i), output);
-  }
-  
-  // optional .android.gltrace.GLMessage.DataType returnValue = 6;
-  if (_has_bit(5)) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessage(
-      6, this->returnvalue(), output);
-  }
-  
-  // optional .android.gltrace.GLMessage.FrameBuffer fb = 7;
-  if (_has_bit(6)) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessage(
-      7, this->fb(), output);
-  }
-  
-  // optional int32 threadtime = 8;
-  if (_has_bit(7)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->threadtime(), output);
-  }
-  
-}
-
-int GLMessage::ByteSize() const {
-  int total_size = 0;
-  
-  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
-    // required int32 context_id = 1;
-    if (has_context_id()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->context_id());
-    }
-    
-    // required int64 start_time = 2;
-    if (has_start_time()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int64Size(
-          this->start_time());
-    }
-    
-    // required int32 duration = 3;
-    if (has_duration()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->duration());
-    }
-    
-    // required .android.gltrace.GLMessage.Function function = 4 [default = invalid];
-    if (has_function()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->function());
-    }
-    
-    // optional .android.gltrace.GLMessage.DataType returnValue = 6;
-    if (has_returnvalue()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
-          this->returnvalue());
-    }
-    
-    // optional .android.gltrace.GLMessage.FrameBuffer fb = 7;
-    if (has_fb()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
-          this->fb());
-    }
-    
-    // optional int32 threadtime = 8;
-    if (has_threadtime()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->threadtime());
-    }
-    
-  }
-  // repeated .android.gltrace.GLMessage.DataType args = 5;
-  total_size += 1 * this->args_size();
-  for (int i = 0; i < this->args_size(); i++) {
-    total_size +=
-      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
-        this->args(i));
-  }
-  
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = total_size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-  return total_size;
-}
-
-void GLMessage::CheckTypeAndMergeFrom(
-    const ::google::protobuf::MessageLite& from) {
-  MergeFrom(*::google::protobuf::down_cast<const GLMessage*>(&from));
-}
-
-void GLMessage::MergeFrom(const GLMessage& from) {
-  GOOGLE_CHECK_NE(&from, this);
-  args_.MergeFrom(from.args_);
-  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
-    if (from._has_bit(0)) {
-      set_context_id(from.context_id());
-    }
-    if (from._has_bit(1)) {
-      set_start_time(from.start_time());
-    }
-    if (from._has_bit(2)) {
-      set_duration(from.duration());
-    }
-    if (from._has_bit(3)) {
-      set_function(from.function());
-    }
-    if (from._has_bit(5)) {
-      mutable_returnvalue()->::android::gltrace::GLMessage_DataType::MergeFrom(from.returnvalue());
-    }
-    if (from._has_bit(6)) {
-      mutable_fb()->::android::gltrace::GLMessage_FrameBuffer::MergeFrom(from.fb());
-    }
-    if (from._has_bit(7)) {
-      set_threadtime(from.threadtime());
-    }
-  }
-}
-
-void GLMessage::CopyFrom(const GLMessage& from) {
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool GLMessage::IsInitialized() const {
-  if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false;
-  
-  for (int i = 0; i < args_size(); i++) {
-    if (!this->args(i).IsInitialized()) return false;
-  }
-  if (has_returnvalue()) {
-    if (!this->returnvalue().IsInitialized()) return false;
-  }
-  if (has_fb()) {
-    if (!this->fb().IsInitialized()) return false;
-  }
-  return true;
-}
-
-void GLMessage::Swap(GLMessage* other) {
-  if (other != this) {
-    std::swap(context_id_, other->context_id_);
-    std::swap(start_time_, other->start_time_);
-    std::swap(duration_, other->duration_);
-    std::swap(function_, other->function_);
-    args_.Swap(&other->args_);
-    std::swap(returnvalue_, other->returnvalue_);
-    std::swap(fb_, other->fb_);
-    std::swap(threadtime_, other->threadtime_);
-    std::swap(_has_bits_[0], other->_has_bits_[0]);
-    std::swap(_cached_size_, other->_cached_size_);
-  }
-}
-
-::std::string GLMessage::GetTypeName() const {
-  return "android.gltrace.GLMessage";
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace gltrace
-}  // namespace android
-
-// @@protoc_insertion_point(global_scope)
diff --git a/opengl/libs/GLES_trace/src/gltrace.pb.h b/opengl/libs/GLES_trace/src/gltrace.pb.h
deleted file mode 100644
index 9bc7c58..0000000
--- a/opengl/libs/GLES_trace/src/gltrace.pb.h
+++ /dev/null
@@ -1,2525 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: gltrace.proto
-
-#ifndef PROTOBUF_gltrace_2eproto__INCLUDED
-#define PROTOBUF_gltrace_2eproto__INCLUDED
-
-#include <string>
-
-#include <google/protobuf/stubs/common.h>
-
-#if GOOGLE_PROTOBUF_VERSION < 2003000
-#error This file was generated by a newer version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please update
-#error your headers.
-#endif
-#if 2003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
-#error This file was generated by an older version of protoc which is
-#error incompatible with your Protocol Buffer headers.  Please
-#error regenerate this file with a newer version of protoc.
-#endif
-
-#include <google/protobuf/generated_message_util.h>
-#include <google/protobuf/repeated_field.h>
-#include <google/protobuf/extension_set.h>
-// @@protoc_insertion_point(includes)
-
-namespace android {
-namespace gltrace {
-
-// Internal implementation detail -- do not call these.
-void  protobuf_AddDesc_gltrace_2eproto();
-void protobuf_AssignDesc_gltrace_2eproto();
-void protobuf_ShutdownFile_gltrace_2eproto();
-
-class GLMessage;
-class GLMessage_DataType;
-class GLMessage_FrameBuffer;
-
-enum GLMessage_DataType_Type {
-  GLMessage_DataType_Type_VOID = 1,
-  GLMessage_DataType_Type_CHAR = 2,
-  GLMessage_DataType_Type_BYTE = 3,
-  GLMessage_DataType_Type_INT = 4,
-  GLMessage_DataType_Type_FLOAT = 5,
-  GLMessage_DataType_Type_BOOL = 6,
-  GLMessage_DataType_Type_ENUM = 7,
-  GLMessage_DataType_Type_INT64 = 8
-};
-bool GLMessage_DataType_Type_IsValid(int value);
-const GLMessage_DataType_Type GLMessage_DataType_Type_Type_MIN = GLMessage_DataType_Type_VOID;
-const GLMessage_DataType_Type GLMessage_DataType_Type_Type_MAX = GLMessage_DataType_Type_INT64;
-const int GLMessage_DataType_Type_Type_ARRAYSIZE = GLMessage_DataType_Type_Type_MAX + 1;
-
-enum GLMessage_Function {
-  GLMessage_Function_glActiveTexture = 0,
-  GLMessage_Function_glAlphaFunc = 1,
-  GLMessage_Function_glAlphaFuncx = 2,
-  GLMessage_Function_glAlphaFuncxOES = 3,
-  GLMessage_Function_glAttachShader = 4,
-  GLMessage_Function_glBeginPerfMonitorAMD = 5,
-  GLMessage_Function_glBindAttribLocation = 6,
-  GLMessage_Function_glBindBuffer = 7,
-  GLMessage_Function_glBindFramebuffer = 8,
-  GLMessage_Function_glBindFramebufferOES = 9,
-  GLMessage_Function_glBindRenderbuffer = 10,
-  GLMessage_Function_glBindRenderbufferOES = 11,
-  GLMessage_Function_glBindTexture = 12,
-  GLMessage_Function_glBindVertexArrayOES = 13,
-  GLMessage_Function_glBlendColor = 14,
-  GLMessage_Function_glBlendEquation = 15,
-  GLMessage_Function_glBlendEquationOES = 16,
-  GLMessage_Function_glBlendEquationSeparate = 17,
-  GLMessage_Function_glBlendEquationSeparateOES = 18,
-  GLMessage_Function_glBlendFunc = 19,
-  GLMessage_Function_glBlendFuncSeparate = 20,
-  GLMessage_Function_glBlendFuncSeparateOES = 21,
-  GLMessage_Function_glBufferData = 22,
-  GLMessage_Function_glBufferSubData = 23,
-  GLMessage_Function_glCheckFramebufferStatus = 24,
-  GLMessage_Function_glCheckFramebufferStatusOES = 25,
-  GLMessage_Function_glClearColor = 26,
-  GLMessage_Function_glClearColorx = 27,
-  GLMessage_Function_glClearColorxOES = 28,
-  GLMessage_Function_glClearDepthf = 29,
-  GLMessage_Function_glClearDepthfOES = 30,
-  GLMessage_Function_glClearDepthx = 31,
-  GLMessage_Function_glClearDepthxOES = 32,
-  GLMessage_Function_glClear = 33,
-  GLMessage_Function_glClearStencil = 34,
-  GLMessage_Function_glClientActiveTexture = 35,
-  GLMessage_Function_glClipPlanef = 36,
-  GLMessage_Function_glClipPlanefIMG = 37,
-  GLMessage_Function_glClipPlanefOES = 38,
-  GLMessage_Function_glClipPlanex = 39,
-  GLMessage_Function_glClipPlanexIMG = 40,
-  GLMessage_Function_glClipPlanexOES = 41,
-  GLMessage_Function_glColor4f = 42,
-  GLMessage_Function_glColor4ub = 43,
-  GLMessage_Function_glColor4x = 44,
-  GLMessage_Function_glColor4xOES = 45,
-  GLMessage_Function_glColorMask = 46,
-  GLMessage_Function_glColorPointer = 47,
-  GLMessage_Function_glCompileShader = 48,
-  GLMessage_Function_glCompressedTexImage2D = 49,
-  GLMessage_Function_glCompressedTexImage3DOES = 50,
-  GLMessage_Function_glCompressedTexSubImage2D = 51,
-  GLMessage_Function_glCompressedTexSubImage3DOES = 52,
-  GLMessage_Function_glCopyTexImage2D = 53,
-  GLMessage_Function_glCopyTexSubImage2D = 54,
-  GLMessage_Function_glCopyTexSubImage3DOES = 55,
-  GLMessage_Function_glCoverageMaskNV = 56,
-  GLMessage_Function_glCoverageOperationNV = 57,
-  GLMessage_Function_glCreateProgram = 58,
-  GLMessage_Function_glCreateShader = 59,
-  GLMessage_Function_glCullFace = 60,
-  GLMessage_Function_glCurrentPaletteMatrixOES = 61,
-  GLMessage_Function_glDeleteBuffers = 62,
-  GLMessage_Function_glDeleteFencesNV = 63,
-  GLMessage_Function_glDeleteFramebuffers = 64,
-  GLMessage_Function_glDeleteFramebuffersOES = 65,
-  GLMessage_Function_glDeletePerfMonitorsAMD = 66,
-  GLMessage_Function_glDeleteProgram = 67,
-  GLMessage_Function_glDeleteRenderbuffers = 68,
-  GLMessage_Function_glDeleteRenderbuffersOES = 69,
-  GLMessage_Function_glDeleteShader = 70,
-  GLMessage_Function_glDeleteTextures = 71,
-  GLMessage_Function_glDeleteVertexArraysOES = 72,
-  GLMessage_Function_glDepthFunc = 73,
-  GLMessage_Function_glDepthMask = 74,
-  GLMessage_Function_glDepthRangef = 75,
-  GLMessage_Function_glDepthRangefOES = 76,
-  GLMessage_Function_glDepthRangex = 77,
-  GLMessage_Function_glDepthRangexOES = 78,
-  GLMessage_Function_glDetachShader = 79,
-  GLMessage_Function_glDisableClientState = 80,
-  GLMessage_Function_glDisableDriverControlQCOM = 81,
-  GLMessage_Function_glDisable = 82,
-  GLMessage_Function_glDisableVertexAttribArray = 83,
-  GLMessage_Function_glDiscardFramebufferEXT = 84,
-  GLMessage_Function_glDrawArrays = 85,
-  GLMessage_Function_glDrawElements = 86,
-  GLMessage_Function_glDrawTexfOES = 87,
-  GLMessage_Function_glDrawTexfvOES = 88,
-  GLMessage_Function_glDrawTexiOES = 89,
-  GLMessage_Function_glDrawTexivOES = 90,
-  GLMessage_Function_glDrawTexsOES = 91,
-  GLMessage_Function_glDrawTexsvOES = 92,
-  GLMessage_Function_glDrawTexxOES = 93,
-  GLMessage_Function_glDrawTexxvOES = 94,
-  GLMessage_Function_glEGLImageTargetRenderbufferStorageOES = 95,
-  GLMessage_Function_glEGLImageTargetTexture2DOES = 96,
-  GLMessage_Function_glEnableClientState = 97,
-  GLMessage_Function_glEnableDriverControlQCOM = 98,
-  GLMessage_Function_glEnable = 99,
-  GLMessage_Function_glEnableVertexAttribArray = 100,
-  GLMessage_Function_glEndPerfMonitorAMD = 101,
-  GLMessage_Function_glEndTilingQCOM = 102,
-  GLMessage_Function_glExtGetBufferPointervQCOM = 103,
-  GLMessage_Function_glExtGetBuffersQCOM = 104,
-  GLMessage_Function_glExtGetFramebuffersQCOM = 105,
-  GLMessage_Function_glExtGetProgramBinarySourceQCOM = 106,
-  GLMessage_Function_glExtGetProgramsQCOM = 107,
-  GLMessage_Function_glExtGetRenderbuffersQCOM = 108,
-  GLMessage_Function_glExtGetShadersQCOM = 109,
-  GLMessage_Function_glExtGetTexLevelParameterivQCOM = 110,
-  GLMessage_Function_glExtGetTexSubImageQCOM = 111,
-  GLMessage_Function_glExtGetTexturesQCOM = 112,
-  GLMessage_Function_glExtIsProgramBinaryQCOM = 113,
-  GLMessage_Function_glExtTexObjectStateOverrideiQCOM = 114,
-  GLMessage_Function_glFinishFenceNV = 115,
-  GLMessage_Function_glFinish = 116,
-  GLMessage_Function_glFlush = 117,
-  GLMessage_Function_glFogf = 118,
-  GLMessage_Function_glFogfv = 119,
-  GLMessage_Function_glFogx = 120,
-  GLMessage_Function_glFogxOES = 121,
-  GLMessage_Function_glFogxv = 122,
-  GLMessage_Function_glFogxvOES = 123,
-  GLMessage_Function_glFramebufferRenderbuffer = 124,
-  GLMessage_Function_glFramebufferRenderbufferOES = 125,
-  GLMessage_Function_glFramebufferTexture2D = 126,
-  GLMessage_Function_glFramebufferTexture2DMultisampleIMG = 127,
-  GLMessage_Function_glFramebufferTexture2DOES = 128,
-  GLMessage_Function_glFramebufferTexture3DOES = 129,
-  GLMessage_Function_glFrontFace = 130,
-  GLMessage_Function_glFrustumf = 131,
-  GLMessage_Function_glFrustumfOES = 132,
-  GLMessage_Function_glFrustumx = 133,
-  GLMessage_Function_glFrustumxOES = 134,
-  GLMessage_Function_glGenBuffers = 135,
-  GLMessage_Function_glGenerateMipmap = 136,
-  GLMessage_Function_glGenerateMipmapOES = 137,
-  GLMessage_Function_glGenFencesNV = 138,
-  GLMessage_Function_glGenFramebuffers = 139,
-  GLMessage_Function_glGenFramebuffersOES = 140,
-  GLMessage_Function_glGenPerfMonitorsAMD = 141,
-  GLMessage_Function_glGenRenderbuffers = 142,
-  GLMessage_Function_glGenRenderbuffersOES = 143,
-  GLMessage_Function_glGenTextures = 144,
-  GLMessage_Function_glGenVertexArraysOES = 145,
-  GLMessage_Function_glGetActiveAttrib = 146,
-  GLMessage_Function_glGetActiveUniform = 147,
-  GLMessage_Function_glGetAttachedShaders = 148,
-  GLMessage_Function_glGetAttribLocation = 149,
-  GLMessage_Function_glGetBooleanv = 150,
-  GLMessage_Function_glGetBufferParameteriv = 151,
-  GLMessage_Function_glGetBufferPointervOES = 152,
-  GLMessage_Function_glGetClipPlanef = 153,
-  GLMessage_Function_glGetClipPlanefOES = 154,
-  GLMessage_Function_glGetClipPlanex = 155,
-  GLMessage_Function_glGetClipPlanexOES = 156,
-  GLMessage_Function_glGetDriverControlsQCOM = 157,
-  GLMessage_Function_glGetDriverControlStringQCOM = 158,
-  GLMessage_Function_glGetError = 159,
-  GLMessage_Function_glGetFenceivNV = 160,
-  GLMessage_Function_glGetFixedv = 161,
-  GLMessage_Function_glGetFixedvOES = 162,
-  GLMessage_Function_glGetFloatv = 163,
-  GLMessage_Function_glGetFramebufferAttachmentParameteriv = 164,
-  GLMessage_Function_glGetFramebufferAttachmentParameterivOES = 165,
-  GLMessage_Function_glGetIntegerv = 166,
-  GLMessage_Function_glGetLightfv = 167,
-  GLMessage_Function_glGetLightxv = 168,
-  GLMessage_Function_glGetLightxvOES = 169,
-  GLMessage_Function_glGetMaterialfv = 170,
-  GLMessage_Function_glGetMaterialxv = 171,
-  GLMessage_Function_glGetMaterialxvOES = 172,
-  GLMessage_Function_glGetPerfMonitorCounterDataAMD = 173,
-  GLMessage_Function_glGetPerfMonitorCounterInfoAMD = 174,
-  GLMessage_Function_glGetPerfMonitorCountersAMD = 175,
-  GLMessage_Function_glGetPerfMonitorCounterStringAMD = 176,
-  GLMessage_Function_glGetPerfMonitorGroupsAMD = 177,
-  GLMessage_Function_glGetPerfMonitorGroupStringAMD = 178,
-  GLMessage_Function_glGetPointerv = 179,
-  GLMessage_Function_glGetProgramBinaryOES = 180,
-  GLMessage_Function_glGetProgramInfoLog = 181,
-  GLMessage_Function_glGetProgramiv = 182,
-  GLMessage_Function_glGetRenderbufferParameteriv = 183,
-  GLMessage_Function_glGetRenderbufferParameterivOES = 184,
-  GLMessage_Function_glGetShaderInfoLog = 185,
-  GLMessage_Function_glGetShaderiv = 186,
-  GLMessage_Function_glGetShaderPrecisionFormat = 187,
-  GLMessage_Function_glGetShaderSource = 188,
-  GLMessage_Function_glGetString = 189,
-  GLMessage_Function_glGetTexEnvfv = 190,
-  GLMessage_Function_glGetTexEnviv = 191,
-  GLMessage_Function_glGetTexEnvxv = 192,
-  GLMessage_Function_glGetTexEnvxvOES = 193,
-  GLMessage_Function_glGetTexGenfvOES = 194,
-  GLMessage_Function_glGetTexGenivOES = 195,
-  GLMessage_Function_glGetTexGenxvOES = 196,
-  GLMessage_Function_glGetTexParameterfv = 197,
-  GLMessage_Function_glGetTexParameteriv = 198,
-  GLMessage_Function_glGetTexParameterxv = 199,
-  GLMessage_Function_glGetTexParameterxvOES = 200,
-  GLMessage_Function_glGetUniformfv = 201,
-  GLMessage_Function_glGetUniformiv = 202,
-  GLMessage_Function_glGetUniformLocation = 203,
-  GLMessage_Function_glGetVertexAttribfv = 204,
-  GLMessage_Function_glGetVertexAttribiv = 205,
-  GLMessage_Function_glGetVertexAttribPointerv = 206,
-  GLMessage_Function_glHint = 207,
-  GLMessage_Function_glIsBuffer = 208,
-  GLMessage_Function_glIsEnabled = 209,
-  GLMessage_Function_glIsFenceNV = 210,
-  GLMessage_Function_glIsFramebuffer = 211,
-  GLMessage_Function_glIsFramebufferOES = 212,
-  GLMessage_Function_glIsProgram = 213,
-  GLMessage_Function_glIsRenderbuffer = 214,
-  GLMessage_Function_glIsRenderbufferOES = 215,
-  GLMessage_Function_glIsShader = 216,
-  GLMessage_Function_glIsTexture = 217,
-  GLMessage_Function_glIsVertexArrayOES = 218,
-  GLMessage_Function_glLightf = 219,
-  GLMessage_Function_glLightfv = 220,
-  GLMessage_Function_glLightModelf = 221,
-  GLMessage_Function_glLightModelfv = 222,
-  GLMessage_Function_glLightModelx = 223,
-  GLMessage_Function_glLightModelxOES = 224,
-  GLMessage_Function_glLightModelxv = 225,
-  GLMessage_Function_glLightModelxvOES = 226,
-  GLMessage_Function_glLightx = 227,
-  GLMessage_Function_glLightxOES = 228,
-  GLMessage_Function_glLightxv = 229,
-  GLMessage_Function_glLightxvOES = 230,
-  GLMessage_Function_glLineWidth = 231,
-  GLMessage_Function_glLineWidthx = 232,
-  GLMessage_Function_glLineWidthxOES = 233,
-  GLMessage_Function_glLinkProgram = 234,
-  GLMessage_Function_glLoadIdentity = 235,
-  GLMessage_Function_glLoadMatrixf = 236,
-  GLMessage_Function_glLoadMatrixx = 237,
-  GLMessage_Function_glLoadMatrixxOES = 238,
-  GLMessage_Function_glLoadPaletteFromModelViewMatrixOES = 239,
-  GLMessage_Function_glLogicOp = 240,
-  GLMessage_Function_glMapBufferOES = 241,
-  GLMessage_Function_glMaterialf = 242,
-  GLMessage_Function_glMaterialfv = 243,
-  GLMessage_Function_glMaterialx = 244,
-  GLMessage_Function_glMaterialxOES = 245,
-  GLMessage_Function_glMaterialxv = 246,
-  GLMessage_Function_glMaterialxvOES = 247,
-  GLMessage_Function_glMatrixIndexPointerOES = 248,
-  GLMessage_Function_glMatrixMode = 249,
-  GLMessage_Function_glMultiDrawArraysEXT = 250,
-  GLMessage_Function_glMultiDrawElementsEXT = 251,
-  GLMessage_Function_glMultiTexCoord4f = 252,
-  GLMessage_Function_glMultiTexCoord4x = 253,
-  GLMessage_Function_glMultiTexCoord4xOES = 254,
-  GLMessage_Function_glMultMatrixf = 255,
-  GLMessage_Function_glMultMatrixx = 256,
-  GLMessage_Function_glMultMatrixxOES = 257,
-  GLMessage_Function_glNormal3f = 258,
-  GLMessage_Function_glNormal3x = 259,
-  GLMessage_Function_glNormal3xOES = 260,
-  GLMessage_Function_glNormalPointer = 261,
-  GLMessage_Function_glOrthof = 262,
-  GLMessage_Function_glOrthofOES = 263,
-  GLMessage_Function_glOrthox = 264,
-  GLMessage_Function_glOrthoxOES = 265,
-  GLMessage_Function_glPixelStorei = 266,
-  GLMessage_Function_glPointParameterf = 267,
-  GLMessage_Function_glPointParameterfv = 268,
-  GLMessage_Function_glPointParameterx = 269,
-  GLMessage_Function_glPointParameterxOES = 270,
-  GLMessage_Function_glPointParameterxv = 271,
-  GLMessage_Function_glPointParameterxvOES = 272,
-  GLMessage_Function_glPointSize = 273,
-  GLMessage_Function_glPointSizePointerOES = 274,
-  GLMessage_Function_glPointSizex = 275,
-  GLMessage_Function_glPointSizexOES = 276,
-  GLMessage_Function_glPolygonOffset = 277,
-  GLMessage_Function_glPolygonOffsetx = 278,
-  GLMessage_Function_glPolygonOffsetxOES = 279,
-  GLMessage_Function_glPopMatrix = 280,
-  GLMessage_Function_glProgramBinaryOES = 281,
-  GLMessage_Function_glPushMatrix = 282,
-  GLMessage_Function_glQueryMatrixxOES = 283,
-  GLMessage_Function_glReadPixels = 284,
-  GLMessage_Function_glReleaseShaderCompiler = 285,
-  GLMessage_Function_glRenderbufferStorage = 286,
-  GLMessage_Function_glRenderbufferStorageMultisampleIMG = 287,
-  GLMessage_Function_glRenderbufferStorageOES = 288,
-  GLMessage_Function_glRotatef = 289,
-  GLMessage_Function_glRotatex = 290,
-  GLMessage_Function_glRotatexOES = 291,
-  GLMessage_Function_glSampleCoverage = 292,
-  GLMessage_Function_glSampleCoveragex = 293,
-  GLMessage_Function_glSampleCoveragexOES = 294,
-  GLMessage_Function_glScalef = 295,
-  GLMessage_Function_glScalex = 296,
-  GLMessage_Function_glScalexOES = 297,
-  GLMessage_Function_glScissor = 298,
-  GLMessage_Function_glSelectPerfMonitorCountersAMD = 299,
-  GLMessage_Function_glSetFenceNV = 300,
-  GLMessage_Function_glShadeModel = 301,
-  GLMessage_Function_glShaderBinary = 302,
-  GLMessage_Function_glShaderSource = 303,
-  GLMessage_Function_glStartTilingQCOM = 304,
-  GLMessage_Function_glStencilFunc = 305,
-  GLMessage_Function_glStencilFuncSeparate = 306,
-  GLMessage_Function_glStencilMask = 307,
-  GLMessage_Function_glStencilMaskSeparate = 308,
-  GLMessage_Function_glStencilOp = 309,
-  GLMessage_Function_glStencilOpSeparate = 310,
-  GLMessage_Function_glTestFenceNV = 311,
-  GLMessage_Function_glTexCoordPointer = 312,
-  GLMessage_Function_glTexEnvf = 313,
-  GLMessage_Function_glTexEnvfv = 314,
-  GLMessage_Function_glTexEnvi = 315,
-  GLMessage_Function_glTexEnviv = 316,
-  GLMessage_Function_glTexEnvx = 317,
-  GLMessage_Function_glTexEnvxOES = 318,
-  GLMessage_Function_glTexEnvxv = 319,
-  GLMessage_Function_glTexEnvxvOES = 320,
-  GLMessage_Function_glTexGenfOES = 321,
-  GLMessage_Function_glTexGenfvOES = 322,
-  GLMessage_Function_glTexGeniOES = 323,
-  GLMessage_Function_glTexGenivOES = 324,
-  GLMessage_Function_glTexGenxOES = 325,
-  GLMessage_Function_glTexGenxvOES = 326,
-  GLMessage_Function_glTexImage2D = 327,
-  GLMessage_Function_glTexImage3DOES = 328,
-  GLMessage_Function_glTexParameterf = 329,
-  GLMessage_Function_glTexParameterfv = 330,
-  GLMessage_Function_glTexParameteri = 331,
-  GLMessage_Function_glTexParameteriv = 332,
-  GLMessage_Function_glTexParameterx = 333,
-  GLMessage_Function_glTexParameterxOES = 334,
-  GLMessage_Function_glTexParameterxv = 335,
-  GLMessage_Function_glTexParameterxvOES = 336,
-  GLMessage_Function_glTexSubImage2D = 337,
-  GLMessage_Function_glTexSubImage3DOES = 338,
-  GLMessage_Function_glTranslatef = 339,
-  GLMessage_Function_glTranslatex = 340,
-  GLMessage_Function_glTranslatexOES = 341,
-  GLMessage_Function_glUniform1f = 342,
-  GLMessage_Function_glUniform1fv = 343,
-  GLMessage_Function_glUniform1i = 344,
-  GLMessage_Function_glUniform1iv = 345,
-  GLMessage_Function_glUniform2f = 346,
-  GLMessage_Function_glUniform2fv = 347,
-  GLMessage_Function_glUniform2i = 348,
-  GLMessage_Function_glUniform2iv = 349,
-  GLMessage_Function_glUniform3f = 350,
-  GLMessage_Function_glUniform3fv = 351,
-  GLMessage_Function_glUniform3i = 352,
-  GLMessage_Function_glUniform3iv = 353,
-  GLMessage_Function_glUniform4f = 354,
-  GLMessage_Function_glUniform4fv = 355,
-  GLMessage_Function_glUniform4i = 356,
-  GLMessage_Function_glUniform4iv = 357,
-  GLMessage_Function_glUniformMatrix2fv = 358,
-  GLMessage_Function_glUniformMatrix3fv = 359,
-  GLMessage_Function_glUniformMatrix4fv = 360,
-  GLMessage_Function_glUnmapBufferOES = 361,
-  GLMessage_Function_glUseProgram = 362,
-  GLMessage_Function_glValidateProgram = 363,
-  GLMessage_Function_glVertexAttrib1f = 364,
-  GLMessage_Function_glVertexAttrib1fv = 365,
-  GLMessage_Function_glVertexAttrib2f = 366,
-  GLMessage_Function_glVertexAttrib2fv = 367,
-  GLMessage_Function_glVertexAttrib3f = 368,
-  GLMessage_Function_glVertexAttrib3fv = 369,
-  GLMessage_Function_glVertexAttrib4f = 370,
-  GLMessage_Function_glVertexAttrib4fv = 371,
-  GLMessage_Function_glVertexAttribPointer = 372,
-  GLMessage_Function_glVertexPointer = 373,
-  GLMessage_Function_glViewport = 374,
-  GLMessage_Function_glWeightPointerOES = 375,
-  GLMessage_Function_glReadBuffer = 376,
-  GLMessage_Function_glDrawRangeElements = 377,
-  GLMessage_Function_glTexImage3D = 378,
-  GLMessage_Function_glTexSubImage3D = 379,
-  GLMessage_Function_glCopyTexSubImage3D = 380,
-  GLMessage_Function_glCompressedTexImage3D = 381,
-  GLMessage_Function_glCompressedTexSubImage3D = 382,
-  GLMessage_Function_glGenQueries = 383,
-  GLMessage_Function_glDeleteQueries = 384,
-  GLMessage_Function_glIsQuery = 385,
-  GLMessage_Function_glBeginQuery = 386,
-  GLMessage_Function_glEndQuery = 387,
-  GLMessage_Function_glGetQueryiv = 388,
-  GLMessage_Function_glGetQueryObjectuiv = 389,
-  GLMessage_Function_glUnmapBuffer = 390,
-  GLMessage_Function_glGetBufferPointerv = 391,
-  GLMessage_Function_glDrawBuffers = 392,
-  GLMessage_Function_glUniformMatrix2x3fv = 393,
-  GLMessage_Function_glUniformMatrix3x2fv = 394,
-  GLMessage_Function_glUniformMatrix2x4fv = 395,
-  GLMessage_Function_glUniformMatrix4x2fv = 396,
-  GLMessage_Function_glUniformMatrix3x4fv = 397,
-  GLMessage_Function_glUniformMatrix4x3fv = 398,
-  GLMessage_Function_glBlitFramebuffer = 399,
-  GLMessage_Function_glRenderbufferStorageMultisample = 400,
-  GLMessage_Function_glFramebufferTextureLayer = 401,
-  GLMessage_Function_glMapBufferRange = 402,
-  GLMessage_Function_glFlushMappedBufferRange = 403,
-  GLMessage_Function_glBindVertexArray = 404,
-  GLMessage_Function_glDeleteVertexArrays = 405,
-  GLMessage_Function_glGenVertexArrays = 406,
-  GLMessage_Function_glIsVertexArray = 407,
-  GLMessage_Function_glGetIntegeri_v = 408,
-  GLMessage_Function_glBeginTransformFeedback = 409,
-  GLMessage_Function_glEndTransformFeedback = 410,
-  GLMessage_Function_glBindBufferRange = 411,
-  GLMessage_Function_glBindBufferBase = 412,
-  GLMessage_Function_glTransformFeedbackVaryings = 413,
-  GLMessage_Function_glGetTransformFeedbackVarying = 414,
-  GLMessage_Function_glVertexAttribIPointer = 415,
-  GLMessage_Function_glGetVertexAttribIiv = 416,
-  GLMessage_Function_glGetVertexAttribIuiv = 417,
-  GLMessage_Function_glVertexAttribI4i = 418,
-  GLMessage_Function_glVertexAttribI4ui = 419,
-  GLMessage_Function_glVertexAttribI4iv = 420,
-  GLMessage_Function_glVertexAttribI4uiv = 421,
-  GLMessage_Function_glGetUniformuiv = 422,
-  GLMessage_Function_glGetFragDataLocation = 423,
-  GLMessage_Function_glUniform1ui = 424,
-  GLMessage_Function_glUniform2ui = 425,
-  GLMessage_Function_glUniform3ui = 426,
-  GLMessage_Function_glUniform4ui = 427,
-  GLMessage_Function_glUniform1uiv = 428,
-  GLMessage_Function_glUniform2uiv = 429,
-  GLMessage_Function_glUniform3uiv = 430,
-  GLMessage_Function_glUniform4uiv = 431,
-  GLMessage_Function_glClearBufferiv = 432,
-  GLMessage_Function_glClearBufferuiv = 433,
-  GLMessage_Function_glClearBufferfv = 434,
-  GLMessage_Function_glClearBufferfi = 435,
-  GLMessage_Function_glGetStringi = 436,
-  GLMessage_Function_glCopyBufferSubData = 437,
-  GLMessage_Function_glGetUniformIndices = 438,
-  GLMessage_Function_glGetActiveUniformsiv = 439,
-  GLMessage_Function_glGetUniformBlockIndex = 440,
-  GLMessage_Function_glGetActiveUniformBlockiv = 441,
-  GLMessage_Function_glGetActiveUniformBlockName = 442,
-  GLMessage_Function_glUniformBlockBinding = 443,
-  GLMessage_Function_glDrawArraysInstanced = 444,
-  GLMessage_Function_glDrawElementsInstanced = 445,
-  GLMessage_Function_glFenceSync = 446,
-  GLMessage_Function_glIsSync = 447,
-  GLMessage_Function_glDeleteSync = 448,
-  GLMessage_Function_glClientWaitSync = 449,
-  GLMessage_Function_glWaitSync = 450,
-  GLMessage_Function_glGetInteger64v = 451,
-  GLMessage_Function_glGetSynciv = 452,
-  GLMessage_Function_glGetInteger64i_v = 453,
-  GLMessage_Function_glGetBufferParameteri64v = 454,
-  GLMessage_Function_glGenSamplers = 455,
-  GLMessage_Function_glDeleteSamplers = 456,
-  GLMessage_Function_glIsSampler = 457,
-  GLMessage_Function_glBindSampler = 458,
-  GLMessage_Function_glSamplerParameteri = 459,
-  GLMessage_Function_glSamplerParameteriv = 460,
-  GLMessage_Function_glSamplerParameterf = 461,
-  GLMessage_Function_glSamplerParameterfv = 462,
-  GLMessage_Function_glGetSamplerParameteriv = 463,
-  GLMessage_Function_glGetSamplerParameterfv = 464,
-  GLMessage_Function_glVertexAttribDivisor = 465,
-  GLMessage_Function_glBindTransformFeedback = 466,
-  GLMessage_Function_glDeleteTransformFeedbacks = 467,
-  GLMessage_Function_glGenTransformFeedbacks = 468,
-  GLMessage_Function_glIsTransformFeedback = 469,
-  GLMessage_Function_glPauseTransformFeedback = 470,
-  GLMessage_Function_glResumeTransformFeedback = 471,
-  GLMessage_Function_glGetProgramBinary = 472,
-  GLMessage_Function_glProgramBinary = 473,
-  GLMessage_Function_glProgramParameteri = 474,
-  GLMessage_Function_glInvalidateFramebuffer = 475,
-  GLMessage_Function_glInvalidateSubFramebuffer = 476,
-  GLMessage_Function_glTexStorage2D = 477,
-  GLMessage_Function_glTexStorage3D = 478,
-  GLMessage_Function_glGetInternalformativ = 479,
-  GLMessage_Function_glBeginPerfQueryINTEL = 480,
-  GLMessage_Function_glCreatePerfQueryINTEL = 481,
-  GLMessage_Function_glDeletePerfQueryINTEL = 482,
-  GLMessage_Function_glEndPerfQueryINTEL = 483,
-  GLMessage_Function_glGetFirstPerfQueryIdINTEL = 484,
-  GLMessage_Function_glGetNextPerfQueryIdINTEL = 485,
-  GLMessage_Function_glGetPerfCounterInfoINTEL = 486,
-  GLMessage_Function_glGetPerfQueryDataINTEL = 487,
-  GLMessage_Function_glGetPerfQueryIdByNameINTEL = 488,
-  GLMessage_Function_glGetPerfQueryInfoINTEL = 489,
-  GLMessage_Function_glBlendBarrierKHR = 490,
-  GLMessage_Function_glBlendBarrierNV = 491,
-  GLMessage_Function_glBlendParameteriNV = 492,
-  GLMessage_Function_glBlitFramebufferNV = 493,
-  GLMessage_Function_glFenceSyncAPPLE = 494,
-  GLMessage_Function_glIsSyncAPPLE = 495,
-  GLMessage_Function_glDeleteSyncAPPLE = 496,
-  GLMessage_Function_glClientWaitSyncAPPLE = 497,
-  GLMessage_Function_glWaitSyncAPPLE = 498,
-  GLMessage_Function_glGetInteger64vAPPLE = 499,
-  GLMessage_Function_glGetSyncivAPPLE = 500,
-  GLMessage_Function_glCopyBufferSubDataNV = 501,
-  GLMessage_Function_glActiveShaderProgramEXT = 502,
-  GLMessage_Function_glAlphaFuncQCOM = 503,
-  GLMessage_Function_glBeginQueryEXT = 504,
-  GLMessage_Function_glBindProgramPipelineEXT = 505,
-  GLMessage_Function_glBlitFramebufferANGLE = 506,
-  GLMessage_Function_glCreateShaderProgramvEXT = 507,
-  GLMessage_Function_glDeleteProgramPipelinesEXT = 508,
-  GLMessage_Function_glDeleteQueriesEXT = 509,
-  GLMessage_Function_glDrawBuffersNV = 510,
-  GLMessage_Function_glEndQueryEXT = 511,
-  GLMessage_Function_glFramebufferTexture2DMultisampleEXT = 512,
-  GLMessage_Function_glGenProgramPipelinesEXT = 513,
-  GLMessage_Function_glGenQueriesEXT = 514,
-  GLMessage_Function_glGetGraphicsResetStatusEXT = 515,
-  GLMessage_Function_glGetObjectLabelEXT = 516,
-  GLMessage_Function_glGetProgramPipelineInfoLogEXT = 517,
-  GLMessage_Function_glGetProgramPipelineivEXT = 518,
-  GLMessage_Function_glGetQueryObjectuivEXT = 519,
-  GLMessage_Function_glGetQueryivEXT = 520,
-  GLMessage_Function_glGetnUniformfvEXT = 521,
-  GLMessage_Function_glGetnUniformivEXT = 521,
-  GLMessage_Function_glInsertEventMarkerEXT = 522,
-  GLMessage_Function_glIsProgramPipelineEXT = 523,
-  GLMessage_Function_glIsQueryEXT = 524,
-  GLMessage_Function_glLabelObjectEXT = 525,
-  GLMessage_Function_glPopGroupMarkerEXT = 526,
-  GLMessage_Function_glProgramParameteriEXT = 527,
-  GLMessage_Function_glProgramUniform1fEXT = 528,
-  GLMessage_Function_glProgramUniform1fvEXT = 529,
-  GLMessage_Function_glProgramUniform1iEXT = 530,
-  GLMessage_Function_glProgramUniform1ivEXT = 531,
-  GLMessage_Function_glProgramUniform2fEXT = 532,
-  GLMessage_Function_glProgramUniform2fvEXT = 533,
-  GLMessage_Function_glProgramUniform2iEXT = 534,
-  GLMessage_Function_glProgramUniform2ivEXT = 535,
-  GLMessage_Function_glProgramUniform3fEXT = 536,
-  GLMessage_Function_glProgramUniform3fvEXT = 537,
-  GLMessage_Function_glProgramUniform3iEXT = 538,
-  GLMessage_Function_glProgramUniform3ivEXT = 539,
-  GLMessage_Function_glProgramUniform4fEXT = 540,
-  GLMessage_Function_glProgramUniform4fvEXT = 541,
-  GLMessage_Function_glProgramUniform4iEXT = 542,
-  GLMessage_Function_glProgramUniform4ivEXT = 543,
-  GLMessage_Function_glProgramUniformMatrix2fvEXT = 544,
-  GLMessage_Function_glProgramUniformMatrix3fvEXT = 545,
-  GLMessage_Function_glProgramUniformMatrix4fvEXT = 546,
-  GLMessage_Function_glPushGroupMarkerEXT = 547,
-  GLMessage_Function_glReadBufferNV = 548,
-  GLMessage_Function_glReadnPixelsEXT = 549,
-  GLMessage_Function_glRenderbufferStorageMultisampleANGLE = 550,
-  GLMessage_Function_glRenderbufferStorageMultisampleAPPLE = 551,
-  GLMessage_Function_glRenderbufferStorageMultisampleEXT = 552,
-  GLMessage_Function_glResolveMultisampleFramebufferAPPLE = 553,
-  GLMessage_Function_glTexStorage1DEXT = 554,
-  GLMessage_Function_glTexStorage2DEXT = 555,
-  GLMessage_Function_glTexStorage3DEXT = 556,
-  GLMessage_Function_glTextureStorage1DEXT = 557,
-  GLMessage_Function_glTextureStorage2DEXT = 558,
-  GLMessage_Function_glTextureStorage3DEXT = 559,
-  GLMessage_Function_glUseProgramStagesEXT = 560,
-  GLMessage_Function_glValidateProgramPipelineEXT = 561,
-  GLMessage_Function_glCopyTextureLevelsAPPLE = 562,
-  GLMessage_Function_glDebugMessageControlKHR = 563,
-  GLMessage_Function_glDebugMessageInsertKHR = 564,
-  GLMessage_Function_glDebugMessageCallbackKHR = 565,
-  GLMessage_Function_glGetDebugMessageLogKHR = 566,
-  GLMessage_Function_glPushDebugGroupKHR = 567,
-  GLMessage_Function_glPopDebugGroupKHR = 568,
-  GLMessage_Function_glObjectLabelKHR = 569,
-  GLMessage_Function_glGetObjectLabelKHR = 570,
-  GLMessage_Function_glObjectPtrLabelKHR = 571,
-  GLMessage_Function_glGetObjectPtrLabelKHR = 572,
-  GLMessage_Function_glGetPointervKHR = 573,
-  GLMessage_Function_glDrawArraysInstancedANGLE = 574,
-  GLMessage_Function_glDrawElementsInstancedANGLE = 575,
-  GLMessage_Function_glVertexAttribDivisorANGLE = 576,
-  GLMessage_Function_glDrawArraysInstancedEXT = 577,
-  GLMessage_Function_glDrawElementsInstancedEXT = 578,
-  GLMessage_Function_glVertexAttribDivisorEXT = 579,
-  GLMessage_Function_glDrawArraysInstancedNV = 580,
-  GLMessage_Function_glDrawElementsInstancedNV = 581,
-  GLMessage_Function_glVertexAttribDivisorNV = 582,
-  GLMessage_Function_glDrawBuffersEXT = 583,
-  GLMessage_Function_glReadBufferIndexedEXT = 584,
-  GLMessage_Function_glDrawBuffersIndexedEXT = 585,
-  GLMessage_Function_glGetIntegeri_vEXT = 586,
-  GLMessage_Function_glMapBufferRangeEXT = 587,
-  GLMessage_Function_glFlushMappedBufferRangeEXT = 588,
-  GLMessage_Function_glQueryCounterEXT = 589,
-  GLMessage_Function_glGetQueryObjecti64vEXT = 590,
-  GLMessage_Function_glGetQueryObjectivEXT = 591,
-  GLMessage_Function_glGetQueryObjectui64vEXT = 592,
-  GLMessage_Function_glGetTranslatedShaderSourceANGLE = 593,
-  GLMessage_Function_glMinSampleShadingOES = 594,
-  GLMessage_Function_glMultiTexCoord1bOES = 595,
-  GLMessage_Function_glMultiTexCoord1bvOES = 596,
-  GLMessage_Function_glMultiTexCoord2bOES = 597,
-  GLMessage_Function_glMultiTexCoord2bvOES = 598,
-  GLMessage_Function_glMultiTexCoord3bOES = 599,
-  GLMessage_Function_glMultiTexCoord3bvOES = 600,
-  GLMessage_Function_glMultiTexCoord4bOES = 601,
-  GLMessage_Function_glMultiTexCoord4bvOES = 602,
-  GLMessage_Function_glTexCoord1bOES = 603,
-  GLMessage_Function_glTexCoord1bvOES = 604,
-  GLMessage_Function_glTexCoord2bOES = 605,
-  GLMessage_Function_glTexCoord2bvOES = 606,
-  GLMessage_Function_glTexCoord3bOES = 607,
-  GLMessage_Function_glTexCoord3bvOES = 608,
-  GLMessage_Function_glTexCoord4bOES = 609,
-  GLMessage_Function_glTexCoord4bvOES = 610,
-  GLMessage_Function_glVertex2bOES = 611,
-  GLMessage_Function_glVertex2bvOES = 612,
-  GLMessage_Function_glVertex3bOES = 613,
-  GLMessage_Function_glVertex3bvOES = 614,
-  GLMessage_Function_glVertex4bOES = 615,
-  GLMessage_Function_glVertex4bvOES = 616,
-  GLMessage_Function_glProgramUniform1uiEXT = 617,
-  GLMessage_Function_glProgramUniform2uiEXT = 618,
-  GLMessage_Function_glProgramUniform3uiEXT = 619,
-  GLMessage_Function_glProgramUniform4uiEXT = 620,
-  GLMessage_Function_glProgramUniform1uivEXT = 621,
-  GLMessage_Function_glProgramUniform2uivEXT = 622,
-  GLMessage_Function_glProgramUniform3uivEXT = 623,
-  GLMessage_Function_glProgramUniform4uivEXT = 624,
-  GLMessage_Function_glProgramUniformMatrix2x3fvEXT = 625,
-  GLMessage_Function_glProgramUniformMatrix3x2fvEXT = 626,
-  GLMessage_Function_glProgramUniformMatrix2x4fvEXT = 627,
-  GLMessage_Function_glProgramUniformMatrix4x2fvEXT = 628,
-  GLMessage_Function_glProgramUniformMatrix3x4fvEXT = 629,
-  GLMessage_Function_glProgramUniformMatrix4x3fvEXT = 630,
-  GLMessage_Function_glRenderbufferStorageMultisampleNV = 631,
-  GLMessage_Function_glSampleCoverageOES = 632,
-  GLMessage_Function_glTexStorage3DMultisampleOES = 633,
-  GLMessage_Function_glUniformMatrix2x3fvNV = 634,
-  GLMessage_Function_glUniformMatrix3x2fvNV = 635,
-  GLMessage_Function_glUniformMatrix2x4fvNV = 636,
-  GLMessage_Function_glUniformMatrix4x2fvNV = 637,
-  GLMessage_Function_glUniformMatrix3x4fvNV = 638,
-  GLMessage_Function_glUniformMatrix4x3fvNV = 639,
-  GLMessage_Function_glActiveShaderProgram = 640,
-  GLMessage_Function_glBindImageTexture = 641,
-  GLMessage_Function_glBindProgramPipeline = 642,
-  GLMessage_Function_glBindVertexBuffer = 643,
-  GLMessage_Function_glCreateShaderProgramv = 644,
-  GLMessage_Function_glDeleteProgramPipelines = 645,
-  GLMessage_Function_glDispatchCompute = 646,
-  GLMessage_Function_glDispatchComputeIndirect = 647,
-  GLMessage_Function_glDrawArraysIndirect = 648,
-  GLMessage_Function_glDrawElementsIndirect = 649,
-  GLMessage_Function_glFramebufferParameteri = 650,
-  GLMessage_Function_glGenProgramPipelines = 651,
-  GLMessage_Function_glGetBooleani_v = 652,
-  GLMessage_Function_glGetFramebufferParameteriv = 653,
-  GLMessage_Function_glGetMultisamplefv = 654,
-  GLMessage_Function_glGetProgramInterfaceiv = 655,
-  GLMessage_Function_glGetProgramPipelineInfoLog = 656,
-  GLMessage_Function_glGetProgramPipelineiv = 657,
-  GLMessage_Function_glGetProgramResourceIndex = 658,
-  GLMessage_Function_glGetProgramResourceLocation = 659,
-  GLMessage_Function_glGetProgramResourceName = 660,
-  GLMessage_Function_glGetProgramResourceiv = 661,
-  GLMessage_Function_glGetTexLevelParameterfv = 662,
-  GLMessage_Function_glGetTexLevelParameteriv = 663,
-  GLMessage_Function_glIsProgramPipeline = 664,
-  GLMessage_Function_glMemoryBarrier = 665,
-  GLMessage_Function_glMemoryBarrierByRegion = 666,
-  GLMessage_Function_glProgramUniform1f = 667,
-  GLMessage_Function_glProgramUniform1fv = 668,
-  GLMessage_Function_glProgramUniform1i = 669,
-  GLMessage_Function_glProgramUniform1iv = 670,
-  GLMessage_Function_glProgramUniform1ui = 671,
-  GLMessage_Function_glProgramUniform1uiv = 672,
-  GLMessage_Function_glProgramUniform2f = 673,
-  GLMessage_Function_glProgramUniform2fv = 674,
-  GLMessage_Function_glProgramUniform2i = 675,
-  GLMessage_Function_glProgramUniform2iv = 676,
-  GLMessage_Function_glProgramUniform2ui = 677,
-  GLMessage_Function_glProgramUniform2uiv = 678,
-  GLMessage_Function_glProgramUniform3f = 679,
-  GLMessage_Function_glProgramUniform3fv = 680,
-  GLMessage_Function_glProgramUniform3i = 681,
-  GLMessage_Function_glProgramUniform3iv = 682,
-  GLMessage_Function_glProgramUniform3ui = 683,
-  GLMessage_Function_glProgramUniform3uiv = 684,
-  GLMessage_Function_glProgramUniform4f = 685,
-  GLMessage_Function_glProgramUniform4fv = 686,
-  GLMessage_Function_glProgramUniform4i = 687,
-  GLMessage_Function_glProgramUniform4iv = 688,
-  GLMessage_Function_glProgramUniform4ui = 689,
-  GLMessage_Function_glProgramUniform4uiv = 690,
-  GLMessage_Function_glProgramUniformMatrix2fv = 691,
-  GLMessage_Function_glProgramUniformMatrix2x3fv = 692,
-  GLMessage_Function_glProgramUniformMatrix2x4fv = 693,
-  GLMessage_Function_glProgramUniformMatrix3fv = 694,
-  GLMessage_Function_glProgramUniformMatrix3x2fv = 695,
-  GLMessage_Function_glProgramUniformMatrix3x4fv = 696,
-  GLMessage_Function_glProgramUniformMatrix4fv = 697,
-  GLMessage_Function_glProgramUniformMatrix4x2fv = 698,
-  GLMessage_Function_glProgramUniformMatrix4x3fv = 699,
-  GLMessage_Function_glSampleMaski = 700,
-  GLMessage_Function_glTexStorage2DMultisample = 701,
-  GLMessage_Function_glUseProgramStages = 702,
-  GLMessage_Function_glValidateProgramPipeline = 703,
-  GLMessage_Function_glVertexAttribBinding = 704,
-  GLMessage_Function_glVertexAttribFormat = 705,
-  GLMessage_Function_glVertexAttribIFormat = 706,
-  GLMessage_Function_glVertexBindingDivisor = 707,
-  GLMessage_Function_glBlendEquationSeparateiEXT = 708,
-  GLMessage_Function_glBlendEquationiEXT = 709,
-  GLMessage_Function_glBlendFuncSeparateiEXT = 710,
-  GLMessage_Function_glBlendFunciEXT = 711,
-  GLMessage_Function_glColorMaskiEXT = 712,
-  GLMessage_Function_glCopyImageSubDataEXT = 713,
-  GLMessage_Function_glDisableiEXT = 714,
-  GLMessage_Function_glEnableiEXT = 715,
-  GLMessage_Function_glFramebufferTextureEXT = 716,
-  GLMessage_Function_glGetSamplerParameterIivEXT = 717,
-  GLMessage_Function_glGetSamplerParameterIuivEXT = 718,
-  GLMessage_Function_glGetTexParameterIivEXT = 719,
-  GLMessage_Function_glGetTexParameterIuivEXT = 720,
-  GLMessage_Function_glIsEnablediEXT = 721,
-  GLMessage_Function_glPatchParameteriEXT = 722,
-  GLMessage_Function_glPrimitiveBoundingBoxEXT = 723,
-  GLMessage_Function_glSamplerParameterIivEXT = 724,
-  GLMessage_Function_glSamplerParameterIuivEXT = 725,
-  GLMessage_Function_glTexBufferEXT = 726,
-  GLMessage_Function_glTexBufferRangeEXT = 727,
-  GLMessage_Function_glTexParameterIivEXT = 728,
-  GLMessage_Function_glTexParameterIuivEXT = 729,
-  GLMessage_Function_glTextureViewEXT = 730,
-  GLMessage_Function_eglGetDisplay = 2000,
-  GLMessage_Function_eglInitialize = 2001,
-  GLMessage_Function_eglTerminate = 2002,
-  GLMessage_Function_eglGetConfigs = 2003,
-  GLMessage_Function_eglChooseConfig = 2004,
-  GLMessage_Function_eglGetConfigAttrib = 2005,
-  GLMessage_Function_eglCreateWindowSurface = 2006,
-  GLMessage_Function_eglCreatePixmapSurface = 2007,
-  GLMessage_Function_eglCreatePbufferSurface = 2008,
-  GLMessage_Function_eglDestroySurface = 2009,
-  GLMessage_Function_eglQuerySurface = 2010,
-  GLMessage_Function_eglCreateContext = 2011,
-  GLMessage_Function_eglDestroyContext = 2012,
-  GLMessage_Function_eglMakeCurrent = 2013,
-  GLMessage_Function_eglGetCurrentContext = 2014,
-  GLMessage_Function_eglGetCurrentSurface = 2015,
-  GLMessage_Function_eglGetCurrentDisplay = 2016,
-  GLMessage_Function_eglQueryContext = 2017,
-  GLMessage_Function_eglWaitGL = 2018,
-  GLMessage_Function_eglWaitNative = 2019,
-  GLMessage_Function_eglSwapBuffers = 2020,
-  GLMessage_Function_eglCopyBuffers = 2021,
-  GLMessage_Function_eglGetError = 2022,
-  GLMessage_Function_eglQueryString = 2023,
-  GLMessage_Function_eglGetProcAddress = 2024,
-  GLMessage_Function_eglSurfaceAttrib = 2025,
-  GLMessage_Function_eglBindTexImage = 2026,
-  GLMessage_Function_eglReleaseTexImage = 2027,
-  GLMessage_Function_eglSwapInterval = 2028,
-  GLMessage_Function_eglBindAPI = 2029,
-  GLMessage_Function_eglQueryAPI = 2030,
-  GLMessage_Function_eglWaitClient = 2031,
-  GLMessage_Function_eglReleaseThread = 2032,
-  GLMessage_Function_eglCreatePbufferFromClientBuffer = 2033,
-  GLMessage_Function_eglLockSurfaceKHR = 2034,
-  GLMessage_Function_eglUnlockSurfaceKHR = 2035,
-  GLMessage_Function_eglCreateImageKHR = 2036,
-  GLMessage_Function_eglDestroyImageKHR = 2037,
-  GLMessage_Function_eglCreateSyncKHR = 2038,
-  GLMessage_Function_eglDestroySyncKHR = 2039,
-  GLMessage_Function_eglClientWaitSyncKHR = 2040,
-  GLMessage_Function_eglGetSyncAttribKHR = 2041,
-  GLMessage_Function_eglSetSwapRectangleANDROID = 2042,
-  GLMessage_Function_eglGetRenderBufferANDROID = 2043,
-  GLMessage_Function_eglGetSystemTimeFrequencyNV = 2044,
-  GLMessage_Function_eglGetSystemTimeNV = 2045,
-  GLMessage_Function_invalid = 3000,
-  GLMessage_Function_glVertexAttribPointerData = 3001
-};
-bool GLMessage_Function_IsValid(int value);
-const GLMessage_Function GLMessage_Function_Function_MIN = GLMessage_Function_glActiveTexture;
-const GLMessage_Function GLMessage_Function_Function_MAX = GLMessage_Function_glVertexAttribPointerData;
-const int GLMessage_Function_Function_ARRAYSIZE = GLMessage_Function_Function_MAX + 1;
-
-// ===================================================================
-
-class GLMessage_DataType : public ::google::protobuf::MessageLite {
- public:
-  GLMessage_DataType();
-  virtual ~GLMessage_DataType();
-  
-  GLMessage_DataType(const GLMessage_DataType& from);
-  
-  inline GLMessage_DataType& operator=(const GLMessage_DataType& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  
-  static const GLMessage_DataType& default_instance();
-  
-  void Swap(GLMessage_DataType* other);
-  
-  // implements Message ----------------------------------------------
-  
-  GLMessage_DataType* New() const;
-  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
-  void CopyFrom(const GLMessage_DataType& from);
-  void MergeFrom(const GLMessage_DataType& from);
-  void Clear();
-  bool IsInitialized() const;
-  
-  int ByteSize() const;
-  bool MergePartialFromCodedStream(
-      ::google::protobuf::io::CodedInputStream* input);
-  void SerializeWithCachedSizes(
-      ::google::protobuf::io::CodedOutputStream* output) const;
-  int GetCachedSize() const { return _cached_size_; }
-  private:
-  void SharedCtor();
-  void SharedDtor();
-  void SetCachedSize(int size) const;
-  public:
-  
-  ::std::string GetTypeName() const;
-  
-  // nested types ----------------------------------------------------
-  
-  typedef GLMessage_DataType_Type Type;
-  static const Type VOID = GLMessage_DataType_Type_VOID;
-  static const Type CHAR = GLMessage_DataType_Type_CHAR;
-  static const Type BYTE = GLMessage_DataType_Type_BYTE;
-  static const Type INT = GLMessage_DataType_Type_INT;
-  static const Type FLOAT = GLMessage_DataType_Type_FLOAT;
-  static const Type BOOL = GLMessage_DataType_Type_BOOL;
-  static const Type ENUM = GLMessage_DataType_Type_ENUM;
-  static const Type INT64 = GLMessage_DataType_Type_INT64;
-  static inline bool Type_IsValid(int value) {
-    return GLMessage_DataType_Type_IsValid(value);
-  }
-  static const Type Type_MIN =
-    GLMessage_DataType_Type_Type_MIN;
-  static const Type Type_MAX =
-    GLMessage_DataType_Type_Type_MAX;
-  static const int Type_ARRAYSIZE =
-    GLMessage_DataType_Type_Type_ARRAYSIZE;
-  
-  // accessors -------------------------------------------------------
-  
-  // required .android.gltrace.GLMessage.DataType.Type type = 1 [default = VOID];
-  inline bool has_type() const;
-  inline void clear_type();
-  static const int kTypeFieldNumber = 1;
-  inline ::android::gltrace::GLMessage_DataType_Type type() const;
-  inline void set_type(::android::gltrace::GLMessage_DataType_Type value);
-  
-  // required bool isArray = 2 [default = false];
-  inline bool has_isarray() const;
-  inline void clear_isarray();
-  static const int kIsArrayFieldNumber = 2;
-  inline bool isarray() const;
-  inline void set_isarray(bool value);
-  
-  // repeated int32 intValue = 3;
-  inline int intvalue_size() const;
-  inline void clear_intvalue();
-  static const int kIntValueFieldNumber = 3;
-  inline ::google::protobuf::int32 intvalue(int index) const;
-  inline void set_intvalue(int index, ::google::protobuf::int32 value);
-  inline void add_intvalue(::google::protobuf::int32 value);
-  inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
-      intvalue() const;
-  inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
-      mutable_intvalue();
-  
-  // repeated float floatValue = 4;
-  inline int floatvalue_size() const;
-  inline void clear_floatvalue();
-  static const int kFloatValueFieldNumber = 4;
-  inline float floatvalue(int index) const;
-  inline void set_floatvalue(int index, float value);
-  inline void add_floatvalue(float value);
-  inline const ::google::protobuf::RepeatedField< float >&
-      floatvalue() const;
-  inline ::google::protobuf::RepeatedField< float >*
-      mutable_floatvalue();
-  
-  // repeated bytes charValue = 5;
-  inline int charvalue_size() const;
-  inline void clear_charvalue();
-  static const int kCharValueFieldNumber = 5;
-  inline const ::std::string& charvalue(int index) const;
-  inline ::std::string* mutable_charvalue(int index);
-  inline void set_charvalue(int index, const ::std::string& value);
-  inline void set_charvalue(int index, const char* value);
-  inline void set_charvalue(int index, const void* value, size_t size);
-  inline ::std::string* add_charvalue();
-  inline void add_charvalue(const ::std::string& value);
-  inline void add_charvalue(const char* value);
-  inline void add_charvalue(const void* value, size_t size);
-  inline const ::google::protobuf::RepeatedPtrField< ::std::string>& charvalue() const;
-  inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_charvalue();
-  
-  // repeated bytes rawBytes = 6;
-  inline int rawbytes_size() const;
-  inline void clear_rawbytes();
-  static const int kRawBytesFieldNumber = 6;
-  inline const ::std::string& rawbytes(int index) const;
-  inline ::std::string* mutable_rawbytes(int index);
-  inline void set_rawbytes(int index, const ::std::string& value);
-  inline void set_rawbytes(int index, const char* value);
-  inline void set_rawbytes(int index, const void* value, size_t size);
-  inline ::std::string* add_rawbytes();
-  inline void add_rawbytes(const ::std::string& value);
-  inline void add_rawbytes(const char* value);
-  inline void add_rawbytes(const void* value, size_t size);
-  inline const ::google::protobuf::RepeatedPtrField< ::std::string>& rawbytes() const;
-  inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_rawbytes();
-  
-  // repeated bool boolValue = 7;
-  inline int boolvalue_size() const;
-  inline void clear_boolvalue();
-  static const int kBoolValueFieldNumber = 7;
-  inline bool boolvalue(int index) const;
-  inline void set_boolvalue(int index, bool value);
-  inline void add_boolvalue(bool value);
-  inline const ::google::protobuf::RepeatedField< bool >&
-      boolvalue() const;
-  inline ::google::protobuf::RepeatedField< bool >*
-      mutable_boolvalue();
-  
-  // repeated int64 int64Value = 8;
-  inline int int64value_size() const;
-  inline void clear_int64value();
-  static const int kInt64ValueFieldNumber = 8;
-  inline ::google::protobuf::int64 int64value(int index) const;
-  inline void set_int64value(int index, ::google::protobuf::int64 value);
-  inline void add_int64value(::google::protobuf::int64 value);
-  inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
-      int64value() const;
-  inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
-      mutable_int64value();
-  
-  // @@protoc_insertion_point(class_scope:android.gltrace.GLMessage.DataType)
- private:
-  mutable int _cached_size_;
-  
-  int type_;
-  bool isarray_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > intvalue_;
-  ::google::protobuf::RepeatedField< float > floatvalue_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> charvalue_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> rawbytes_;
-  ::google::protobuf::RepeatedField< bool > boolvalue_;
-  ::google::protobuf::RepeatedField< ::google::protobuf::int64 > int64value_;
-  friend void  protobuf_AddDesc_gltrace_2eproto();
-  friend void protobuf_AssignDesc_gltrace_2eproto();
-  friend void protobuf_ShutdownFile_gltrace_2eproto();
-  
-  ::google::protobuf::uint32 _has_bits_[(8 + 31) / 32];
-  
-  // WHY DOES & HAVE LOWER PRECEDENCE THAN != !?
-  inline bool _has_bit(int index) const {
-    return (_has_bits_[index / 32] & (1u << (index % 32))) != 0;
-  }
-  inline void _set_bit(int index) {
-    _has_bits_[index / 32] |= (1u << (index % 32));
-  }
-  inline void _clear_bit(int index) {
-    _has_bits_[index / 32] &= ~(1u << (index % 32));
-  }
-  
-  void InitAsDefaultInstance();
-  static GLMessage_DataType* default_instance_;
-};
-// -------------------------------------------------------------------
-
-class GLMessage_FrameBuffer : public ::google::protobuf::MessageLite {
- public:
-  GLMessage_FrameBuffer();
-  virtual ~GLMessage_FrameBuffer();
-  
-  GLMessage_FrameBuffer(const GLMessage_FrameBuffer& from);
-  
-  inline GLMessage_FrameBuffer& operator=(const GLMessage_FrameBuffer& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  
-  static const GLMessage_FrameBuffer& default_instance();
-  
-  void Swap(GLMessage_FrameBuffer* other);
-  
-  // implements Message ----------------------------------------------
-  
-  GLMessage_FrameBuffer* New() const;
-  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
-  void CopyFrom(const GLMessage_FrameBuffer& from);
-  void MergeFrom(const GLMessage_FrameBuffer& from);
-  void Clear();
-  bool IsInitialized() const;
-  
-  int ByteSize() const;
-  bool MergePartialFromCodedStream(
-      ::google::protobuf::io::CodedInputStream* input);
-  void SerializeWithCachedSizes(
-      ::google::protobuf::io::CodedOutputStream* output) const;
-  int GetCachedSize() const { return _cached_size_; }
-  private:
-  void SharedCtor();
-  void SharedDtor();
-  void SetCachedSize(int size) const;
-  public:
-  
-  ::std::string GetTypeName() const;
-  
-  // nested types ----------------------------------------------------
-  
-  // accessors -------------------------------------------------------
-  
-  // required int32 width = 1;
-  inline bool has_width() const;
-  inline void clear_width();
-  static const int kWidthFieldNumber = 1;
-  inline ::google::protobuf::int32 width() const;
-  inline void set_width(::google::protobuf::int32 value);
-  
-  // required int32 height = 2;
-  inline bool has_height() const;
-  inline void clear_height();
-  static const int kHeightFieldNumber = 2;
-  inline ::google::protobuf::int32 height() const;
-  inline void set_height(::google::protobuf::int32 value);
-  
-  // repeated bytes contents = 3;
-  inline int contents_size() const;
-  inline void clear_contents();
-  static const int kContentsFieldNumber = 3;
-  inline const ::std::string& contents(int index) const;
-  inline ::std::string* mutable_contents(int index);
-  inline void set_contents(int index, const ::std::string& value);
-  inline void set_contents(int index, const char* value);
-  inline void set_contents(int index, const void* value, size_t size);
-  inline ::std::string* add_contents();
-  inline void add_contents(const ::std::string& value);
-  inline void add_contents(const char* value);
-  inline void add_contents(const void* value, size_t size);
-  inline const ::google::protobuf::RepeatedPtrField< ::std::string>& contents() const;
-  inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_contents();
-  
-  // @@protoc_insertion_point(class_scope:android.gltrace.GLMessage.FrameBuffer)
- private:
-  mutable int _cached_size_;
-  
-  ::google::protobuf::int32 width_;
-  ::google::protobuf::int32 height_;
-  ::google::protobuf::RepeatedPtrField< ::std::string> contents_;
-  friend void  protobuf_AddDesc_gltrace_2eproto();
-  friend void protobuf_AssignDesc_gltrace_2eproto();
-  friend void protobuf_ShutdownFile_gltrace_2eproto();
-  
-  ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32];
-  
-  // WHY DOES & HAVE LOWER PRECEDENCE THAN != !?
-  inline bool _has_bit(int index) const {
-    return (_has_bits_[index / 32] & (1u << (index % 32))) != 0;
-  }
-  inline void _set_bit(int index) {
-    _has_bits_[index / 32] |= (1u << (index % 32));
-  }
-  inline void _clear_bit(int index) {
-    _has_bits_[index / 32] &= ~(1u << (index % 32));
-  }
-  
-  void InitAsDefaultInstance();
-  static GLMessage_FrameBuffer* default_instance_;
-};
-// -------------------------------------------------------------------
-
-class GLMessage : public ::google::protobuf::MessageLite {
- public:
-  GLMessage();
-  virtual ~GLMessage();
-  
-  GLMessage(const GLMessage& from);
-  
-  inline GLMessage& operator=(const GLMessage& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  
-  static const GLMessage& default_instance();
-  
-  void Swap(GLMessage* other);
-  
-  // implements Message ----------------------------------------------
-  
-  GLMessage* New() const;
-  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
-  void CopyFrom(const GLMessage& from);
-  void MergeFrom(const GLMessage& from);
-  void Clear();
-  bool IsInitialized() const;
-  
-  int ByteSize() const;
-  bool MergePartialFromCodedStream(
-      ::google::protobuf::io::CodedInputStream* input);
-  void SerializeWithCachedSizes(
-      ::google::protobuf::io::CodedOutputStream* output) const;
-  int GetCachedSize() const { return _cached_size_; }
-  private:
-  void SharedCtor();
-  void SharedDtor();
-  void SetCachedSize(int size) const;
-  public:
-  
-  ::std::string GetTypeName() const;
-  
-  // nested types ----------------------------------------------------
-  
-  typedef GLMessage_DataType DataType;
-  typedef GLMessage_FrameBuffer FrameBuffer;
-  
-  typedef GLMessage_Function Function;
-  static const Function glActiveTexture = GLMessage_Function_glActiveTexture;
-  static const Function glAlphaFunc = GLMessage_Function_glAlphaFunc;
-  static const Function glAlphaFuncx = GLMessage_Function_glAlphaFuncx;
-  static const Function glAlphaFuncxOES = GLMessage_Function_glAlphaFuncxOES;
-  static const Function glAttachShader = GLMessage_Function_glAttachShader;
-  static const Function glBeginPerfMonitorAMD = GLMessage_Function_glBeginPerfMonitorAMD;
-  static const Function glBindAttribLocation = GLMessage_Function_glBindAttribLocation;
-  static const Function glBindBuffer = GLMessage_Function_glBindBuffer;
-  static const Function glBindFramebuffer = GLMessage_Function_glBindFramebuffer;
-  static const Function glBindFramebufferOES = GLMessage_Function_glBindFramebufferOES;
-  static const Function glBindRenderbuffer = GLMessage_Function_glBindRenderbuffer;
-  static const Function glBindRenderbufferOES = GLMessage_Function_glBindRenderbufferOES;
-  static const Function glBindTexture = GLMessage_Function_glBindTexture;
-  static const Function glBindVertexArrayOES = GLMessage_Function_glBindVertexArrayOES;
-  static const Function glBlendColor = GLMessage_Function_glBlendColor;
-  static const Function glBlendEquation = GLMessage_Function_glBlendEquation;
-  static const Function glBlendEquationOES = GLMessage_Function_glBlendEquationOES;
-  static const Function glBlendEquationSeparate = GLMessage_Function_glBlendEquationSeparate;
-  static const Function glBlendEquationSeparateOES = GLMessage_Function_glBlendEquationSeparateOES;
-  static const Function glBlendFunc = GLMessage_Function_glBlendFunc;
-  static const Function glBlendFuncSeparate = GLMessage_Function_glBlendFuncSeparate;
-  static const Function glBlendFuncSeparateOES = GLMessage_Function_glBlendFuncSeparateOES;
-  static const Function glBufferData = GLMessage_Function_glBufferData;
-  static const Function glBufferSubData = GLMessage_Function_glBufferSubData;
-  static const Function glCheckFramebufferStatus = GLMessage_Function_glCheckFramebufferStatus;
-  static const Function glCheckFramebufferStatusOES = GLMessage_Function_glCheckFramebufferStatusOES;
-  static const Function glClearColor = GLMessage_Function_glClearColor;
-  static const Function glClearColorx = GLMessage_Function_glClearColorx;
-  static const Function glClearColorxOES = GLMessage_Function_glClearColorxOES;
-  static const Function glClearDepthf = GLMessage_Function_glClearDepthf;
-  static const Function glClearDepthfOES = GLMessage_Function_glClearDepthfOES;
-  static const Function glClearDepthx = GLMessage_Function_glClearDepthx;
-  static const Function glClearDepthxOES = GLMessage_Function_glClearDepthxOES;
-  static const Function glClear = GLMessage_Function_glClear;
-  static const Function glClearStencil = GLMessage_Function_glClearStencil;
-  static const Function glClientActiveTexture = GLMessage_Function_glClientActiveTexture;
-  static const Function glClipPlanef = GLMessage_Function_glClipPlanef;
-  static const Function glClipPlanefIMG = GLMessage_Function_glClipPlanefIMG;
-  static const Function glClipPlanefOES = GLMessage_Function_glClipPlanefOES;
-  static const Function glClipPlanex = GLMessage_Function_glClipPlanex;
-  static const Function glClipPlanexIMG = GLMessage_Function_glClipPlanexIMG;
-  static const Function glClipPlanexOES = GLMessage_Function_glClipPlanexOES;
-  static const Function glColor4f = GLMessage_Function_glColor4f;
-  static const Function glColor4ub = GLMessage_Function_glColor4ub;
-  static const Function glColor4x = GLMessage_Function_glColor4x;
-  static const Function glColor4xOES = GLMessage_Function_glColor4xOES;
-  static const Function glColorMask = GLMessage_Function_glColorMask;
-  static const Function glColorPointer = GLMessage_Function_glColorPointer;
-  static const Function glCompileShader = GLMessage_Function_glCompileShader;
-  static const Function glCompressedTexImage2D = GLMessage_Function_glCompressedTexImage2D;
-  static const Function glCompressedTexImage3DOES = GLMessage_Function_glCompressedTexImage3DOES;
-  static const Function glCompressedTexSubImage2D = GLMessage_Function_glCompressedTexSubImage2D;
-  static const Function glCompressedTexSubImage3DOES = GLMessage_Function_glCompressedTexSubImage3DOES;
-  static const Function glCopyTexImage2D = GLMessage_Function_glCopyTexImage2D;
-  static const Function glCopyTexSubImage2D = GLMessage_Function_glCopyTexSubImage2D;
-  static const Function glCopyTexSubImage3DOES = GLMessage_Function_glCopyTexSubImage3DOES;
-  static const Function glCoverageMaskNV = GLMessage_Function_glCoverageMaskNV;
-  static const Function glCoverageOperationNV = GLMessage_Function_glCoverageOperationNV;
-  static const Function glCreateProgram = GLMessage_Function_glCreateProgram;
-  static const Function glCreateShader = GLMessage_Function_glCreateShader;
-  static const Function glCullFace = GLMessage_Function_glCullFace;
-  static const Function glCurrentPaletteMatrixOES = GLMessage_Function_glCurrentPaletteMatrixOES;
-  static const Function glDeleteBuffers = GLMessage_Function_glDeleteBuffers;
-  static const Function glDeleteFencesNV = GLMessage_Function_glDeleteFencesNV;
-  static const Function glDeleteFramebuffers = GLMessage_Function_glDeleteFramebuffers;
-  static const Function glDeleteFramebuffersOES = GLMessage_Function_glDeleteFramebuffersOES;
-  static const Function glDeletePerfMonitorsAMD = GLMessage_Function_glDeletePerfMonitorsAMD;
-  static const Function glDeleteProgram = GLMessage_Function_glDeleteProgram;
-  static const Function glDeleteRenderbuffers = GLMessage_Function_glDeleteRenderbuffers;
-  static const Function glDeleteRenderbuffersOES = GLMessage_Function_glDeleteRenderbuffersOES;
-  static const Function glDeleteShader = GLMessage_Function_glDeleteShader;
-  static const Function glDeleteTextures = GLMessage_Function_glDeleteTextures;
-  static const Function glDeleteVertexArraysOES = GLMessage_Function_glDeleteVertexArraysOES;
-  static const Function glDepthFunc = GLMessage_Function_glDepthFunc;
-  static const Function glDepthMask = GLMessage_Function_glDepthMask;
-  static const Function glDepthRangef = GLMessage_Function_glDepthRangef;
-  static const Function glDepthRangefOES = GLMessage_Function_glDepthRangefOES;
-  static const Function glDepthRangex = GLMessage_Function_glDepthRangex;
-  static const Function glDepthRangexOES = GLMessage_Function_glDepthRangexOES;
-  static const Function glDetachShader = GLMessage_Function_glDetachShader;
-  static const Function glDisableClientState = GLMessage_Function_glDisableClientState;
-  static const Function glDisableDriverControlQCOM = GLMessage_Function_glDisableDriverControlQCOM;
-  static const Function glDisable = GLMessage_Function_glDisable;
-  static const Function glDisableVertexAttribArray = GLMessage_Function_glDisableVertexAttribArray;
-  static const Function glDiscardFramebufferEXT = GLMessage_Function_glDiscardFramebufferEXT;
-  static const Function glDrawArrays = GLMessage_Function_glDrawArrays;
-  static const Function glDrawElements = GLMessage_Function_glDrawElements;
-  static const Function glDrawTexfOES = GLMessage_Function_glDrawTexfOES;
-  static const Function glDrawTexfvOES = GLMessage_Function_glDrawTexfvOES;
-  static const Function glDrawTexiOES = GLMessage_Function_glDrawTexiOES;
-  static const Function glDrawTexivOES = GLMessage_Function_glDrawTexivOES;
-  static const Function glDrawTexsOES = GLMessage_Function_glDrawTexsOES;
-  static const Function glDrawTexsvOES = GLMessage_Function_glDrawTexsvOES;
-  static const Function glDrawTexxOES = GLMessage_Function_glDrawTexxOES;
-  static const Function glDrawTexxvOES = GLMessage_Function_glDrawTexxvOES;
-  static const Function glEGLImageTargetRenderbufferStorageOES = GLMessage_Function_glEGLImageTargetRenderbufferStorageOES;
-  static const Function glEGLImageTargetTexture2DOES = GLMessage_Function_glEGLImageTargetTexture2DOES;
-  static const Function glEnableClientState = GLMessage_Function_glEnableClientState;
-  static const Function glEnableDriverControlQCOM = GLMessage_Function_glEnableDriverControlQCOM;
-  static const Function glEnable = GLMessage_Function_glEnable;
-  static const Function glEnableVertexAttribArray = GLMessage_Function_glEnableVertexAttribArray;
-  static const Function glEndPerfMonitorAMD = GLMessage_Function_glEndPerfMonitorAMD;
-  static const Function glEndTilingQCOM = GLMessage_Function_glEndTilingQCOM;
-  static const Function glExtGetBufferPointervQCOM = GLMessage_Function_glExtGetBufferPointervQCOM;
-  static const Function glExtGetBuffersQCOM = GLMessage_Function_glExtGetBuffersQCOM;
-  static const Function glExtGetFramebuffersQCOM = GLMessage_Function_glExtGetFramebuffersQCOM;
-  static const Function glExtGetProgramBinarySourceQCOM = GLMessage_Function_glExtGetProgramBinarySourceQCOM;
-  static const Function glExtGetProgramsQCOM = GLMessage_Function_glExtGetProgramsQCOM;
-  static const Function glExtGetRenderbuffersQCOM = GLMessage_Function_glExtGetRenderbuffersQCOM;
-  static const Function glExtGetShadersQCOM = GLMessage_Function_glExtGetShadersQCOM;
-  static const Function glExtGetTexLevelParameterivQCOM = GLMessage_Function_glExtGetTexLevelParameterivQCOM;
-  static const Function glExtGetTexSubImageQCOM = GLMessage_Function_glExtGetTexSubImageQCOM;
-  static const Function glExtGetTexturesQCOM = GLMessage_Function_glExtGetTexturesQCOM;
-  static const Function glExtIsProgramBinaryQCOM = GLMessage_Function_glExtIsProgramBinaryQCOM;
-  static const Function glExtTexObjectStateOverrideiQCOM = GLMessage_Function_glExtTexObjectStateOverrideiQCOM;
-  static const Function glFinishFenceNV = GLMessage_Function_glFinishFenceNV;
-  static const Function glFinish = GLMessage_Function_glFinish;
-  static const Function glFlush = GLMessage_Function_glFlush;
-  static const Function glFogf = GLMessage_Function_glFogf;
-  static const Function glFogfv = GLMessage_Function_glFogfv;
-  static const Function glFogx = GLMessage_Function_glFogx;
-  static const Function glFogxOES = GLMessage_Function_glFogxOES;
-  static const Function glFogxv = GLMessage_Function_glFogxv;
-  static const Function glFogxvOES = GLMessage_Function_glFogxvOES;
-  static const Function glFramebufferRenderbuffer = GLMessage_Function_glFramebufferRenderbuffer;
-  static const Function glFramebufferRenderbufferOES = GLMessage_Function_glFramebufferRenderbufferOES;
-  static const Function glFramebufferTexture2D = GLMessage_Function_glFramebufferTexture2D;
-  static const Function glFramebufferTexture2DMultisampleIMG = GLMessage_Function_glFramebufferTexture2DMultisampleIMG;
-  static const Function glFramebufferTexture2DOES = GLMessage_Function_glFramebufferTexture2DOES;
-  static const Function glFramebufferTexture3DOES = GLMessage_Function_glFramebufferTexture3DOES;
-  static const Function glFrontFace = GLMessage_Function_glFrontFace;
-  static const Function glFrustumf = GLMessage_Function_glFrustumf;
-  static const Function glFrustumfOES = GLMessage_Function_glFrustumfOES;
-  static const Function glFrustumx = GLMessage_Function_glFrustumx;
-  static const Function glFrustumxOES = GLMessage_Function_glFrustumxOES;
-  static const Function glGenBuffers = GLMessage_Function_glGenBuffers;
-  static const Function glGenerateMipmap = GLMessage_Function_glGenerateMipmap;
-  static const Function glGenerateMipmapOES = GLMessage_Function_glGenerateMipmapOES;
-  static const Function glGenFencesNV = GLMessage_Function_glGenFencesNV;
-  static const Function glGenFramebuffers = GLMessage_Function_glGenFramebuffers;
-  static const Function glGenFramebuffersOES = GLMessage_Function_glGenFramebuffersOES;
-  static const Function glGenPerfMonitorsAMD = GLMessage_Function_glGenPerfMonitorsAMD;
-  static const Function glGenRenderbuffers = GLMessage_Function_glGenRenderbuffers;
-  static const Function glGenRenderbuffersOES = GLMessage_Function_glGenRenderbuffersOES;
-  static const Function glGenTextures = GLMessage_Function_glGenTextures;
-  static const Function glGenVertexArraysOES = GLMessage_Function_glGenVertexArraysOES;
-  static const Function glGetActiveAttrib = GLMessage_Function_glGetActiveAttrib;
-  static const Function glGetActiveUniform = GLMessage_Function_glGetActiveUniform;
-  static const Function glGetAttachedShaders = GLMessage_Function_glGetAttachedShaders;
-  static const Function glGetAttribLocation = GLMessage_Function_glGetAttribLocation;
-  static const Function glGetBooleanv = GLMessage_Function_glGetBooleanv;
-  static const Function glGetBufferParameteriv = GLMessage_Function_glGetBufferParameteriv;
-  static const Function glGetBufferPointervOES = GLMessage_Function_glGetBufferPointervOES;
-  static const Function glGetClipPlanef = GLMessage_Function_glGetClipPlanef;
-  static const Function glGetClipPlanefOES = GLMessage_Function_glGetClipPlanefOES;
-  static const Function glGetClipPlanex = GLMessage_Function_glGetClipPlanex;
-  static const Function glGetClipPlanexOES = GLMessage_Function_glGetClipPlanexOES;
-  static const Function glGetDriverControlsQCOM = GLMessage_Function_glGetDriverControlsQCOM;
-  static const Function glGetDriverControlStringQCOM = GLMessage_Function_glGetDriverControlStringQCOM;
-  static const Function glGetError = GLMessage_Function_glGetError;
-  static const Function glGetFenceivNV = GLMessage_Function_glGetFenceivNV;
-  static const Function glGetFixedv = GLMessage_Function_glGetFixedv;
-  static const Function glGetFixedvOES = GLMessage_Function_glGetFixedvOES;
-  static const Function glGetFloatv = GLMessage_Function_glGetFloatv;
-  static const Function glGetFramebufferAttachmentParameteriv = GLMessage_Function_glGetFramebufferAttachmentParameteriv;
-  static const Function glGetFramebufferAttachmentParameterivOES = GLMessage_Function_glGetFramebufferAttachmentParameterivOES;
-  static const Function glGetIntegerv = GLMessage_Function_glGetIntegerv;
-  static const Function glGetLightfv = GLMessage_Function_glGetLightfv;
-  static const Function glGetLightxv = GLMessage_Function_glGetLightxv;
-  static const Function glGetLightxvOES = GLMessage_Function_glGetLightxvOES;
-  static const Function glGetMaterialfv = GLMessage_Function_glGetMaterialfv;
-  static const Function glGetMaterialxv = GLMessage_Function_glGetMaterialxv;
-  static const Function glGetMaterialxvOES = GLMessage_Function_glGetMaterialxvOES;
-  static const Function glGetPerfMonitorCounterDataAMD = GLMessage_Function_glGetPerfMonitorCounterDataAMD;
-  static const Function glGetPerfMonitorCounterInfoAMD = GLMessage_Function_glGetPerfMonitorCounterInfoAMD;
-  static const Function glGetPerfMonitorCountersAMD = GLMessage_Function_glGetPerfMonitorCountersAMD;
-  static const Function glGetPerfMonitorCounterStringAMD = GLMessage_Function_glGetPerfMonitorCounterStringAMD;
-  static const Function glGetPerfMonitorGroupsAMD = GLMessage_Function_glGetPerfMonitorGroupsAMD;
-  static const Function glGetPerfMonitorGroupStringAMD = GLMessage_Function_glGetPerfMonitorGroupStringAMD;
-  static const Function glGetPointerv = GLMessage_Function_glGetPointerv;
-  static const Function glGetProgramBinaryOES = GLMessage_Function_glGetProgramBinaryOES;
-  static const Function glGetProgramInfoLog = GLMessage_Function_glGetProgramInfoLog;
-  static const Function glGetProgramiv = GLMessage_Function_glGetProgramiv;
-  static const Function glGetRenderbufferParameteriv = GLMessage_Function_glGetRenderbufferParameteriv;
-  static const Function glGetRenderbufferParameterivOES = GLMessage_Function_glGetRenderbufferParameterivOES;
-  static const Function glGetShaderInfoLog = GLMessage_Function_glGetShaderInfoLog;
-  static const Function glGetShaderiv = GLMessage_Function_glGetShaderiv;
-  static const Function glGetShaderPrecisionFormat = GLMessage_Function_glGetShaderPrecisionFormat;
-  static const Function glGetShaderSource = GLMessage_Function_glGetShaderSource;
-  static const Function glGetString = GLMessage_Function_glGetString;
-  static const Function glGetTexEnvfv = GLMessage_Function_glGetTexEnvfv;
-  static const Function glGetTexEnviv = GLMessage_Function_glGetTexEnviv;
-  static const Function glGetTexEnvxv = GLMessage_Function_glGetTexEnvxv;
-  static const Function glGetTexEnvxvOES = GLMessage_Function_glGetTexEnvxvOES;
-  static const Function glGetTexGenfvOES = GLMessage_Function_glGetTexGenfvOES;
-  static const Function glGetTexGenivOES = GLMessage_Function_glGetTexGenivOES;
-  static const Function glGetTexGenxvOES = GLMessage_Function_glGetTexGenxvOES;
-  static const Function glGetTexParameterfv = GLMessage_Function_glGetTexParameterfv;
-  static const Function glGetTexParameteriv = GLMessage_Function_glGetTexParameteriv;
-  static const Function glGetTexParameterxv = GLMessage_Function_glGetTexParameterxv;
-  static const Function glGetTexParameterxvOES = GLMessage_Function_glGetTexParameterxvOES;
-  static const Function glGetUniformfv = GLMessage_Function_glGetUniformfv;
-  static const Function glGetUniformiv = GLMessage_Function_glGetUniformiv;
-  static const Function glGetUniformLocation = GLMessage_Function_glGetUniformLocation;
-  static const Function glGetVertexAttribfv = GLMessage_Function_glGetVertexAttribfv;
-  static const Function glGetVertexAttribiv = GLMessage_Function_glGetVertexAttribiv;
-  static const Function glGetVertexAttribPointerv = GLMessage_Function_glGetVertexAttribPointerv;
-  static const Function glHint = GLMessage_Function_glHint;
-  static const Function glIsBuffer = GLMessage_Function_glIsBuffer;
-  static const Function glIsEnabled = GLMessage_Function_glIsEnabled;
-  static const Function glIsFenceNV = GLMessage_Function_glIsFenceNV;
-  static const Function glIsFramebuffer = GLMessage_Function_glIsFramebuffer;
-  static const Function glIsFramebufferOES = GLMessage_Function_glIsFramebufferOES;
-  static const Function glIsProgram = GLMessage_Function_glIsProgram;
-  static const Function glIsRenderbuffer = GLMessage_Function_glIsRenderbuffer;
-  static const Function glIsRenderbufferOES = GLMessage_Function_glIsRenderbufferOES;
-  static const Function glIsShader = GLMessage_Function_glIsShader;
-  static const Function glIsTexture = GLMessage_Function_glIsTexture;
-  static const Function glIsVertexArrayOES = GLMessage_Function_glIsVertexArrayOES;
-  static const Function glLightf = GLMessage_Function_glLightf;
-  static const Function glLightfv = GLMessage_Function_glLightfv;
-  static const Function glLightModelf = GLMessage_Function_glLightModelf;
-  static const Function glLightModelfv = GLMessage_Function_glLightModelfv;
-  static const Function glLightModelx = GLMessage_Function_glLightModelx;
-  static const Function glLightModelxOES = GLMessage_Function_glLightModelxOES;
-  static const Function glLightModelxv = GLMessage_Function_glLightModelxv;
-  static const Function glLightModelxvOES = GLMessage_Function_glLightModelxvOES;
-  static const Function glLightx = GLMessage_Function_glLightx;
-  static const Function glLightxOES = GLMessage_Function_glLightxOES;
-  static const Function glLightxv = GLMessage_Function_glLightxv;
-  static const Function glLightxvOES = GLMessage_Function_glLightxvOES;
-  static const Function glLineWidth = GLMessage_Function_glLineWidth;
-  static const Function glLineWidthx = GLMessage_Function_glLineWidthx;
-  static const Function glLineWidthxOES = GLMessage_Function_glLineWidthxOES;
-  static const Function glLinkProgram = GLMessage_Function_glLinkProgram;
-  static const Function glLoadIdentity = GLMessage_Function_glLoadIdentity;
-  static const Function glLoadMatrixf = GLMessage_Function_glLoadMatrixf;
-  static const Function glLoadMatrixx = GLMessage_Function_glLoadMatrixx;
-  static const Function glLoadMatrixxOES = GLMessage_Function_glLoadMatrixxOES;
-  static const Function glLoadPaletteFromModelViewMatrixOES = GLMessage_Function_glLoadPaletteFromModelViewMatrixOES;
-  static const Function glLogicOp = GLMessage_Function_glLogicOp;
-  static const Function glMapBufferOES = GLMessage_Function_glMapBufferOES;
-  static const Function glMaterialf = GLMessage_Function_glMaterialf;
-  static const Function glMaterialfv = GLMessage_Function_glMaterialfv;
-  static const Function glMaterialx = GLMessage_Function_glMaterialx;
-  static const Function glMaterialxOES = GLMessage_Function_glMaterialxOES;
-  static const Function glMaterialxv = GLMessage_Function_glMaterialxv;
-  static const Function glMaterialxvOES = GLMessage_Function_glMaterialxvOES;
-  static const Function glMatrixIndexPointerOES = GLMessage_Function_glMatrixIndexPointerOES;
-  static const Function glMatrixMode = GLMessage_Function_glMatrixMode;
-  static const Function glMultiDrawArraysEXT = GLMessage_Function_glMultiDrawArraysEXT;
-  static const Function glMultiDrawElementsEXT = GLMessage_Function_glMultiDrawElementsEXT;
-  static const Function glMultiTexCoord4f = GLMessage_Function_glMultiTexCoord4f;
-  static const Function glMultiTexCoord4x = GLMessage_Function_glMultiTexCoord4x;
-  static const Function glMultiTexCoord4xOES = GLMessage_Function_glMultiTexCoord4xOES;
-  static const Function glMultMatrixf = GLMessage_Function_glMultMatrixf;
-  static const Function glMultMatrixx = GLMessage_Function_glMultMatrixx;
-  static const Function glMultMatrixxOES = GLMessage_Function_glMultMatrixxOES;
-  static const Function glNormal3f = GLMessage_Function_glNormal3f;
-  static const Function glNormal3x = GLMessage_Function_glNormal3x;
-  static const Function glNormal3xOES = GLMessage_Function_glNormal3xOES;
-  static const Function glNormalPointer = GLMessage_Function_glNormalPointer;
-  static const Function glOrthof = GLMessage_Function_glOrthof;
-  static const Function glOrthofOES = GLMessage_Function_glOrthofOES;
-  static const Function glOrthox = GLMessage_Function_glOrthox;
-  static const Function glOrthoxOES = GLMessage_Function_glOrthoxOES;
-  static const Function glPixelStorei = GLMessage_Function_glPixelStorei;
-  static const Function glPointParameterf = GLMessage_Function_glPointParameterf;
-  static const Function glPointParameterfv = GLMessage_Function_glPointParameterfv;
-  static const Function glPointParameterx = GLMessage_Function_glPointParameterx;
-  static const Function glPointParameterxOES = GLMessage_Function_glPointParameterxOES;
-  static const Function glPointParameterxv = GLMessage_Function_glPointParameterxv;
-  static const Function glPointParameterxvOES = GLMessage_Function_glPointParameterxvOES;
-  static const Function glPointSize = GLMessage_Function_glPointSize;
-  static const Function glPointSizePointerOES = GLMessage_Function_glPointSizePointerOES;
-  static const Function glPointSizex = GLMessage_Function_glPointSizex;
-  static const Function glPointSizexOES = GLMessage_Function_glPointSizexOES;
-  static const Function glPolygonOffset = GLMessage_Function_glPolygonOffset;
-  static const Function glPolygonOffsetx = GLMessage_Function_glPolygonOffsetx;
-  static const Function glPolygonOffsetxOES = GLMessage_Function_glPolygonOffsetxOES;
-  static const Function glPopMatrix = GLMessage_Function_glPopMatrix;
-  static const Function glProgramBinaryOES = GLMessage_Function_glProgramBinaryOES;
-  static const Function glPushMatrix = GLMessage_Function_glPushMatrix;
-  static const Function glQueryMatrixxOES = GLMessage_Function_glQueryMatrixxOES;
-  static const Function glReadPixels = GLMessage_Function_glReadPixels;
-  static const Function glReleaseShaderCompiler = GLMessage_Function_glReleaseShaderCompiler;
-  static const Function glRenderbufferStorage = GLMessage_Function_glRenderbufferStorage;
-  static const Function glRenderbufferStorageMultisampleIMG = GLMessage_Function_glRenderbufferStorageMultisampleIMG;
-  static const Function glRenderbufferStorageOES = GLMessage_Function_glRenderbufferStorageOES;
-  static const Function glRotatef = GLMessage_Function_glRotatef;
-  static const Function glRotatex = GLMessage_Function_glRotatex;
-  static const Function glRotatexOES = GLMessage_Function_glRotatexOES;
-  static const Function glSampleCoverage = GLMessage_Function_glSampleCoverage;
-  static const Function glSampleCoveragex = GLMessage_Function_glSampleCoveragex;
-  static const Function glSampleCoveragexOES = GLMessage_Function_glSampleCoveragexOES;
-  static const Function glScalef = GLMessage_Function_glScalef;
-  static const Function glScalex = GLMessage_Function_glScalex;
-  static const Function glScalexOES = GLMessage_Function_glScalexOES;
-  static const Function glScissor = GLMessage_Function_glScissor;
-  static const Function glSelectPerfMonitorCountersAMD = GLMessage_Function_glSelectPerfMonitorCountersAMD;
-  static const Function glSetFenceNV = GLMessage_Function_glSetFenceNV;
-  static const Function glShadeModel = GLMessage_Function_glShadeModel;
-  static const Function glShaderBinary = GLMessage_Function_glShaderBinary;
-  static const Function glShaderSource = GLMessage_Function_glShaderSource;
-  static const Function glStartTilingQCOM = GLMessage_Function_glStartTilingQCOM;
-  static const Function glStencilFunc = GLMessage_Function_glStencilFunc;
-  static const Function glStencilFuncSeparate = GLMessage_Function_glStencilFuncSeparate;
-  static const Function glStencilMask = GLMessage_Function_glStencilMask;
-  static const Function glStencilMaskSeparate = GLMessage_Function_glStencilMaskSeparate;
-  static const Function glStencilOp = GLMessage_Function_glStencilOp;
-  static const Function glStencilOpSeparate = GLMessage_Function_glStencilOpSeparate;
-  static const Function glTestFenceNV = GLMessage_Function_glTestFenceNV;
-  static const Function glTexCoordPointer = GLMessage_Function_glTexCoordPointer;
-  static const Function glTexEnvf = GLMessage_Function_glTexEnvf;
-  static const Function glTexEnvfv = GLMessage_Function_glTexEnvfv;
-  static const Function glTexEnvi = GLMessage_Function_glTexEnvi;
-  static const Function glTexEnviv = GLMessage_Function_glTexEnviv;
-  static const Function glTexEnvx = GLMessage_Function_glTexEnvx;
-  static const Function glTexEnvxOES = GLMessage_Function_glTexEnvxOES;
-  static const Function glTexEnvxv = GLMessage_Function_glTexEnvxv;
-  static const Function glTexEnvxvOES = GLMessage_Function_glTexEnvxvOES;
-  static const Function glTexGenfOES = GLMessage_Function_glTexGenfOES;
-  static const Function glTexGenfvOES = GLMessage_Function_glTexGenfvOES;
-  static const Function glTexGeniOES = GLMessage_Function_glTexGeniOES;
-  static const Function glTexGenivOES = GLMessage_Function_glTexGenivOES;
-  static const Function glTexGenxOES = GLMessage_Function_glTexGenxOES;
-  static const Function glTexGenxvOES = GLMessage_Function_glTexGenxvOES;
-  static const Function glTexImage2D = GLMessage_Function_glTexImage2D;
-  static const Function glTexImage3DOES = GLMessage_Function_glTexImage3DOES;
-  static const Function glTexParameterf = GLMessage_Function_glTexParameterf;
-  static const Function glTexParameterfv = GLMessage_Function_glTexParameterfv;
-  static const Function glTexParameteri = GLMessage_Function_glTexParameteri;
-  static const Function glTexParameteriv = GLMessage_Function_glTexParameteriv;
-  static const Function glTexParameterx = GLMessage_Function_glTexParameterx;
-  static const Function glTexParameterxOES = GLMessage_Function_glTexParameterxOES;
-  static const Function glTexParameterxv = GLMessage_Function_glTexParameterxv;
-  static const Function glTexParameterxvOES = GLMessage_Function_glTexParameterxvOES;
-  static const Function glTexSubImage2D = GLMessage_Function_glTexSubImage2D;
-  static const Function glTexSubImage3DOES = GLMessage_Function_glTexSubImage3DOES;
-  static const Function glTranslatef = GLMessage_Function_glTranslatef;
-  static const Function glTranslatex = GLMessage_Function_glTranslatex;
-  static const Function glTranslatexOES = GLMessage_Function_glTranslatexOES;
-  static const Function glUniform1f = GLMessage_Function_glUniform1f;
-  static const Function glUniform1fv = GLMessage_Function_glUniform1fv;
-  static const Function glUniform1i = GLMessage_Function_glUniform1i;
-  static const Function glUniform1iv = GLMessage_Function_glUniform1iv;
-  static const Function glUniform2f = GLMessage_Function_glUniform2f;
-  static const Function glUniform2fv = GLMessage_Function_glUniform2fv;
-  static const Function glUniform2i = GLMessage_Function_glUniform2i;
-  static const Function glUniform2iv = GLMessage_Function_glUniform2iv;
-  static const Function glUniform3f = GLMessage_Function_glUniform3f;
-  static const Function glUniform3fv = GLMessage_Function_glUniform3fv;
-  static const Function glUniform3i = GLMessage_Function_glUniform3i;
-  static const Function glUniform3iv = GLMessage_Function_glUniform3iv;
-  static const Function glUniform4f = GLMessage_Function_glUniform4f;
-  static const Function glUniform4fv = GLMessage_Function_glUniform4fv;
-  static const Function glUniform4i = GLMessage_Function_glUniform4i;
-  static const Function glUniform4iv = GLMessage_Function_glUniform4iv;
-  static const Function glUniformMatrix2fv = GLMessage_Function_glUniformMatrix2fv;
-  static const Function glUniformMatrix3fv = GLMessage_Function_glUniformMatrix3fv;
-  static const Function glUniformMatrix4fv = GLMessage_Function_glUniformMatrix4fv;
-  static const Function glUnmapBufferOES = GLMessage_Function_glUnmapBufferOES;
-  static const Function glUseProgram = GLMessage_Function_glUseProgram;
-  static const Function glValidateProgram = GLMessage_Function_glValidateProgram;
-  static const Function glVertexAttrib1f = GLMessage_Function_glVertexAttrib1f;
-  static const Function glVertexAttrib1fv = GLMessage_Function_glVertexAttrib1fv;
-  static const Function glVertexAttrib2f = GLMessage_Function_glVertexAttrib2f;
-  static const Function glVertexAttrib2fv = GLMessage_Function_glVertexAttrib2fv;
-  static const Function glVertexAttrib3f = GLMessage_Function_glVertexAttrib3f;
-  static const Function glVertexAttrib3fv = GLMessage_Function_glVertexAttrib3fv;
-  static const Function glVertexAttrib4f = GLMessage_Function_glVertexAttrib4f;
-  static const Function glVertexAttrib4fv = GLMessage_Function_glVertexAttrib4fv;
-  static const Function glVertexAttribPointer = GLMessage_Function_glVertexAttribPointer;
-  static const Function glVertexPointer = GLMessage_Function_glVertexPointer;
-  static const Function glViewport = GLMessage_Function_glViewport;
-  static const Function glWeightPointerOES = GLMessage_Function_glWeightPointerOES;
-  static const Function glReadBuffer = GLMessage_Function_glReadBuffer;
-  static const Function glDrawRangeElements = GLMessage_Function_glDrawRangeElements;
-  static const Function glTexImage3D = GLMessage_Function_glTexImage3D;
-  static const Function glTexSubImage3D = GLMessage_Function_glTexSubImage3D;
-  static const Function glCopyTexSubImage3D = GLMessage_Function_glCopyTexSubImage3D;
-  static const Function glCompressedTexImage3D = GLMessage_Function_glCompressedTexImage3D;
-  static const Function glCompressedTexSubImage3D = GLMessage_Function_glCompressedTexSubImage3D;
-  static const Function glGenQueries = GLMessage_Function_glGenQueries;
-  static const Function glDeleteQueries = GLMessage_Function_glDeleteQueries;
-  static const Function glIsQuery = GLMessage_Function_glIsQuery;
-  static const Function glBeginQuery = GLMessage_Function_glBeginQuery;
-  static const Function glEndQuery = GLMessage_Function_glEndQuery;
-  static const Function glGetQueryiv = GLMessage_Function_glGetQueryiv;
-  static const Function glGetQueryObjectuiv = GLMessage_Function_glGetQueryObjectuiv;
-  static const Function glUnmapBuffer = GLMessage_Function_glUnmapBuffer;
-  static const Function glGetBufferPointerv = GLMessage_Function_glGetBufferPointerv;
-  static const Function glDrawBuffers = GLMessage_Function_glDrawBuffers;
-  static const Function glUniformMatrix2x3fv = GLMessage_Function_glUniformMatrix2x3fv;
-  static const Function glUniformMatrix3x2fv = GLMessage_Function_glUniformMatrix3x2fv;
-  static const Function glUniformMatrix2x4fv = GLMessage_Function_glUniformMatrix2x4fv;
-  static const Function glUniformMatrix4x2fv = GLMessage_Function_glUniformMatrix4x2fv;
-  static const Function glUniformMatrix3x4fv = GLMessage_Function_glUniformMatrix3x4fv;
-  static const Function glUniformMatrix4x3fv = GLMessage_Function_glUniformMatrix4x3fv;
-  static const Function glBlitFramebuffer = GLMessage_Function_glBlitFramebuffer;
-  static const Function glRenderbufferStorageMultisample = GLMessage_Function_glRenderbufferStorageMultisample;
-  static const Function glFramebufferTextureLayer = GLMessage_Function_glFramebufferTextureLayer;
-  static const Function glMapBufferRange = GLMessage_Function_glMapBufferRange;
-  static const Function glFlushMappedBufferRange = GLMessage_Function_glFlushMappedBufferRange;
-  static const Function glBindVertexArray = GLMessage_Function_glBindVertexArray;
-  static const Function glDeleteVertexArrays = GLMessage_Function_glDeleteVertexArrays;
-  static const Function glGenVertexArrays = GLMessage_Function_glGenVertexArrays;
-  static const Function glIsVertexArray = GLMessage_Function_glIsVertexArray;
-  static const Function glGetIntegeri_v = GLMessage_Function_glGetIntegeri_v;
-  static const Function glBeginTransformFeedback = GLMessage_Function_glBeginTransformFeedback;
-  static const Function glEndTransformFeedback = GLMessage_Function_glEndTransformFeedback;
-  static const Function glBindBufferRange = GLMessage_Function_glBindBufferRange;
-  static const Function glBindBufferBase = GLMessage_Function_glBindBufferBase;
-  static const Function glTransformFeedbackVaryings = GLMessage_Function_glTransformFeedbackVaryings;
-  static const Function glGetTransformFeedbackVarying = GLMessage_Function_glGetTransformFeedbackVarying;
-  static const Function glVertexAttribIPointer = GLMessage_Function_glVertexAttribIPointer;
-  static const Function glGetVertexAttribIiv = GLMessage_Function_glGetVertexAttribIiv;
-  static const Function glGetVertexAttribIuiv = GLMessage_Function_glGetVertexAttribIuiv;
-  static const Function glVertexAttribI4i = GLMessage_Function_glVertexAttribI4i;
-  static const Function glVertexAttribI4ui = GLMessage_Function_glVertexAttribI4ui;
-  static const Function glVertexAttribI4iv = GLMessage_Function_glVertexAttribI4iv;
-  static const Function glVertexAttribI4uiv = GLMessage_Function_glVertexAttribI4uiv;
-  static const Function glGetUniformuiv = GLMessage_Function_glGetUniformuiv;
-  static const Function glGetFragDataLocation = GLMessage_Function_glGetFragDataLocation;
-  static const Function glUniform1ui = GLMessage_Function_glUniform1ui;
-  static const Function glUniform2ui = GLMessage_Function_glUniform2ui;
-  static const Function glUniform3ui = GLMessage_Function_glUniform3ui;
-  static const Function glUniform4ui = GLMessage_Function_glUniform4ui;
-  static const Function glUniform1uiv = GLMessage_Function_glUniform1uiv;
-  static const Function glUniform2uiv = GLMessage_Function_glUniform2uiv;
-  static const Function glUniform3uiv = GLMessage_Function_glUniform3uiv;
-  static const Function glUniform4uiv = GLMessage_Function_glUniform4uiv;
-  static const Function glClearBufferiv = GLMessage_Function_glClearBufferiv;
-  static const Function glClearBufferuiv = GLMessage_Function_glClearBufferuiv;
-  static const Function glClearBufferfv = GLMessage_Function_glClearBufferfv;
-  static const Function glClearBufferfi = GLMessage_Function_glClearBufferfi;
-  static const Function glGetStringi = GLMessage_Function_glGetStringi;
-  static const Function glCopyBufferSubData = GLMessage_Function_glCopyBufferSubData;
-  static const Function glGetUniformIndices = GLMessage_Function_glGetUniformIndices;
-  static const Function glGetActiveUniformsiv = GLMessage_Function_glGetActiveUniformsiv;
-  static const Function glGetUniformBlockIndex = GLMessage_Function_glGetUniformBlockIndex;
-  static const Function glGetActiveUniformBlockiv = GLMessage_Function_glGetActiveUniformBlockiv;
-  static const Function glGetActiveUniformBlockName = GLMessage_Function_glGetActiveUniformBlockName;
-  static const Function glUniformBlockBinding = GLMessage_Function_glUniformBlockBinding;
-  static const Function glDrawArraysInstanced = GLMessage_Function_glDrawArraysInstanced;
-  static const Function glDrawElementsInstanced = GLMessage_Function_glDrawElementsInstanced;
-  static const Function glFenceSync = GLMessage_Function_glFenceSync;
-  static const Function glIsSync = GLMessage_Function_glIsSync;
-  static const Function glDeleteSync = GLMessage_Function_glDeleteSync;
-  static const Function glClientWaitSync = GLMessage_Function_glClientWaitSync;
-  static const Function glWaitSync = GLMessage_Function_glWaitSync;
-  static const Function glGetInteger64v = GLMessage_Function_glGetInteger64v;
-  static const Function glGetSynciv = GLMessage_Function_glGetSynciv;
-  static const Function glGetInteger64i_v = GLMessage_Function_glGetInteger64i_v;
-  static const Function glGetBufferParameteri64v = GLMessage_Function_glGetBufferParameteri64v;
-  static const Function glGenSamplers = GLMessage_Function_glGenSamplers;
-  static const Function glDeleteSamplers = GLMessage_Function_glDeleteSamplers;
-  static const Function glIsSampler = GLMessage_Function_glIsSampler;
-  static const Function glBindSampler = GLMessage_Function_glBindSampler;
-  static const Function glSamplerParameteri = GLMessage_Function_glSamplerParameteri;
-  static const Function glSamplerParameteriv = GLMessage_Function_glSamplerParameteriv;
-  static const Function glSamplerParameterf = GLMessage_Function_glSamplerParameterf;
-  static const Function glSamplerParameterfv = GLMessage_Function_glSamplerParameterfv;
-  static const Function glGetSamplerParameteriv = GLMessage_Function_glGetSamplerParameteriv;
-  static const Function glGetSamplerParameterfv = GLMessage_Function_glGetSamplerParameterfv;
-  static const Function glVertexAttribDivisor = GLMessage_Function_glVertexAttribDivisor;
-  static const Function glBindTransformFeedback = GLMessage_Function_glBindTransformFeedback;
-  static const Function glDeleteTransformFeedbacks = GLMessage_Function_glDeleteTransformFeedbacks;
-  static const Function glGenTransformFeedbacks = GLMessage_Function_glGenTransformFeedbacks;
-  static const Function glIsTransformFeedback = GLMessage_Function_glIsTransformFeedback;
-  static const Function glPauseTransformFeedback = GLMessage_Function_glPauseTransformFeedback;
-  static const Function glResumeTransformFeedback = GLMessage_Function_glResumeTransformFeedback;
-  static const Function glGetProgramBinary = GLMessage_Function_glGetProgramBinary;
-  static const Function glProgramBinary = GLMessage_Function_glProgramBinary;
-  static const Function glProgramParameteri = GLMessage_Function_glProgramParameteri;
-  static const Function glInvalidateFramebuffer = GLMessage_Function_glInvalidateFramebuffer;
-  static const Function glInvalidateSubFramebuffer = GLMessage_Function_glInvalidateSubFramebuffer;
-  static const Function glTexStorage2D = GLMessage_Function_glTexStorage2D;
-  static const Function glTexStorage3D = GLMessage_Function_glTexStorage3D;
-  static const Function glGetInternalformativ = GLMessage_Function_glGetInternalformativ;
-  static const Function glBeginPerfQueryINTEL = GLMessage_Function_glBeginPerfQueryINTEL;
-  static const Function glCreatePerfQueryINTEL = GLMessage_Function_glCreatePerfQueryINTEL;
-  static const Function glDeletePerfQueryINTEL = GLMessage_Function_glDeletePerfQueryINTEL;
-  static const Function glEndPerfQueryINTEL = GLMessage_Function_glEndPerfQueryINTEL;
-  static const Function glGetFirstPerfQueryIdINTEL = GLMessage_Function_glGetFirstPerfQueryIdINTEL;
-  static const Function glGetNextPerfQueryIdINTEL = GLMessage_Function_glGetNextPerfQueryIdINTEL;
-  static const Function glGetPerfCounterInfoINTEL = GLMessage_Function_glGetPerfCounterInfoINTEL;
-  static const Function glGetPerfQueryDataINTEL = GLMessage_Function_glGetPerfQueryDataINTEL;
-  static const Function glGetPerfQueryIdByNameINTEL = GLMessage_Function_glGetPerfQueryIdByNameINTEL;
-  static const Function glGetPerfQueryInfoINTEL = GLMessage_Function_glGetPerfQueryInfoINTEL;
-  static const Function glBlendBarrierKHR = GLMessage_Function_glBlendBarrierKHR;
-  static const Function glBlendBarrierNV = GLMessage_Function_glBlendBarrierNV;
-  static const Function glBlendParameteriNV = GLMessage_Function_glBlendParameteriNV;
-  static const Function glBlitFramebufferNV = GLMessage_Function_glBlitFramebufferNV;
-  static const Function glFenceSyncAPPLE = GLMessage_Function_glFenceSyncAPPLE;
-  static const Function glIsSyncAPPLE = GLMessage_Function_glIsSyncAPPLE;
-  static const Function glDeleteSyncAPPLE = GLMessage_Function_glDeleteSyncAPPLE;
-  static const Function glClientWaitSyncAPPLE = GLMessage_Function_glClientWaitSyncAPPLE;
-  static const Function glWaitSyncAPPLE = GLMessage_Function_glWaitSyncAPPLE;
-  static const Function glGetInteger64vAPPLE = GLMessage_Function_glGetInteger64vAPPLE;
-  static const Function glGetSyncivAPPLE = GLMessage_Function_glGetSyncivAPPLE;
-  static const Function glCopyBufferSubDataNV = GLMessage_Function_glCopyBufferSubDataNV;
-  static const Function glActiveShaderProgramEXT = GLMessage_Function_glActiveShaderProgramEXT;
-  static const Function glAlphaFuncQCOM = GLMessage_Function_glAlphaFuncQCOM;
-  static const Function glBeginQueryEXT = GLMessage_Function_glBeginQueryEXT;
-  static const Function glBindProgramPipelineEXT = GLMessage_Function_glBindProgramPipelineEXT;
-  static const Function glBlitFramebufferANGLE = GLMessage_Function_glBlitFramebufferANGLE;
-  static const Function glCreateShaderProgramvEXT = GLMessage_Function_glCreateShaderProgramvEXT;
-  static const Function glDeleteProgramPipelinesEXT = GLMessage_Function_glDeleteProgramPipelinesEXT;
-  static const Function glDeleteQueriesEXT = GLMessage_Function_glDeleteQueriesEXT;
-  static const Function glDrawBuffersNV = GLMessage_Function_glDrawBuffersNV;
-  static const Function glEndQueryEXT = GLMessage_Function_glEndQueryEXT;
-  static const Function glFramebufferTexture2DMultisampleEXT = GLMessage_Function_glFramebufferTexture2DMultisampleEXT;
-  static const Function glGenProgramPipelinesEXT = GLMessage_Function_glGenProgramPipelinesEXT;
-  static const Function glGenQueriesEXT = GLMessage_Function_glGenQueriesEXT;
-  static const Function glGetGraphicsResetStatusEXT = GLMessage_Function_glGetGraphicsResetStatusEXT;
-  static const Function glGetObjectLabelEXT = GLMessage_Function_glGetObjectLabelEXT;
-  static const Function glGetProgramPipelineInfoLogEXT = GLMessage_Function_glGetProgramPipelineInfoLogEXT;
-  static const Function glGetProgramPipelineivEXT = GLMessage_Function_glGetProgramPipelineivEXT;
-  static const Function glGetQueryObjectuivEXT = GLMessage_Function_glGetQueryObjectuivEXT;
-  static const Function glGetQueryivEXT = GLMessage_Function_glGetQueryivEXT;
-  static const Function glGetnUniformfvEXT = GLMessage_Function_glGetnUniformfvEXT;
-  static const Function glGetnUniformivEXT = GLMessage_Function_glGetnUniformivEXT;
-  static const Function glInsertEventMarkerEXT = GLMessage_Function_glInsertEventMarkerEXT;
-  static const Function glIsProgramPipelineEXT = GLMessage_Function_glIsProgramPipelineEXT;
-  static const Function glIsQueryEXT = GLMessage_Function_glIsQueryEXT;
-  static const Function glLabelObjectEXT = GLMessage_Function_glLabelObjectEXT;
-  static const Function glPopGroupMarkerEXT = GLMessage_Function_glPopGroupMarkerEXT;
-  static const Function glProgramParameteriEXT = GLMessage_Function_glProgramParameteriEXT;
-  static const Function glProgramUniform1fEXT = GLMessage_Function_glProgramUniform1fEXT;
-  static const Function glProgramUniform1fvEXT = GLMessage_Function_glProgramUniform1fvEXT;
-  static const Function glProgramUniform1iEXT = GLMessage_Function_glProgramUniform1iEXT;
-  static const Function glProgramUniform1ivEXT = GLMessage_Function_glProgramUniform1ivEXT;
-  static const Function glProgramUniform2fEXT = GLMessage_Function_glProgramUniform2fEXT;
-  static const Function glProgramUniform2fvEXT = GLMessage_Function_glProgramUniform2fvEXT;
-  static const Function glProgramUniform2iEXT = GLMessage_Function_glProgramUniform2iEXT;
-  static const Function glProgramUniform2ivEXT = GLMessage_Function_glProgramUniform2ivEXT;
-  static const Function glProgramUniform3fEXT = GLMessage_Function_glProgramUniform3fEXT;
-  static const Function glProgramUniform3fvEXT = GLMessage_Function_glProgramUniform3fvEXT;
-  static const Function glProgramUniform3iEXT = GLMessage_Function_glProgramUniform3iEXT;
-  static const Function glProgramUniform3ivEXT = GLMessage_Function_glProgramUniform3ivEXT;
-  static const Function glProgramUniform4fEXT = GLMessage_Function_glProgramUniform4fEXT;
-  static const Function glProgramUniform4fvEXT = GLMessage_Function_glProgramUniform4fvEXT;
-  static const Function glProgramUniform4iEXT = GLMessage_Function_glProgramUniform4iEXT;
-  static const Function glProgramUniform4ivEXT = GLMessage_Function_glProgramUniform4ivEXT;
-  static const Function glProgramUniformMatrix2fvEXT = GLMessage_Function_glProgramUniformMatrix2fvEXT;
-  static const Function glProgramUniformMatrix3fvEXT = GLMessage_Function_glProgramUniformMatrix3fvEXT;
-  static const Function glProgramUniformMatrix4fvEXT = GLMessage_Function_glProgramUniformMatrix4fvEXT;
-  static const Function glPushGroupMarkerEXT = GLMessage_Function_glPushGroupMarkerEXT;
-  static const Function glReadBufferNV = GLMessage_Function_glReadBufferNV;
-  static const Function glReadnPixelsEXT = GLMessage_Function_glReadnPixelsEXT;
-  static const Function glRenderbufferStorageMultisampleANGLE = GLMessage_Function_glRenderbufferStorageMultisampleANGLE;
-  static const Function glRenderbufferStorageMultisampleAPPLE = GLMessage_Function_glRenderbufferStorageMultisampleAPPLE;
-  static const Function glRenderbufferStorageMultisampleEXT = GLMessage_Function_glRenderbufferStorageMultisampleEXT;
-  static const Function glResolveMultisampleFramebufferAPPLE = GLMessage_Function_glResolveMultisampleFramebufferAPPLE;
-  static const Function glTexStorage1DEXT = GLMessage_Function_glTexStorage1DEXT;
-  static const Function glTexStorage2DEXT = GLMessage_Function_glTexStorage2DEXT;
-  static const Function glTexStorage3DEXT = GLMessage_Function_glTexStorage3DEXT;
-  static const Function glTextureStorage1DEXT = GLMessage_Function_glTextureStorage1DEXT;
-  static const Function glTextureStorage2DEXT = GLMessage_Function_glTextureStorage2DEXT;
-  static const Function glTextureStorage3DEXT = GLMessage_Function_glTextureStorage3DEXT;
-  static const Function glUseProgramStagesEXT = GLMessage_Function_glUseProgramStagesEXT;
-  static const Function glValidateProgramPipelineEXT = GLMessage_Function_glValidateProgramPipelineEXT;
-  static const Function glCopyTextureLevelsAPPLE = GLMessage_Function_glCopyTextureLevelsAPPLE;
-  static const Function glDebugMessageControlKHR = GLMessage_Function_glDebugMessageControlKHR;
-  static const Function glDebugMessageInsertKHR = GLMessage_Function_glDebugMessageInsertKHR;
-  static const Function glDebugMessageCallbackKHR = GLMessage_Function_glDebugMessageCallbackKHR;
-  static const Function glGetDebugMessageLogKHR = GLMessage_Function_glGetDebugMessageLogKHR;
-  static const Function glPushDebugGroupKHR = GLMessage_Function_glPushDebugGroupKHR;
-  static const Function glPopDebugGroupKHR = GLMessage_Function_glPopDebugGroupKHR;
-  static const Function glObjectLabelKHR = GLMessage_Function_glObjectLabelKHR;
-  static const Function glGetObjectLabelKHR = GLMessage_Function_glGetObjectLabelKHR;
-  static const Function glObjectPtrLabelKHR = GLMessage_Function_glObjectPtrLabelKHR;
-  static const Function glGetObjectPtrLabelKHR = GLMessage_Function_glGetObjectPtrLabelKHR;
-  static const Function glGetPointervKHR = GLMessage_Function_glGetPointervKHR;
-  static const Function glDrawArraysInstancedANGLE = GLMessage_Function_glDrawArraysInstancedANGLE;
-  static const Function glDrawElementsInstancedANGLE = GLMessage_Function_glDrawElementsInstancedANGLE;
-  static const Function glVertexAttribDivisorANGLE = GLMessage_Function_glVertexAttribDivisorANGLE;
-  static const Function glDrawArraysInstancedEXT = GLMessage_Function_glDrawArraysInstancedEXT;
-  static const Function glDrawElementsInstancedEXT = GLMessage_Function_glDrawElementsInstancedEXT;
-  static const Function glVertexAttribDivisorEXT = GLMessage_Function_glVertexAttribDivisorEXT;
-  static const Function glDrawArraysInstancedNV = GLMessage_Function_glDrawArraysInstancedNV;
-  static const Function glDrawElementsInstancedNV = GLMessage_Function_glDrawElementsInstancedNV;
-  static const Function glVertexAttribDivisorNV = GLMessage_Function_glVertexAttribDivisorNV;
-  static const Function glDrawBuffersEXT = GLMessage_Function_glDrawBuffersEXT;
-  static const Function glReadBufferIndexedEXT = GLMessage_Function_glReadBufferIndexedEXT;
-  static const Function glDrawBuffersIndexedEXT = GLMessage_Function_glDrawBuffersIndexedEXT;
-  static const Function glGetIntegeri_vEXT = GLMessage_Function_glGetIntegeri_vEXT;
-  static const Function glMapBufferRangeEXT = GLMessage_Function_glMapBufferRangeEXT;
-  static const Function glFlushMappedBufferRangeEXT = GLMessage_Function_glFlushMappedBufferRangeEXT;
-  static const Function glQueryCounterEXT = GLMessage_Function_glQueryCounterEXT;
-  static const Function glGetQueryObjecti64vEXT = GLMessage_Function_glGetQueryObjecti64vEXT;
-  static const Function glGetQueryObjectivEXT = GLMessage_Function_glGetQueryObjectivEXT;
-  static const Function glGetQueryObjectui64vEXT = GLMessage_Function_glGetQueryObjectui64vEXT;
-  static const Function glGetTranslatedShaderSourceANGLE = GLMessage_Function_glGetTranslatedShaderSourceANGLE;
-  static const Function glMinSampleShadingOES = GLMessage_Function_glMinSampleShadingOES;
-  static const Function glMultiTexCoord1bOES = GLMessage_Function_glMultiTexCoord1bOES;
-  static const Function glMultiTexCoord1bvOES = GLMessage_Function_glMultiTexCoord1bvOES;
-  static const Function glMultiTexCoord2bOES = GLMessage_Function_glMultiTexCoord2bOES;
-  static const Function glMultiTexCoord2bvOES = GLMessage_Function_glMultiTexCoord2bvOES;
-  static const Function glMultiTexCoord3bOES = GLMessage_Function_glMultiTexCoord3bOES;
-  static const Function glMultiTexCoord3bvOES = GLMessage_Function_glMultiTexCoord3bvOES;
-  static const Function glMultiTexCoord4bOES = GLMessage_Function_glMultiTexCoord4bOES;
-  static const Function glMultiTexCoord4bvOES = GLMessage_Function_glMultiTexCoord4bvOES;
-  static const Function glTexCoord1bOES = GLMessage_Function_glTexCoord1bOES;
-  static const Function glTexCoord1bvOES = GLMessage_Function_glTexCoord1bvOES;
-  static const Function glTexCoord2bOES = GLMessage_Function_glTexCoord2bOES;
-  static const Function glTexCoord2bvOES = GLMessage_Function_glTexCoord2bvOES;
-  static const Function glTexCoord3bOES = GLMessage_Function_glTexCoord3bOES;
-  static const Function glTexCoord3bvOES = GLMessage_Function_glTexCoord3bvOES;
-  static const Function glTexCoord4bOES = GLMessage_Function_glTexCoord4bOES;
-  static const Function glTexCoord4bvOES = GLMessage_Function_glTexCoord4bvOES;
-  static const Function glVertex2bOES = GLMessage_Function_glVertex2bOES;
-  static const Function glVertex2bvOES = GLMessage_Function_glVertex2bvOES;
-  static const Function glVertex3bOES = GLMessage_Function_glVertex3bOES;
-  static const Function glVertex3bvOES = GLMessage_Function_glVertex3bvOES;
-  static const Function glVertex4bOES = GLMessage_Function_glVertex4bOES;
-  static const Function glVertex4bvOES = GLMessage_Function_glVertex4bvOES;
-  static const Function glProgramUniform1uiEXT = GLMessage_Function_glProgramUniform1uiEXT;
-  static const Function glProgramUniform2uiEXT = GLMessage_Function_glProgramUniform2uiEXT;
-  static const Function glProgramUniform3uiEXT = GLMessage_Function_glProgramUniform3uiEXT;
-  static const Function glProgramUniform4uiEXT = GLMessage_Function_glProgramUniform4uiEXT;
-  static const Function glProgramUniform1uivEXT = GLMessage_Function_glProgramUniform1uivEXT;
-  static const Function glProgramUniform2uivEXT = GLMessage_Function_glProgramUniform2uivEXT;
-  static const Function glProgramUniform3uivEXT = GLMessage_Function_glProgramUniform3uivEXT;
-  static const Function glProgramUniform4uivEXT = GLMessage_Function_glProgramUniform4uivEXT;
-  static const Function glProgramUniformMatrix2x3fvEXT = GLMessage_Function_glProgramUniformMatrix2x3fvEXT;
-  static const Function glProgramUniformMatrix3x2fvEXT = GLMessage_Function_glProgramUniformMatrix3x2fvEXT;
-  static const Function glProgramUniformMatrix2x4fvEXT = GLMessage_Function_glProgramUniformMatrix2x4fvEXT;
-  static const Function glProgramUniformMatrix4x2fvEXT = GLMessage_Function_glProgramUniformMatrix4x2fvEXT;
-  static const Function glProgramUniformMatrix3x4fvEXT = GLMessage_Function_glProgramUniformMatrix3x4fvEXT;
-  static const Function glProgramUniformMatrix4x3fvEXT = GLMessage_Function_glProgramUniformMatrix4x3fvEXT;
-  static const Function glRenderbufferStorageMultisampleNV = GLMessage_Function_glRenderbufferStorageMultisampleNV;
-  static const Function glSampleCoverageOES = GLMessage_Function_glSampleCoverageOES;
-  static const Function glTexStorage3DMultisampleOES = GLMessage_Function_glTexStorage3DMultisampleOES;
-  static const Function glUniformMatrix2x3fvNV = GLMessage_Function_glUniformMatrix2x3fvNV;
-  static const Function glUniformMatrix3x2fvNV = GLMessage_Function_glUniformMatrix3x2fvNV;
-  static const Function glUniformMatrix2x4fvNV = GLMessage_Function_glUniformMatrix2x4fvNV;
-  static const Function glUniformMatrix4x2fvNV = GLMessage_Function_glUniformMatrix4x2fvNV;
-  static const Function glUniformMatrix3x4fvNV = GLMessage_Function_glUniformMatrix3x4fvNV;
-  static const Function glUniformMatrix4x3fvNV = GLMessage_Function_glUniformMatrix4x3fvNV;
-  static const Function glActiveShaderProgram = GLMessage_Function_glActiveShaderProgram;
-  static const Function glBindImageTexture = GLMessage_Function_glBindImageTexture;
-  static const Function glBindProgramPipeline = GLMessage_Function_glBindProgramPipeline;
-  static const Function glBindVertexBuffer = GLMessage_Function_glBindVertexBuffer;
-  static const Function glCreateShaderProgramv = GLMessage_Function_glCreateShaderProgramv;
-  static const Function glDeleteProgramPipelines = GLMessage_Function_glDeleteProgramPipelines;
-  static const Function glDispatchCompute = GLMessage_Function_glDispatchCompute;
-  static const Function glDispatchComputeIndirect = GLMessage_Function_glDispatchComputeIndirect;
-  static const Function glDrawArraysIndirect = GLMessage_Function_glDrawArraysIndirect;
-  static const Function glDrawElementsIndirect = GLMessage_Function_glDrawElementsIndirect;
-  static const Function glFramebufferParameteri = GLMessage_Function_glFramebufferParameteri;
-  static const Function glGenProgramPipelines = GLMessage_Function_glGenProgramPipelines;
-  static const Function glGetBooleani_v = GLMessage_Function_glGetBooleani_v;
-  static const Function glGetFramebufferParameteriv = GLMessage_Function_glGetFramebufferParameteriv;
-  static const Function glGetMultisamplefv = GLMessage_Function_glGetMultisamplefv;
-  static const Function glGetProgramInterfaceiv = GLMessage_Function_glGetProgramInterfaceiv;
-  static const Function glGetProgramPipelineInfoLog = GLMessage_Function_glGetProgramPipelineInfoLog;
-  static const Function glGetProgramPipelineiv = GLMessage_Function_glGetProgramPipelineiv;
-  static const Function glGetProgramResourceIndex = GLMessage_Function_glGetProgramResourceIndex;
-  static const Function glGetProgramResourceLocation = GLMessage_Function_glGetProgramResourceLocation;
-  static const Function glGetProgramResourceName = GLMessage_Function_glGetProgramResourceName;
-  static const Function glGetProgramResourceiv = GLMessage_Function_glGetProgramResourceiv;
-  static const Function glGetTexLevelParameterfv = GLMessage_Function_glGetTexLevelParameterfv;
-  static const Function glGetTexLevelParameteriv = GLMessage_Function_glGetTexLevelParameteriv;
-  static const Function glIsProgramPipeline = GLMessage_Function_glIsProgramPipeline;
-  static const Function glMemoryBarrier = GLMessage_Function_glMemoryBarrier;
-  static const Function glMemoryBarrierByRegion = GLMessage_Function_glMemoryBarrierByRegion;
-  static const Function glProgramUniform1f = GLMessage_Function_glProgramUniform1f;
-  static const Function glProgramUniform1fv = GLMessage_Function_glProgramUniform1fv;
-  static const Function glProgramUniform1i = GLMessage_Function_glProgramUniform1i;
-  static const Function glProgramUniform1iv = GLMessage_Function_glProgramUniform1iv;
-  static const Function glProgramUniform1ui = GLMessage_Function_glProgramUniform1ui;
-  static const Function glProgramUniform1uiv = GLMessage_Function_glProgramUniform1uiv;
-  static const Function glProgramUniform2f = GLMessage_Function_glProgramUniform2f;
-  static const Function glProgramUniform2fv = GLMessage_Function_glProgramUniform2fv;
-  static const Function glProgramUniform2i = GLMessage_Function_glProgramUniform2i;
-  static const Function glProgramUniform2iv = GLMessage_Function_glProgramUniform2iv;
-  static const Function glProgramUniform2ui = GLMessage_Function_glProgramUniform2ui;
-  static const Function glProgramUniform2uiv = GLMessage_Function_glProgramUniform2uiv;
-  static const Function glProgramUniform3f = GLMessage_Function_glProgramUniform3f;
-  static const Function glProgramUniform3fv = GLMessage_Function_glProgramUniform3fv;
-  static const Function glProgramUniform3i = GLMessage_Function_glProgramUniform3i;
-  static const Function glProgramUniform3iv = GLMessage_Function_glProgramUniform3iv;
-  static const Function glProgramUniform3ui = GLMessage_Function_glProgramUniform3ui;
-  static const Function glProgramUniform3uiv = GLMessage_Function_glProgramUniform3uiv;
-  static const Function glProgramUniform4f = GLMessage_Function_glProgramUniform4f;
-  static const Function glProgramUniform4fv = GLMessage_Function_glProgramUniform4fv;
-  static const Function glProgramUniform4i = GLMessage_Function_glProgramUniform4i;
-  static const Function glProgramUniform4iv = GLMessage_Function_glProgramUniform4iv;
-  static const Function glProgramUniform4ui = GLMessage_Function_glProgramUniform4ui;
-  static const Function glProgramUniform4uiv = GLMessage_Function_glProgramUniform4uiv;
-  static const Function glProgramUniformMatrix2fv = GLMessage_Function_glProgramUniformMatrix2fv;
-  static const Function glProgramUniformMatrix2x3fv = GLMessage_Function_glProgramUniformMatrix2x3fv;
-  static const Function glProgramUniformMatrix2x4fv = GLMessage_Function_glProgramUniformMatrix2x4fv;
-  static const Function glProgramUniformMatrix3fv = GLMessage_Function_glProgramUniformMatrix3fv;
-  static const Function glProgramUniformMatrix3x2fv = GLMessage_Function_glProgramUniformMatrix3x2fv;
-  static const Function glProgramUniformMatrix3x4fv = GLMessage_Function_glProgramUniformMatrix3x4fv;
-  static const Function glProgramUniformMatrix4fv = GLMessage_Function_glProgramUniformMatrix4fv;
-  static const Function glProgramUniformMatrix4x2fv = GLMessage_Function_glProgramUniformMatrix4x2fv;
-  static const Function glProgramUniformMatrix4x3fv = GLMessage_Function_glProgramUniformMatrix4x3fv;
-  static const Function glSampleMaski = GLMessage_Function_glSampleMaski;
-  static const Function glTexStorage2DMultisample = GLMessage_Function_glTexStorage2DMultisample;
-  static const Function glUseProgramStages = GLMessage_Function_glUseProgramStages;
-  static const Function glValidateProgramPipeline = GLMessage_Function_glValidateProgramPipeline;
-  static const Function glVertexAttribBinding = GLMessage_Function_glVertexAttribBinding;
-  static const Function glVertexAttribFormat = GLMessage_Function_glVertexAttribFormat;
-  static const Function glVertexAttribIFormat = GLMessage_Function_glVertexAttribIFormat;
-  static const Function glVertexBindingDivisor = GLMessage_Function_glVertexBindingDivisor;
-  static const Function glBlendEquationSeparateiEXT = GLMessage_Function_glBlendEquationSeparateiEXT;
-  static const Function glBlendEquationiEXT = GLMessage_Function_glBlendEquationiEXT;
-  static const Function glBlendFuncSeparateiEXT = GLMessage_Function_glBlendFuncSeparateiEXT;
-  static const Function glBlendFunciEXT = GLMessage_Function_glBlendFunciEXT;
-  static const Function glColorMaskiEXT = GLMessage_Function_glColorMaskiEXT;
-  static const Function glCopyImageSubDataEXT = GLMessage_Function_glCopyImageSubDataEXT;
-  static const Function glDisableiEXT = GLMessage_Function_glDisableiEXT;
-  static const Function glEnableiEXT = GLMessage_Function_glEnableiEXT;
-  static const Function glFramebufferTextureEXT = GLMessage_Function_glFramebufferTextureEXT;
-  static const Function glGetSamplerParameterIivEXT = GLMessage_Function_glGetSamplerParameterIivEXT;
-  static const Function glGetSamplerParameterIuivEXT = GLMessage_Function_glGetSamplerParameterIuivEXT;
-  static const Function glGetTexParameterIivEXT = GLMessage_Function_glGetTexParameterIivEXT;
-  static const Function glGetTexParameterIuivEXT = GLMessage_Function_glGetTexParameterIuivEXT;
-  static const Function glIsEnablediEXT = GLMessage_Function_glIsEnablediEXT;
-  static const Function glPatchParameteriEXT = GLMessage_Function_glPatchParameteriEXT;
-  static const Function glPrimitiveBoundingBoxEXT = GLMessage_Function_glPrimitiveBoundingBoxEXT;
-  static const Function glSamplerParameterIivEXT = GLMessage_Function_glSamplerParameterIivEXT;
-  static const Function glSamplerParameterIuivEXT = GLMessage_Function_glSamplerParameterIuivEXT;
-  static const Function glTexBufferEXT = GLMessage_Function_glTexBufferEXT;
-  static const Function glTexBufferRangeEXT = GLMessage_Function_glTexBufferRangeEXT;
-  static const Function glTexParameterIivEXT = GLMessage_Function_glTexParameterIivEXT;
-  static const Function glTexParameterIuivEXT = GLMessage_Function_glTexParameterIuivEXT;
-  static const Function glTextureViewEXT = GLMessage_Function_glTextureViewEXT;
-  static const Function eglGetDisplay = GLMessage_Function_eglGetDisplay;
-  static const Function eglInitialize = GLMessage_Function_eglInitialize;
-  static const Function eglTerminate = GLMessage_Function_eglTerminate;
-  static const Function eglGetConfigs = GLMessage_Function_eglGetConfigs;
-  static const Function eglChooseConfig = GLMessage_Function_eglChooseConfig;
-  static const Function eglGetConfigAttrib = GLMessage_Function_eglGetConfigAttrib;
-  static const Function eglCreateWindowSurface = GLMessage_Function_eglCreateWindowSurface;
-  static const Function eglCreatePixmapSurface = GLMessage_Function_eglCreatePixmapSurface;
-  static const Function eglCreatePbufferSurface = GLMessage_Function_eglCreatePbufferSurface;
-  static const Function eglDestroySurface = GLMessage_Function_eglDestroySurface;
-  static const Function eglQuerySurface = GLMessage_Function_eglQuerySurface;
-  static const Function eglCreateContext = GLMessage_Function_eglCreateContext;
-  static const Function eglDestroyContext = GLMessage_Function_eglDestroyContext;
-  static const Function eglMakeCurrent = GLMessage_Function_eglMakeCurrent;
-  static const Function eglGetCurrentContext = GLMessage_Function_eglGetCurrentContext;
-  static const Function eglGetCurrentSurface = GLMessage_Function_eglGetCurrentSurface;
-  static const Function eglGetCurrentDisplay = GLMessage_Function_eglGetCurrentDisplay;
-  static const Function eglQueryContext = GLMessage_Function_eglQueryContext;
-  static const Function eglWaitGL = GLMessage_Function_eglWaitGL;
-  static const Function eglWaitNative = GLMessage_Function_eglWaitNative;
-  static const Function eglSwapBuffers = GLMessage_Function_eglSwapBuffers;
-  static const Function eglCopyBuffers = GLMessage_Function_eglCopyBuffers;
-  static const Function eglGetError = GLMessage_Function_eglGetError;
-  static const Function eglQueryString = GLMessage_Function_eglQueryString;
-  static const Function eglGetProcAddress = GLMessage_Function_eglGetProcAddress;
-  static const Function eglSurfaceAttrib = GLMessage_Function_eglSurfaceAttrib;
-  static const Function eglBindTexImage = GLMessage_Function_eglBindTexImage;
-  static const Function eglReleaseTexImage = GLMessage_Function_eglReleaseTexImage;
-  static const Function eglSwapInterval = GLMessage_Function_eglSwapInterval;
-  static const Function eglBindAPI = GLMessage_Function_eglBindAPI;
-  static const Function eglQueryAPI = GLMessage_Function_eglQueryAPI;
-  static const Function eglWaitClient = GLMessage_Function_eglWaitClient;
-  static const Function eglReleaseThread = GLMessage_Function_eglReleaseThread;
-  static const Function eglCreatePbufferFromClientBuffer = GLMessage_Function_eglCreatePbufferFromClientBuffer;
-  static const Function eglLockSurfaceKHR = GLMessage_Function_eglLockSurfaceKHR;
-  static const Function eglUnlockSurfaceKHR = GLMessage_Function_eglUnlockSurfaceKHR;
-  static const Function eglCreateImageKHR = GLMessage_Function_eglCreateImageKHR;
-  static const Function eglDestroyImageKHR = GLMessage_Function_eglDestroyImageKHR;
-  static const Function eglCreateSyncKHR = GLMessage_Function_eglCreateSyncKHR;
-  static const Function eglDestroySyncKHR = GLMessage_Function_eglDestroySyncKHR;
-  static const Function eglClientWaitSyncKHR = GLMessage_Function_eglClientWaitSyncKHR;
-  static const Function eglGetSyncAttribKHR = GLMessage_Function_eglGetSyncAttribKHR;
-  static const Function eglSetSwapRectangleANDROID = GLMessage_Function_eglSetSwapRectangleANDROID;
-  static const Function eglGetRenderBufferANDROID = GLMessage_Function_eglGetRenderBufferANDROID;
-  static const Function eglGetSystemTimeFrequencyNV = GLMessage_Function_eglGetSystemTimeFrequencyNV;
-  static const Function eglGetSystemTimeNV = GLMessage_Function_eglGetSystemTimeNV;
-  static const Function invalid = GLMessage_Function_invalid;
-  static const Function glVertexAttribPointerData = GLMessage_Function_glVertexAttribPointerData;
-  static inline bool Function_IsValid(int value) {
-    return GLMessage_Function_IsValid(value);
-  }
-  static const Function Function_MIN =
-    GLMessage_Function_Function_MIN;
-  static const Function Function_MAX =
-    GLMessage_Function_Function_MAX;
-  static const int Function_ARRAYSIZE =
-    GLMessage_Function_Function_ARRAYSIZE;
-  
-  // accessors -------------------------------------------------------
-  
-  // required int32 context_id = 1;
-  inline bool has_context_id() const;
-  inline void clear_context_id();
-  static const int kContextIdFieldNumber = 1;
-  inline ::google::protobuf::int32 context_id() const;
-  inline void set_context_id(::google::protobuf::int32 value);
-  
-  // required int64 start_time = 2;
-  inline bool has_start_time() const;
-  inline void clear_start_time();
-  static const int kStartTimeFieldNumber = 2;
-  inline ::google::protobuf::int64 start_time() const;
-  inline void set_start_time(::google::protobuf::int64 value);
-  
-  // required int32 duration = 3;
-  inline bool has_duration() const;
-  inline void clear_duration();
-  static const int kDurationFieldNumber = 3;
-  inline ::google::protobuf::int32 duration() const;
-  inline void set_duration(::google::protobuf::int32 value);
-  
-  // required .android.gltrace.GLMessage.Function function = 4 [default = invalid];
-  inline bool has_function() const;
-  inline void clear_function();
-  static const int kFunctionFieldNumber = 4;
-  inline ::android::gltrace::GLMessage_Function function() const;
-  inline void set_function(::android::gltrace::GLMessage_Function value);
-  
-  // repeated .android.gltrace.GLMessage.DataType args = 5;
-  inline int args_size() const;
-  inline void clear_args();
-  static const int kArgsFieldNumber = 5;
-  inline const ::android::gltrace::GLMessage_DataType& args(int index) const;
-  inline ::android::gltrace::GLMessage_DataType* mutable_args(int index);
-  inline ::android::gltrace::GLMessage_DataType* add_args();
-  inline const ::google::protobuf::RepeatedPtrField< ::android::gltrace::GLMessage_DataType >&
-      args() const;
-  inline ::google::protobuf::RepeatedPtrField< ::android::gltrace::GLMessage_DataType >*
-      mutable_args();
-  
-  // optional .android.gltrace.GLMessage.DataType returnValue = 6;
-  inline bool has_returnvalue() const;
-  inline void clear_returnvalue();
-  static const int kReturnValueFieldNumber = 6;
-  inline const ::android::gltrace::GLMessage_DataType& returnvalue() const;
-  inline ::android::gltrace::GLMessage_DataType* mutable_returnvalue();
-  
-  // optional .android.gltrace.GLMessage.FrameBuffer fb = 7;
-  inline bool has_fb() const;
-  inline void clear_fb();
-  static const int kFbFieldNumber = 7;
-  inline const ::android::gltrace::GLMessage_FrameBuffer& fb() const;
-  inline ::android::gltrace::GLMessage_FrameBuffer* mutable_fb();
-  
-  // optional int32 threadtime = 8;
-  inline bool has_threadtime() const;
-  inline void clear_threadtime();
-  static const int kThreadtimeFieldNumber = 8;
-  inline ::google::protobuf::int32 threadtime() const;
-  inline void set_threadtime(::google::protobuf::int32 value);
-  
-  // @@protoc_insertion_point(class_scope:android.gltrace.GLMessage)
- private:
-  mutable int _cached_size_;
-  
-  ::google::protobuf::int32 context_id_;
-  ::google::protobuf::int64 start_time_;
-  ::google::protobuf::int32 duration_;
-  int function_;
-  ::google::protobuf::RepeatedPtrField< ::android::gltrace::GLMessage_DataType > args_;
-  ::android::gltrace::GLMessage_DataType* returnvalue_;
-  ::android::gltrace::GLMessage_FrameBuffer* fb_;
-  ::google::protobuf::int32 threadtime_;
-  friend void  protobuf_AddDesc_gltrace_2eproto();
-  friend void protobuf_AssignDesc_gltrace_2eproto();
-  friend void protobuf_ShutdownFile_gltrace_2eproto();
-  
-  ::google::protobuf::uint32 _has_bits_[(8 + 31) / 32];
-  
-  // WHY DOES & HAVE LOWER PRECEDENCE THAN != !?
-  inline bool _has_bit(int index) const {
-    return (_has_bits_[index / 32] & (1u << (index % 32))) != 0;
-  }
-  inline void _set_bit(int index) {
-    _has_bits_[index / 32] |= (1u << (index % 32));
-  }
-  inline void _clear_bit(int index) {
-    _has_bits_[index / 32] &= ~(1u << (index % 32));
-  }
-  
-  void InitAsDefaultInstance();
-  static GLMessage* default_instance_;
-};
-// ===================================================================
-
-
-// ===================================================================
-
-// GLMessage_DataType
-
-// required .android.gltrace.GLMessage.DataType.Type type = 1 [default = VOID];
-inline bool GLMessage_DataType::has_type() const {
-  return _has_bit(0);
-}
-inline void GLMessage_DataType::clear_type() {
-  type_ = 1;
-  _clear_bit(0);
-}
-inline ::android::gltrace::GLMessage_DataType_Type GLMessage_DataType::type() const {
-  return static_cast< ::android::gltrace::GLMessage_DataType_Type >(type_);
-}
-inline void GLMessage_DataType::set_type(::android::gltrace::GLMessage_DataType_Type value) {
-  GOOGLE_DCHECK(::android::gltrace::GLMessage_DataType_Type_IsValid(value));
-  _set_bit(0);
-  type_ = value;
-}
-
-// required bool isArray = 2 [default = false];
-inline bool GLMessage_DataType::has_isarray() const {
-  return _has_bit(1);
-}
-inline void GLMessage_DataType::clear_isarray() {
-  isarray_ = false;
-  _clear_bit(1);
-}
-inline bool GLMessage_DataType::isarray() const {
-  return isarray_;
-}
-inline void GLMessage_DataType::set_isarray(bool value) {
-  _set_bit(1);
-  isarray_ = value;
-}
-
-// repeated int32 intValue = 3;
-inline int GLMessage_DataType::intvalue_size() const {
-  return intvalue_.size();
-}
-inline void GLMessage_DataType::clear_intvalue() {
-  intvalue_.Clear();
-}
-inline ::google::protobuf::int32 GLMessage_DataType::intvalue(int index) const {
-  return intvalue_.Get(index);
-}
-inline void GLMessage_DataType::set_intvalue(int index, ::google::protobuf::int32 value) {
-  intvalue_.Set(index, value);
-}
-inline void GLMessage_DataType::add_intvalue(::google::protobuf::int32 value) {
-  intvalue_.Add(value);
-}
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
-GLMessage_DataType::intvalue() const {
-  return intvalue_;
-}
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
-GLMessage_DataType::mutable_intvalue() {
-  return &intvalue_;
-}
-
-// repeated float floatValue = 4;
-inline int GLMessage_DataType::floatvalue_size() const {
-  return floatvalue_.size();
-}
-inline void GLMessage_DataType::clear_floatvalue() {
-  floatvalue_.Clear();
-}
-inline float GLMessage_DataType::floatvalue(int index) const {
-  return floatvalue_.Get(index);
-}
-inline void GLMessage_DataType::set_floatvalue(int index, float value) {
-  floatvalue_.Set(index, value);
-}
-inline void GLMessage_DataType::add_floatvalue(float value) {
-  floatvalue_.Add(value);
-}
-inline const ::google::protobuf::RepeatedField< float >&
-GLMessage_DataType::floatvalue() const {
-  return floatvalue_;
-}
-inline ::google::protobuf::RepeatedField< float >*
-GLMessage_DataType::mutable_floatvalue() {
-  return &floatvalue_;
-}
-
-// repeated bytes charValue = 5;
-inline int GLMessage_DataType::charvalue_size() const {
-  return charvalue_.size();
-}
-inline void GLMessage_DataType::clear_charvalue() {
-  charvalue_.Clear();
-}
-inline const ::std::string& GLMessage_DataType::charvalue(int index) const {
-  return charvalue_.Get(index);
-}
-inline ::std::string* GLMessage_DataType::mutable_charvalue(int index) {
-  return charvalue_.Mutable(index);
-}
-inline void GLMessage_DataType::set_charvalue(int index, const ::std::string& value) {
-  charvalue_.Mutable(index)->assign(value);
-}
-inline void GLMessage_DataType::set_charvalue(int index, const char* value) {
-  charvalue_.Mutable(index)->assign(value);
-}
-inline void GLMessage_DataType::set_charvalue(int index, const void* value, size_t size) {
-  charvalue_.Mutable(index)->assign(
-    reinterpret_cast<const char*>(value), size);
-}
-inline ::std::string* GLMessage_DataType::add_charvalue() {
-  return charvalue_.Add();
-}
-inline void GLMessage_DataType::add_charvalue(const ::std::string& value) {
-  charvalue_.Add()->assign(value);
-}
-inline void GLMessage_DataType::add_charvalue(const char* value) {
-  charvalue_.Add()->assign(value);
-}
-inline void GLMessage_DataType::add_charvalue(const void* value, size_t size) {
-  charvalue_.Add()->assign(reinterpret_cast<const char*>(value), size);
-}
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
-GLMessage_DataType::charvalue() const {
-  return charvalue_;
-}
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
-GLMessage_DataType::mutable_charvalue() {
-  return &charvalue_;
-}
-
-// repeated bytes rawBytes = 6;
-inline int GLMessage_DataType::rawbytes_size() const {
-  return rawbytes_.size();
-}
-inline void GLMessage_DataType::clear_rawbytes() {
-  rawbytes_.Clear();
-}
-inline const ::std::string& GLMessage_DataType::rawbytes(int index) const {
-  return rawbytes_.Get(index);
-}
-inline ::std::string* GLMessage_DataType::mutable_rawbytes(int index) {
-  return rawbytes_.Mutable(index);
-}
-inline void GLMessage_DataType::set_rawbytes(int index, const ::std::string& value) {
-  rawbytes_.Mutable(index)->assign(value);
-}
-inline void GLMessage_DataType::set_rawbytes(int index, const char* value) {
-  rawbytes_.Mutable(index)->assign(value);
-}
-inline void GLMessage_DataType::set_rawbytes(int index, const void* value, size_t size) {
-  rawbytes_.Mutable(index)->assign(
-    reinterpret_cast<const char*>(value), size);
-}
-inline ::std::string* GLMessage_DataType::add_rawbytes() {
-  return rawbytes_.Add();
-}
-inline void GLMessage_DataType::add_rawbytes(const ::std::string& value) {
-  rawbytes_.Add()->assign(value);
-}
-inline void GLMessage_DataType::add_rawbytes(const char* value) {
-  rawbytes_.Add()->assign(value);
-}
-inline void GLMessage_DataType::add_rawbytes(const void* value, size_t size) {
-  rawbytes_.Add()->assign(reinterpret_cast<const char*>(value), size);
-}
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
-GLMessage_DataType::rawbytes() const {
-  return rawbytes_;
-}
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
-GLMessage_DataType::mutable_rawbytes() {
-  return &rawbytes_;
-}
-
-// repeated bool boolValue = 7;
-inline int GLMessage_DataType::boolvalue_size() const {
-  return boolvalue_.size();
-}
-inline void GLMessage_DataType::clear_boolvalue() {
-  boolvalue_.Clear();
-}
-inline bool GLMessage_DataType::boolvalue(int index) const {
-  return boolvalue_.Get(index);
-}
-inline void GLMessage_DataType::set_boolvalue(int index, bool value) {
-  boolvalue_.Set(index, value);
-}
-inline void GLMessage_DataType::add_boolvalue(bool value) {
-  boolvalue_.Add(value);
-}
-inline const ::google::protobuf::RepeatedField< bool >&
-GLMessage_DataType::boolvalue() const {
-  return boolvalue_;
-}
-inline ::google::protobuf::RepeatedField< bool >*
-GLMessage_DataType::mutable_boolvalue() {
-  return &boolvalue_;
-}
-
-// repeated int64 int64Value = 8;
-inline int GLMessage_DataType::int64value_size() const {
-  return int64value_.size();
-}
-inline void GLMessage_DataType::clear_int64value() {
-  int64value_.Clear();
-}
-inline ::google::protobuf::int64 GLMessage_DataType::int64value(int index) const {
-  return int64value_.Get(index);
-}
-inline void GLMessage_DataType::set_int64value(int index, ::google::protobuf::int64 value) {
-  int64value_.Set(index, value);
-}
-inline void GLMessage_DataType::add_int64value(::google::protobuf::int64 value) {
-  int64value_.Add(value);
-}
-inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
-GLMessage_DataType::int64value() const {
-  return int64value_;
-}
-inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
-GLMessage_DataType::mutable_int64value() {
-  return &int64value_;
-}
-
-// -------------------------------------------------------------------
-
-// GLMessage_FrameBuffer
-
-// required int32 width = 1;
-inline bool GLMessage_FrameBuffer::has_width() const {
-  return _has_bit(0);
-}
-inline void GLMessage_FrameBuffer::clear_width() {
-  width_ = 0;
-  _clear_bit(0);
-}
-inline ::google::protobuf::int32 GLMessage_FrameBuffer::width() const {
-  return width_;
-}
-inline void GLMessage_FrameBuffer::set_width(::google::protobuf::int32 value) {
-  _set_bit(0);
-  width_ = value;
-}
-
-// required int32 height = 2;
-inline bool GLMessage_FrameBuffer::has_height() const {
-  return _has_bit(1);
-}
-inline void GLMessage_FrameBuffer::clear_height() {
-  height_ = 0;
-  _clear_bit(1);
-}
-inline ::google::protobuf::int32 GLMessage_FrameBuffer::height() const {
-  return height_;
-}
-inline void GLMessage_FrameBuffer::set_height(::google::protobuf::int32 value) {
-  _set_bit(1);
-  height_ = value;
-}
-
-// repeated bytes contents = 3;
-inline int GLMessage_FrameBuffer::contents_size() const {
-  return contents_.size();
-}
-inline void GLMessage_FrameBuffer::clear_contents() {
-  contents_.Clear();
-}
-inline const ::std::string& GLMessage_FrameBuffer::contents(int index) const {
-  return contents_.Get(index);
-}
-inline ::std::string* GLMessage_FrameBuffer::mutable_contents(int index) {
-  return contents_.Mutable(index);
-}
-inline void GLMessage_FrameBuffer::set_contents(int index, const ::std::string& value) {
-  contents_.Mutable(index)->assign(value);
-}
-inline void GLMessage_FrameBuffer::set_contents(int index, const char* value) {
-  contents_.Mutable(index)->assign(value);
-}
-inline void GLMessage_FrameBuffer::set_contents(int index, const void* value, size_t size) {
-  contents_.Mutable(index)->assign(
-    reinterpret_cast<const char*>(value), size);
-}
-inline ::std::string* GLMessage_FrameBuffer::add_contents() {
-  return contents_.Add();
-}
-inline void GLMessage_FrameBuffer::add_contents(const ::std::string& value) {
-  contents_.Add()->assign(value);
-}
-inline void GLMessage_FrameBuffer::add_contents(const char* value) {
-  contents_.Add()->assign(value);
-}
-inline void GLMessage_FrameBuffer::add_contents(const void* value, size_t size) {
-  contents_.Add()->assign(reinterpret_cast<const char*>(value), size);
-}
-inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
-GLMessage_FrameBuffer::contents() const {
-  return contents_;
-}
-inline ::google::protobuf::RepeatedPtrField< ::std::string>*
-GLMessage_FrameBuffer::mutable_contents() {
-  return &contents_;
-}
-
-// -------------------------------------------------------------------
-
-// GLMessage
-
-// required int32 context_id = 1;
-inline bool GLMessage::has_context_id() const {
-  return _has_bit(0);
-}
-inline void GLMessage::clear_context_id() {
-  context_id_ = 0;
-  _clear_bit(0);
-}
-inline ::google::protobuf::int32 GLMessage::context_id() const {
-  return context_id_;
-}
-inline void GLMessage::set_context_id(::google::protobuf::int32 value) {
-  _set_bit(0);
-  context_id_ = value;
-}
-
-// required int64 start_time = 2;
-inline bool GLMessage::has_start_time() const {
-  return _has_bit(1);
-}
-inline void GLMessage::clear_start_time() {
-  start_time_ = GOOGLE_LONGLONG(0);
-  _clear_bit(1);
-}
-inline ::google::protobuf::int64 GLMessage::start_time() const {
-  return start_time_;
-}
-inline void GLMessage::set_start_time(::google::protobuf::int64 value) {
-  _set_bit(1);
-  start_time_ = value;
-}
-
-// required int32 duration = 3;
-inline bool GLMessage::has_duration() const {
-  return _has_bit(2);
-}
-inline void GLMessage::clear_duration() {
-  duration_ = 0;
-  _clear_bit(2);
-}
-inline ::google::protobuf::int32 GLMessage::duration() const {
-  return duration_;
-}
-inline void GLMessage::set_duration(::google::protobuf::int32 value) {
-  _set_bit(2);
-  duration_ = value;
-}
-
-// required .android.gltrace.GLMessage.Function function = 4 [default = invalid];
-inline bool GLMessage::has_function() const {
-  return _has_bit(3);
-}
-inline void GLMessage::clear_function() {
-  function_ = 3000;
-  _clear_bit(3);
-}
-inline ::android::gltrace::GLMessage_Function GLMessage::function() const {
-  return static_cast< ::android::gltrace::GLMessage_Function >(function_);
-}
-inline void GLMessage::set_function(::android::gltrace::GLMessage_Function value) {
-  GOOGLE_DCHECK(::android::gltrace::GLMessage_Function_IsValid(value));
-  _set_bit(3);
-  function_ = value;
-}
-
-// repeated .android.gltrace.GLMessage.DataType args = 5;
-inline int GLMessage::args_size() const {
-  return args_.size();
-}
-inline void GLMessage::clear_args() {
-  args_.Clear();
-}
-inline const ::android::gltrace::GLMessage_DataType& GLMessage::args(int index) const {
-  return args_.Get(index);
-}
-inline ::android::gltrace::GLMessage_DataType* GLMessage::mutable_args(int index) {
-  return args_.Mutable(index);
-}
-inline ::android::gltrace::GLMessage_DataType* GLMessage::add_args() {
-  return args_.Add();
-}
-inline const ::google::protobuf::RepeatedPtrField< ::android::gltrace::GLMessage_DataType >&
-GLMessage::args() const {
-  return args_;
-}
-inline ::google::protobuf::RepeatedPtrField< ::android::gltrace::GLMessage_DataType >*
-GLMessage::mutable_args() {
-  return &args_;
-}
-
-// optional .android.gltrace.GLMessage.DataType returnValue = 6;
-inline bool GLMessage::has_returnvalue() const {
-  return _has_bit(5);
-}
-inline void GLMessage::clear_returnvalue() {
-  if (returnvalue_ != NULL) returnvalue_->::android::gltrace::GLMessage_DataType::Clear();
-  _clear_bit(5);
-}
-inline const ::android::gltrace::GLMessage_DataType& GLMessage::returnvalue() const {
-  return returnvalue_ != NULL ? *returnvalue_ : *default_instance_->returnvalue_;
-}
-inline ::android::gltrace::GLMessage_DataType* GLMessage::mutable_returnvalue() {
-  _set_bit(5);
-  if (returnvalue_ == NULL) returnvalue_ = new ::android::gltrace::GLMessage_DataType;
-  return returnvalue_;
-}
-
-// optional .android.gltrace.GLMessage.FrameBuffer fb = 7;
-inline bool GLMessage::has_fb() const {
-  return _has_bit(6);
-}
-inline void GLMessage::clear_fb() {
-  if (fb_ != NULL) fb_->::android::gltrace::GLMessage_FrameBuffer::Clear();
-  _clear_bit(6);
-}
-inline const ::android::gltrace::GLMessage_FrameBuffer& GLMessage::fb() const {
-  return fb_ != NULL ? *fb_ : *default_instance_->fb_;
-}
-inline ::android::gltrace::GLMessage_FrameBuffer* GLMessage::mutable_fb() {
-  _set_bit(6);
-  if (fb_ == NULL) fb_ = new ::android::gltrace::GLMessage_FrameBuffer;
-  return fb_;
-}
-
-// optional int32 threadtime = 8;
-inline bool GLMessage::has_threadtime() const {
-  return _has_bit(7);
-}
-inline void GLMessage::clear_threadtime() {
-  threadtime_ = 0;
-  _clear_bit(7);
-}
-inline ::google::protobuf::int32 GLMessage::threadtime() const {
-  return threadtime_;
-}
-inline void GLMessage::set_threadtime(::google::protobuf::int32 value) {
-  _set_bit(7);
-  threadtime_ = value;
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace gltrace
-}  // namespace android
-
-// @@protoc_insertion_point(global_scope)
-
-#endif  // PROTOBUF_gltrace_2eproto__INCLUDED
diff --git a/opengl/libs/GLES_trace/src/gltrace_api.cpp b/opengl/libs/GLES_trace/src/gltrace_api.cpp
index eed3ccf..d83b9b4 100644
--- a/opengl/libs/GLES_trace/src/gltrace_api.cpp
+++ b/opengl/libs/GLES_trace/src/gltrace_api.cpp
@@ -19,7 +19,7 @@
 #include <cutils/log.h>
 #include <utils/Timers.h>
 
-#include "gltrace.pb.h"
+#include "frameworks/native/opengl/libs/GLES_trace/proto/gltrace.pb.h"
 #include "gltrace_context.h"
 #include "gltrace_fixup.h"
 #include "gltrace_transport.h"
diff --git a/opengl/libs/GLES_trace/src/gltrace_egl.cpp b/opengl/libs/GLES_trace/src/gltrace_egl.cpp
index 4f9b006..a7878f2 100644
--- a/opengl/libs/GLES_trace/src/gltrace_egl.cpp
+++ b/opengl/libs/GLES_trace/src/gltrace_egl.cpp
@@ -17,7 +17,7 @@
 #include <cutils/log.h>
 #include <utils/Timers.h>
 
-#include "gltrace.pb.h"
+#include "frameworks/native/opengl/libs/GLES_trace/proto/gltrace.pb.h"
 #include "gltrace_context.h"
 #include "gltrace_fixup.h"
 #include "gltrace_transport.h"
diff --git a/opengl/libs/GLES_trace/src/gltrace_fixup.cpp b/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
index be729c7..a4a187a 100644
--- a/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
+++ b/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
@@ -21,7 +21,7 @@
 #include <GLES2/gl2.h>
 #include <GLES2/gl2ext.h>
 
-#include "gltrace.pb.h"
+#include "frameworks/native/opengl/libs/GLES_trace/proto/gltrace.pb.h"
 #include "gltrace_api.h"
 #include "gltrace_context.h"
 #include "gltrace_fixup.h"
diff --git a/opengl/libs/GLES_trace/src/gltrace_fixup.h b/opengl/libs/GLES_trace/src/gltrace_fixup.h
index fe30125..c90dbeb 100644
--- a/opengl/libs/GLES_trace/src/gltrace_fixup.h
+++ b/opengl/libs/GLES_trace/src/gltrace_fixup.h
@@ -19,7 +19,7 @@
 
 #include <utils/Timers.h>
 
-#include "gltrace.pb.h"
+#include "frameworks/native/opengl/libs/GLES_trace/proto/gltrace.pb.h"
 #include "gltrace_context.h"
 
 namespace android {
diff --git a/opengl/libs/GLES_trace/src/gltrace_transport.h b/opengl/libs/GLES_trace/src/gltrace_transport.h
index 9cf5b45..fd6cb8c 100644
--- a/opengl/libs/GLES_trace/src/gltrace_transport.h
+++ b/opengl/libs/GLES_trace/src/gltrace_transport.h
@@ -19,7 +19,7 @@
 
 #include <pthread.h>
 
-#include "gltrace.pb.h"
+#include "frameworks/native/opengl/libs/GLES_trace/proto/gltrace.pb.h"
 
 namespace android {
 namespace gltrace {
diff --git a/opengl/tests/EGLTest/Android.mk b/opengl/tests/EGLTest/Android.mk
index f37efec..80e4867 100644
--- a/opengl/tests/EGLTest/Android.mk
+++ b/opengl/tests/EGLTest/Android.mk
@@ -1,6 +1,7 @@
 # Build the unit tests.
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 
 LOCAL_MODULE := EGL_test
 
@@ -14,27 +15,18 @@
 	libEGL \
 	libcutils \
 	libbinder \
-	libstlport \
 	libutils \
 	libgui \
 
-LOCAL_STATIC_LIBRARIES := \
-	libgtest \
-	libgtest_main \
-
 LOCAL_C_INCLUDES := \
-    bionic \
     bionic/libc/private \
-    bionic/libstdc++/include \
-    external/gtest/include \
-    external/stlport/stlport \
     frameworks/native/opengl/libs \
     frameworks/native/opengl/libs/EGL \
 
 # gold in binutils 2.22 will warn about the usage of mktemp
 LOCAL_LDFLAGS += -Wl,--no-fatal-warnings
 
-include $(BUILD_EXECUTABLE)
+include $(BUILD_NATIVE_TEST)
 
 # Include subdirectory makefiles
 # ============================================================
diff --git a/opengl/tests/EGLTest/egl_cache_test.cpp b/opengl/tests/EGLTest/egl_cache_test.cpp
index c7d9e3e..c5bf296 100644
--- a/opengl/tests/EGLTest/egl_cache_test.cpp
+++ b/opengl/tests/EGLTest/egl_cache_test.cpp
@@ -41,7 +41,7 @@
 };
 
 TEST_F(EGLCacheTest, UninitializedCacheAlwaysMisses) {
-    char buf[4] = { 0xee, 0xee, 0xee, 0xee };
+    uint8_t buf[4] = { 0xee, 0xee, 0xee, 0xee };
     mCache->setBlob("abcd", 4, "efgh", 4);
     ASSERT_EQ(0, mCache->getBlob("abcd", 4, buf, 4));
     ASSERT_EQ(0xee, buf[0]);
@@ -51,7 +51,7 @@
 }
 
 TEST_F(EGLCacheTest, InitializedCacheAlwaysHits) {
-    char buf[4] = { 0xee, 0xee, 0xee, 0xee };
+    uint8_t buf[4] = { 0xee, 0xee, 0xee, 0xee };
     mCache->initialize(egl_display_t::get(EGL_DEFAULT_DISPLAY));
     mCache->setBlob("abcd", 4, "efgh", 4);
     ASSERT_EQ(4, mCache->getBlob("abcd", 4, buf, 4));
@@ -62,7 +62,7 @@
 }
 
 TEST_F(EGLCacheTest, TerminatedCacheAlwaysMisses) {
-    char buf[4] = { 0xee, 0xee, 0xee, 0xee };
+    uint8_t buf[4] = { 0xee, 0xee, 0xee, 0xee };
     mCache->initialize(egl_display_t::get(EGL_DEFAULT_DISPLAY));
     mCache->setBlob("abcd", 4, "efgh", 4);
     mCache->terminate();
@@ -94,7 +94,7 @@
 };
 
 TEST_F(EGLCacheSerializationTest, ReinitializedCacheContainsValues) {
-    char buf[4] = { 0xee, 0xee, 0xee, 0xee };
+    uint8_t buf[4] = { 0xee, 0xee, 0xee, 0xee };
     mCache->setCacheFilename(mFilename);
     mCache->initialize(egl_display_t::get(EGL_DEFAULT_DISPLAY));
     mCache->setBlob("abcd", 4, "efgh", 4);
diff --git a/opengl/tests/angeles/app-linux.cpp b/opengl/tests/angeles/app-linux.cpp
index e490351..ced8786 100644
--- a/opengl/tests/angeles/app-linux.cpp
+++ b/opengl/tests/angeles/app-linux.cpp
@@ -118,7 +118,7 @@
         fprintf(stderr, "EGL Error: 0x%04x\n", (int)error);
 }
 
-static int initGraphics(unsigned samples, const WindowSurface& windowSurface)
+static int initGraphics(EGLint samples, const WindowSurface& windowSurface)
 {
     EGLint configAttribs[] = {
             EGL_DEPTH_SIZE, 16,
diff --git a/opengl/tests/fillrate/fillrate.cpp b/opengl/tests/fillrate/fillrate.cpp
index 1d9b026..2db63d7 100644
--- a/opengl/tests/fillrate/fillrate.cpp
+++ b/opengl/tests/fillrate/fillrate.cpp
@@ -91,11 +91,13 @@
          }
      }
 
+     const GLfloat fh = h;
+     const GLfloat fw = w;
      const GLfloat vertices[4][2] = {
-             { 0,  0 },
-             { 0,  h },
-             { w,  h },
-             { w,  0 }
+             { 0,   0  },
+             { 0,   fh },
+             { fw,  fh },
+             { fw,  0  }
      };
 
      const GLfloat texCoords[4][2] = {
diff --git a/opengl/tests/filter/filter.cpp b/opengl/tests/filter/filter.cpp
index 289e6cc..287ee93 100644
--- a/opengl/tests/filter/filter.cpp
+++ b/opengl/tests/filter/filter.cpp
@@ -140,11 +140,12 @@
 
      //glDrawTexiOES(0, 0, 0, dim, dim);
      
+     const GLfloat fdim = dim;
      const GLfloat vertices[4][2] = {
-             { 0,    0   },
-             { 0,    dim },
-             { dim,  dim },
-             { dim,  0   }
+             { 0,     0    },
+             { 0,     fdim },
+             { fdim,  fdim },
+             { fdim,  0    }
      };
 
      const GLfloat texCoords[4][2] = {
diff --git a/opengl/tests/hwc/Android.mk b/opengl/tests/hwc/Android.mk
index 86e1d46..f83846b 100644
--- a/opengl/tests/hwc/Android.mk
+++ b/opengl/tests/hwc/Android.mk
@@ -15,24 +15,25 @@
 LOCAL_PATH:= $(call my-dir)
 
 include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
 LOCAL_MODULE_TAGS := tests
 LOCAL_MODULE:= libhwcTest
+LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+LOCAL_CXX_STL := libc++
 LOCAL_SRC_FILES:= hwcTestLib.cpp
 LOCAL_C_INCLUDES += system/extras/tests/include \
-    bionic \
-    bionic/libstdc++/include \
-    external/stlport/stlport \
-	$(call include-path-for, opengl-tests-includes)
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-
-LOCAL_SHARED_LIBRARIES += libcutils libutils libstlport
-LOCAL_STATIC_LIBRARIES += libglTest
-
+    $(call include-path-for, opengl-tests-includes) \
 
 include $(BUILD_STATIC_LIBRARY)
 
 include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+LOCAL_MODULE:= hwcStress
+LOCAL_MODULE_TAGS := tests
+LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+LOCAL_CXX_STL := libc++
 LOCAL_SRC_FILES:= hwcStress.cpp
 
 LOCAL_SHARED_LIBRARIES := \
@@ -52,19 +53,17 @@
 LOCAL_C_INCLUDES += \
     system/extras/tests/include \
     hardware/libhardware/include \
-	$(call include-path-for, opengl-tests-includes)
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-
-LOCAL_MODULE:= hwcStress
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+    $(call include-path-for, opengl-tests-includes) \
 
 include $(BUILD_NATIVE_TEST)
 
 include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+LOCAL_MODULE:= hwcRects
+LOCAL_MODULE_TAGS := tests
+LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+LOCAL_CXX_STL := libc++
 LOCAL_SRC_FILES:= hwcRects.cpp
 
 LOCAL_SHARED_LIBRARIES := \
@@ -84,17 +83,17 @@
 LOCAL_C_INCLUDES += \
     system/extras/tests/include \
     hardware/libhardware/include \
-	$(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= hwcRects
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+    $(call include-path-for, opengl-tests-includes) \
 
 include $(BUILD_NATIVE_TEST)
 
 include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+LOCAL_MODULE:= hwcColorEquiv
+LOCAL_MODULE_TAGS := tests
+LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+LOCAL_CXX_STL := libc++
 LOCAL_SRC_FILES:= hwcColorEquiv.cpp
 
 LOCAL_SHARED_LIBRARIES := \
@@ -114,17 +113,17 @@
 LOCAL_C_INCLUDES += \
     system/extras/tests/include \
     hardware/libhardware/include \
-	$(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= hwcColorEquiv
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+    $(call include-path-for, opengl-tests-includes) \
 
 include $(BUILD_NATIVE_TEST)
 
 include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+LOCAL_MODULE:= hwcCommit
+LOCAL_MODULE_TAGS := tests
+LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+LOCAL_CXX_STL := libc++
 LOCAL_SRC_FILES:= hwcCommit.cpp
 
 LOCAL_SHARED_LIBRARIES := \
@@ -144,12 +143,6 @@
 LOCAL_C_INCLUDES += \
     system/extras/tests/include \
     hardware/libhardware/include \
-	$(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= hwcCommit
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+    $(call include-path-for, opengl-tests-includes) \
 
 include $(BUILD_NATIVE_TEST)
diff --git a/opengl/tests/hwc/hwcColorEquiv.cpp b/opengl/tests/hwc/hwcColorEquiv.cpp
index c4624d2..06a0191 100644
--- a/opengl/tests/hwc/hwcColorEquiv.cpp
+++ b/opengl/tests/hwc/hwcColorEquiv.cpp
@@ -166,7 +166,6 @@
     int rv, opt;
     bool error;
     char *chptr;
-    unsigned int pass;
     char cmd[MAXCMD];
     string str;
 
@@ -293,14 +292,12 @@
     // Use the upper third of the display for the reference frame and
     // the middle third for the equivalence frame.
     unsigned int refHeight = height / 3;
-    unsigned int refPosY = 0; // Reference frame Y position
     unsigned int refPosX = 0; // Reference frame X position
     unsigned int refWidth = width - refPosX;
     if ((refWidth & refFormat->wMod) != 0) {
         refWidth += refFormat->wMod - (refWidth % refFormat->wMod);
     }
     unsigned int equivHeight = height / 3;
-    unsigned int equivPosY = refHeight; // Equivalence frame Y position
     unsigned int equivPosX = 0;         // Equivalence frame X position
     unsigned int equivWidth = width - equivPosX;
     if ((equivWidth & equivFormat->wMod) != 0) {
diff --git a/opengl/tests/hwc/hwcCommit.cpp b/opengl/tests/hwc/hwcCommit.cpp
index 1bd5fdf..1bcb860 100644
--- a/opengl/tests/hwc/hwcCommit.cpp
+++ b/opengl/tests/hwc/hwcCommit.cpp
@@ -338,7 +338,6 @@
 main(int argc, char *argv[])
 {
     int     rv, opt;
-    char   *chptr;
     bool    error;
     string  str;
     char cmd[MAXCMD];
diff --git a/opengl/tests/hwc/hwcRects.cpp b/opengl/tests/hwc/hwcRects.cpp
index 9b57623..56c1a2a 100644
--- a/opengl/tests/hwc/hwcRects.cpp
+++ b/opengl/tests/hwc/hwcRects.cpp
@@ -204,7 +204,6 @@
 {
     int     rv, opt;
     char   *chptr;
-    bool    error;
     string  str;
     char cmd[MAXCMD];
 
@@ -367,7 +366,6 @@
     istringstream in(rectStr);
     const struct hwcTestGraphicFormat *format;
     Rectangle rect;
-    struct hwc_rect hwcRect;
 
     // Graphic Format
     in >> str;
diff --git a/opengl/tests/hwc/hwcTestLib.cpp b/opengl/tests/hwc/hwcTestLib.cpp
index 7fae5e5..3b0ca74 100644
--- a/opengl/tests/hwc/hwcTestLib.cpp
+++ b/opengl/tests/hwc/hwcTestLib.cpp
@@ -20,22 +20,22 @@
  * Utility library functions for use by the Hardware Composer test cases
  */
 
+#include <arpa/inet.h> // For ntohl() and htonl()
+
+#include <cmath>
 #include <sstream>
 #include <string>
 
-#include <arpa/inet.h> // For ntohl() and htonl()
-
 #include "hwcTestLib.h"
 
 #include "EGLUtils.h"
 
 // Defines
-#define NUMA(a) (sizeof(a) / sizeof(a [0]))
+#define NUMA(a) (sizeof(a) / sizeof((a)[0]))
 
 // Function Prototypes
 static void printGLString(const char *name, GLenum s);
 static void checkEglError(const char* op, EGLBoolean returnVal = EGL_TRUE);
-static void checkGlError(const char* op);
 static void printEGLConfiguration(EGLDisplay dpy, EGLConfig config);
 
 using namespace std;
@@ -51,8 +51,6 @@
 {
     static EGLContext context;
 
-    int rv;
-
     EGLBoolean returnValue;
     EGLConfig myConfig = {0};
     EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
@@ -668,7 +666,6 @@
 
     for (unsigned int x = 0; x < gBuf->getStride(); x++) {
         for (unsigned int y = 0; y < gBuf->getHeight(); y++) {
-            uint32_t val = pixel;
             hwcTestSetPixel(gBuf, buf, x, y, (x < gBuf->getWidth())
                             ? pixel : testRand());
         }
@@ -965,14 +962,6 @@
     }
 }
 
-static void checkGlError(const char* op)
-{
-    for (GLint error = glGetError(); error; error
-            = glGetError()) {
-        testPrintE("after %s() glError (0x%x)", op, error);
-    }
-}
-
 static void printEGLConfiguration(EGLDisplay dpy, EGLConfig config)
 {
 
diff --git a/opengl/tests/lib/Android.mk b/opengl/tests/lib/Android.mk
index a2752cd..e5124ad 100644
--- a/opengl/tests/lib/Android.mk
+++ b/opengl/tests/lib/Android.mk
@@ -15,18 +15,13 @@
 LOCAL_PATH:= $(call my-dir)
 
 include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 LOCAL_MODULE_TAGS := tests
 LOCAL_MODULE:= libglTest
 LOCAL_SRC_FILES:= glTestLib.cpp WindowSurface.cpp
 LOCAL_C_INCLUDES += system/extras/tests/include \
-    bionic \
-    bionic/libstdc++/include \
-    external/stlport/stlport \
 	$(call include-path-for, opengl-tests-includes)
 
 LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
 
-LOCAL_SHARED_LIBRARIES += libcutils libutils libstlport
-
-
 include $(BUILD_STATIC_LIBRARY)
diff --git a/opengl/tests/linetex/linetex.cpp b/opengl/tests/linetex/linetex.cpp
index 7921f80..5ad695b 100644
--- a/opengl/tests/linetex/linetex.cpp
+++ b/opengl/tests/linetex/linetex.cpp
@@ -80,9 +80,11 @@
      // default pack-alignment is 4
      const uint16_t t16[64] = { 0xFFFF, 0, 0xF800, 0, 0x07E0, 0, 0x001F, 0 };
 
+     const GLfloat fh = h;
+     const GLfloat fw2 = w/2;
      const GLfloat vertices[4][2] = {
-             { w/2,  0 },
-             { w/2,  h }
+             { fw2,  0  },
+             { fw2,  fh }
      };
 
      const GLfloat texCoords[4][2] = {
diff --git a/opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp b/opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp
index a372362..f6813fd 100644
--- a/opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp
+++ b/opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp
@@ -16,6 +16,10 @@
 
 // This source file is automatically generated
 
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
 #include "jni.h"
 #include "JNIHelp.h"
 #include <android_runtime/AndroidRuntime.h>
diff --git a/opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp b/opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp
index b5c19df..4df61d3 100644
--- a/opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp
+++ b/opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp
@@ -16,6 +16,10 @@
 
 // This source file is automatically generated
 
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
 #include "jni.h"
 #include "JNIHelp.h"
 #include <android_runtime/AndroidRuntime.h>
@@ -81,23 +85,19 @@
     eglsurfaceConstructor = _env->GetMethodID(eglsurfaceClass, "<init>", "(J)V");
     eglconfigConstructor = _env->GetMethodID(eglconfigClass, "<init>", "(J)V");
 
-    jobject localeglNoContextObject = _env->NewObject(eglcontextClass, eglcontextConstructor, reinterpret_cast<jlong>(EGL_NO_CONTEXT));
-    eglNoContextObject = _env->NewGlobalRef(localeglNoContextObject);
-    jobject localeglNoDisplayObject = _env->NewObject(egldisplayClass, egldisplayConstructor, reinterpret_cast<jlong>(EGL_NO_DISPLAY));
-    eglNoDisplayObject = _env->NewGlobalRef(localeglNoDisplayObject);
-    jobject localeglNoSurfaceObject = _env->NewObject(eglsurfaceClass, eglsurfaceConstructor, reinterpret_cast<jlong>(EGL_NO_SURFACE));
-    eglNoSurfaceObject = _env->NewGlobalRef(localeglNoSurfaceObject);
-
 
     jclass eglClass = _env->FindClass("android/opengl/EGL14");
     jfieldID noContextFieldID = _env->GetStaticFieldID(eglClass, "EGL_NO_CONTEXT", "Landroid/opengl/EGLContext;");
-    _env->SetStaticObjectField(eglClass, noContextFieldID, eglNoContextObject);
+    jobject localeglNoContextObject = _env->GetStaticObjectField(eglClass, noContextFieldID);
+    eglNoContextObject = _env->NewGlobalRef(localeglNoContextObject);
 
     jfieldID noDisplayFieldID = _env->GetStaticFieldID(eglClass, "EGL_NO_DISPLAY", "Landroid/opengl/EGLDisplay;");
-    _env->SetStaticObjectField(eglClass, noDisplayFieldID, eglNoDisplayObject);
+    jobject localeglNoDisplayObject = _env->GetStaticObjectField(eglClass, noDisplayFieldID);
+    eglNoDisplayObject = _env->NewGlobalRef(localeglNoDisplayObject);
 
     jfieldID noSurfaceFieldID = _env->GetStaticFieldID(eglClass, "EGL_NO_SURFACE", "Landroid/opengl/EGLSurface;");
-    _env->SetStaticObjectField(eglClass, noSurfaceFieldID, eglNoSurfaceObject);
+    jobject localeglNoSurfaceObject = _env->GetStaticObjectField(eglClass, noSurfaceFieldID);
+    eglNoSurfaceObject = _env->NewGlobalRef(localeglNoSurfaceObject);
 }
 
 static void *
diff --git a/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp
index 8a1d5ed..1fa9275 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp
@@ -17,6 +17,10 @@
 
 // This source file is automatically generated
 
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
 #include <GLES/gl.h>
 #include <GLES/glext.h>
 
diff --git a/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp
index 8a1d5ed..1fa9275 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp
@@ -17,6 +17,10 @@
 
 // This source file is automatically generated
 
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
 #include <GLES/gl.h>
 #include <GLES/glext.h>
 
diff --git a/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp
index 8a1d5ed..1fa9275 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp
@@ -17,6 +17,10 @@
 
 // This source file is automatically generated
 
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
 #include <GLES/gl.h>
 #include <GLES/glext.h>
 
diff --git a/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp
index 8a1d5ed..1fa9275 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp
@@ -17,6 +17,10 @@
 
 // This source file is automatically generated
 
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
 #include <GLES/gl.h>
 #include <GLES/glext.h>
 
diff --git a/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp
index 2389563..4004a7d 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp
@@ -17,6 +17,10 @@
 
 // This source file is automatically generated
 
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
 #include <GLES2/gl2.h>
 #include <GLES2/gl2ext.h>
 
diff --git a/opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp
index f5ec455..c5bdf32 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp
@@ -17,6 +17,10 @@
 
 // This source file is automatically generated
 
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
 #include <GLES3/gl3.h>
 #include <GLES3/gl3ext.h>
 
diff --git a/opengl/tools/glgen/stubs/gles11/GLES31ExtcHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES31ExtcHeader.cpp
index e7e3561..2260a80 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES31ExtcHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES31ExtcHeader.cpp
@@ -16,6 +16,10 @@
 
 // This source file is automatically generated
 
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
 #include <GLES3/gl31.h>
 #include <GLES2/gl2ext.h>
 
diff --git a/opengl/tools/glgen/stubs/gles11/GLES31cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES31cHeader.cpp
index c48ec7c..130612d 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES31cHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES31cHeader.cpp
@@ -16,5 +16,9 @@
 
 // This source file is automatically generated
 
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
 #include <stdint.h>
 #include <GLES3/gl31.h>
diff --git a/opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp b/opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp
index ce3bc8f..eda2e46 100644
--- a/opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp
+++ b/opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp
@@ -3,7 +3,7 @@
     // In OpenGL ES, 'indirect' is a byte offset into a buffer, not a raw pointer.
     // GL checks for too-large values. Here we only need to check for successful signed 64-bit
     // to unsigned 32-bit conversion.
-    if (sizeof(void*) != sizeof(jlong) && indirect > UINTPTR_MAX) {
+    if (sizeof(void*) != sizeof(jlong) && indirect > static_cast<jlong>(UINT32_MAX)) {
         jniThrowException(_env, "java/lang/IllegalArgumentException", "indirect offset too large");
         return;
     }
diff --git a/opengl/tools/glgen/stubs/gles11/glDrawElementsIndirect.cpp b/opengl/tools/glgen/stubs/gles11/glDrawElementsIndirect.cpp
index 1833ee9..a091dc9 100644
--- a/opengl/tools/glgen/stubs/gles11/glDrawElementsIndirect.cpp
+++ b/opengl/tools/glgen/stubs/gles11/glDrawElementsIndirect.cpp
@@ -3,7 +3,7 @@
     // In OpenGL ES, 'indirect' is a byte offset into a buffer, not a raw pointer.
     // GL checks for too-large values. Here we only need to check for successful signed 64-bit
     // to unsigned 32-bit conversion.
-    if (sizeof(void*) != sizeof(jlong) && indirect > UINTPTR_MAX) {
+    if (sizeof(void*) != sizeof(jlong) && indirect > static_cast<jlong>(UINT32_MAX)) {
         jniThrowException(_env, "java/lang/IllegalArgumentException", "indirect offset too large");
         return;
     }
diff --git a/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp b/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp
index df11c53..f5506ba 100644
--- a/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp
+++ b/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp
@@ -16,6 +16,10 @@
 
 // This source file is automatically generated
 
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
 #include "jni.h"
 #include "JNIHelp.h"
 #include <android_runtime/AndroidRuntime.h>
diff --git a/services/batteryservice/Android.mk b/services/batteryservice/Android.mk
index 9354b99..e4097d7 100644
--- a/services/batteryservice/Android.mk
+++ b/services/batteryservice/Android.mk
@@ -2,17 +2,19 @@
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES:= \
-	BatteryProperties.cpp \
-	BatteryProperty.cpp \
-	IBatteryPropertiesListener.cpp \
-	IBatteryPropertiesRegistrar.cpp
+    BatteryProperties.cpp \
+    BatteryProperty.cpp \
+    IBatteryPropertiesListener.cpp \
+    IBatteryPropertiesRegistrar.cpp
 
 LOCAL_STATIC_LIBRARIES := \
-	libutils \
-	libbinder
+    libutils \
+    libbinder
 
 LOCAL_MODULE:= libbatteryservice
 
 LOCAL_MODULE_TAGS := optional
 
+LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
+
 include $(BUILD_STATIC_LIBRARY)
diff --git a/services/batteryservice/IBatteryPropertiesListener.cpp b/services/batteryservice/IBatteryPropertiesListener.cpp
index 19ac7f0..8aff26c 100644
--- a/services/batteryservice/IBatteryPropertiesListener.cpp
+++ b/services/batteryservice/IBatteryPropertiesListener.cpp
@@ -35,7 +35,7 @@
         data.writeInterfaceToken(IBatteryPropertiesListener::getInterfaceDescriptor());
         data.writeInt32(1);
         props.writeToParcel(&data);
-        status_t err = remote()->transact(TRANSACT_BATTERYPROPERTIESCHANGED, data, &reply, IBinder::FLAG_ONEWAY);
+        remote()->transact(TRANSACT_BATTERYPROPERTIESCHANGED, data, &reply, IBinder::FLAG_ONEWAY);
     }
 };
 
diff --git a/services/batteryservice/IBatteryPropertiesRegistrar.cpp b/services/batteryservice/IBatteryPropertiesRegistrar.cpp
index 296bfab..46934e0 100644
--- a/services/batteryservice/IBatteryPropertiesRegistrar.cpp
+++ b/services/batteryservice/IBatteryPropertiesRegistrar.cpp
@@ -34,14 +34,14 @@
         void registerListener(const sp<IBatteryPropertiesListener>& listener) {
             Parcel data;
             data.writeInterfaceToken(IBatteryPropertiesRegistrar::getInterfaceDescriptor());
-            data.writeStrongBinder(listener->asBinder());
+            data.writeStrongBinder(IInterface::asBinder(listener));
             remote()->transact(REGISTER_LISTENER, data, NULL);
         }
 
         void unregisterListener(const sp<IBatteryPropertiesListener>& listener) {
             Parcel data;
             data.writeInterfaceToken(IBatteryPropertiesRegistrar::getInterfaceDescriptor());
-            data.writeStrongBinder(listener->asBinder());
+            data.writeStrongBinder(IInterface::asBinder(listener));
             remote()->transact(UNREGISTER_LISTENER, data, NULL);
         }
 
diff --git a/services/inputflinger/Android.mk b/services/inputflinger/Android.mk
index 85edbe5..1af59a3 100644
--- a/services/inputflinger/Android.mk
+++ b/services/inputflinger/Android.mk
@@ -31,16 +31,13 @@
     libinput \
     liblog \
     libutils \
-	libui \
-	libhardware_legacy
+    libui \
+    libhardware_legacy
 
 
 # TODO: Move inputflinger to its own process and mark it hidden
 #LOCAL_CFLAGS += -fvisibility=hidden
 
-LOCAL_C_INCLUDES := \
-    external/openssl/include \
-
 LOCAL_CFLAGS += -Wno-unused-parameter
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
diff --git a/services/inputflinger/EventHub.cpp b/services/inputflinger/EventHub.cpp
index dfe5d3d..93ce010 100644
--- a/services/inputflinger/EventHub.cpp
+++ b/services/inputflinger/EventHub.cpp
@@ -858,7 +858,6 @@
                                     int(iev.time.tv_sec), int(iev.time.tv_usec));
                         }
 
-#ifdef HAVE_POSIX_CLOCKS
                         // Use the time specified in the event instead of the current time
                         // so that downstream code can get more accurate estimates of
                         // event dispatch latency from the time the event is enqueued onto
@@ -909,9 +908,6 @@
                                         event->when, time, now);
                             }
                         }
-#else
-                        event->when = now;
-#endif
                         event->deviceId = deviceId;
                         event->type = iev.type;
                         event->code = iev.code;
@@ -1443,7 +1439,7 @@
 }
 
 bool EventHub::hasKeycodeLocked(Device* device, int keycode) const {
-    if (!device->keyMap.haveKeyLayout() || !device->keyBitmask) {
+    if (!device->keyMap.haveKeyLayout()) {
         return false;
     }
     
@@ -1461,7 +1457,7 @@
 }
 
 status_t EventHub::mapLed(Device* device, int32_t led, int32_t* outScanCode) const {
-    if (!device->keyMap.haveKeyLayout() || !device->ledBitmask) {
+    if (!device->keyMap.haveKeyLayout()) {
         return NAME_NOT_FOUND;
     }
 
diff --git a/services/inputflinger/InputDispatcher.cpp b/services/inputflinger/InputDispatcher.cpp
index 603836a..9157bc1 100644
--- a/services/inputflinger/InputDispatcher.cpp
+++ b/services/inputflinger/InputDispatcher.cpp
@@ -3789,18 +3789,6 @@
 }
 
 
-// --- InputDispatcher::Queue ---
-
-template <typename T>
-uint32_t InputDispatcher::Queue<T>::count() const {
-    uint32_t result = 0;
-    for (const T* entry = head; entry; entry = entry->next) {
-        result += 1;
-    }
-    return result;
-}
-
-
 // --- InputDispatcher::InjectionState ---
 
 InputDispatcher::InjectionState::InjectionState(int32_t injectorPid, int32_t injectorUid) :
diff --git a/services/inputflinger/InputDispatcher.h b/services/inputflinger/InputDispatcher.h
index 70b0a34..8c78a44 100644
--- a/services/inputflinger/InputDispatcher.h
+++ b/services/inputflinger/InputDispatcher.h
@@ -606,8 +606,9 @@
     struct Queue {
         T* head;
         T* tail;
+        uint32_t entryCount;
 
-        inline Queue() : head(NULL), tail(NULL) {
+        inline Queue() : head(NULL), tail(NULL), entryCount(0) {
         }
 
         inline bool isEmpty() const {
@@ -615,6 +616,7 @@
         }
 
         inline void enqueueAtTail(T* entry) {
+            entryCount++;
             entry->prev = tail;
             if (tail) {
                 tail->next = entry;
@@ -626,6 +628,7 @@
         }
 
         inline void enqueueAtHead(T* entry) {
+            entryCount++;
             entry->next = head;
             if (head) {
                 head->prev = entry;
@@ -637,6 +640,7 @@
         }
 
         inline void dequeue(T* entry) {
+            entryCount--;
             if (entry->prev) {
                 entry->prev->next = entry->next;
             } else {
@@ -650,6 +654,7 @@
         }
 
         inline T* dequeueAtHead() {
+            entryCount--;
             T* entry = head;
             head = entry->next;
             if (head) {
@@ -660,7 +665,9 @@
             return entry;
         }
 
-        uint32_t count() const;
+        uint32_t count() const {
+            return entryCount;
+        }
     };
 
     /* Specifies which events are to be canceled and why. */
diff --git a/services/inputflinger/tests/Android.mk b/services/inputflinger/tests/Android.mk
index 6dae82f..0742a08 100644
--- a/services/inputflinger/tests/Android.mk
+++ b/services/inputflinger/tests/Android.mk
@@ -16,20 +16,11 @@
     libhardware_legacy \
     libui \
     libskia \
-    libstlport \
     libinput \
     libinputflinger \
     libinputservice
 
-static_libraries := \
-    libgtest \
-    libgtest_main
-
 c_includes := \
-    bionic \
-    bionic/libstdc++/include \
-    external/gtest/include \
-    external/stlport/stlport \
     external/skia/include/core
 
 
@@ -38,9 +29,8 @@
 $(foreach file,$(test_src_files), \
     $(eval include $(CLEAR_VARS)) \
     $(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \
-    $(eval LOCAL_STATIC_LIBRARIES := $(static_libraries)) \
     $(eval LOCAL_C_INCLUDES := $(c_includes)) \
-	$(eval LOCAL_CFLAGS += -Wno-unused-parameter) \
+    $(eval LOCAL_CFLAGS += -Wno-unused-parameter) \
     $(eval LOCAL_SRC_FILES := $(file)) \
     $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \
     $(eval LOCAL_MODULE_TAGS := $(module_tags)) \
diff --git a/services/inputflinger/tests/InputDispatcher_test.cpp b/services/inputflinger/tests/InputDispatcher_test.cpp
index 7aac6ed..9b68986 100644
--- a/services/inputflinger/tests/InputDispatcher_test.cpp
+++ b/services/inputflinger/tests/InputDispatcher_test.cpp
@@ -49,51 +49,49 @@
     }
 
 private:
-    virtual void notifyConfigurationChanged(nsecs_t when) {
+    virtual void notifyConfigurationChanged(nsecs_t) {
     }
 
-    virtual nsecs_t notifyANR(const sp<InputApplicationHandle>& inputApplicationHandle,
-            const sp<InputWindowHandle>& inputWindowHandle,
-            const String8& reason) {
+    virtual nsecs_t notifyANR(const sp<InputApplicationHandle>&,
+            const sp<InputWindowHandle>&,
+            const String8&) {
         return 0;
     }
 
-    virtual void notifyInputChannelBroken(const sp<InputWindowHandle>& inputWindowHandle) {
+    virtual void notifyInputChannelBroken(const sp<InputWindowHandle>&) {
     }
 
     virtual void getDispatcherConfiguration(InputDispatcherConfiguration* outConfig) {
         *outConfig = mConfig;
     }
 
-    virtual bool filterInputEvent(const InputEvent* inputEvent, uint32_t policyFlags) {
+    virtual bool filterInputEvent(const InputEvent*, uint32_t) {
         return true;
     }
 
-    virtual void interceptKeyBeforeQueueing(const KeyEvent* keyEvent, uint32_t& policyFlags) {
+    virtual void interceptKeyBeforeQueueing(const KeyEvent*, uint32_t&) {
     }
 
-    virtual void interceptMotionBeforeQueueing(nsecs_t when, uint32_t& policyFlags) {
+    virtual void interceptMotionBeforeQueueing(nsecs_t, uint32_t&) {
     }
 
-    virtual nsecs_t interceptKeyBeforeDispatching(const sp<InputWindowHandle>& inputWindowHandle,
-            const KeyEvent* keyEvent, uint32_t policyFlags) {
+    virtual nsecs_t interceptKeyBeforeDispatching(const sp<InputWindowHandle>&,
+            const KeyEvent*, uint32_t) {
         return 0;
     }
 
-    virtual bool dispatchUnhandledKey(const sp<InputWindowHandle>& inputWindowHandle,
-            const KeyEvent* keyEvent, uint32_t policyFlags, KeyEvent* outFallbackKeyEvent) {
+    virtual bool dispatchUnhandledKey(const sp<InputWindowHandle>&,
+            const KeyEvent*, uint32_t, KeyEvent*) {
         return false;
     }
 
-    virtual void notifySwitch(nsecs_t when,
-            uint32_t switchValues, uint32_t switchMask, uint32_t policyFlags) {
+    virtual void notifySwitch(nsecs_t, uint32_t, uint32_t, uint32_t) {
     }
 
-    virtual void pokeUserActivity(nsecs_t eventTime, int32_t eventType) {
+    virtual void pokeUserActivity(nsecs_t, int32_t) {
     }
 
-    virtual bool checkInjectEventsPermissionNonReentrant(
-            int32_t injectorPid, int32_t injectorUid) {
+    virtual bool checkInjectEventsPermissionNonReentrant(int32_t, int32_t) {
         return false;
     }
 };
diff --git a/services/inputflinger/tests/InputReader_test.cpp b/services/inputflinger/tests/InputReader_test.cpp
index c6eb1fd..40f51b6 100644
--- a/services/inputflinger/tests/InputReader_test.cpp
+++ b/services/inputflinger/tests/InputReader_test.cpp
@@ -104,17 +104,16 @@
         if (mY > mMaxY) mY = mMaxY;
     }
 
-    virtual void fade(Transition transition) {
+    virtual void fade(Transition) {
     }
 
-    virtual void unfade(Transition transition) {
+    virtual void unfade(Transition) {
     }
 
-    virtual void setPresentation(Presentation presentation) {
+    virtual void setPresentation(Presentation) {
     }
 
-    virtual void setSpots(const PointerCoords* spotCoords,
-            const uint32_t* spotIdToIndex, BitSet32 spotIdBits) {
+    virtual void setSpots(const PointerCoords*, const uint32_t*, BitSet32) {
     }
 
     virtual void clearSpots() {
@@ -196,11 +195,11 @@
         mInputDevices = inputDevices;
     }
 
-    virtual sp<KeyCharacterMap> getKeyboardLayoutOverlay(const InputDeviceIdentifier& identifier) {
+    virtual sp<KeyCharacterMap> getKeyboardLayoutOverlay(const InputDeviceIdentifier&) {
         return NULL;
     }
 
-    virtual String8 getDeviceAlias(const InputDeviceIdentifier& identifier) {
+    virtual String8 getDeviceAlias(const InputDeviceIdentifier&) {
         return String8::empty();
     }
 };
@@ -482,7 +481,7 @@
         return device ? device->identifier : InputDeviceIdentifier();
     }
 
-    virtual int32_t getDeviceControllerNumber(int32_t deviceId) const {
+    virtual int32_t getDeviceControllerNumber(int32_t) const {
         return 0;
     }
 
@@ -515,7 +514,7 @@
         return false;
     }
 
-    virtual bool hasInputProperty(int32_t deviceId, int property) const {
+    virtual bool hasInputProperty(int32_t, int) const {
         return false;
     }
 
@@ -553,8 +552,7 @@
         return NULL;
     }
 
-    virtual status_t mapAxis(int32_t deviceId, int32_t scanCode,
-            AxisInfo* outAxisInfo) const {
+    virtual status_t mapAxis(int32_t, int32_t, AxisInfo*) const {
         return NAME_NOT_FOUND;
     }
 
@@ -562,7 +560,7 @@
         mExcludedDevices = devices;
     }
 
-    virtual size_t getEvents(int timeoutMillis, RawEvent* buffer, size_t bufferSize) {
+    virtual size_t getEvents(int, RawEvent* buffer, size_t) {
         if (mEvents.empty()) {
             return 0;
         }
@@ -680,25 +678,25 @@
         }
     }
 
-    virtual sp<KeyCharacterMap> getKeyCharacterMap(int32_t deviceId) const {
+    virtual sp<KeyCharacterMap> getKeyCharacterMap(int32_t) const {
         return NULL;
     }
 
-    virtual bool setKeyboardLayoutOverlay(int32_t deviceId, const sp<KeyCharacterMap>& map) {
+    virtual bool setKeyboardLayoutOverlay(int32_t, const sp<KeyCharacterMap>&) {
         return false;
     }
 
-    virtual void vibrate(int32_t deviceId, nsecs_t duration) {
+    virtual void vibrate(int32_t, nsecs_t) {
     }
 
-    virtual void cancelVibrate(int32_t deviceId) {
+    virtual void cancelVibrate(int32_t) {
     }
 
-    virtual bool isExternal(int32_t deviceId) const {
+    virtual bool isExternal(int32_t) const {
         return false;
     }
 
-    virtual void dump(String8& dump) {
+    virtual void dump(String8&) {
     }
 
     virtual void monitor() {
@@ -763,18 +761,17 @@
         return mListener.get();
     }
 
-    virtual void disableVirtualKeysUntil(nsecs_t time) {
+    virtual void disableVirtualKeysUntil(nsecs_t) {
     }
 
-    virtual bool shouldDropVirtualKey(nsecs_t now,
-            InputDevice* device, int32_t keyCode, int32_t scanCode) {
+    virtual bool shouldDropVirtualKey(nsecs_t, InputDevice*, int32_t, int32_t) {
         return false;
     }
 
     virtual void fadePointer() {
     }
 
-    virtual void requestTimeoutAtTime(nsecs_t when) {
+    virtual void requestTimeoutAtTime(nsecs_t) {
     }
 
     virtual int32_t bumpGeneration() {
@@ -867,12 +864,11 @@
         }
     }
 
-    virtual void configure(nsecs_t when,
-            const InputReaderConfiguration* config, uint32_t changes) {
+    virtual void configure(nsecs_t, const InputReaderConfiguration*, uint32_t) {
         mConfigureWasCalled = true;
     }
 
-    virtual void reset(nsecs_t when) {
+    virtual void reset(nsecs_t) {
         mResetWasCalled = true;
     }
 
@@ -881,22 +877,22 @@
         mProcessWasCalled = true;
     }
 
-    virtual int32_t getKeyCodeState(uint32_t sourceMask, int32_t keyCode) {
+    virtual int32_t getKeyCodeState(uint32_t, int32_t keyCode) {
         ssize_t index = mKeyCodeStates.indexOfKey(keyCode);
         return index >= 0 ? mKeyCodeStates.valueAt(index) : AKEY_STATE_UNKNOWN;
     }
 
-    virtual int32_t getScanCodeState(uint32_t sourceMask, int32_t scanCode) {
+    virtual int32_t getScanCodeState(uint32_t, int32_t scanCode) {
         ssize_t index = mScanCodeStates.indexOfKey(scanCode);
         return index >= 0 ? mScanCodeStates.valueAt(index) : AKEY_STATE_UNKNOWN;
     }
 
-    virtual int32_t getSwitchState(uint32_t sourceMask, int32_t switchCode) {
+    virtual int32_t getSwitchState(uint32_t, int32_t switchCode) {
         ssize_t index = mSwitchStates.indexOfKey(switchCode);
         return index >= 0 ? mSwitchStates.valueAt(index) : AKEY_STATE_UNKNOWN;
     }
 
-    virtual bool markSupportedKeyCodes(uint32_t sourceMask, size_t numCodes,
+    virtual bool markSupportedKeyCodes(uint32_t, size_t numCodes,
             const int32_t* keyCodes, uint8_t* outFlags) {
         bool result = false;
         for (size_t i = 0; i < numCodes; i++) {
@@ -1536,7 +1532,7 @@
 };
 
 void KeyboardInputMapperTest::testDPadKeyRotation(KeyboardInputMapper* mapper,
-        int32_t originalScanCode, int32_t originalKeyCode, int32_t rotatedKeyCode) {
+        int32_t originalScanCode, int32_t, int32_t rotatedKeyCode) {
     NotifyKeyArgs args;
 
     process(mapper, ARBITRARY_TIME, DEVICE_ID, EV_KEY, originalScanCode, 1);
diff --git a/services/powermanager/Android.mk b/services/powermanager/Android.mk
index d98b2da..7b24c65 100644
--- a/services/powermanager/Android.mk
+++ b/services/powermanager/Android.mk
@@ -2,14 +2,16 @@
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES:= \
-	IPowerManager.cpp
+    IPowerManager.cpp
 
 LOCAL_SHARED_LIBRARIES := \
-	libutils \
-	libbinder
+    libutils \
+    libbinder
 
 LOCAL_MODULE:= libpowermanager
 
 LOCAL_MODULE_TAGS := optional
 
+LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
+
 include $(BUILD_SHARED_LIBRARY)
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index c316ef6..a857366 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -647,12 +647,9 @@
         if (canAccessSensor(sensor)) {
             accessibleSensorList.add(sensor);
         } else {
-            String8 infoMessage;
-            infoMessage.appendFormat(
-                    "Skipped sensor %s because it requires permission %s",
-                    sensor.getName().string(),
-                    sensor.getRequiredPermission().string());
-            ALOGI(infoMessage.string());
+            ALOGI("Skipped sensor %s because it requires permission %s",
+                  sensor.getName().string(),
+                  sensor.getRequiredPermission().string());
         }
     }
     return accessibleSensorList;
diff --git a/services/sensorservice/SensorService.h b/services/sensorservice/SensorService.h
index 8719487..e9ca3a5 100644
--- a/services/sensorservice/SensorService.h
+++ b/services/sensorservice/SensorService.h
@@ -37,6 +37,13 @@
 
 #include "SensorInterface.h"
 
+#if __clang__
+// Clang warns about SensorEventConnection::dump hiding BBinder::dump
+// The cause isn't fixable without changing the API, so let's tell clang
+// this is indeed intentional.
+#pragma clang diagnostic ignored "-Woverloaded-virtual"
+#endif
+
 // ---------------------------------------------------------------------------
 
 #define DEBUG_CONNECTIONS   false
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index af271b2..13d1a55 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -1,10 +1,10 @@
-LOCAL_PATH:= $(call my-dir)
+LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
 LOCAL_CLANG := true
 
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-LOCAL_SRC_FILES:= \
+LOCAL_SRC_FILES := \
     Client.cpp \
     DisplayDevice.cpp \
     DispSync.cpp \
@@ -37,18 +37,18 @@
     RenderEngine/GLES20RenderEngine.cpp
 
 
-LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\"
+LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
 LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
 
 ifeq ($(TARGET_BOARD_PLATFORM),omap4)
-	LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
+    LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
 endif
 ifeq ($(TARGET_BOARD_PLATFORM),s5pc110)
-	LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
+    LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
 endif
 
 ifeq ($(TARGET_DISABLE_TRIPLE_BUFFERING),true)
-	LOCAL_CFLAGS += -DTARGET_DISABLE_TRIPLE_BUFFERING
+    LOCAL_CFLAGS += -DTARGET_DISABLE_TRIPLE_BUFFERING
 endif
 
 ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true)
@@ -56,7 +56,7 @@
 endif
 
 ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
-  LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
+    LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
 endif
 
 ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true)
@@ -90,23 +90,25 @@
 endif
 
 LOCAL_CFLAGS += -fvisibility=hidden -Werror=format
-LOCAL_CFLAGS += -std=c++1y
+LOCAL_CPPFLAGS := -std=c++1y
 
 LOCAL_SHARED_LIBRARIES := \
-	libcutils \
-	liblog \
-	libdl \
-	libhardware \
-	libutils \
-	libEGL \
-	libGLESv1_CM \
-	libGLESv2 \
-	libbinder \
-	libui \
-	libgui \
-	libpowermanager
+    libcutils \
+    liblog \
+    libdl \
+    libhardware \
+    libutils \
+    libEGL \
+    libGLESv1_CM \
+    libGLESv2 \
+    libbinder \
+    libui \
+    libgui \
+    libpowermanager
 
-LOCAL_MODULE:= libsurfaceflinger
+LOCAL_MODULE := libsurfaceflinger
+
+LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
 
 include external/libcxx/libcxx.mk
 
@@ -116,46 +118,56 @@
 # build surfaceflinger's executable
 include $(CLEAR_VARS)
 
-LOCAL_LDFLAGS := -Wl,--version-script,art/sigchainlib/version-script.txt -Wl,--export-dynamic
-LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\"
-LOCAL_CPPFLAGS:= -std=c++11
+LOCAL_CLANG := true
 
-LOCAL_SRC_FILES:= \
-	main_surfaceflinger.cpp
+LOCAL_LDFLAGS := -Wl,--version-script,art/sigchainlib/version-script.txt -Wl,--export-dynamic
+LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
+LOCAL_CPPFLAGS := -std=c++11
+
+LOCAL_SRC_FILES := \
+    main_surfaceflinger.cpp
 
 LOCAL_SHARED_LIBRARIES := \
-	libsurfaceflinger \
-	libcutils \
-	liblog \
-	libbinder \
-	libutils \
-	libdl
+    libsurfaceflinger \
+    libcutils \
+    liblog \
+    libbinder \
+    libutils \
+    libdl
 
 LOCAL_WHOLE_STATIC_LIBRARIES := libsigchain
 
-LOCAL_MODULE:= surfaceflinger
+LOCAL_MODULE := surfaceflinger
 
 ifdef TARGET_32_BIT_SURFACEFLINGER
 LOCAL_32_BIT_ONLY := true
 endif
 
+LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
+
 include $(BUILD_EXECUTABLE)
 
 ###############################################################
 # uses jni which may not be available in PDK
 ifneq ($(wildcard libnativehelper/include),)
 include $(CLEAR_VARS)
-LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\"
 
-LOCAL_SRC_FILES:= \
+LOCAL_CLANG := true
+
+LOCAL_CFLAGS := -DLOG_TAG=\"SurfaceFlinger\"
+LOCAL_CPPFLAGS := -std=c++11
+
+LOCAL_SRC_FILES := \
     DdmConnection.cpp
 
 LOCAL_SHARED_LIBRARIES := \
-	libcutils \
-	liblog \
-	libdl
+    libcutils \
+    liblog \
+    libdl
 
-LOCAL_MODULE:= libsurfaceflinger_ddmconnection
+LOCAL_MODULE := libsurfaceflinger_ddmconnection
+
+LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
 
 include $(BUILD_SHARED_LIBRARY)
 endif # libnativehelper
diff --git a/services/surfaceflinger/DdmConnection.cpp b/services/surfaceflinger/DdmConnection.cpp
index 2477921..a000a84 100644
--- a/services/surfaceflinger/DdmConnection.cpp
+++ b/services/surfaceflinger/DdmConnection.cpp
@@ -59,12 +59,14 @@
     }
 
     jint (*JNI_CreateJavaVM)(JavaVM** p_vm, JNIEnv** p_env, void* vm_args);
-    JNI_CreateJavaVM = (typeof JNI_CreateJavaVM)dlsym(libart_dso, "JNI_CreateJavaVM");
+    JNI_CreateJavaVM = reinterpret_cast<decltype(JNI_CreateJavaVM)>(
+            dlsym(libart_dso, "JNI_CreateJavaVM"));
     ALOGE_IF(!JNI_CreateJavaVM, "DdmConnection: %s", dlerror());
 
     jint (*registerNatives)(JNIEnv* env, jclass clazz);
-    registerNatives = (typeof registerNatives)dlsym(libandroid_runtime_dso,
-        "Java_com_android_internal_util_WithFramework_registerNatives");
+    registerNatives = reinterpret_cast<decltype(registerNatives)>(
+            dlsym(libandroid_runtime_dso,
+                  "Java_com_android_internal_util_WithFramework_registerNatives"));
     ALOGE_IF(!registerNatives, "DdmConnection: %s", dlerror());
 
     if (!JNI_CreateJavaVM || !registerNatives) {
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index 564f974..13d44f3 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -44,6 +44,18 @@
 using namespace android;
 // ----------------------------------------------------------------------------
 
+#ifdef EGL_ANDROID_swap_rectangle
+static constexpr bool kEGLAndroidSwapRectangle = true;
+#else
+static constexpr bool kEGLAndroidSwapRectangle = false;
+#endif
+
+#if !defined(EGL_EGLEXT_PROTOTYPES) || !defined(EGL_ANDROID_swap_rectangle)
+// Dummy implementation in case it is missing.
+inline void eglSetSwapRectangleANDROID (EGLDisplay, EGLSurface, EGLint, EGLint, EGLint, EGLint) {
+}
+#endif
+
 /*
  * Initialize the display to the specified values.
  *
@@ -84,7 +96,6 @@
      */
 
     EGLSurface surface;
-    EGLint w, h;
     EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
     if (config == EGL_NO_CONFIG) {
         config = RenderEngine::chooseEglConfig(display, format);
@@ -188,19 +199,14 @@
 {
     mFlinger->getRenderEngine().checkErrors();
 
-    EGLDisplay dpy = mDisplay;
-    EGLSurface surface = mSurface;
-
-#ifdef EGL_ANDROID_swap_rectangle
-    if (mFlags & SWAP_RECTANGLE) {
-        const Region newDirty(dirty.intersect(bounds()));
-        const Rect b(newDirty.getBounds());
-        eglSetSwapRectangleANDROID(dpy, surface,
-                b.left, b.top, b.width(), b.height());
+    if (kEGLAndroidSwapRectangle) {
+        if (mFlags & SWAP_RECTANGLE) {
+            const Region newDirty(dirty.intersect(bounds()));
+            const Rect b(newDirty.getBounds());
+            eglSetSwapRectangleANDROID(mDisplay, mSurface,
+                    b.left, b.top, b.width(), b.height());
+        }
     }
-#else
-    (void) dirty; // Eliminate unused parameter warning
-#endif
 
     mPageFlipCount++;
 }
@@ -511,6 +517,6 @@
         tr[0][2], tr[1][2], tr[2][2]);
 
     String8 surfaceDump;
-    mDisplaySurface->dump(surfaceDump);
+    mDisplaySurface->dumpAsString(surfaceDump);
     result.append(surfaceDump);
 }
diff --git a/services/surfaceflinger/DisplayHardware/DisplaySurface.h b/services/surfaceflinger/DisplayHardware/DisplaySurface.h
index e60c4fb..2f743c1 100644
--- a/services/surfaceflinger/DisplayHardware/DisplaySurface.h
+++ b/services/surfaceflinger/DisplayHardware/DisplaySurface.h
@@ -70,7 +70,7 @@
     // frame's buffer.
     virtual void onFrameCommitted() = 0;
 
-    virtual void dump(String8& result) const = 0;
+    virtual void dumpAsString(String8& result) const = 0;
 
     virtual void resizeBuffers(const uint32_t w, const uint32_t h) = 0;
 
diff --git a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
index 22d3cec..4885c5f 100644
--- a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
+++ b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
@@ -160,23 +160,7 @@
     return mHwc.fbCompositionComplete();
 }
 
-// Since DisplaySurface and ConsumerBase both have a method with this
-// signature, results will vary based on the static pointer type the caller is
-// using:
-//   void dump(FrameBufferSurface* fbs, String8& s) {
-//       // calls FramebufferSurface::dump()
-//       fbs->dump(s);
-//
-//       // calls ConsumerBase::dump() since it is non-virtual
-//       static_cast<ConsumerBase*>(fbs)->dump(s);
-//
-//       // calls FramebufferSurface::dump() since it is virtual
-//       static_cast<DisplaySurface*>(fbs)->dump(s);
-//   }
-// To make sure that all of these end up doing the same thing, we just redirect
-// to ConsumerBase::dump() here. It will take the internal lock, and then call
-// virtual dumpLocked(), which is where the real work happens.
-void FramebufferSurface::dump(String8& result) const {
+void FramebufferSurface::dumpAsString(String8& result) const {
     ConsumerBase::dump(result);
 }
 
diff --git a/services/surfaceflinger/DisplayHardware/FramebufferSurface.h b/services/surfaceflinger/DisplayHardware/FramebufferSurface.h
index 8605862..3d17840 100644
--- a/services/surfaceflinger/DisplayHardware/FramebufferSurface.h
+++ b/services/surfaceflinger/DisplayHardware/FramebufferSurface.h
@@ -44,10 +44,7 @@
     virtual status_t compositionComplete();
     virtual status_t advanceFrame();
     virtual void onFrameCommitted();
-
-    // Implementation of DisplaySurface::dump(). Note that ConsumerBase also
-    // has a non-virtual dump() with the same signature.
-    virtual void dump(String8& result) const;
+    virtual void dumpAsString(String8& result) const;
 
     // Cannot resize a buffers in a FramebufferSurface. Only works with virtual
     // displays.
diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp
index c3d45ee..e0f32e9 100644
--- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp
+++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp
@@ -254,7 +254,7 @@
     resetPerFrameState();
 }
 
-void VirtualDisplaySurface::dump(String8& /* result */) const {
+void VirtualDisplaySurface::dumpAsString(String8& /* result */) const {
 }
 
 void VirtualDisplaySurface::resizeBuffers(const uint32_t w, const uint32_t h) {
diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h
index 363dce2..2c14d6d 100644
--- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h
+++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h
@@ -86,7 +86,7 @@
     virtual status_t compositionComplete();
     virtual status_t advanceFrame();
     virtual void onFrameCommitted();
-    virtual void dump(String8& result) const;
+    virtual void dumpAsString(String8& result) const;
     virtual void resizeBuffers(const uint32_t w, const uint32_t h);
 
 private:
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 5e3dfab..9da1efd 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -64,7 +64,6 @@
         mTextureName(-1U),
         mPremultipliedAlpha(true),
         mName("unnamed"),
-        mDebug(false),
         mFormat(PIXEL_FORMAT_NONE),
         mTransactionFlags(0),
         mQueuedFrames(0),
@@ -693,7 +692,6 @@
 
 void Layer::drawWithOpenGL(const sp<const DisplayDevice>& hw,
         const Region& /* clip */, bool useIdentityTransform) const {
-    const uint32_t fbHeight = hw->getHeight();
     const State& s(getDrawingState());
 
     computeGeometry(hw, mMesh, useIdentityTransform);
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 1d4eee7..424c03e 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -364,7 +364,6 @@
     uint32_t mTextureName;      // from GLES
     bool mPremultipliedAlpha;
     String8 mName;
-    mutable bool mDebug;
     PixelFormat mFormat;
 
     // these are protected by an external lock
diff --git a/services/surfaceflinger/MonitoredProducer.cpp b/services/surfaceflinger/MonitoredProducer.cpp
index 8739682..37a044e 100644
--- a/services/surfaceflinger/MonitoredProducer.cpp
+++ b/services/surfaceflinger/MonitoredProducer.cpp
@@ -49,7 +49,7 @@
         wp<IBinder> mProducer;
     };
 
-    mFlinger->postMessageAsync(new MessageCleanUpList(mFlinger, asBinder()));
+    mFlinger->postMessageAsync(new MessageCleanUpList(mFlinger, asBinder(this)));
 }
 
 status_t MonitoredProducer::requestBuffer(int slot, sp<GraphicBuffer>* buf) {
@@ -111,7 +111,7 @@
 }
 
 IBinder* MonitoredProducer::onAsBinder() {
-    return mProducer->asBinder().get();
+    return IInterface::asBinder(mProducer).get();
 }
 
 // ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/RenderEngine/GLES11RenderEngine.cpp b/services/surfaceflinger/RenderEngine/GLES11RenderEngine.cpp
index c2768f3..2e6af49 100644
--- a/services/surfaceflinger/RenderEngine/GLES11RenderEngine.cpp
+++ b/services/surfaceflinger/RenderEngine/GLES11RenderEngine.cpp
@@ -43,12 +43,6 @@
     glDisable(GL_DITHER);
     glDisable(GL_CULL_FACE);
 
-    struct pack565 {
-        inline uint16_t operator() (int r, int g, int b) const {
-            return (r<<11)|(g<<5)|b;
-        }
-    } pack565;
-
     const uint16_t protTexData[] = { 0 };
     glGenTextures(1, &mProtectedTexName);
     glBindTexture(GL_TEXTURE_2D, mProtectedTexName);
diff --git a/services/surfaceflinger/RenderEngine/GLES20RenderEngine.cpp b/services/surfaceflinger/RenderEngine/GLES20RenderEngine.cpp
index 8ebafbc..8712c9a 100644
--- a/services/surfaceflinger/RenderEngine/GLES20RenderEngine.cpp
+++ b/services/surfaceflinger/RenderEngine/GLES20RenderEngine.cpp
@@ -48,12 +48,6 @@
     glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
     glPixelStorei(GL_PACK_ALIGNMENT, 4);
 
-    struct pack565 {
-        inline uint16_t operator() (int r, int g, int b) const {
-            return (r<<11)|(g<<5)|b;
-        }
-    } pack565;
-
     const uint16_t protTexData[] = { 0 };
     glGenTextures(1, &mProtectedTexName);
     glBindTexture(GL_TEXTURE_2D, mProtectedTexName);
diff --git a/services/surfaceflinger/RenderEngine/RenderEngine.cpp b/services/surfaceflinger/RenderEngine/RenderEngine.cpp
index a77e0e9..7cd42e4 100644
--- a/services/surfaceflinger/RenderEngine/RenderEngine.cpp
+++ b/services/surfaceflinger/RenderEngine/RenderEngine.cpp
@@ -283,7 +283,6 @@
 
 static status_t selectConfigForAttribute(EGLDisplay dpy, EGLint const* attrs,
         EGLint attribute, EGLint wanted, EGLConfig* outConfig) {
-    EGLConfig config = NULL;
     EGLint numConfigs = -1, n = 0;
     eglGetConfigs(dpy, NULL, 0, &numConfigs);
     EGLConfig* const configs = new EGLConfig[numConfigs];
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 6013ddb..fff7451 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -394,7 +394,6 @@
     ALOGI(  "SurfaceFlinger's main thread ready to run. "
             "Initializing graphics H/W...");
 
-    status_t err;
     Mutex::Autolock _l(mStateLock);
 
     // initialize EGL for the default display
@@ -503,7 +502,7 @@
 bool SurfaceFlinger::authenticateSurfaceTexture(
         const sp<IGraphicBufferProducer>& bufferProducer) const {
     Mutex::Autolock _l(mStateLock);
-    sp<IBinder> surfaceTextureBinder(bufferProducer->asBinder());
+    sp<IBinder> surfaceTextureBinder(IInterface::asBinder(bufferProducer));
     return mGraphicBufferProducerList.indexOf(surfaceTextureBinder) >= 0;
 }
 
@@ -613,7 +612,7 @@
     return NO_ERROR;
 }
 
-status_t SurfaceFlinger::getDisplayStats(const sp<IBinder>& display,
+status_t SurfaceFlinger::getDisplayStats(const sp<IBinder>& /* display */,
         DisplayStatInfo* stats) {
     if (stats == NULL) {
         return BAD_VALUE;
@@ -1294,7 +1293,9 @@
                     // this display is in both lists. see if something changed.
                     const DisplayDeviceState& state(curr[j]);
                     const wp<IBinder>& display(curr.keyAt(j));
-                    if (state.surface->asBinder() != draw[i].surface->asBinder()) {
+                    const sp<IBinder> state_binder = IInterface::asBinder(state.surface);
+                    const sp<IBinder> draw_binder = IInterface::asBinder(draw[i].surface);
+                    if (state_binder != draw_binder) {
                         // changing the surface is like destroying and
                         // recreating the DisplayDevice, so we just remove it
                         // from the drawing state, so that it get re-added
@@ -2046,7 +2047,7 @@
     // add this layer to the current state list
     Mutex::Autolock _l(mStateLock);
     mCurrentState.layersSortedByZ.add(lbc);
-    mGraphicBufferProducerList.add(gbc->asBinder());
+    mGraphicBufferProducerList.add(IInterface::asBinder(gbc));
 }
 
 status_t SurfaceFlinger::removeLayer(const sp<Layer>& layer) {
@@ -2119,7 +2120,7 @@
         // NOTE: it would be better to use RTTI as we could directly check
         // that we have a Client*. however, RTTI is disabled in Android.
         if (s.client != NULL) {
-            sp<IBinder> binder = s.client->asBinder();
+            sp<IBinder> binder = IInterface::asBinder(s.client);
             if (binder != NULL) {
                 String16 desc(binder->getInterfaceDescriptor());
                 if (desc == ISurfaceComposerClient::descriptor) {
@@ -2166,7 +2167,7 @@
     if (disp.isValid()) {
         const uint32_t what = s.what;
         if (what & DisplayState::eSurfaceChanged) {
-            if (disp.surface->asBinder() != s.surface->asBinder()) {
+            if (IInterface::asBinder(disp.surface) != IInterface::asBinder(s.surface)) {
                 disp.surface = s.surface;
                 flags |= eDisplayTransactionNeeded;
             }
@@ -2497,18 +2498,15 @@
         result.appendFormat("Permission Denial: "
                 "can't dump SurfaceFlinger from pid=%d, uid=%d\n", pid, uid);
     } else {
-        // Try to get the main lock, but don't insist if we can't
+        // Try to get the main lock, but give up after one second
         // (this would indicate SF is stuck, but we want to be able to
         // print something in dumpsys).
-        int retry = 3;
-        while (mStateLock.tryLock()<0 && --retry>=0) {
-            usleep(1000000);
-        }
-        const bool locked(retry >= 0);
+        status_t err = mStateLock.timedLock(s2ns(1));
+        bool locked = (err == NO_ERROR);
         if (!locked) {
-            result.append(
-                    "SurfaceFlinger appears to be unresponsive, "
-                    "dumping anyways (no locks held)\n");
+            result.appendFormat(
+                    "SurfaceFlinger appears to be unresponsive (%s [%d]), "
+                    "dumping anyways (no locks held)\n", strerror(-err), err);
         }
 
         bool dumpAll = true;
@@ -3057,7 +3055,7 @@
         // Prevent reads below from happening before the read from Message
         atomic_thread_fence(memory_order_acquire);
         if (what == MSG_API_CALL) {
-            result = impl->asBinder()->transact(code, data[0], reply);
+            result = IInterface::asBinder(impl)->transact(code, data[0], reply);
             barrier.open();
         } else if (what == MSG_EXIT) {
             exitRequested = true;
@@ -3107,7 +3105,7 @@
     // if we have secure windows on this display, never allow the screen capture
     // unless the producer interface is local (i.e.: we can take a screenshot for
     // ourselves).
-    if (!producer->asBinder()->localBinder()) {
+    if (!IInterface::asBinder(producer)->localBinder()) {
         Mutex::Autolock _l(mStateLock);
         sp<const DisplayDevice> hw(getDisplayDevice(display));
         if (hw->getSecureLayerVisible()) {
@@ -3171,7 +3169,7 @@
             result = flinger->captureScreenImplLocked(hw, producer,
                     sourceCrop, reqWidth, reqHeight, minLayerZ, maxLayerZ,
                     useIdentityTransform, rotation);
-            static_cast<GraphicProducerWrapper*>(producer->asBinder().get())->exit(result);
+            static_cast<GraphicProducerWrapper*>(IInterface::asBinder(producer).get())->exit(result);
             return true;
         }
     };
@@ -3213,9 +3211,10 @@
     RenderEngine& engine(getRenderEngine());
 
     // get screen geometry
-    const uint32_t hw_w = hw->getWidth();
-    const uint32_t hw_h = hw->getHeight();
-    const bool filtering = reqWidth != hw_w || reqWidth != hw_h;
+    const int32_t hw_w = hw->getWidth();
+    const int32_t hw_h = hw->getHeight();
+    const bool filtering = static_cast<int32_t>(reqWidth) != hw_w ||
+                           static_cast<int32_t>(reqWidth) != hw_h;
 
     // if a default or invalid sourceCrop is passed in, set reasonable values
     if (sourceCrop.width() == 0 || sourceCrop.height() == 0 ||
@@ -3228,13 +3227,13 @@
     if (sourceCrop.left < 0) {
         ALOGE("Invalid crop rect: l = %d (< 0)", sourceCrop.left);
     }
-    if (static_cast<uint32_t>(sourceCrop.right) > hw_w) {
+    if (sourceCrop.right > hw_w) {
         ALOGE("Invalid crop rect: r = %d (> %d)", sourceCrop.right, hw_w);
     }
     if (sourceCrop.top < 0) {
         ALOGE("Invalid crop rect: t = %d (< 0)", sourceCrop.top);
     }
-    if (static_cast<uint32_t>(sourceCrop.bottom) > hw_h) {
+    if (sourceCrop.bottom > hw_h) {
         ALOGE("Invalid crop rect: b = %d (> %d)", sourceCrop.bottom, hw_h);
     }
 
diff --git a/services/surfaceflinger/tests/Android.mk b/services/surfaceflinger/tests/Android.mk
index e210860..979062e 100644
--- a/services/surfaceflinger/tests/Android.mk
+++ b/services/surfaceflinger/tests/Android.mk
@@ -1,6 +1,7 @@
 # Build the unit tests,
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 
 LOCAL_MODULE := SurfaceFlinger_test
 
@@ -15,16 +16,9 @@
 	libbinder \
 	libcutils \
 	libgui \
-	libstlport \
 	libui \
 	libutils \
 
-LOCAL_C_INCLUDES := \
-    bionic \
-    bionic/libstdc++/include \
-    external/gtest/include \
-    external/stlport/stlport \
-
 # Build the binary to $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)
 # to integrate with auto-test framework.
 include $(BUILD_NATIVE_TEST)