am 136704a8: am b069833e: Merge "Adjust the LTE signal bar mapping." into ics-mr1

* commit '136704a803ed7dd419a452315d1c0fe4885ce441':
  Adjust the LTE signal bar mapping.
diff --git a/include/gui/SensorChannel.h b/include/gui/BitTube.h
similarity index 89%
rename from include/gui/SensorChannel.h
rename to include/gui/BitTube.h
index bb54618..76389a0 100644
--- a/include/gui/SensorChannel.h
+++ b/include/gui/BitTube.h
@@ -28,14 +28,15 @@
 // ----------------------------------------------------------------------------
 class Parcel;
 
-class SensorChannel : public RefBase
+class BitTube : public RefBase
 {
 public:
 
-            SensorChannel();
-            SensorChannel(const Parcel& data);
-    virtual ~SensorChannel();
+            BitTube();
+            BitTube(const Parcel& data);
+    virtual ~BitTube();
 
+    status_t initCheck() const;
     int getFd() const;
     ssize_t write(void const* vaddr, size_t size);
     ssize_t read(void* vaddr, size_t size);
diff --git a/include/gui/DisplayEventReceiver.h b/include/gui/DisplayEventReceiver.h
new file mode 100644
index 0000000..dccc164
--- /dev/null
+++ b/include/gui/DisplayEventReceiver.h
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#ifndef ANDROID_GUI_DISPLAY_EVENT_H
+#define ANDROID_GUI_DISPLAY_EVENT_H
+
+#include <stdint.h>
+#include <sys/types.h>
+
+#include <utils/Errors.h>
+#include <utils/RefBase.h>
+#include <utils/Timers.h>
+
+#include <binder/IInterface.h>
+
+// ----------------------------------------------------------------------------
+
+namespace android {
+
+// ----------------------------------------------------------------------------
+
+class BitTube;
+class IDisplayEventConnection;
+
+// ----------------------------------------------------------------------------
+
+class DisplayEventReceiver {
+public:
+    enum {
+        DISPLAY_EVENT_VSYNC = 'vsyn'
+    };
+
+    struct Event {
+
+        struct Header {
+            uint32_t type;
+            nsecs_t timestamp;
+        };
+
+        struct VSync {
+            uint32_t count;
+        };
+
+        Header header;
+        union {
+            VSync vsync;
+        };
+    };
+
+public:
+    /*
+     * DisplayEventReceiver creates and registers an event connection with
+     * SurfaceFlinger. Events start being delivered immediately.
+     */
+    DisplayEventReceiver();
+
+    /*
+     * ~DisplayEventReceiver severs the connection with SurfaceFlinger, new events
+     * stop being delivered immediately. Note that the queue could have
+     * some events pending. These will be delivered.
+     */
+    ~DisplayEventReceiver();
+
+    /*
+     * initCheck returns the state of DisplayEventReceiver after construction.
+     */
+    status_t initCheck() const;
+
+    /*
+     * getFd returns the file descriptor to use to receive events.
+     * OWNERSHIP IS RETAINED by DisplayEventReceiver. DO NOT CLOSE this
+     * file-descriptor.
+     */
+    int getFd() const;
+
+    /*
+     * getEvents reads event from the queue and returns how many events were
+     * read. Returns 0 if there are no more events or a negative error code.
+     * If NOT_ENOUGH_DATA is returned, the object has become invalid forever, it
+     * should be destroyed and getEvents() shouldn't be called again.
+     */
+    ssize_t getEvents(Event* events, size_t count);
+
+    /*
+     * setVsyncRate() sets the Event::VSync delivery rate. A value of
+     * 1 returns every Event::VSync. A value of 2 returns every other event,
+     * etc... a value of 0 returns no event unless  requestNextVsync() has
+     * been called.
+     */
+    status_t setVsyncRate(uint32_t count);
+
+    /*
+     * requestNextVsync() schedules the next Event::VSync. It has no effect
+     * if the vsync rate is > 0.
+     */
+    status_t requestNextVsync();
+
+private:
+    sp<IDisplayEventConnection> mEventConnection;
+    sp<BitTube> mDataChannel;
+};
+
+// ----------------------------------------------------------------------------
+}; // namespace android
+
+#endif // ANDROID_GUI_DISPLAY_EVENT_H
diff --git a/include/gui/IDisplayEventConnection.h b/include/gui/IDisplayEventConnection.h
new file mode 100644
index 0000000..86247de
--- /dev/null
+++ b/include/gui/IDisplayEventConnection.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#ifndef ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H
+#define ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H
+
+#include <stdint.h>
+#include <sys/types.h>
+
+#include <utils/Errors.h>
+#include <utils/RefBase.h>
+
+#include <binder/IInterface.h>
+
+namespace android {
+// ----------------------------------------------------------------------------
+
+class BitTube;
+
+class IDisplayEventConnection : public IInterface
+{
+public:
+
+    DECLARE_META_INTERFACE(DisplayEventConnection);
+
+    /*
+     * getDataChannel() returns a BitTube where to receive the events from
+     */
+    virtual sp<BitTube> getDataChannel() const = 0;
+
+    /*
+     * setVsyncRate() sets the vsync event delivery rate. A value of
+     * 1 returns every vsync events. A value of 2 returns every other events,
+     * etc... a value of 0 returns no event unless  requestNextVsync() has
+     * been called.
+     */
+    virtual void setVsyncRate(uint32_t count) = 0;
+
+    /*
+     * requestNextVsync() schedules the next vsync event. It has no effect
+     * if the vsync rate is > 0.
+     */
+    virtual void requestNextVsync() = 0;    // asynchronous
+};
+
+// ----------------------------------------------------------------------------
+
+class BnDisplayEventConnection : public BnInterface<IDisplayEventConnection>
+{
+public:
+    virtual status_t    onTransact( uint32_t code,
+                                    const Parcel& data,
+                                    Parcel* reply,
+                                    uint32_t flags = 0);
+};
+
+// ----------------------------------------------------------------------------
+}; // namespace android
+
+#endif // ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H
diff --git a/include/gui/ISensorEventConnection.h b/include/gui/ISensorEventConnection.h
index ed4e4cc..749065e 100644
--- a/include/gui/ISensorEventConnection.h
+++ b/include/gui/ISensorEventConnection.h
@@ -28,14 +28,14 @@
 namespace android {
 // ----------------------------------------------------------------------------
 
-class SensorChannel;
+class BitTube;
 
 class ISensorEventConnection : public IInterface
 {
 public:
     DECLARE_META_INTERFACE(SensorEventConnection);
 
-    virtual sp<SensorChannel> getSensorChannel() const = 0;
+    virtual sp<BitTube> getSensorChannel() const = 0;
     virtual status_t enableDisable(int handle, bool enabled) = 0;
     virtual status_t setEventRate(int handle, nsecs_t ns) = 0;
 };
diff --git a/include/gui/SensorEventQueue.h b/include/gui/SensorEventQueue.h
index 97dd391..ef7c6e3 100644
--- a/include/gui/SensorEventQueue.h
+++ b/include/gui/SensorEventQueue.h
@@ -24,7 +24,7 @@
 #include <utils/RefBase.h>
 #include <utils/Timers.h>
 
-#include <gui/SensorChannel.h>
+#include <gui/BitTube.h>
 
 // ----------------------------------------------------------------------------
 
@@ -71,7 +71,7 @@
 private:
     sp<Looper> getLooper() const;
     sp<ISensorEventConnection> mSensorEventConnection;
-    sp<SensorChannel> mSensorChannel;
+    sp<BitTube> mSensorChannel;
     mutable Mutex mLock;
     mutable sp<Looper> mLooper;
 };
diff --git a/include/private/gui/ComposerService.h b/include/private/gui/ComposerService.h
new file mode 100644
index 0000000..d04491a
--- /dev/null
+++ b/include/private/gui/ComposerService.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#ifndef ANDROID_PRIVATE_GUI_COMPOSER_SERVICE_H
+#define ANDROID_PRIVATE_GUI_COMPOSER_SERVICE_H
+
+#include <stdint.h>
+#include <sys/types.h>
+
+#include <utils/Singleton.h>
+#include <utils/StrongPointer.h>
+
+
+namespace android {
+
+// ---------------------------------------------------------------------------
+
+class IMemoryHeap;
+class ISurfaceComposer;
+class surface_flinger_cblk_t;
+
+// ---------------------------------------------------------------------------
+
+class ComposerService : public Singleton<ComposerService>
+{
+    // these are constants
+    sp<ISurfaceComposer> mComposerService;
+    sp<IMemoryHeap> mServerCblkMemory;
+    surface_flinger_cblk_t volatile* mServerCblk;
+    ComposerService();
+    friend class Singleton<ComposerService>;
+public:
+    static sp<ISurfaceComposer> getComposerService();
+    static surface_flinger_cblk_t const volatile * getControlBlock();
+};
+
+// ---------------------------------------------------------------------------
+}; // namespace android
+
+#endif // ANDROID_PRIVATE_GUI_COMPOSER_SERVICE_H
diff --git a/include/surfaceflinger/ISurfaceComposer.h b/include/surfaceflinger/ISurfaceComposer.h
index 5eb09c7..58fd89d 100644
--- a/include/surfaceflinger/ISurfaceComposer.h
+++ b/include/surfaceflinger/ISurfaceComposer.h
@@ -33,8 +33,9 @@
 namespace android {
 // ----------------------------------------------------------------------------
 
-class IMemoryHeap;
 class ComposerState;
+class IDisplayEventConnection;
+class IMemoryHeap;
 
 class ISurfaceComposer : public IInterface
 {
@@ -124,13 +125,19 @@
             uint32_t reqWidth, uint32_t reqHeight,
             uint32_t minLayerZ, uint32_t maxLayerZ) = 0;
 
+    /* triggers screen off animation */
     virtual status_t turnElectronBeamOff(int32_t mode) = 0;
+
+    /* triggers screen on animation */
     virtual status_t turnElectronBeamOn(int32_t mode) = 0;
 
     /* verify that an ISurfaceTexture was created by SurfaceFlinger.
      */
     virtual bool authenticateSurfaceTexture(
             const sp<ISurfaceTexture>& surface) const = 0;
+
+    /* return an IDisplayEventConnection */
+    virtual sp<IDisplayEventConnection> createDisplayEventConnection() = 0;
 };
 
 // ----------------------------------------------------------------------------
@@ -151,6 +158,7 @@
         TURN_ELECTRON_BEAM_OFF,
         TURN_ELECTRON_BEAM_ON,
         AUTHENTICATE_SURFACE,
+        CREATE_DISPLAY_EVENT_CONNECTION,
     };
 
     virtual status_t    onTransact( uint32_t code,
diff --git a/include/surfaceflinger/SurfaceComposerClient.h b/include/surfaceflinger/SurfaceComposerClient.h
index 8226abe..99affda 100644
--- a/include/surfaceflinger/SurfaceComposerClient.h
+++ b/include/surfaceflinger/SurfaceComposerClient.h
@@ -28,7 +28,6 @@
 #include <utils/threads.h>
 
 #include <ui/PixelFormat.h>
-#include <ui/Region.h>
 
 #include <surfaceflinger/Surface.h>
 
@@ -39,30 +38,11 @@
 class DisplayInfo;
 class Composer;
 class IMemoryHeap;
-class ISurfaceComposer;
+class ISurfaceComposerClient;
 class Region;
-class surface_flinger_cblk_t;
-struct layer_state_t;
 
 // ---------------------------------------------------------------------------
 
-class ComposerService : public Singleton<ComposerService>
-{
-    // these are constants
-    sp<ISurfaceComposer> mComposerService;
-    sp<IMemoryHeap> mServerCblkMemory;
-    surface_flinger_cblk_t volatile* mServerCblk;
-    ComposerService();
-    friend class Singleton<ComposerService>;
-public:
-    static sp<ISurfaceComposer> getComposerService();
-    static surface_flinger_cblk_t const volatile * getControlBlock();
-};
-
-// ---------------------------------------------------------------------------
-
-class Composer;
-
 class SurfaceComposerClient : public RefBase
 {
     friend class Composer;
diff --git a/include/ui/GraphicLog.h b/include/ui/GraphicLog.h
deleted file mode 100644
index ee1b09a..0000000
--- a/include/ui/GraphicLog.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef _UI_GRAPHIC_LOG_H
-#define _UI_GRAPHIC_LOG_H
-
-#include <utils/Singleton.h>
-#include <cutils/compiler.h>
-
-namespace android {
-
-class GraphicLog : public Singleton<GraphicLog>
-{
-    int32_t mEnabled;
-    static void logImpl(int32_t tag, int32_t buffer);
-    static void logImpl(int32_t tag, int32_t identity, int32_t buffer);
-
-public:
-    enum {
-        SF_APP_DEQUEUE_BEFORE   = 60100,
-        SF_APP_DEQUEUE_AFTER    = 60101,
-        SF_APP_LOCK_BEFORE      = 60102,
-        SF_APP_LOCK_AFTER       = 60103,
-        SF_APP_QUEUE            = 60104,
-
-        SF_REPAINT              = 60105,
-        SF_COMPOSITION_COMPLETE = 60106,
-        SF_UNLOCK_CLIENTS       = 60107,
-        SF_SWAP_BUFFERS         = 60108,
-        SF_REPAINT_DONE         = 60109,
-
-        SF_FB_POST_BEFORE       = 60110,
-        SF_FB_POST_AFTER        = 60111,
-        SF_FB_DEQUEUE_BEFORE    = 60112,
-        SF_FB_DEQUEUE_AFTER     = 60113,
-        SF_FB_LOCK_BEFORE       = 60114,
-        SF_FB_LOCK_AFTER        = 60115,
-    };
-
-    inline void log(int32_t tag, int32_t buffer) {
-        if (CC_UNLIKELY(mEnabled))
-            logImpl(tag, buffer);
-    }
-    inline void log(int32_t tag, int32_t identity, int32_t buffer) {
-        if (CC_UNLIKELY(mEnabled))
-            logImpl(tag, identity, buffer);
-    }
-
-    GraphicLog();
-
-    void setEnabled(bool enable);
-};
-
-}
-
-#endif // _UI_GRAPHIC_LOG_H
-
diff --git a/include/utils/BasicHashtable.h b/include/utils/BasicHashtable.h
new file mode 100644
index 0000000..fdf9738
--- /dev/null
+++ b/include/utils/BasicHashtable.h
@@ -0,0 +1,393 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#ifndef ANDROID_BASIC_HASHTABLE_H
+#define ANDROID_BASIC_HASHTABLE_H
+
+#include <stdint.h>
+#include <sys/types.h>
+#include <utils/SharedBuffer.h>
+#include <utils/TypeHelpers.h>
+
+namespace android {
+
+/* Implementation type.  Nothing to see here. */
+class BasicHashtableImpl {
+protected:
+    struct Bucket {
+        // The collision flag indicates that the bucket is part of a collision chain
+        // such that at least two entries both hash to this bucket.  When true, we
+        // may need to seek further along the chain to find the entry.
+        static const uint32_t COLLISION = 0x80000000UL;
+
+        // The present flag indicates that the bucket contains an initialized entry value.
+        static const uint32_t PRESENT   = 0x40000000UL;
+
+        // Mask for 30 bits worth of the hash code that are stored within the bucket to
+        // speed up lookups and rehashing by eliminating the need to recalculate the
+        // hash code of the entry's key.
+        static const uint32_t HASH_MASK = 0x3fffffffUL;
+
+        // Combined value that stores the collision and present flags as well as
+        // a 30 bit hash code.
+        uint32_t cookie;
+
+        // Storage for the entry begins here.
+        char entry[0];
+    };
+
+    BasicHashtableImpl(size_t entrySize, bool hasTrivialDestructor,
+            size_t minimumInitialCapacity, float loadFactor);
+    BasicHashtableImpl(const BasicHashtableImpl& other);
+
+    void dispose();
+
+    inline void edit() {
+        if (mBuckets && !SharedBuffer::bufferFromData(mBuckets)->onlyOwner()) {
+            clone();
+        }
+    }
+
+    void setTo(const BasicHashtableImpl& other);
+    void clear();
+
+    ssize_t next(ssize_t index) const;
+    ssize_t find(ssize_t index, hash_t hash, const void* __restrict__ key) const;
+    size_t add(hash_t hash, const void* __restrict__ entry);
+    void removeAt(size_t index);
+    void rehash(size_t minimumCapacity, float loadFactor);
+
+    const size_t mBucketSize; // number of bytes per bucket including the entry
+    const bool mHasTrivialDestructor; // true if the entry type does not require destruction
+    size_t mCapacity;         // number of buckets that can be filled before exceeding load factor
+    float mLoadFactor;        // load factor
+    size_t mSize;             // number of elements actually in the table
+    size_t mFilledBuckets;    // number of buckets for which collision or present is true
+    size_t mBucketCount;      // number of slots in the mBuckets array
+    void* mBuckets;           // array of buckets, as a SharedBuffer
+
+    inline const Bucket& bucketAt(const void* __restrict__ buckets, size_t index) const {
+        return *reinterpret_cast<const Bucket*>(
+                static_cast<const uint8_t*>(buckets) + index * mBucketSize);
+    }
+
+    inline Bucket& bucketAt(void* __restrict__ buckets, size_t index) const {
+        return *reinterpret_cast<Bucket*>(static_cast<uint8_t*>(buckets) + index * mBucketSize);
+    }
+
+    virtual bool compareBucketKey(const Bucket& bucket, const void* __restrict__ key) const = 0;
+    virtual void initializeBucketEntry(Bucket& bucket, const void* __restrict__ entry) const = 0;
+    virtual void destroyBucketEntry(Bucket& bucket) const = 0;
+
+private:
+    void clone();
+
+    // Allocates a bucket array as a SharedBuffer.
+    void* allocateBuckets(size_t count) const;
+
+    // Releases a bucket array's associated SharedBuffer.
+    void releaseBuckets(void* __restrict__ buckets, size_t count) const;
+
+    // Destroys the contents of buckets (invokes destroyBucketEntry for each
+    // populated bucket if needed).
+    void destroyBuckets(void* __restrict__ buckets, size_t count) const;
+
+    // Copies the content of buckets (copies the cookie and invokes copyBucketEntry
+    // for each populated bucket if needed).
+    void copyBuckets(const void* __restrict__ fromBuckets,
+            void* __restrict__ toBuckets, size_t count) const;
+
+    // Determines the appropriate size of a bucket array to store a certain minimum
+    // number of entries and returns its effective capacity.
+    static void determineCapacity(size_t minimumCapacity, float loadFactor,
+            size_t* __restrict__ outBucketCount, size_t* __restrict__ outCapacity);
+
+    // Trim a hash code to 30 bits to match what we store in the bucket's cookie.
+    inline static hash_t trimHash(hash_t hash) {
+        return (hash & Bucket::HASH_MASK) ^ (hash >> 30);
+    }
+
+    // Returns the index of the first bucket that is in the collision chain
+    // for the specified hash code, given the total number of buckets.
+    // (Primary hash)
+    inline static size_t chainStart(hash_t hash, size_t count) {
+        return hash % count;
+    }
+
+    // Returns the increment to add to a bucket index to seek to the next bucket
+    // in the collision chain for the specified hash code, given the total number of buckets.
+    // (Secondary hash)
+    inline static size_t chainIncrement(hash_t hash, size_t count) {
+        return ((hash >> 7) | (hash << 25)) % (count - 1) + 1;
+    }
+
+    // Returns the index of the next bucket that is in the collision chain
+    // that is defined by the specified increment, given the total number of buckets.
+    inline static size_t chainSeek(size_t index, size_t increment, size_t count) {
+        return (index + increment) % count;
+    }
+};
+
+/*
+ * A BasicHashtable stores entries that are indexed by hash code in place
+ * within an array.  The basic operations are finding entries by key,
+ * adding new entries and removing existing entries.
+ *
+ * This class provides a very limited set of operations with simple semantics.
+ * It is intended to be used as a building block to construct more complex
+ * and interesting data structures such as HashMap.  Think very hard before
+ * adding anything extra to BasicHashtable, it probably belongs at a
+ * higher level of abstraction.
+ *
+ * TKey: The key type.
+ * TEntry: The entry type which is what is actually stored in the array.
+ *
+ * TKey must support the following contract:
+ *     bool operator==(const TKey& other) const;  // return true if equal
+ *     bool operator!=(const TKey& other) const;  // return true if unequal
+ *
+ * TEntry must support the following contract:
+ *     const TKey& getKey() const;  // get the key from the entry
+ *
+ * This class supports storing entries with duplicate keys.  Of course, it can't
+ * tell them apart during removal so only the first entry will be removed.
+ * We do this because it means that operations like add() can't fail.
+ */
+template <typename TKey, typename TEntry>
+class BasicHashtable : private BasicHashtableImpl {
+public:
+    /* Creates a hashtable with the specified minimum initial capacity.
+     * The underlying array will be created when the first entry is added.
+     *
+     * minimumInitialCapacity: The minimum initial capacity for the hashtable.
+     *     Default is 0.
+     * loadFactor: The desired load factor for the hashtable, between 0 and 1.
+     *     Default is 0.75.
+     */
+    BasicHashtable(size_t minimumInitialCapacity = 0, float loadFactor = 0.75f);
+
+    /* Copies a hashtable.
+     * The underlying storage is shared copy-on-write.
+     */
+    BasicHashtable(const BasicHashtable& other);
+
+    /* Clears and destroys the hashtable.
+     */
+    virtual ~BasicHashtable();
+
+    /* Making this hashtable a copy of the other hashtable.
+     * The underlying storage is shared copy-on-write.
+     *
+     * other: The hashtable to copy.
+     */
+    inline BasicHashtable<TKey, TEntry>& operator =(const BasicHashtable<TKey, TEntry> & other) {
+        setTo(other);
+        return *this;
+    }
+
+    /* Returns the number of entries in the hashtable.
+     */
+    inline size_t size() const {
+        return mSize;
+    }
+
+    /* Returns the capacity of the hashtable, which is the number of elements that can
+     * added to the hashtable without requiring it to be grown.
+     */
+    inline size_t capacity() const {
+        return mCapacity;
+    }
+
+    /* Returns the number of buckets that the hashtable has, which is the size of its
+     * underlying array.
+     */
+    inline size_t bucketCount() const {
+        return mBucketCount;
+    }
+
+    /* Returns the load factor of the hashtable. */
+    inline float loadFactor() const {
+        return mLoadFactor;
+    };
+
+    /* Returns a const reference to the entry at the specified index.
+     *
+     * index:   The index of the entry to retrieve.  Must be a valid index within
+     *          the bounds of the hashtable.
+     */
+    inline const TEntry& entryAt(size_t index) const {
+        return entryFor(bucketAt(mBuckets, index));
+    }
+
+    /* Returns a non-const reference to the entry at the specified index.
+     *
+     * index: The index of the entry to edit.  Must be a valid index within
+     *        the bounds of the hashtable.
+     */
+    inline TEntry& editEntryAt(size_t index) {
+        edit();
+        return entryFor(bucketAt(mBuckets, index));
+    }
+
+    /* Clears the hashtable.
+     * All entries in the hashtable are destroyed immediately.
+     * If you need to do something special with the entries in the hashtable then iterate
+     * over them and do what you need before clearing the hashtable.
+     */
+    inline void clear() {
+        BasicHashtableImpl::clear();
+    }
+
+    /* Returns the index of the next entry in the hashtable given the index of a previous entry.
+     * If the given index is -1, then returns the index of the first entry in the hashtable,
+     * if there is one, or -1 otherwise.
+     * If the given index is not -1, then returns the index of the next entry in the hashtable,
+     * in strictly increasing order, or -1 if there are none left.
+     *
+     * index:   The index of the previous entry that was iterated, or -1 to begin
+     *          iteration at the beginning of the hashtable.
+     */
+    inline ssize_t next(ssize_t index) const {
+        return BasicHashtableImpl::next(index);
+    }
+
+    /* Finds the index of an entry with the specified key.
+     * If the given index is -1, then returns the index of the first matching entry,
+     * otherwise returns the index of the next matching entry.
+     * If the hashtable contains multiple entries with keys that match the requested
+     * key, then the sequence of entries returned is arbitrary.
+     * Returns -1 if no entry was found.
+     *
+     * index:   The index of the previous entry with the specified key, or -1 to
+     *          find the first matching entry.
+     * hash:    The hashcode of the key.
+     * key:     The key.
+     */
+    inline ssize_t find(ssize_t index, hash_t hash, const TKey& key) const {
+        return BasicHashtableImpl::find(index, hash, &key);
+    }
+
+    /* Adds the entry to the hashtable.
+     * Returns the index of the newly added entry.
+     * If an entry with the same key already exists, then a duplicate entry is added.
+     * If the entry will not fit, then the hashtable's capacity is increased and
+     * its contents are rehashed.  See rehash().
+     *
+     * hash:    The hashcode of the key.
+     * entry:   The entry to add.
+     */
+    inline size_t add(hash_t hash, const TEntry& entry) {
+        return BasicHashtableImpl::add(hash, &entry);
+    }
+
+    /* Removes the entry with the specified index from the hashtable.
+     * The entry is destroyed immediately.
+     * The index must be valid.
+     *
+     * The hashtable is not compacted after an item is removed, so it is legal
+     * to continue iterating over the hashtable using next() or find().
+     *
+     * index:   The index of the entry to remove.  Must be a valid index within the
+     *          bounds of the hashtable, and it must refer to an existing entry.
+     */
+    inline void removeAt(size_t index) {
+        BasicHashtableImpl::removeAt(index);
+    }
+
+    /* Rehashes the contents of the hashtable.
+     * Grows the hashtable to at least the specified minimum capacity or the
+     * current number of elements, whichever is larger.
+     *
+     * Rehashing causes all entries to be copied and the entry indices may change.
+     * Although the hash codes are cached by the hashtable, rehashing can be an
+     * expensive operation and should be avoided unless the hashtable's size
+     * needs to be changed.
+     *
+     * Rehashing is the only way to change the capacity or load factor of the
+     * hashtable once it has been created.  It can be used to compact the
+     * hashtable by choosing a minimum capacity that is smaller than the current
+     * capacity (such as 0).
+     *
+     * minimumCapacity: The desired minimum capacity after rehashing.
+     * loadFactor: The desired load factor after rehashing.
+     */
+    inline void rehash(size_t minimumCapacity, float loadFactor) {
+        BasicHashtableImpl::rehash(minimumCapacity, loadFactor);
+    }
+
+protected:
+    static inline const TEntry& entryFor(const Bucket& bucket) {
+        return reinterpret_cast<const TEntry&>(bucket.entry);
+    }
+
+    static inline TEntry& entryFor(Bucket& bucket) {
+        return reinterpret_cast<TEntry&>(bucket.entry);
+    }
+
+    virtual bool compareBucketKey(const Bucket& bucket, const void* __restrict__ key) const;
+    virtual void initializeBucketEntry(Bucket& bucket, const void* __restrict__ entry) const;
+    virtual void destroyBucketEntry(Bucket& bucket) const;
+
+private:
+    // For dumping the raw contents of a hashtable during testing.
+    friend class BasicHashtableTest;
+    inline uint32_t cookieAt(size_t index) const {
+        return bucketAt(mBuckets, index).cookie;
+    }
+};
+
+template <typename TKey, typename TEntry>
+BasicHashtable<TKey, TEntry>::BasicHashtable(size_t minimumInitialCapacity, float loadFactor) :
+        BasicHashtableImpl(sizeof(TEntry), traits<TEntry>::has_trivial_dtor,
+                minimumInitialCapacity, loadFactor) {
+}
+
+template <typename TKey, typename TEntry>
+BasicHashtable<TKey, TEntry>::BasicHashtable(const BasicHashtable<TKey, TEntry>& other) :
+        BasicHashtableImpl(other) {
+}
+
+template <typename TKey, typename TEntry>
+BasicHashtable<TKey, TEntry>::~BasicHashtable() {
+    dispose();
+}
+
+template <typename TKey, typename TEntry>
+bool BasicHashtable<TKey, TEntry>::compareBucketKey(const Bucket& bucket,
+        const void* __restrict__ key) const {
+    return entryFor(bucket).getKey() == *static_cast<const TKey*>(key);
+}
+
+template <typename TKey, typename TEntry>
+void BasicHashtable<TKey, TEntry>::initializeBucketEntry(Bucket& bucket,
+        const void* __restrict__ entry) const {
+    if (!traits<TEntry>::has_trivial_copy) {
+        new (&entryFor(bucket)) TEntry(*(static_cast<const TEntry*>(entry)));
+    } else {
+        memcpy(&entryFor(bucket), entry, sizeof(TEntry));
+    }
+}
+
+template <typename TKey, typename TEntry>
+void BasicHashtable<TKey, TEntry>::destroyBucketEntry(Bucket& bucket) const {
+    if (!traits<TEntry>::has_trivial_dtor) {
+        entryFor(bucket).~TEntry();
+    }
+}
+
+}; // namespace android
+
+#endif // ANDROID_BASIC_HASHTABLE_H
diff --git a/include/utils/CallStack.h b/include/utils/CallStack.h
index 8817120..079e20c 100644
--- a/include/utils/CallStack.h
+++ b/include/utils/CallStack.h
@@ -21,6 +21,7 @@
 #include <sys/types.h>
 
 #include <utils/String8.h>
+#include <corkscrew/backtrace.h>
 
 // ---------------------------------------------------------------------------
 
@@ -61,11 +62,8 @@
     size_t size() const { return mCount; }
 
 private:
-    // Internal helper function
-    String8 toStringSingleLevel(const char* prefix, int32_t level) const;
-
-    size_t      mCount;
-    const void* mStack[MAX_DEPTH];
+    size_t mCount;
+    backtrace_frame_t mStack[MAX_DEPTH];
 };
 
 }; // namespace android
diff --git a/include/utils/GenerationCache.h b/include/utils/GenerationCache.h
index bb9ddd6..40722d1 100644
--- a/include/utils/GenerationCache.h
+++ b/include/utils/GenerationCache.h
@@ -34,17 +34,17 @@
 
 template<typename EntryKey, typename EntryValue>
 struct Entry: public LightRefBase<Entry<EntryKey, EntryValue> > {
-    Entry() { }
-    Entry(const Entry<EntryKey, EntryValue>& e):
-            key(e.key), value(e.value), parent(e.parent), child(e.child) { }
-    Entry(sp<Entry<EntryKey, EntryValue> > e):
-            key(e->key), value(e->value), parent(e->parent), child(e->child) { }
+    Entry(const Entry<EntryKey, EntryValue>& e) :
+            key(e.key), value(e.value),
+            parent(e.parent), child(e.child) { }
+    Entry(const EntryKey& key, const EntryValue& value) :
+            key(key), value(value) { }
 
     EntryKey key;
     EntryValue value;
 
-    sp<Entry<EntryKey, EntryValue> > parent;
-    sp<Entry<EntryKey, EntryValue> > child;
+    sp<Entry<EntryKey, EntryValue> > parent; // next older entry
+    sp<Entry<EntryKey, EntryValue> > child;  // next younger entry
 }; // struct Entry
 
 /**
@@ -62,23 +62,20 @@
 
     void setOnEntryRemovedListener(OnEntryRemoved<K, V>* listener);
 
+    size_t size() const;
+
     void clear();
 
-    bool contains(K key) const;
-    V get(K key);
-    K getKeyAt(uint32_t index) const;
-    bool put(K key, V value);
-    V remove(K key);
-    V removeOldest();
-    V getValueAt(uint32_t index) const;
+    bool contains(const K& key) const;
+    const K& getKeyAt(size_t index) const;
+    const V& getValueAt(size_t index) const;
 
-    uint32_t size() const;
+    const V& get(const K& key);
+    bool put(const K& key, const V& value);
 
-    void addToCache(sp<Entry<K, V> > entry, K key, V value);
-    void attachToCache(sp<Entry<K, V> > entry);
-    void detachFromCache(sp<Entry<K, V> > entry);
-
-    V removeAt(ssize_t index);
+    void removeAt(ssize_t index);
+    bool remove(const K& key);
+    bool removeOldest();
 
 private:
     KeyedVector<K, sp<Entry<K, V> > > mCache;
@@ -88,11 +85,16 @@
 
     sp<Entry<K, V> > mOldest;
     sp<Entry<K, V> > mYoungest;
+
+    void attachToCache(const sp<Entry<K, V> >& entry);
+    void detachFromCache(const sp<Entry<K, V> >& entry);
+
+    const V mNullValue;
 }; // class GenerationCache
 
 template<typename K, typename V>
 GenerationCache<K, V>::GenerationCache(uint32_t maxCapacity): mMaxCapacity(maxCapacity),
-    mListener(NULL) {
+    mListener(NULL), mNullValue(NULL) {
 };
 
 template<typename K, typename V>
@@ -130,45 +132,44 @@
 }
 
 template<typename K, typename V>
-bool GenerationCache<K, V>::contains(K key) const {
+bool GenerationCache<K, V>::contains(const K& key) const {
     return mCache.indexOfKey(key) >= 0;
 }
 
 template<typename K, typename V>
-K GenerationCache<K, V>::getKeyAt(uint32_t index) const {
+const K& GenerationCache<K, V>::getKeyAt(size_t index) const {
     return mCache.keyAt(index);
 }
 
 template<typename K, typename V>
-V GenerationCache<K, V>::getValueAt(uint32_t index) const {
+const V& GenerationCache<K, V>::getValueAt(size_t index) const {
     return mCache.valueAt(index)->value;
 }
 
 template<typename K, typename V>
-V GenerationCache<K, V>::get(K key) {
+const V& GenerationCache<K, V>::get(const K& key) {
     ssize_t index = mCache.indexOfKey(key);
     if (index >= 0) {
-        sp<Entry<K, V> > entry = mCache.valueAt(index);
-        if (entry.get()) {
-            detachFromCache(entry);
-            attachToCache(entry);
-            return entry->value;
-        }
+        const sp<Entry<K, V> >& entry = mCache.valueAt(index);
+        detachFromCache(entry);
+        attachToCache(entry);
+        return entry->value;
     }
 
-    return NULL;
+    return mNullValue;
 }
 
 template<typename K, typename V>
-bool GenerationCache<K, V>::put(K key, V value) {
+bool GenerationCache<K, V>::put(const K& key, const V& value) {
     if (mMaxCapacity != kUnlimitedCapacity && mCache.size() >= mMaxCapacity) {
         removeOldest();
     }
 
     ssize_t index = mCache.indexOfKey(key);
     if (index < 0) {
-        sp<Entry<K, V> > entry = new Entry<K, V>;
-        addToCache(entry, key, value);
+        sp<Entry<K, V> > entry = new Entry<K, V>(key, value);
+        mCache.add(key, entry);
+        attachToCache(entry);
         return true;
     }
 
@@ -176,49 +177,44 @@
 }
 
 template<typename K, typename V>
-void GenerationCache<K, V>::addToCache(sp<Entry<K, V> > entry, K key, V value) {
-    entry->key = key;
-    entry->value = value;
-    mCache.add(key, entry);
-    attachToCache(entry);
-}
-
-template<typename K, typename V>
-V GenerationCache<K, V>::remove(K key) {
+bool GenerationCache<K, V>::remove(const K& key) {
     ssize_t index = mCache.indexOfKey(key);
     if (index >= 0) {
-        return removeAt(index);
+        removeAt(index);
+        return true;
     }
 
-    return NULL;
+    return false;
 }
 
 template<typename K, typename V>
-V GenerationCache<K, V>::removeAt(ssize_t index) {
+void GenerationCache<K, V>::removeAt(ssize_t index) {
     sp<Entry<K, V> > entry = mCache.valueAt(index);
     if (mListener) {
         (*mListener)(entry->key, entry->value);
     }
     mCache.removeItemsAt(index, 1);
     detachFromCache(entry);
-
-    return entry->value;
 }
 
 template<typename K, typename V>
-V GenerationCache<K, V>::removeOldest() {
+bool GenerationCache<K, V>::removeOldest() {
     if (mOldest.get()) {
         ssize_t index = mCache.indexOfKey(mOldest->key);
         if (index >= 0) {
-            return removeAt(index);
+            removeAt(index);
+            return true;
         }
+        ALOGE("GenerationCache: removeOldest failed to find the item in the cache "
+                "with the given key, but we know it must be in there.  "
+                "Is the key comparator kaput?");
     }
 
-    return NULL;
+    return false;
 }
 
 template<typename K, typename V>
-void GenerationCache<K, V>::attachToCache(sp<Entry<K, V> > entry) {
+void GenerationCache<K, V>::attachToCache(const sp<Entry<K, V> >& entry) {
     if (!mYoungest.get()) {
         mYoungest = mOldest = entry;
     } else {
@@ -229,20 +225,16 @@
 }
 
 template<typename K, typename V>
-void GenerationCache<K, V>::detachFromCache(sp<Entry<K, V> > entry) {
+void GenerationCache<K, V>::detachFromCache(const sp<Entry<K, V> >& entry) {
     if (entry->parent.get()) {
         entry->parent->child = entry->child;
+    } else {
+        mOldest = entry->child;
     }
 
     if (entry->child.get()) {
         entry->child->parent = entry->parent;
-    }
-
-    if (mOldest == entry) {
-        mOldest = entry->child;
-    }
-
-    if (mYoungest == entry) {
+    } else {
         mYoungest = entry->parent;
     }
 
diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h
index 71e5324..b741ed6 100644
--- a/include/utils/ResourceTypes.h
+++ b/include/utils/ResourceTypes.h
@@ -843,6 +843,8 @@
         DENSITY_MEDIUM = ACONFIGURATION_DENSITY_MEDIUM,
         DENSITY_TV = ACONFIGURATION_DENSITY_TV,
         DENSITY_HIGH = ACONFIGURATION_DENSITY_HIGH,
+        DENSITY_XHIGH = ACONFIGURATION_DENSITY_XHIGH,
+        DENSITY_XXHIGH = ACONFIGURATION_DENSITY_XXHIGH,
         DENSITY_NONE = ACONFIGURATION_DENSITY_NONE
     };
     
@@ -955,6 +957,7 @@
         UI_MODE_TYPE_DESK = ACONFIGURATION_UI_MODE_TYPE_DESK,
         UI_MODE_TYPE_CAR = ACONFIGURATION_UI_MODE_TYPE_CAR,
         UI_MODE_TYPE_TELEVISION = ACONFIGURATION_UI_MODE_TYPE_TELEVISION,
+        UI_MODE_TYPE_APPLIANCE = ACONFIGURATION_UI_MODE_TYPE_APPLIANCE,
 
         // uiMode bits for the night switch.
         MASK_UI_MODE_NIGHT = 0x30,
diff --git a/include/utils/TypeHelpers.h b/include/utils/TypeHelpers.h
index a1663f3..1f2c2d5 100644
--- a/include/utils/TypeHelpers.h
+++ b/include/utils/TypeHelpers.h
@@ -213,6 +213,9 @@
 
 template <typename KEY, typename VALUE>
 struct key_value_pair_t {
+    typedef KEY key_t;
+    typedef VALUE value_t;
+
     KEY     key;
     VALUE   value;
     key_value_pair_t() { }
@@ -222,27 +225,64 @@
     inline bool operator < (const key_value_pair_t& o) const {
         return strictly_order_type(key, o.key);
     }
+    inline const KEY& getKey() const {
+        return key;
+    }
+    inline const VALUE& getValue() const {
+        return value;
+    }
 };
 
-template<>
 template <typename K, typename V>
 struct trait_trivial_ctor< key_value_pair_t<K, V> >
 { enum { value = aggregate_traits<K,V>::has_trivial_ctor }; };
-template<> 
 template <typename K, typename V>
 struct trait_trivial_dtor< key_value_pair_t<K, V> >
 { enum { value = aggregate_traits<K,V>::has_trivial_dtor }; };
-template<> 
 template <typename K, typename V>
 struct trait_trivial_copy< key_value_pair_t<K, V> >
 { enum { value = aggregate_traits<K,V>::has_trivial_copy }; };
-template<> 
 template <typename K, typename V>
 struct trait_trivial_move< key_value_pair_t<K, V> >
 { enum { value = aggregate_traits<K,V>::has_trivial_move }; };
 
 // ---------------------------------------------------------------------------
 
+/*
+ * Hash codes.
+ */
+typedef uint32_t hash_t;
+
+template <typename TKey>
+hash_t hash_type(const TKey& key);
+
+/* Built-in hash code specializations.
+ * Assumes pointers are 32bit. */
+#define ANDROID_INT32_HASH(T) \
+        template <> inline hash_t hash_type(const T& value) { return hash_t(value); }
+#define ANDROID_INT64_HASH(T) \
+        template <> inline hash_t hash_type(const T& value) { \
+                return hash_t((value >> 32) ^ value); }
+#define ANDROID_REINTERPRET_HASH(T, R) \
+        template <> inline hash_t hash_type(const T& value) { \
+                return hash_type(*reinterpret_cast<const R*>(&value)); }
+
+ANDROID_INT32_HASH(bool)
+ANDROID_INT32_HASH(int8_t)
+ANDROID_INT32_HASH(uint8_t)
+ANDROID_INT32_HASH(int16_t)
+ANDROID_INT32_HASH(uint16_t)
+ANDROID_INT32_HASH(int32_t)
+ANDROID_INT32_HASH(uint32_t)
+ANDROID_INT64_HASH(int64_t)
+ANDROID_INT64_HASH(uint64_t)
+ANDROID_REINTERPRET_HASH(float, uint32_t)
+ANDROID_REINTERPRET_HASH(double, uint64_t)
+
+template <typename T> inline hash_t hash_type(const T*& value) {
+    return hash_type(uintptr_t(value));
+}
+
 }; // namespace android
 
 // ---------------------------------------------------------------------------
diff --git a/libs/binder/MemoryDealer.cpp b/libs/binder/MemoryDealer.cpp
index ff5e6bd..8d0e0a7 100644
--- a/libs/binder/MemoryDealer.cpp
+++ b/libs/binder/MemoryDealer.cpp
@@ -180,7 +180,6 @@
         /* NOTE: it's VERY important to not free allocations of size 0 because
          * they're special as they don't have any record in the allocator
          * and could alias some real allocation (their offset is zero). */
-        mDealer->deallocate(freedOffset);
 
         // keep the size to unmap in excess
         size_t pagesize = getpagesize();
@@ -216,6 +215,11 @@
             }
 #endif
         }
+
+        // This should be done after madvise(MADV_REMOVE), otherwise madvise()
+        // might kick out the memory region that's allocated and/or written
+        // right after the deallocation.
+        mDealer->deallocate(freedOffset);
     }
 }
 
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 3400e97..dea14bb 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -722,7 +722,15 @@
 
 status_t Parcel::writeDupFileDescriptor(int fd)
 {
-    return writeFileDescriptor(dup(fd), true /*takeOwnership*/);
+    int dupFd = dup(fd);
+    if (dupFd < 0) {
+        return -errno;
+    }
+    status_t err = writeFileDescriptor(dupFd, true /*takeOwnership*/);
+    if (err) {
+        close(dupFd);
+    }
+    return err;
 }
 
 status_t Parcel::writeBlob(size_t len, WritableBlob* outBlob)
diff --git a/libs/gui/Android.mk b/libs/gui/Android.mk
index 9767568..b6f5b9e 100644
--- a/libs/gui/Android.mk
+++ b/libs/gui/Android.mk
@@ -2,11 +2,13 @@
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES:= \
+	BitTube.cpp \
+	DisplayEventReceiver.cpp \
+	IDisplayEventConnection.cpp \
 	ISensorEventConnection.cpp \
 	ISensorServer.cpp \
 	ISurfaceTexture.cpp \
 	Sensor.cpp \
-	SensorChannel.cpp \
 	SensorEventQueue.cpp \
 	SensorManager.cpp \
 	SurfaceTexture.cpp \
@@ -32,6 +34,13 @@
 
 LOCAL_MODULE:= libgui
 
+ifeq ($(TARGET_BOARD_PLATFORM), omap4)
+	LOCAL_CFLAGS += -DUSE_FENCE_SYNC
+endif
+ifeq ($(TARGET_BOARD_PLATFORM), s5pc110)
+	LOCAL_CFLAGS += -DUSE_FENCE_SYNC
+endif
+
 ifeq ($(TARGET_BOARD_PLATFORM), tegra)
 	LOCAL_CFLAGS += -DALLOW_DEQUEUE_CURRENT_BUFFER
 endif
diff --git a/libs/gui/BitTube.cpp b/libs/gui/BitTube.cpp
new file mode 100644
index 0000000..785da39
--- /dev/null
+++ b/libs/gui/BitTube.cpp
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2010 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 <stdint.h>
+#include <sys/types.h>
+
+#include <unistd.h>
+#include <fcntl.h>
+
+#include <utils/Errors.h>
+
+#include <binder/Parcel.h>
+
+#include <gui/BitTube.h>
+
+namespace android {
+// ----------------------------------------------------------------------------
+
+BitTube::BitTube()
+    : mSendFd(-1), mReceiveFd(-1)
+{
+    int fds[2];
+    if (pipe(fds) == 0) {
+        mReceiveFd = fds[0];
+        mSendFd = fds[1];
+        fcntl(mReceiveFd, F_SETFL, O_NONBLOCK);
+        fcntl(mSendFd, F_SETFL, O_NONBLOCK);
+    } else {
+        mReceiveFd = -errno;
+        ALOGE("BitTube: pipe creation failed (%s)", strerror(-mReceiveFd));
+    }
+}
+
+BitTube::BitTube(const Parcel& data)
+    : mSendFd(-1), mReceiveFd(-1)
+{
+    mReceiveFd = dup(data.readFileDescriptor());
+    if (mReceiveFd >= 0) {
+        fcntl(mReceiveFd, F_SETFL, O_NONBLOCK);
+    } else {
+        mReceiveFd = -errno;
+        ALOGE("BitTube(Parcel): can't dup filedescriptor (%s)",
+                strerror(-mReceiveFd));
+    }
+}
+
+BitTube::~BitTube()
+{
+    if (mSendFd >= 0)
+        close(mSendFd);
+
+    if (mReceiveFd >= 0)
+        close(mReceiveFd);
+}
+
+status_t BitTube::initCheck() const
+{
+    if (mReceiveFd < 0) {
+        return status_t(mReceiveFd);
+    }
+    return NO_ERROR;
+}
+
+int BitTube::getFd() const
+{
+    return mReceiveFd;
+}
+
+ssize_t BitTube::write(void const* vaddr, size_t size)
+{
+    ssize_t err, len;
+    do {
+        len = ::write(mSendFd, vaddr, size);
+        err = len < 0 ? errno : 0;
+    } while (err == EINTR);
+    return err == 0 ? len : -err;
+
+}
+
+ssize_t BitTube::read(void* vaddr, size_t size)
+{
+    ssize_t err, len;
+    do {
+        len = ::read(mReceiveFd, vaddr, size);
+        err = len < 0 ? errno : 0;
+    } while (err == EINTR);
+    if (err == EAGAIN || err == EWOULDBLOCK) {
+        // EAGAIN means that we have non-blocking I/O but there was
+        // no data to be read. Nothing the client should care about.
+        return 0;
+    }
+    return err == 0 ? len : -err;
+}
+
+status_t BitTube::writeToParcel(Parcel* reply) const
+{
+    if (mReceiveFd < 0)
+        return -EINVAL;
+
+    status_t result = reply->writeDupFileDescriptor(mReceiveFd);
+    close(mReceiveFd);
+    mReceiveFd = -1;
+    return result;
+}
+
+// ----------------------------------------------------------------------------
+}; // namespace android
diff --git a/libs/gui/DisplayEventReceiver.cpp b/libs/gui/DisplayEventReceiver.cpp
new file mode 100644
index 0000000..3b3ccaa
--- /dev/null
+++ b/libs/gui/DisplayEventReceiver.cpp
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2011 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 <string.h>
+
+#include <utils/Errors.h>
+
+#include <gui/BitTube.h>
+#include <gui/DisplayEventReceiver.h>
+#include <gui/IDisplayEventConnection.h>
+
+#include <private/gui/ComposerService.h>
+
+#include <surfaceflinger/ISurfaceComposer.h>
+
+// ---------------------------------------------------------------------------
+
+namespace android {
+
+// ---------------------------------------------------------------------------
+
+DisplayEventReceiver::DisplayEventReceiver() {
+    sp<ISurfaceComposer> sf(ComposerService::getComposerService());
+    if (sf != NULL) {
+        mEventConnection = sf->createDisplayEventConnection();
+        if (mEventConnection != NULL) {
+            mDataChannel = mEventConnection->getDataChannel();
+        }
+    }
+}
+
+DisplayEventReceiver::~DisplayEventReceiver() {
+}
+
+status_t DisplayEventReceiver::initCheck() const {
+    if (mDataChannel != NULL)
+        return NO_ERROR;
+    return NO_INIT;
+}
+
+int DisplayEventReceiver::getFd() const {
+    if (mDataChannel == NULL)
+        return NO_INIT;
+
+    return mDataChannel->getFd();
+}
+
+status_t DisplayEventReceiver::setVsyncRate(uint32_t count) {
+    if (int32_t(count) < 0)
+        return BAD_VALUE;
+
+    if (mEventConnection != NULL) {
+        mEventConnection->setVsyncRate(count);
+        return NO_ERROR;
+    }
+    return NO_INIT;
+}
+
+status_t DisplayEventReceiver::requestNextVsync() {
+    if (mEventConnection != NULL) {
+        mEventConnection->requestNextVsync();
+        return NO_ERROR;
+    }
+    return NO_INIT;
+}
+
+
+ssize_t DisplayEventReceiver::getEvents(DisplayEventReceiver::Event* events,
+        size_t count) {
+    ssize_t size = mDataChannel->read(events, sizeof(events[0])*count);
+    ALOGE_IF(size<0,
+            "DisplayEventReceiver::getEvents error (%s)",
+            strerror(-size));
+    if (size >= 0) {
+        // Note: if (size % sizeof(events[0])) != 0, we've got a
+        // partial read. This can happen if the queue filed up (ie: if we
+        // didn't pull from it fast enough).
+        // We discard the partial event and rely on the sender to
+        // re-send the event if appropriate (some events, like VSYNC
+        // can be lost forever).
+
+        // returns number of events read
+        size /= sizeof(events[0]);
+    }
+    return size;
+}
+
+// ---------------------------------------------------------------------------
+
+}; // namespace android
diff --git a/libs/gui/IDisplayEventConnection.cpp b/libs/gui/IDisplayEventConnection.cpp
new file mode 100644
index 0000000..887d176
--- /dev/null
+++ b/libs/gui/IDisplayEventConnection.cpp
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2011 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 <stdint.h>
+#include <sys/types.h>
+
+#include <utils/Errors.h>
+#include <utils/RefBase.h>
+#include <utils/Timers.h>
+
+#include <binder/Parcel.h>
+#include <binder/IInterface.h>
+
+#include <gui/IDisplayEventConnection.h>
+#include <gui/BitTube.h>
+
+namespace android {
+// ----------------------------------------------------------------------------
+
+enum {
+    GET_DATA_CHANNEL = IBinder::FIRST_CALL_TRANSACTION,
+    SET_VSYNC_RATE,
+    REQUEST_NEXT_VSYNC
+};
+
+class BpDisplayEventConnection : public BpInterface<IDisplayEventConnection>
+{
+public:
+    BpDisplayEventConnection(const sp<IBinder>& impl)
+        : BpInterface<IDisplayEventConnection>(impl)
+    {
+    }
+
+    virtual sp<BitTube> getDataChannel() const
+    {
+        Parcel data, reply;
+        data.writeInterfaceToken(IDisplayEventConnection::getInterfaceDescriptor());
+        remote()->transact(GET_DATA_CHANNEL, data, &reply);
+        return new BitTube(reply);
+    }
+
+    virtual void setVsyncRate(uint32_t count) {
+        Parcel data, reply;
+        data.writeInterfaceToken(IDisplayEventConnection::getInterfaceDescriptor());
+        data.writeInt32(count);
+        remote()->transact(SET_VSYNC_RATE, data, &reply);
+    }
+
+    virtual void requestNextVsync() {
+        Parcel data, reply;
+        data.writeInterfaceToken(IDisplayEventConnection::getInterfaceDescriptor());
+        remote()->transact(REQUEST_NEXT_VSYNC, data, &reply, IBinder::FLAG_ONEWAY);
+    }
+};
+
+IMPLEMENT_META_INTERFACE(DisplayEventConnection, "android.gui.DisplayEventConnection");
+
+// ----------------------------------------------------------------------------
+
+status_t BnDisplayEventConnection::onTransact(
+    uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
+{
+    switch(code) {
+        case GET_DATA_CHANNEL: {
+            CHECK_INTERFACE(IDisplayEventConnection, data, reply);
+            sp<BitTube> channel(getDataChannel());
+            channel->writeToParcel(reply);
+            return NO_ERROR;
+        } break;
+        case SET_VSYNC_RATE: {
+            CHECK_INTERFACE(IDisplayEventConnection, data, reply);
+            setVsyncRate(data.readInt32());
+            return NO_ERROR;
+        } break;
+        case REQUEST_NEXT_VSYNC: {
+            CHECK_INTERFACE(IDisplayEventConnection, data, reply);
+            requestNextVsync();
+            return NO_ERROR;
+        } break;
+    }
+    return BBinder::onTransact(code, data, reply, flags);
+}
+
+// ----------------------------------------------------------------------------
+}; // namespace android
diff --git a/libs/gui/ISensorEventConnection.cpp b/libs/gui/ISensorEventConnection.cpp
index a5083fe..0e51e8e 100644
--- a/libs/gui/ISensorEventConnection.cpp
+++ b/libs/gui/ISensorEventConnection.cpp
@@ -25,7 +25,7 @@
 #include <binder/IInterface.h>
 
 #include <gui/ISensorEventConnection.h>
-#include <gui/SensorChannel.h>
+#include <gui/BitTube.h>
 
 namespace android {
 // ----------------------------------------------------------------------------
@@ -44,12 +44,12 @@
     {
     }
 
-    virtual sp<SensorChannel> getSensorChannel() const
+    virtual sp<BitTube> getSensorChannel() const
     {
         Parcel data, reply;
         data.writeInterfaceToken(ISensorEventConnection::getInterfaceDescriptor());
         remote()->transact(GET_SENSOR_CHANNEL, data, &reply);
-        return new SensorChannel(reply);
+        return new BitTube(reply);
     }
 
     virtual status_t enableDisable(int handle, bool enabled)
@@ -83,7 +83,7 @@
     switch(code) {
         case GET_SENSOR_CHANNEL: {
             CHECK_INTERFACE(ISensorEventConnection, data, reply);
-            sp<SensorChannel> channel(getSensorChannel());
+            sp<BitTube> channel(getSensorChannel());
             channel->writeToParcel(reply);
             return NO_ERROR;
         } break;
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp
index b1b9adb..95b2379 100644
--- a/libs/gui/ISurfaceComposer.cpp
+++ b/libs/gui/ISurfaceComposer.cpp
@@ -29,6 +29,9 @@
 
 #include <surfaceflinger/ISurfaceComposer.h>
 
+#include <gui/BitTube.h>
+#include <gui/IDisplayEventConnection.h>
+
 #include <ui/DisplayInfo.h>
 
 #include <gui/ISurfaceTexture.h>
@@ -37,13 +40,10 @@
 
 // ---------------------------------------------------------------------------
 
-#define LIKELY( exp )       (__builtin_expect( (exp) != 0, true  ))
-#define UNLIKELY( exp )     (__builtin_expect( (exp) != 0, false ))
-
-// ---------------------------------------------------------------------------
-
 namespace android {
 
+class IDisplayEventConnection;
+
 class BpSurfaceComposer : public BpInterface<ISurfaceComposer>
 {
 public:
@@ -174,6 +174,27 @@
         }
         return result != 0;
     }
+
+    virtual sp<IDisplayEventConnection> createDisplayEventConnection()
+    {
+        Parcel data, reply;
+        sp<IDisplayEventConnection> result;
+        int err = data.writeInterfaceToken(
+                ISurfaceComposer::getInterfaceDescriptor());
+        if (err != NO_ERROR) {
+            return result;
+        }
+        err = remote()->transact(
+                BnSurfaceComposer::CREATE_DISPLAY_EVENT_CONNECTION,
+                data, &reply);
+        if (err != NO_ERROR) {
+            ALOGE("ISurfaceComposer::createDisplayEventConnection: error performing "
+                    "transaction: %s (%d)", strerror(-err), -err);
+            return result;
+        }
+        result = interface_cast<IDisplayEventConnection>(reply.readStrongBinder());
+        return result;
+    }
 };
 
 IMPLEMENT_META_INTERFACE(SurfaceComposer, "android.ui.ISurfaceComposer");
@@ -254,6 +275,12 @@
             int32_t result = authenticateSurfaceTexture(surfaceTexture) ? 1 : 0;
             reply->writeInt32(result);
         } break;
+        case CREATE_DISPLAY_EVENT_CONNECTION: {
+            CHECK_INTERFACE(ISurfaceComposer, data, reply);
+            sp<IDisplayEventConnection> connection(createDisplayEventConnection());
+            reply->writeStrongBinder(connection->asBinder());
+            return NO_ERROR;
+        } break;
         default:
             return BBinder::onTransact(code, data, reply, flags);
     }
diff --git a/libs/gui/ISurfaceComposerClient.cpp b/libs/gui/ISurfaceComposerClient.cpp
index ace16aa..8fe96b1 100644
--- a/libs/gui/ISurfaceComposerClient.cpp
+++ b/libs/gui/ISurfaceComposerClient.cpp
@@ -35,18 +35,6 @@
 
 // ---------------------------------------------------------------------------
 
-/* ideally AID_GRAPHICS would be in a semi-public header
- * or there would be a way to map a user/group name to its id
- */
-#ifndef AID_GRAPHICS
-#define AID_GRAPHICS 1003
-#endif
-
-#define LIKELY( exp )       (__builtin_expect( (exp) != 0, true  ))
-#define UNLIKELY( exp )     (__builtin_expect( (exp) != 0, false ))
-
-// ---------------------------------------------------------------------------
-
 namespace android {
 
 enum {
diff --git a/libs/gui/SensorChannel.cpp b/libs/gui/SensorChannel.cpp
deleted file mode 100644
index 147e1c2..0000000
--- a/libs/gui/SensorChannel.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2010 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 <stdint.h>
-#include <sys/types.h>
-
-#include <unistd.h>
-#include <fcntl.h>
-
-#include <utils/Errors.h>
-
-#include <binder/Parcel.h>
-
-#include <gui/SensorChannel.h>
-
-namespace android {
-// ----------------------------------------------------------------------------
-
-SensorChannel::SensorChannel()
-    : mSendFd(-1), mReceiveFd(-1)
-{
-    int fds[2];
-    if (pipe(fds) == 0) {
-        mReceiveFd = fds[0];
-        mSendFd = fds[1];
-        fcntl(mReceiveFd, F_SETFL, O_NONBLOCK);
-        fcntl(mSendFd, F_SETFL, O_NONBLOCK);
-    }
-}
-
-SensorChannel::SensorChannel(const Parcel& data)
-    : mSendFd(-1), mReceiveFd(-1)
-{
-    mReceiveFd = dup(data.readFileDescriptor());
-    fcntl(mReceiveFd, F_SETFL, O_NONBLOCK);
-}
-
-SensorChannel::~SensorChannel()
-{
-    if (mSendFd >= 0)
-        close(mSendFd);
-
-    if (mReceiveFd >= 0)
-        close(mReceiveFd);
-}
-
-int SensorChannel::getFd() const
-{
-    return mReceiveFd;
-}
-
-ssize_t SensorChannel::write(void const* vaddr, size_t size)
-{
-    ssize_t len = ::write(mSendFd, vaddr, size);
-    if (len < 0)
-        return -errno;
-    return len;
-}
-
-ssize_t SensorChannel::read(void* vaddr, size_t size)
-{
-    ssize_t len = ::read(mReceiveFd, vaddr, size);
-    if (len < 0)
-        return -errno;
-    return len;
-}
-
-status_t SensorChannel::writeToParcel(Parcel* reply) const
-{
-    if (mReceiveFd < 0)
-        return -EINVAL;
-
-    status_t result = reply->writeDupFileDescriptor(mReceiveFd);
-    close(mReceiveFd);
-    mReceiveFd = -1;
-    return result;
-}
-
-// ----------------------------------------------------------------------------
-}; // namespace android
diff --git a/libs/gui/SensorEventQueue.cpp b/libs/gui/SensorEventQueue.cpp
index ac362fc..b95dd90 100644
--- a/libs/gui/SensorEventQueue.cpp
+++ b/libs/gui/SensorEventQueue.cpp
@@ -24,7 +24,7 @@
 #include <utils/Looper.h>
 
 #include <gui/Sensor.h>
-#include <gui/SensorChannel.h>
+#include <gui/BitTube.h>
 #include <gui/SensorEventQueue.h>
 #include <gui/ISensorEventConnection.h>
 
@@ -104,7 +104,7 @@
     do {
         result = looper->pollOnce(-1);
         if (result == ALOOPER_EVENT_ERROR) {
-            ALOGE("SensorChannel::waitForEvent error (errno=%d)", errno);
+            ALOGE("SensorEventQueue::waitForEvent error (errno=%d)", errno);
             result = -EPIPE; // unknown error, so we make up one
             break;
         }
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 4ad6c22..699438c 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -39,6 +39,7 @@
 #include <private/surfaceflinger/LayerState.h>
 #include <private/surfaceflinger/SharedBufferStack.h>
 
+#include <private/gui/ComposerService.h>
 
 namespace android {
 // ---------------------------------------------------------------------------
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index c80d93d..3abe84a 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -29,6 +29,8 @@
 
 #include <hardware/hardware.h>
 
+#include <private/gui/ComposerService.h>
+
 #include <surfaceflinger/ISurfaceComposer.h>
 #include <surfaceflinger/SurfaceComposerClient.h>
 #include <surfaceflinger/IGraphicBufferAlloc.h>
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp
index 5f01ae9..d0934ba 100644
--- a/libs/gui/SurfaceTextureClient.cpp
+++ b/libs/gui/SurfaceTextureClient.cpp
@@ -23,6 +23,8 @@
 
 #include <utils/Log.h>
 
+#include <private/gui/ComposerService.h>
+
 namespace android {
 
 SurfaceTextureClient::SurfaceTextureClient(
diff --git a/libs/gui/tests/Surface_test.cpp b/libs/gui/tests/Surface_test.cpp
index 693b7b8..ea52750 100644
--- a/libs/gui/tests/Surface_test.cpp
+++ b/libs/gui/tests/Surface_test.cpp
@@ -22,6 +22,8 @@
 #include <surfaceflinger/SurfaceComposerClient.h>
 #include <utils/String8.h>
 
+#include <private/gui/ComposerService.h>
+
 namespace android {
 
 class SurfaceTest : public ::testing::Test {
diff --git a/libs/ui/Android.mk b/libs/ui/Android.mk
index fbabfc4..f8b4452 100644
--- a/libs/ui/Android.mk
+++ b/libs/ui/Android.mk
@@ -47,7 +47,6 @@
 	GraphicBuffer.cpp \
 	GraphicBufferAllocator.cpp \
 	GraphicBufferMapper.cpp \
-	GraphicLog.cpp \
 	InputTransport.cpp \
 	PixelFormat.cpp \
 	Rect.cpp \
diff --git a/libs/ui/FramebufferNativeWindow.cpp b/libs/ui/FramebufferNativeWindow.cpp
index f5ed981..d1dca0c 100644
--- a/libs/ui/FramebufferNativeWindow.cpp
+++ b/libs/ui/FramebufferNativeWindow.cpp
@@ -29,7 +29,6 @@
 
 #include <ui/Rect.h>
 #include <ui/FramebufferNativeWindow.h>
-#include <ui/GraphicLog.h>
 
 #include <EGL/egl.h>
 
@@ -211,9 +210,6 @@
     if (self->mBufferHead >= self->mNumBuffers)
         self->mBufferHead = 0;
 
-    GraphicLog& logger(GraphicLog::getInstance());
-    logger.log(GraphicLog::SF_FB_DEQUEUE_BEFORE, index);
-
     // wait for a free buffer
     while (!self->mNumFreeBuffers) {
         self->mCondition.wait(self->mutex);
@@ -224,7 +220,6 @@
 
     *buffer = self->buffers[index].get();
 
-    logger.log(GraphicLog::SF_FB_DEQUEUE_AFTER, index);
     return 0;
 }
 
@@ -235,16 +230,12 @@
     Mutex::Autolock _l(self->mutex);
 
     const int index = self->mCurrentBufferIndex;
-    GraphicLog& logger(GraphicLog::getInstance());
-    logger.log(GraphicLog::SF_FB_LOCK_BEFORE, index);
 
     // wait that the buffer we're locking is not front anymore
     while (self->front == buffer) {
         self->mCondition.wait(self->mutex);
     }
 
-    logger.log(GraphicLog::SF_FB_LOCK_AFTER, index);
-
     return NO_ERROR;
 }
 
@@ -257,13 +248,7 @@
     buffer_handle_t handle = static_cast<NativeBuffer*>(buffer)->handle;
 
     const int index = self->mCurrentBufferIndex;
-    GraphicLog& logger(GraphicLog::getInstance());
-    logger.log(GraphicLog::SF_FB_POST_BEFORE, index);
-
     int res = fb->post(fb, handle);
-
-    logger.log(GraphicLog::SF_FB_POST_AFTER, index);
-
     self->front = static_cast<NativeBuffer*>(buffer);
     self->mNumFreeBuffers++;
     self->mCondition.broadcast();
diff --git a/libs/ui/GraphicLog.cpp b/libs/ui/GraphicLog.cpp
deleted file mode 100644
index 7ba2779..0000000
--- a/libs/ui/GraphicLog.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2010 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 <stdlib.h>
-#include <unistd.h>
-#include <cutils/log.h>
-#include <cutils/properties.h>
-#include <utils/Endian.h>
-#include <utils/Timers.h>
-
-#include <ui/GraphicLog.h>
-
-namespace android {
-
-ANDROID_SINGLETON_STATIC_INSTANCE(GraphicLog)
-
-static inline
-void writeInt32(uint8_t* base, size_t& pos, int32_t value) {
-#ifdef HAVE_LITTLE_ENDIAN
-    int32_t v = value;
-#else
-    int32_t v = htole32(value);
-#endif
-    base[pos] = EVENT_TYPE_INT;
-    memcpy(&base[pos+1], &v, sizeof(int32_t));
-    pos += 1+sizeof(int32_t);
-}
-
-static inline
-void writeInt64(uint8_t* base,  size_t& pos, int64_t value) {
-#ifdef HAVE_LITTLE_ENDIAN
-    int64_t v = value;
-#else
-    int64_t v = htole64(value);
-#endif
-    base[pos] = EVENT_TYPE_LONG;
-    memcpy(&base[pos+1], &v, sizeof(int64_t));
-    pos += 1+sizeof(int64_t);
-}
-
-void GraphicLog::logImpl(int32_t tag, int32_t buffer)
-{
-    uint8_t scratch[2 + 2 + sizeof(int32_t) + sizeof(int64_t)];
-    size_t pos = 0;
-    scratch[pos++] = EVENT_TYPE_LIST;
-    scratch[pos++] = 2;
-    writeInt32(scratch, pos, buffer);
-    writeInt64(scratch, pos, ns2ms( systemTime( SYSTEM_TIME_MONOTONIC ) ));
-    android_bWriteLog(tag, scratch, sizeof(scratch));
-}
-
-void GraphicLog::logImpl(int32_t tag, int32_t identity, int32_t buffer)
-{
-    uint8_t scratch[2 + 3 + sizeof(int32_t) + sizeof(int32_t) + sizeof(int64_t)];
-    size_t pos = 0;
-    scratch[pos++] = EVENT_TYPE_LIST;
-    scratch[pos++] = 3;
-    writeInt32(scratch, pos, buffer);
-    writeInt32(scratch, pos, identity);
-    writeInt64(scratch, pos, ns2ms( systemTime( SYSTEM_TIME_MONOTONIC ) ));
-    android_bWriteLog(tag, scratch, sizeof(scratch));
-}
-
-GraphicLog::GraphicLog()
-    : mEnabled(0)
-{
-    char property[PROPERTY_VALUE_MAX];
-    if (property_get("debug.graphic_log", property, NULL) > 0) {
-        mEnabled = atoi(property);
-    }
-}
-
-void GraphicLog::setEnabled(bool enable)
-{
-    mEnabled = enable;
-}
-
-}
diff --git a/libs/utils/Android.mk b/libs/utils/Android.mk
index 831d9e3..544ab74 100644
--- a/libs/utils/Android.mk
+++ b/libs/utils/Android.mk
@@ -21,6 +21,7 @@
 	Asset.cpp \
 	AssetDir.cpp \
 	AssetManager.cpp \
+	BasicHashtable.cpp \
 	BlobCache.cpp \
 	BufferedTextOutput.cpp \
 	CallStack.cpp \
@@ -105,7 +106,8 @@
 	libz \
 	liblog \
 	libcutils \
-	libdl
+	libdl \
+	libcorkscrew
 
 LOCAL_MODULE:= libutils
 include $(BUILD_SHARED_LIBRARY)
diff --git a/libs/utils/BasicHashtable.cpp b/libs/utils/BasicHashtable.cpp
new file mode 100644
index 0000000..fb8ec9f
--- /dev/null
+++ b/libs/utils/BasicHashtable.cpp
@@ -0,0 +1,338 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#define LOG_TAG "BasicHashtable"
+
+#include <math.h>
+
+#include <utils/Log.h>
+#include <utils/BasicHashtable.h>
+#include <utils/misc.h>
+
+namespace android {
+
+BasicHashtableImpl::BasicHashtableImpl(size_t entrySize, bool hasTrivialDestructor,
+        size_t minimumInitialCapacity, float loadFactor) :
+        mBucketSize(entrySize + sizeof(Bucket)), mHasTrivialDestructor(hasTrivialDestructor),
+        mLoadFactor(loadFactor), mSize(0),
+        mFilledBuckets(0), mBuckets(NULL) {
+    determineCapacity(minimumInitialCapacity, mLoadFactor, &mBucketCount, &mCapacity);
+}
+
+BasicHashtableImpl::BasicHashtableImpl(const BasicHashtableImpl& other) :
+        mBucketSize(other.mBucketSize), mHasTrivialDestructor(other.mHasTrivialDestructor),
+        mCapacity(other.mCapacity), mLoadFactor(other.mLoadFactor),
+        mSize(other.mSize), mFilledBuckets(other.mFilledBuckets),
+        mBucketCount(other.mBucketCount), mBuckets(other.mBuckets) {
+    if (mBuckets) {
+        SharedBuffer::bufferFromData(mBuckets)->acquire();
+    }
+}
+
+void BasicHashtableImpl::dispose() {
+    if (mBuckets) {
+        releaseBuckets(mBuckets, mBucketCount);
+    }
+}
+
+void BasicHashtableImpl::clone() {
+    if (mBuckets) {
+        void* newBuckets = allocateBuckets(mBucketCount);
+        copyBuckets(mBuckets, newBuckets, mBucketCount);
+        releaseBuckets(mBuckets, mBucketCount);
+        mBuckets = newBuckets;
+    }
+}
+
+void BasicHashtableImpl::setTo(const BasicHashtableImpl& other) {
+    if (mBuckets) {
+        releaseBuckets(mBuckets, mBucketCount);
+    }
+
+    mCapacity = other.mCapacity;
+    mLoadFactor = other.mLoadFactor;
+    mSize = other.mSize;
+    mFilledBuckets = other.mFilledBuckets;
+    mBucketCount = other.mBucketCount;
+    mBuckets = other.mBuckets;
+
+    if (mBuckets) {
+        SharedBuffer::bufferFromData(mBuckets)->acquire();
+    }
+}
+
+void BasicHashtableImpl::clear() {
+    if (mBuckets) {
+        if (mFilledBuckets) {
+            SharedBuffer* sb = SharedBuffer::bufferFromData(mBuckets);
+            if (sb->onlyOwner()) {
+                destroyBuckets(mBuckets, mBucketCount);
+                for (size_t i = 0; i < mSize; i++) {
+                    Bucket& bucket = bucketAt(mBuckets, i);
+                    bucket.cookie = 0;
+                }
+            } else {
+                releaseBuckets(mBuckets, mBucketCount);
+                mBuckets = NULL;
+            }
+            mFilledBuckets = 0;
+        }
+        mSize = 0;
+    }
+}
+
+ssize_t BasicHashtableImpl::next(ssize_t index) const {
+    if (mSize) {
+        while (size_t(++index) < mBucketCount) {
+            const Bucket& bucket = bucketAt(mBuckets, index);
+            if (bucket.cookie & Bucket::PRESENT) {
+                return index;
+            }
+        }
+    }
+    return -1;
+}
+
+ssize_t BasicHashtableImpl::find(ssize_t index, hash_t hash,
+        const void* __restrict__ key) const {
+    if (!mSize) {
+        return -1;
+    }
+
+    hash = trimHash(hash);
+    if (index < 0) {
+        index = chainStart(hash, mBucketCount);
+
+        const Bucket& bucket = bucketAt(mBuckets, size_t(index));
+        if (bucket.cookie & Bucket::PRESENT) {
+            if (compareBucketKey(bucket, key)) {
+                return index;
+            }
+        } else {
+            if (!(bucket.cookie & Bucket::COLLISION)) {
+                return -1;
+            }
+        }
+    }
+
+    size_t inc = chainIncrement(hash, mBucketCount);
+    for (;;) {
+        index = chainSeek(index, inc, mBucketCount);
+
+        const Bucket& bucket = bucketAt(mBuckets, size_t(index));
+        if (bucket.cookie & Bucket::PRESENT) {
+            if ((bucket.cookie & Bucket::HASH_MASK) == hash
+                    && compareBucketKey(bucket, key)) {
+                return index;
+            }
+        }
+        if (!(bucket.cookie & Bucket::COLLISION)) {
+            return -1;
+        }
+    }
+}
+
+size_t BasicHashtableImpl::add(hash_t hash, const void* entry) {
+    if (!mBuckets) {
+        mBuckets = allocateBuckets(mBucketCount);
+    } else {
+        edit();
+    }
+
+    hash = trimHash(hash);
+    for (;;) {
+        size_t index = chainStart(hash, mBucketCount);
+        Bucket* bucket = &bucketAt(mBuckets, size_t(index));
+        if (bucket->cookie & Bucket::PRESENT) {
+            size_t inc = chainIncrement(hash, mBucketCount);
+            do {
+                bucket->cookie |= Bucket::COLLISION;
+                index = chainSeek(index, inc, mBucketCount);
+                bucket = &bucketAt(mBuckets, size_t(index));
+            } while (bucket->cookie & Bucket::PRESENT);
+        }
+
+        uint32_t collision = bucket->cookie & Bucket::COLLISION;
+        if (!collision) {
+            if (mFilledBuckets >= mCapacity) {
+                rehash(mCapacity * 2, mLoadFactor);
+                continue;
+            }
+            mFilledBuckets += 1;
+        }
+
+        bucket->cookie = collision | Bucket::PRESENT | hash;
+        mSize += 1;
+        initializeBucketEntry(*bucket, entry);
+        return index;
+    }
+}
+
+void BasicHashtableImpl::removeAt(size_t index) {
+    edit();
+
+    Bucket& bucket = bucketAt(mBuckets, index);
+    bucket.cookie &= ~Bucket::PRESENT;
+    if (!(bucket.cookie & Bucket::COLLISION)) {
+        mFilledBuckets -= 1;
+    }
+    mSize -= 1;
+    if (!mHasTrivialDestructor) {
+        destroyBucketEntry(bucket);
+    }
+}
+
+void BasicHashtableImpl::rehash(size_t minimumCapacity, float loadFactor) {
+    if (minimumCapacity < mSize) {
+        minimumCapacity = mSize;
+    }
+    size_t newBucketCount, newCapacity;
+    determineCapacity(minimumCapacity, loadFactor, &newBucketCount, &newCapacity);
+
+    if (newBucketCount != mBucketCount || newCapacity != mCapacity) {
+        if (mBuckets) {
+            void* newBuckets;
+            if (mSize) {
+                newBuckets = allocateBuckets(newBucketCount);
+                for (size_t i = 0; i < mBucketCount; i++) {
+                    const Bucket& fromBucket = bucketAt(mBuckets, i);
+                    if (fromBucket.cookie & Bucket::PRESENT) {
+                        hash_t hash = fromBucket.cookie & Bucket::HASH_MASK;
+                        size_t index = chainStart(hash, newBucketCount);
+                        Bucket* toBucket = &bucketAt(newBuckets, size_t(index));
+                        if (toBucket->cookie & Bucket::PRESENT) {
+                            size_t inc = chainIncrement(hash, newBucketCount);
+                            do {
+                                toBucket->cookie |= Bucket::COLLISION;
+                                index = chainSeek(index, inc, newBucketCount);
+                                toBucket = &bucketAt(newBuckets, size_t(index));
+                            } while (toBucket->cookie & Bucket::PRESENT);
+                        }
+                        toBucket->cookie = Bucket::PRESENT | hash;
+                        initializeBucketEntry(*toBucket, fromBucket.entry);
+                    }
+                }
+            } else {
+                newBuckets = NULL;
+            }
+            releaseBuckets(mBuckets, mBucketCount);
+            mBuckets = newBuckets;
+            mFilledBuckets = mSize;
+        }
+        mBucketCount = newBucketCount;
+        mCapacity = newCapacity;
+    }
+    mLoadFactor = loadFactor;
+}
+
+void* BasicHashtableImpl::allocateBuckets(size_t count) const {
+    size_t bytes = count * mBucketSize;
+    SharedBuffer* sb = SharedBuffer::alloc(bytes);
+    LOG_ALWAYS_FATAL_IF(!sb, "Could not allocate %u bytes for hashtable with %u buckets.",
+            uint32_t(bytes), uint32_t(count));
+    void* buckets = sb->data();
+    for (size_t i = 0; i < count; i++) {
+        Bucket& bucket = bucketAt(buckets, i);
+        bucket.cookie = 0;
+    }
+    return buckets;
+}
+
+void BasicHashtableImpl::releaseBuckets(void* __restrict__ buckets, size_t count) const {
+    SharedBuffer* sb = SharedBuffer::bufferFromData(buckets);
+    if (sb->release(SharedBuffer::eKeepStorage) == 1) {
+        destroyBuckets(buckets, count);
+        SharedBuffer::dealloc(sb);
+    }
+}
+
+void BasicHashtableImpl::destroyBuckets(void* __restrict__ buckets, size_t count) const {
+    if (!mHasTrivialDestructor) {
+        for (size_t i = 0; i < count; i++) {
+            Bucket& bucket = bucketAt(buckets, i);
+            if (bucket.cookie & Bucket::PRESENT) {
+                destroyBucketEntry(bucket);
+            }
+        }
+    }
+}
+
+void BasicHashtableImpl::copyBuckets(const void* __restrict__ fromBuckets,
+        void* __restrict__ toBuckets, size_t count) const {
+    for (size_t i = 0; i < count; i++) {
+        const Bucket& fromBucket = bucketAt(fromBuckets, i);
+        Bucket& toBucket = bucketAt(toBuckets, i);
+        toBucket.cookie = fromBucket.cookie;
+        if (fromBucket.cookie & Bucket::PRESENT) {
+            initializeBucketEntry(toBucket, fromBucket.entry);
+        }
+    }
+}
+
+// Table of 31-bit primes where each prime is no less than twice as large
+// as the previous one.  Generated by "primes.py".
+static size_t PRIMES[] = {
+    5,
+    11,
+    23,
+    47,
+    97,
+    197,
+    397,
+    797,
+    1597,
+    3203,
+    6421,
+    12853,
+    25717,
+    51437,
+    102877,
+    205759,
+    411527,
+    823117,
+    1646237,
+    3292489,
+    6584983,
+    13169977,
+    26339969,
+    52679969,
+    105359939,
+    210719881,
+    421439783,
+    842879579,
+    1685759167,
+    0,
+};
+
+void BasicHashtableImpl::determineCapacity(size_t minimumCapacity, float loadFactor,
+        size_t* __restrict__ outBucketCount, size_t* __restrict__ outCapacity) {
+    LOG_ALWAYS_FATAL_IF(loadFactor <= 0.0f || loadFactor > 1.0f,
+            "Invalid load factor %0.3f.  Must be in the range (0, 1].", loadFactor);
+
+    size_t count = ceilf(minimumCapacity / loadFactor) + 1;
+    size_t i = 0;
+    while (count > PRIMES[i] && i < NELEM(PRIMES)) {
+        i++;
+    }
+    count = PRIMES[i];
+    LOG_ALWAYS_FATAL_IF(!count, "Could not determine required number of buckets for "
+            "hashtable with minimum capacity %u and load factor %0.3f.",
+            uint32_t(minimumCapacity), loadFactor);
+    *outBucketCount = count;
+    *outCapacity = ceilf((count - 1) * loadFactor);
+}
+
+}; // namespace android
diff --git a/libs/utils/CallStack.cpp b/libs/utils/CallStack.cpp
index bd7e239..18fd84f 100644
--- a/libs/utils/CallStack.cpp
+++ b/libs/utils/CallStack.cpp
@@ -17,218 +17,33 @@
 #define LOG_TAG "CallStack"
 
 #include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#if HAVE_DLADDR
-#include <dlfcn.h>
-#endif
-
-#if HAVE_CXXABI
-#include <cxxabi.h>
-#endif
-
-#include <unwind.h>
 
 #include <utils/Log.h>
 #include <utils/Errors.h>
 #include <utils/CallStack.h>
-#include <utils/threads.h>
-
+#include <corkscrew/backtrace.h>
 
 /*****************************************************************************/
 namespace android {
 
-
-typedef struct {
-    size_t count;
-    size_t ignore;
-    const void** addrs;
-} stack_crawl_state_t;
-
-static
-_Unwind_Reason_Code trace_function(_Unwind_Context *context, void *arg)
-{
-    stack_crawl_state_t* state = (stack_crawl_state_t*)arg;
-    if (state->count) {
-        void* ip = (void*)_Unwind_GetIP(context);
-        if (ip) {
-            if (state->ignore) {
-                state->ignore--;
-            } else {
-                state->addrs[0] = ip; 
-                state->addrs++;
-                state->count--;
-            }
-        }
-    }
-    return _URC_NO_REASON;
+CallStack::CallStack() :
+        mCount(0) {
 }
 
-static
-int backtrace(const void** addrs, size_t ignore, size_t size)
-{
-    stack_crawl_state_t state;
-    state.count = size;
-    state.ignore = ignore;
-    state.addrs = addrs;
-    _Unwind_Backtrace(trace_function, (void*)&state);
-    return size - state.count;
-}
-
-/*****************************************************************************/
-
-static 
-const char *lookup_symbol(const void* addr, void **offset, char* name, size_t bufSize)
-{
-#if HAVE_DLADDR
-    Dl_info info;
-    if (dladdr(addr, &info)) {
-        *offset = info.dli_saddr;
-        return info.dli_sname;
-    }
-#endif
-    return NULL;
-}
-
-static 
-int32_t linux_gcc_demangler(const char *mangled_name, char *unmangled_name, size_t buffersize)
-{
-    size_t out_len = 0;
-#if HAVE_CXXABI
-    int status = 0;
-    char *demangled = abi::__cxa_demangle(mangled_name, 0, &out_len, &status);
-    if (status == 0) {
-        // OK
-        if (out_len < buffersize) memcpy(unmangled_name, demangled, out_len);
-        else out_len = 0;
-        free(demangled);
-    } else {
-        out_len = 0;
-    }
-#endif
-    return out_len;
-}
-
-/*****************************************************************************/
-
-class MapInfo {
-    struct mapinfo {
-        struct mapinfo *next;
-        uint64_t start;
-        uint64_t end;
-        char name[];
-    };
-
-    const char *map_to_name(uint64_t pc, const char* def, uint64_t* start) {
-        mapinfo* mi = getMapInfoList();
-        while(mi) {
-            if ((pc >= mi->start) && (pc < mi->end)) {
-                if (start) 
-                    *start = mi->start;
-                return mi->name;
-            }
-            mi = mi->next;
-        }
-        if (start) 
-            *start = 0;
-        return def;
-    }
-
-    mapinfo *parse_maps_line(char *line) {
-        mapinfo *mi;
-        int len = strlen(line);
-        if (len < 1) return 0;
-        line[--len] = 0;
-        if (len < 50) return 0;
-        if (line[20] != 'x') return 0;
-        mi = (mapinfo*)malloc(sizeof(mapinfo) + (len - 47));
-        if (mi == 0) return 0;
-        mi->start = strtoull(line, 0, 16);
-        mi->end = strtoull(line + 9, 0, 16);
-        mi->next = 0;
-        strcpy(mi->name, line + 49);
-        return mi;
-    }
-
-    mapinfo* getMapInfoList() {
-        Mutex::Autolock _l(mLock);
-        if (milist == 0) {
-            char data[1024];
-            FILE *fp;
-            sprintf(data, "/proc/%d/maps", getpid());
-            fp = fopen(data, "r");
-            if (fp) {
-                while(fgets(data, 1024, fp)) {
-                    mapinfo *mi = parse_maps_line(data);
-                    if(mi) {
-                        mi->next = milist;
-                        milist = mi;
-                    }
-                }
-                fclose(fp);
-            }
-        }
-        return milist;
-    }
-    mapinfo*    milist;
-    Mutex       mLock;
-    static MapInfo sMapInfo;
-
-public:
-    MapInfo()
-     : milist(0) {
-    }
-
-    ~MapInfo() {
-        while (milist) {
-            mapinfo *next = milist->next;
-            free(milist);
-            milist = next;
-        }
-    }
-    
-    static const char *mapAddressToName(const void* pc, const char* def,
-            void const** start) 
-    {
-        uint64_t s;
-        char const* name = sMapInfo.map_to_name(uint64_t(uintptr_t(pc)), def, &s);
-        if (start) {
-            *start = (void*)s;
-        }
-        return name;
-    }
-
-};
-
-/*****************************************************************************/
-
-MapInfo MapInfo::sMapInfo;
-
-/*****************************************************************************/
-
-CallStack::CallStack()
-    : mCount(0)
-{
-}
-
-CallStack::CallStack(const CallStack& rhs)
-    : mCount(rhs.mCount)
-{
+CallStack::CallStack(const CallStack& rhs) :
+        mCount(rhs.mCount) {
     if (mCount) {
-        memcpy(mStack, rhs.mStack, mCount*sizeof(void*));
+        memcpy(mStack, rhs.mStack, mCount * sizeof(backtrace_frame_t));
     }
 }
 
-CallStack::~CallStack()
-{
+CallStack::~CallStack() {
 }
 
-CallStack& CallStack::operator = (const CallStack& rhs)
-{
+CallStack& CallStack::operator = (const CallStack& rhs) {
     mCount = rhs.mCount;
     if (mCount) {
-        memcpy(mStack, rhs.mStack, mCount*sizeof(void*));
+        memcpy(mStack, rhs.mStack, mCount * sizeof(backtrace_frame_t));
     }
     return *this;
 }
@@ -236,7 +51,7 @@
 bool CallStack::operator == (const CallStack& rhs) const {
     if (mCount != rhs.mCount)
         return false;
-    return !mCount || (memcmp(mStack, rhs.mStack, mCount*sizeof(void*)) == 0);
+    return !mCount || memcmp(mStack, rhs.mStack, mCount * sizeof(backtrace_frame_t)) == 0;
 }
 
 bool CallStack::operator != (const CallStack& rhs) const {
@@ -246,7 +61,7 @@
 bool CallStack::operator < (const CallStack& rhs) const {
     if (mCount != rhs.mCount)
         return mCount < rhs.mCount;
-    return memcmp(mStack, rhs.mStack, mCount*sizeof(void*)) < 0;
+    return memcmp(mStack, rhs.mStack, mCount * sizeof(backtrace_frame_t)) < 0;
 }
 
 bool CallStack::operator >= (const CallStack& rhs) const {
@@ -256,7 +71,7 @@
 bool CallStack::operator > (const CallStack& rhs) const {
     if (mCount != rhs.mCount)
         return mCount > rhs.mCount;
-    return memcmp(mStack, rhs.mStack, mCount*sizeof(void*)) > 0;
+    return memcmp(mStack, rhs.mStack, mCount * sizeof(backtrace_frame_t)) > 0;
 }
 
 bool CallStack::operator <= (const CallStack& rhs) const {
@@ -266,84 +81,49 @@
 const void* CallStack::operator [] (int index) const {
     if (index >= int(mCount))
         return 0;
-    return mStack[index];
+    return reinterpret_cast<const void*>(mStack[index].absolute_pc);
 }
 
-
-void CallStack::clear()
-{
+void CallStack::clear() {
     mCount = 0;
 }
 
-void CallStack::update(int32_t ignoreDepth, int32_t maxDepth)
-{
-    if (maxDepth > MAX_DEPTH)
+void CallStack::update(int32_t ignoreDepth, int32_t maxDepth) {
+    if (maxDepth > MAX_DEPTH) {
         maxDepth = MAX_DEPTH;
-    mCount = backtrace(mStack, ignoreDepth, maxDepth);
-}
-
-// Return the stack frame name on the designated level
-String8 CallStack::toStringSingleLevel(const char* prefix, int32_t level) const
-{
-    String8 res;
-    char namebuf[1024];
-    char tmp[256];
-    char tmp1[32];
-    char tmp2[32];
-    void *offs;
-
-    const void* ip = mStack[level];
-    if (!ip) return res;
-
-    if (prefix) res.append(prefix);
-    snprintf(tmp1, 32, "#%02d  ", level);
-    res.append(tmp1);
-
-    const char* name = lookup_symbol(ip, &offs, namebuf, sizeof(namebuf));
-    if (name) {
-        if (linux_gcc_demangler(name, tmp, 256) != 0)
-            name = tmp;
-        snprintf(tmp1, 32, "0x%p: <", ip);
-        snprintf(tmp2, 32, ">+0x%p", offs);
-        res.append(tmp1);
-        res.append(name);
-        res.append(tmp2);
-    } else { 
-        void const* start = 0;
-        name = MapInfo::mapAddressToName(ip, "<unknown>", &start);
-        snprintf(tmp, 256, "pc %08lx  %s", 
-                long(uintptr_t(ip)-uintptr_t(start)), name);
-        res.append(tmp);
     }
-    res.append("\n");
-
-    return res;
+    ssize_t count = unwind_backtrace(mStack, ignoreDepth + 1, maxDepth);
+    mCount = count > 0 ? count : 0;
 }
 
-// Dump a stack trace to the log
-void CallStack::dump(const char* prefix) const
-{
-    /* 
-     * Sending a single long log may be truncated since the stack levels can
-     * get very deep. So we request function names of each frame individually.
-     */
-    for (int i=0; i<int(mCount); i++) {
-        ALOGD("%s", toStringSingleLevel(prefix, i).string());
+void CallStack::dump(const char* prefix) const {
+    backtrace_symbol_t symbols[mCount];
+
+    get_backtrace_symbols(mStack, mCount, symbols);
+    for (size_t i = 0; i < mCount; i++) {
+        char line[MAX_BACKTRACE_LINE_LENGTH];
+        format_backtrace_line(i, &mStack[i], &symbols[i],
+                line, MAX_BACKTRACE_LINE_LENGTH);
+        ALOGD("%s%s", prefix, line);
     }
+    free_backtrace_symbols(symbols, mCount);
 }
 
-// Return a string (possibly very long) containing the complete stack trace
-String8 CallStack::toString(const char* prefix) const
-{
-    String8 res;
+String8 CallStack::toString(const char* prefix) const {
+    String8 str;
+    backtrace_symbol_t symbols[mCount];
 
-    for (int i=0; i<int(mCount); i++) {
-        res.append(toStringSingleLevel(prefix, i).string());
+    get_backtrace_symbols(mStack, mCount, symbols);
+    for (size_t i = 0; i < mCount; i++) {
+        char line[MAX_BACKTRACE_LINE_LENGTH];
+        format_backtrace_line(i, &mStack[i], &symbols[i],
+                line, MAX_BACKTRACE_LINE_LENGTH);
+        str.append(prefix);
+        str.append(line);
+        str.append("\n");
     }
-
-    return res;
+    free_backtrace_symbols(symbols, mCount);
+    return str;
 }
 
-/*****************************************************************************/
-
 }; // namespace android
diff --git a/libs/utils/primes.py b/libs/utils/primes.py
new file mode 100755
index 0000000..e161dd8
--- /dev/null
+++ b/libs/utils/primes.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python2.6
+#
+# Copyright (C) 2011 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.
+#
+
+#
+# Generates a table of prime numbers for use in BasicHashtable.cpp.
+#
+# Each prime is chosen such that it is a little more than twice as large as
+# the previous prime in the table.  This makes it easier to choose a new
+# hashtable size when the underlying array is grown by as nominal factor
+# of two each time.
+#
+
+def is_odd_prime(n):
+  limit = (n - 1) / 2
+  d = 3
+  while d <= limit:
+    if n % d == 0:
+      return False
+    d += 2
+  return True
+
+print "static size_t PRIMES[] = {"
+
+n = 5
+max = 2**31 - 1
+while n < max:
+  print "    %d," % (n)
+  n = n * 2 + 1
+  while not is_odd_prime(n):
+    n += 2
+
+print "    0,"
+print "};"
diff --git a/libs/utils/tests/Android.mk b/libs/utils/tests/Android.mk
index b97f52f..58230f4 100644
--- a/libs/utils/tests/Android.mk
+++ b/libs/utils/tests/Android.mk
@@ -4,9 +4,10 @@
 
 # Build the unit tests.
 test_src_files := \
+	BasicHashtable_test.cpp \
 	BlobCache_test.cpp \
-	ObbFile_test.cpp \
 	Looper_test.cpp \
+	ObbFile_test.cpp \
 	String8_test.cpp \
 	Unicode_test.cpp \
 	ZipFileRO_test.cpp \
diff --git a/libs/utils/tests/BasicHashtable_test.cpp b/libs/utils/tests/BasicHashtable_test.cpp
new file mode 100644
index 0000000..7dcf750
--- /dev/null
+++ b/libs/utils/tests/BasicHashtable_test.cpp
@@ -0,0 +1,577 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#define LOG_TAG "BasicHashtable_test"
+
+#include <utils/BasicHashtable.h>
+#include <cutils/log.h>
+#include <gtest/gtest.h>
+#include <unistd.h>
+
+namespace android {
+
+typedef int SimpleKey;
+typedef int SimpleValue;
+typedef key_value_pair_t<SimpleKey, SimpleValue> SimpleEntry;
+typedef BasicHashtable<SimpleKey, SimpleEntry> SimpleHashtable;
+
+struct ComplexKey {
+    int k;
+
+    explicit ComplexKey(int k) : k(k) {
+        instanceCount += 1;
+    }
+
+    ComplexKey(const ComplexKey& other) : k(other.k) {
+        instanceCount += 1;
+    }
+
+    ~ComplexKey() {
+        instanceCount -= 1;
+    }
+
+    bool operator ==(const ComplexKey& other) const {
+        return k == other.k;
+    }
+
+    bool operator !=(const ComplexKey& other) const {
+        return k != other.k;
+    }
+
+    static ssize_t instanceCount;
+};
+
+ssize_t ComplexKey::instanceCount = 0;
+
+template<> inline hash_t hash_type(const ComplexKey& value) {
+    return hash_type(value.k);
+}
+
+struct ComplexValue {
+    int v;
+
+    explicit ComplexValue(int v) : v(v) {
+        instanceCount += 1;
+    }
+
+    ComplexValue(const ComplexValue& other) : v(other.v) {
+        instanceCount += 1;
+    }
+
+    ~ComplexValue() {
+        instanceCount -= 1;
+    }
+
+    static ssize_t instanceCount;
+};
+
+ssize_t ComplexValue::instanceCount = 0;
+
+typedef key_value_pair_t<ComplexKey, ComplexValue> ComplexEntry;
+typedef BasicHashtable<ComplexKey, ComplexEntry> ComplexHashtable;
+
+class BasicHashtableTest : public testing::Test {
+protected:
+    virtual void SetUp() {
+        ComplexKey::instanceCount = 0;
+        ComplexValue::instanceCount = 0;
+    }
+
+    virtual void TearDown() {
+        ASSERT_NO_FATAL_FAILURE(assertInstanceCount(0, 0));
+    }
+
+    void assertInstanceCount(ssize_t keys, ssize_t values) {
+        if (keys != ComplexKey::instanceCount || values != ComplexValue::instanceCount) {
+            FAIL() << "Expected " << keys << " keys and " << values << " values "
+                    "but there were actually " << ComplexKey::instanceCount << " keys and "
+                    << ComplexValue::instanceCount << " values";
+        }
+    }
+
+public:
+    template <typename TKey, typename TEntry>
+    static void cookieAt(const BasicHashtable<TKey, TEntry>& h, size_t index,
+            bool* collision, bool* present, hash_t* hash) {
+        uint32_t cookie = h.cookieAt(index);
+        *collision = cookie & BasicHashtable<TKey, TEntry>::Bucket::COLLISION;
+        *present = cookie & BasicHashtable<TKey, TEntry>::Bucket::PRESENT;
+        *hash = cookie & BasicHashtable<TKey, TEntry>::Bucket::HASH_MASK;
+    }
+
+    template <typename TKey, typename TEntry>
+    static const void* getBuckets(const BasicHashtable<TKey, TEntry>& h) {
+        return h.mBuckets;
+    }
+};
+
+template <typename TKey, typename TValue>
+static size_t add(BasicHashtable<TKey, key_value_pair_t<TKey, TValue> >& h,
+        const TKey& key, const TValue& value) {
+    return h.add(hash_type(key), key_value_pair_t<TKey, TValue>(key, value));
+}
+
+template <typename TKey, typename TValue>
+static ssize_t find(BasicHashtable<TKey, key_value_pair_t<TKey, TValue> >& h,
+        ssize_t index, const TKey& key) {
+    return h.find(index, hash_type(key), key);
+}
+
+template <typename TKey, typename TValue>
+static bool remove(BasicHashtable<TKey, key_value_pair_t<TKey, TValue> >& h,
+        const TKey& key) {
+    ssize_t index = find(h, -1, key);
+    if (index >= 0) {
+        h.removeAt(index);
+        return true;
+    }
+    return false;
+}
+
+template <typename TEntry>
+static void getKeyValue(const TEntry& entry, int* key, int* value);
+
+template <> void getKeyValue(const SimpleEntry& entry, int* key, int* value) {
+    *key = entry.key;
+    *value = entry.value;
+}
+
+template <> void getKeyValue(const ComplexEntry& entry, int* key, int* value) {
+    *key = entry.key.k;
+    *value = entry.value.v;
+}
+
+template <typename TKey, typename TValue>
+static void dump(BasicHashtable<TKey, key_value_pair_t<TKey, TValue> >& h) {
+    ALOGD("hashtable %p, size=%u, capacity=%u, bucketCount=%u",
+            &h, h.size(), h.capacity(), h.bucketCount());
+    for (size_t i = 0; i < h.bucketCount(); i++) {
+        bool collision, present;
+        hash_t hash;
+        BasicHashtableTest::cookieAt(h, i, &collision, &present, &hash);
+        if (present) {
+            int key, value;
+            getKeyValue(h.entryAt(i), &key, &value);
+            ALOGD("  [%3u] = collision=%d, present=%d, hash=0x%08x, key=%3d, value=%3d, "
+                    "hash_type(key)=0x%08x",
+                    i, collision, present, hash, key, value, hash_type(key));
+        } else {
+            ALOGD("  [%3u] = collision=%d, present=%d",
+                    i, collision, present);
+        }
+    }
+}
+
+TEST_F(BasicHashtableTest, DefaultConstructor_WithDefaultProperties) {
+    SimpleHashtable h;
+
+    EXPECT_EQ(0U, h.size());
+    EXPECT_EQ(3U, h.capacity());
+    EXPECT_EQ(5U, h.bucketCount());
+    EXPECT_EQ(0.75f, h.loadFactor());
+}
+
+TEST_F(BasicHashtableTest, Constructor_WithNonUnityLoadFactor) {
+    SimpleHashtable h(52, 0.8f);
+
+    EXPECT_EQ(0U, h.size());
+    EXPECT_EQ(77U, h.capacity());
+    EXPECT_EQ(97U, h.bucketCount());
+    EXPECT_EQ(0.8f, h.loadFactor());
+}
+
+TEST_F(BasicHashtableTest, Constructor_WithUnityLoadFactorAndExactCapacity) {
+    SimpleHashtable h(46, 1.0f);
+
+    EXPECT_EQ(0U, h.size());
+    EXPECT_EQ(46U, h.capacity()); // must be one less than bucketCount because loadFactor == 1.0f
+    EXPECT_EQ(47U, h.bucketCount());
+    EXPECT_EQ(1.0f, h.loadFactor());
+}
+
+TEST_F(BasicHashtableTest, Constructor_WithUnityLoadFactorAndInexactCapacity) {
+    SimpleHashtable h(42, 1.0f);
+
+    EXPECT_EQ(0U, h.size());
+    EXPECT_EQ(46U, h.capacity()); // must be one less than bucketCount because loadFactor == 1.0f
+    EXPECT_EQ(47U, h.bucketCount());
+    EXPECT_EQ(1.0f, h.loadFactor());
+}
+
+TEST_F(BasicHashtableTest, FindAddFindRemoveFind_OneEntry) {
+    SimpleHashtable h;
+    ssize_t index = find(h, -1, 8);
+    ASSERT_EQ(-1, index);
+
+    index = add(h, 8, 1);
+    ASSERT_EQ(1U, h.size());
+
+    ASSERT_EQ(index, find(h, -1, 8));
+    ASSERT_EQ(8, h.entryAt(index).key);
+    ASSERT_EQ(1, h.entryAt(index).value);
+
+    index = find(h, index, 8);
+    ASSERT_EQ(-1, index);
+
+    ASSERT_TRUE(remove(h, 8));
+    ASSERT_EQ(0U, h.size());
+
+    index = find(h, -1, 8);
+    ASSERT_EQ(-1, index);
+}
+
+TEST_F(BasicHashtableTest, FindAddFindRemoveFind_MultipleEntryWithUniqueKey) {
+    const size_t N = 11;
+
+    SimpleHashtable h;
+    for (size_t i = 0; i < N; i++) {
+        ssize_t index = find(h, -1, int(i));
+        ASSERT_EQ(-1, index);
+
+        index = add(h, int(i), int(i * 10));
+        ASSERT_EQ(i + 1, h.size());
+
+        ASSERT_EQ(index, find(h, -1, int(i)));
+        ASSERT_EQ(int(i), h.entryAt(index).key);
+        ASSERT_EQ(int(i * 10), h.entryAt(index).value);
+
+        index = find(h, index, int(i));
+        ASSERT_EQ(-1, index);
+    }
+
+    for (size_t i = N; --i > 0; ) {
+        ASSERT_TRUE(remove(h, int(i))) << "i = " << i;
+        ASSERT_EQ(i, h.size());
+
+        ssize_t index = find(h, -1, int(i));
+        ASSERT_EQ(-1, index);
+    }
+}
+
+TEST_F(BasicHashtableTest, FindAddFindRemoveFind_MultipleEntryWithDuplicateKey) {
+    const size_t N = 11;
+    const int K = 1;
+
+    SimpleHashtable h;
+    for (size_t i = 0; i < N; i++) {
+        ssize_t index = find(h, -1, K);
+        if (i == 0) {
+            ASSERT_EQ(-1, index);
+        } else {
+            ASSERT_NE(-1, index);
+        }
+
+        add(h, K, int(i));
+        ASSERT_EQ(i + 1, h.size());
+
+        index = -1;
+        int values = 0;
+        for (size_t j = 0; j <= i; j++) {
+            index = find(h, index, K);
+            ASSERT_GE(index, 0);
+            ASSERT_EQ(K, h.entryAt(index).key);
+            values |= 1 << h.entryAt(index).value;
+        }
+        ASSERT_EQ(values, (1 << (i + 1)) - 1);
+
+        index = find(h, index, K);
+        ASSERT_EQ(-1, index);
+    }
+
+    for (size_t i = N; --i > 0; ) {
+        ASSERT_TRUE(remove(h, K)) << "i = " << i;
+        ASSERT_EQ(i, h.size());
+
+        ssize_t index = -1;
+        for (size_t j = 0; j < i; j++) {
+            index = find(h, index, K);
+            ASSERT_GE(index, 0);
+            ASSERT_EQ(K, h.entryAt(index).key);
+        }
+
+        index = find(h, index, K);
+        ASSERT_EQ(-1, index);
+    }
+}
+
+TEST_F(BasicHashtableTest, Clear_WhenAlreadyEmpty_DoesNothing) {
+    SimpleHashtable h;
+    h.clear();
+
+    EXPECT_EQ(0U, h.size());
+    EXPECT_EQ(3U, h.capacity());
+    EXPECT_EQ(5U, h.bucketCount());
+    EXPECT_EQ(0.75f, h.loadFactor());
+}
+
+TEST_F(BasicHashtableTest, Clear_AfterElementsAdded_RemovesThem) {
+    SimpleHashtable h;
+    add(h, 0, 0);
+    add(h, 1, 0);
+    h.clear();
+
+    EXPECT_EQ(0U, h.size());
+    EXPECT_EQ(3U, h.capacity());
+    EXPECT_EQ(5U, h.bucketCount());
+    EXPECT_EQ(0.75f, h.loadFactor());
+}
+
+TEST_F(BasicHashtableTest, Clear_AfterElementsAdded_DestroysThem) {
+    ComplexHashtable h;
+    add(h, ComplexKey(0), ComplexValue(0));
+    add(h, ComplexKey(1), ComplexValue(0));
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
+
+    h.clear();
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(0, 0));
+
+    EXPECT_EQ(0U, h.size());
+    EXPECT_EQ(3U, h.capacity());
+    EXPECT_EQ(5U, h.bucketCount());
+    EXPECT_EQ(0.75f, h.loadFactor());
+}
+
+TEST_F(BasicHashtableTest, Remove_AfterElementsAdded_DestroysThem) {
+    ComplexHashtable h;
+    add(h, ComplexKey(0), ComplexValue(0));
+    add(h, ComplexKey(1), ComplexValue(0));
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
+
+    ASSERT_TRUE(remove(h, ComplexKey(0)));
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(1, 1));
+
+    ASSERT_TRUE(remove(h, ComplexKey(1)));
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(0, 0));
+
+    EXPECT_EQ(0U, h.size());
+    EXPECT_EQ(3U, h.capacity());
+    EXPECT_EQ(5U, h.bucketCount());
+    EXPECT_EQ(0.75f, h.loadFactor());
+}
+
+TEST_F(BasicHashtableTest, Destructor_AfterElementsAdded_DestroysThem) {
+    {
+        ComplexHashtable h;
+        add(h, ComplexKey(0), ComplexValue(0));
+        add(h, ComplexKey(1), ComplexValue(0));
+        ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
+    } // h is destroyed here
+
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(0, 0));
+}
+
+TEST_F(BasicHashtableTest, Next_WhenEmpty_ReturnsMinusOne) {
+    SimpleHashtable h;
+
+    ASSERT_EQ(-1, h.next(-1));
+}
+
+TEST_F(BasicHashtableTest, Next_WhenNonEmpty_IteratesOverAllEntries) {
+    const int N = 88;
+
+    SimpleHashtable h;
+    for (int i = 0; i < N; i++) {
+        add(h, i, i * 10);
+    }
+
+    bool set[N];
+    memset(set, 0, sizeof(bool) * N);
+    int count = 0;
+    for (ssize_t index = -1; (index = h.next(index)) != -1; ) {
+        ASSERT_GE(index, 0);
+        ASSERT_LT(size_t(index), h.bucketCount());
+
+        const SimpleEntry& entry = h.entryAt(index);
+        ASSERT_GE(entry.key, 0);
+        ASSERT_LT(entry.key, N);
+        ASSERT_EQ(false, set[entry.key]);
+        ASSERT_EQ(entry.key * 10, entry.value);
+
+        set[entry.key] = true;
+        count += 1;
+    }
+    ASSERT_EQ(N, count);
+}
+
+TEST_F(BasicHashtableTest, Add_RehashesOnDemand) {
+    SimpleHashtable h;
+    size_t initialCapacity = h.capacity();
+    size_t initialBucketCount = h.bucketCount();
+
+    for (size_t i = 0; i < initialCapacity; i++) {
+        add(h, int(i), 0);
+    }
+
+    EXPECT_EQ(initialCapacity, h.size());
+    EXPECT_EQ(initialCapacity, h.capacity());
+    EXPECT_EQ(initialBucketCount, h.bucketCount());
+
+    add(h, -1, -1);
+
+    EXPECT_EQ(initialCapacity + 1, h.size());
+    EXPECT_GT(h.capacity(), initialCapacity);
+    EXPECT_GT(h.bucketCount(), initialBucketCount);
+    EXPECT_GT(h.bucketCount(), h.capacity());
+}
+
+TEST_F(BasicHashtableTest, Rehash_WhenCapacityAndBucketCountUnchanged_DoesNothing) {
+    ComplexHashtable h;
+    add(h, ComplexKey(0), ComplexValue(0));
+    const void* oldBuckets = getBuckets(h);
+    ASSERT_NE((void*)NULL, oldBuckets);
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(1, 1));
+
+    h.rehash(h.capacity(), h.loadFactor());
+
+    ASSERT_EQ(oldBuckets, getBuckets(h));
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(1, 1));
+}
+
+TEST_F(BasicHashtableTest, Rehash_WhenEmptyAndHasNoBuckets_ButDoesNotAllocateBuckets) {
+    ComplexHashtable h;
+    ASSERT_EQ((void*)NULL, getBuckets(h));
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(0, 0));
+
+    h.rehash(9, 1.0f);
+
+    EXPECT_EQ(0U, h.size());
+    EXPECT_EQ(10U, h.capacity());
+    EXPECT_EQ(11U, h.bucketCount());
+    EXPECT_EQ(1.0f, h.loadFactor());
+    EXPECT_EQ((void*)NULL, getBuckets(h));
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(0, 0));
+}
+
+TEST_F(BasicHashtableTest, Rehash_WhenEmptyAndHasBuckets_ReleasesBucketsAndSetsCapacity) {
+    ComplexHashtable h(10);
+    add(h, ComplexKey(0), ComplexValue(0));
+    ASSERT_TRUE(remove(h, ComplexKey(0)));
+    ASSERT_NE((void*)NULL, getBuckets(h));
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(0, 0));
+
+    h.rehash(0, 0.75f);
+
+    EXPECT_EQ(0U, h.size());
+    EXPECT_EQ(3U, h.capacity());
+    EXPECT_EQ(5U, h.bucketCount());
+    EXPECT_EQ(0.75f, h.loadFactor());
+    EXPECT_EQ((void*)NULL, getBuckets(h));
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(0, 0));
+}
+
+TEST_F(BasicHashtableTest, Rehash_WhenLessThanCurrentCapacity_ShrinksBuckets) {
+    ComplexHashtable h(10);
+    add(h, ComplexKey(0), ComplexValue(0));
+    add(h, ComplexKey(1), ComplexValue(1));
+    const void* oldBuckets = getBuckets(h);
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
+
+    h.rehash(0, 0.75f);
+
+    EXPECT_EQ(2U, h.size());
+    EXPECT_EQ(3U, h.capacity());
+    EXPECT_EQ(5U, h.bucketCount());
+    EXPECT_EQ(0.75f, h.loadFactor());
+    EXPECT_NE(oldBuckets, getBuckets(h));
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
+}
+
+TEST_F(BasicHashtableTest, CopyOnWrite) {
+    ComplexHashtable h1;
+    add(h1, ComplexKey(0), ComplexValue(0));
+    add(h1, ComplexKey(1), ComplexValue(1));
+    const void* originalBuckets = getBuckets(h1);
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
+    ssize_t index0 = find(h1, -1, ComplexKey(0));
+    EXPECT_GE(index0, 0);
+
+    // copy constructor acquires shared reference
+    ComplexHashtable h2(h1);
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
+    ASSERT_EQ(originalBuckets, getBuckets(h2));
+    EXPECT_EQ(h1.size(), h2.size());
+    EXPECT_EQ(h1.capacity(), h2.capacity());
+    EXPECT_EQ(h1.bucketCount(), h2.bucketCount());
+    EXPECT_EQ(h1.loadFactor(), h2.loadFactor());
+    EXPECT_EQ(index0, find(h2, -1, ComplexKey(0)));
+
+    // operator= acquires shared reference
+    ComplexHashtable h3;
+    h3 = h2;
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
+    ASSERT_EQ(originalBuckets, getBuckets(h3));
+    EXPECT_EQ(h1.size(), h3.size());
+    EXPECT_EQ(h1.capacity(), h3.capacity());
+    EXPECT_EQ(h1.bucketCount(), h3.bucketCount());
+    EXPECT_EQ(h1.loadFactor(), h3.loadFactor());
+    EXPECT_EQ(index0, find(h3, -1, ComplexKey(0)));
+
+    // editEntryAt copies shared contents
+    h1.editEntryAt(index0).value.v = 42;
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(4, 4));
+    ASSERT_NE(originalBuckets, getBuckets(h1));
+    EXPECT_EQ(42, h1.entryAt(index0).value.v);
+    EXPECT_EQ(0, h2.entryAt(index0).value.v);
+    EXPECT_EQ(0, h3.entryAt(index0).value.v);
+
+    // clear releases reference to shared contents
+    h2.clear();
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(4, 4));
+    EXPECT_EQ(0U, h2.size());
+    ASSERT_NE(originalBuckets, getBuckets(h2));
+
+    // operator= acquires shared reference, destroys unshared contents
+    h1 = h3;
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
+    ASSERT_EQ(originalBuckets, getBuckets(h1));
+    EXPECT_EQ(h3.size(), h1.size());
+    EXPECT_EQ(h3.capacity(), h1.capacity());
+    EXPECT_EQ(h3.bucketCount(), h1.bucketCount());
+    EXPECT_EQ(h3.loadFactor(), h1.loadFactor());
+    EXPECT_EQ(index0, find(h1, -1, ComplexKey(0)));
+
+    // add copies shared contents
+    add(h1, ComplexKey(2), ComplexValue(2));
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(5, 5));
+    ASSERT_NE(originalBuckets, getBuckets(h1));
+    EXPECT_EQ(3U, h1.size());
+    EXPECT_EQ(0U, h2.size());
+    EXPECT_EQ(2U, h3.size());
+
+    // remove copies shared contents
+    h1 = h3;
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
+    ASSERT_EQ(originalBuckets, getBuckets(h1));
+    h1.removeAt(index0);
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(3, 3));
+    ASSERT_NE(originalBuckets, getBuckets(h1));
+    EXPECT_EQ(1U, h1.size());
+    EXPECT_EQ(0U, h2.size());
+    EXPECT_EQ(2U, h3.size());
+
+    // rehash copies shared contents
+    h1 = h3;
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(2, 2));
+    ASSERT_EQ(originalBuckets, getBuckets(h1));
+    h1.rehash(10, 1.0f);
+    ASSERT_NO_FATAL_FAILURE(assertInstanceCount(4, 4));
+    ASSERT_NE(originalBuckets, getBuckets(h1));
+    EXPECT_EQ(2U, h1.size());
+    EXPECT_EQ(0U, h2.size());
+    EXPECT_EQ(2U, h3.size());
+}
+
+} // namespace android
diff --git a/opengl/include/GLES/glext.h b/opengl/include/GLES/glext.h
index 65ab5e4..54afaab 100644
--- a/opengl/include/GLES/glext.h
+++ b/opengl/include/GLES/glext.h
@@ -1,7 +1,7 @@
 #ifndef __glext_h_
 #define __glext_h_
 
-/* $Revision: 10965 $ on $Date:: 2010-04-09 02:11:29 -0700 #$ */
+/* $Revision: 16481 $ on $Date:: 2012-01-04 10:43:56 -0800 #$ */
 
 #ifdef __cplusplus
 extern "C" {
@@ -68,6 +68,14 @@
 typedef void* GLeglImageOES;
 #endif
 
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+/* GLeglImageOES defined in GL_OES_EGL_image already. */
+#define GL_TEXTURE_EXTERNAL_OES                                 0x8D65
+#define GL_TEXTURE_BINDING_EXTERNAL_OES                         0x8D67
+#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES                     0x8D68
+#endif
+
 /* GL_OES_element_index_uint */
 #ifndef GL_OES_element_index_uint
 #define GL_UNSIGNED_INT                                         0x1405
@@ -211,14 +219,6 @@
 #define GL_VERTEX_ARRAY_BINDING_OES                             0x85B5
 #endif
 
-/* GL_OES_EGL_image_external */
-#ifndef GL_OES_EGL_image_external
-#define GL_TEXTURE_EXTERNAL_OES                                 0x8D65
-#define GL_SAMPLER_EXTERNAL_OES                                 0x8D66
-#define GL_TEXTURE_BINDING_EXTERNAL_OES                         0x8D67
-#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES                     0x8D68
-#endif
-
 /*------------------------------------------------------------------------*
  * AMD extension tokens
  *------------------------------------------------------------------------*/
@@ -243,6 +243,34 @@
 /* GL_APPLE_texture_2D_limited_npot */
 /* No new tokens introduced by this extension. */
 
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_APPLE                           0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE             0x8D56
+#define GL_MAX_SAMPLES_APPLE                                    0x8D57
+#define GL_READ_FRAMEBUFFER_APPLE                               0x8CA8
+#define GL_DRAW_FRAMEBUFFER_APPLE                               0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE                       0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_APPLE                       0x8CAA
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_BGRA_EXT                                             0x80E1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_TEXTURE_MAX_LEVEL_APPLE                              0x813D
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_rgba8 */
+/* No new tokens introduced by this extension. */
+
 /*------------------------------------------------------------------------*
  * EXT extension tokens
  *------------------------------------------------------------------------*/
@@ -260,6 +288,14 @@
 #define GL_STENCIL_EXT                                          0x1802
 #endif
 
+/* GL_EXT_multisampled_render_to_texture */
+#ifndef GL_EXT_multisampled_render_to_texture
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT           0x8D6C
+#define GL_RENDERBUFFER_SAMPLES_EXT                             0x9133
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT               0x9134
+#define GL_MAX_SAMPLES_EXT                                      0x9135
+#endif
+
 /* GL_EXT_multi_draw_arrays */
 /* No new tokens introduced by this extension. */
 
@@ -270,6 +306,32 @@
 #define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT                       0x8366
 #endif
 
+/* GL_EXT_robustness */
+#ifndef GL_EXT_robustness
+/* reuse GL_NO_ERROR */
+#define GL_GUILTY_CONTEXT_RESET_EXT                             0x8253
+#define GL_INNOCENT_CONTEXT_RESET_EXT                           0x8254
+#define GL_UNKNOWN_CONTEXT_RESET_EXT                            0x8255
+#define GL_CONTEXT_ROBUST_ACCESS_EXT                            0x90F3
+#define GL_RESET_NOTIFICATION_STRATEGY_EXT                      0x8256
+#define GL_LOSE_CONTEXT_ON_RESET_EXT                            0x8252
+#define GL_NO_RESET_NOTIFICATION_EXT                            0x8261
+#endif
+
+/* GL_EXT_sRGB */
+#ifndef GL_EXT_sRGB
+#define GL_SRGB_EXT                                             0x8C40
+#define GL_SRGB_ALPHA_EXT                                       0x8C42
+#define GL_SRGB8_ALPHA8_EXT                                     0x8C43
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT            0x8210
+#endif
+
+/* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT                         0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT                        0x83F1
+#endif
+
 /* GL_EXT_texture_filter_anisotropic */
 #ifndef GL_EXT_texture_filter_anisotropic
 #define GL_TEXTURE_MAX_ANISOTROPY_EXT                           0x84FE
@@ -288,6 +350,27 @@
 #define GL_TEXTURE_LOD_BIAS_EXT                                 0x8501
 #endif
 
+/* GL_EXT_texture_storage */
+#ifndef GL_EXT_texture_storage
+#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT                         0x912F
+#define GL_ALPHA8_EXT                                           0x803C  
+#define GL_LUMINANCE8_EXT                                       0x8040
+#define GL_LUMINANCE8_ALPHA8_EXT                                0x8045
+#define GL_RGBA32F_EXT                                          0x8814  
+#define GL_RGB32F_EXT                                           0x8815
+#define GL_ALPHA32F_EXT                                         0x8816
+#define GL_LUMINANCE32F_EXT                                     0x8818
+#define GL_LUMINANCE_ALPHA32F_EXT                               0x8819
+/* reuse GL_RGBA16F_EXT */
+#define GL_RGB16F_EXT                                           0x881B
+#define GL_ALPHA16F_EXT                                         0x881C
+#define GL_LUMINANCE16F_EXT                                     0x881E
+#define GL_LUMINANCE_ALPHA16F_EXT                               0x881F
+#define GL_RGB10_A2_EXT                                         0x8059  
+#define GL_RGB10_EXT                                            0x8052
+#define GL_BGRA8_EXT                                            0x93A1
+#endif
+
 /*------------------------------------------------------------------------*
  * IMG extension tokens
  *------------------------------------------------------------------------*/
@@ -507,6 +590,12 @@
 typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
 #endif
 
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+#define GL_OES_EGL_image_external 1
+/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */
+#endif
+
 /* GL_OES_element_index_uint */
 #ifndef GL_OES_element_index_uint
 #define GL_OES_element_index_uint 1
@@ -785,11 +874,6 @@
 typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
 #endif
 
-/* GL_OES_EGL_image_external */
-#ifndef GL_OES_EGL_image_external
-#define GL_OES_EGL_image_external 1
-#endif
-
 /*------------------------------------------------------------------------*
  * AMD extension functions
  *------------------------------------------------------------------------*/
@@ -813,6 +897,36 @@
 #define GL_APPLE_texture_2D_limited_npot 1
 #endif
 
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_APPLE_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_APPLE_texture_format_BGRA8888 1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_APPLE_texture_max_level 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_rgba8 */
+#ifndef GL_ARM_rgba8
+#define GL_ARM_rgba8 1
+#endif
+
 /*------------------------------------------------------------------------*
  * EXT extension functions
  *------------------------------------------------------------------------*/
@@ -831,6 +945,17 @@
 typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
 #endif
 
+/* GL_EXT_multisampled_render_to_texture */
+#ifndef GL_EXT_multisampled_render_to_texture
+#define GL_EXT_multisampled_render_to_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+
 /* GL_EXT_multi_draw_arrays */
 #ifndef GL_EXT_multi_draw_arrays
 #define GL_EXT_multi_draw_arrays 1
@@ -847,6 +972,31 @@
 #define GL_EXT_read_format_bgra 1
 #endif
 
+/* GL_EXT_robustness */
+#ifndef GL_EXT_robustness
+#define GL_EXT_robustness 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void);
+GL_API void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+GL_API void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, float *params);
+GL_API void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+#endif
+typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void);
+typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, float *params);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+#endif
+
+/* GL_EXT_sRGB */
+#ifndef GL_EXT_sRGB
+#define GL_EXT_sRGB 1
+#endif
+
+/* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_EXT_texture_compression_dxt1 1
+#endif
+
 /* GL_EXT_texture_filter_anisotropic */
 #ifndef GL_EXT_texture_filter_anisotropic
 #define GL_EXT_texture_filter_anisotropic 1
@@ -862,6 +1012,25 @@
 #define GL_EXT_texture_lod_bias 1
 #endif
 
+/* GL_EXT_texture_storage */
+#ifndef GL_EXT_texture_storage
+#define GL_EXT_texture_storage 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GL_API void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+GL_API void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GL_API void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+
 /*------------------------------------------------------------------------*
  * IMG extension functions
  *------------------------------------------------------------------------*/
diff --git a/opengl/include/GLES2/gl2ext.h b/opengl/include/GLES2/gl2ext.h
index 9db4e25..8f8d80a 100644
--- a/opengl/include/GLES2/gl2ext.h
+++ b/opengl/include/GLES2/gl2ext.h
@@ -1,7 +1,7 @@
 #ifndef __gl2ext_h_
 #define __gl2ext_h_
 
-/* $Revision: 10969 $ on $Date:: 2010-04-09 02:27:15 -0700 #$ */
+/* $Revision: 16619 $ on $Date:: 2012-01-18 10:00:14 -0800 #$ */
 
 #ifdef __cplusplus
 extern "C" {
@@ -57,6 +57,15 @@
 typedef void* GLeglImageOES;
 #endif
 
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+/* GLeglImageOES defined in GL_OES_EGL_image already. */
+#define GL_TEXTURE_EXTERNAL_OES                                 0x8D65
+#define GL_SAMPLER_EXTERNAL_OES                                 0x8D66
+#define GL_TEXTURE_BINDING_EXTERNAL_OES                         0x8D67
+#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES                     0x8D68
+#endif
+
 /* GL_OES_element_index_uint */
 #ifndef GL_OES_element_index_uint
 #define GL_UNSIGNED_INT                                         0x1405
@@ -146,14 +155,6 @@
 #define GL_INT_10_10_10_2_OES                                   0x8DF7
 #endif
 
-/* GL_OES_EGL_image_external */
-#ifndef GL_OES_EGL_image_external
-#define GL_TEXTURE_EXTERNAL_OES                                 0x8D65
-#define GL_SAMPLER_EXTERNAL_OES                                 0x8D66
-#define GL_TEXTURE_BINDING_EXTERNAL_OES                         0x8D67
-#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES                     0x8D68
-#endif
-
 /*------------------------------------------------------------------------*
  * AMD extension tokens
  *------------------------------------------------------------------------*/
@@ -188,6 +189,69 @@
 #endif
 
 /*------------------------------------------------------------------------*
+ * ANGLE extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_ANGLE_framebuffer_blit */
+#ifndef GL_ANGLE_framebuffer_blit
+#define GL_READ_FRAMEBUFFER_ANGLE                               0x8CA8
+#define GL_DRAW_FRAMEBUFFER_ANGLE                               0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE                       0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_ANGLE                       0x8CAA
+#endif
+
+/* GL_ANGLE_framebuffer_multisample */
+#ifndef GL_ANGLE_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_ANGLE                           0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE             0x8D56
+#define GL_MAX_SAMPLES_ANGLE                                    0x8D57
+#endif
+
+/*------------------------------------------------------------------------*
+ * APPLE extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_APPLE_rgb_422 */
+#ifndef GL_APPLE_rgb_422
+#define GL_RGB_422_APPLE                                        0x8A1F
+#define GL_UNSIGNED_SHORT_8_8_APPLE                             0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE                         0x85BB
+#endif
+
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_APPLE                           0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE             0x8D56
+#define GL_MAX_SAMPLES_APPLE                                    0x8D57
+#define GL_READ_FRAMEBUFFER_APPLE                               0x8CA8
+#define GL_DRAW_FRAMEBUFFER_APPLE                               0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE                       0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_APPLE                       0x8CAA
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_BGRA_EXT                                             0x80E1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_TEXTURE_MAX_LEVEL_APPLE                              0x813D
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_mali_shader_binary */
+#ifndef GL_ARM_mali_shader_binary
+#define GL_MALI_SHADER_BINARY_ARM                               0x8F60
+#endif
+
+/* GL_ARM_rgba8 */
+/* No new tokens introduced by this extension. */
+
+/*------------------------------------------------------------------------*
  * EXT extension tokens
  *------------------------------------------------------------------------*/
 
@@ -197,6 +261,29 @@
 #define GL_MAX_EXT                                              0x8008
 #endif
 
+/* GL_EXT_color_buffer_half_float */
+#ifndef GL_EXT_color_buffer_half_float
+#define GL_RGBA16F_EXT                                          0x881A
+#define GL_RGB16F_EXT                                           0x881B
+#define GL_RG16F_EXT                                            0x822F
+#define GL_R16F_EXT                                             0x822D
+#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT            0x8211
+#define GL_UNSIGNED_NORMALIZED_EXT                              0x8C17
+#endif
+
+/* GL_EXT_debug_label */
+#ifndef GL_EXT_debug_label
+#define GL_PROGRAM_PIPELINE_OBJECT_EXT                          0x8A4F
+#define GL_PROGRAM_OBJECT_EXT                                   0x8B40
+#define GL_SHADER_OBJECT_EXT                                    0x8B48
+#define GL_BUFFER_OBJECT_EXT                                    0x9151
+#define GL_QUERY_OBJECT_EXT                                     0x9153
+#define GL_VERTEX_ARRAY_OBJECT_EXT                              0x9154
+#endif
+
+/* GL_EXT_debug_marker */
+/* No new tokens introduced by this extension. */
+
 /* GL_EXT_discard_framebuffer */
 #ifndef GL_EXT_discard_framebuffer
 #define GL_COLOR_EXT                                            0x1800
@@ -204,9 +291,26 @@
 #define GL_STENCIL_EXT                                          0x1802
 #endif
 
+/* GL_EXT_multisampled_render_to_texture */
+#ifndef GL_EXT_multisampled_render_to_texture
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT           0x8D6C
+#define GL_RENDERBUFFER_SAMPLES_EXT                             0x9133
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT               0x9134
+#define GL_MAX_SAMPLES_EXT                                      0x9135
+#endif
+
 /* GL_EXT_multi_draw_arrays */
 /* No new tokens introduced by this extension. */
 
+/* GL_EXT_occlusion_query_boolean */
+#ifndef GL_EXT_occlusion_query_boolean
+#define GL_ANY_SAMPLES_PASSED_EXT                               0x8C2F
+#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT                  0x8D6A
+#define GL_CURRENT_QUERY_EXT                                    0x8865
+#define GL_QUERY_RESULT_EXT                                     0x8866
+#define GL_QUERY_RESULT_AVAILABLE_EXT                           0x8867
+#endif
+
 /* GL_EXT_read_format_bgra */
 #ifndef GL_EXT_read_format_bgra
 #define GL_BGRA_EXT                                             0x80E1
@@ -214,6 +318,53 @@
 #define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT                       0x8366
 #endif
 
+/* GL_EXT_robustness */
+#ifndef GL_EXT_robustness
+/* reuse GL_NO_ERROR */
+#define GL_GUILTY_CONTEXT_RESET_EXT                             0x8253
+#define GL_INNOCENT_CONTEXT_RESET_EXT                           0x8254
+#define GL_UNKNOWN_CONTEXT_RESET_EXT                            0x8255
+#define GL_CONTEXT_ROBUST_ACCESS_EXT                            0x90F3
+#define GL_RESET_NOTIFICATION_STRATEGY_EXT                      0x8256
+#define GL_LOSE_CONTEXT_ON_RESET_EXT                            0x8252
+#define GL_NO_RESET_NOTIFICATION_EXT                            0x8261
+#endif
+
+/* GL_EXT_separate_shader_objects */
+#ifndef GL_EXT_separate_shader_objects
+#define GL_VERTEX_SHADER_BIT_EXT                                0x00000001
+#define GL_FRAGMENT_SHADER_BIT_EXT                              0x00000002
+#define GL_ALL_SHADER_BITS_EXT                                  0xFFFFFFFF
+#define GL_PROGRAM_SEPARABLE_EXT                                0x8258
+#define GL_ACTIVE_PROGRAM_EXT                                   0x8259
+#define GL_PROGRAM_PIPELINE_BINDING_EXT                         0x825A
+#endif
+
+/* GL_EXT_shader_texture_lod */
+/* No new tokens introduced by this extension. */
+
+/* GL_EXT_shadow_samplers */
+#ifndef GL_EXT_shadow_samplers
+#define GL_TEXTURE_COMPARE_MODE_EXT                             0x884C
+#define GL_TEXTURE_COMPARE_FUNC_EXT                             0x884D
+#define GL_COMPARE_REF_TO_TEXTURE_EXT                           0x884E
+#define GL_SAMPLER_2D_SHADOW_EXT                                0x8B62
+#endif
+
+/* GL_EXT_sRGB */
+#ifndef GL_EXT_sRGB
+#define GL_SRGB_EXT                                             0x8C40
+#define GL_SRGB_ALPHA_EXT                                       0x8C42
+#define GL_SRGB8_ALPHA8_EXT                                     0x8C43
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT            0x8210
+#endif
+
+/* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT                         0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT                        0x83F1
+#endif
+
 /* GL_EXT_texture_filter_anisotropic */
 #ifndef GL_EXT_texture_filter_anisotropic
 #define GL_TEXTURE_MAX_ANISOTROPY_EXT                           0x84FE
@@ -225,15 +376,54 @@
 #define GL_BGRA_EXT                                             0x80E1
 #endif
 
+/* GL_EXT_texture_rg */
+#ifndef GL_EXT_texture_rg
+#define GL_RED_EXT                                              0x1903
+#define GL_RG_EXT                                               0x8227
+#define GL_R8_EXT                                               0x8229
+#define GL_RG8_EXT                                              0x822B
+#endif
+
+/* GL_EXT_texture_storage */
+#ifndef GL_EXT_texture_storage
+#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT                         0x912F
+#define GL_ALPHA8_EXT                                           0x803C  
+#define GL_LUMINANCE8_EXT                                       0x8040
+#define GL_LUMINANCE8_ALPHA8_EXT                                0x8045
+#define GL_RGBA32F_EXT                                          0x8814  
+#define GL_RGB32F_EXT                                           0x8815
+#define GL_ALPHA32F_EXT                                         0x8816
+#define GL_LUMINANCE32F_EXT                                     0x8818
+#define GL_LUMINANCE_ALPHA32F_EXT                               0x8819
+/* reuse GL_RGBA16F_EXT */
+#define GL_RGB16F_EXT                                           0x881B
+#define GL_ALPHA16F_EXT                                         0x881C
+#define GL_LUMINANCE16F_EXT                                     0x881E
+#define GL_LUMINANCE_ALPHA16F_EXT                               0x881F
+#define GL_RGB10_A2_EXT                                         0x8059  
+#define GL_RGB10_EXT                                            0x8052
+#define GL_BGRA8_EXT                                            0x93A1
+#endif
+
 /* GL_EXT_texture_type_2_10_10_10_REV */
 #ifndef GL_EXT_texture_type_2_10_10_10_REV
 #define GL_UNSIGNED_INT_2_10_10_10_REV_EXT                      0x8368
 #endif
 
-/* GL_EXT_texture_compression_dxt1 */
-#ifndef GL_EXT_texture_compression_dxt1
-#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT                         0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT                        0x83F1
+/* GL_EXT_unpack_subimage */
+#ifndef GL_EXT_unpack_subimage
+#define GL_UNPACK_ROW_LENGTH                                    0x0CF2
+#define GL_UNPACK_SKIP_ROWS                                     0x0CF3
+#define GL_UNPACK_SKIP_PIXELS                                   0x0CF4
+#endif
+
+/*------------------------------------------------------------------------*
+ * DMP extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_DMP_shader_binary */
+#ifndef GL_DMP_shader_binary
+#define GL_SHADER_BINARY_DMP                                    0x9250
 #endif
 
 /*------------------------------------------------------------------------*
@@ -276,13 +466,6 @@
  * NV extension tokens
  *------------------------------------------------------------------------*/
 
-/* GL_NV_fence */
-#ifndef GL_NV_fence
-#define GL_ALL_COMPLETED_NV                                     0x84F2
-#define GL_FENCE_STATUS_NV                                      0x84F3
-#define GL_FENCE_CONDITION_NV                                   0x84F4
-#endif
-
 /* GL_NV_coverage_sample */
 #ifndef GL_NV_coverage_sample
 #define GL_COVERAGE_COMPONENT_NV                                0x8ED0
@@ -301,10 +484,90 @@
 #define GL_DEPTH_COMPONENT16_NONLINEAR_NV                       0x8E2C
 #endif
 
+/* GL_NV_draw_buffers */
+#ifndef GL_NV_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_NV                                  0x8824
+#define GL_DRAW_BUFFER0_NV                                      0x8825
+#define GL_DRAW_BUFFER1_NV                                      0x8826
+#define GL_DRAW_BUFFER2_NV                                      0x8827
+#define GL_DRAW_BUFFER3_NV                                      0x8828
+#define GL_DRAW_BUFFER4_NV                                      0x8829
+#define GL_DRAW_BUFFER5_NV                                      0x882A
+#define GL_DRAW_BUFFER6_NV                                      0x882B
+#define GL_DRAW_BUFFER7_NV                                      0x882C
+#define GL_DRAW_BUFFER8_NV                                      0x882D
+#define GL_DRAW_BUFFER9_NV                                      0x882E
+#define GL_DRAW_BUFFER10_NV                                     0x882F
+#define GL_DRAW_BUFFER11_NV                                     0x8830
+#define GL_DRAW_BUFFER12_NV                                     0x8831
+#define GL_DRAW_BUFFER13_NV                                     0x8832
+#define GL_DRAW_BUFFER14_NV                                     0x8833
+#define GL_DRAW_BUFFER15_NV                                     0x8834
+#define GL_COLOR_ATTACHMENT0_NV                                 0x8CE0
+#define GL_COLOR_ATTACHMENT1_NV                                 0x8CE1
+#define GL_COLOR_ATTACHMENT2_NV                                 0x8CE2
+#define GL_COLOR_ATTACHMENT3_NV                                 0x8CE3
+#define GL_COLOR_ATTACHMENT4_NV                                 0x8CE4
+#define GL_COLOR_ATTACHMENT5_NV                                 0x8CE5
+#define GL_COLOR_ATTACHMENT6_NV                                 0x8CE6
+#define GL_COLOR_ATTACHMENT7_NV                                 0x8CE7
+#define GL_COLOR_ATTACHMENT8_NV                                 0x8CE8
+#define GL_COLOR_ATTACHMENT9_NV                                 0x8CE9
+#define GL_COLOR_ATTACHMENT10_NV                                0x8CEA
+#define GL_COLOR_ATTACHMENT11_NV                                0x8CEB
+#define GL_COLOR_ATTACHMENT12_NV                                0x8CEC
+#define GL_COLOR_ATTACHMENT13_NV                                0x8CED
+#define GL_COLOR_ATTACHMENT14_NV                                0x8CEE
+#define GL_COLOR_ATTACHMENT15_NV                                0x8CEF
+#endif
+
+/* GL_NV_fbo_color_attachments */
+#ifndef GL_NV_fbo_color_attachments
+#define GL_MAX_COLOR_ATTACHMENTS_NV                             0x8CDF
+/* GL_COLOR_ATTACHMENT{0-15}_NV defined in GL_NV_draw_buffers already. */
+#endif
+
+/* GL_NV_fence */
+#ifndef GL_NV_fence
+#define GL_ALL_COMPLETED_NV                                     0x84F2
+#define GL_FENCE_STATUS_NV                                      0x84F3
+#define GL_FENCE_CONDITION_NV                                   0x84F4
+#endif
+
+/* GL_NV_read_buffer */
+#ifndef GL_NV_read_buffer
+#define GL_READ_BUFFER_NV                                       0x0C02
+#endif
+
+/* GL_NV_read_buffer_front */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_read_depth */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_read_depth_stencil */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_read_stencil */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_texture_compression_s3tc_update */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_texture_npot_2D_mipmap */
+/* No new tokens introduced by this extension. */
+
 /*------------------------------------------------------------------------*
  * QCOM extension tokens
  *------------------------------------------------------------------------*/
 
+/* GL_QCOM_alpha_test */
+#ifndef GL_QCOM_alpha_test
+#define GL_ALPHA_TEST_QCOM                                      0x0BC0
+#define GL_ALPHA_TEST_FUNC_QCOM                                 0x0BC1
+#define GL_ALPHA_TEST_REF_QCOM                                  0x0BC2
+#endif
+
 /* GL_QCOM_driver_control */
 /* No new tokens introduced by this extension. */
 
@@ -373,6 +636,15 @@
 #endif
 
 /*------------------------------------------------------------------------*
+ * VIV extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_VIV_shader_binary */
+#ifndef GL_VIV_shader_binary
+#define GL_SHADER_BINARY_VIV                                    0x8FC4
+#endif
+
+/*------------------------------------------------------------------------*
  * End of extension tokens, start of corresponding extension functions
  *------------------------------------------------------------------------*/
 
@@ -416,6 +688,12 @@
 typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
 #endif
 
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+#define GL_OES_EGL_image_external 1
+/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */
+#endif
+
 /* GL_OES_element_index_uint */
 #ifndef GL_OES_element_index_uint
 #define GL_OES_element_index_uint 1
@@ -549,11 +827,6 @@
 #define GL_OES_vertex_type_10_10_10_2 1
 #endif
 
-/* GL_OES_EGL_image_external */
-#ifndef GL_OES_EGL_image_external
-#define GL_OES_EGL_image_external 1
-#endif
-
 /*------------------------------------------------------------------------*
  * AMD extension functions
  *------------------------------------------------------------------------*/
@@ -603,6 +876,72 @@
 #endif
 
 /*------------------------------------------------------------------------*
+ * ANGLE extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_ANGLE_framebuffer_blit */
+#ifndef GL_ANGLE_framebuffer_blit
+#define GL_ANGLE_framebuffer_blit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+
+/* GL_ANGLE_framebuffer_multisample */
+#ifndef GL_ANGLE_framebuffer_multisample
+#define GL_ANGLE_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+
+/*------------------------------------------------------------------------*
+ * APPLE extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_APPLE_rgb_422 */
+#ifndef GL_APPLE_rgb_422
+#define GL_APPLE_rgb_422 1
+#endif
+
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_APPLE_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_APPLE_texture_format_BGRA8888 1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_APPLE_texture_max_level 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_mali_shader_binary */
+#ifndef GL_ARM_mali_shader_binary
+#define GL_ARM_mali_shader_binary 1
+#endif
+
+/* GL_ARM_rgba8 */
+#ifndef GL_ARM_rgba8
+#define GL_ARM_rgba8 1
+#endif
+
+/*------------------------------------------------------------------------*
  * EXT extension functions
  *------------------------------------------------------------------------*/
 
@@ -611,6 +950,35 @@
 #define GL_EXT_blend_minmax 1
 #endif
 
+/* GL_EXT_color_buffer_half_float */
+#ifndef GL_EXT_color_buffer_half_float
+#define GL_EXT_color_buffer_half_float 1
+#endif
+
+/* GL_EXT_debug_label */
+#ifndef GL_EXT_debug_label
+#define GL_EXT_debug_label 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label);
+GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
+#endif
+typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label);
+typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
+#endif
+
+/* GL_EXT_debug_marker */
+#ifndef GL_EXT_debug_marker
+#define GL_EXT_debug_marker 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker);
+GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker);
+GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void);
+#endif
+typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker);
+typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker);
+typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void);
+#endif
+
 /* GL_EXT_discard_framebuffer */
 #ifndef GL_EXT_discard_framebuffer
 #define GL_EXT_discard_framebuffer 1
@@ -620,6 +988,17 @@
 typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
 #endif
 
+/* GL_EXT_multisampled_render_to_texture */
+#ifndef GL_EXT_multisampled_render_to_texture
+#define GL_EXT_multisampled_render_to_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+
 #ifndef GL_EXT_multi_draw_arrays
 #define GL_EXT_multi_draw_arrays 1
 #ifdef GL_GLEXT_PROTOTYPES
@@ -630,11 +1009,134 @@
 typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
 #endif
 
+/* GL_EXT_occlusion_query_boolean */
+#ifndef GL_EXT_occlusion_query_boolean
+#define GL_EXT_occlusion_query_boolean 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids);
+GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids);
+GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id);
+GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id);
+GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target);
+GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params);
+#endif
+typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids);
+typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id);
+typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id);
+typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
 /* GL_EXT_read_format_bgra */
 #ifndef GL_EXT_read_format_bgra
 #define GL_EXT_read_format_bgra 1
 #endif
 
+/* GL_EXT_robustness */
+#ifndef GL_EXT_robustness
+#define GL_EXT_robustness 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void);
+GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, float *params);
+GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+#endif
+typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void);
+typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, float *params);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+#endif
+
+/* GL_EXT_separate_shader_objects */
+#ifndef GL_EXT_separate_shader_objects
+#define GL_EXT_separate_shader_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program);
+GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program);
+GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings);
+GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline);
+GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines);
+GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines);
+GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline);
+GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
+GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint x);
+GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint x, GLint y);
+GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z);
+GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
+GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat x);
+GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat x, GLfloat y);
+GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline);
+GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+#endif
+typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
+typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program);
+typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings);
+typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
+typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines);
+typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines);
+typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
+typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint x);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint x, GLint y);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat x);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+#endif
+
+/* GL_EXT_shader_texture_lod */
+#ifndef GL_EXT_shader_texture_lod
+#define GL_EXT_shader_texture_lod 1
+#endif
+
+/* GL_EXT_shadow_samplers */
+#ifndef GL_EXT_shadow_samplers
+#define GL_EXT_shadow_samplers 1
+#endif
+
+/* GL_EXT_sRGB */
+#ifndef GL_EXT_sRGB
+#define GL_EXT_sRGB 1
+#endif
+
+/* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_EXT_texture_compression_dxt1 1
+#endif
+
 /* GL_EXT_texture_filter_anisotropic */
 #ifndef GL_EXT_texture_filter_anisotropic
 #define GL_EXT_texture_filter_anisotropic 1
@@ -645,14 +1147,47 @@
 #define GL_EXT_texture_format_BGRA8888 1
 #endif
 
+/* GL_EXT_texture_rg */
+#ifndef GL_EXT_texture_rg
+#define GL_EXT_texture_rg 1
+#endif
+
+/* GL_EXT_texture_storage */
+#ifndef GL_EXT_texture_storage
+#define GL_EXT_texture_storage 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+
 /* GL_EXT_texture_type_2_10_10_10_REV */
 #ifndef GL_EXT_texture_type_2_10_10_10_REV
 #define GL_EXT_texture_type_2_10_10_10_REV 1
 #endif
 
-/* GL_EXT_texture_compression_dxt1 */
-#ifndef GL_EXT_texture_compression_dxt1
-#define GL_EXT_texture_compression_dxt1 1
+/* GL_EXT_unpack_subimage */
+#ifndef GL_EXT_unpack_subimage
+#define GL_EXT_unpack_subimage 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * DMP extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_DMP_shader_binary */
+#ifndef GL_DMP_shader_binary
+#define GL_DMP_shader_binary 1
 #endif
 
 /*------------------------------------------------------------------------*
@@ -694,6 +1229,36 @@
  * NV extension functions
  *------------------------------------------------------------------------*/
 
+/* GL_NV_coverage_sample */
+#ifndef GL_NV_coverage_sample
+#define GL_NV_coverage_sample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
+GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
+#endif
+typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
+typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
+#endif
+
+/* GL_NV_depth_nonlinear */
+#ifndef GL_NV_depth_nonlinear
+#define GL_NV_depth_nonlinear 1
+#endif
+
+/* GL_NV_draw_buffers */
+#ifndef GL_NV_draw_buffers
+#define GL_NV_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs);
+#endif
+typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+/* GL_NV_fbo_color_attachments */
+#ifndef GL_NV_fbo_color_attachments
+#define GL_NV_fbo_color_attachments 1
+#endif
+
 /* GL_NV_fence */
 #ifndef GL_NV_fence
 #define GL_NV_fence 1
@@ -715,26 +1280,58 @@
 typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
 #endif
 
-/* GL_NV_coverage_sample */
-#ifndef GL_NV_coverage_sample
-#define GL_NV_coverage_sample 1
+/* GL_NV_read_buffer */
+#ifndef GL_NV_read_buffer
+#define GL_NV_read_buffer 1
 #ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
-GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
+GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode);
 #endif
-typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
-typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
+typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode);
 #endif
 
-/* GL_NV_depth_nonlinear */
-#ifndef GL_NV_depth_nonlinear
-#define GL_NV_depth_nonlinear 1
+/* GL_NV_read_buffer_front */
+#ifndef GL_NV_read_buffer_front
+#define GL_NV_read_buffer_front 1
+#endif
+
+/* GL_NV_read_depth */
+#ifndef GL_NV_read_depth
+#define GL_NV_read_depth 1
+#endif
+
+/* GL_NV_read_depth_stencil */
+#ifndef GL_NV_read_depth_stencil
+#define GL_NV_read_depth_stencil 1
+#endif
+
+/* GL_NV_read_stencil */
+#ifndef GL_NV_read_stencil
+#define GL_NV_read_stencil 1
+#endif
+
+/* GL_NV_texture_compression_s3tc_update */
+#ifndef GL_NV_texture_compression_s3tc_update
+#define GL_NV_texture_compression_s3tc_update 1
+#endif
+
+/* GL_NV_texture_npot_2D_mipmap */
+#ifndef GL_NV_texture_npot_2D_mipmap
+#define GL_NV_texture_npot_2D_mipmap 1
 #endif
 
 /*------------------------------------------------------------------------*
  * QCOM extension functions
  *------------------------------------------------------------------------*/
 
+/* GL_QCOM_alpha_test */
+#ifndef GL_QCOM_alpha_test
+#define GL_QCOM_alpha_test 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref);
+#endif
+typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref);
+#endif
+
 /* GL_QCOM_driver_control */
 #ifndef GL_QCOM_driver_control
 #define GL_QCOM_driver_control 1
@@ -809,6 +1406,15 @@
 typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
 #endif
 
+/*------------------------------------------------------------------------*
+ * VIV extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_VIV_shader_binary */
+#ifndef GL_VIV_shader_binary
+#define GL_VIV_shader_binary 1
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/opengl/libs/Android.mk b/opengl/libs/Android.mk
index 9c1a10e..66bc64d 100644
--- a/opengl/libs/Android.mk
+++ b/opengl/libs/Android.mk
@@ -18,7 +18,7 @@
 	EGL/Loader.cpp 	       \
 #
 
-LOCAL_SHARED_LIBRARIES += libcutils libutils libGLESv2_dbg
+LOCAL_SHARED_LIBRARIES += libcutils libutils libGLES_trace
 LOCAL_LDLIBS := -lpthread -ldl
 LOCAL_MODULE:= libEGL
 LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp
index 160abc2..2fc6125 100644
--- a/opengl/libs/EGL/Loader.cpp
+++ b/opengl/libs/EGL/Loader.cpp
@@ -28,7 +28,7 @@
 #include <EGL/egl.h>
 
 #include "egldefs.h"
-#include "glesv2dbg.h"
+#include "glestrace.h"
 #include "hooks.h"
 #include "Loader.h"
 
@@ -157,7 +157,7 @@
 
 Loader::~Loader()
 {
-    StopDebugServer();
+    GLTrace_stop();
 }
 
 const char* Loader::getTag(int dpy, int impl)
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index 60baeaa..e053589 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -37,7 +37,7 @@
 #include "egldefs.h"
 #include "egl_impl.h"
 #include "egl_tls.h"
-#include "glesv2dbg.h"
+#include "glestrace.h"
 #include "hooks.h"
 #include "Loader.h"
 
@@ -67,7 +67,6 @@
 static int sEGLApplicationTraceLevel;
 
 extern gl_hooks_t gHooksTrace;
-extern gl_hooks_t gHooksDebug;
 
 static inline void setGlTraceThreadSpecific(gl_hooks_t const *value) {
     pthread_setspecific(gGLTraceKey, value);
@@ -85,31 +84,27 @@
     sEGLTraceLevel = propertyLevel > applicationLevel ? propertyLevel : applicationLevel;
 
     property_get("debug.egl.debug_proc", value, "");
+    if (strlen(value) == 0)
+        return;
+
     long pid = getpid();
     char procPath[128] = {};
     sprintf(procPath, "/proc/%ld/cmdline", pid);
     FILE * file = fopen(procPath, "r");
-    if (file)
-    {
+    if (file) {
         char cmdline[256] = {};
-        if (fgets(cmdline, sizeof(cmdline) - 1, file))
-        {
-            if (!strcmp(value, cmdline))
+        if (fgets(cmdline, sizeof(cmdline) - 1, file)) {
+            if (!strncmp(value, cmdline, strlen(value))) {
+                // set EGL debug if the "debug.egl.debug_proc" property
+                // matches the prefix of this application's command line
                 gEGLDebugLevel = 1;
+            }
         }
         fclose(file);
     }
 
-    if (gEGLDebugLevel > 0)
-    {
-        property_get("debug.egl.debug_port", value, "5039");
-        const unsigned short port = (unsigned short)atoi(value);
-        property_get("debug.egl.debug_forceUseFile", value, "0");
-        const bool forceUseFile = (bool)atoi(value);
-        property_get("debug.egl.debug_maxFileSize", value, "8");
-        const unsigned int maxFileSize = atoi(value) << 20;
-        property_get("debug.egl.debug_filePath", value, "/data/local/tmp/dump.gles2dbg");
-        StartDebugServer(port, forceUseFile, maxFileSize, value);
+    if (gEGLDebugLevel > 0) {
+        GLTrace_start();
     }
 }
 
@@ -119,7 +114,7 @@
         setGlThreadSpecific(&gHooksTrace);
     } else if (gEGLDebugLevel > 0 && value != &gHooksNoContext) {
         setGlTraceThreadSpecific(value);
-        setGlThreadSpecific(&gHooksDebug);
+        setGlThreadSpecific(GLTrace_getGLHooks());
     } else {
         setGlThreadSpecific(value);
     }
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index d5e9cb8..8b37da5 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -37,7 +37,7 @@
 
 #include "egl_impl.h"
 #include "egl_tls.h"
-#include "glesv2dbg.h"
+#include "glestrace.h"
 #include "hooks.h"
 
 #include "egl_display.h"
@@ -112,7 +112,6 @@
 extern const __eglMustCastToProperFunctionPointerType gExtensionForwarders[MAX_NUMBER_OF_GL_EXTENSIONS];
 extern int gEGLDebugLevel;
 extern gl_hooks_t gHooksTrace;
-extern gl_hooks_t gHooksDebug;
 } // namespace android;
 
 // ----------------------------------------------------------------------------
@@ -478,6 +477,26 @@
     return result;
 }
 
+void EGLAPI eglBeginFrame(EGLDisplay dpy, EGLSurface surface) {
+    clearError();
+
+    egl_display_t const * const dp = validate_display(dpy);
+    if (!dp) {
+        return;
+    }
+
+    SurfaceRef _s(dp, surface);
+    if (!_s.get()) {
+        setError(EGL_BAD_SURFACE, EGL_FALSE);
+        return;
+    }
+
+    int64_t timestamp = systemTime(SYSTEM_TIME_MONOTONIC);
+
+    egl_surface_t const * const s = get_surface(surface);
+    native_window_set_buffers_timestamp(s->win.get(), timestamp);
+}
+
 // ----------------------------------------------------------------------------
 // Contexts
 // ----------------------------------------------------------------------------
@@ -516,6 +535,10 @@
             }
             egl_context_t* c = new egl_context_t(dpy, context, config,
                     dp->configs[intptr_t(config)].impl, cnx, version);
+#if EGL_TRACE
+            if (gEGLDebugLevel > 0)
+                GLTrace_eglCreateContext(version, c);
+#endif
             return c;
         }
     }
@@ -657,9 +680,10 @@
         if (ctx != EGL_NO_CONTEXT) {
             setGLHooksThreadSpecific(c->cnx->hooks[c->version]);
             egl_tls_t::setContext(ctx);
-            if (gEGLDebugLevel > 0) {
-                CreateDbgContext(c->version, c->cnx->hooks[c->version]);
-            }
+#if EGL_TRACE
+            if (gEGLDebugLevel > 0)
+                GLTrace_eglMakeCurrent(c->version, c->cnx->hooks[c->version], ctx);
+#endif
             _c.acquire();
             _r.acquire();
             _d.acquire();
@@ -886,6 +910,10 @@
                 "no more slots for eglGetProcAddress(\"%s\")",
                 procname);
 
+#if EGL_TRACE
+        gl_hooks_t *debugHooks = GLTrace_getGLHooks();
+#endif
+
         if (!addr && (slot < MAX_NUMBER_OF_GL_EXTENSIONS)) {
             bool found = false;
             for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) {
@@ -896,7 +924,7 @@
                     cnx->hooks[GLESv1_INDEX]->ext.extensions[slot] =
                     cnx->hooks[GLESv2_INDEX]->ext.extensions[slot] =
 #if EGL_TRACE
-                    gHooksDebug.ext.extensions[slot] = gHooksTrace.ext.extensions[slot] =
+                    debugHooks->ext.extensions[slot] = gHooksTrace.ext.extensions[slot] =
 #endif
                             cnx->egl.eglGetProcAddress(procname);
                 }
@@ -924,10 +952,6 @@
 
 EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw)
 {
-    EGLBoolean Debug_eglSwapBuffers(EGLDisplay dpy, EGLSurface draw);
-    if (gEGLDebugLevel > 0)
-        Debug_eglSwapBuffers(dpy, draw);
-
     clearError();
 
     egl_display_t const * const dp = validate_display(dpy);
@@ -937,6 +961,11 @@
     if (!_s.get())
         return setError(EGL_BAD_SURFACE, EGL_FALSE);
 
+#if EGL_TRACE
+    if (gEGLDebugLevel > 0)
+        GLTrace_eglSwapBuffers(dpy, draw);
+#endif
+
     egl_surface_t const * const s = get_surface(draw);
     return s->cnx->egl.eglSwapBuffers(dp->disp[s->impl].dpy, s->surface);
 }
@@ -1162,7 +1191,10 @@
         }
     }
     egl_tls_t::clearTLS();
-    dbgReleaseThread();
+#if EGL_TRACE
+    if (gEGLDebugLevel > 0)
+        GLTrace_eglReleaseThread();
+#endif
     return EGL_TRUE;
 }
 
diff --git a/opengl/libs/EGL/egl_tls.cpp b/opengl/libs/EGL/egl_tls.cpp
index cf144ce..41cfae1 100644
--- a/opengl/libs/EGL/egl_tls.cpp
+++ b/opengl/libs/EGL/egl_tls.cpp
@@ -33,7 +33,7 @@
 pthread_mutex_t egl_tls_t::sLockKey = PTHREAD_MUTEX_INITIALIZER;
 
 egl_tls_t::egl_tls_t()
-    : error(EGL_SUCCESS), ctx(0), logCallWithNoContext(EGL_TRUE), dbg(0) {
+    : error(EGL_SUCCESS), ctx(0), logCallWithNoContext(EGL_TRUE) {
 }
 
 const char *egl_tls_t::egl_strerror(EGLint err) {
diff --git a/opengl/libs/EGL/egl_tls.h b/opengl/libs/EGL/egl_tls.h
index 78b0b2f..2442ca0 100644
--- a/opengl/libs/EGL/egl_tls.h
+++ b/opengl/libs/EGL/egl_tls.h
@@ -37,7 +37,6 @@
     EGLint      error;
     EGLContext  ctx;
     EGLBoolean  logCallWithNoContext;
-    DbgContext* dbg;
 
     egl_tls_t();
     static void validateTLSKey();
diff --git a/opengl/libs/EGL/trace.cpp b/opengl/libs/EGL/trace.cpp
index d04ef10..52907c1 100644
--- a/opengl/libs/EGL/trace.cpp
+++ b/opengl/libs/EGL/trace.cpp
@@ -375,22 +375,6 @@
 #undef TRACE_GL_VOID
 #undef TRACE_GL
 
-// declare all Debug_gl* functions
-#define GL_ENTRY(_r, _api, ...) _r Debug_##_api ( __VA_ARGS__ );
-#include "glesv2dbg_functions.h"
-#undef GL_ENTRY
-
-#define GL_ENTRY(_r, _api, ...) Debug_ ## _api,
-EGLAPI gl_hooks_t gHooksDebug = {
-    {
-        #include "entries.in"
-    },
-    {
-        {0}
-    }
-};
-#undef GL_ENTRY
-
 // ----------------------------------------------------------------------------
 }; // namespace android
 // ----------------------------------------------------------------------------
diff --git a/opengl/libs/ETC1/etc1.cpp b/opengl/libs/ETC1/etc1.cpp
index 5ed2c3c..97d1085 100644
--- a/opengl/libs/ETC1/etc1.cpp
+++ b/opengl/libs/ETC1/etc1.cpp
@@ -149,13 +149,13 @@
 static
 inline int convert8To4(int b) {
     int c = b & 0xff;
-    return divideBy255(b * 15);
+    return divideBy255(c * 15);
 }
 
 static
 inline int convert8To5(int b) {
     int c = b & 0xff;
-    return divideBy255(b * 31);
+    return divideBy255(c * 31);
 }
 
 static
diff --git a/opengl/libs/GLES2/gl2ext_api.in b/opengl/libs/GLES2/gl2ext_api.in
index e965625..a8907fd 100644
--- a/opengl/libs/GLES2/gl2ext_api.in
+++ b/opengl/libs/GLES2/gl2ext_api.in
@@ -82,21 +82,204 @@
 void API_ENTRY(glGetPerfMonitorCounterDataAMD)(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten) {
     CALL_GL_API(glGetPerfMonitorCounterDataAMD, monitor, pname, dataSize, data, bytesWritten);
 }
+void API_ENTRY(glBlitFramebufferANGLE)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
+    CALL_GL_API(glBlitFramebufferANGLE, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+}
+void API_ENTRY(glRenderbufferStorageMultisampleANGLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glRenderbufferStorageMultisampleANGLE, target, samples, internalformat, width, height);
+}
+void API_ENTRY(glRenderbufferStorageMultisampleAPPLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glRenderbufferStorageMultisampleAPPLE, target, samples, internalformat, width, height);
+}
+void API_ENTRY(glResolveMultisampleFramebufferAPPLE)(void) {
+    CALL_GL_API(glResolveMultisampleFramebufferAPPLE);
+}
+void API_ENTRY(glLabelObjectEXT)(GLenum type, GLuint object, GLsizei length, const GLchar *label) {
+    CALL_GL_API(glLabelObjectEXT, type, object, length, label);
+}
+void API_ENTRY(glGetObjectLabelEXT)(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label) {
+    CALL_GL_API(glGetObjectLabelEXT, type, object, bufSize, length, label);
+}
+void API_ENTRY(glInsertEventMarkerEXT)(GLsizei length, const GLchar *marker) {
+    CALL_GL_API(glInsertEventMarkerEXT, length, marker);
+}
+void API_ENTRY(glPushGroupMarkerEXT)(GLsizei length, const GLchar *marker) {
+    CALL_GL_API(glPushGroupMarkerEXT, length, marker);
+}
+void API_ENTRY(glPopGroupMarkerEXT)(void) {
+    CALL_GL_API(glPopGroupMarkerEXT);
+}
 void API_ENTRY(glDiscardFramebufferEXT)(GLenum target, GLsizei numAttachments, const GLenum *attachments) {
     CALL_GL_API(glDiscardFramebufferEXT, target, numAttachments, attachments);
 }
+void API_ENTRY(glRenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glRenderbufferStorageMultisampleEXT, target, samples, internalformat, width, height);
+}
+void API_ENTRY(glFramebufferTexture2DMultisampleEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
+    CALL_GL_API(glFramebufferTexture2DMultisampleEXT, target, attachment, textarget, texture, level, samples);
+}
 void API_ENTRY(glMultiDrawArraysEXT)(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) {
     CALL_GL_API(glMultiDrawArraysEXT, mode, first, count, primcount);
 }
 void API_ENTRY(glMultiDrawElementsEXT)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount) {
     CALL_GL_API(glMultiDrawElementsEXT, mode, count, type, indices, primcount);
 }
+void API_ENTRY(glGenQueriesEXT)(GLsizei n, GLuint *ids) {
+    CALL_GL_API(glGenQueriesEXT, n, ids);
+}
+void API_ENTRY(glDeleteQueriesEXT)(GLsizei n, const GLuint *ids) {
+    CALL_GL_API(glDeleteQueriesEXT, n, ids);
+}
+GLboolean API_ENTRY(glIsQueryEXT)(GLuint id) {
+    CALL_GL_API_RETURN(glIsQueryEXT, id);
+}
+void API_ENTRY(glBeginQueryEXT)(GLenum target, GLuint id) {
+    CALL_GL_API(glBeginQueryEXT, target, id);
+}
+void API_ENTRY(glEndQueryEXT)(GLenum target) {
+    CALL_GL_API(glEndQueryEXT, target);
+}
+void API_ENTRY(glGetQueryivEXT)(GLenum target, GLenum pname, GLint *params) {
+    CALL_GL_API(glGetQueryivEXT, target, pname, params);
+}
+void API_ENTRY(glGetQueryObjectuivEXT)(GLuint id, GLenum pname, GLuint *params) {
+    CALL_GL_API(glGetQueryObjectuivEXT, id, pname, params);
+}
+GLenum API_ENTRY(glGetGraphicsResetStatusEXT)(void) {
+    CALL_GL_API_RETURN(glGetGraphicsResetStatusEXT);
+}
+void API_ENTRY(glReadnPixelsEXT)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data) {
+    CALL_GL_API(glReadnPixelsEXT, x, y, width, height, format, type, bufSize, data);
+}
+void API_ENTRY(glGetnUniformfvEXT)(GLuint program, GLint location, GLsizei bufSize, float *params) {
+    CALL_GL_API(glGetnUniformfvEXT, program, location, bufSize, params);
+}
+void API_ENTRY(glGetnUniformivEXT)(GLuint program, GLint location, GLsizei bufSize, GLint *params) {
+    CALL_GL_API(glGetnUniformivEXT, program, location, bufSize, params);
+}
+void API_ENTRY(glUseProgramStagesEXT)(GLuint pipeline, GLbitfield stages, GLuint program) {
+    CALL_GL_API(glUseProgramStagesEXT, pipeline, stages, program);
+}
+void API_ENTRY(glActiveShaderProgramEXT)(GLuint pipeline, GLuint program) {
+    CALL_GL_API(glActiveShaderProgramEXT, pipeline, program);
+}
+GLuint API_ENTRY(glCreateShaderProgramvEXT)(GLenum type, GLsizei count, const GLchar **strings) {
+    CALL_GL_API_RETURN(glCreateShaderProgramvEXT, type, count, strings);
+}
+void API_ENTRY(glBindProgramPipelineEXT)(GLuint pipeline) {
+    CALL_GL_API(glBindProgramPipelineEXT, pipeline);
+}
+void API_ENTRY(glDeleteProgramPipelinesEXT)(GLsizei n, const GLuint *pipelines) {
+    CALL_GL_API(glDeleteProgramPipelinesEXT, n, pipelines);
+}
+void API_ENTRY(glGenProgramPipelinesEXT)(GLsizei n, GLuint *pipelines) {
+    CALL_GL_API(glGenProgramPipelinesEXT, n, pipelines);
+}
+GLboolean API_ENTRY(glIsProgramPipelineEXT)(GLuint pipeline) {
+    CALL_GL_API_RETURN(glIsProgramPipelineEXT, pipeline);
+}
+void API_ENTRY(glProgramParameteriEXT)(GLuint program, GLenum pname, GLint value) {
+    CALL_GL_API(glProgramParameteriEXT, program, pname, value);
+}
+void API_ENTRY(glGetProgramPipelineivEXT)(GLuint pipeline, GLenum pname, GLint *params) {
+    CALL_GL_API(glGetProgramPipelineivEXT, pipeline, pname, params);
+}
+void API_ENTRY(glProgramUniform1iEXT)(GLuint program, GLint location, GLint x) {
+    CALL_GL_API(glProgramUniform1iEXT, program, location, x);
+}
+void API_ENTRY(glProgramUniform2iEXT)(GLuint program, GLint location, GLint x, GLint y) {
+    CALL_GL_API(glProgramUniform2iEXT, program, location, x, y);
+}
+void API_ENTRY(glProgramUniform3iEXT)(GLuint program, GLint location, GLint x, GLint y, GLint z) {
+    CALL_GL_API(glProgramUniform3iEXT, program, location, x, y, z);
+}
+void API_ENTRY(glProgramUniform4iEXT)(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w) {
+    CALL_GL_API(glProgramUniform4iEXT, program, location, x, y, z, w);
+}
+void API_ENTRY(glProgramUniform1fEXT)(GLuint program, GLint location, GLfloat x) {
+    CALL_GL_API(glProgramUniform1fEXT, program, location, x);
+}
+void API_ENTRY(glProgramUniform2fEXT)(GLuint program, GLint location, GLfloat x, GLfloat y) {
+    CALL_GL_API(glProgramUniform2fEXT, program, location, x, y);
+}
+void API_ENTRY(glProgramUniform3fEXT)(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z) {
+    CALL_GL_API(glProgramUniform3fEXT, program, location, x, y, z);
+}
+void API_ENTRY(glProgramUniform4fEXT)(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
+    CALL_GL_API(glProgramUniform4fEXT, program, location, x, y, z, w);
+}
+void API_ENTRY(glProgramUniform1ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value) {
+    CALL_GL_API(glProgramUniform1ivEXT, program, location, count, value);
+}
+void API_ENTRY(glProgramUniform2ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value) {
+    CALL_GL_API(glProgramUniform2ivEXT, program, location, count, value);
+}
+void API_ENTRY(glProgramUniform3ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value) {
+    CALL_GL_API(glProgramUniform3ivEXT, program, location, count, value);
+}
+void API_ENTRY(glProgramUniform4ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value) {
+    CALL_GL_API(glProgramUniform4ivEXT, program, location, count, value);
+}
+void API_ENTRY(glProgramUniform1fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
+    CALL_GL_API(glProgramUniform1fvEXT, program, location, count, value);
+}
+void API_ENTRY(glProgramUniform2fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
+    CALL_GL_API(glProgramUniform2fvEXT, program, location, count, value);
+}
+void API_ENTRY(glProgramUniform3fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
+    CALL_GL_API(glProgramUniform3fvEXT, program, location, count, value);
+}
+void API_ENTRY(glProgramUniform4fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
+    CALL_GL_API(glProgramUniform4fvEXT, program, location, count, value);
+}
+void API_ENTRY(glProgramUniformMatrix2fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    CALL_GL_API(glProgramUniformMatrix2fvEXT, program, location, count, transpose, value);
+}
+void API_ENTRY(glProgramUniformMatrix3fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    CALL_GL_API(glProgramUniformMatrix3fvEXT, program, location, count, transpose, value);
+}
+void API_ENTRY(glProgramUniformMatrix4fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    CALL_GL_API(glProgramUniformMatrix4fvEXT, program, location, count, transpose, value);
+}
+void API_ENTRY(glValidateProgramPipelineEXT)(GLuint pipeline) {
+    CALL_GL_API(glValidateProgramPipelineEXT, pipeline);
+}
+void API_ENTRY(glGetProgramPipelineInfoLogEXT)(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog) {
+    CALL_GL_API(glGetProgramPipelineInfoLogEXT, pipeline, bufSize, length, infoLog);
+}
+void API_ENTRY(glTexStorage1DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
+    CALL_GL_API(glTexStorage1DEXT, target, levels, internalformat, width);
+}
+void API_ENTRY(glTexStorage2DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glTexStorage2DEXT, target, levels, internalformat, width, height);
+}
+void API_ENTRY(glTexStorage3DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
+    CALL_GL_API(glTexStorage3DEXT, target, levels, internalformat, width, height, depth);
+}
+void API_ENTRY(glTextureStorage1DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
+    CALL_GL_API(glTextureStorage1DEXT, texture, target, levels, internalformat, width);
+}
+void API_ENTRY(glTextureStorage2DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glTextureStorage2DEXT, texture, target, levels, internalformat, width, height);
+}
+void API_ENTRY(glTextureStorage3DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
+    CALL_GL_API(glTextureStorage3DEXT, texture, target, levels, internalformat, width, height, depth);
+}
 void API_ENTRY(glRenderbufferStorageMultisampleIMG)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
     CALL_GL_API(glRenderbufferStorageMultisampleIMG, target, samples, internalformat, width, height);
 }
 void API_ENTRY(glFramebufferTexture2DMultisampleIMG)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
     CALL_GL_API(glFramebufferTexture2DMultisampleIMG, target, attachment, textarget, texture, level, samples);
 }
+void API_ENTRY(glCoverageMaskNV)(GLboolean mask) {
+    CALL_GL_API(glCoverageMaskNV, mask);
+}
+void API_ENTRY(glCoverageOperationNV)(GLenum operation) {
+    CALL_GL_API(glCoverageOperationNV, operation);
+}
+void API_ENTRY(glDrawBuffersNV)(GLsizei n, const GLenum *bufs) {
+    CALL_GL_API(glDrawBuffersNV, n, bufs);
+}
 void API_ENTRY(glDeleteFencesNV)(GLsizei n, const GLuint *fences) {
     CALL_GL_API(glDeleteFencesNV, n, fences);
 }
@@ -118,11 +301,11 @@
 void API_ENTRY(glSetFenceNV)(GLuint fence, GLenum condition) {
     CALL_GL_API(glSetFenceNV, fence, condition);
 }
-void API_ENTRY(glCoverageMaskNV)(GLboolean mask) {
-    CALL_GL_API(glCoverageMaskNV, mask);
+void API_ENTRY(glReadBufferNV)(GLenum mode) {
+    CALL_GL_API(glReadBufferNV, mode);
 }
-void API_ENTRY(glCoverageOperationNV)(GLenum operation) {
-    CALL_GL_API(glCoverageOperationNV, operation);
+void API_ENTRY(glAlphaFuncQCOM)(GLenum func, GLclampf ref) {
+    CALL_GL_API(glAlphaFuncQCOM, func, ref);
 }
 void API_ENTRY(glGetDriverControlsQCOM)(GLint *num, GLsizei size, GLuint *driverControls) {
     CALL_GL_API(glGetDriverControlsQCOM, num, size, driverControls);
diff --git a/opengl/libs/GLES2_dbg/generate_api_cpp.py b/opengl/libs/GLES2_dbg/generate_api_cpp.py
deleted file mode 100755
index 96cde57..0000000
--- a/opengl/libs/GLES2_dbg/generate_api_cpp.py
+++ /dev/null
@@ -1,219 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-#
-# Copyright 2011, 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.
-#
-
-import os
-import sys
-
-def RemoveAnnotation(line):
-    if line.find(":") >= 0:
-        annotation = line[line.find(":"): line.find(" ", line.find(":"))]
-        return line.replace(annotation, "*")
-    else:
-        return line
-
-def generate_api(lines):
-    externs = []
-    i = 0
-    # these have been hand written
-    skipFunctions = ["glDrawArrays", "glDrawElements"]
-
-    # these have an EXTEND_Debug_* macro for getting data
-    extendFunctions = ["glCopyTexImage2D", "glCopyTexSubImage2D", "glReadPixels",
-"glShaderSource", "glTexImage2D", "glTexSubImage2D"]
-
-    # these also needs to be forwarded to DbgContext
-    contextFunctions = ["glUseProgram", "glEnableVertexAttribArray", "glDisableVertexAttribArray",
-"glVertexAttribPointer", "glBindBuffer", "glBufferData", "glBufferSubData", "glDeleteBuffers",]
-
-    for line in lines:
-        if line.find("API_ENTRY(") >= 0: # a function prototype
-            returnType = line[0: line.find(" API_ENTRY(")]
-            functionName = line[line.find("(") + 1: line.find(")")] #extract GL function name
-            parameterList = line[line.find(")(") + 2: line.find(") {")]
-
-            #if line.find("*") >= 0:
-            #    extern = "%s Debug_%s(%s);" % (returnType, functionName, parameterList)
-            #    externs.append(extern)
-            #    continue
-
-            if functionName in skipFunctions:
-                sys.stderr.write("!\n! skipping function '%s'\n!\n" % (functionName))
-                continue
-
-            parameters = parameterList.split(',')
-            paramIndex = 0
-            if line.find("*") >= 0 and (line.find("*") < line.find(":") or line.find("*") > line.rfind(":")): # unannotated pointer
-                if not functionName in extendFunctions:
-                    # add function to list of functions that should be hand written, but generate code anyways
-                    extern = "%s Debug_%s(%s);" % (returnType, functionName, RemoveAnnotation(parameterList))
-                    sys.stderr.write("%s should be hand written\n" % (extern))
-                    print "// FIXME: this function has pointers, it should be hand written"
-                    externs.append(extern)
-
-            print "%s Debug_%s(%s)\n{" % (returnType, functionName, RemoveAnnotation(parameterList))
-            print "    glesv2debugger::Message msg;"
-
-            if parameterList == "void":
-                parameters = []
-            arguments = ""
-            paramNames = []
-            inout = ""
-            getData = ""
-
-            callerMembers = ""
-            setCallerMembers = ""
-            setMsgParameters = ""
-
-            for parameter in parameters:
-                const = parameter.find("const")
-                parameter = parameter.replace("const", "")
-                parameter = parameter.strip()
-                paramType = parameter.split(' ')[0]
-                paramName = parameter.split(' ')[1]
-                annotation = ""
-                arguments += paramName
-                if parameter.find(":") >= 0: # has annotation
-                    assert inout == "" # only one parameter should be annotated
-                    sys.stderr.write("%s is annotated: %s \n" % (functionName, paramType))
-                    inout = paramType.split(":")[2]
-                    annotation = paramType.split(":")[1]
-                    paramType = paramType.split(":")[0]
-                    count = 1
-                    countArg = ""
-                    if annotation.find("*") >= 0: # [1,n] * param
-                        count = int(annotation.split("*")[0])
-                        countArg = annotation.split("*")[1]
-                        assert countArg in paramNames
-                    elif annotation in paramNames:
-                        count = 1
-                        countArg = annotation
-                    elif annotation == "GLstring":
-                        annotation = "strlen(%s)" % (paramName)
-                    else:
-                        count = int(annotation)
-
-                    setMsgParameters += "    msg.set_arg%d(ToInt(%s));\n" % (paramIndex, paramName)
-                    if paramType.find("void") >= 0:
-                        getData += "    msg.mutable_data()->assign(reinterpret_cast<const char *>(%s), %s * sizeof(char));" % (paramName, annotation)
-                    else:
-                        getData += "    msg.mutable_data()->assign(reinterpret_cast<const char *>(%s), %s * sizeof(%s));" % (paramName, annotation, paramType)
-                    paramType += "*"
-                else:
-                    if paramType == "GLfloat" or paramType == "GLclampf" or paramType.find("*") >= 0:
-                        setMsgParameters += "    msg.set_arg%d(ToInt(%s));\n" % (paramIndex, paramName)
-                    else:
-                        setMsgParameters += "    msg.set_arg%d(%s);\n" % (paramIndex, paramName)
-                if paramIndex < len(parameters) - 1:
-                        arguments += ', '
-                if const >= 0:
-                    paramType = "const " + paramType
-                paramNames.append(paramName)
-                paramIndex += 1
-                callerMembers += "        %s %s;\n" % (paramType, paramName)
-                setCallerMembers += "    caller.%s = %s;\n" % (paramName, paramName)
-
-            print "    struct : public FunctionCall {"
-            print callerMembers
-            print "        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {"
-            if inout in ["out", "inout"]: # get timing excluding output data copy
-                print "            nsecs_t c0 = systemTime(timeMode);"
-            if returnType == "void":
-                print "            _c->%s(%s);" % (functionName, arguments)
-            else:
-                print "            const int * ret = reinterpret_cast<const int *>(_c->%s(%s));" % (functionName, arguments)
-                print "            msg.set_ret(ToInt(ret));"
-            if inout in ["out", "inout"]:
-                print "            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);"
-                print "        " + getData
-            if functionName in extendFunctions:
-                print "\
-#ifdef EXTEND_AFTER_CALL_Debug_%s\n\
-            EXTEND_AFTER_CALL_Debug_%s;\n\
-#endif" % (functionName, functionName)
-            if functionName in contextFunctions:
-                print "            getDbgContextThreadSpecific()->%s(%s);" % (functionName, arguments)
-            if returnType == "void":
-                print "            return 0;"
-            else:
-                print "            return ret;"
-            print """        }
-    } caller;"""
-            print setCallerMembers
-            print setMsgParameters
-
-            if line.find("*") >= 0 or line.find(":") >= 0:
-                print "    // FIXME: check for pointer usage"
-            if inout in ["in", "inout"]:
-                print getData
-            if functionName in extendFunctions:
-                print "\
-#ifdef EXTEND_Debug_%s\n\
-    EXTEND_Debug_%s;\n\
-#endif" % (functionName, functionName)
-            print "    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_%s);"\
-                % (functionName)
-            if returnType != "void":
-                if returnType == "GLboolean":
-                    print "    return static_cast<GLboolean>(reinterpret_cast<int>(ret));"
-                else:
-                    print "    return reinterpret_cast<%s>(ret);" % (returnType)
-            print "}\n"
-
-
-    print "// FIXME: the following functions should be written by hand"
-    for extern in externs:
-        print extern
-
-if __name__ == "__main__":
-    print """\
-/*
- ** Copyright 2011, 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.
- */
-
-// auto generated by generate_api_cpp.py
-
-#include <utils/Debug.h>
-
-#include "src/header.h"
-#include "src/api.h"
-
-template<typename T> static int ToInt(const T & t)
-{
-    COMPILE_TIME_ASSERT_FUNCTION_SCOPE(sizeof(T) == sizeof(int));
-    return (int &)t;
-}
-"""
-    lines = open("gl2_api_annotated.in").readlines()
-    generate_api(lines)
-    #lines = open("gl2ext_api.in").readlines()
-    #generate_api(lines)
-
-
diff --git a/opengl/libs/GLES2_dbg/generate_caller_cpp.py b/opengl/libs/GLES2_dbg/generate_caller_cpp.py
deleted file mode 100755
index ee4208d..0000000
--- a/opengl/libs/GLES2_dbg/generate_caller_cpp.py
+++ /dev/null
@@ -1,199 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-#
-# Copyright 2011, 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.
-#
-
-import os
-import sys
-
-externs = []
-    
-def generate_caller(lines):
-    i = 0
-    output = ""
-    skipFunctions = []
-    
-    for line in lines:
-        if line.find("API_ENTRY(") >= 0: # a function prototype
-            returnType = line[0: line.find(" API_ENTRY(")]
-            functionName = line[line.find("(") + 1: line.find(")")] #extract GL function name
-            parameterList = line[line.find(")(") + 2: line.find(") {")]
-            
-            #if line.find("*") >= 0:
-            #    extern = "%s Debug_%s(%s);" % (returnType, functionName, parameterList)
-            #    externs.append(extern)
-            #    continue
-            
-            if functionName in skipFunctions:
-                sys.stderr.write("!\n! skipping function '%s'\n!\n" % functionName)
-                continue
-            output += "\
-    case glesv2debugger::Message_Function_%s:\n" % functionName
-            parameters = parameterList.split(',')
-            paramIndex = 0
-            if line.find("*") >= 0 and (line.find("*") < line.find(":") or line.find("*") > line.rfind(":")): # unannotated pointer
-                # add function to list of functions that should be hand written, but generate code anyways
-                externs.append(functionName)
-                output += "\
-        ret = GenerateCall_%s(dbg, cmd, msg, prevRet);\n\
-        break;\n" % (functionName)
-                continue
-            elif line.find(":out") >= 0 or line.find(":inout") >= 0:
-                externs.append(functionName)
-                output += "\
-        ret = GenerateCall_%s(dbg, cmd, msg, prevRet);\n\
-        break; // annotated output pointers\n" % (functionName)
-                continue
-                
-            if parameterList == "void":
-                parameters = []
-            arguments = ""
-            paramNames = []
-            inout = ""
-            getData = ""
-            
-            callerMembers = ""
-
-            for parameter in parameters:
-                const = parameter.find("const")
-                parameter = parameter.replace("const", "")
-                parameter = parameter.strip()
-                paramType = parameter.split(' ')[0]
-                paramName = parameter.split(' ')[1]
-                annotation = ""
-                if parameter.find(":") >= 0: # has annotation
-                    assert inout == "" # only one parameter should be annotated
-                    sys.stderr.write("%s is annotated: %s \n" % (functionName, paramType))
-                    inout = paramType.split(":")[2]
-                    annotation = paramType.split(":")[1]
-                    paramType = paramType.split(":")[0]
-                    count = 1
-                    countArg = ""
-                    if annotation.find("*") >= 0: # [1,n] * param
-                        count = int(annotation.split("*")[0])
-                        countArg = annotation.split("*")[1]
-                        assert countArg in paramNames
-                    elif annotation in paramNames:
-                        count = 1
-                        countArg = annotation
-                    elif annotation == "GLstring":
-                        annotation = "strlen(%s)" % (paramName)
-                    else:
-                        count = int(annotation)
-            
-                    paramType += "*"
-                    arguments += "reinterpret_cast<%s>(const_cast<char *>(cmd.data().data()))" % (paramType)
-                elif paramType == "GLboolean":
-                    arguments += "GLboolean(cmd.arg%d())" % (paramIndex)
-                else:
-                    arguments += "static_cast<%s>(cmd.arg%d())" % (paramType, paramIndex)
-
-                if paramIndex < len(parameters) - 1:
-                        arguments += ", "
-                if len(arguments) - arguments.rfind("\n") > 60 :
-                    arguments += "\n\
-            "
-                if const >= 0:
-                    paramType = "const " + paramType
-                paramNames.append(paramName)
-                paramIndex += 1
-                
-            if returnType == "void":
-                output += "\
-        dbg->hooks->gl.%s(\n\
-            %s);\n\
-        break;\n" % (functionName, arguments)
-            else:
-                output += "\
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.%s(\n\
-            %s)));\n\
-        if (cmd.has_ret())\n\
-            ret = reinterpret_cast<int *>(msg.ret());\n\
-        break;\n" % (functionName, arguments)
-    return output
-
-if __name__ == "__main__":
-
-    lines = open("gl2_api_annotated.in").readlines()
-    output = generate_caller(lines)
-    
-    out = open("src/caller.cpp", "w")
-    out.write("""\
-/*
- ** Copyright 2011, 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.
- */
-
-// auto generated by generate_caller_cpp.py
-// implement declarations in caller.h
-
-#include "header.h"
-
-namespace android {
-
-""")
-
-    for extern in externs:
-        out.write("\
-static const int * GenerateCall_%s(DbgContext * const dbg,\n\
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);\n" % (extern))
-        print("\
-static const int * GenerateCall_%s(DbgContext * const dbg,\n\
-                            const glesv2debugger::Message & cmd,\n\
-                            glesv2debugger::Message & msg, const int * const prevRet)\n\
-{ assert(0); return prevRet; }\n" % (extern))
-                     
-    out.write(
-"""
-#include "caller.h"
-
-const int * GenerateCall(DbgContext * const dbg, const glesv2debugger::Message & cmd,
-                  glesv2debugger::Message & msg, const int * const prevRet)
-{
-    LOGD("GenerateCall function=%u", cmd.function());
-    const int * ret = prevRet; // only some functions have return value
-    nsecs_t c0 = systemTime(timeMode);
-    switch (cmd.function()) {""")
-    
-    out.write(output)
-    
-    out.write("""\
-    default:
-        assert(0);
-    }
-    msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-    msg.set_context_id(reinterpret_cast<int>(dbg));
-    msg.set_function(cmd.function());
-    msg.set_type(glesv2debugger::Message_Type_AfterCall);
-    return ret;
-}
-
-}; // name space android {
-""")           
-    
-            
diff --git a/opengl/libs/GLES2_dbg/generate_debug_in.py b/opengl/libs/GLES2_dbg/generate_debug_in.py
deleted file mode 100755
index 1280c6f..0000000
--- a/opengl/libs/GLES2_dbg/generate_debug_in.py
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-#
-# Copyright 2011, 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.
-#
-
-import os
-import sys
-
-def append_functions(functions, lines):
-	i = 0
-	for line in lines:
-		if line.find("API_ENTRY(") >= 0: # a function prototype
-			returnType = line[0: line.find(" API_ENTRY(")]
-			functionName = line[line.find("(") + 1: line.find(")")] #extract GL function name
-			parameterList = line[line.find(")(") + 2: line.find(") {")]
-			
-			functions.append(functionName)
-			#print functionName
-			continue
-				
-			parameters = parameterList.split(',')
-			paramIndex = 0
-			if line.find("*") >= 0:
-				print "// FIXME: this function has pointers, it should be hand written"
-				externs.append("%s Tracing_%s(%s);" % (returnType, functionName, parameterList))
-			print "%s Tracing_%s(%s)\n{" % (returnType, functionName, parameterList)
-			
-			if parameterList == "void":
-				parameters = []
-			
-			arguments = ""
-			 
-			for parameter in parameters:
-				parameter = parameter.replace("const", "")
-				parameter = parameter.strip()
-				paramType = parameter.split(' ')[0]
-				paramName = parameter.split(' ')[1]
-				
-				paramIndex += 1
-				
-	return functions
-	
-
-
-if __name__ == "__main__":
-	definedFunctions = []
-	lines = open("gl2_api_annotated.in").readlines()
-	definedFunctions = append_functions(definedFunctions, lines)
-	
-	output = open("../debug.in", "w")
-	lines = open("../trace.in").readlines()
-	output.write("// the following functions are not defined in GLESv2_dbg\n")
-	for line in lines:
-		functionName = ""
-		if line.find("TRACE_GL(") >= 0: # a function prototype
-			functionName = line.split(',')[1].strip()
-		elif line.find("TRACE_GL_VOID(") >= 0: # a function prototype
-			functionName = line[line.find("(") + 1: line.find(",")] #extract GL function name
-		else:
-			continue
-		if functionName in definedFunctions:
-			#print functionName
-			continue
-		else:
-			output.write(line)
-	
diff --git a/opengl/libs/GLES2_dbg/generate_debugger_message_proto.py b/opengl/libs/GLES2_dbg/generate_debugger_message_proto.py
deleted file mode 100755
index 535b13e..0000000
--- a/opengl/libs/GLES2_dbg/generate_debugger_message_proto.py
+++ /dev/null
@@ -1,155 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-#
-# Copyright 2011, 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.
-#
-
-import os
-
-def generate_egl_entries(output, lines, i):
-    for line in lines:
-        if line.find("EGL_ENTRY(") >= 0:
-            line = line.split(",")[1].strip() #extract EGL function name
-            output.write("        %s = %d;\n" % (line, i))
-            i += 1
-    return i
-
-
-def generate_gl_entries(output,lines,i):
-    for line in lines:
-        if line.find("API_ENTRY(") >= 0:
-            line = line[line.find("(") + 1: line.find(")")] #extract GL function name
-            output.write("        %s = %d;\n" % (line, i))
-            i += 1
-    return i
-
-
-if __name__ == "__main__":
-    output = open("debugger_message.proto",'w')
-    output.write("""\
-/*
- * Copyright (C) 2011 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.
- */
-
-// do not edit; auto generated by generate_debugger_message_proto.py
-
-package com.android.glesv2debugger;
-
-option optimize_for = LITE_RUNTIME;
-
-message Message
-{
-    required int32 context_id = 1; // GL context id
-    enum Function
-    {
-""")
-
-    i = 0;
-
-    lines = open("gl2_api_annotated.in").readlines()
-    i = generate_gl_entries(output, lines, i)
-    output.write("        // end of GL functions\n")
-
-    #lines = open("gl2ext_api.in").readlines()
-    #i = generate_gl_entries(output, lines, i)
-    #output.write("        // end of GL EXT functions\n")
-
-    lines = open("../EGL/egl_entries.in").readlines()
-    i = generate_egl_entries(output, lines, i)
-    output.write("        // end of GL EXT functions\n")
-
-    output.write("        ACK = %d;\n" % (i))
-    i += 1
-
-    output.write("        NEG = %d;\n" % (i))
-    i += 1
-
-    output.write("        CONTINUE = %d;\n" % (i))
-    i += 1
-
-    output.write("        SKIP = %d;\n" % (i))
-    i += 1
-
-    output.write("        SETPROP = %d;\n" % (i))
-    i += 1
-
-    output.write("""    }
-    required Function function = 2 [default = NEG]; // type/function of message
-    enum Type
-    {
-        BeforeCall = 0;
-        AfterCall = 1;
-        AfterGeneratedCall = 2;
-        Response = 3; // currently used for misc messages
-        CompleteCall = 4; // BeforeCall and AfterCall merged
-    }
-    required Type type = 3;
-    required bool expect_response = 4;
-    optional int32 ret = 5; // return value from previous GL call
-    optional int32 arg0 = 6; // args to GL call
-    optional int32 arg1 = 7;
-    optional int32 arg2 = 8;
-    optional int32 arg3 = 9;
-    optional int32 arg4 = 16;
-    optional int32 arg5 = 17;
-    optional int32 arg6 = 18;
-    optional int32 arg7 = 19; // glDrawArrays/Elements sets this to active number of attributes
-    optional int32 arg8 = 20;
-
-    optional bytes data = 10; // variable length data used for GL call
-    enum DataType
-    {
-        ReferencedImage = 0; // for image sourced from ReadPixels
-        NonreferencedImage = 1; // for image sourced from ReadPixels
-    };
-    // most data types can be inferred from function
-    optional DataType data_type = 23;
-    // these are used for image data when they cannot be determined from args
-    optional int32 pixel_format = 24;
-    optional int32 pixel_type = 25;
-    optional int32 image_width = 26;
-    optional int32 image_height = 27;
-
-    optional float time = 11; // duration of previous GL call (ms)
-    enum Prop
-    {
-        CaptureDraw = 0; // arg0 = number of glDrawArrays/Elements to glReadPixels
-        TimeMode = 1; // arg0 = SYSTEM_TIME_* in utils/Timers.h
-        ExpectResponse = 2; // arg0 = enum Function, arg1 = true/false
-        CaptureSwap = 3; // arg0 = number of eglSwapBuffers to glReadPixels
-        GLConstant = 4; // arg0 = GLenum, arg1 = constant; send GL impl. constants
-    };
-    optional Prop prop = 21; // used with SETPROP, value in arg0
-    optional float clock = 22; // wall clock in seconds
-}
-""")
-
-    output.close()
-
-    os.system("aprotoc --cpp_out=src --java_out=../../../../../development/tools/glesv2debugger/src debugger_message.proto")
-    os.system('mv -f "src/debugger_message.pb.cc" "src/debugger_message.pb.cpp"')
diff --git a/opengl/libs/GLES2_dbg/gl2_api_annotated.in b/opengl/libs/GLES2_dbg/gl2_api_annotated.in
deleted file mode 100644
index 227e2eb..0000000
--- a/opengl/libs/GLES2_dbg/gl2_api_annotated.in
+++ /dev/null
@@ -1,426 +0,0 @@
-void API_ENTRY(glActiveTexture)(GLenum texture) {
-    CALL_GL_API(glActiveTexture, texture);
-}
-void API_ENTRY(glAttachShader)(GLuint program, GLuint shader) {
-    CALL_GL_API(glAttachShader, program, shader);
-}
-void API_ENTRY(glBindAttribLocation)(GLuint program, GLuint index, const GLchar:GLstring:in name) {
-    CALL_GL_API(glBindAttribLocation, program, index, name);
-}
-void API_ENTRY(glBindBuffer)(GLenum target, GLuint buffer) {
-    CALL_GL_API(glBindBuffer, target, buffer);
-}
-void API_ENTRY(glBindFramebuffer)(GLenum target, GLuint framebuffer) {
-    CALL_GL_API(glBindFramebuffer, target, framebuffer);
-}
-void API_ENTRY(glBindRenderbuffer)(GLenum target, GLuint renderbuffer) {
-    CALL_GL_API(glBindRenderbuffer, target, renderbuffer);
-}
-void API_ENTRY(glBindTexture)(GLenum target, GLuint texture) {
-    CALL_GL_API(glBindTexture, target, texture);
-}
-void API_ENTRY(glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
-    CALL_GL_API(glBlendColor, red, green, blue, alpha);
-}
-void API_ENTRY(glBlendEquation)( GLenum mode ) {
-    CALL_GL_API(glBlendEquation, mode);
-}
-void API_ENTRY(glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha) {
-    CALL_GL_API(glBlendEquationSeparate, modeRGB, modeAlpha);
-}
-void API_ENTRY(glBlendFunc)(GLenum sfactor, GLenum dfactor) {
-    CALL_GL_API(glBlendFunc, sfactor, dfactor);
-}
-void API_ENTRY(glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
-    CALL_GL_API(glBlendFuncSeparate, srcRGB, dstRGB, srcAlpha, dstAlpha);
-}
-void API_ENTRY(glBufferData)(GLenum target, GLsizeiptr size, const GLvoid:size:in data, GLenum usage) {
-    CALL_GL_API(glBufferData, target, size, data, usage);
-}
-void API_ENTRY(glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid:size:in data) {
-    CALL_GL_API(glBufferSubData, target, offset, size, data);
-}
-GLenum API_ENTRY(glCheckFramebufferStatus)(GLenum target) {
-    CALL_GL_API_RETURN(glCheckFramebufferStatus, target);
-}
-void API_ENTRY(glClear)(GLbitfield mask) {
-    CALL_GL_API(glClear, mask);
-}
-void API_ENTRY(glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
-    CALL_GL_API(glClearColor, red, green, blue, alpha);
-}
-void API_ENTRY(glClearDepthf)(GLclampf depth) {
-    CALL_GL_API(glClearDepthf, depth);
-}
-void API_ENTRY(glClearStencil)(GLint s) {
-    CALL_GL_API(glClearStencil, s);
-}
-void API_ENTRY(glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
-    CALL_GL_API(glColorMask, red, green, blue, alpha);
-}
-void API_ENTRY(glCompileShader)(GLuint shader) {
-    CALL_GL_API(glCompileShader, shader);
-}
-void API_ENTRY(glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data) {
-    CALL_GL_API(glCompressedTexImage2D, target, level, internalformat, width, height, border, imageSize, data);
-}
-void API_ENTRY(glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data) {
-    CALL_GL_API(glCompressedTexSubImage2D, target, level, xoffset, yoffset, width, height, format, imageSize, data);
-}
-void API_ENTRY(glCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
-    CALL_GL_API(glCopyTexImage2D, target, level, internalformat, x, y, width, height, border);
-}
-void API_ENTRY(glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
-    CALL_GL_API(glCopyTexSubImage2D, target, level, xoffset, yoffset, x, y, width, height);
-}
-GLuint API_ENTRY(glCreateProgram)(void) {
-    CALL_GL_API_RETURN(glCreateProgram);
-}
-GLuint API_ENTRY(glCreateShader)(GLenum type) {
-    CALL_GL_API_RETURN(glCreateShader, type);
-}
-void API_ENTRY(glCullFace)(GLenum mode) {
-    CALL_GL_API(glCullFace, mode);
-}
-void API_ENTRY(glDeleteBuffers)(GLsizei n, const GLuint:n:in buffers) {
-    CALL_GL_API(glDeleteBuffers, n, buffers);
-}
-void API_ENTRY(glDeleteFramebuffers)(GLsizei n, const GLuint:n:in framebuffers) {
-    CALL_GL_API(glDeleteFramebuffers, n, framebuffers);
-}
-void API_ENTRY(glDeleteProgram)(GLuint program) {
-    CALL_GL_API(glDeleteProgram, program);
-}
-void API_ENTRY(glDeleteRenderbuffers)(GLsizei n, const GLuint:n:in renderbuffers) {
-    CALL_GL_API(glDeleteRenderbuffers, n, renderbuffers);
-}
-void API_ENTRY(glDeleteShader)(GLuint shader) {
-    CALL_GL_API(glDeleteShader, shader);
-}
-void API_ENTRY(glDeleteTextures)(GLsizei n, const GLuint:n:in textures) {
-    CALL_GL_API(glDeleteTextures, n, textures);
-}
-void API_ENTRY(glDepthFunc)(GLenum func) {
-    CALL_GL_API(glDepthFunc, func);
-}
-void API_ENTRY(glDepthMask)(GLboolean flag) {
-    CALL_GL_API(glDepthMask, flag);
-}
-void API_ENTRY(glDepthRangef)(GLclampf zNear, GLclampf zFar) {
-    CALL_GL_API(glDepthRangef, zNear, zFar);
-}
-void API_ENTRY(glDetachShader)(GLuint program, GLuint shader) {
-    CALL_GL_API(glDetachShader, program, shader);
-}
-void API_ENTRY(glDisable)(GLenum cap) {
-    CALL_GL_API(glDisable, cap);
-}
-void API_ENTRY(glDisableVertexAttribArray)(GLuint index) {
-    CALL_GL_API(glDisableVertexAttribArray, index);
-}
-void API_ENTRY(glDrawArrays)(GLenum mode, GLint first, GLsizei count) {
-    CALL_GL_API(glDrawArrays, mode, first, count);
-}
-void API_ENTRY(glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) {
-    CALL_GL_API(glDrawElements, mode, count, type, indices);
-}
-void API_ENTRY(glEnable)(GLenum cap) {
-    CALL_GL_API(glEnable, cap);
-}
-void API_ENTRY(glEnableVertexAttribArray)(GLuint index) {
-    CALL_GL_API(glEnableVertexAttribArray, index);
-}
-void API_ENTRY(glFinish)(void) {
-    CALL_GL_API(glFinish);
-}
-void API_ENTRY(glFlush)(void) {
-    CALL_GL_API(glFlush);
-}
-void API_ENTRY(glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
-    CALL_GL_API(glFramebufferRenderbuffer, target, attachment, renderbuffertarget, renderbuffer);
-}
-void API_ENTRY(glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
-    CALL_GL_API(glFramebufferTexture2D, target, attachment, textarget, texture, level);
-}
-void API_ENTRY(glFrontFace)(GLenum mode) {
-    CALL_GL_API(glFrontFace, mode);
-}
-void API_ENTRY(glGenBuffers)(GLsizei n, GLuint:n:out buffers) {
-    CALL_GL_API(glGenBuffers, n, buffers);
-}
-void API_ENTRY(glGenerateMipmap)(GLenum target) {
-    CALL_GL_API(glGenerateMipmap, target);
-}
-void API_ENTRY(glGenFramebuffers)(GLsizei n, GLuint:n:out framebuffers) {
-    CALL_GL_API(glGenFramebuffers, n, framebuffers);
-}
-void API_ENTRY(glGenRenderbuffers)(GLsizei n, GLuint:n:out renderbuffers) {
-    CALL_GL_API(glGenRenderbuffers, n, renderbuffers);
-}
-void API_ENTRY(glGenTextures)(GLsizei n, GLuint:n:out textures) {
-    CALL_GL_API(glGenTextures, n, textures);
-}
-void API_ENTRY(glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar:GLstring:in name) {
-    CALL_GL_API(glGetActiveAttrib, program, index, bufsize, length, size, type, name);
-}
-void API_ENTRY(glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar:GLstring:in name) {
-    CALL_GL_API(glGetActiveUniform, program, index, bufsize, length, size, type, name);
-}
-void API_ENTRY(glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) {
-    CALL_GL_API(glGetAttachedShaders, program, maxcount, count, shaders);
-}
-int API_ENTRY(glGetAttribLocation)(GLuint program, const GLchar:GLstring:in name) {
-    CALL_GL_API_RETURN(glGetAttribLocation, program, name);
-}
-void API_ENTRY(glGetBooleanv)(GLenum pname, GLboolean* params) {
-    CALL_GL_API(glGetBooleanv, pname, params);
-}
-void API_ENTRY(glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params) {
-    CALL_GL_API(glGetBufferParameteriv, target, pname, params);
-}
-GLenum API_ENTRY(glGetError)(void) {
-    CALL_GL_API_RETURN(glGetError);
-}
-void API_ENTRY(glGetFloatv)(GLenum pname, GLfloat* params) {
-    CALL_GL_API(glGetFloatv, pname, params);
-}
-void API_ENTRY(glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params) {
-    CALL_GL_API(glGetFramebufferAttachmentParameteriv, target, attachment, pname, params);
-}
-void API_ENTRY(glGetIntegerv)(GLenum pname, GLint* params) {
-    CALL_GL_API(glGetIntegerv, pname, params);
-}
-void API_ENTRY(glGetProgramiv)(GLuint program, GLenum pname, GLint:1:out params) {
-    CALL_GL_API(glGetProgramiv, program, pname, params);
-}
-void API_ENTRY(glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, GLchar:GLstring:out infolog) {
-    CALL_GL_API(glGetProgramInfoLog, program, bufsize, length, infolog);
-}
-void API_ENTRY(glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params) {
-    CALL_GL_API(glGetRenderbufferParameteriv, target, pname, params);
-}
-void API_ENTRY(glGetShaderiv)(GLuint shader, GLenum pname, GLint:1:out params) {
-    CALL_GL_API(glGetShaderiv, shader, pname, params);
-}
-void API_ENTRY(glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar:GLstring:out infolog) {
-    CALL_GL_API(glGetShaderInfoLog, shader, bufsize, length, infolog);
-}
-void API_ENTRY(glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) {
-    CALL_GL_API(glGetShaderPrecisionFormat, shadertype, precisiontype, range, precision);
-}
-void API_ENTRY(glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar:GLstring:out source) {
-    CALL_GL_API(glGetShaderSource, shader, bufsize, length, source);
-}
-const GLubyte* API_ENTRY(glGetString)(GLenum name) {
-    CALL_GL_API_RETURN(glGetString, name);
-}
-void API_ENTRY(glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat* params) {
-    CALL_GL_API(glGetTexParameterfv, target, pname, params);
-}
-void API_ENTRY(glGetTexParameteriv)(GLenum target, GLenum pname, GLint* params) {
-    CALL_GL_API(glGetTexParameteriv, target, pname, params);
-}
-void API_ENTRY(glGetUniformfv)(GLuint program, GLint location, GLfloat* params) {
-    CALL_GL_API(glGetUniformfv, program, location, params);
-}
-void API_ENTRY(glGetUniformiv)(GLuint program, GLint location, GLint* params) {
-    CALL_GL_API(glGetUniformiv, program, location, params);
-}
-int API_ENTRY(glGetUniformLocation)(GLuint program, const GLchar:GLstring:in name) {
-    CALL_GL_API_RETURN(glGetUniformLocation, program, name);
-}
-void API_ENTRY(glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params) {
-    CALL_GL_API(glGetVertexAttribfv, index, pname, params);
-}
-void API_ENTRY(glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params) {
-    CALL_GL_API(glGetVertexAttribiv, index, pname, params);
-}
-void API_ENTRY(glGetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid** pointer) {
-    CALL_GL_API(glGetVertexAttribPointerv, index, pname, pointer);
-}
-void API_ENTRY(glHint)(GLenum target, GLenum mode) {
-    CALL_GL_API(glHint, target, mode);
-}
-GLboolean API_ENTRY(glIsBuffer)(GLuint buffer) {
-    CALL_GL_API_RETURN(glIsBuffer, buffer);
-}
-GLboolean API_ENTRY(glIsEnabled)(GLenum cap) {
-    CALL_GL_API_RETURN(glIsEnabled, cap);
-}
-GLboolean API_ENTRY(glIsFramebuffer)(GLuint framebuffer) {
-    CALL_GL_API_RETURN(glIsFramebuffer, framebuffer);
-}
-GLboolean API_ENTRY(glIsProgram)(GLuint program) {
-    CALL_GL_API_RETURN(glIsProgram, program);
-}
-GLboolean API_ENTRY(glIsRenderbuffer)(GLuint renderbuffer) {
-    CALL_GL_API_RETURN(glIsRenderbuffer, renderbuffer);
-}
-GLboolean API_ENTRY(glIsShader)(GLuint shader) {
-    CALL_GL_API_RETURN(glIsShader, shader);
-}
-GLboolean API_ENTRY(glIsTexture)(GLuint texture) {
-    CALL_GL_API_RETURN(glIsTexture, texture);
-}
-void API_ENTRY(glLineWidth)(GLfloat width) {
-    CALL_GL_API(glLineWidth, width);
-}
-void API_ENTRY(glLinkProgram)(GLuint program) {
-    CALL_GL_API(glLinkProgram, program);
-}
-void API_ENTRY(glPixelStorei)(GLenum pname, GLint param) {
-    CALL_GL_API(glPixelStorei, pname, param);
-}
-void API_ENTRY(glPolygonOffset)(GLfloat factor, GLfloat units) {
-    CALL_GL_API(glPolygonOffset, factor, units);
-}
-void API_ENTRY(glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) {
-    CALL_GL_API(glReadPixels, x, y, width, height, format, type, pixels);
-}
-void API_ENTRY(glReleaseShaderCompiler)(void) {
-    CALL_GL_API(glReleaseShaderCompiler);
-}
-void API_ENTRY(glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
-    CALL_GL_API(glRenderbufferStorage, target, internalformat, width, height);
-}
-void API_ENTRY(glSampleCoverage)(GLclampf value, GLboolean invert) {
-    CALL_GL_API(glSampleCoverage, value, invert);
-}
-void API_ENTRY(glScissor)(GLint x, GLint y, GLsizei width, GLsizei height) {
-    CALL_GL_API(glScissor, x, y, width, height);
-}
-void API_ENTRY(glShaderBinary)(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length) {
-    CALL_GL_API(glShaderBinary, n, shaders, binaryformat, binary, length);
-}
-void API_ENTRY(glShaderSource)(GLuint shader, GLsizei count, const GLchar** string, const GLint* length) {
-    CALL_GL_API(glShaderSource, shader, count, string, length);
-}
-void API_ENTRY(glStencilFunc)(GLenum func, GLint ref, GLuint mask) {
-    CALL_GL_API(glStencilFunc, func, ref, mask);
-}
-void API_ENTRY(glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask) {
-    CALL_GL_API(glStencilFuncSeparate, face, func, ref, mask);
-}
-void API_ENTRY(glStencilMask)(GLuint mask) {
-    CALL_GL_API(glStencilMask, mask);
-}
-void API_ENTRY(glStencilMaskSeparate)(GLenum face, GLuint mask) {
-    CALL_GL_API(glStencilMaskSeparate, face, mask);
-}
-void API_ENTRY(glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass) {
-    CALL_GL_API(glStencilOp, fail, zfail, zpass);
-}
-void API_ENTRY(glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) {
-    CALL_GL_API(glStencilOpSeparate, face, fail, zfail, zpass);
-}
-void API_ENTRY(glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) {
-    CALL_GL_API(glTexImage2D, target, level, internalformat, width, height, border, format, type, pixels);
-}
-void API_ENTRY(glTexParameterf)(GLenum target, GLenum pname, GLfloat param) {
-    CALL_GL_API(glTexParameterf, target, pname, param);
-}
-void API_ENTRY(glTexParameterfv)(GLenum target, GLenum pname, const GLfloat* params) {
-    CALL_GL_API(glTexParameterfv, target, pname, params);
-}
-void API_ENTRY(glTexParameteri)(GLenum target, GLenum pname, GLint param) {
-    CALL_GL_API(glTexParameteri, target, pname, param);
-}
-void API_ENTRY(glTexParameteriv)(GLenum target, GLenum pname, const GLint* params) {
-    CALL_GL_API(glTexParameteriv, target, pname, params);
-}
-void API_ENTRY(glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels) {
-    CALL_GL_API(glTexSubImage2D, target, level, xoffset, yoffset, width, height, format, type, pixels);
-}
-void API_ENTRY(glUniform1f)(GLint location, GLfloat x) {
-    CALL_GL_API(glUniform1f, location, x);
-}
-void API_ENTRY(glUniform1fv)(GLint location, GLsizei count, const GLfloat:1*count:in v) {
-    CALL_GL_API(glUniform1fv, location, count, v);
-}
-void API_ENTRY(glUniform1i)(GLint location, GLint x) {
-    CALL_GL_API(glUniform1i, location, x);
-}
-void API_ENTRY(glUniform1iv)(GLint location, GLsizei count, const GLint:1*count:in v) {
-    CALL_GL_API(glUniform1iv, location, count, v);
-}
-void API_ENTRY(glUniform2f)(GLint location, GLfloat x, GLfloat y) {
-    CALL_GL_API(glUniform2f, location, x, y);
-}
-void API_ENTRY(glUniform2fv)(GLint location, GLsizei count, const GLfloat:2*count:in v) {
-    CALL_GL_API(glUniform2fv, location, count, v);
-}
-void API_ENTRY(glUniform2i)(GLint location, GLint x, GLint y) {
-    CALL_GL_API(glUniform2i, location, x, y);
-}
-void API_ENTRY(glUniform2iv)(GLint location, GLsizei count, const GLint:2*count:in v) {
-    CALL_GL_API(glUniform2iv, location, count, v);
-}
-void API_ENTRY(glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z) {
-    CALL_GL_API(glUniform3f, location, x, y, z);
-}
-void API_ENTRY(glUniform3fv)(GLint location, GLsizei count, const GLfloat:3*count:in v) {
-    CALL_GL_API(glUniform3fv, location, count, v);
-}
-void API_ENTRY(glUniform3i)(GLint location, GLint x, GLint y, GLint z) {
-    CALL_GL_API(glUniform3i, location, x, y, z);
-}
-void API_ENTRY(glUniform3iv)(GLint location, GLsizei count, const GLint:3*count:in v) {
-    CALL_GL_API(glUniform3iv, location, count, v);
-}
-void API_ENTRY(glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
-    CALL_GL_API(glUniform4f, location, x, y, z, w);
-}
-void API_ENTRY(glUniform4fv)(GLint location, GLsizei count, const GLfloat:4*count:in v) {
-    CALL_GL_API(glUniform4fv, location, count, v);
-}
-void API_ENTRY(glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w) {
-    CALL_GL_API(glUniform4i, location, x, y, z, w);
-}
-void API_ENTRY(glUniform4iv)(GLint location, GLsizei count, const GLint:4*count:in v) {
-    CALL_GL_API(glUniform4iv, location, count, v);
-}
-void API_ENTRY(glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat:4*count:in value) {
-    CALL_GL_API(glUniformMatrix2fv, location, count, transpose, value);
-}
-void API_ENTRY(glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat:9*count:in value) {
-    CALL_GL_API(glUniformMatrix3fv, location, count, transpose, value);
-}
-void API_ENTRY(glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat:16*count:in value) {
-    CALL_GL_API(glUniformMatrix4fv, location, count, transpose, value);
-}
-void API_ENTRY(glUseProgram)(GLuint program) {
-    CALL_GL_API(glUseProgram, program);
-}
-void API_ENTRY(glValidateProgram)(GLuint program) {
-    CALL_GL_API(glValidateProgram, program);
-}
-void API_ENTRY(glVertexAttrib1f)(GLuint indx, GLfloat x) {
-    CALL_GL_API(glVertexAttrib1f, indx, x);
-}
-void API_ENTRY(glVertexAttrib1fv)(GLuint indx, const GLfloat:1:in values) {
-    CALL_GL_API(glVertexAttrib1fv, indx, values);
-}
-void API_ENTRY(glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y) {
-    CALL_GL_API(glVertexAttrib2f, indx, x, y);
-}
-void API_ENTRY(glVertexAttrib2fv)(GLuint indx, const GLfloat:2:in values) {
-    CALL_GL_API(glVertexAttrib2fv, indx, values);
-}
-void API_ENTRY(glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z) {
-    CALL_GL_API(glVertexAttrib3f, indx, x, y, z);
-}
-void API_ENTRY(glVertexAttrib3fv)(GLuint indx, const GLfloat:3:in values) {
-    CALL_GL_API(glVertexAttrib3fv, indx, values);
-}
-void API_ENTRY(glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
-    CALL_GL_API(glVertexAttrib4f, indx, x, y, z, w);
-}
-void API_ENTRY(glVertexAttrib4fv)(GLuint indx, const GLfloat:4:in values) {
-    CALL_GL_API(glVertexAttrib4fv, indx, values);
-}
-void API_ENTRY(glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr) {
-    CALL_GL_API(glVertexAttribPointer, indx, size, type, normalized, stride, ptr);
-}
-void API_ENTRY(glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) {
-    CALL_GL_API(glViewport, x, y, width, height);
-}
diff --git a/opengl/libs/GLES2_dbg/src/api.cpp b/opengl/libs/GLES2_dbg/src/api.cpp
deleted file mode 100644
index c483547..0000000
--- a/opengl/libs/GLES2_dbg/src/api.cpp
+++ /dev/null
@@ -1,3540 +0,0 @@
-/*
- ** Copyright 2011, 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.
- */
- 
-// auto generated by generate_api_cpp.py
-
-#include <utils/Debug.h>
-
-#include "src/header.h"
-#include "src/api.h"
-
-template<typename T> static int ToInt(const T & t)
-{
-    COMPILE_TIME_ASSERT_FUNCTION_SCOPE(sizeof(T) == sizeof(int));
-    return (int &)t;
-}
-
-void Debug_glActiveTexture(GLenum texture)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum texture;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glActiveTexture(texture);
-            return 0;
-        }
-    } caller;
-    caller.texture = texture;
-
-    msg.set_arg0(texture);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glActiveTexture);
-}
-
-void Debug_glAttachShader(GLuint program, GLuint shader)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLuint shader;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glAttachShader(program, shader);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.shader = shader;
-
-    msg.set_arg0(program);
-    msg.set_arg1(shader);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glAttachShader);
-}
-
-void Debug_glBindAttribLocation(GLuint program, GLuint index, const GLchar* name)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLuint index;
-        const GLchar* name;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBindAttribLocation(program, index, name);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.index = index;
-    caller.name = name;
-
-    msg.set_arg0(program);
-    msg.set_arg1(index);
-    msg.set_arg2(ToInt(name));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(name), strlen(name) * sizeof(GLchar));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBindAttribLocation);
-}
-
-void Debug_glBindBuffer(GLenum target, GLuint buffer)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLuint buffer;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBindBuffer(target, buffer);
-            getDbgContextThreadSpecific()->glBindBuffer(target, buffer);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.buffer = buffer;
-
-    msg.set_arg0(target);
-    msg.set_arg1(buffer);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBindBuffer);
-}
-
-void Debug_glBindFramebuffer(GLenum target, GLuint framebuffer)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLuint framebuffer;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBindFramebuffer(target, framebuffer);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.framebuffer = framebuffer;
-
-    msg.set_arg0(target);
-    msg.set_arg1(framebuffer);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBindFramebuffer);
-}
-
-void Debug_glBindRenderbuffer(GLenum target, GLuint renderbuffer)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLuint renderbuffer;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBindRenderbuffer(target, renderbuffer);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.renderbuffer = renderbuffer;
-
-    msg.set_arg0(target);
-    msg.set_arg1(renderbuffer);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBindRenderbuffer);
-}
-
-void Debug_glBindTexture(GLenum target, GLuint texture)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLuint texture;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBindTexture(target, texture);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.texture = texture;
-
-    msg.set_arg0(target);
-    msg.set_arg1(texture);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBindTexture);
-}
-
-void Debug_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLclampf red;
-        GLclampf green;
-        GLclampf blue;
-        GLclampf alpha;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBlendColor(red, green, blue, alpha);
-            return 0;
-        }
-    } caller;
-    caller.red = red;
-    caller.green = green;
-    caller.blue = blue;
-    caller.alpha = alpha;
-
-    msg.set_arg0(ToInt(red));
-    msg.set_arg1(ToInt(green));
-    msg.set_arg2(ToInt(blue));
-    msg.set_arg3(ToInt(alpha));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBlendColor);
-}
-
-void Debug_glBlendEquation( GLenum mode )
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum mode;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBlendEquation(mode);
-            return 0;
-        }
-    } caller;
-    caller.mode = mode;
-
-    msg.set_arg0(mode);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBlendEquation);
-}
-
-void Debug_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum modeRGB;
-        GLenum modeAlpha;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBlendEquationSeparate(modeRGB, modeAlpha);
-            return 0;
-        }
-    } caller;
-    caller.modeRGB = modeRGB;
-    caller.modeAlpha = modeAlpha;
-
-    msg.set_arg0(modeRGB);
-    msg.set_arg1(modeAlpha);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBlendEquationSeparate);
-}
-
-void Debug_glBlendFunc(GLenum sfactor, GLenum dfactor)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum sfactor;
-        GLenum dfactor;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBlendFunc(sfactor, dfactor);
-            return 0;
-        }
-    } caller;
-    caller.sfactor = sfactor;
-    caller.dfactor = dfactor;
-
-    msg.set_arg0(sfactor);
-    msg.set_arg1(dfactor);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBlendFunc);
-}
-
-void Debug_glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum srcRGB;
-        GLenum dstRGB;
-        GLenum srcAlpha;
-        GLenum dstAlpha;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
-            return 0;
-        }
-    } caller;
-    caller.srcRGB = srcRGB;
-    caller.dstRGB = dstRGB;
-    caller.srcAlpha = srcAlpha;
-    caller.dstAlpha = dstAlpha;
-
-    msg.set_arg0(srcRGB);
-    msg.set_arg1(dstRGB);
-    msg.set_arg2(srcAlpha);
-    msg.set_arg3(dstAlpha);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBlendFuncSeparate);
-}
-
-void Debug_glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLsizeiptr size;
-        const GLvoid* data;
-        GLenum usage;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBufferData(target, size, data, usage);
-            getDbgContextThreadSpecific()->glBufferData(target, size, data, usage);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.size = size;
-    caller.data = data;
-    caller.usage = usage;
-
-    msg.set_arg0(target);
-    msg.set_arg1(size);
-    msg.set_arg2(ToInt(data));
-    msg.set_arg3(usage);
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(data), size * sizeof(char));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBufferData);
-}
-
-void Debug_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLintptr offset;
-        GLsizeiptr size;
-        const GLvoid* data;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glBufferSubData(target, offset, size, data);
-            getDbgContextThreadSpecific()->glBufferSubData(target, offset, size, data);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.offset = offset;
-    caller.size = size;
-    caller.data = data;
-
-    msg.set_arg0(target);
-    msg.set_arg1(offset);
-    msg.set_arg2(size);
-    msg.set_arg3(ToInt(data));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(data), size * sizeof(char));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBufferSubData);
-}
-
-GLenum Debug_glCheckFramebufferStatus(GLenum target)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glCheckFramebufferStatus(target));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.target = target;
-
-    msg.set_arg0(target);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCheckFramebufferStatus);
-    return reinterpret_cast<GLenum>(ret);
-}
-
-void Debug_glClear(GLbitfield mask)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLbitfield mask;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glClear(mask);
-            return 0;
-        }
-    } caller;
-    caller.mask = mask;
-
-    msg.set_arg0(mask);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glClear);
-}
-
-void Debug_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLclampf red;
-        GLclampf green;
-        GLclampf blue;
-        GLclampf alpha;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glClearColor(red, green, blue, alpha);
-            return 0;
-        }
-    } caller;
-    caller.red = red;
-    caller.green = green;
-    caller.blue = blue;
-    caller.alpha = alpha;
-
-    msg.set_arg0(ToInt(red));
-    msg.set_arg1(ToInt(green));
-    msg.set_arg2(ToInt(blue));
-    msg.set_arg3(ToInt(alpha));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glClearColor);
-}
-
-void Debug_glClearDepthf(GLclampf depth)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLclampf depth;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glClearDepthf(depth);
-            return 0;
-        }
-    } caller;
-    caller.depth = depth;
-
-    msg.set_arg0(ToInt(depth));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glClearDepthf);
-}
-
-void Debug_glClearStencil(GLint s)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint s;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glClearStencil(s);
-            return 0;
-        }
-    } caller;
-    caller.s = s;
-
-    msg.set_arg0(s);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glClearStencil);
-}
-
-void Debug_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLboolean red;
-        GLboolean green;
-        GLboolean blue;
-        GLboolean alpha;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glColorMask(red, green, blue, alpha);
-            return 0;
-        }
-    } caller;
-    caller.red = red;
-    caller.green = green;
-    caller.blue = blue;
-    caller.alpha = alpha;
-
-    msg.set_arg0(red);
-    msg.set_arg1(green);
-    msg.set_arg2(blue);
-    msg.set_arg3(alpha);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glColorMask);
-}
-
-void Debug_glCompileShader(GLuint shader)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint shader;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glCompileShader(shader);
-            return 0;
-        }
-    } caller;
-    caller.shader = shader;
-
-    msg.set_arg0(shader);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCompileShader);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLint level;
-        GLenum internalformat;
-        GLsizei width;
-        GLsizei height;
-        GLint border;
-        GLsizei imageSize;
-        const GLvoid* data;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.level = level;
-    caller.internalformat = internalformat;
-    caller.width = width;
-    caller.height = height;
-    caller.border = border;
-    caller.imageSize = imageSize;
-    caller.data = data;
-
-    msg.set_arg0(target);
-    msg.set_arg1(level);
-    msg.set_arg2(internalformat);
-    msg.set_arg3(width);
-    msg.set_arg4(height);
-    msg.set_arg5(border);
-    msg.set_arg6(imageSize);
-    msg.set_arg7(ToInt(data));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCompressedTexImage2D);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLint level;
-        GLint xoffset;
-        GLint yoffset;
-        GLsizei width;
-        GLsizei height;
-        GLenum format;
-        GLsizei imageSize;
-        const GLvoid* data;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.level = level;
-    caller.xoffset = xoffset;
-    caller.yoffset = yoffset;
-    caller.width = width;
-    caller.height = height;
-    caller.format = format;
-    caller.imageSize = imageSize;
-    caller.data = data;
-
-    msg.set_arg0(target);
-    msg.set_arg1(level);
-    msg.set_arg2(xoffset);
-    msg.set_arg3(yoffset);
-    msg.set_arg4(width);
-    msg.set_arg5(height);
-    msg.set_arg6(format);
-    msg.set_arg7(imageSize);
-    msg.set_arg8(ToInt(data));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCompressedTexSubImage2D);
-}
-
-void Debug_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLint level;
-        GLenum internalformat;
-        GLint x;
-        GLint y;
-        GLsizei width;
-        GLsizei height;
-        GLint border;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
-#ifdef EXTEND_AFTER_CALL_Debug_glCopyTexImage2D
-            EXTEND_AFTER_CALL_Debug_glCopyTexImage2D;
-#endif
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.level = level;
-    caller.internalformat = internalformat;
-    caller.x = x;
-    caller.y = y;
-    caller.width = width;
-    caller.height = height;
-    caller.border = border;
-
-    msg.set_arg0(target);
-    msg.set_arg1(level);
-    msg.set_arg2(internalformat);
-    msg.set_arg3(x);
-    msg.set_arg4(y);
-    msg.set_arg5(width);
-    msg.set_arg6(height);
-    msg.set_arg7(border);
-
-#ifdef EXTEND_Debug_glCopyTexImage2D
-    EXTEND_Debug_glCopyTexImage2D;
-#endif
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCopyTexImage2D);
-}
-
-void Debug_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLint level;
-        GLint xoffset;
-        GLint yoffset;
-        GLint x;
-        GLint y;
-        GLsizei width;
-        GLsizei height;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
-#ifdef EXTEND_AFTER_CALL_Debug_glCopyTexSubImage2D
-            EXTEND_AFTER_CALL_Debug_glCopyTexSubImage2D;
-#endif
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.level = level;
-    caller.xoffset = xoffset;
-    caller.yoffset = yoffset;
-    caller.x = x;
-    caller.y = y;
-    caller.width = width;
-    caller.height = height;
-
-    msg.set_arg0(target);
-    msg.set_arg1(level);
-    msg.set_arg2(xoffset);
-    msg.set_arg3(yoffset);
-    msg.set_arg4(x);
-    msg.set_arg5(y);
-    msg.set_arg6(width);
-    msg.set_arg7(height);
-
-#ifdef EXTEND_Debug_glCopyTexSubImage2D
-    EXTEND_Debug_glCopyTexSubImage2D;
-#endif
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCopyTexSubImage2D);
-}
-
-GLuint Debug_glCreateProgram(void)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glCreateProgram());
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCreateProgram);
-    return reinterpret_cast<GLuint>(ret);
-}
-
-GLuint Debug_glCreateShader(GLenum type)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum type;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glCreateShader(type));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.type = type;
-
-    msg.set_arg0(type);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCreateShader);
-    return reinterpret_cast<GLuint>(ret);
-}
-
-void Debug_glCullFace(GLenum mode)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum mode;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glCullFace(mode);
-            return 0;
-        }
-    } caller;
-    caller.mode = mode;
-
-    msg.set_arg0(mode);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCullFace);
-}
-
-void Debug_glDeleteBuffers(GLsizei n, const GLuint* buffers)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        const GLuint* buffers;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDeleteBuffers(n, buffers);
-            getDbgContextThreadSpecific()->glDeleteBuffers(n, buffers);
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.buffers = buffers;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(buffers));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(buffers), n * sizeof(GLuint));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteBuffers);
-}
-
-void Debug_glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        const GLuint* framebuffers;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDeleteFramebuffers(n, framebuffers);
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.framebuffers = framebuffers;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(framebuffers));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(framebuffers), n * sizeof(GLuint));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteFramebuffers);
-}
-
-void Debug_glDeleteProgram(GLuint program)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDeleteProgram(program);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-
-    msg.set_arg0(program);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteProgram);
-}
-
-void Debug_glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        const GLuint* renderbuffers;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDeleteRenderbuffers(n, renderbuffers);
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.renderbuffers = renderbuffers;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(renderbuffers));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(renderbuffers), n * sizeof(GLuint));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteRenderbuffers);
-}
-
-void Debug_glDeleteShader(GLuint shader)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint shader;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDeleteShader(shader);
-            return 0;
-        }
-    } caller;
-    caller.shader = shader;
-
-    msg.set_arg0(shader);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteShader);
-}
-
-void Debug_glDeleteTextures(GLsizei n, const GLuint* textures)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        const GLuint* textures;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDeleteTextures(n, textures);
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.textures = textures;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(textures));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(textures), n * sizeof(GLuint));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteTextures);
-}
-
-void Debug_glDepthFunc(GLenum func)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum func;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDepthFunc(func);
-            return 0;
-        }
-    } caller;
-    caller.func = func;
-
-    msg.set_arg0(func);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDepthFunc);
-}
-
-void Debug_glDepthMask(GLboolean flag)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLboolean flag;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDepthMask(flag);
-            return 0;
-        }
-    } caller;
-    caller.flag = flag;
-
-    msg.set_arg0(flag);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDepthMask);
-}
-
-void Debug_glDepthRangef(GLclampf zNear, GLclampf zFar)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLclampf zNear;
-        GLclampf zFar;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDepthRangef(zNear, zFar);
-            return 0;
-        }
-    } caller;
-    caller.zNear = zNear;
-    caller.zFar = zFar;
-
-    msg.set_arg0(ToInt(zNear));
-    msg.set_arg1(ToInt(zFar));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDepthRangef);
-}
-
-void Debug_glDetachShader(GLuint program, GLuint shader)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLuint shader;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDetachShader(program, shader);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.shader = shader;
-
-    msg.set_arg0(program);
-    msg.set_arg1(shader);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDetachShader);
-}
-
-void Debug_glDisable(GLenum cap)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum cap;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDisable(cap);
-            return 0;
-        }
-    } caller;
-    caller.cap = cap;
-
-    msg.set_arg0(cap);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDisable);
-}
-
-void Debug_glDisableVertexAttribArray(GLuint index)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint index;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glDisableVertexAttribArray(index);
-            getDbgContextThreadSpecific()->glDisableVertexAttribArray(index);
-            return 0;
-        }
-    } caller;
-    caller.index = index;
-
-    msg.set_arg0(index);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDisableVertexAttribArray);
-}
-
-void Debug_glEnable(GLenum cap)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum cap;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glEnable(cap);
-            return 0;
-        }
-    } caller;
-    caller.cap = cap;
-
-    msg.set_arg0(cap);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glEnable);
-}
-
-void Debug_glEnableVertexAttribArray(GLuint index)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint index;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glEnableVertexAttribArray(index);
-            getDbgContextThreadSpecific()->glEnableVertexAttribArray(index);
-            return 0;
-        }
-    } caller;
-    caller.index = index;
-
-    msg.set_arg0(index);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glEnableVertexAttribArray);
-}
-
-void Debug_glFinish(void)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glFinish();
-            return 0;
-        }
-    } caller;
-
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glFinish);
-}
-
-void Debug_glFlush(void)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glFlush();
-            return 0;
-        }
-    } caller;
-
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glFlush);
-}
-
-void Debug_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum attachment;
-        GLenum renderbuffertarget;
-        GLuint renderbuffer;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.attachment = attachment;
-    caller.renderbuffertarget = renderbuffertarget;
-    caller.renderbuffer = renderbuffer;
-
-    msg.set_arg0(target);
-    msg.set_arg1(attachment);
-    msg.set_arg2(renderbuffertarget);
-    msg.set_arg3(renderbuffer);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glFramebufferRenderbuffer);
-}
-
-void Debug_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum attachment;
-        GLenum textarget;
-        GLuint texture;
-        GLint level;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glFramebufferTexture2D(target, attachment, textarget, texture, level);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.attachment = attachment;
-    caller.textarget = textarget;
-    caller.texture = texture;
-    caller.level = level;
-
-    msg.set_arg0(target);
-    msg.set_arg1(attachment);
-    msg.set_arg2(textarget);
-    msg.set_arg3(texture);
-    msg.set_arg4(level);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glFramebufferTexture2D);
-}
-
-void Debug_glFrontFace(GLenum mode)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum mode;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glFrontFace(mode);
-            return 0;
-        }
-    } caller;
-    caller.mode = mode;
-
-    msg.set_arg0(mode);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glFrontFace);
-}
-
-void Debug_glGenBuffers(GLsizei n, GLuint* buffers)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        GLuint* buffers;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGenBuffers(n, buffers);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(buffers), n * sizeof(GLuint));
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.buffers = buffers;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(buffers));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGenBuffers);
-}
-
-void Debug_glGenerateMipmap(GLenum target)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGenerateMipmap(target);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-
-    msg.set_arg0(target);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGenerateMipmap);
-}
-
-void Debug_glGenFramebuffers(GLsizei n, GLuint* framebuffers)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        GLuint* framebuffers;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGenFramebuffers(n, framebuffers);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(framebuffers), n * sizeof(GLuint));
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.framebuffers = framebuffers;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(framebuffers));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGenFramebuffers);
-}
-
-void Debug_glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        GLuint* renderbuffers;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGenRenderbuffers(n, renderbuffers);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(renderbuffers), n * sizeof(GLuint));
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.renderbuffers = renderbuffers;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(renderbuffers));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGenRenderbuffers);
-}
-
-void Debug_glGenTextures(GLsizei n, GLuint* textures)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        GLuint* textures;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGenTextures(n, textures);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(textures), n * sizeof(GLuint));
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.textures = textures;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(textures));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGenTextures);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLuint index;
-        GLsizei bufsize;
-        GLsizei* length;
-        GLint* size;
-        GLenum* type;
-        GLchar* name;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetActiveAttrib(program, index, bufsize, length, size, type, name);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.index = index;
-    caller.bufsize = bufsize;
-    caller.length = length;
-    caller.size = size;
-    caller.type = type;
-    caller.name = name;
-
-    msg.set_arg0(program);
-    msg.set_arg1(index);
-    msg.set_arg2(bufsize);
-    msg.set_arg3(ToInt(length));
-    msg.set_arg4(ToInt(size));
-    msg.set_arg5(ToInt(type));
-    msg.set_arg6(ToInt(name));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(name), strlen(name) * sizeof(GLchar));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetActiveAttrib);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLuint index;
-        GLsizei bufsize;
-        GLsizei* length;
-        GLint* size;
-        GLenum* type;
-        GLchar* name;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetActiveUniform(program, index, bufsize, length, size, type, name);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.index = index;
-    caller.bufsize = bufsize;
-    caller.length = length;
-    caller.size = size;
-    caller.type = type;
-    caller.name = name;
-
-    msg.set_arg0(program);
-    msg.set_arg1(index);
-    msg.set_arg2(bufsize);
-    msg.set_arg3(ToInt(length));
-    msg.set_arg4(ToInt(size));
-    msg.set_arg5(ToInt(type));
-    msg.set_arg6(ToInt(name));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(name), strlen(name) * sizeof(GLchar));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetActiveUniform);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLsizei maxcount;
-        GLsizei* count;
-        GLuint* shaders;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetAttachedShaders(program, maxcount, count, shaders);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.maxcount = maxcount;
-    caller.count = count;
-    caller.shaders = shaders;
-
-    msg.set_arg0(program);
-    msg.set_arg1(maxcount);
-    msg.set_arg2(ToInt(count));
-    msg.set_arg3(ToInt(shaders));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetAttachedShaders);
-}
-
-int Debug_glGetAttribLocation(GLuint program, const GLchar* name)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        const GLchar* name;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glGetAttribLocation(program, name));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.program = program;
-    caller.name = name;
-
-    msg.set_arg0(program);
-    msg.set_arg1(ToInt(name));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(name), strlen(name) * sizeof(GLchar));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetAttribLocation);
-    return reinterpret_cast<int>(ret);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetBooleanv(GLenum pname, GLboolean* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum pname;
-        GLboolean* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetBooleanv(pname, params);
-            return 0;
-        }
-    } caller;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(pname);
-    msg.set_arg1(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetBooleanv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum pname;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetBufferParameteriv(target, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(target);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetBufferParameteriv);
-}
-
-GLenum Debug_glGetError(void)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glGetError());
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetError);
-    return reinterpret_cast<GLenum>(ret);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetFloatv(GLenum pname, GLfloat* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum pname;
-        GLfloat* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetFloatv(pname, params);
-            return 0;
-        }
-    } caller;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(pname);
-    msg.set_arg1(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetFloatv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum attachment;
-        GLenum pname;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.attachment = attachment;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(target);
-    msg.set_arg1(attachment);
-    msg.set_arg2(pname);
-    msg.set_arg3(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetFramebufferAttachmentParameteriv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetIntegerv(GLenum pname, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum pname;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetIntegerv(pname, params);
-            return 0;
-        }
-    } caller;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(pname);
-    msg.set_arg1(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetIntegerv);
-}
-
-void Debug_glGetProgramiv(GLuint program, GLenum pname, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLenum pname;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGetProgramiv(program, pname, params);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(params), 1 * sizeof(GLint));
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(program);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetProgramiv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLsizei bufsize;
-        GLsizei* length;
-        GLchar* infolog;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGetProgramInfoLog(program, bufsize, length, infolog);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(infolog), strlen(infolog) * sizeof(GLchar));
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.bufsize = bufsize;
-    caller.length = length;
-    caller.infolog = infolog;
-
-    msg.set_arg0(program);
-    msg.set_arg1(bufsize);
-    msg.set_arg2(ToInt(length));
-    msg.set_arg3(ToInt(infolog));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetProgramInfoLog);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum pname;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetRenderbufferParameteriv(target, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(target);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetRenderbufferParameteriv);
-}
-
-void Debug_glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint shader;
-        GLenum pname;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGetShaderiv(shader, pname, params);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(params), 1 * sizeof(GLint));
-            return 0;
-        }
-    } caller;
-    caller.shader = shader;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(shader);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetShaderiv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint shader;
-        GLsizei bufsize;
-        GLsizei* length;
-        GLchar* infolog;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGetShaderInfoLog(shader, bufsize, length, infolog);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(infolog), strlen(infolog) * sizeof(GLchar));
-            return 0;
-        }
-    } caller;
-    caller.shader = shader;
-    caller.bufsize = bufsize;
-    caller.length = length;
-    caller.infolog = infolog;
-
-    msg.set_arg0(shader);
-    msg.set_arg1(bufsize);
-    msg.set_arg2(ToInt(length));
-    msg.set_arg3(ToInt(infolog));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetShaderInfoLog);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum shadertype;
-        GLenum precisiontype;
-        GLint* range;
-        GLint* precision;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
-            return 0;
-        }
-    } caller;
-    caller.shadertype = shadertype;
-    caller.precisiontype = precisiontype;
-    caller.range = range;
-    caller.precision = precision;
-
-    msg.set_arg0(shadertype);
-    msg.set_arg1(precisiontype);
-    msg.set_arg2(ToInt(range));
-    msg.set_arg3(ToInt(precision));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetShaderPrecisionFormat);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint shader;
-        GLsizei bufsize;
-        GLsizei* length;
-        GLchar* source;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            nsecs_t c0 = systemTime(timeMode);
-            _c->glGetShaderSource(shader, bufsize, length, source);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.mutable_data()->assign(reinterpret_cast<const char *>(source), strlen(source) * sizeof(GLchar));
-            return 0;
-        }
-    } caller;
-    caller.shader = shader;
-    caller.bufsize = bufsize;
-    caller.length = length;
-    caller.source = source;
-
-    msg.set_arg0(shader);
-    msg.set_arg1(bufsize);
-    msg.set_arg2(ToInt(length));
-    msg.set_arg3(ToInt(source));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetShaderSource);
-}
-
-// FIXME: this function has pointers, it should be hand written
-const GLubyte* Debug_glGetString(GLenum name)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum name;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glGetString(name));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.name = name;
-
-    msg.set_arg0(name);
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetString);
-    return reinterpret_cast<const GLubyte*>(ret);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum pname;
-        GLfloat* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetTexParameterfv(target, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(target);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetTexParameterfv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum pname;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetTexParameteriv(target, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(target);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetTexParameteriv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetUniformfv(GLuint program, GLint location, GLfloat* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLint location;
-        GLfloat* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetUniformfv(program, location, params);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.location = location;
-    caller.params = params;
-
-    msg.set_arg0(program);
-    msg.set_arg1(location);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetUniformfv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetUniformiv(GLuint program, GLint location, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        GLint location;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetUniformiv(program, location, params);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-    caller.location = location;
-    caller.params = params;
-
-    msg.set_arg0(program);
-    msg.set_arg1(location);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetUniformiv);
-}
-
-int Debug_glGetUniformLocation(GLuint program, const GLchar* name)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-        const GLchar* name;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glGetUniformLocation(program, name));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.program = program;
-    caller.name = name;
-
-    msg.set_arg0(program);
-    msg.set_arg1(ToInt(name));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(name), strlen(name) * sizeof(GLchar));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetUniformLocation);
-    return reinterpret_cast<int>(ret);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint index;
-        GLenum pname;
-        GLfloat* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetVertexAttribfv(index, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.index = index;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(index);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetVertexAttribfv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint index;
-        GLenum pname;
-        GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetVertexAttribiv(index, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.index = index;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(index);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetVertexAttribiv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint index;
-        GLenum pname;
-        GLvoid** pointer;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glGetVertexAttribPointerv(index, pname, pointer);
-            return 0;
-        }
-    } caller;
-    caller.index = index;
-    caller.pname = pname;
-    caller.pointer = pointer;
-
-    msg.set_arg0(index);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(pointer));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetVertexAttribPointerv);
-}
-
-void Debug_glHint(GLenum target, GLenum mode)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum mode;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glHint(target, mode);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.mode = mode;
-
-    msg.set_arg0(target);
-    msg.set_arg1(mode);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glHint);
-}
-
-GLboolean Debug_glIsBuffer(GLuint buffer)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint buffer;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glIsBuffer(buffer));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.buffer = buffer;
-
-    msg.set_arg0(buffer);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsBuffer);
-    return static_cast<GLboolean>(reinterpret_cast<int>(ret));
-}
-
-GLboolean Debug_glIsEnabled(GLenum cap)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum cap;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glIsEnabled(cap));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.cap = cap;
-
-    msg.set_arg0(cap);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsEnabled);
-    return static_cast<GLboolean>(reinterpret_cast<int>(ret));
-}
-
-GLboolean Debug_glIsFramebuffer(GLuint framebuffer)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint framebuffer;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glIsFramebuffer(framebuffer));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.framebuffer = framebuffer;
-
-    msg.set_arg0(framebuffer);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsFramebuffer);
-    return static_cast<GLboolean>(reinterpret_cast<int>(ret));
-}
-
-GLboolean Debug_glIsProgram(GLuint program)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glIsProgram(program));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.program = program;
-
-    msg.set_arg0(program);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsProgram);
-    return static_cast<GLboolean>(reinterpret_cast<int>(ret));
-}
-
-GLboolean Debug_glIsRenderbuffer(GLuint renderbuffer)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint renderbuffer;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glIsRenderbuffer(renderbuffer));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.renderbuffer = renderbuffer;
-
-    msg.set_arg0(renderbuffer);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsRenderbuffer);
-    return static_cast<GLboolean>(reinterpret_cast<int>(ret));
-}
-
-GLboolean Debug_glIsShader(GLuint shader)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint shader;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glIsShader(shader));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.shader = shader;
-
-    msg.set_arg0(shader);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsShader);
-    return static_cast<GLboolean>(reinterpret_cast<int>(ret));
-}
-
-GLboolean Debug_glIsTexture(GLuint texture)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint texture;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int * ret = reinterpret_cast<const int *>(_c->glIsTexture(texture));
-            msg.set_ret(ToInt(ret));
-            return ret;
-        }
-    } caller;
-    caller.texture = texture;
-
-    msg.set_arg0(texture);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsTexture);
-    return static_cast<GLboolean>(reinterpret_cast<int>(ret));
-}
-
-void Debug_glLineWidth(GLfloat width)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLfloat width;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glLineWidth(width);
-            return 0;
-        }
-    } caller;
-    caller.width = width;
-
-    msg.set_arg0(ToInt(width));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glLineWidth);
-}
-
-void Debug_glLinkProgram(GLuint program)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glLinkProgram(program);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-
-    msg.set_arg0(program);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glLinkProgram);
-}
-
-void Debug_glPixelStorei(GLenum pname, GLint param)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum pname;
-        GLint param;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glPixelStorei(pname, param);
-            return 0;
-        }
-    } caller;
-    caller.pname = pname;
-    caller.param = param;
-
-    msg.set_arg0(pname);
-    msg.set_arg1(param);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glPixelStorei);
-}
-
-void Debug_glPolygonOffset(GLfloat factor, GLfloat units)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLfloat factor;
-        GLfloat units;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glPolygonOffset(factor, units);
-            return 0;
-        }
-    } caller;
-    caller.factor = factor;
-    caller.units = units;
-
-    msg.set_arg0(ToInt(factor));
-    msg.set_arg1(ToInt(units));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glPolygonOffset);
-}
-
-void Debug_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint x;
-        GLint y;
-        GLsizei width;
-        GLsizei height;
-        GLenum format;
-        GLenum type;
-        GLvoid* pixels;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glReadPixels(x, y, width, height, format, type, pixels);
-#ifdef EXTEND_AFTER_CALL_Debug_glReadPixels
-            EXTEND_AFTER_CALL_Debug_glReadPixels;
-#endif
-            return 0;
-        }
-    } caller;
-    caller.x = x;
-    caller.y = y;
-    caller.width = width;
-    caller.height = height;
-    caller.format = format;
-    caller.type = type;
-    caller.pixels = pixels;
-
-    msg.set_arg0(x);
-    msg.set_arg1(y);
-    msg.set_arg2(width);
-    msg.set_arg3(height);
-    msg.set_arg4(format);
-    msg.set_arg5(type);
-    msg.set_arg6(ToInt(pixels));
-
-    // FIXME: check for pointer usage
-#ifdef EXTEND_Debug_glReadPixels
-    EXTEND_Debug_glReadPixels;
-#endif
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glReadPixels);
-}
-
-void Debug_glReleaseShaderCompiler(void)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glReleaseShaderCompiler();
-            return 0;
-        }
-    } caller;
-
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glReleaseShaderCompiler);
-}
-
-void Debug_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum internalformat;
-        GLsizei width;
-        GLsizei height;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glRenderbufferStorage(target, internalformat, width, height);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.internalformat = internalformat;
-    caller.width = width;
-    caller.height = height;
-
-    msg.set_arg0(target);
-    msg.set_arg1(internalformat);
-    msg.set_arg2(width);
-    msg.set_arg3(height);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glRenderbufferStorage);
-}
-
-void Debug_glSampleCoverage(GLclampf value, GLboolean invert)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLclampf value;
-        GLboolean invert;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glSampleCoverage(value, invert);
-            return 0;
-        }
-    } caller;
-    caller.value = value;
-    caller.invert = invert;
-
-    msg.set_arg0(ToInt(value));
-    msg.set_arg1(invert);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glSampleCoverage);
-}
-
-void Debug_glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint x;
-        GLint y;
-        GLsizei width;
-        GLsizei height;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glScissor(x, y, width, height);
-            return 0;
-        }
-    } caller;
-    caller.x = x;
-    caller.y = y;
-    caller.width = width;
-    caller.height = height;
-
-    msg.set_arg0(x);
-    msg.set_arg1(y);
-    msg.set_arg2(width);
-    msg.set_arg3(height);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glScissor);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLsizei n;
-        const GLuint* shaders;
-        GLenum binaryformat;
-        const GLvoid* binary;
-        GLsizei length;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glShaderBinary(n, shaders, binaryformat, binary, length);
-            return 0;
-        }
-    } caller;
-    caller.n = n;
-    caller.shaders = shaders;
-    caller.binaryformat = binaryformat;
-    caller.binary = binary;
-    caller.length = length;
-
-    msg.set_arg0(n);
-    msg.set_arg1(ToInt(shaders));
-    msg.set_arg2(binaryformat);
-    msg.set_arg3(ToInt(binary));
-    msg.set_arg4(length);
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glShaderBinary);
-}
-
-void Debug_glShaderSource(GLuint shader, GLsizei count, const GLchar** string, const GLint* length)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint shader;
-        GLsizei count;
-        const GLchar** string;
-        const GLint* length;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glShaderSource(shader, count, string, length);
-#ifdef EXTEND_AFTER_CALL_Debug_glShaderSource
-            EXTEND_AFTER_CALL_Debug_glShaderSource;
-#endif
-            return 0;
-        }
-    } caller;
-    caller.shader = shader;
-    caller.count = count;
-    caller.string = string;
-    caller.length = length;
-
-    msg.set_arg0(shader);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(string));
-    msg.set_arg3(ToInt(length));
-
-    // FIXME: check for pointer usage
-#ifdef EXTEND_Debug_glShaderSource
-    EXTEND_Debug_glShaderSource;
-#endif
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glShaderSource);
-}
-
-void Debug_glStencilFunc(GLenum func, GLint ref, GLuint mask)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum func;
-        GLint ref;
-        GLuint mask;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glStencilFunc(func, ref, mask);
-            return 0;
-        }
-    } caller;
-    caller.func = func;
-    caller.ref = ref;
-    caller.mask = mask;
-
-    msg.set_arg0(func);
-    msg.set_arg1(ref);
-    msg.set_arg2(mask);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilFunc);
-}
-
-void Debug_glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum face;
-        GLenum func;
-        GLint ref;
-        GLuint mask;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glStencilFuncSeparate(face, func, ref, mask);
-            return 0;
-        }
-    } caller;
-    caller.face = face;
-    caller.func = func;
-    caller.ref = ref;
-    caller.mask = mask;
-
-    msg.set_arg0(face);
-    msg.set_arg1(func);
-    msg.set_arg2(ref);
-    msg.set_arg3(mask);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilFuncSeparate);
-}
-
-void Debug_glStencilMask(GLuint mask)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint mask;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glStencilMask(mask);
-            return 0;
-        }
-    } caller;
-    caller.mask = mask;
-
-    msg.set_arg0(mask);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilMask);
-}
-
-void Debug_glStencilMaskSeparate(GLenum face, GLuint mask)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum face;
-        GLuint mask;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glStencilMaskSeparate(face, mask);
-            return 0;
-        }
-    } caller;
-    caller.face = face;
-    caller.mask = mask;
-
-    msg.set_arg0(face);
-    msg.set_arg1(mask);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilMaskSeparate);
-}
-
-void Debug_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum fail;
-        GLenum zfail;
-        GLenum zpass;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glStencilOp(fail, zfail, zpass);
-            return 0;
-        }
-    } caller;
-    caller.fail = fail;
-    caller.zfail = zfail;
-    caller.zpass = zpass;
-
-    msg.set_arg0(fail);
-    msg.set_arg1(zfail);
-    msg.set_arg2(zpass);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilOp);
-}
-
-void Debug_glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum face;
-        GLenum fail;
-        GLenum zfail;
-        GLenum zpass;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glStencilOpSeparate(face, fail, zfail, zpass);
-            return 0;
-        }
-    } caller;
-    caller.face = face;
-    caller.fail = fail;
-    caller.zfail = zfail;
-    caller.zpass = zpass;
-
-    msg.set_arg0(face);
-    msg.set_arg1(fail);
-    msg.set_arg2(zfail);
-    msg.set_arg3(zpass);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilOpSeparate);
-}
-
-void Debug_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLint level;
-        GLint internalformat;
-        GLsizei width;
-        GLsizei height;
-        GLint border;
-        GLenum format;
-        GLenum type;
-        const GLvoid* pixels;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
-#ifdef EXTEND_AFTER_CALL_Debug_glTexImage2D
-            EXTEND_AFTER_CALL_Debug_glTexImage2D;
-#endif
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.level = level;
-    caller.internalformat = internalformat;
-    caller.width = width;
-    caller.height = height;
-    caller.border = border;
-    caller.format = format;
-    caller.type = type;
-    caller.pixels = pixels;
-
-    msg.set_arg0(target);
-    msg.set_arg1(level);
-    msg.set_arg2(internalformat);
-    msg.set_arg3(width);
-    msg.set_arg4(height);
-    msg.set_arg5(border);
-    msg.set_arg6(format);
-    msg.set_arg7(type);
-    msg.set_arg8(ToInt(pixels));
-
-    // FIXME: check for pointer usage
-#ifdef EXTEND_Debug_glTexImage2D
-    EXTEND_Debug_glTexImage2D;
-#endif
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexImage2D);
-}
-
-void Debug_glTexParameterf(GLenum target, GLenum pname, GLfloat param)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum pname;
-        GLfloat param;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glTexParameterf(target, pname, param);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.pname = pname;
-    caller.param = param;
-
-    msg.set_arg0(target);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(param));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexParameterf);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum pname;
-        const GLfloat* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glTexParameterfv(target, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(target);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexParameterfv);
-}
-
-void Debug_glTexParameteri(GLenum target, GLenum pname, GLint param)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum pname;
-        GLint param;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glTexParameteri(target, pname, param);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.pname = pname;
-    caller.param = param;
-
-    msg.set_arg0(target);
-    msg.set_arg1(pname);
-    msg.set_arg2(param);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexParameteri);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glTexParameteriv(GLenum target, GLenum pname, const GLint* params)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLenum pname;
-        const GLint* params;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glTexParameteriv(target, pname, params);
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.pname = pname;
-    caller.params = params;
-
-    msg.set_arg0(target);
-    msg.set_arg1(pname);
-    msg.set_arg2(ToInt(params));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexParameteriv);
-}
-
-void Debug_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLenum target;
-        GLint level;
-        GLint xoffset;
-        GLint yoffset;
-        GLsizei width;
-        GLsizei height;
-        GLenum format;
-        GLenum type;
-        const GLvoid* pixels;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
-#ifdef EXTEND_AFTER_CALL_Debug_glTexSubImage2D
-            EXTEND_AFTER_CALL_Debug_glTexSubImage2D;
-#endif
-            return 0;
-        }
-    } caller;
-    caller.target = target;
-    caller.level = level;
-    caller.xoffset = xoffset;
-    caller.yoffset = yoffset;
-    caller.width = width;
-    caller.height = height;
-    caller.format = format;
-    caller.type = type;
-    caller.pixels = pixels;
-
-    msg.set_arg0(target);
-    msg.set_arg1(level);
-    msg.set_arg2(xoffset);
-    msg.set_arg3(yoffset);
-    msg.set_arg4(width);
-    msg.set_arg5(height);
-    msg.set_arg6(format);
-    msg.set_arg7(type);
-    msg.set_arg8(ToInt(pixels));
-
-    // FIXME: check for pointer usage
-#ifdef EXTEND_Debug_glTexSubImage2D
-    EXTEND_Debug_glTexSubImage2D;
-#endif
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexSubImage2D);
-}
-
-void Debug_glUniform1f(GLint location, GLfloat x)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLfloat x;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform1f(location, x);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.x = x;
-
-    msg.set_arg0(location);
-    msg.set_arg1(ToInt(x));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform1f);
-}
-
-void Debug_glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        const GLfloat* v;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform1fv(location, count, v);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.v = v;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(v));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 1*count * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform1fv);
-}
-
-void Debug_glUniform1i(GLint location, GLint x)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLint x;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform1i(location, x);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.x = x;
-
-    msg.set_arg0(location);
-    msg.set_arg1(x);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform1i);
-}
-
-void Debug_glUniform1iv(GLint location, GLsizei count, const GLint* v)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        const GLint* v;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform1iv(location, count, v);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.v = v;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(v));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 1*count * sizeof(GLint));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform1iv);
-}
-
-void Debug_glUniform2f(GLint location, GLfloat x, GLfloat y)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLfloat x;
-        GLfloat y;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform2f(location, x, y);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.x = x;
-    caller.y = y;
-
-    msg.set_arg0(location);
-    msg.set_arg1(ToInt(x));
-    msg.set_arg2(ToInt(y));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform2f);
-}
-
-void Debug_glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        const GLfloat* v;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform2fv(location, count, v);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.v = v;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(v));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 2*count * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform2fv);
-}
-
-void Debug_glUniform2i(GLint location, GLint x, GLint y)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLint x;
-        GLint y;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform2i(location, x, y);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.x = x;
-    caller.y = y;
-
-    msg.set_arg0(location);
-    msg.set_arg1(x);
-    msg.set_arg2(y);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform2i);
-}
-
-void Debug_glUniform2iv(GLint location, GLsizei count, const GLint* v)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        const GLint* v;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform2iv(location, count, v);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.v = v;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(v));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 2*count * sizeof(GLint));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform2iv);
-}
-
-void Debug_glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLfloat x;
-        GLfloat y;
-        GLfloat z;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform3f(location, x, y, z);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.x = x;
-    caller.y = y;
-    caller.z = z;
-
-    msg.set_arg0(location);
-    msg.set_arg1(ToInt(x));
-    msg.set_arg2(ToInt(y));
-    msg.set_arg3(ToInt(z));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform3f);
-}
-
-void Debug_glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        const GLfloat* v;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform3fv(location, count, v);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.v = v;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(v));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 3*count * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform3fv);
-}
-
-void Debug_glUniform3i(GLint location, GLint x, GLint y, GLint z)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLint x;
-        GLint y;
-        GLint z;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform3i(location, x, y, z);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.x = x;
-    caller.y = y;
-    caller.z = z;
-
-    msg.set_arg0(location);
-    msg.set_arg1(x);
-    msg.set_arg2(y);
-    msg.set_arg3(z);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform3i);
-}
-
-void Debug_glUniform3iv(GLint location, GLsizei count, const GLint* v)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        const GLint* v;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform3iv(location, count, v);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.v = v;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(v));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 3*count * sizeof(GLint));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform3iv);
-}
-
-void Debug_glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLfloat x;
-        GLfloat y;
-        GLfloat z;
-        GLfloat w;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform4f(location, x, y, z, w);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.x = x;
-    caller.y = y;
-    caller.z = z;
-    caller.w = w;
-
-    msg.set_arg0(location);
-    msg.set_arg1(ToInt(x));
-    msg.set_arg2(ToInt(y));
-    msg.set_arg3(ToInt(z));
-    msg.set_arg4(ToInt(w));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform4f);
-}
-
-void Debug_glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        const GLfloat* v;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform4fv(location, count, v);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.v = v;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(v));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 4*count * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform4fv);
-}
-
-void Debug_glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLint x;
-        GLint y;
-        GLint z;
-        GLint w;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform4i(location, x, y, z, w);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.x = x;
-    caller.y = y;
-    caller.z = z;
-    caller.w = w;
-
-    msg.set_arg0(location);
-    msg.set_arg1(x);
-    msg.set_arg2(y);
-    msg.set_arg3(z);
-    msg.set_arg4(w);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform4i);
-}
-
-void Debug_glUniform4iv(GLint location, GLsizei count, const GLint* v)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        const GLint* v;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniform4iv(location, count, v);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.v = v;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(ToInt(v));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 4*count * sizeof(GLint));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform4iv);
-}
-
-void Debug_glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        GLboolean transpose;
-        const GLfloat* value;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniformMatrix2fv(location, count, transpose, value);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.transpose = transpose;
-    caller.value = value;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(transpose);
-    msg.set_arg3(ToInt(value));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(value), 4*count * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniformMatrix2fv);
-}
-
-void Debug_glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        GLboolean transpose;
-        const GLfloat* value;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniformMatrix3fv(location, count, transpose, value);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.transpose = transpose;
-    caller.value = value;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(transpose);
-    msg.set_arg3(ToInt(value));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(value), 9*count * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniformMatrix3fv);
-}
-
-void Debug_glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint location;
-        GLsizei count;
-        GLboolean transpose;
-        const GLfloat* value;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUniformMatrix4fv(location, count, transpose, value);
-            return 0;
-        }
-    } caller;
-    caller.location = location;
-    caller.count = count;
-    caller.transpose = transpose;
-    caller.value = value;
-
-    msg.set_arg0(location);
-    msg.set_arg1(count);
-    msg.set_arg2(transpose);
-    msg.set_arg3(ToInt(value));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(value), 16*count * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniformMatrix4fv);
-}
-
-void Debug_glUseProgram(GLuint program)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glUseProgram(program);
-            getDbgContextThreadSpecific()->glUseProgram(program);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-
-    msg.set_arg0(program);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUseProgram);
-}
-
-void Debug_glValidateProgram(GLuint program)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint program;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glValidateProgram(program);
-            return 0;
-        }
-    } caller;
-    caller.program = program;
-
-    msg.set_arg0(program);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glValidateProgram);
-}
-
-void Debug_glVertexAttrib1f(GLuint indx, GLfloat x)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        GLfloat x;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttrib1f(indx, x);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.x = x;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(ToInt(x));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib1f);
-}
-
-void Debug_glVertexAttrib1fv(GLuint indx, const GLfloat* values)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        const GLfloat* values;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttrib1fv(indx, values);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.values = values;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(ToInt(values));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(values), 1 * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib1fv);
-}
-
-void Debug_glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        GLfloat x;
-        GLfloat y;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttrib2f(indx, x, y);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.x = x;
-    caller.y = y;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(ToInt(x));
-    msg.set_arg2(ToInt(y));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib2f);
-}
-
-void Debug_glVertexAttrib2fv(GLuint indx, const GLfloat* values)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        const GLfloat* values;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttrib2fv(indx, values);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.values = values;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(ToInt(values));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(values), 2 * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib2fv);
-}
-
-void Debug_glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        GLfloat x;
-        GLfloat y;
-        GLfloat z;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttrib3f(indx, x, y, z);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.x = x;
-    caller.y = y;
-    caller.z = z;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(ToInt(x));
-    msg.set_arg2(ToInt(y));
-    msg.set_arg3(ToInt(z));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib3f);
-}
-
-void Debug_glVertexAttrib3fv(GLuint indx, const GLfloat* values)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        const GLfloat* values;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttrib3fv(indx, values);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.values = values;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(ToInt(values));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(values), 3 * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib3fv);
-}
-
-void Debug_glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        GLfloat x;
-        GLfloat y;
-        GLfloat z;
-        GLfloat w;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttrib4f(indx, x, y, z, w);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.x = x;
-    caller.y = y;
-    caller.z = z;
-    caller.w = w;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(ToInt(x));
-    msg.set_arg2(ToInt(y));
-    msg.set_arg3(ToInt(z));
-    msg.set_arg4(ToInt(w));
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib4f);
-}
-
-void Debug_glVertexAttrib4fv(GLuint indx, const GLfloat* values)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        const GLfloat* values;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttrib4fv(indx, values);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.values = values;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(ToInt(values));
-
-    // FIXME: check for pointer usage
-    msg.mutable_data()->assign(reinterpret_cast<const char *>(values), 4 * sizeof(GLfloat));
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib4fv);
-}
-
-// FIXME: this function has pointers, it should be hand written
-void Debug_glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLuint indx;
-        GLint size;
-        GLenum type;
-        GLboolean normalized;
-        GLsizei stride;
-        const GLvoid* ptr;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
-            getDbgContextThreadSpecific()->glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
-            return 0;
-        }
-    } caller;
-    caller.indx = indx;
-    caller.size = size;
-    caller.type = type;
-    caller.normalized = normalized;
-    caller.stride = stride;
-    caller.ptr = ptr;
-
-    msg.set_arg0(indx);
-    msg.set_arg1(size);
-    msg.set_arg2(type);
-    msg.set_arg3(normalized);
-    msg.set_arg4(stride);
-    msg.set_arg5(ToInt(ptr));
-
-    // FIXME: check for pointer usage
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttribPointer);
-}
-
-void Debug_glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
-{
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        GLint x;
-        GLint y;
-        GLsizei width;
-        GLsizei height;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            _c->glViewport(x, y, width, height);
-            return 0;
-        }
-    } caller;
-    caller.x = x;
-    caller.y = y;
-    caller.width = width;
-    caller.height = height;
-
-    msg.set_arg0(x);
-    msg.set_arg1(y);
-    msg.set_arg2(width);
-    msg.set_arg3(height);
-
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glViewport);
-}
-
-// FIXME: the following functions should be written by hand
-void Debug_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
-void Debug_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
-void Debug_glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
-void Debug_glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
-void Debug_glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
-void Debug_glGetBooleanv(GLenum pname, GLboolean* params);
-void Debug_glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
-void Debug_glGetFloatv(GLenum pname, GLfloat* params);
-void Debug_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params);
-void Debug_glGetIntegerv(GLenum pname, GLint* params);
-void Debug_glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
-void Debug_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params);
-void Debug_glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
-void Debug_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
-void Debug_glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
-const GLubyte* Debug_glGetString(GLenum name);
-void Debug_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params);
-void Debug_glGetTexParameteriv(GLenum target, GLenum pname, GLint* params);
-void Debug_glGetUniformfv(GLuint program, GLint location, GLfloat* params);
-void Debug_glGetUniformiv(GLuint program, GLint location, GLint* params);
-void Debug_glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
-void Debug_glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
-void Debug_glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer);
-void Debug_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
-void Debug_glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params);
-void Debug_glTexParameteriv(GLenum target, GLenum pname, const GLint* params);
-void Debug_glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
diff --git a/opengl/libs/GLES2_dbg/src/api.h b/opengl/libs/GLES2_dbg/src/api.h
deleted file mode 100644
index 0b227bc..0000000
--- a/opengl/libs/GLES2_dbg/src/api.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- ** Copyright 2011, 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.
- */
-
-#define EXTEND_Debug_glCopyTexImage2D \
-    DbgContext * const dbg = getDbgContextThreadSpecific(); \
-    void * readData = dbg->GetReadPixelsBuffer(4 * width * height); \
-    /* pick easy format for client to convert */ \
-    dbg->hooks->gl.glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, readData); \
-    dbg->CompressReadPixelBuffer(msg.mutable_data()); \
-    msg.set_data_type(msg.ReferencedImage); \
-    msg.set_pixel_format(GL_RGBA); \
-    msg.set_pixel_type(GL_UNSIGNED_BYTE);
-
-#define EXTEND_Debug_glCopyTexSubImage2D EXTEND_Debug_glCopyTexImage2D
-
-#define EXTEND_AFTER_CALL_Debug_glReadPixels \
-    { \
-        DbgContext * const dbg = getDbgContextThreadSpecific(); \
-        if (dbg->IsReadPixelBuffer(pixels)) { \
-            dbg->CompressReadPixelBuffer(msg.mutable_data()); \
-            msg.set_data_type(msg.ReferencedImage); \
-        } else { \
-            const unsigned int size = width * height * GetBytesPerPixel(format, type); \
-            dbg->Compress(pixels, size, msg.mutable_data()); \
-            msg.set_data_type(msg.NonreferencedImage); \
-        } \
-    }
-
-#define EXTEND_Debug_glShaderSource \
-    std::string * const data = msg.mutable_data(); \
-    for (unsigned i = 0; i < count; i++) \
-        if (!length || length[i] < 0) \
-            data->append(string[i]); \
-        else \
-            data->append(string[i], length[i]);
-
-#define EXTEND_Debug_glTexImage2D \
-    if (pixels) { \
-        DbgContext * const dbg = getDbgContextThreadSpecific(); \
-        const unsigned size = GetBytesPerPixel(format, type) * width * height; \
-        assert(0 < size); \
-        dbg->Compress(pixels, size, msg.mutable_data()); \
-    }
-
-#define EXTEND_Debug_glTexSubImage2D EXTEND_Debug_glTexImage2D
diff --git a/opengl/libs/GLES2_dbg/src/caller.cpp b/opengl/libs/GLES2_dbg/src/caller.cpp
deleted file mode 100644
index 70d23d6..0000000
--- a/opengl/libs/GLES2_dbg/src/caller.cpp
+++ /dev/null
@@ -1,778 +0,0 @@
-/*
- ** Copyright 2011, 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.
- */
-
-// auto generated by generate_caller_cpp.py
-// implement declarations in caller.h
-
-#include "header.h"
-
-namespace android {
-
-static const int * GenerateCall_glCompressedTexImage2D(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glCompressedTexSubImage2D(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glDrawElements(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGenBuffers(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGenFramebuffers(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGenRenderbuffers(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGenTextures(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetActiveAttrib(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetActiveUniform(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetAttachedShaders(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetBooleanv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetBufferParameteriv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetFloatv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetFramebufferAttachmentParameteriv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetIntegerv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetProgramiv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetProgramInfoLog(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetRenderbufferParameteriv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetShaderiv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetShaderInfoLog(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetShaderPrecisionFormat(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetShaderSource(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetString(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetTexParameterfv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetTexParameteriv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetUniformfv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetUniformiv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetVertexAttribfv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetVertexAttribiv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glGetVertexAttribPointerv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glReadPixels(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glShaderBinary(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glShaderSource(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glTexImage2D(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glTexParameterfv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glTexParameteriv(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glTexSubImage2D(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-static const int * GenerateCall_glVertexAttribPointer(DbgContext * const dbg,
-    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
-
-#include "caller.h"
-
-const int * GenerateCall(DbgContext * const dbg, const glesv2debugger::Message & cmd,
-                  glesv2debugger::Message & msg, const int * const prevRet)
-{
-    ALOGD("GenerateCall function=%u", cmd.function());
-    const int * ret = prevRet; // only some functions have return value
-    nsecs_t c0 = systemTime(timeMode);
-    switch (cmd.function()) {    case glesv2debugger::Message_Function_glActiveTexture:
-        dbg->hooks->gl.glActiveTexture(
-            static_cast<GLenum>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glAttachShader:
-        dbg->hooks->gl.glAttachShader(
-            static_cast<GLuint>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBindAttribLocation:
-        dbg->hooks->gl.glBindAttribLocation(
-            static_cast<GLuint>(cmd.arg0()), static_cast<GLuint>(cmd.arg1()), 
-            reinterpret_cast<GLchar*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glBindBuffer:
-        dbg->hooks->gl.glBindBuffer(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBindFramebuffer:
-        dbg->hooks->gl.glBindFramebuffer(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBindRenderbuffer:
-        dbg->hooks->gl.glBindRenderbuffer(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBindTexture:
-        dbg->hooks->gl.glBindTexture(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBlendColor:
-        dbg->hooks->gl.glBlendColor(
-            static_cast<GLclampf>(cmd.arg0()), static_cast<GLclampf>(cmd.arg1()), 
-            static_cast<GLclampf>(cmd.arg2()), static_cast<GLclampf>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBlendEquation:
-        dbg->hooks->gl.glBlendEquation(
-            static_cast<GLenum>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glBlendEquationSeparate:
-        dbg->hooks->gl.glBlendEquationSeparate(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBlendFunc:
-        dbg->hooks->gl.glBlendFunc(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBlendFuncSeparate:
-        dbg->hooks->gl.glBlendFuncSeparate(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLenum>(cmd.arg2()), static_cast<GLenum>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glBufferData:
-        dbg->hooks->gl.glBufferData(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLsizeiptr>(cmd.arg1()), 
-            reinterpret_cast<GLvoid*>(const_cast<char *>(cmd.data().data())), 
-            static_cast<GLenum>(cmd.arg3()));
-        break;
-    case glesv2debugger::Message_Function_glBufferSubData:
-        dbg->hooks->gl.glBufferSubData(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLintptr>(cmd.arg1()), 
-            static_cast<GLsizeiptr>(cmd.arg2()), reinterpret_cast<GLvoid*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glCheckFramebufferStatus:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glCheckFramebufferStatus(
-            static_cast<GLenum>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glClear:
-        dbg->hooks->gl.glClear(
-            static_cast<GLbitfield>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glClearColor:
-        dbg->hooks->gl.glClearColor(
-            static_cast<GLclampf>(cmd.arg0()), static_cast<GLclampf>(cmd.arg1()), 
-            static_cast<GLclampf>(cmd.arg2()), static_cast<GLclampf>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glClearDepthf:
-        dbg->hooks->gl.glClearDepthf(
-            static_cast<GLclampf>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glClearStencil:
-        dbg->hooks->gl.glClearStencil(
-            static_cast<GLint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glColorMask:
-        dbg->hooks->gl.glColorMask(
-            GLboolean(cmd.arg0()), GLboolean(cmd.arg1()), GLboolean(cmd.arg2()), 
-            GLboolean(cmd.arg3()));
-        break;
-    case glesv2debugger::Message_Function_glCompileShader:
-        dbg->hooks->gl.glCompileShader(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glCompressedTexImage2D:
-        ret = GenerateCall_glCompressedTexImage2D(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glCompressedTexSubImage2D:
-        ret = GenerateCall_glCompressedTexSubImage2D(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glCopyTexImage2D:
-        dbg->hooks->gl.glCopyTexImage2D(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLenum>(cmd.arg2()), static_cast<GLint>(cmd.arg3()), 
-            static_cast<GLint>(cmd.arg4()), static_cast<GLsizei>(cmd.arg5()), 
-            static_cast<GLsizei>(cmd.arg6()), static_cast<GLint>(cmd.arg7())
-            );
-        break;
-    case glesv2debugger::Message_Function_glCopyTexSubImage2D:
-        dbg->hooks->gl.glCopyTexSubImage2D(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLint>(cmd.arg2()), static_cast<GLint>(cmd.arg3()), 
-            static_cast<GLint>(cmd.arg4()), static_cast<GLint>(cmd.arg5()), 
-            static_cast<GLsizei>(cmd.arg6()), static_cast<GLsizei>(cmd.arg7())
-            );
-        break;
-    case glesv2debugger::Message_Function_glCreateProgram:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glCreateProgram(
-            )));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glCreateShader:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glCreateShader(
-            static_cast<GLenum>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glCullFace:
-        dbg->hooks->gl.glCullFace(
-            static_cast<GLenum>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glDeleteBuffers:
-        dbg->hooks->gl.glDeleteBuffers(
-            static_cast<GLsizei>(cmd.arg0()), reinterpret_cast<GLuint*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glDeleteFramebuffers:
-        dbg->hooks->gl.glDeleteFramebuffers(
-            static_cast<GLsizei>(cmd.arg0()), reinterpret_cast<GLuint*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glDeleteProgram:
-        dbg->hooks->gl.glDeleteProgram(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glDeleteRenderbuffers:
-        dbg->hooks->gl.glDeleteRenderbuffers(
-            static_cast<GLsizei>(cmd.arg0()), reinterpret_cast<GLuint*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glDeleteShader:
-        dbg->hooks->gl.glDeleteShader(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glDeleteTextures:
-        dbg->hooks->gl.glDeleteTextures(
-            static_cast<GLsizei>(cmd.arg0()), reinterpret_cast<GLuint*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glDepthFunc:
-        dbg->hooks->gl.glDepthFunc(
-            static_cast<GLenum>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glDepthMask:
-        dbg->hooks->gl.glDepthMask(
-            GLboolean(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glDepthRangef:
-        dbg->hooks->gl.glDepthRangef(
-            static_cast<GLclampf>(cmd.arg0()), static_cast<GLclampf>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glDetachShader:
-        dbg->hooks->gl.glDetachShader(
-            static_cast<GLuint>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glDisable:
-        dbg->hooks->gl.glDisable(
-            static_cast<GLenum>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glDisableVertexAttribArray:
-        dbg->hooks->gl.glDisableVertexAttribArray(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glDrawArrays:
-        dbg->hooks->gl.glDrawArrays(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLsizei>(cmd.arg2()));
-        break;
-    case glesv2debugger::Message_Function_glDrawElements:
-        ret = GenerateCall_glDrawElements(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glEnable:
-        dbg->hooks->gl.glEnable(
-            static_cast<GLenum>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glEnableVertexAttribArray:
-        dbg->hooks->gl.glEnableVertexAttribArray(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glFinish:
-        dbg->hooks->gl.glFinish(
-            );
-        break;
-    case glesv2debugger::Message_Function_glFlush:
-        dbg->hooks->gl.glFlush(
-            );
-        break;
-    case glesv2debugger::Message_Function_glFramebufferRenderbuffer:
-        dbg->hooks->gl.glFramebufferRenderbuffer(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLenum>(cmd.arg2()), static_cast<GLuint>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glFramebufferTexture2D:
-        dbg->hooks->gl.glFramebufferTexture2D(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLenum>(cmd.arg2()), static_cast<GLuint>(cmd.arg3()), 
-            static_cast<GLint>(cmd.arg4()));
-        break;
-    case glesv2debugger::Message_Function_glFrontFace:
-        dbg->hooks->gl.glFrontFace(
-            static_cast<GLenum>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glGenBuffers:
-        ret = GenerateCall_glGenBuffers(dbg, cmd, msg, prevRet);
-        break; // annotated output pointers
-    case glesv2debugger::Message_Function_glGenerateMipmap:
-        dbg->hooks->gl.glGenerateMipmap(
-            static_cast<GLenum>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glGenFramebuffers:
-        ret = GenerateCall_glGenFramebuffers(dbg, cmd, msg, prevRet);
-        break; // annotated output pointers
-    case glesv2debugger::Message_Function_glGenRenderbuffers:
-        ret = GenerateCall_glGenRenderbuffers(dbg, cmd, msg, prevRet);
-        break; // annotated output pointers
-    case glesv2debugger::Message_Function_glGenTextures:
-        ret = GenerateCall_glGenTextures(dbg, cmd, msg, prevRet);
-        break; // annotated output pointers
-    case glesv2debugger::Message_Function_glGetActiveAttrib:
-        ret = GenerateCall_glGetActiveAttrib(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetActiveUniform:
-        ret = GenerateCall_glGetActiveUniform(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetAttachedShaders:
-        ret = GenerateCall_glGetAttachedShaders(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetAttribLocation:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glGetAttribLocation(
-            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLchar*>(const_cast<char *>(cmd.data().data()))
-            )));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glGetBooleanv:
-        ret = GenerateCall_glGetBooleanv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetBufferParameteriv:
-        ret = GenerateCall_glGetBufferParameteriv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetError:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glGetError(
-            )));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glGetFloatv:
-        ret = GenerateCall_glGetFloatv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetFramebufferAttachmentParameteriv:
-        ret = GenerateCall_glGetFramebufferAttachmentParameteriv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetIntegerv:
-        ret = GenerateCall_glGetIntegerv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetProgramiv:
-        ret = GenerateCall_glGetProgramiv(dbg, cmd, msg, prevRet);
-        break; // annotated output pointers
-    case glesv2debugger::Message_Function_glGetProgramInfoLog:
-        ret = GenerateCall_glGetProgramInfoLog(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetRenderbufferParameteriv:
-        ret = GenerateCall_glGetRenderbufferParameteriv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetShaderiv:
-        ret = GenerateCall_glGetShaderiv(dbg, cmd, msg, prevRet);
-        break; // annotated output pointers
-    case glesv2debugger::Message_Function_glGetShaderInfoLog:
-        ret = GenerateCall_glGetShaderInfoLog(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetShaderPrecisionFormat:
-        ret = GenerateCall_glGetShaderPrecisionFormat(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetShaderSource:
-        ret = GenerateCall_glGetShaderSource(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetString:
-        ret = GenerateCall_glGetString(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetTexParameterfv:
-        ret = GenerateCall_glGetTexParameterfv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetTexParameteriv:
-        ret = GenerateCall_glGetTexParameteriv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetUniformfv:
-        ret = GenerateCall_glGetUniformfv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetUniformiv:
-        ret = GenerateCall_glGetUniformiv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetUniformLocation:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glGetUniformLocation(
-            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLchar*>(const_cast<char *>(cmd.data().data()))
-            )));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glGetVertexAttribfv:
-        ret = GenerateCall_glGetVertexAttribfv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetVertexAttribiv:
-        ret = GenerateCall_glGetVertexAttribiv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glGetVertexAttribPointerv:
-        ret = GenerateCall_glGetVertexAttribPointerv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glHint:
-        dbg->hooks->gl.glHint(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glIsBuffer:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsBuffer(
-            static_cast<GLuint>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glIsEnabled:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsEnabled(
-            static_cast<GLenum>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glIsFramebuffer:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsFramebuffer(
-            static_cast<GLuint>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glIsProgram:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsProgram(
-            static_cast<GLuint>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glIsRenderbuffer:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsRenderbuffer(
-            static_cast<GLuint>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glIsShader:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsShader(
-            static_cast<GLuint>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glIsTexture:
-        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsTexture(
-            static_cast<GLuint>(cmd.arg0()))));
-        if (cmd.has_ret())
-            ret = reinterpret_cast<int *>(msg.ret());
-        break;
-    case glesv2debugger::Message_Function_glLineWidth:
-        dbg->hooks->gl.glLineWidth(
-            static_cast<GLfloat>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glLinkProgram:
-        dbg->hooks->gl.glLinkProgram(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glPixelStorei:
-        dbg->hooks->gl.glPixelStorei(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glPolygonOffset:
-        dbg->hooks->gl.glPolygonOffset(
-            static_cast<GLfloat>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glReadPixels:
-        ret = GenerateCall_glReadPixels(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glReleaseShaderCompiler:
-        dbg->hooks->gl.glReleaseShaderCompiler(
-            );
-        break;
-    case glesv2debugger::Message_Function_glRenderbufferStorage:
-        dbg->hooks->gl.glRenderbufferStorage(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLsizei>(cmd.arg2()), static_cast<GLsizei>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glSampleCoverage:
-        dbg->hooks->gl.glSampleCoverage(
-            static_cast<GLclampf>(cmd.arg0()), GLboolean(cmd.arg1()));
-        break;
-    case glesv2debugger::Message_Function_glScissor:
-        dbg->hooks->gl.glScissor(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLsizei>(cmd.arg2()), static_cast<GLsizei>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glShaderBinary:
-        ret = GenerateCall_glShaderBinary(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glShaderSource:
-        ret = GenerateCall_glShaderSource(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glStencilFunc:
-        dbg->hooks->gl.glStencilFunc(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLuint>(cmd.arg2()));
-        break;
-    case glesv2debugger::Message_Function_glStencilFuncSeparate:
-        dbg->hooks->gl.glStencilFuncSeparate(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLint>(cmd.arg2()), static_cast<GLuint>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glStencilMask:
-        dbg->hooks->gl.glStencilMask(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glStencilMaskSeparate:
-        dbg->hooks->gl.glStencilMaskSeparate(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glStencilOp:
-        dbg->hooks->gl.glStencilOp(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLenum>(cmd.arg2()));
-        break;
-    case glesv2debugger::Message_Function_glStencilOpSeparate:
-        dbg->hooks->gl.glStencilOpSeparate(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLenum>(cmd.arg2()), static_cast<GLenum>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glTexImage2D:
-        ret = GenerateCall_glTexImage2D(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glTexParameterf:
-        dbg->hooks->gl.glTexParameterf(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLfloat>(cmd.arg2()));
-        break;
-    case glesv2debugger::Message_Function_glTexParameterfv:
-        ret = GenerateCall_glTexParameterfv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glTexParameteri:
-        dbg->hooks->gl.glTexParameteri(
-            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()), 
-            static_cast<GLint>(cmd.arg2()));
-        break;
-    case glesv2debugger::Message_Function_glTexParameteriv:
-        ret = GenerateCall_glTexParameteriv(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glTexSubImage2D:
-        ret = GenerateCall_glTexSubImage2D(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glUniform1f:
-        dbg->hooks->gl.glUniform1f(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform1fv:
-        dbg->hooks->gl.glUniform1fv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform1i:
-        dbg->hooks->gl.glUniform1i(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform1iv:
-        dbg->hooks->gl.glUniform1iv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            reinterpret_cast<GLint*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform2f:
-        dbg->hooks->gl.glUniform2f(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()), 
-            static_cast<GLfloat>(cmd.arg2()));
-        break;
-    case glesv2debugger::Message_Function_glUniform2fv:
-        dbg->hooks->gl.glUniform2fv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform2i:
-        dbg->hooks->gl.glUniform2i(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLint>(cmd.arg2()));
-        break;
-    case glesv2debugger::Message_Function_glUniform2iv:
-        dbg->hooks->gl.glUniform2iv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            reinterpret_cast<GLint*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform3f:
-        dbg->hooks->gl.glUniform3f(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()), 
-            static_cast<GLfloat>(cmd.arg2()), static_cast<GLfloat>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform3fv:
-        dbg->hooks->gl.glUniform3fv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform3i:
-        dbg->hooks->gl.glUniform3i(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLint>(cmd.arg2()), static_cast<GLint>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform3iv:
-        dbg->hooks->gl.glUniform3iv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            reinterpret_cast<GLint*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform4f:
-        dbg->hooks->gl.glUniform4f(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()), 
-            static_cast<GLfloat>(cmd.arg2()), static_cast<GLfloat>(cmd.arg3()), 
-            static_cast<GLfloat>(cmd.arg4()));
-        break;
-    case glesv2debugger::Message_Function_glUniform4fv:
-        dbg->hooks->gl.glUniform4fv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniform4i:
-        dbg->hooks->gl.glUniform4i(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLint>(cmd.arg2()), static_cast<GLint>(cmd.arg3()), 
-            static_cast<GLint>(cmd.arg4()));
-        break;
-    case glesv2debugger::Message_Function_glUniform4iv:
-        dbg->hooks->gl.glUniform4iv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            reinterpret_cast<GLint*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniformMatrix2fv:
-        dbg->hooks->gl.glUniformMatrix2fv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            GLboolean(cmd.arg2()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniformMatrix3fv:
-        dbg->hooks->gl.glUniformMatrix3fv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            GLboolean(cmd.arg2()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUniformMatrix4fv:
-        dbg->hooks->gl.glUniformMatrix4fv(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()), 
-            GLboolean(cmd.arg2()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glUseProgram:
-        dbg->hooks->gl.glUseProgram(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glValidateProgram:
-        dbg->hooks->gl.glValidateProgram(
-            static_cast<GLuint>(cmd.arg0()));
-        break;
-    case glesv2debugger::Message_Function_glVertexAttrib1f:
-        dbg->hooks->gl.glVertexAttrib1f(
-            static_cast<GLuint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1())
-            );
-        break;
-    case glesv2debugger::Message_Function_glVertexAttrib1fv:
-        dbg->hooks->gl.glVertexAttrib1fv(
-            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glVertexAttrib2f:
-        dbg->hooks->gl.glVertexAttrib2f(
-            static_cast<GLuint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()), 
-            static_cast<GLfloat>(cmd.arg2()));
-        break;
-    case glesv2debugger::Message_Function_glVertexAttrib2fv:
-        dbg->hooks->gl.glVertexAttrib2fv(
-            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glVertexAttrib3f:
-        dbg->hooks->gl.glVertexAttrib3f(
-            static_cast<GLuint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()), 
-            static_cast<GLfloat>(cmd.arg2()), static_cast<GLfloat>(cmd.arg3())
-            );
-        break;
-    case glesv2debugger::Message_Function_glVertexAttrib3fv:
-        dbg->hooks->gl.glVertexAttrib3fv(
-            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glVertexAttrib4f:
-        dbg->hooks->gl.glVertexAttrib4f(
-            static_cast<GLuint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()), 
-            static_cast<GLfloat>(cmd.arg2()), static_cast<GLfloat>(cmd.arg3()), 
-            static_cast<GLfloat>(cmd.arg4()));
-        break;
-    case glesv2debugger::Message_Function_glVertexAttrib4fv:
-        dbg->hooks->gl.glVertexAttrib4fv(
-            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
-            );
-        break;
-    case glesv2debugger::Message_Function_glVertexAttribPointer:
-        ret = GenerateCall_glVertexAttribPointer(dbg, cmd, msg, prevRet);
-        break;
-    case glesv2debugger::Message_Function_glViewport:
-        dbg->hooks->gl.glViewport(
-            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1()), 
-            static_cast<GLsizei>(cmd.arg2()), static_cast<GLsizei>(cmd.arg3())
-            );
-        break;
-    default:
-        assert(0);
-    }
-    msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-    msg.set_context_id(reinterpret_cast<int>(dbg));
-    msg.set_function(cmd.function());
-    msg.set_type(glesv2debugger::Message_Type_AfterGeneratedCall);
-    return ret;
-}
-
-}; // name space android {
diff --git a/opengl/libs/GLES2_dbg/src/caller.h b/opengl/libs/GLES2_dbg/src/caller.h
deleted file mode 100644
index e8111b3..0000000
--- a/opengl/libs/GLES2_dbg/src/caller.h
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- ** Copyright 2011, 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.
- */
-
-static const int * GenerateCall_glCompressedTexImage2D(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glCompressedTexSubImage2D(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glDrawElements(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGenBuffers(DbgContext * const dbg,
-                                       const glesv2debugger::Message & cmd,
-                                       glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGenFramebuffers(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGenRenderbuffers(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGenTextures(DbgContext * const dbg,
-                                        const glesv2debugger::Message & cmd,
-                                        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetActiveAttrib(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetActiveUniform(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetAttachedShaders(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetBooleanv(DbgContext * const dbg,
-                                        const glesv2debugger::Message & cmd,
-                                        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetBufferParameteriv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetFloatv(DbgContext * const dbg,
-                                      const glesv2debugger::Message & cmd,
-                                      glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetFramebufferAttachmentParameteriv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetIntegerv(DbgContext * const dbg,
-                                        const glesv2debugger::Message & cmd,
-                                        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetProgramiv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    GLint params = -1;
-    dbg->hooks->gl.glGetProgramiv(cmd.arg0(), cmd.arg1(), &params);
-    msg.mutable_data()->append(reinterpret_cast<char *>(&params), sizeof(params));
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetProgramInfoLog(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    const GLsizei bufSize = static_cast<GLsizei>(dbg->GetBufferSize());
-    GLsizei length = -1;
-    dbg->hooks->gl.glGetProgramInfoLog(cmd.arg0(), bufSize, &length, dbg->GetBuffer());
-    msg.mutable_data()->append(dbg->GetBuffer(), length);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetRenderbufferParameteriv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetShaderiv(DbgContext * const dbg,
-                                        const glesv2debugger::Message & cmd,
-                                        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    GLint params = -1;
-    dbg->hooks->gl.glGetShaderiv(cmd.arg0(), cmd.arg1(), &params);
-    msg.mutable_data()->append(reinterpret_cast<char *>(&params), sizeof(params));
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetShaderInfoLog(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    const GLsizei bufSize = static_cast<GLsizei>(dbg->GetBufferSize());
-    GLsizei length = -1;
-    dbg->hooks->gl.glGetShaderInfoLog(cmd.arg0(), bufSize, &length, dbg->GetBuffer());
-    msg.mutable_data()->append(dbg->GetBuffer(), length);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetShaderPrecisionFormat(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetShaderSource(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetString(DbgContext * const dbg,
-                                      const glesv2debugger::Message & cmd,
-                                      glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetTexParameterfv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetTexParameteriv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetUniformfv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetUniformiv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetVertexAttribfv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetVertexAttribiv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glGetVertexAttribPointerv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glReadPixels(DbgContext * const dbg,
-                                       const glesv2debugger::Message & cmd,
-                                       glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glShaderBinary(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glShaderSource(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    const char * string = cmd.data().data();
-    dbg->hooks->gl.glShaderSource(cmd.arg0(), 1, &string, NULL);
-    return prevRet;
-}
-
-static const int * GenerateCall_glTexImage2D(DbgContext * const dbg,
-                                       const glesv2debugger::Message & cmd,
-                                       glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glTexParameterfv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glTexParameteriv(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glTexSubImage2D(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
-
-static const int * GenerateCall_glVertexAttribPointer(DbgContext * const dbg,
-        const glesv2debugger::Message & cmd,
-        glesv2debugger::Message & msg, const int * const prevRet)
-{
-    assert(0);
-    return prevRet;
-}
diff --git a/opengl/libs/GLES2_dbg/src/dbgcontext.cpp b/opengl/libs/GLES2_dbg/src/dbgcontext.cpp
deleted file mode 100644
index 7bbaa18..0000000
--- a/opengl/libs/GLES2_dbg/src/dbgcontext.cpp
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- ** Copyright 2011, 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 "header.h"
-
-extern "C" {
-#include "liblzf/lzf.h"
-}
-
-namespace android {
-
-static pthread_key_t dbgEGLThreadLocalStorageKey = -1;
-static pthread_mutex_t gThreadLocalStorageKeyMutex = PTHREAD_MUTEX_INITIALIZER;
-
-DbgContext * getDbgContextThreadSpecific() {
-    return (DbgContext*)pthread_getspecific(dbgEGLThreadLocalStorageKey);
-}
-
-DbgContext::DbgContext(const unsigned version, const gl_hooks_t * const hooks,
-                       const unsigned MAX_VERTEX_ATTRIBS)
-        : lzf_buf(NULL), lzf_readIndex(0), lzf_refSize(0), lzf_refBufSize(0)
-        , version(version), hooks(hooks)
-        , MAX_VERTEX_ATTRIBS(MAX_VERTEX_ATTRIBS)
-        , readBytesPerPixel(4)
-        , captureSwap(0), captureDraw(0)
-        , vertexAttribs(new VertexAttrib[MAX_VERTEX_ATTRIBS])
-        , hasNonVBOAttribs(false), indexBuffers(NULL), indexBuffer(NULL)
-        , program(0), maxAttrib(0)
-{
-    lzf_ref[0] = lzf_ref[1] = NULL;
-    for (unsigned i = 0; i < MAX_VERTEX_ATTRIBS; i++)
-        vertexAttribs[i] = VertexAttrib();
-    memset(&expectResponse, 0, sizeof(expectResponse));
-}
-
-DbgContext::~DbgContext()
-{
-    delete vertexAttribs;
-    free(lzf_buf);
-    free(lzf_ref[0]);
-    free(lzf_ref[1]);
-}
-
-DbgContext* CreateDbgContext(const unsigned version, const gl_hooks_t * const hooks)
-{
-    pthread_mutex_lock(&gThreadLocalStorageKeyMutex);
-    if (dbgEGLThreadLocalStorageKey == -1)
-        pthread_key_create(&dbgEGLThreadLocalStorageKey, NULL);
-    pthread_mutex_unlock(&gThreadLocalStorageKeyMutex);
-
-    assert(version < 2);
-    assert(GL_NO_ERROR == hooks->gl.glGetError());
-    GLint MAX_VERTEX_ATTRIBS = 0;
-    hooks->gl.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &MAX_VERTEX_ATTRIBS);
-    DbgContext* dbg = new DbgContext(version, hooks, MAX_VERTEX_ATTRIBS);
-    glesv2debugger::Message msg, cmd;
-    msg.set_context_id(reinterpret_cast<int>(dbg));
-    msg.set_expect_response(false);
-    msg.set_type(msg.Response);
-    msg.set_function(msg.SETPROP);
-    msg.set_prop(msg.GLConstant);
-    msg.set_arg0(GL_MAX_VERTEX_ATTRIBS);
-    msg.set_arg1(MAX_VERTEX_ATTRIBS);
-    Send(msg, cmd);
-
-    GLint MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0;
-    hooks->gl.glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &MAX_COMBINED_TEXTURE_IMAGE_UNITS);
-    msg.set_arg0(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS);
-    msg.set_arg1(MAX_COMBINED_TEXTURE_IMAGE_UNITS);
-    Send(msg, cmd);
-
-    pthread_setspecific(dbgEGLThreadLocalStorageKey, dbg);
-    return dbg;
-}
-
-void dbgReleaseThread() {
-    delete getDbgContextThreadSpecific();
-}
-
-unsigned GetBytesPerPixel(const GLenum format, const GLenum type)
-{
-    switch (type) {
-    case GL_UNSIGNED_SHORT_5_6_5:
-    case GL_UNSIGNED_SHORT_4_4_4_4:
-    case GL_UNSIGNED_SHORT_5_5_5_1:
-        return 2;
-    case GL_UNSIGNED_BYTE:
-        break;
-    default:
-        ALOGE("GetBytesPerPixel: unknown type %x", type);
-    }
-
-    switch (format) {
-    case GL_ALPHA:
-    case GL_LUMINANCE:
-        return 1;
-    case GL_LUMINANCE_ALPHA:
-        return 2;
-    case GL_RGB:
-        return 3;
-    case GL_RGBA:
-    case 0x80E1:   // GL_BGRA_EXT
-        return 4;
-    default:
-        ALOGE("GetBytesPerPixel: unknown format %x", format);
-    }
-
-    return 1; // in doubt...
-}
-
-void DbgContext::Fetch(const unsigned index, std::string * const data) const
-{
-    // VBO data is already on client, just send user pointer data
-    for (unsigned i = 0; i < maxAttrib; i++) {
-        if (!vertexAttribs[i].enabled)
-            continue;
-        if (vertexAttribs[i].buffer > 0)
-            continue;
-        const char * ptr = (const char *)vertexAttribs[i].ptr;
-        ptr += index * vertexAttribs[i].stride;
-        data->append(ptr, vertexAttribs[i].elemSize);
-    }
-}
-
-void DbgContext::Compress(const void * in_data, unsigned int in_len,
-                          std::string * const outStr)
-{
-    if (!lzf_buf)
-        lzf_buf = (char *)malloc(LZF_CHUNK_SIZE);
-    assert(lzf_buf);
-    const uint32_t totalDecompSize = in_len;
-    outStr->append((const char *)&totalDecompSize, sizeof(totalDecompSize));
-    for (unsigned int i = 0; i < in_len; i += LZF_CHUNK_SIZE) {
-        uint32_t chunkSize = LZF_CHUNK_SIZE;
-        if (i + LZF_CHUNK_SIZE > in_len)
-            chunkSize = in_len - i;
-        const uint32_t compSize = lzf_compress((const char *)in_data + i, chunkSize,
-                                               lzf_buf, LZF_CHUNK_SIZE);
-        outStr->append((const char *)&chunkSize, sizeof(chunkSize));
-        outStr->append((const char *)&compSize, sizeof(compSize));
-        if (compSize > 0)
-            outStr->append(lzf_buf, compSize);
-        else // compressed chunk bigger than LZF_CHUNK_SIZE (and uncompressed)
-            outStr->append((const char *)in_data + i, chunkSize);
-    }
-}
-
-unsigned char * DbgContext::Decompress(const void * in, const unsigned int inLen,
-                                       unsigned int * const outLen)
-{
-    assert(inLen > 4 * 3);
-    if (inLen < 4 * 3)
-        return NULL;
-    *outLen = *(uint32_t *)in;
-    unsigned char * const out = (unsigned char *)malloc(*outLen);
-    unsigned int outPos = 0;
-    const unsigned char * const end = (const unsigned char *)in + inLen;
-    for (const unsigned char * inData = (const unsigned char *)in + 4; inData < end; ) {
-        const uint32_t chunkOut = *(uint32_t *)inData;
-        inData += 4;
-        const uint32_t chunkIn = *(uint32_t *)inData;
-        inData += 4;
-        if (chunkIn > 0) {
-            assert(inData + chunkIn <= end);
-            assert(outPos + chunkOut <= *outLen);
-            outPos += lzf_decompress(inData, chunkIn, out + outPos, chunkOut);
-            inData += chunkIn;
-        } else {
-            assert(inData + chunkOut <= end);
-            assert(outPos + chunkOut <= *outLen);
-            memcpy(out + outPos, inData, chunkOut);
-            inData += chunkOut;
-            outPos += chunkOut;
-        }
-    }
-    return out;
-}
-
-void * DbgContext::GetReadPixelsBuffer(const unsigned size)
-{
-    if (lzf_refBufSize < size + 8) {
-        lzf_refBufSize = size + 8;
-        lzf_ref[0] = (unsigned *)realloc(lzf_ref[0], lzf_refBufSize);
-        assert(lzf_ref[0]);
-        memset(lzf_ref[0], 0, lzf_refBufSize);
-        lzf_ref[1] = (unsigned *)realloc(lzf_ref[1], lzf_refBufSize);
-        assert(lzf_ref[1]);
-        memset(lzf_ref[1], 0, lzf_refBufSize);
-    }
-    if (lzf_refSize != size) // need to clear unused ref to maintain consistency
-    { // since ref and src are swapped each time
-        memset((char *)lzf_ref[0] + lzf_refSize, 0, lzf_refBufSize - lzf_refSize);
-        memset((char *)lzf_ref[1] + lzf_refSize, 0, lzf_refBufSize - lzf_refSize);
-    }
-    lzf_refSize = size;
-    lzf_readIndex ^= 1;
-    return lzf_ref[lzf_readIndex];
-}
-
-void DbgContext::CompressReadPixelBuffer(std::string * const outStr)
-{
-    assert(lzf_ref[0] && lzf_ref[1]);
-    unsigned * const ref = lzf_ref[lzf_readIndex ^ 1];
-    unsigned * const src = lzf_ref[lzf_readIndex];
-    for (unsigned i = 0; i < lzf_refSize / sizeof(*ref) + 1; i++)
-        ref[i] ^= src[i];
-    Compress(ref, lzf_refSize, outStr);
-}
-
-char * DbgContext::GetBuffer()
-{
-    if (!lzf_buf)
-        lzf_buf = (char *)malloc(LZF_CHUNK_SIZE);
-    assert(lzf_buf);
-    return lzf_buf;
-}
-
-unsigned int DbgContext::GetBufferSize()
-{
-    if (!lzf_buf)
-        lzf_buf = (char *)malloc(LZF_CHUNK_SIZE);
-    assert(lzf_buf);
-    if (lzf_buf)
-        return LZF_CHUNK_SIZE;
-    else
-        return 0;
-}
-
-void DbgContext::glUseProgram(GLuint program)
-{
-    while (GLenum error = hooks->gl.glGetError())
-        ALOGD("DbgContext::glUseProgram(%u): before glGetError() = 0x%.4X",
-             program, error);
-    this->program = program;
-    maxAttrib = 0;
-    if (program == 0)
-        return;
-    GLint activeAttributes = 0;
-    hooks->gl.glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &activeAttributes);
-    maxAttrib = 0;
-    GLint maxNameLen = -1;
-    hooks->gl.glGetProgramiv(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxNameLen);
-    char * name = new char [maxNameLen + 1];
-    name[maxNameLen] = 0;
-    // find total number of attribute slots used
-    for (unsigned i = 0; i < activeAttributes; i++) {
-        GLint size = -1;
-        GLenum type = -1;
-        hooks->gl.glGetActiveAttrib(program, i, maxNameLen + 1, NULL, &size, &type, name);
-        GLint slot = hooks->gl.glGetAttribLocation(program, name);
-        assert(slot >= 0);
-        switch (type) {
-        case GL_FLOAT:
-        case GL_FLOAT_VEC2:
-        case GL_FLOAT_VEC3:
-        case GL_FLOAT_VEC4:
-            slot += size;
-            break;
-        case GL_FLOAT_MAT2:
-            slot += size * 2;
-            break;
-        case GL_FLOAT_MAT3:
-            slot += size * 3;
-            break;
-        case GL_FLOAT_MAT4:
-            slot += size * 4;
-            break;
-        default:
-            assert(0);
-        }
-        if (slot > maxAttrib)
-            maxAttrib = slot;
-    }
-    delete name;
-    while (GLenum error = hooks->gl.glGetError())
-        ALOGD("DbgContext::glUseProgram(%u): after glGetError() = 0x%.4X",
-             program, error);
-}
-
-static bool HasNonVBOAttribs(const DbgContext * const ctx)
-{
-    bool need = false;
-    for (unsigned i = 0; !need && i < ctx->maxAttrib; i++)
-        if (ctx->vertexAttribs[i].enabled && ctx->vertexAttribs[i].buffer == 0)
-            need = true;
-    return need;
-}
-
-void DbgContext::glVertexAttribPointer(GLuint indx, GLint size, GLenum type,
-                                       GLboolean normalized, GLsizei stride, const GLvoid* ptr)
-{
-    assert(GL_NO_ERROR == hooks->gl.glGetError());
-    assert(indx < MAX_VERTEX_ATTRIBS);
-    vertexAttribs[indx].size = size;
-    vertexAttribs[indx].type = type;
-    vertexAttribs[indx].normalized = normalized;
-    switch (type) {
-    case GL_FLOAT:
-        vertexAttribs[indx].elemSize = sizeof(GLfloat) * size;
-        break;
-    case GL_INT:
-    case GL_UNSIGNED_INT:
-        vertexAttribs[indx].elemSize = sizeof(GLint) * size;
-        break;
-    case GL_SHORT:
-    case GL_UNSIGNED_SHORT:
-        vertexAttribs[indx].elemSize = sizeof(GLshort) * size;
-        break;
-    case GL_BYTE:
-    case GL_UNSIGNED_BYTE:
-        vertexAttribs[indx].elemSize = sizeof(GLbyte) * size;
-        break;
-    default:
-        assert(0);
-    }
-    if (0 == stride)
-        stride = vertexAttribs[indx].elemSize;
-    vertexAttribs[indx].stride = stride;
-    vertexAttribs[indx].ptr = ptr;
-    hooks->gl.glGetVertexAttribiv(indx, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING,
-                                  (GLint *)&vertexAttribs[indx].buffer);
-    hasNonVBOAttribs = HasNonVBOAttribs(this);
-}
-
-void DbgContext::glEnableVertexAttribArray(GLuint index)
-{
-    if (index >= MAX_VERTEX_ATTRIBS)
-        return;
-    vertexAttribs[index].enabled = true;
-    hasNonVBOAttribs = HasNonVBOAttribs(this);
-}
-
-void DbgContext::glDisableVertexAttribArray(GLuint index)
-{
-    if (index >= MAX_VERTEX_ATTRIBS)
-        return;
-    vertexAttribs[index].enabled = false;
-    hasNonVBOAttribs = HasNonVBOAttribs(this);
-}
-
-void DbgContext::glBindBuffer(GLenum target, GLuint buffer)
-{
-    if (GL_ELEMENT_ARRAY_BUFFER != target)
-        return;
-    if (0 == buffer) {
-        indexBuffer = NULL;
-        return;
-    }
-    VBO * b = indexBuffers;
-    indexBuffer = NULL;
-    while (b) {
-        if (b->name == buffer) {
-            assert(GL_ELEMENT_ARRAY_BUFFER == b->target);
-            indexBuffer = b;
-            break;
-        }
-        b = b->next;
-    }
-    if (!indexBuffer)
-        indexBuffer = indexBuffers = new VBO(buffer, target, indexBuffers);
-}
-
-void DbgContext::glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
-{
-    if (GL_ELEMENT_ARRAY_BUFFER != target)
-        return;
-    assert(indexBuffer);
-    assert(size >= 0);
-    indexBuffer->size = size;
-    indexBuffer->data = realloc(indexBuffer->data, size);
-    memcpy(indexBuffer->data, data, size);
-}
-
-void DbgContext::glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
-{
-    if (GL_ELEMENT_ARRAY_BUFFER != target)
-        return;
-    assert(indexBuffer);
-    assert(size >= 0);
-    assert(offset >= 0);
-    assert(offset + size <= indexBuffer->size);
-    memcpy((char *)indexBuffer->data + offset, data, size);
-}
-
-void DbgContext::glDeleteBuffers(GLsizei n, const GLuint *buffers)
-{
-    for (unsigned i = 0; i < n; i++) {
-        for (unsigned j = 0; j < MAX_VERTEX_ATTRIBS; j++)
-            if (buffers[i] == vertexAttribs[j].buffer) {
-                vertexAttribs[j].buffer = 0;
-                vertexAttribs[j].enabled = false;
-            }
-        VBO * b = indexBuffers, * previous = NULL;
-        while (b) {
-            if (b->name == buffers[i]) {
-                assert(GL_ELEMENT_ARRAY_BUFFER == b->target);
-                if (indexBuffer == b)
-                    indexBuffer = NULL;
-                if (previous)
-                    previous->next = b->next;
-                else
-                    indexBuffers = b->next;
-                free(b->data);
-                delete b;
-                break;
-            }
-            previous = b;
-            b = b->next;
-        }
-    }
-    hasNonVBOAttribs = HasNonVBOAttribs(this);
-}
-
-}; // namespace android
diff --git a/opengl/libs/GLES2_dbg/src/debugger_message.pb.cpp b/opengl/libs/GLES2_dbg/src/debugger_message.pb.cpp
deleted file mode 100644
index 50f70f7..0000000
--- a/opengl/libs/GLES2_dbg/src/debugger_message.pb.cpp
+++ /dev/null
@@ -1,1455 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-
-#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
-#include "debugger_message.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 com {
-namespace android {
-namespace glesv2debugger {
-
-void protobuf_ShutdownFile_debugger_5fmessage_2eproto() {
-  delete Message::default_instance_;
-}
-
-void protobuf_AddDesc_debugger_5fmessage_2eproto() {
-  static bool already_here = false;
-  if (already_here) return;
-  already_here = true;
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-  Message::default_instance_ = new Message();
-  Message::default_instance_->InitAsDefaultInstance();
-  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_debugger_5fmessage_2eproto);
-}
-
-// Force AddDescriptors() to be called at static initialization time.
-struct StaticDescriptorInitializer_debugger_5fmessage_2eproto {
-  StaticDescriptorInitializer_debugger_5fmessage_2eproto() {
-    protobuf_AddDesc_debugger_5fmessage_2eproto();
-  }
-} static_descriptor_initializer_debugger_5fmessage_2eproto_;
-
-
-// ===================================================================
-
-bool Message_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:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#ifndef _MSC_VER
-const Message_Function Message::glActiveTexture;
-const Message_Function Message::glAttachShader;
-const Message_Function Message::glBindAttribLocation;
-const Message_Function Message::glBindBuffer;
-const Message_Function Message::glBindFramebuffer;
-const Message_Function Message::glBindRenderbuffer;
-const Message_Function Message::glBindTexture;
-const Message_Function Message::glBlendColor;
-const Message_Function Message::glBlendEquation;
-const Message_Function Message::glBlendEquationSeparate;
-const Message_Function Message::glBlendFunc;
-const Message_Function Message::glBlendFuncSeparate;
-const Message_Function Message::glBufferData;
-const Message_Function Message::glBufferSubData;
-const Message_Function Message::glCheckFramebufferStatus;
-const Message_Function Message::glClear;
-const Message_Function Message::glClearColor;
-const Message_Function Message::glClearDepthf;
-const Message_Function Message::glClearStencil;
-const Message_Function Message::glColorMask;
-const Message_Function Message::glCompileShader;
-const Message_Function Message::glCompressedTexImage2D;
-const Message_Function Message::glCompressedTexSubImage2D;
-const Message_Function Message::glCopyTexImage2D;
-const Message_Function Message::glCopyTexSubImage2D;
-const Message_Function Message::glCreateProgram;
-const Message_Function Message::glCreateShader;
-const Message_Function Message::glCullFace;
-const Message_Function Message::glDeleteBuffers;
-const Message_Function Message::glDeleteFramebuffers;
-const Message_Function Message::glDeleteProgram;
-const Message_Function Message::glDeleteRenderbuffers;
-const Message_Function Message::glDeleteShader;
-const Message_Function Message::glDeleteTextures;
-const Message_Function Message::glDepthFunc;
-const Message_Function Message::glDepthMask;
-const Message_Function Message::glDepthRangef;
-const Message_Function Message::glDetachShader;
-const Message_Function Message::glDisable;
-const Message_Function Message::glDisableVertexAttribArray;
-const Message_Function Message::glDrawArrays;
-const Message_Function Message::glDrawElements;
-const Message_Function Message::glEnable;
-const Message_Function Message::glEnableVertexAttribArray;
-const Message_Function Message::glFinish;
-const Message_Function Message::glFlush;
-const Message_Function Message::glFramebufferRenderbuffer;
-const Message_Function Message::glFramebufferTexture2D;
-const Message_Function Message::glFrontFace;
-const Message_Function Message::glGenBuffers;
-const Message_Function Message::glGenerateMipmap;
-const Message_Function Message::glGenFramebuffers;
-const Message_Function Message::glGenRenderbuffers;
-const Message_Function Message::glGenTextures;
-const Message_Function Message::glGetActiveAttrib;
-const Message_Function Message::glGetActiveUniform;
-const Message_Function Message::glGetAttachedShaders;
-const Message_Function Message::glGetAttribLocation;
-const Message_Function Message::glGetBooleanv;
-const Message_Function Message::glGetBufferParameteriv;
-const Message_Function Message::glGetError;
-const Message_Function Message::glGetFloatv;
-const Message_Function Message::glGetFramebufferAttachmentParameteriv;
-const Message_Function Message::glGetIntegerv;
-const Message_Function Message::glGetProgramiv;
-const Message_Function Message::glGetProgramInfoLog;
-const Message_Function Message::glGetRenderbufferParameteriv;
-const Message_Function Message::glGetShaderiv;
-const Message_Function Message::glGetShaderInfoLog;
-const Message_Function Message::glGetShaderPrecisionFormat;
-const Message_Function Message::glGetShaderSource;
-const Message_Function Message::glGetString;
-const Message_Function Message::glGetTexParameterfv;
-const Message_Function Message::glGetTexParameteriv;
-const Message_Function Message::glGetUniformfv;
-const Message_Function Message::glGetUniformiv;
-const Message_Function Message::glGetUniformLocation;
-const Message_Function Message::glGetVertexAttribfv;
-const Message_Function Message::glGetVertexAttribiv;
-const Message_Function Message::glGetVertexAttribPointerv;
-const Message_Function Message::glHint;
-const Message_Function Message::glIsBuffer;
-const Message_Function Message::glIsEnabled;
-const Message_Function Message::glIsFramebuffer;
-const Message_Function Message::glIsProgram;
-const Message_Function Message::glIsRenderbuffer;
-const Message_Function Message::glIsShader;
-const Message_Function Message::glIsTexture;
-const Message_Function Message::glLineWidth;
-const Message_Function Message::glLinkProgram;
-const Message_Function Message::glPixelStorei;
-const Message_Function Message::glPolygonOffset;
-const Message_Function Message::glReadPixels;
-const Message_Function Message::glReleaseShaderCompiler;
-const Message_Function Message::glRenderbufferStorage;
-const Message_Function Message::glSampleCoverage;
-const Message_Function Message::glScissor;
-const Message_Function Message::glShaderBinary;
-const Message_Function Message::glShaderSource;
-const Message_Function Message::glStencilFunc;
-const Message_Function Message::glStencilFuncSeparate;
-const Message_Function Message::glStencilMask;
-const Message_Function Message::glStencilMaskSeparate;
-const Message_Function Message::glStencilOp;
-const Message_Function Message::glStencilOpSeparate;
-const Message_Function Message::glTexImage2D;
-const Message_Function Message::glTexParameterf;
-const Message_Function Message::glTexParameterfv;
-const Message_Function Message::glTexParameteri;
-const Message_Function Message::glTexParameteriv;
-const Message_Function Message::glTexSubImage2D;
-const Message_Function Message::glUniform1f;
-const Message_Function Message::glUniform1fv;
-const Message_Function Message::glUniform1i;
-const Message_Function Message::glUniform1iv;
-const Message_Function Message::glUniform2f;
-const Message_Function Message::glUniform2fv;
-const Message_Function Message::glUniform2i;
-const Message_Function Message::glUniform2iv;
-const Message_Function Message::glUniform3f;
-const Message_Function Message::glUniform3fv;
-const Message_Function Message::glUniform3i;
-const Message_Function Message::glUniform3iv;
-const Message_Function Message::glUniform4f;
-const Message_Function Message::glUniform4fv;
-const Message_Function Message::glUniform4i;
-const Message_Function Message::glUniform4iv;
-const Message_Function Message::glUniformMatrix2fv;
-const Message_Function Message::glUniformMatrix3fv;
-const Message_Function Message::glUniformMatrix4fv;
-const Message_Function Message::glUseProgram;
-const Message_Function Message::glValidateProgram;
-const Message_Function Message::glVertexAttrib1f;
-const Message_Function Message::glVertexAttrib1fv;
-const Message_Function Message::glVertexAttrib2f;
-const Message_Function Message::glVertexAttrib2fv;
-const Message_Function Message::glVertexAttrib3f;
-const Message_Function Message::glVertexAttrib3fv;
-const Message_Function Message::glVertexAttrib4f;
-const Message_Function Message::glVertexAttrib4fv;
-const Message_Function Message::glVertexAttribPointer;
-const Message_Function Message::glViewport;
-const Message_Function Message::eglGetDisplay;
-const Message_Function Message::eglInitialize;
-const Message_Function Message::eglTerminate;
-const Message_Function Message::eglGetConfigs;
-const Message_Function Message::eglChooseConfig;
-const Message_Function Message::eglGetConfigAttrib;
-const Message_Function Message::eglCreateWindowSurface;
-const Message_Function Message::eglCreatePixmapSurface;
-const Message_Function Message::eglCreatePbufferSurface;
-const Message_Function Message::eglDestroySurface;
-const Message_Function Message::eglQuerySurface;
-const Message_Function Message::eglCreateContext;
-const Message_Function Message::eglDestroyContext;
-const Message_Function Message::eglMakeCurrent;
-const Message_Function Message::eglGetCurrentContext;
-const Message_Function Message::eglGetCurrentSurface;
-const Message_Function Message::eglGetCurrentDisplay;
-const Message_Function Message::eglQueryContext;
-const Message_Function Message::eglWaitGL;
-const Message_Function Message::eglWaitNative;
-const Message_Function Message::eglSwapBuffers;
-const Message_Function Message::eglCopyBuffers;
-const Message_Function Message::eglGetError;
-const Message_Function Message::eglQueryString;
-const Message_Function Message::eglGetProcAddress;
-const Message_Function Message::eglSurfaceAttrib;
-const Message_Function Message::eglBindTexImage;
-const Message_Function Message::eglReleaseTexImage;
-const Message_Function Message::eglSwapInterval;
-const Message_Function Message::eglBindAPI;
-const Message_Function Message::eglQueryAPI;
-const Message_Function Message::eglWaitClient;
-const Message_Function Message::eglReleaseThread;
-const Message_Function Message::eglCreatePbufferFromClientBuffer;
-const Message_Function Message::eglLockSurfaceKHR;
-const Message_Function Message::eglUnlockSurfaceKHR;
-const Message_Function Message::eglCreateImageKHR;
-const Message_Function Message::eglDestroyImageKHR;
-const Message_Function Message::eglCreateSyncKHR;
-const Message_Function Message::eglDestroySyncKHR;
-const Message_Function Message::eglClientWaitSyncKHR;
-const Message_Function Message::eglGetSyncAttribKHR;
-const Message_Function Message::eglSetSwapRectangleANDROID;
-const Message_Function Message::eglGetRenderBufferANDROID;
-const Message_Function Message::ACK;
-const Message_Function Message::NEG;
-const Message_Function Message::CONTINUE;
-const Message_Function Message::SKIP;
-const Message_Function Message::SETPROP;
-const Message_Function Message::Function_MIN;
-const Message_Function Message::Function_MAX;
-const int Message::Function_ARRAYSIZE;
-#endif  // _MSC_VER
-bool Message_Type_IsValid(int value) {
-  switch(value) {
-    case 0:
-    case 1:
-    case 2:
-    case 3:
-    case 4:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#ifndef _MSC_VER
-const Message_Type Message::BeforeCall;
-const Message_Type Message::AfterCall;
-const Message_Type Message::AfterGeneratedCall;
-const Message_Type Message::Response;
-const Message_Type Message::CompleteCall;
-const Message_Type Message::Type_MIN;
-const Message_Type Message::Type_MAX;
-const int Message::Type_ARRAYSIZE;
-#endif  // _MSC_VER
-bool Message_DataType_IsValid(int value) {
-  switch(value) {
-    case 0:
-    case 1:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#ifndef _MSC_VER
-const Message_DataType Message::ReferencedImage;
-const Message_DataType Message::NonreferencedImage;
-const Message_DataType Message::DataType_MIN;
-const Message_DataType Message::DataType_MAX;
-const int Message::DataType_ARRAYSIZE;
-#endif  // _MSC_VER
-bool Message_Prop_IsValid(int value) {
-  switch(value) {
-    case 0:
-    case 1:
-    case 2:
-    case 3:
-    case 4:
-      return true;
-    default:
-      return false;
-  }
-}
-
-#ifndef _MSC_VER
-const Message_Prop Message::CaptureDraw;
-const Message_Prop Message::TimeMode;
-const Message_Prop Message::ExpectResponse;
-const Message_Prop Message::CaptureSwap;
-const Message_Prop Message::GLConstant;
-const Message_Prop Message::Prop_MIN;
-const Message_Prop Message::Prop_MAX;
-const int Message::Prop_ARRAYSIZE;
-#endif  // _MSC_VER
-const ::std::string Message::_default_data_;
-#ifndef _MSC_VER
-const int Message::kContextIdFieldNumber;
-const int Message::kFunctionFieldNumber;
-const int Message::kTypeFieldNumber;
-const int Message::kExpectResponseFieldNumber;
-const int Message::kRetFieldNumber;
-const int Message::kArg0FieldNumber;
-const int Message::kArg1FieldNumber;
-const int Message::kArg2FieldNumber;
-const int Message::kArg3FieldNumber;
-const int Message::kArg4FieldNumber;
-const int Message::kArg5FieldNumber;
-const int Message::kArg6FieldNumber;
-const int Message::kArg7FieldNumber;
-const int Message::kArg8FieldNumber;
-const int Message::kDataFieldNumber;
-const int Message::kDataTypeFieldNumber;
-const int Message::kPixelFormatFieldNumber;
-const int Message::kPixelTypeFieldNumber;
-const int Message::kImageWidthFieldNumber;
-const int Message::kImageHeightFieldNumber;
-const int Message::kTimeFieldNumber;
-const int Message::kPropFieldNumber;
-const int Message::kClockFieldNumber;
-#endif  // !_MSC_VER
-
-Message::Message()
-  : ::google::protobuf::MessageLite() {
-  SharedCtor();
-}
-
-void Message::InitAsDefaultInstance() {
-}
-
-Message::Message(const Message& from)
-  : ::google::protobuf::MessageLite() {
-  SharedCtor();
-  MergeFrom(from);
-}
-
-void Message::SharedCtor() {
-  _cached_size_ = 0;
-  context_id_ = 0;
-  function_ = 187;
-  type_ = 0;
-  expect_response_ = false;
-  ret_ = 0;
-  arg0_ = 0;
-  arg1_ = 0;
-  arg2_ = 0;
-  arg3_ = 0;
-  arg4_ = 0;
-  arg5_ = 0;
-  arg6_ = 0;
-  arg7_ = 0;
-  arg8_ = 0;
-  data_ = const_cast< ::std::string*>(&_default_data_);
-  data_type_ = 0;
-  pixel_format_ = 0;
-  pixel_type_ = 0;
-  image_width_ = 0;
-  image_height_ = 0;
-  time_ = 0;
-  prop_ = 0;
-  clock_ = 0;
-  ::memset(_has_bits_, 0, sizeof(_has_bits_));
-}
-
-Message::~Message() {
-  SharedDtor();
-}
-
-void Message::SharedDtor() {
-  if (data_ != &_default_data_) {
-    delete data_;
-  }
-  if (this != default_instance_) {
-  }
-}
-
-void Message::SetCachedSize(int size) const {
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-}
-const Message& Message::default_instance() {
-  if (default_instance_ == NULL) protobuf_AddDesc_debugger_5fmessage_2eproto();  return *default_instance_;
-}
-
-Message* Message::default_instance_ = NULL;
-
-Message* Message::New() const {
-  return new Message;
-}
-
-void Message::Clear() {
-  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
-    context_id_ = 0;
-    function_ = 187;
-    type_ = 0;
-    expect_response_ = false;
-    ret_ = 0;
-    arg0_ = 0;
-    arg1_ = 0;
-    arg2_ = 0;
-  }
-  if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
-    arg3_ = 0;
-    arg4_ = 0;
-    arg5_ = 0;
-    arg6_ = 0;
-    arg7_ = 0;
-    arg8_ = 0;
-    if (_has_bit(14)) {
-      if (data_ != &_default_data_) {
-        data_->clear();
-      }
-    }
-    data_type_ = 0;
-  }
-  if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) {
-    pixel_format_ = 0;
-    pixel_type_ = 0;
-    image_width_ = 0;
-    image_height_ = 0;
-    time_ = 0;
-    prop_ = 0;
-    clock_ = 0;
-  }
-  ::memset(_has_bits_, 0, sizeof(_has_bits_));
-}
-
-bool Message::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_function;
-        break;
-      }
-      
-      // required .com.android.glesv2debugger.Message.Function function = 2 [default = NEG];
-      case 2: {
-        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 (::com::android::glesv2debugger::Message_Function_IsValid(value)) {
-            set_function(static_cast< ::com::android::glesv2debugger::Message_Function >(value));
-          }
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(24)) goto parse_type;
-        break;
-      }
-      
-      // required .com.android.glesv2debugger.Message.Type type = 3;
-      case 3: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_type:
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::com::android::glesv2debugger::Message_Type_IsValid(value)) {
-            set_type(static_cast< ::com::android::glesv2debugger::Message_Type >(value));
-          }
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(32)) goto parse_expect_response;
-        break;
-      }
-      
-      // required bool expect_response = 4;
-      case 4: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_expect_response:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
-                 input, &expect_response_)));
-          _set_bit(3);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(40)) goto parse_ret;
-        break;
-      }
-      
-      // optional int32 ret = 5;
-      case 5: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_ret:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &ret_)));
-          _set_bit(4);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(48)) goto parse_arg0;
-        break;
-      }
-      
-      // optional int32 arg0 = 6;
-      case 6: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg0:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg0_)));
-          _set_bit(5);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(56)) goto parse_arg1;
-        break;
-      }
-      
-      // optional int32 arg1 = 7;
-      case 7: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg1:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg1_)));
-          _set_bit(6);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(64)) goto parse_arg2;
-        break;
-      }
-      
-      // optional int32 arg2 = 8;
-      case 8: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg2:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg2_)));
-          _set_bit(7);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(72)) goto parse_arg3;
-        break;
-      }
-      
-      // optional int32 arg3 = 9;
-      case 9: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg3:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg3_)));
-          _set_bit(8);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(82)) goto parse_data;
-        break;
-      }
-      
-      // optional bytes data = 10;
-      case 10: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
-         parse_data:
-          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
-                input, this->mutable_data()));
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(93)) goto parse_time;
-        break;
-      }
-      
-      // optional float time = 11;
-      case 11: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
-         parse_time:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &time_)));
-          _set_bit(20);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(128)) goto parse_arg4;
-        break;
-      }
-      
-      // optional int32 arg4 = 16;
-      case 16: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg4:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg4_)));
-          _set_bit(9);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(136)) goto parse_arg5;
-        break;
-      }
-      
-      // optional int32 arg5 = 17;
-      case 17: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg5:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg5_)));
-          _set_bit(10);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(144)) goto parse_arg6;
-        break;
-      }
-      
-      // optional int32 arg6 = 18;
-      case 18: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg6:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg6_)));
-          _set_bit(11);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(152)) goto parse_arg7;
-        break;
-      }
-      
-      // optional int32 arg7 = 19;
-      case 19: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg7:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg7_)));
-          _set_bit(12);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(160)) goto parse_arg8;
-        break;
-      }
-      
-      // optional int32 arg8 = 20;
-      case 20: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_arg8:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &arg8_)));
-          _set_bit(13);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(168)) goto parse_prop;
-        break;
-      }
-      
-      // optional .com.android.glesv2debugger.Message.Prop prop = 21;
-      case 21: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_prop:
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::com::android::glesv2debugger::Message_Prop_IsValid(value)) {
-            set_prop(static_cast< ::com::android::glesv2debugger::Message_Prop >(value));
-          }
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(181)) goto parse_clock;
-        break;
-      }
-      
-      // optional float clock = 22;
-      case 22: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
-         parse_clock:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &clock_)));
-          _set_bit(22);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(184)) goto parse_data_type;
-        break;
-      }
-      
-      // optional .com.android.glesv2debugger.Message.DataType data_type = 23;
-      case 23: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_data_type:
-          int value;
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
-                 input, &value)));
-          if (::com::android::glesv2debugger::Message_DataType_IsValid(value)) {
-            set_data_type(static_cast< ::com::android::glesv2debugger::Message_DataType >(value));
-          }
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(192)) goto parse_pixel_format;
-        break;
-      }
-      
-      // optional int32 pixel_format = 24;
-      case 24: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_pixel_format:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &pixel_format_)));
-          _set_bit(16);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(200)) goto parse_pixel_type;
-        break;
-      }
-      
-      // optional int32 pixel_type = 25;
-      case 25: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_pixel_type:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &pixel_type_)));
-          _set_bit(17);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(208)) goto parse_image_width;
-        break;
-      }
-      
-      // optional int32 image_width = 26;
-      case 26: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_image_width:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &image_width_)));
-          _set_bit(18);
-        } else {
-          goto handle_uninterpreted;
-        }
-        if (input->ExpectTag(216)) goto parse_image_height;
-        break;
-      }
-      
-      // optional int32 image_height = 27;
-      case 27: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
-            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
-         parse_image_height:
-          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
-                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
-                 input, &image_height_)));
-          _set_bit(19);
-        } 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 Message::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 .com.android.glesv2debugger.Message.Function function = 2 [default = NEG];
-  if (_has_bit(1)) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      2, this->function(), output);
-  }
-  
-  // required .com.android.glesv2debugger.Message.Type type = 3;
-  if (_has_bit(2)) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      3, this->type(), output);
-  }
-  
-  // required bool expect_response = 4;
-  if (_has_bit(3)) {
-    ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->expect_response(), output);
-  }
-  
-  // optional int32 ret = 5;
-  if (_has_bit(4)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->ret(), output);
-  }
-  
-  // optional int32 arg0 = 6;
-  if (_has_bit(5)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->arg0(), output);
-  }
-  
-  // optional int32 arg1 = 7;
-  if (_has_bit(6)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->arg1(), output);
-  }
-  
-  // optional int32 arg2 = 8;
-  if (_has_bit(7)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->arg2(), output);
-  }
-  
-  // optional int32 arg3 = 9;
-  if (_has_bit(8)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->arg3(), output);
-  }
-  
-  // optional bytes data = 10;
-  if (_has_bit(14)) {
-    ::google::protobuf::internal::WireFormatLite::WriteBytes(
-      10, this->data(), output);
-  }
-  
-  // optional float time = 11;
-  if (_has_bit(20)) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(11, this->time(), output);
-  }
-  
-  // optional int32 arg4 = 16;
-  if (_has_bit(9)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(16, this->arg4(), output);
-  }
-  
-  // optional int32 arg5 = 17;
-  if (_has_bit(10)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(17, this->arg5(), output);
-  }
-  
-  // optional int32 arg6 = 18;
-  if (_has_bit(11)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(18, this->arg6(), output);
-  }
-  
-  // optional int32 arg7 = 19;
-  if (_has_bit(12)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(19, this->arg7(), output);
-  }
-  
-  // optional int32 arg8 = 20;
-  if (_has_bit(13)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(20, this->arg8(), output);
-  }
-  
-  // optional .com.android.glesv2debugger.Message.Prop prop = 21;
-  if (_has_bit(21)) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      21, this->prop(), output);
-  }
-  
-  // optional float clock = 22;
-  if (_has_bit(22)) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(22, this->clock(), output);
-  }
-  
-  // optional .com.android.glesv2debugger.Message.DataType data_type = 23;
-  if (_has_bit(15)) {
-    ::google::protobuf::internal::WireFormatLite::WriteEnum(
-      23, this->data_type(), output);
-  }
-  
-  // optional int32 pixel_format = 24;
-  if (_has_bit(16)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(24, this->pixel_format(), output);
-  }
-  
-  // optional int32 pixel_type = 25;
-  if (_has_bit(17)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(25, this->pixel_type(), output);
-  }
-  
-  // optional int32 image_width = 26;
-  if (_has_bit(18)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(26, this->image_width(), output);
-  }
-  
-  // optional int32 image_height = 27;
-  if (_has_bit(19)) {
-    ::google::protobuf::internal::WireFormatLite::WriteInt32(27, this->image_height(), output);
-  }
-  
-}
-
-int Message::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 .com.android.glesv2debugger.Message.Function function = 2 [default = NEG];
-    if (has_function()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->function());
-    }
-    
-    // required .com.android.glesv2debugger.Message.Type type = 3;
-    if (has_type()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->type());
-    }
-    
-    // required bool expect_response = 4;
-    if (has_expect_response()) {
-      total_size += 1 + 1;
-    }
-    
-    // optional int32 ret = 5;
-    if (has_ret()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->ret());
-    }
-    
-    // optional int32 arg0 = 6;
-    if (has_arg0()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg0());
-    }
-    
-    // optional int32 arg1 = 7;
-    if (has_arg1()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg1());
-    }
-    
-    // optional int32 arg2 = 8;
-    if (has_arg2()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg2());
-    }
-    
-  }
-  if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
-    // optional int32 arg3 = 9;
-    if (has_arg3()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg3());
-    }
-    
-    // optional int32 arg4 = 16;
-    if (has_arg4()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg4());
-    }
-    
-    // optional int32 arg5 = 17;
-    if (has_arg5()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg5());
-    }
-    
-    // optional int32 arg6 = 18;
-    if (has_arg6()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg6());
-    }
-    
-    // optional int32 arg7 = 19;
-    if (has_arg7()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg7());
-    }
-    
-    // optional int32 arg8 = 20;
-    if (has_arg8()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->arg8());
-    }
-    
-    // optional bytes data = 10;
-    if (has_data()) {
-      total_size += 1 +
-        ::google::protobuf::internal::WireFormatLite::BytesSize(
-          this->data());
-    }
-    
-    // optional .com.android.glesv2debugger.Message.DataType data_type = 23;
-    if (has_data_type()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->data_type());
-    }
-    
-  }
-  if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) {
-    // optional int32 pixel_format = 24;
-    if (has_pixel_format()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->pixel_format());
-    }
-    
-    // optional int32 pixel_type = 25;
-    if (has_pixel_type()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->pixel_type());
-    }
-    
-    // optional int32 image_width = 26;
-    if (has_image_width()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->image_width());
-    }
-    
-    // optional int32 image_height = 27;
-    if (has_image_height()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::Int32Size(
-          this->image_height());
-    }
-    
-    // optional float time = 11;
-    if (has_time()) {
-      total_size += 1 + 4;
-    }
-    
-    // optional .com.android.glesv2debugger.Message.Prop prop = 21;
-    if (has_prop()) {
-      total_size += 2 +
-        ::google::protobuf::internal::WireFormatLite::EnumSize(this->prop());
-    }
-    
-    // optional float clock = 22;
-    if (has_clock()) {
-      total_size += 2 + 4;
-    }
-    
-  }
-  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
-  _cached_size_ = total_size;
-  GOOGLE_SAFE_CONCURRENT_WRITES_END();
-  return total_size;
-}
-
-void Message::CheckTypeAndMergeFrom(
-    const ::google::protobuf::MessageLite& from) {
-  MergeFrom(*::google::protobuf::down_cast<const Message*>(&from));
-}
-
-void Message::MergeFrom(const Message& from) {
-  GOOGLE_CHECK_NE(&from, this);
-  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_function(from.function());
-    }
-    if (from._has_bit(2)) {
-      set_type(from.type());
-    }
-    if (from._has_bit(3)) {
-      set_expect_response(from.expect_response());
-    }
-    if (from._has_bit(4)) {
-      set_ret(from.ret());
-    }
-    if (from._has_bit(5)) {
-      set_arg0(from.arg0());
-    }
-    if (from._has_bit(6)) {
-      set_arg1(from.arg1());
-    }
-    if (from._has_bit(7)) {
-      set_arg2(from.arg2());
-    }
-  }
-  if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) {
-    if (from._has_bit(8)) {
-      set_arg3(from.arg3());
-    }
-    if (from._has_bit(9)) {
-      set_arg4(from.arg4());
-    }
-    if (from._has_bit(10)) {
-      set_arg5(from.arg5());
-    }
-    if (from._has_bit(11)) {
-      set_arg6(from.arg6());
-    }
-    if (from._has_bit(12)) {
-      set_arg7(from.arg7());
-    }
-    if (from._has_bit(13)) {
-      set_arg8(from.arg8());
-    }
-    if (from._has_bit(14)) {
-      set_data(from.data());
-    }
-    if (from._has_bit(15)) {
-      set_data_type(from.data_type());
-    }
-  }
-  if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) {
-    if (from._has_bit(16)) {
-      set_pixel_format(from.pixel_format());
-    }
-    if (from._has_bit(17)) {
-      set_pixel_type(from.pixel_type());
-    }
-    if (from._has_bit(18)) {
-      set_image_width(from.image_width());
-    }
-    if (from._has_bit(19)) {
-      set_image_height(from.image_height());
-    }
-    if (from._has_bit(20)) {
-      set_time(from.time());
-    }
-    if (from._has_bit(21)) {
-      set_prop(from.prop());
-    }
-    if (from._has_bit(22)) {
-      set_clock(from.clock());
-    }
-  }
-}
-
-void Message::CopyFrom(const Message& from) {
-  if (&from == this) return;
-  Clear();
-  MergeFrom(from);
-}
-
-bool Message::IsInitialized() const {
-  if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false;
-  
-  return true;
-}
-
-void Message::Swap(Message* other) {
-  if (other != this) {
-    std::swap(context_id_, other->context_id_);
-    std::swap(function_, other->function_);
-    std::swap(type_, other->type_);
-    std::swap(expect_response_, other->expect_response_);
-    std::swap(ret_, other->ret_);
-    std::swap(arg0_, other->arg0_);
-    std::swap(arg1_, other->arg1_);
-    std::swap(arg2_, other->arg2_);
-    std::swap(arg3_, other->arg3_);
-    std::swap(arg4_, other->arg4_);
-    std::swap(arg5_, other->arg5_);
-    std::swap(arg6_, other->arg6_);
-    std::swap(arg7_, other->arg7_);
-    std::swap(arg8_, other->arg8_);
-    std::swap(data_, other->data_);
-    std::swap(data_type_, other->data_type_);
-    std::swap(pixel_format_, other->pixel_format_);
-    std::swap(pixel_type_, other->pixel_type_);
-    std::swap(image_width_, other->image_width_);
-    std::swap(image_height_, other->image_height_);
-    std::swap(time_, other->time_);
-    std::swap(prop_, other->prop_);
-    std::swap(clock_, other->clock_);
-    std::swap(_has_bits_[0], other->_has_bits_[0]);
-    std::swap(_cached_size_, other->_cached_size_);
-  }
-}
-
-::std::string Message::GetTypeName() const {
-  return "com.android.glesv2debugger.Message";
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace glesv2debugger
-}  // namespace android
-}  // namespace com
-
-// @@protoc_insertion_point(global_scope)
diff --git a/opengl/libs/GLES2_dbg/src/debugger_message.pb.h b/opengl/libs/GLES2_dbg/src/debugger_message.pb.h
deleted file mode 100644
index 5c94664..0000000
--- a/opengl/libs/GLES2_dbg/src/debugger_message.pb.h
+++ /dev/null
@@ -1,1187 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: debugger_message.proto
-
-#ifndef PROTOBUF_debugger_5fmessage_2eproto__INCLUDED
-#define PROTOBUF_debugger_5fmessage_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 com {
-namespace android {
-namespace glesv2debugger {
-
-// Internal implementation detail -- do not call these.
-void  protobuf_AddDesc_debugger_5fmessage_2eproto();
-void protobuf_AssignDesc_debugger_5fmessage_2eproto();
-void protobuf_ShutdownFile_debugger_5fmessage_2eproto();
-
-class Message;
-
-enum Message_Function {
-  Message_Function_glActiveTexture = 0,
-  Message_Function_glAttachShader = 1,
-  Message_Function_glBindAttribLocation = 2,
-  Message_Function_glBindBuffer = 3,
-  Message_Function_glBindFramebuffer = 4,
-  Message_Function_glBindRenderbuffer = 5,
-  Message_Function_glBindTexture = 6,
-  Message_Function_glBlendColor = 7,
-  Message_Function_glBlendEquation = 8,
-  Message_Function_glBlendEquationSeparate = 9,
-  Message_Function_glBlendFunc = 10,
-  Message_Function_glBlendFuncSeparate = 11,
-  Message_Function_glBufferData = 12,
-  Message_Function_glBufferSubData = 13,
-  Message_Function_glCheckFramebufferStatus = 14,
-  Message_Function_glClear = 15,
-  Message_Function_glClearColor = 16,
-  Message_Function_glClearDepthf = 17,
-  Message_Function_glClearStencil = 18,
-  Message_Function_glColorMask = 19,
-  Message_Function_glCompileShader = 20,
-  Message_Function_glCompressedTexImage2D = 21,
-  Message_Function_glCompressedTexSubImage2D = 22,
-  Message_Function_glCopyTexImage2D = 23,
-  Message_Function_glCopyTexSubImage2D = 24,
-  Message_Function_glCreateProgram = 25,
-  Message_Function_glCreateShader = 26,
-  Message_Function_glCullFace = 27,
-  Message_Function_glDeleteBuffers = 28,
-  Message_Function_glDeleteFramebuffers = 29,
-  Message_Function_glDeleteProgram = 30,
-  Message_Function_glDeleteRenderbuffers = 31,
-  Message_Function_glDeleteShader = 32,
-  Message_Function_glDeleteTextures = 33,
-  Message_Function_glDepthFunc = 34,
-  Message_Function_glDepthMask = 35,
-  Message_Function_glDepthRangef = 36,
-  Message_Function_glDetachShader = 37,
-  Message_Function_glDisable = 38,
-  Message_Function_glDisableVertexAttribArray = 39,
-  Message_Function_glDrawArrays = 40,
-  Message_Function_glDrawElements = 41,
-  Message_Function_glEnable = 42,
-  Message_Function_glEnableVertexAttribArray = 43,
-  Message_Function_glFinish = 44,
-  Message_Function_glFlush = 45,
-  Message_Function_glFramebufferRenderbuffer = 46,
-  Message_Function_glFramebufferTexture2D = 47,
-  Message_Function_glFrontFace = 48,
-  Message_Function_glGenBuffers = 49,
-  Message_Function_glGenerateMipmap = 50,
-  Message_Function_glGenFramebuffers = 51,
-  Message_Function_glGenRenderbuffers = 52,
-  Message_Function_glGenTextures = 53,
-  Message_Function_glGetActiveAttrib = 54,
-  Message_Function_glGetActiveUniform = 55,
-  Message_Function_glGetAttachedShaders = 56,
-  Message_Function_glGetAttribLocation = 57,
-  Message_Function_glGetBooleanv = 58,
-  Message_Function_glGetBufferParameteriv = 59,
-  Message_Function_glGetError = 60,
-  Message_Function_glGetFloatv = 61,
-  Message_Function_glGetFramebufferAttachmentParameteriv = 62,
-  Message_Function_glGetIntegerv = 63,
-  Message_Function_glGetProgramiv = 64,
-  Message_Function_glGetProgramInfoLog = 65,
-  Message_Function_glGetRenderbufferParameteriv = 66,
-  Message_Function_glGetShaderiv = 67,
-  Message_Function_glGetShaderInfoLog = 68,
-  Message_Function_glGetShaderPrecisionFormat = 69,
-  Message_Function_glGetShaderSource = 70,
-  Message_Function_glGetString = 71,
-  Message_Function_glGetTexParameterfv = 72,
-  Message_Function_glGetTexParameteriv = 73,
-  Message_Function_glGetUniformfv = 74,
-  Message_Function_glGetUniformiv = 75,
-  Message_Function_glGetUniformLocation = 76,
-  Message_Function_glGetVertexAttribfv = 77,
-  Message_Function_glGetVertexAttribiv = 78,
-  Message_Function_glGetVertexAttribPointerv = 79,
-  Message_Function_glHint = 80,
-  Message_Function_glIsBuffer = 81,
-  Message_Function_glIsEnabled = 82,
-  Message_Function_glIsFramebuffer = 83,
-  Message_Function_glIsProgram = 84,
-  Message_Function_glIsRenderbuffer = 85,
-  Message_Function_glIsShader = 86,
-  Message_Function_glIsTexture = 87,
-  Message_Function_glLineWidth = 88,
-  Message_Function_glLinkProgram = 89,
-  Message_Function_glPixelStorei = 90,
-  Message_Function_glPolygonOffset = 91,
-  Message_Function_glReadPixels = 92,
-  Message_Function_glReleaseShaderCompiler = 93,
-  Message_Function_glRenderbufferStorage = 94,
-  Message_Function_glSampleCoverage = 95,
-  Message_Function_glScissor = 96,
-  Message_Function_glShaderBinary = 97,
-  Message_Function_glShaderSource = 98,
-  Message_Function_glStencilFunc = 99,
-  Message_Function_glStencilFuncSeparate = 100,
-  Message_Function_glStencilMask = 101,
-  Message_Function_glStencilMaskSeparate = 102,
-  Message_Function_glStencilOp = 103,
-  Message_Function_glStencilOpSeparate = 104,
-  Message_Function_glTexImage2D = 105,
-  Message_Function_glTexParameterf = 106,
-  Message_Function_glTexParameterfv = 107,
-  Message_Function_glTexParameteri = 108,
-  Message_Function_glTexParameteriv = 109,
-  Message_Function_glTexSubImage2D = 110,
-  Message_Function_glUniform1f = 111,
-  Message_Function_glUniform1fv = 112,
-  Message_Function_glUniform1i = 113,
-  Message_Function_glUniform1iv = 114,
-  Message_Function_glUniform2f = 115,
-  Message_Function_glUniform2fv = 116,
-  Message_Function_glUniform2i = 117,
-  Message_Function_glUniform2iv = 118,
-  Message_Function_glUniform3f = 119,
-  Message_Function_glUniform3fv = 120,
-  Message_Function_glUniform3i = 121,
-  Message_Function_glUniform3iv = 122,
-  Message_Function_glUniform4f = 123,
-  Message_Function_glUniform4fv = 124,
-  Message_Function_glUniform4i = 125,
-  Message_Function_glUniform4iv = 126,
-  Message_Function_glUniformMatrix2fv = 127,
-  Message_Function_glUniformMatrix3fv = 128,
-  Message_Function_glUniformMatrix4fv = 129,
-  Message_Function_glUseProgram = 130,
-  Message_Function_glValidateProgram = 131,
-  Message_Function_glVertexAttrib1f = 132,
-  Message_Function_glVertexAttrib1fv = 133,
-  Message_Function_glVertexAttrib2f = 134,
-  Message_Function_glVertexAttrib2fv = 135,
-  Message_Function_glVertexAttrib3f = 136,
-  Message_Function_glVertexAttrib3fv = 137,
-  Message_Function_glVertexAttrib4f = 138,
-  Message_Function_glVertexAttrib4fv = 139,
-  Message_Function_glVertexAttribPointer = 140,
-  Message_Function_glViewport = 141,
-  Message_Function_eglGetDisplay = 142,
-  Message_Function_eglInitialize = 143,
-  Message_Function_eglTerminate = 144,
-  Message_Function_eglGetConfigs = 145,
-  Message_Function_eglChooseConfig = 146,
-  Message_Function_eglGetConfigAttrib = 147,
-  Message_Function_eglCreateWindowSurface = 148,
-  Message_Function_eglCreatePixmapSurface = 149,
-  Message_Function_eglCreatePbufferSurface = 150,
-  Message_Function_eglDestroySurface = 151,
-  Message_Function_eglQuerySurface = 152,
-  Message_Function_eglCreateContext = 153,
-  Message_Function_eglDestroyContext = 154,
-  Message_Function_eglMakeCurrent = 155,
-  Message_Function_eglGetCurrentContext = 156,
-  Message_Function_eglGetCurrentSurface = 157,
-  Message_Function_eglGetCurrentDisplay = 158,
-  Message_Function_eglQueryContext = 159,
-  Message_Function_eglWaitGL = 160,
-  Message_Function_eglWaitNative = 161,
-  Message_Function_eglSwapBuffers = 162,
-  Message_Function_eglCopyBuffers = 163,
-  Message_Function_eglGetError = 164,
-  Message_Function_eglQueryString = 165,
-  Message_Function_eglGetProcAddress = 166,
-  Message_Function_eglSurfaceAttrib = 167,
-  Message_Function_eglBindTexImage = 168,
-  Message_Function_eglReleaseTexImage = 169,
-  Message_Function_eglSwapInterval = 170,
-  Message_Function_eglBindAPI = 171,
-  Message_Function_eglQueryAPI = 172,
-  Message_Function_eglWaitClient = 173,
-  Message_Function_eglReleaseThread = 174,
-  Message_Function_eglCreatePbufferFromClientBuffer = 175,
-  Message_Function_eglLockSurfaceKHR = 176,
-  Message_Function_eglUnlockSurfaceKHR = 177,
-  Message_Function_eglCreateImageKHR = 178,
-  Message_Function_eglDestroyImageKHR = 179,
-  Message_Function_eglCreateSyncKHR = 180,
-  Message_Function_eglDestroySyncKHR = 181,
-  Message_Function_eglClientWaitSyncKHR = 182,
-  Message_Function_eglGetSyncAttribKHR = 183,
-  Message_Function_eglSetSwapRectangleANDROID = 184,
-  Message_Function_eglGetRenderBufferANDROID = 185,
-  Message_Function_ACK = 186,
-  Message_Function_NEG = 187,
-  Message_Function_CONTINUE = 188,
-  Message_Function_SKIP = 189,
-  Message_Function_SETPROP = 190
-};
-bool Message_Function_IsValid(int value);
-const Message_Function Message_Function_Function_MIN = Message_Function_glActiveTexture;
-const Message_Function Message_Function_Function_MAX = Message_Function_SETPROP;
-const int Message_Function_Function_ARRAYSIZE = Message_Function_Function_MAX + 1;
-
-enum Message_Type {
-  Message_Type_BeforeCall = 0,
-  Message_Type_AfterCall = 1,
-  Message_Type_AfterGeneratedCall = 2,
-  Message_Type_Response = 3,
-  Message_Type_CompleteCall = 4
-};
-bool Message_Type_IsValid(int value);
-const Message_Type Message_Type_Type_MIN = Message_Type_BeforeCall;
-const Message_Type Message_Type_Type_MAX = Message_Type_CompleteCall;
-const int Message_Type_Type_ARRAYSIZE = Message_Type_Type_MAX + 1;
-
-enum Message_DataType {
-  Message_DataType_ReferencedImage = 0,
-  Message_DataType_NonreferencedImage = 1
-};
-bool Message_DataType_IsValid(int value);
-const Message_DataType Message_DataType_DataType_MIN = Message_DataType_ReferencedImage;
-const Message_DataType Message_DataType_DataType_MAX = Message_DataType_NonreferencedImage;
-const int Message_DataType_DataType_ARRAYSIZE = Message_DataType_DataType_MAX + 1;
-
-enum Message_Prop {
-  Message_Prop_CaptureDraw = 0,
-  Message_Prop_TimeMode = 1,
-  Message_Prop_ExpectResponse = 2,
-  Message_Prop_CaptureSwap = 3,
-  Message_Prop_GLConstant = 4
-};
-bool Message_Prop_IsValid(int value);
-const Message_Prop Message_Prop_Prop_MIN = Message_Prop_CaptureDraw;
-const Message_Prop Message_Prop_Prop_MAX = Message_Prop_GLConstant;
-const int Message_Prop_Prop_ARRAYSIZE = Message_Prop_Prop_MAX + 1;
-
-// ===================================================================
-
-class Message : public ::google::protobuf::MessageLite {
- public:
-  Message();
-  virtual ~Message();
-  
-  Message(const Message& from);
-  
-  inline Message& operator=(const Message& from) {
-    CopyFrom(from);
-    return *this;
-  }
-  
-  static const Message& default_instance();
-  
-  void Swap(Message* other);
-  
-  // implements Message ----------------------------------------------
-  
-  Message* New() const;
-  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
-  void CopyFrom(const Message& from);
-  void MergeFrom(const Message& 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 Message_Function Function;
-  static const Function glActiveTexture = Message_Function_glActiveTexture;
-  static const Function glAttachShader = Message_Function_glAttachShader;
-  static const Function glBindAttribLocation = Message_Function_glBindAttribLocation;
-  static const Function glBindBuffer = Message_Function_glBindBuffer;
-  static const Function glBindFramebuffer = Message_Function_glBindFramebuffer;
-  static const Function glBindRenderbuffer = Message_Function_glBindRenderbuffer;
-  static const Function glBindTexture = Message_Function_glBindTexture;
-  static const Function glBlendColor = Message_Function_glBlendColor;
-  static const Function glBlendEquation = Message_Function_glBlendEquation;
-  static const Function glBlendEquationSeparate = Message_Function_glBlendEquationSeparate;
-  static const Function glBlendFunc = Message_Function_glBlendFunc;
-  static const Function glBlendFuncSeparate = Message_Function_glBlendFuncSeparate;
-  static const Function glBufferData = Message_Function_glBufferData;
-  static const Function glBufferSubData = Message_Function_glBufferSubData;
-  static const Function glCheckFramebufferStatus = Message_Function_glCheckFramebufferStatus;
-  static const Function glClear = Message_Function_glClear;
-  static const Function glClearColor = Message_Function_glClearColor;
-  static const Function glClearDepthf = Message_Function_glClearDepthf;
-  static const Function glClearStencil = Message_Function_glClearStencil;
-  static const Function glColorMask = Message_Function_glColorMask;
-  static const Function glCompileShader = Message_Function_glCompileShader;
-  static const Function glCompressedTexImage2D = Message_Function_glCompressedTexImage2D;
-  static const Function glCompressedTexSubImage2D = Message_Function_glCompressedTexSubImage2D;
-  static const Function glCopyTexImage2D = Message_Function_glCopyTexImage2D;
-  static const Function glCopyTexSubImage2D = Message_Function_glCopyTexSubImage2D;
-  static const Function glCreateProgram = Message_Function_glCreateProgram;
-  static const Function glCreateShader = Message_Function_glCreateShader;
-  static const Function glCullFace = Message_Function_glCullFace;
-  static const Function glDeleteBuffers = Message_Function_glDeleteBuffers;
-  static const Function glDeleteFramebuffers = Message_Function_glDeleteFramebuffers;
-  static const Function glDeleteProgram = Message_Function_glDeleteProgram;
-  static const Function glDeleteRenderbuffers = Message_Function_glDeleteRenderbuffers;
-  static const Function glDeleteShader = Message_Function_glDeleteShader;
-  static const Function glDeleteTextures = Message_Function_glDeleteTextures;
-  static const Function glDepthFunc = Message_Function_glDepthFunc;
-  static const Function glDepthMask = Message_Function_glDepthMask;
-  static const Function glDepthRangef = Message_Function_glDepthRangef;
-  static const Function glDetachShader = Message_Function_glDetachShader;
-  static const Function glDisable = Message_Function_glDisable;
-  static const Function glDisableVertexAttribArray = Message_Function_glDisableVertexAttribArray;
-  static const Function glDrawArrays = Message_Function_glDrawArrays;
-  static const Function glDrawElements = Message_Function_glDrawElements;
-  static const Function glEnable = Message_Function_glEnable;
-  static const Function glEnableVertexAttribArray = Message_Function_glEnableVertexAttribArray;
-  static const Function glFinish = Message_Function_glFinish;
-  static const Function glFlush = Message_Function_glFlush;
-  static const Function glFramebufferRenderbuffer = Message_Function_glFramebufferRenderbuffer;
-  static const Function glFramebufferTexture2D = Message_Function_glFramebufferTexture2D;
-  static const Function glFrontFace = Message_Function_glFrontFace;
-  static const Function glGenBuffers = Message_Function_glGenBuffers;
-  static const Function glGenerateMipmap = Message_Function_glGenerateMipmap;
-  static const Function glGenFramebuffers = Message_Function_glGenFramebuffers;
-  static const Function glGenRenderbuffers = Message_Function_glGenRenderbuffers;
-  static const Function glGenTextures = Message_Function_glGenTextures;
-  static const Function glGetActiveAttrib = Message_Function_glGetActiveAttrib;
-  static const Function glGetActiveUniform = Message_Function_glGetActiveUniform;
-  static const Function glGetAttachedShaders = Message_Function_glGetAttachedShaders;
-  static const Function glGetAttribLocation = Message_Function_glGetAttribLocation;
-  static const Function glGetBooleanv = Message_Function_glGetBooleanv;
-  static const Function glGetBufferParameteriv = Message_Function_glGetBufferParameteriv;
-  static const Function glGetError = Message_Function_glGetError;
-  static const Function glGetFloatv = Message_Function_glGetFloatv;
-  static const Function glGetFramebufferAttachmentParameteriv = Message_Function_glGetFramebufferAttachmentParameteriv;
-  static const Function glGetIntegerv = Message_Function_glGetIntegerv;
-  static const Function glGetProgramiv = Message_Function_glGetProgramiv;
-  static const Function glGetProgramInfoLog = Message_Function_glGetProgramInfoLog;
-  static const Function glGetRenderbufferParameteriv = Message_Function_glGetRenderbufferParameteriv;
-  static const Function glGetShaderiv = Message_Function_glGetShaderiv;
-  static const Function glGetShaderInfoLog = Message_Function_glGetShaderInfoLog;
-  static const Function glGetShaderPrecisionFormat = Message_Function_glGetShaderPrecisionFormat;
-  static const Function glGetShaderSource = Message_Function_glGetShaderSource;
-  static const Function glGetString = Message_Function_glGetString;
-  static const Function glGetTexParameterfv = Message_Function_glGetTexParameterfv;
-  static const Function glGetTexParameteriv = Message_Function_glGetTexParameteriv;
-  static const Function glGetUniformfv = Message_Function_glGetUniformfv;
-  static const Function glGetUniformiv = Message_Function_glGetUniformiv;
-  static const Function glGetUniformLocation = Message_Function_glGetUniformLocation;
-  static const Function glGetVertexAttribfv = Message_Function_glGetVertexAttribfv;
-  static const Function glGetVertexAttribiv = Message_Function_glGetVertexAttribiv;
-  static const Function glGetVertexAttribPointerv = Message_Function_glGetVertexAttribPointerv;
-  static const Function glHint = Message_Function_glHint;
-  static const Function glIsBuffer = Message_Function_glIsBuffer;
-  static const Function glIsEnabled = Message_Function_glIsEnabled;
-  static const Function glIsFramebuffer = Message_Function_glIsFramebuffer;
-  static const Function glIsProgram = Message_Function_glIsProgram;
-  static const Function glIsRenderbuffer = Message_Function_glIsRenderbuffer;
-  static const Function glIsShader = Message_Function_glIsShader;
-  static const Function glIsTexture = Message_Function_glIsTexture;
-  static const Function glLineWidth = Message_Function_glLineWidth;
-  static const Function glLinkProgram = Message_Function_glLinkProgram;
-  static const Function glPixelStorei = Message_Function_glPixelStorei;
-  static const Function glPolygonOffset = Message_Function_glPolygonOffset;
-  static const Function glReadPixels = Message_Function_glReadPixels;
-  static const Function glReleaseShaderCompiler = Message_Function_glReleaseShaderCompiler;
-  static const Function glRenderbufferStorage = Message_Function_glRenderbufferStorage;
-  static const Function glSampleCoverage = Message_Function_glSampleCoverage;
-  static const Function glScissor = Message_Function_glScissor;
-  static const Function glShaderBinary = Message_Function_glShaderBinary;
-  static const Function glShaderSource = Message_Function_glShaderSource;
-  static const Function glStencilFunc = Message_Function_glStencilFunc;
-  static const Function glStencilFuncSeparate = Message_Function_glStencilFuncSeparate;
-  static const Function glStencilMask = Message_Function_glStencilMask;
-  static const Function glStencilMaskSeparate = Message_Function_glStencilMaskSeparate;
-  static const Function glStencilOp = Message_Function_glStencilOp;
-  static const Function glStencilOpSeparate = Message_Function_glStencilOpSeparate;
-  static const Function glTexImage2D = Message_Function_glTexImage2D;
-  static const Function glTexParameterf = Message_Function_glTexParameterf;
-  static const Function glTexParameterfv = Message_Function_glTexParameterfv;
-  static const Function glTexParameteri = Message_Function_glTexParameteri;
-  static const Function glTexParameteriv = Message_Function_glTexParameteriv;
-  static const Function glTexSubImage2D = Message_Function_glTexSubImage2D;
-  static const Function glUniform1f = Message_Function_glUniform1f;
-  static const Function glUniform1fv = Message_Function_glUniform1fv;
-  static const Function glUniform1i = Message_Function_glUniform1i;
-  static const Function glUniform1iv = Message_Function_glUniform1iv;
-  static const Function glUniform2f = Message_Function_glUniform2f;
-  static const Function glUniform2fv = Message_Function_glUniform2fv;
-  static const Function glUniform2i = Message_Function_glUniform2i;
-  static const Function glUniform2iv = Message_Function_glUniform2iv;
-  static const Function glUniform3f = Message_Function_glUniform3f;
-  static const Function glUniform3fv = Message_Function_glUniform3fv;
-  static const Function glUniform3i = Message_Function_glUniform3i;
-  static const Function glUniform3iv = Message_Function_glUniform3iv;
-  static const Function glUniform4f = Message_Function_glUniform4f;
-  static const Function glUniform4fv = Message_Function_glUniform4fv;
-  static const Function glUniform4i = Message_Function_glUniform4i;
-  static const Function glUniform4iv = Message_Function_glUniform4iv;
-  static const Function glUniformMatrix2fv = Message_Function_glUniformMatrix2fv;
-  static const Function glUniformMatrix3fv = Message_Function_glUniformMatrix3fv;
-  static const Function glUniformMatrix4fv = Message_Function_glUniformMatrix4fv;
-  static const Function glUseProgram = Message_Function_glUseProgram;
-  static const Function glValidateProgram = Message_Function_glValidateProgram;
-  static const Function glVertexAttrib1f = Message_Function_glVertexAttrib1f;
-  static const Function glVertexAttrib1fv = Message_Function_glVertexAttrib1fv;
-  static const Function glVertexAttrib2f = Message_Function_glVertexAttrib2f;
-  static const Function glVertexAttrib2fv = Message_Function_glVertexAttrib2fv;
-  static const Function glVertexAttrib3f = Message_Function_glVertexAttrib3f;
-  static const Function glVertexAttrib3fv = Message_Function_glVertexAttrib3fv;
-  static const Function glVertexAttrib4f = Message_Function_glVertexAttrib4f;
-  static const Function glVertexAttrib4fv = Message_Function_glVertexAttrib4fv;
-  static const Function glVertexAttribPointer = Message_Function_glVertexAttribPointer;
-  static const Function glViewport = Message_Function_glViewport;
-  static const Function eglGetDisplay = Message_Function_eglGetDisplay;
-  static const Function eglInitialize = Message_Function_eglInitialize;
-  static const Function eglTerminate = Message_Function_eglTerminate;
-  static const Function eglGetConfigs = Message_Function_eglGetConfigs;
-  static const Function eglChooseConfig = Message_Function_eglChooseConfig;
-  static const Function eglGetConfigAttrib = Message_Function_eglGetConfigAttrib;
-  static const Function eglCreateWindowSurface = Message_Function_eglCreateWindowSurface;
-  static const Function eglCreatePixmapSurface = Message_Function_eglCreatePixmapSurface;
-  static const Function eglCreatePbufferSurface = Message_Function_eglCreatePbufferSurface;
-  static const Function eglDestroySurface = Message_Function_eglDestroySurface;
-  static const Function eglQuerySurface = Message_Function_eglQuerySurface;
-  static const Function eglCreateContext = Message_Function_eglCreateContext;
-  static const Function eglDestroyContext = Message_Function_eglDestroyContext;
-  static const Function eglMakeCurrent = Message_Function_eglMakeCurrent;
-  static const Function eglGetCurrentContext = Message_Function_eglGetCurrentContext;
-  static const Function eglGetCurrentSurface = Message_Function_eglGetCurrentSurface;
-  static const Function eglGetCurrentDisplay = Message_Function_eglGetCurrentDisplay;
-  static const Function eglQueryContext = Message_Function_eglQueryContext;
-  static const Function eglWaitGL = Message_Function_eglWaitGL;
-  static const Function eglWaitNative = Message_Function_eglWaitNative;
-  static const Function eglSwapBuffers = Message_Function_eglSwapBuffers;
-  static const Function eglCopyBuffers = Message_Function_eglCopyBuffers;
-  static const Function eglGetError = Message_Function_eglGetError;
-  static const Function eglQueryString = Message_Function_eglQueryString;
-  static const Function eglGetProcAddress = Message_Function_eglGetProcAddress;
-  static const Function eglSurfaceAttrib = Message_Function_eglSurfaceAttrib;
-  static const Function eglBindTexImage = Message_Function_eglBindTexImage;
-  static const Function eglReleaseTexImage = Message_Function_eglReleaseTexImage;
-  static const Function eglSwapInterval = Message_Function_eglSwapInterval;
-  static const Function eglBindAPI = Message_Function_eglBindAPI;
-  static const Function eglQueryAPI = Message_Function_eglQueryAPI;
-  static const Function eglWaitClient = Message_Function_eglWaitClient;
-  static const Function eglReleaseThread = Message_Function_eglReleaseThread;
-  static const Function eglCreatePbufferFromClientBuffer = Message_Function_eglCreatePbufferFromClientBuffer;
-  static const Function eglLockSurfaceKHR = Message_Function_eglLockSurfaceKHR;
-  static const Function eglUnlockSurfaceKHR = Message_Function_eglUnlockSurfaceKHR;
-  static const Function eglCreateImageKHR = Message_Function_eglCreateImageKHR;
-  static const Function eglDestroyImageKHR = Message_Function_eglDestroyImageKHR;
-  static const Function eglCreateSyncKHR = Message_Function_eglCreateSyncKHR;
-  static const Function eglDestroySyncKHR = Message_Function_eglDestroySyncKHR;
-  static const Function eglClientWaitSyncKHR = Message_Function_eglClientWaitSyncKHR;
-  static const Function eglGetSyncAttribKHR = Message_Function_eglGetSyncAttribKHR;
-  static const Function eglSetSwapRectangleANDROID = Message_Function_eglSetSwapRectangleANDROID;
-  static const Function eglGetRenderBufferANDROID = Message_Function_eglGetRenderBufferANDROID;
-  static const Function ACK = Message_Function_ACK;
-  static const Function NEG = Message_Function_NEG;
-  static const Function CONTINUE = Message_Function_CONTINUE;
-  static const Function SKIP = Message_Function_SKIP;
-  static const Function SETPROP = Message_Function_SETPROP;
-  static inline bool Function_IsValid(int value) {
-    return Message_Function_IsValid(value);
-  }
-  static const Function Function_MIN =
-    Message_Function_Function_MIN;
-  static const Function Function_MAX =
-    Message_Function_Function_MAX;
-  static const int Function_ARRAYSIZE =
-    Message_Function_Function_ARRAYSIZE;
-  
-  typedef Message_Type Type;
-  static const Type BeforeCall = Message_Type_BeforeCall;
-  static const Type AfterCall = Message_Type_AfterCall;
-  static const Type AfterGeneratedCall = Message_Type_AfterGeneratedCall;
-  static const Type Response = Message_Type_Response;
-  static const Type CompleteCall = Message_Type_CompleteCall;
-  static inline bool Type_IsValid(int value) {
-    return Message_Type_IsValid(value);
-  }
-  static const Type Type_MIN =
-    Message_Type_Type_MIN;
-  static const Type Type_MAX =
-    Message_Type_Type_MAX;
-  static const int Type_ARRAYSIZE =
-    Message_Type_Type_ARRAYSIZE;
-  
-  typedef Message_DataType DataType;
-  static const DataType ReferencedImage = Message_DataType_ReferencedImage;
-  static const DataType NonreferencedImage = Message_DataType_NonreferencedImage;
-  static inline bool DataType_IsValid(int value) {
-    return Message_DataType_IsValid(value);
-  }
-  static const DataType DataType_MIN =
-    Message_DataType_DataType_MIN;
-  static const DataType DataType_MAX =
-    Message_DataType_DataType_MAX;
-  static const int DataType_ARRAYSIZE =
-    Message_DataType_DataType_ARRAYSIZE;
-  
-  typedef Message_Prop Prop;
-  static const Prop CaptureDraw = Message_Prop_CaptureDraw;
-  static const Prop TimeMode = Message_Prop_TimeMode;
-  static const Prop ExpectResponse = Message_Prop_ExpectResponse;
-  static const Prop CaptureSwap = Message_Prop_CaptureSwap;
-  static const Prop GLConstant = Message_Prop_GLConstant;
-  static inline bool Prop_IsValid(int value) {
-    return Message_Prop_IsValid(value);
-  }
-  static const Prop Prop_MIN =
-    Message_Prop_Prop_MIN;
-  static const Prop Prop_MAX =
-    Message_Prop_Prop_MAX;
-  static const int Prop_ARRAYSIZE =
-    Message_Prop_Prop_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 .com.android.glesv2debugger.Message.Function function = 2 [default = NEG];
-  inline bool has_function() const;
-  inline void clear_function();
-  static const int kFunctionFieldNumber = 2;
-  inline ::com::android::glesv2debugger::Message_Function function() const;
-  inline void set_function(::com::android::glesv2debugger::Message_Function value);
-  
-  // required .com.android.glesv2debugger.Message.Type type = 3;
-  inline bool has_type() const;
-  inline void clear_type();
-  static const int kTypeFieldNumber = 3;
-  inline ::com::android::glesv2debugger::Message_Type type() const;
-  inline void set_type(::com::android::glesv2debugger::Message_Type value);
-  
-  // required bool expect_response = 4;
-  inline bool has_expect_response() const;
-  inline void clear_expect_response();
-  static const int kExpectResponseFieldNumber = 4;
-  inline bool expect_response() const;
-  inline void set_expect_response(bool value);
-  
-  // optional int32 ret = 5;
-  inline bool has_ret() const;
-  inline void clear_ret();
-  static const int kRetFieldNumber = 5;
-  inline ::google::protobuf::int32 ret() const;
-  inline void set_ret(::google::protobuf::int32 value);
-  
-  // optional int32 arg0 = 6;
-  inline bool has_arg0() const;
-  inline void clear_arg0();
-  static const int kArg0FieldNumber = 6;
-  inline ::google::protobuf::int32 arg0() const;
-  inline void set_arg0(::google::protobuf::int32 value);
-  
-  // optional int32 arg1 = 7;
-  inline bool has_arg1() const;
-  inline void clear_arg1();
-  static const int kArg1FieldNumber = 7;
-  inline ::google::protobuf::int32 arg1() const;
-  inline void set_arg1(::google::protobuf::int32 value);
-  
-  // optional int32 arg2 = 8;
-  inline bool has_arg2() const;
-  inline void clear_arg2();
-  static const int kArg2FieldNumber = 8;
-  inline ::google::protobuf::int32 arg2() const;
-  inline void set_arg2(::google::protobuf::int32 value);
-  
-  // optional int32 arg3 = 9;
-  inline bool has_arg3() const;
-  inline void clear_arg3();
-  static const int kArg3FieldNumber = 9;
-  inline ::google::protobuf::int32 arg3() const;
-  inline void set_arg3(::google::protobuf::int32 value);
-  
-  // optional int32 arg4 = 16;
-  inline bool has_arg4() const;
-  inline void clear_arg4();
-  static const int kArg4FieldNumber = 16;
-  inline ::google::protobuf::int32 arg4() const;
-  inline void set_arg4(::google::protobuf::int32 value);
-  
-  // optional int32 arg5 = 17;
-  inline bool has_arg5() const;
-  inline void clear_arg5();
-  static const int kArg5FieldNumber = 17;
-  inline ::google::protobuf::int32 arg5() const;
-  inline void set_arg5(::google::protobuf::int32 value);
-  
-  // optional int32 arg6 = 18;
-  inline bool has_arg6() const;
-  inline void clear_arg6();
-  static const int kArg6FieldNumber = 18;
-  inline ::google::protobuf::int32 arg6() const;
-  inline void set_arg6(::google::protobuf::int32 value);
-  
-  // optional int32 arg7 = 19;
-  inline bool has_arg7() const;
-  inline void clear_arg7();
-  static const int kArg7FieldNumber = 19;
-  inline ::google::protobuf::int32 arg7() const;
-  inline void set_arg7(::google::protobuf::int32 value);
-  
-  // optional int32 arg8 = 20;
-  inline bool has_arg8() const;
-  inline void clear_arg8();
-  static const int kArg8FieldNumber = 20;
-  inline ::google::protobuf::int32 arg8() const;
-  inline void set_arg8(::google::protobuf::int32 value);
-  
-  // optional bytes data = 10;
-  inline bool has_data() const;
-  inline void clear_data();
-  static const int kDataFieldNumber = 10;
-  inline const ::std::string& data() const;
-  inline void set_data(const ::std::string& value);
-  inline void set_data(const char* value);
-  inline void set_data(const void* value, size_t size);
-  inline ::std::string* mutable_data();
-  
-  // optional .com.android.glesv2debugger.Message.DataType data_type = 23;
-  inline bool has_data_type() const;
-  inline void clear_data_type();
-  static const int kDataTypeFieldNumber = 23;
-  inline ::com::android::glesv2debugger::Message_DataType data_type() const;
-  inline void set_data_type(::com::android::glesv2debugger::Message_DataType value);
-  
-  // optional int32 pixel_format = 24;
-  inline bool has_pixel_format() const;
-  inline void clear_pixel_format();
-  static const int kPixelFormatFieldNumber = 24;
-  inline ::google::protobuf::int32 pixel_format() const;
-  inline void set_pixel_format(::google::protobuf::int32 value);
-  
-  // optional int32 pixel_type = 25;
-  inline bool has_pixel_type() const;
-  inline void clear_pixel_type();
-  static const int kPixelTypeFieldNumber = 25;
-  inline ::google::protobuf::int32 pixel_type() const;
-  inline void set_pixel_type(::google::protobuf::int32 value);
-  
-  // optional int32 image_width = 26;
-  inline bool has_image_width() const;
-  inline void clear_image_width();
-  static const int kImageWidthFieldNumber = 26;
-  inline ::google::protobuf::int32 image_width() const;
-  inline void set_image_width(::google::protobuf::int32 value);
-  
-  // optional int32 image_height = 27;
-  inline bool has_image_height() const;
-  inline void clear_image_height();
-  static const int kImageHeightFieldNumber = 27;
-  inline ::google::protobuf::int32 image_height() const;
-  inline void set_image_height(::google::protobuf::int32 value);
-  
-  // optional float time = 11;
-  inline bool has_time() const;
-  inline void clear_time();
-  static const int kTimeFieldNumber = 11;
-  inline float time() const;
-  inline void set_time(float value);
-  
-  // optional .com.android.glesv2debugger.Message.Prop prop = 21;
-  inline bool has_prop() const;
-  inline void clear_prop();
-  static const int kPropFieldNumber = 21;
-  inline ::com::android::glesv2debugger::Message_Prop prop() const;
-  inline void set_prop(::com::android::glesv2debugger::Message_Prop value);
-  
-  // optional float clock = 22;
-  inline bool has_clock() const;
-  inline void clear_clock();
-  static const int kClockFieldNumber = 22;
-  inline float clock() const;
-  inline void set_clock(float value);
-  
-  // @@protoc_insertion_point(class_scope:com.android.glesv2debugger.Message)
- private:
-  mutable int _cached_size_;
-  
-  ::google::protobuf::int32 context_id_;
-  int function_;
-  int type_;
-  bool expect_response_;
-  ::google::protobuf::int32 ret_;
-  ::google::protobuf::int32 arg0_;
-  ::google::protobuf::int32 arg1_;
-  ::google::protobuf::int32 arg2_;
-  ::google::protobuf::int32 arg3_;
-  ::google::protobuf::int32 arg4_;
-  ::google::protobuf::int32 arg5_;
-  ::google::protobuf::int32 arg6_;
-  ::google::protobuf::int32 arg7_;
-  ::google::protobuf::int32 arg8_;
-  ::std::string* data_;
-  static const ::std::string _default_data_;
-  int data_type_;
-  ::google::protobuf::int32 pixel_format_;
-  ::google::protobuf::int32 pixel_type_;
-  ::google::protobuf::int32 image_width_;
-  ::google::protobuf::int32 image_height_;
-  float time_;
-  int prop_;
-  float clock_;
-  friend void  protobuf_AddDesc_debugger_5fmessage_2eproto();
-  friend void protobuf_AssignDesc_debugger_5fmessage_2eproto();
-  friend void protobuf_ShutdownFile_debugger_5fmessage_2eproto();
-  
-  ::google::protobuf::uint32 _has_bits_[(23 + 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 Message* default_instance_;
-};
-// ===================================================================
-
-
-// ===================================================================
-
-// Message
-
-// required int32 context_id = 1;
-inline bool Message::has_context_id() const {
-  return _has_bit(0);
-}
-inline void Message::clear_context_id() {
-  context_id_ = 0;
-  _clear_bit(0);
-}
-inline ::google::protobuf::int32 Message::context_id() const {
-  return context_id_;
-}
-inline void Message::set_context_id(::google::protobuf::int32 value) {
-  _set_bit(0);
-  context_id_ = value;
-}
-
-// required .com.android.glesv2debugger.Message.Function function = 2 [default = NEG];
-inline bool Message::has_function() const {
-  return _has_bit(1);
-}
-inline void Message::clear_function() {
-  function_ = 187;
-  _clear_bit(1);
-}
-inline ::com::android::glesv2debugger::Message_Function Message::function() const {
-  return static_cast< ::com::android::glesv2debugger::Message_Function >(function_);
-}
-inline void Message::set_function(::com::android::glesv2debugger::Message_Function value) {
-  GOOGLE_DCHECK(::com::android::glesv2debugger::Message_Function_IsValid(value));
-  _set_bit(1);
-  function_ = value;
-}
-
-// required .com.android.glesv2debugger.Message.Type type = 3;
-inline bool Message::has_type() const {
-  return _has_bit(2);
-}
-inline void Message::clear_type() {
-  type_ = 0;
-  _clear_bit(2);
-}
-inline ::com::android::glesv2debugger::Message_Type Message::type() const {
-  return static_cast< ::com::android::glesv2debugger::Message_Type >(type_);
-}
-inline void Message::set_type(::com::android::glesv2debugger::Message_Type value) {
-  GOOGLE_DCHECK(::com::android::glesv2debugger::Message_Type_IsValid(value));
-  _set_bit(2);
-  type_ = value;
-}
-
-// required bool expect_response = 4;
-inline bool Message::has_expect_response() const {
-  return _has_bit(3);
-}
-inline void Message::clear_expect_response() {
-  expect_response_ = false;
-  _clear_bit(3);
-}
-inline bool Message::expect_response() const {
-  return expect_response_;
-}
-inline void Message::set_expect_response(bool value) {
-  _set_bit(3);
-  expect_response_ = value;
-}
-
-// optional int32 ret = 5;
-inline bool Message::has_ret() const {
-  return _has_bit(4);
-}
-inline void Message::clear_ret() {
-  ret_ = 0;
-  _clear_bit(4);
-}
-inline ::google::protobuf::int32 Message::ret() const {
-  return ret_;
-}
-inline void Message::set_ret(::google::protobuf::int32 value) {
-  _set_bit(4);
-  ret_ = value;
-}
-
-// optional int32 arg0 = 6;
-inline bool Message::has_arg0() const {
-  return _has_bit(5);
-}
-inline void Message::clear_arg0() {
-  arg0_ = 0;
-  _clear_bit(5);
-}
-inline ::google::protobuf::int32 Message::arg0() const {
-  return arg0_;
-}
-inline void Message::set_arg0(::google::protobuf::int32 value) {
-  _set_bit(5);
-  arg0_ = value;
-}
-
-// optional int32 arg1 = 7;
-inline bool Message::has_arg1() const {
-  return _has_bit(6);
-}
-inline void Message::clear_arg1() {
-  arg1_ = 0;
-  _clear_bit(6);
-}
-inline ::google::protobuf::int32 Message::arg1() const {
-  return arg1_;
-}
-inline void Message::set_arg1(::google::protobuf::int32 value) {
-  _set_bit(6);
-  arg1_ = value;
-}
-
-// optional int32 arg2 = 8;
-inline bool Message::has_arg2() const {
-  return _has_bit(7);
-}
-inline void Message::clear_arg2() {
-  arg2_ = 0;
-  _clear_bit(7);
-}
-inline ::google::protobuf::int32 Message::arg2() const {
-  return arg2_;
-}
-inline void Message::set_arg2(::google::protobuf::int32 value) {
-  _set_bit(7);
-  arg2_ = value;
-}
-
-// optional int32 arg3 = 9;
-inline bool Message::has_arg3() const {
-  return _has_bit(8);
-}
-inline void Message::clear_arg3() {
-  arg3_ = 0;
-  _clear_bit(8);
-}
-inline ::google::protobuf::int32 Message::arg3() const {
-  return arg3_;
-}
-inline void Message::set_arg3(::google::protobuf::int32 value) {
-  _set_bit(8);
-  arg3_ = value;
-}
-
-// optional int32 arg4 = 16;
-inline bool Message::has_arg4() const {
-  return _has_bit(9);
-}
-inline void Message::clear_arg4() {
-  arg4_ = 0;
-  _clear_bit(9);
-}
-inline ::google::protobuf::int32 Message::arg4() const {
-  return arg4_;
-}
-inline void Message::set_arg4(::google::protobuf::int32 value) {
-  _set_bit(9);
-  arg4_ = value;
-}
-
-// optional int32 arg5 = 17;
-inline bool Message::has_arg5() const {
-  return _has_bit(10);
-}
-inline void Message::clear_arg5() {
-  arg5_ = 0;
-  _clear_bit(10);
-}
-inline ::google::protobuf::int32 Message::arg5() const {
-  return arg5_;
-}
-inline void Message::set_arg5(::google::protobuf::int32 value) {
-  _set_bit(10);
-  arg5_ = value;
-}
-
-// optional int32 arg6 = 18;
-inline bool Message::has_arg6() const {
-  return _has_bit(11);
-}
-inline void Message::clear_arg6() {
-  arg6_ = 0;
-  _clear_bit(11);
-}
-inline ::google::protobuf::int32 Message::arg6() const {
-  return arg6_;
-}
-inline void Message::set_arg6(::google::protobuf::int32 value) {
-  _set_bit(11);
-  arg6_ = value;
-}
-
-// optional int32 arg7 = 19;
-inline bool Message::has_arg7() const {
-  return _has_bit(12);
-}
-inline void Message::clear_arg7() {
-  arg7_ = 0;
-  _clear_bit(12);
-}
-inline ::google::protobuf::int32 Message::arg7() const {
-  return arg7_;
-}
-inline void Message::set_arg7(::google::protobuf::int32 value) {
-  _set_bit(12);
-  arg7_ = value;
-}
-
-// optional int32 arg8 = 20;
-inline bool Message::has_arg8() const {
-  return _has_bit(13);
-}
-inline void Message::clear_arg8() {
-  arg8_ = 0;
-  _clear_bit(13);
-}
-inline ::google::protobuf::int32 Message::arg8() const {
-  return arg8_;
-}
-inline void Message::set_arg8(::google::protobuf::int32 value) {
-  _set_bit(13);
-  arg8_ = value;
-}
-
-// optional bytes data = 10;
-inline bool Message::has_data() const {
-  return _has_bit(14);
-}
-inline void Message::clear_data() {
-  if (data_ != &_default_data_) {
-    data_->clear();
-  }
-  _clear_bit(14);
-}
-inline const ::std::string& Message::data() const {
-  return *data_;
-}
-inline void Message::set_data(const ::std::string& value) {
-  _set_bit(14);
-  if (data_ == &_default_data_) {
-    data_ = new ::std::string;
-  }
-  data_->assign(value);
-}
-inline void Message::set_data(const char* value) {
-  _set_bit(14);
-  if (data_ == &_default_data_) {
-    data_ = new ::std::string;
-  }
-  data_->assign(value);
-}
-inline void Message::set_data(const void* value, size_t size) {
-  _set_bit(14);
-  if (data_ == &_default_data_) {
-    data_ = new ::std::string;
-  }
-  data_->assign(reinterpret_cast<const char*>(value), size);
-}
-inline ::std::string* Message::mutable_data() {
-  _set_bit(14);
-  if (data_ == &_default_data_) {
-    data_ = new ::std::string;
-  }
-  return data_;
-}
-
-// optional .com.android.glesv2debugger.Message.DataType data_type = 23;
-inline bool Message::has_data_type() const {
-  return _has_bit(15);
-}
-inline void Message::clear_data_type() {
-  data_type_ = 0;
-  _clear_bit(15);
-}
-inline ::com::android::glesv2debugger::Message_DataType Message::data_type() const {
-  return static_cast< ::com::android::glesv2debugger::Message_DataType >(data_type_);
-}
-inline void Message::set_data_type(::com::android::glesv2debugger::Message_DataType value) {
-  GOOGLE_DCHECK(::com::android::glesv2debugger::Message_DataType_IsValid(value));
-  _set_bit(15);
-  data_type_ = value;
-}
-
-// optional int32 pixel_format = 24;
-inline bool Message::has_pixel_format() const {
-  return _has_bit(16);
-}
-inline void Message::clear_pixel_format() {
-  pixel_format_ = 0;
-  _clear_bit(16);
-}
-inline ::google::protobuf::int32 Message::pixel_format() const {
-  return pixel_format_;
-}
-inline void Message::set_pixel_format(::google::protobuf::int32 value) {
-  _set_bit(16);
-  pixel_format_ = value;
-}
-
-// optional int32 pixel_type = 25;
-inline bool Message::has_pixel_type() const {
-  return _has_bit(17);
-}
-inline void Message::clear_pixel_type() {
-  pixel_type_ = 0;
-  _clear_bit(17);
-}
-inline ::google::protobuf::int32 Message::pixel_type() const {
-  return pixel_type_;
-}
-inline void Message::set_pixel_type(::google::protobuf::int32 value) {
-  _set_bit(17);
-  pixel_type_ = value;
-}
-
-// optional int32 image_width = 26;
-inline bool Message::has_image_width() const {
-  return _has_bit(18);
-}
-inline void Message::clear_image_width() {
-  image_width_ = 0;
-  _clear_bit(18);
-}
-inline ::google::protobuf::int32 Message::image_width() const {
-  return image_width_;
-}
-inline void Message::set_image_width(::google::protobuf::int32 value) {
-  _set_bit(18);
-  image_width_ = value;
-}
-
-// optional int32 image_height = 27;
-inline bool Message::has_image_height() const {
-  return _has_bit(19);
-}
-inline void Message::clear_image_height() {
-  image_height_ = 0;
-  _clear_bit(19);
-}
-inline ::google::protobuf::int32 Message::image_height() const {
-  return image_height_;
-}
-inline void Message::set_image_height(::google::protobuf::int32 value) {
-  _set_bit(19);
-  image_height_ = value;
-}
-
-// optional float time = 11;
-inline bool Message::has_time() const {
-  return _has_bit(20);
-}
-inline void Message::clear_time() {
-  time_ = 0;
-  _clear_bit(20);
-}
-inline float Message::time() const {
-  return time_;
-}
-inline void Message::set_time(float value) {
-  _set_bit(20);
-  time_ = value;
-}
-
-// optional .com.android.glesv2debugger.Message.Prop prop = 21;
-inline bool Message::has_prop() const {
-  return _has_bit(21);
-}
-inline void Message::clear_prop() {
-  prop_ = 0;
-  _clear_bit(21);
-}
-inline ::com::android::glesv2debugger::Message_Prop Message::prop() const {
-  return static_cast< ::com::android::glesv2debugger::Message_Prop >(prop_);
-}
-inline void Message::set_prop(::com::android::glesv2debugger::Message_Prop value) {
-  GOOGLE_DCHECK(::com::android::glesv2debugger::Message_Prop_IsValid(value));
-  _set_bit(21);
-  prop_ = value;
-}
-
-// optional float clock = 22;
-inline bool Message::has_clock() const {
-  return _has_bit(22);
-}
-inline void Message::clear_clock() {
-  clock_ = 0;
-  _clear_bit(22);
-}
-inline float Message::clock() const {
-  return clock_;
-}
-inline void Message::set_clock(float value) {
-  _set_bit(22);
-  clock_ = value;
-}
-
-
-// @@protoc_insertion_point(namespace_scope)
-
-}  // namespace glesv2debugger
-}  // namespace android
-}  // namespace com
-
-// @@protoc_insertion_point(global_scope)
-
-#endif  // PROTOBUF_debugger_5fmessage_2eproto__INCLUDED
diff --git a/opengl/libs/GLES2_dbg/src/egl.cpp b/opengl/libs/GLES2_dbg/src/egl.cpp
deleted file mode 100644
index bbea3bd..0000000
--- a/opengl/libs/GLES2_dbg/src/egl.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- ** Copyright 2011, 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 "header.h"
-
-EGLBoolean Debug_eglSwapBuffers(EGLDisplay dpy, EGLSurface draw)
-{
-    DbgContext * const dbg = getDbgContextThreadSpecific();
-    glesv2debugger::Message msg;
-    struct : public FunctionCall {
-        EGLDisplay dpy;
-        EGLSurface draw;
-
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            msg.set_time(-1);
-            return reinterpret_cast<const int *>(true);
-        }
-    } caller;
-    caller.dpy = dpy;
-    caller.draw = draw;
-
-    msg.set_arg0(reinterpret_cast<int>(dpy));
-    msg.set_arg1(reinterpret_cast<int>(draw));
-    if (dbg->captureSwap > 0) {
-        dbg->captureSwap--;
-        int viewport[4] = {};
-        dbg->hooks->gl.glGetIntegerv(GL_VIEWPORT, viewport);
-        void * pixels = dbg->GetReadPixelsBuffer(viewport[2] * viewport[3] *
-                        dbg->readBytesPerPixel);
-        dbg->hooks->gl.glReadPixels(viewport[0], viewport[1], viewport[2],
-                                    viewport[3], GL_RGBA, GL_UNSIGNED_BYTE, pixels);
-        dbg->CompressReadPixelBuffer(msg.mutable_data());
-        msg.set_data_type(msg.ReferencedImage);
-        msg.set_pixel_format(GL_RGBA);
-        msg.set_pixel_type(GL_UNSIGNED_BYTE);
-        msg.set_image_width(viewport[2]);
-        msg.set_image_height(viewport[3]);
-    }
-    int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_eglSwapBuffers);
-    return static_cast<EGLBoolean>(reinterpret_cast<int>(ret));
-}
diff --git a/opengl/libs/GLES2_dbg/src/header.h b/opengl/libs/GLES2_dbg/src/header.h
deleted file mode 100644
index 0ab4890..0000000
--- a/opengl/libs/GLES2_dbg/src/header.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- ** Copyright 2011, 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.
- */
-
-#ifndef ANDROID_GLES2_DBG_HEADER_H
-#define ANDROID_GLES2_DBG_HEADER_H
-
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-
-#include <cutils/log.h>
-#include <utils/Timers.h>
-
-#include "hooks.h"
-
-#include "glesv2dbg.h"
-
-#define GL_ENTRY(_r, _api, ...) _r Debug_##_api ( __VA_ARGS__ );
-#include "glesv2dbg_functions.h"
-
-#include "debugger_message.pb.h"
-
-using namespace android;
-using namespace com::android;
-
-#ifndef __location__
-#define __HIERALLOC_STRING_0__(s)   #s
-#define __HIERALLOC_STRING_1__(s)   __HIERALLOC_STRING_0__(s)
-#define __HIERALLOC_STRING_2__      __HIERALLOC_STRING_1__(__LINE__)
-#define __location__                __FILE__ ":" __HIERALLOC_STRING_2__
-#endif
-
-#undef assert
-#define assert(expr) if (!(expr)) { ALOGD("\n*\n*\n* assert: %s at %s \n*\n*", #expr, __location__); int * x = 0; *x = 5; }
-//#undef ALOGD
-//#define ALOGD(...)
-
-namespace android
-{
-
-struct GLFunctionBitfield {
-    unsigned char field [24]; // 8 * 24 = 192
-
-    void Bit(const glesv2debugger::Message_Function function, bool bit) {
-        const unsigned byte = function / 8, mask = 1 << (function % 8);
-        if (bit)
-            field[byte] |= mask;
-        else
-            field[byte] &= ~mask;
-    }
-
-    bool Bit(const glesv2debugger::Message_Function function) const {
-        const unsigned byte = function / 8, mask = 1 << (function % 8);
-        return field[byte] & mask;
-    }
-};
-
-struct DbgContext {
-    static const unsigned int LZF_CHUNK_SIZE = 256 * 1024;
-
-private:
-    char * lzf_buf; // malloc / free; for lzf chunk compression and other uses
-
-    // used as buffer and reference frame for ReadPixels; malloc/free
-    unsigned * lzf_ref [2];
-    unsigned lzf_readIndex; // 0 or 1
-    unsigned lzf_refSize, lzf_refBufSize; // bytes
-
-public:
-    const unsigned int version; // 0 is GLES1, 1 is GLES2
-    const gl_hooks_t * const hooks;
-    const unsigned int MAX_VERTEX_ATTRIBS;
-    const unsigned int readBytesPerPixel;
-
-    unsigned int captureSwap; // number of eglSwapBuffers to glReadPixels
-    unsigned int captureDraw; // number of glDrawArrays/Elements to glReadPixels
-
-    GLFunctionBitfield expectResponse;
-
-    struct VertexAttrib {
-        GLenum type; // element data type
-        unsigned size; // number of data per element
-        unsigned stride; // calculated number of bytes between elements
-        const void * ptr;
-        unsigned elemSize; // calculated number of bytes per element
-        GLuint buffer; // buffer name
-        GLboolean normalized : 1;
-        GLboolean enabled : 1;
-        VertexAttrib() : type(0), size(0), stride(0), ptr(NULL), elemSize(0),
-                buffer(0), normalized(0), enabled(0) {}
-    } * vertexAttribs;
-    bool hasNonVBOAttribs; // whether any enabled vertexAttrib is user pointer
-
-    struct VBO {
-        const GLuint name;
-        const GLenum target;
-        VBO * next;
-        void * data; // malloc/free
-        unsigned size; // in bytes
-        VBO(const GLuint name, const GLenum target, VBO * head) : name(name),
-                target(target), next(head), data(NULL), size(0) {}
-    } * indexBuffers; // linked list of all index buffers
-    VBO * indexBuffer; // currently bound index buffer
-
-    GLuint program;
-    unsigned maxAttrib; // number of slots used by program
-
-    DbgContext(const unsigned version, const gl_hooks_t * const hooks,
-               const unsigned MAX_VERTEX_ATTRIBS);
-    ~DbgContext();
-
-    void Fetch(const unsigned index, std::string * const data) const;
-    void Compress(const void * in_data, unsigned in_len, std::string * const outStr);
-    static unsigned char * Decompress(const void * in, const unsigned int inLen,
-                                      unsigned int * const outLen); // malloc/free
-    void * GetReadPixelsBuffer(const unsigned size);
-    bool IsReadPixelBuffer(const void * const ptr)  {
-        return ptr == lzf_ref[lzf_readIndex];
-    }
-    void CompressReadPixelBuffer(std::string * const outStr);
-    char * GetBuffer(); // allocates lzf_buf if NULL
-    unsigned int GetBufferSize(); // allocates lzf_buf if NULL
-
-    void glUseProgram(GLuint program);
-    void glEnableVertexAttribArray(GLuint index);
-    void glDisableVertexAttribArray(GLuint index);
-    void glVertexAttribPointer(GLuint indx, GLint size, GLenum type,
-                               GLboolean normalized, GLsizei stride, const GLvoid* ptr);
-    void glBindBuffer(GLenum target, GLuint buffer);
-    void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
-    void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
-    void glDeleteBuffers(GLsizei n, const GLuint *buffers);
-};
-
-DbgContext * getDbgContextThreadSpecific();
-
-struct FunctionCall {
-    virtual const int * operator()(gl_hooks_t::gl_t const * const _c,
-                                   glesv2debugger::Message & msg) = 0;
-    virtual ~FunctionCall() {}
-};
-
-// move these into DbgContext as static
-extern int timeMode; // SYSTEM_TIME_
-
-extern int clientSock, serverSock;
-
-unsigned GetBytesPerPixel(const GLenum format, const GLenum type);
-
-// every Debug_gl* function calls this to send message to client and possibly receive commands
-int * MessageLoop(FunctionCall & functionCall, glesv2debugger::Message & msg,
-                  const glesv2debugger::Message_Function function);
-
-void Receive(glesv2debugger::Message & cmd);
-float Send(const glesv2debugger::Message & msg, glesv2debugger::Message & cmd);
-void SetProp(DbgContext * const dbg, const glesv2debugger::Message & cmd);
-const int * GenerateCall(DbgContext * const dbg, const glesv2debugger::Message & cmd,
-                         glesv2debugger::Message & msg, const int * const prevRet);
-}; // namespace android {
-
-#endif // #ifndef ANDROID_GLES2_DBG_HEADER_H
diff --git a/opengl/libs/GLES2_dbg/src/server.cpp b/opengl/libs/GLES2_dbg/src/server.cpp
deleted file mode 100644
index 3e93697..0000000
--- a/opengl/libs/GLES2_dbg/src/server.cpp
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- ** Copyright 2011, 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 <sys/ioctl.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <fcntl.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <pthread.h>
-
-#include "header.h"
-
-namespace android
-{
-
-int serverSock = -1, clientSock = -1;
-FILE * file = NULL;
-unsigned int MAX_FILE_SIZE = 0;
-int timeMode = SYSTEM_TIME_THREAD;
-
-static void Die(const char * msg)
-{
-    ALOGD("\n*\n*\n* GLESv2_dbg: Die: %s \n*\n*", msg);
-    StopDebugServer();
-    exit(1);
-}
-
-void StartDebugServer(const unsigned short port, const bool forceUseFile,
-                      const unsigned int maxFileSize, const char * const filePath)
-{
-    MAX_FILE_SIZE = maxFileSize;
-
-    ALOGD("GLESv2_dbg: StartDebugServer");
-    if (serverSock >= 0 || file)
-        return;
-
-    ALOGD("GLESv2_dbg: StartDebugServer create socket");
-    struct sockaddr_in server = {}, client = {};
-
-    /* Create the TCP socket */
-    if (forceUseFile || (serverSock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
-        file = fopen(filePath, "wb");
-        if (!file)
-            Die("Failed to create socket and file");
-        else
-            return;
-    }
-    /* Construct the server sockaddr_in structure */
-    server.sin_family = AF_INET;                  /* Internet/IP */
-    server.sin_addr.s_addr = htonl(INADDR_LOOPBACK);   /* Incoming addr */
-    server.sin_port = htons(port);       /* server port */
-
-    /* Bind the server socket */
-    socklen_t sizeofSockaddr_in = sizeof(sockaddr_in);
-    if (bind(serverSock, (struct sockaddr *) &server,
-             sizeof(server)) < 0) {
-        Die("Failed to bind the server socket");
-    }
-    /* Listen on the server socket */
-    if (listen(serverSock, 1) < 0) {
-        Die("Failed to listen on server socket");
-    }
-
-    ALOGD("server started on %d \n", server.sin_port);
-
-
-    /* Wait for client connection */
-    if ((clientSock =
-                accept(serverSock, (struct sockaddr *) &client,
-                       &sizeofSockaddr_in)) < 0) {
-        Die("Failed to accept client connection");
-    }
-
-    ALOGD("Client connected: %s\n", inet_ntoa(client.sin_addr));
-//    fcntl(clientSock, F_SETFL, O_NONBLOCK);
-}
-
-void StopDebugServer()
-{
-    ALOGD("GLESv2_dbg: StopDebugServer");
-    if (clientSock > 0) {
-        close(clientSock);
-        clientSock = -1;
-    }
-    if (serverSock > 0) {
-        close(serverSock);
-        serverSock = -1;
-    }
-    if (file) {
-        fclose(file);
-        file = NULL;
-    }
-}
-
-void Receive(glesv2debugger::Message & cmd)
-{
-    if (clientSock < 0)
-        return;
-    unsigned len = 0;
-    int received = recv(clientSock, &len, 4, MSG_WAITALL);
-    if (received < 0)
-        Die("Failed to receive response length");
-    else if (4 != received) {
-        ALOGD("received %dB: %.8X", received, len);
-        Die("Received length mismatch, expected 4");
-    }
-    static void * buffer = NULL;
-    static unsigned bufferSize = 0;
-    if (bufferSize < len) {
-        buffer = realloc(buffer, len);
-        assert(buffer);
-        bufferSize = len;
-    }
-    received = recv(clientSock, buffer, len, MSG_WAITALL);
-    if (received < 0)
-        Die("Failed to receive response");
-    else if (len != received)
-        Die("Received length mismatch");
-    cmd.Clear();
-    cmd.ParseFromArray(buffer, len);
-}
-
-bool TryReceive(glesv2debugger::Message & cmd)
-{
-    if (clientSock < 0)
-        return false;
-    fd_set readSet;
-    FD_ZERO(&readSet);
-    FD_SET(clientSock, &readSet);
-    timeval timeout;
-    timeout.tv_sec = timeout.tv_usec = 0;
-
-    int rc = select(clientSock + 1, &readSet, NULL, NULL, &timeout);
-    if (rc < 0)
-        Die("failed to select clientSock");
-
-    bool received = false;
-    if (FD_ISSET(clientSock, &readSet)) {
-        ALOGD("TryReceive: avaiable for read");
-        Receive(cmd);
-        return true;
-    }
-    return false;
-}
-
-float Send(const glesv2debugger::Message & msg, glesv2debugger::Message & cmd)
-{
-    // TODO: use per DbgContext send/receive buffer and async socket
-    //  instead of mutex and blocking io; watch out for large messages
-    static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-    struct Autolock {
-        Autolock() {
-            pthread_mutex_lock(&mutex);
-        }
-        ~Autolock() {
-            pthread_mutex_unlock(&mutex);
-        }
-    } autolock;
-
-    if (msg.function() != glesv2debugger::Message_Function_ACK)
-        assert(msg.has_context_id() && msg.context_id() != 0);
-    static std::string str;
-    msg.SerializeToString(&str);
-    const uint32_t len = str.length();
-    if (clientSock < 0) {
-        if (file) {
-            fwrite(&len, sizeof(len), 1, file);
-            fwrite(str.data(), len, 1, file);
-            if (ftell(file) >= MAX_FILE_SIZE) {
-                fclose(file);
-                Die("MAX_FILE_SIZE reached");
-            }
-        }
-        return 0;
-    }
-    int sent = -1;
-    sent = send(clientSock, &len, sizeof(len), 0);
-    if (sent != sizeof(len)) {
-        ALOGD("actual sent=%d expected=%d clientSock=%d", sent, sizeof(len), clientSock);
-        Die("Failed to send message length");
-    }
-    nsecs_t c0 = systemTime(timeMode);
-    sent = send(clientSock, str.data(), str.length(), 0);
-    float t = (float)ns2ms(systemTime(timeMode) - c0);
-    if (sent != str.length()) {
-        ALOGD("actual sent=%d expected=%d clientSock=%d", sent, str.length(), clientSock);
-        Die("Failed to send message");
-    }
-    // TODO: factor Receive & TryReceive out and into MessageLoop, or add control argument.
-    // mean while, if server is sending a SETPROP then don't try to receive,
-    //  because server will not be processing received command
-    if (msg.function() == msg.SETPROP)
-        return t;
-    // try to receive commands even though not expecting response,
-    //  since client can send SETPROP and other commands anytime
-    if (!msg.expect_response()) {
-        if (TryReceive(cmd)) {
-            if (glesv2debugger::Message_Function_SETPROP == cmd.function())
-                ALOGD("Send: TryReceived SETPROP");
-            else
-                ALOGD("Send: TryReceived %u", cmd.function());
-        }
-    } else
-        Receive(cmd);
-    return t;
-}
-
-void SetProp(DbgContext * const dbg, const glesv2debugger::Message & cmd)
-{
-    switch (cmd.prop()) {
-    case glesv2debugger::Message_Prop_CaptureDraw:
-        ALOGD("SetProp Message_Prop_CaptureDraw %d", cmd.arg0());
-        dbg->captureDraw = cmd.arg0();
-        break;
-    case glesv2debugger::Message_Prop_TimeMode:
-        ALOGD("SetProp Message_Prop_TimeMode %d", cmd.arg0());
-        timeMode = cmd.arg0();
-        break;
-    case glesv2debugger::Message_Prop_ExpectResponse:
-        ALOGD("SetProp Message_Prop_ExpectResponse %d=%d", cmd.arg0(), cmd.arg1());
-        dbg->expectResponse.Bit((glesv2debugger::Message_Function)cmd.arg0(), cmd.arg1());
-        break;
-    case glesv2debugger::Message_Prop_CaptureSwap:
-        ALOGD("SetProp CaptureSwap %d", cmd.arg0());
-        dbg->captureSwap = cmd.arg0();
-        break;
-    default:
-        assert(0);
-    }
-}
-
-int * MessageLoop(FunctionCall & functionCall, glesv2debugger::Message & msg,
-                  const glesv2debugger::Message_Function function)
-{
-    DbgContext * const dbg = getDbgContextThreadSpecific();
-    const int * ret = 0;
-    glesv2debugger::Message cmd;
-    msg.set_context_id(reinterpret_cast<int>(dbg));
-    msg.set_type(glesv2debugger::Message_Type_BeforeCall);
-    bool expectResponse = dbg->expectResponse.Bit(function);
-    msg.set_expect_response(expectResponse);
-    msg.set_function(function);
-
-    // when not exectResponse, set cmd to CONTINUE then SKIP
-    // cmd will be overwritten by received command
-    cmd.set_function(glesv2debugger::Message_Function_CONTINUE);
-    cmd.set_expect_response(expectResponse);
-    glesv2debugger::Message_Function oldCmd = cmd.function();
-    Send(msg, cmd);
-    expectResponse = cmd.expect_response();
-    while (true) {
-        msg.Clear();
-        nsecs_t c0 = systemTime(timeMode);
-        switch (cmd.function()) {
-        case glesv2debugger::Message_Function_CONTINUE:
-            ret = functionCall(&dbg->hooks->gl, msg);
-            while (GLenum error = dbg->hooks->gl.glGetError())
-                ALOGD("Function=%u glGetError() = 0x%.4X", function, error);
-            if (!msg.has_time()) // some has output data copy, so time inside call
-                msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.set_context_id(reinterpret_cast<int>(dbg));
-            msg.set_function(function);
-            msg.set_type(glesv2debugger::Message_Type_AfterCall);
-            msg.set_expect_response(expectResponse);
-            if (!expectResponse) {
-                cmd.set_function(glesv2debugger::Message_Function_SKIP);
-                cmd.set_expect_response(false);
-            }
-            oldCmd = cmd.function();
-            Send(msg, cmd);
-            expectResponse = cmd.expect_response();
-            break;
-        case glesv2debugger::Message_Function_SKIP:
-            return const_cast<int *>(ret);
-        case glesv2debugger::Message_Function_SETPROP:
-            SetProp(dbg, cmd);
-            expectResponse = cmd.expect_response();
-            if (!expectResponse) // SETPROP is "out of band"
-                cmd.set_function(oldCmd);
-            else
-                Receive(cmd);
-            break;
-        default:
-            ret = GenerateCall(dbg, cmd, msg, ret);
-            msg.set_expect_response(expectResponse);
-            if (!expectResponse) {
-                cmd.set_function(cmd.SKIP);
-                cmd.set_expect_response(expectResponse);
-            }
-            oldCmd = cmd.function();
-            Send(msg, cmd);
-            expectResponse = cmd.expect_response();
-            break;
-        }
-    }
-    return 0;
-}
-}; // namespace android {
diff --git a/opengl/libs/GLES2_dbg/src/vertex.cpp b/opengl/libs/GLES2_dbg/src/vertex.cpp
deleted file mode 100644
index 70c3433..0000000
--- a/opengl/libs/GLES2_dbg/src/vertex.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- ** Copyright 2011, 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 "header.h"
-
-namespace android
-{
-bool capture; // capture after each glDraw*
-}
-
-void Debug_glDrawArrays(GLenum mode, GLint first, GLsizei count)
-{
-    DbgContext * const dbg = getDbgContextThreadSpecific();
-    glesv2debugger::Message msg, cmd;
-    msg.set_context_id(reinterpret_cast<int>(dbg));
-    msg.set_type(glesv2debugger::Message_Type_BeforeCall);
-    bool expectResponse = dbg->expectResponse.Bit(glesv2debugger::Message_Function_glDrawArrays);
-    msg.set_expect_response(expectResponse);
-    msg.set_function(glesv2debugger::Message_Function_glDrawArrays);
-    msg.set_arg0(mode);
-    msg.set_arg1(first);
-    msg.set_arg2(count);
-
-    msg.set_arg7(dbg->maxAttrib); // indicate capturing vertex data
-    if (dbg->hasNonVBOAttribs) {
-        std::string * const data = msg.mutable_data();
-        for (unsigned i = 0; i < count; i++)
-            dbg->Fetch(i + first, data);
-    }
-
-    void * pixels = NULL;
-    int viewport[4] = {};
-    cmd.set_function(glesv2debugger::Message_Function_CONTINUE);
-    cmd.set_expect_response(expectResponse);
-    glesv2debugger::Message_Function oldCmd = cmd.function();
-    Send(msg, cmd);
-    expectResponse = cmd.expect_response();
-    while (true) {
-        msg.Clear();
-        nsecs_t c0 = systemTime(timeMode);
-        switch (cmd.function()) {
-        case glesv2debugger::Message_Function_CONTINUE:
-            dbg->hooks->gl.glDrawArrays(mode, first, count);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.set_context_id(reinterpret_cast<int>(dbg));
-            msg.set_function(glesv2debugger::Message_Function_glDrawArrays);
-            msg.set_type(glesv2debugger::Message_Type_AfterCall);
-            msg.set_expect_response(expectResponse);
-            if (!expectResponse) {
-                cmd.set_function(glesv2debugger::Message_Function_SKIP);
-                cmd.set_expect_response(false);
-            }
-            oldCmd = cmd.function();
-            Send(msg, cmd);
-            expectResponse = cmd.expect_response();
-            // TODO: pack glReadPixels data with vertex data instead of
-            //  relying on sperate call for transport, this would allow
-            //  auto generated message loop using EXTEND_Debug macro
-            if (dbg->captureDraw > 0) {
-                dbg->captureDraw--;
-                dbg->hooks->gl.glGetIntegerv(GL_VIEWPORT, viewport);
-//                ALOGD("glDrawArrays CAPTURE: x=%d y=%d width=%d height=%d format=0x%.4X type=0x%.4X",
-//                     viewport[0], viewport[1], viewport[2], viewport[3], readFormat, readType);
-                pixels = dbg->GetReadPixelsBuffer(viewport[2] * viewport[3] *
-                                                  dbg->readBytesPerPixel);
-                Debug_glReadPixels(viewport[0], viewport[1], viewport[2], viewport[3],
-                        GL_RGBA, GL_UNSIGNED_BYTE, pixels);
-            }
-            break;
-        case glesv2debugger::Message_Function_SKIP:
-            return;
-        case glesv2debugger::Message_Function_SETPROP:
-            SetProp(dbg, cmd);
-            expectResponse = cmd.expect_response();
-            if (!expectResponse) // SETPROP is "out of band"
-                cmd.set_function(oldCmd);
-            else
-                Receive(cmd);
-            break;
-        default:
-            GenerateCall(dbg, cmd, msg, NULL);
-            msg.set_expect_response(expectResponse);
-            if (!expectResponse) {
-                cmd.set_function(cmd.SKIP);
-                cmd.set_expect_response(expectResponse);
-            }
-            oldCmd = cmd.function();
-            Send(msg, cmd);
-            expectResponse = cmd.expect_response();
-            break;
-        }
-    }
-}
-
-template<typename T>
-static inline void FetchIndexed(const unsigned count, const T * indices,
-                                std::string * const data, const DbgContext * const ctx)
-{
-    for (unsigned i = 0; i < count; i++) {
-        if (!ctx->indexBuffer)
-            data->append((const char *)(indices + i), sizeof(*indices));
-        if (ctx->hasNonVBOAttribs)
-            ctx->Fetch(indices[i], data);
-    }
-}
-
-void Debug_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices)
-{
-    DbgContext * const dbg = getDbgContextThreadSpecific();
-    glesv2debugger::Message msg, cmd;
-    msg.set_context_id(reinterpret_cast<int>(dbg));
-    msg.set_type(glesv2debugger::Message_Type_BeforeCall);
-    bool expectResponse = dbg->expectResponse.Bit(glesv2debugger::Message_Function_glDrawElements);
-    msg.set_expect_response(expectResponse);
-    msg.set_function(glesv2debugger::Message_Function_glDrawElements);
-    msg.set_arg0(mode);
-    msg.set_arg1(count);
-    msg.set_arg2(type);
-    msg.set_arg3(reinterpret_cast<int>(indices));
-
-    msg.set_arg7(dbg->maxAttrib); // indicate capturing vertex data
-    std::string * const data = msg.mutable_data();
-    if (GL_UNSIGNED_BYTE == type) {
-        if (dbg->indexBuffer) {
-            FetchIndexed(count, (unsigned char *)dbg->indexBuffer->data +
-                         (unsigned long)indices, data, dbg);
-        } else {
-            FetchIndexed(count, (unsigned char *)indices, data, dbg);
-        }
-    } else if (GL_UNSIGNED_SHORT == type) {
-        if (dbg->indexBuffer) {
-            FetchIndexed(count, (unsigned short *)((char *)dbg->indexBuffer->data +
-                                                   (unsigned long)indices), data, dbg);
-        } else {
-            FetchIndexed(count, (unsigned short *)indices, data, dbg);
-        }
-    } else {
-        assert(0);
-    }
-
-    void * pixels = NULL;
-    int viewport[4] = {};
-    cmd.set_function(glesv2debugger::Message_Function_CONTINUE);
-    cmd.set_expect_response(expectResponse);
-    glesv2debugger::Message_Function oldCmd = cmd.function();
-    Send(msg, cmd);
-    expectResponse = cmd.expect_response();
-    while (true) {
-        msg.Clear();
-        nsecs_t c0 = systemTime(timeMode);
-        switch (cmd.function()) {
-        case glesv2debugger::Message_Function_CONTINUE:
-            dbg->hooks->gl.glDrawElements(mode, count, type, indices);
-            msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
-            msg.set_context_id(reinterpret_cast<int>(dbg));
-            msg.set_function(glesv2debugger::Message_Function_glDrawElements);
-            msg.set_type(glesv2debugger::Message_Type_AfterCall);
-            msg.set_expect_response(expectResponse);
-            if (!expectResponse) {
-                cmd.set_function(glesv2debugger::Message_Function_SKIP);
-                cmd.set_expect_response(false);
-            }
-            oldCmd = cmd.function();
-            Send(msg, cmd);
-            expectResponse = cmd.expect_response();
-            // TODO: pack glReadPixels data with vertex data instead of
-            //  relying on separate call for transport, this would allow
-            //  auto generated message loop using EXTEND_Debug macro
-            if (dbg->captureDraw > 0) {
-                dbg->captureDraw--;
-                dbg->hooks->gl.glGetIntegerv(GL_VIEWPORT, viewport);
-                pixels = dbg->GetReadPixelsBuffer(viewport[2] * viewport[3] *
-                                                  dbg->readBytesPerPixel);
-                Debug_glReadPixels(viewport[0], viewport[1], viewport[2], viewport[3],
-                        GL_RGBA, GL_UNSIGNED_BYTE, pixels);
-            }
-            break;
-        case glesv2debugger::Message_Function_SKIP:
-            return;
-        case glesv2debugger::Message_Function_SETPROP:
-            SetProp(dbg, cmd);
-            expectResponse = cmd.expect_response();
-            if (!expectResponse) // SETPROP is "out of band"
-                cmd.set_function(oldCmd);
-            else
-                Receive(cmd);
-            break;
-        default:
-            GenerateCall(dbg, cmd, msg, NULL);
-            msg.set_expect_response(expectResponse);
-            if (!expectResponse) {
-                cmd.set_function(cmd.SKIP);
-                cmd.set_expect_response(expectResponse);
-            }
-            oldCmd = cmd.function();
-            Send(msg, cmd);
-            expectResponse = cmd.expect_response();
-            break;
-        }
-    }
-}
diff --git a/opengl/libs/GLES2_dbg/test/Android.mk b/opengl/libs/GLES2_dbg/test/Android.mk
deleted file mode 100644
index 8708d43..0000000
--- a/opengl/libs/GLES2_dbg/test/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_C_INCLUDES := \
-    $(LOCAL_PATH) \
-    $(LOCAL_PATH)/../src \
-    $(LOCAL_PATH)/../../ \
-    external/gtest/include \
-    external/stlport/stlport \
-    external/protobuf/src \
-    bionic \
-    external \
-#
-
-LOCAL_SRC_FILES:= \
-    test_main.cpp \
-    test_server.cpp \
-    test_socket.cpp \
-#
-
-LOCAL_SHARED_LIBRARIES := libcutils libutils libGLESv2_dbg libstlport
-LOCAL_STATIC_LIBRARIES := libgtest libprotobuf-cpp-2.3.0-lite liblzf
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE:= libGLESv2_dbg_test
-
-ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
-    LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
-endif
-LOCAL_C_INCLUDES += bionic/libc/private
-
-LOCAL_CFLAGS += -DLOG_TAG=\"libEGL\"
-LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-LOCAL_CFLAGS += -fvisibility=hidden
-
-include $(BUILD_EXECUTABLE)
-
diff --git a/opengl/libs/GLES2_dbg/test/test_main.cpp b/opengl/libs/GLES2_dbg/test/test_main.cpp
deleted file mode 100644
index 183bf8e..0000000
--- a/opengl/libs/GLES2_dbg/test/test_main.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- ** Copyright 2011, 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 "header.h"
-#include "gtest/gtest.h"
-#include "hooks.h"
-
-namespace
-{
-
-// The fixture for testing class Foo.
-class DbgContextTest : public ::testing::Test
-{
-protected:
-    android::DbgContext dbg;
-    gl_hooks_t hooks;
-
-    DbgContextTest()
-            : dbg(1, &hooks, 32) {
-        // You can do set-up work for each test here.
-        hooks.gl.glGetError = GetError;
-    }
-
-    static GLenum GetError() {
-        return GL_NO_ERROR;
-    }
-
-    virtual ~DbgContextTest() {
-        // You can do clean-up work that doesn't throw exceptions here.
-    }
-
-    // If the constructor and destructor are not enough for setting up
-    // and cleaning up each test, you can define the following methods:
-
-    virtual void SetUp() {
-        // Code here will be called immediately after the constructor (right
-        // before each test).
-    }
-
-    virtual void TearDown() {
-        // Code here will be called immediately after each test (right
-        // before the destructor).
-    }
-};
-
-TEST_F(DbgContextTest, GetReadPixelBuffer)
-{
-    const unsigned int bufferSize = 512;
-    // test that it's allocating two buffers and swapping them
-    void * const buffer0 = dbg.GetReadPixelsBuffer(bufferSize);
-    ASSERT_NE((void *)NULL, buffer0);
-    for (unsigned int i = 0; i < bufferSize / sizeof(unsigned int); i++) {
-        EXPECT_EQ(0, ((unsigned int *)buffer0)[i])
-        << "GetReadPixelsBuffer should allocate and zero";
-        ((unsigned int *)buffer0)[i] = i * 13;
-    }
-
-    void * const buffer1 = dbg.GetReadPixelsBuffer(bufferSize);
-    ASSERT_NE((void *)NULL, buffer1);
-    EXPECT_NE(buffer0, buffer1);
-    for (unsigned int i = 0; i < bufferSize / sizeof(unsigned int); i++) {
-        EXPECT_EQ(0, ((unsigned int *)buffer1)[i])
-        << "GetReadPixelsBuffer should allocate and zero";
-        ((unsigned int *)buffer1)[i] = i * 17;
-    }
-
-    void * const buffer2 = dbg.GetReadPixelsBuffer(bufferSize);
-    EXPECT_EQ(buffer2, buffer0);
-    for (unsigned int i = 0; i < bufferSize / sizeof(unsigned int); i++)
-        EXPECT_EQ(i * 13, ((unsigned int *)buffer2)[i])
-        << "GetReadPixelsBuffer should swap buffers";
-
-    void * const buffer3 = dbg.GetReadPixelsBuffer(bufferSize);
-    EXPECT_EQ(buffer3, buffer1);
-    for (unsigned int i = 0; i < bufferSize / sizeof(unsigned int); i++)
-        EXPECT_EQ(i * 17, ((unsigned int *)buffer3)[i])
-        << "GetReadPixelsBuffer should swap buffers";
-
-    void * const buffer4 = dbg.GetReadPixelsBuffer(bufferSize);
-    EXPECT_NE(buffer3, buffer4);
-    EXPECT_EQ(buffer0, buffer2);
-    EXPECT_EQ(buffer1, buffer3);
-    EXPECT_EQ(buffer2, buffer4);
-
-    // it reallocs as necessary; 0 size may result in NULL
-    for (unsigned int i = 0; i < 42; i++) {
-        void * const buffer = dbg.GetReadPixelsBuffer(((i & 7)) << 20);
-        EXPECT_NE((void *)NULL, buffer)
-        << "should be able to get a variety of reasonable sizes";
-        EXPECT_TRUE(dbg.IsReadPixelBuffer(buffer));
-    }
-}
-
-TEST_F(DbgContextTest, CompressReadPixelBuffer)
-{
-    const unsigned int bufferSize = dbg.LZF_CHUNK_SIZE * 4 + 33;
-    std::string out;
-    unsigned char * buffer = (unsigned char *)dbg.GetReadPixelsBuffer(bufferSize);
-    for (unsigned int i = 0; i < bufferSize; i++)
-        buffer[i] = i * 13;
-    dbg.CompressReadPixelBuffer(&out);
-    uint32_t decompSize = 0;
-    ASSERT_LT(12, out.length()); // at least written chunk header
-    ASSERT_EQ(bufferSize, *(uint32_t *)out.data())
-    << "total decompressed size should be as requested in GetReadPixelsBuffer";
-    for (unsigned int i = 4; i < out.length();) {
-        const uint32_t outSize = *(uint32_t *)(out.data() + i);
-        i += 4;
-        const uint32_t inSize = *(uint32_t *)(out.data() + i);
-        i += 4;
-        if (inSize == 0)
-            i += outSize; // chunk not compressed
-        else
-            i += inSize; // skip the actual compressed chunk
-        decompSize += outSize;
-    }
-    ASSERT_EQ(bufferSize, decompSize);
-    decompSize = 0;
-
-    unsigned char * decomp = dbg.Decompress(out.data(), out.length(), &decompSize);
-    ASSERT_EQ(decompSize, bufferSize);
-    for (unsigned int i = 0; i < bufferSize; i++)
-        EXPECT_EQ((unsigned char)(i * 13), decomp[i]) << "xor with 0 ref is identity";
-    free(decomp);
-
-    buffer = (unsigned char *)dbg.GetReadPixelsBuffer(bufferSize);
-    for (unsigned int i = 0; i < bufferSize; i++)
-        buffer[i] = i * 13;
-    out.clear();
-    dbg.CompressReadPixelBuffer(&out);
-    decompSize = 0;
-    decomp = dbg.Decompress(out.data(), out.length(), &decompSize);
-    ASSERT_EQ(decompSize, bufferSize);
-    for (unsigned int i = 0; i < bufferSize; i++)
-        EXPECT_EQ(0, decomp[i]) << "xor with same ref is 0";
-    free(decomp);
-
-    buffer = (unsigned char *)dbg.GetReadPixelsBuffer(bufferSize);
-    for (unsigned int i = 0; i < bufferSize; i++)
-        buffer[i] = i * 19;
-    out.clear();
-    dbg.CompressReadPixelBuffer(&out);
-    decompSize = 0;
-    decomp = dbg.Decompress(out.data(), out.length(), &decompSize);
-    ASSERT_EQ(decompSize, bufferSize);
-    for (unsigned int i = 0; i < bufferSize; i++)
-        EXPECT_EQ((unsigned char)(i * 13) ^ (unsigned char)(i * 19), decomp[i])
-        << "xor ref";
-    free(decomp);
-}
-
-TEST_F(DbgContextTest, UseProgram)
-{
-    static const GLuint _program = 74568;
-    static const struct Attribute {
-        const char * name;
-        GLint location;
-        GLint size;
-        GLenum type;
-    } _attributes [] = {
-        {"aaa", 2, 2, GL_FLOAT_VEC2},
-        {"bb", 6, 2, GL_FLOAT_MAT2},
-        {"c", 1, 1, GL_FLOAT},
-    };
-    static const unsigned int _attributeCount = sizeof(_attributes) / sizeof(*_attributes);
-    struct GL {
-        static void GetProgramiv(GLuint program, GLenum pname, GLint* params) {
-            EXPECT_EQ(_program, program);
-            ASSERT_NE((GLint *)NULL, params);
-            switch (pname) {
-            case GL_ACTIVE_ATTRIBUTES:
-                *params = _attributeCount;
-                return;
-            case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
-                *params = 4; // includes NULL terminator
-                return;
-            default:
-                ADD_FAILURE() << "not handled pname: " << pname;
-            }
-        }
-
-        static GLint GetAttribLocation(GLuint program, const GLchar* name) {
-            EXPECT_EQ(_program, program);
-            for (unsigned int i = 0; i < _attributeCount; i++)
-                if (!strcmp(name, _attributes[i].name))
-                    return _attributes[i].location;
-            ADD_FAILURE() << "unknown attribute name: " << name;
-            return -1;
-        }
-
-        static void GetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize,
-                                    GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
-            EXPECT_EQ(_program, program);
-            ASSERT_LT(index, _attributeCount);
-            const Attribute & att = _attributes[index];
-            ASSERT_GE(bufsize, strlen(att.name) + 1);
-            ASSERT_NE((GLint *)NULL, size);
-            ASSERT_NE((GLenum *)NULL, type);
-            ASSERT_NE((GLchar *)NULL, name);
-            strcpy(name, att.name);
-            if (length)
-                *length = strlen(name) + 1;
-            *size = att.size;
-            *type = att.type;
-        }
-    };
-    hooks.gl.glGetProgramiv = GL::GetProgramiv;
-    hooks.gl.glGetAttribLocation = GL::GetAttribLocation;
-    hooks.gl.glGetActiveAttrib = GL::GetActiveAttrib;
-    dbg.glUseProgram(_program);
-    EXPECT_EQ(10, dbg.maxAttrib);
-    dbg.glUseProgram(0);
-    EXPECT_EQ(0, dbg.maxAttrib);
-}
-}  // namespace
-
-int main(int argc, char **argv)
-{
-    ::testing::InitGoogleTest(&argc, argv);
-    return RUN_ALL_TESTS();
-}
diff --git a/opengl/libs/GLES2_dbg/test/test_server.cpp b/opengl/libs/GLES2_dbg/test/test_server.cpp
deleted file mode 100644
index 0ab87b0..0000000
--- a/opengl/libs/GLES2_dbg/test/test_server.cpp
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- ** Copyright 2011, 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 "header.h"
-#include "gtest/gtest.h"
-#include "hooks.h"
-
-namespace android
-{
-extern FILE * file;
-extern unsigned int MAX_FILE_SIZE;
-};
-
-// tmpfile fails, so need to manually make a writable file first
-static const char * filePath = "/data/local/tmp/dump.gles2dbg";
-
-class ServerFileTest : public ::testing::Test
-{
-protected:
-    ServerFileTest() { }
-
-    virtual ~ServerFileTest() { }
-
-    virtual void SetUp() {
-        MAX_FILE_SIZE = 8 << 20;
-        ASSERT_EQ((FILE *)NULL, file);
-        file = fopen("/data/local/tmp/dump.gles2dbg", "wb+");
-        ASSERT_NE((FILE *)NULL, file) << "make sure file is writable: "
-        << filePath;
-    }
-
-    virtual void TearDown() {
-        ASSERT_NE((FILE *)NULL, file);
-        fclose(file);
-        file = NULL;
-    }
-
-    void Read(glesv2debugger::Message & msg) const {
-        msg.Clear();
-        uint32_t len = 0;
-        ASSERT_EQ(sizeof(len), fread(&len, 1, sizeof(len), file));
-        ASSERT_GT(len, 0u);
-        char * buffer = new char [len];
-        ASSERT_EQ(len, fread(buffer, 1, len, file));
-        msg.ParseFromArray(buffer, len);
-        delete buffer;
-    }
-
-    void CheckNoAvailable() {
-        const long pos = ftell(file);
-        fseek(file, 0, SEEK_END);
-        EXPECT_EQ(pos, ftell(file)) << "check no available";
-    }
-};
-
-TEST_F(ServerFileTest, Send)
-{
-    glesv2debugger::Message msg, cmd, read;
-    msg.set_context_id(1);
-    msg.set_function(msg.glFinish);
-    msg.set_expect_response(false);
-    msg.set_type(msg.BeforeCall);
-    rewind(file);
-    android::Send(msg, cmd);
-    rewind(file);
-    Read(read);
-    EXPECT_EQ(msg.context_id(), read.context_id());
-    EXPECT_EQ(msg.function(), read.function());
-    EXPECT_EQ(msg.expect_response(), read.expect_response());
-    EXPECT_EQ(msg.type(), read.type());
-}
-
-TEST_F(ServerFileTest, CreateDbgContext)
-{
-    gl_hooks_t hooks;
-    struct Constant {
-        GLenum pname;
-        GLint param;
-    };
-    static const Constant constants [] = {
-        {GL_MAX_VERTEX_ATTRIBS, 16},
-        {GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, 32},
-        {GL_IMPLEMENTATION_COLOR_READ_FORMAT, GL_RGBA},
-        {GL_IMPLEMENTATION_COLOR_READ_TYPE, GL_UNSIGNED_BYTE},
-    };
-    struct HookMock {
-        static void GetIntegerv(GLenum pname, GLint* params) {
-            ASSERT_TRUE(params != NULL);
-            for (unsigned int i = 0; i < sizeof(constants) / sizeof(*constants); i++)
-                if (pname == constants[i].pname) {
-                    *params = constants[i].param;
-                    return;
-                }
-            FAIL() << "GetIntegerv unknown pname: " << pname;
-        }
-        static GLenum GetError() {
-            return GL_NO_ERROR;
-        }
-    };
-    hooks.gl.glGetError = HookMock::GetError;
-    hooks.gl.glGetIntegerv = HookMock::GetIntegerv;
-    DbgContext * const dbg = CreateDbgContext(1, &hooks);
-    ASSERT_TRUE(dbg != NULL);
-    EXPECT_TRUE(dbg->vertexAttribs != NULL);
-
-    rewind(file);
-    glesv2debugger::Message read;
-    for (unsigned int i = 0; i < 2; i++) {
-        Read(read);
-        EXPECT_EQ(reinterpret_cast<int>(dbg), read.context_id());
-        EXPECT_FALSE(read.expect_response());
-        EXPECT_EQ(read.Response, read.type());
-        EXPECT_EQ(read.SETPROP, read.function());
-        EXPECT_EQ(read.GLConstant, read.prop());
-        GLint expectedConstant = 0;
-        HookMock::GetIntegerv(read.arg0(), &expectedConstant);
-        EXPECT_EQ(expectedConstant, read.arg1());
-    }
-    CheckNoAvailable();
-    dbgReleaseThread();
-}
-
-void * glNoop()
-{
-    return 0;
-}
-
-class ServerFileContextTest : public ServerFileTest
-{
-protected:
-    DbgContext* dbg;
-    gl_hooks_t hooks;
-
-    ServerFileContextTest() { }
-
-    virtual ~ServerFileContextTest() { }
-
-    virtual void SetUp() {
-        ServerFileTest::SetUp();
-
-        dbg = new DbgContext(1, &hooks, 32);
-        ASSERT_NE((void *)NULL, dbg);
-        for (unsigned int i = 0; i < sizeof(hooks) / sizeof(void *); i++)
-            ((void **)&hooks)[i] = reinterpret_cast<void *>(glNoop);
-    }
-
-    virtual void TearDown() {
-        ServerFileTest::TearDown();
-    }
-};
-
-TEST_F(ServerFileContextTest, MessageLoop)
-{
-    static const int arg0 = 45;
-    static const float arg7 = -87.2331f;
-    static const int arg8 = -3;
-    static const int * ret = reinterpret_cast<int *>(870);
-
-    struct Caller : public FunctionCall {
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            msg.set_arg0(arg0);
-            msg.set_arg7((int &)arg7);
-            msg.set_arg8(arg8);
-            return ret;
-        }
-    } caller;
-    const int contextId = reinterpret_cast<int>(dbg);
-    glesv2debugger::Message msg, read;
-
-    EXPECT_EQ(ret, MessageLoop(caller, msg, msg.glFinish));
-
-    rewind(file);
-    Read(read);
-    EXPECT_EQ(contextId, read.context_id());
-    EXPECT_EQ(read.glFinish, read.function());
-    EXPECT_EQ(false, read.expect_response());
-    EXPECT_EQ(read.BeforeCall, read.type());
-
-    Read(read);
-    EXPECT_EQ(contextId, read.context_id());
-    EXPECT_EQ(read.glFinish, read.function());
-    EXPECT_EQ(false, read.expect_response());
-    EXPECT_EQ(read.AfterCall, read.type());
-    EXPECT_TRUE(read.has_time());
-    EXPECT_EQ(arg0, read.arg0());
-    const int readArg7 = read.arg7();
-    EXPECT_EQ(arg7, (float &)readArg7);
-    EXPECT_EQ(arg8, read.arg8());
-
-    const long pos = ftell(file);
-    fseek(file, 0, SEEK_END);
-    EXPECT_EQ(pos, ftell(file))
-    << "should only write the BeforeCall and AfterCall messages";
-}
-
-TEST_F(ServerFileContextTest, DisableEnableVertexAttribArray)
-{
-    Debug_glEnableVertexAttribArray(dbg->MAX_VERTEX_ATTRIBS + 2); // should just ignore invalid index
-
-    glesv2debugger::Message read;
-    rewind(file);
-    Read(read);
-    EXPECT_EQ(read.glEnableVertexAttribArray, read.function());
-    EXPECT_EQ(dbg->MAX_VERTEX_ATTRIBS + 2, read.arg0());
-    Read(read);
-
-    rewind(file);
-    Debug_glDisableVertexAttribArray(dbg->MAX_VERTEX_ATTRIBS + 4); // should just ignore invalid index
-    rewind(file);
-    Read(read);
-    Read(read);
-
-    for (unsigned int i = 0; i < dbg->MAX_VERTEX_ATTRIBS; i += 5) {
-        rewind(file);
-        Debug_glEnableVertexAttribArray(i);
-        EXPECT_TRUE(dbg->vertexAttribs[i].enabled);
-        rewind(file);
-        Read(read);
-        EXPECT_EQ(read.glEnableVertexAttribArray, read.function());
-        EXPECT_EQ(i, read.arg0());
-        Read(read);
-
-        rewind(file);
-        Debug_glDisableVertexAttribArray(i);
-        EXPECT_FALSE(dbg->vertexAttribs[i].enabled);
-        rewind(file);
-        Read(read);
-        EXPECT_EQ(read.glDisableVertexAttribArray, read.function());
-        EXPECT_EQ(i, read.arg0());
-        Read(read);
-    }
-}
diff --git a/opengl/libs/GLES2_dbg/test/test_socket.cpp b/opengl/libs/GLES2_dbg/test/test_socket.cpp
deleted file mode 100644
index 9f815e2..0000000
--- a/opengl/libs/GLES2_dbg/test/test_socket.cpp
+++ /dev/null
@@ -1,468 +0,0 @@
-/*
- ** Copyright 2011, 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 <sys/socket.h>
-#include <sys/ioctl.h>
-
-#include "header.h"
-#include "gtest/gtest.h"
-#include "hooks.h"
-
-namespace android
-{
-extern int serverSock, clientSock;
-};
-
-void * glNoop();
-
-class SocketContextTest : public ::testing::Test
-{
-protected:
-    DbgContext* dbg;
-    gl_hooks_t hooks;
-    int sock;
-    char * buffer;
-    unsigned int bufferSize;
-
-    SocketContextTest() : sock(-1) {
-    }
-
-    virtual ~SocketContextTest() {
-    }
-
-    virtual void SetUp() {
-        dbg = new DbgContext(1, &hooks, 32);
-        ASSERT_TRUE(dbg != NULL);
-        for (unsigned int i = 0; i < sizeof(hooks) / sizeof(void *); i++)
-            ((void **)&hooks)[i] = (void *)glNoop;
-
-        int socks[2] = {-1, -1};
-        ASSERT_EQ(0, socketpair(AF_UNIX, SOCK_STREAM, 0, socks));
-        clientSock = socks[0];
-        sock = socks[1];
-
-        bufferSize = 128;
-        buffer = new char [128];
-        ASSERT_NE((char *)NULL, buffer);
-    }
-
-    virtual void TearDown() {
-        close(sock);
-        close(clientSock);
-        clientSock = -1;
-        delete buffer;
-    }
-
-    void Write(glesv2debugger::Message & msg) const {
-        msg.set_context_id((int)dbg);
-        msg.set_type(msg.Response);
-        ASSERT_TRUE(msg.has_context_id());
-        ASSERT_TRUE(msg.has_function());
-        ASSERT_TRUE(msg.has_type());
-        ASSERT_TRUE(msg.has_expect_response());
-        static std::string str;
-        msg.SerializeToString(&str);
-        const uint32_t len = str.length();
-        ASSERT_EQ(sizeof(len), send(sock, &len, sizeof(len), 0));
-        ASSERT_EQ(str.length(), send(sock, str.data(), str.length(), 0));
-    }
-
-    void Read(glesv2debugger::Message & msg) {
-        int available = 0;
-        ASSERT_EQ(0, ioctl(sock, FIONREAD, &available));
-        ASSERT_GT(available, 0);
-        uint32_t len = 0;
-        ASSERT_EQ(sizeof(len), recv(sock, &len, sizeof(len), 0));
-        if (len > bufferSize) {
-            bufferSize = len;
-            buffer = new char[bufferSize];
-            ASSERT_TRUE(buffer != NULL);
-        }
-        ASSERT_EQ(len, recv(sock, buffer, len, 0));
-        msg.Clear();
-        msg.ParseFromArray(buffer, len);
-        ASSERT_TRUE(msg.has_context_id());
-        ASSERT_TRUE(msg.has_function());
-        ASSERT_TRUE(msg.has_type());
-        ASSERT_TRUE(msg.has_expect_response());
-    }
-
-    void CheckNoAvailable() {
-        int available = 0;
-        ASSERT_EQ(0, ioctl(sock, FIONREAD, &available));
-        ASSERT_EQ(available, 0);
-    }
-};
-
-TEST_F(SocketContextTest, MessageLoopSkip)
-{
-    static const int arg0 = 45;
-    static const float arg7 = -87.2331f;
-    static const int arg8 = -3;
-    static const int * ret = (int *)870;
-
-    struct Caller : public FunctionCall {
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            msg.set_arg0(arg0);
-            msg.set_arg7((int &)arg7);
-            msg.set_arg8(arg8);
-            return ret;
-        }
-    } caller;
-    glesv2debugger::Message msg, read, cmd;
-    dbg->expectResponse.Bit(msg.glFinish, true);
-
-    cmd.set_function(cmd.SKIP);
-    cmd.set_expect_response(false);
-    Write(cmd);
-
-    EXPECT_NE(ret, MessageLoop(caller, msg, msg.glFinish));
-
-    Read(read);
-    EXPECT_EQ(read.glFinish, read.function());
-    EXPECT_EQ(read.BeforeCall, read.type());
-    EXPECT_NE(arg0, read.arg0());
-    EXPECT_NE((int &)arg7, read.arg7());
-    EXPECT_NE(arg8, read.arg8());
-
-    CheckNoAvailable();
-}
-
-TEST_F(SocketContextTest, MessageLoopContinue)
-{
-    static const int arg0 = GL_FRAGMENT_SHADER;
-    static const int ret = -342;
-    struct Caller : public FunctionCall {
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            msg.set_ret(ret);
-            return (int *)ret;
-        }
-    } caller;
-    glesv2debugger::Message msg, read, cmd;
-    dbg->expectResponse.Bit(msg.glCreateShader, true);
-
-    cmd.set_function(cmd.CONTINUE);
-    cmd.set_expect_response(false); // MessageLoop should automatically skip after continue
-    Write(cmd);
-
-    msg.set_arg0(arg0);
-    EXPECT_EQ((int *)ret, MessageLoop(caller, msg, msg.glCreateShader));
-
-    Read(read);
-    EXPECT_EQ(read.glCreateShader, read.function());
-    EXPECT_EQ(read.BeforeCall, read.type());
-    EXPECT_EQ(arg0, read.arg0());
-
-    Read(read);
-    EXPECT_EQ(read.glCreateShader, read.function());
-    EXPECT_EQ(read.AfterCall, read.type());
-    EXPECT_EQ(ret, read.ret());
-
-    CheckNoAvailable();
-}
-
-TEST_F(SocketContextTest, MessageLoopGenerateCall)
-{
-    static const int ret = -342;
-    static unsigned int createShader, createProgram;
-    createShader = 0;
-    createProgram = 0;
-    struct Caller : public FunctionCall {
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int r = (int)_c->glCreateProgram();
-            msg.set_ret(r);
-            return (int *)r;
-        }
-        static GLuint CreateShader(const GLenum type) {
-            createShader++;
-            return type;
-        }
-        static GLuint CreateProgram() {
-            createProgram++;
-            return ret;
-        }
-    } caller;
-    glesv2debugger::Message msg, read, cmd;
-    hooks.gl.glCreateShader = caller.CreateShader;
-    hooks.gl.glCreateProgram = caller.CreateProgram;
-    dbg->expectResponse.Bit(msg.glCreateProgram, true);
-
-    cmd.set_function(cmd.glCreateShader);
-    cmd.set_arg0(GL_FRAGMENT_SHADER);
-    cmd.set_expect_response(true);
-    Write(cmd);
-
-    cmd.Clear();
-    cmd.set_function(cmd.CONTINUE);
-    cmd.set_expect_response(true);
-    Write(cmd);
-
-    cmd.set_function(cmd.glCreateShader);
-    cmd.set_arg0(GL_VERTEX_SHADER);
-    cmd.set_expect_response(false); // MessageLoop should automatically skip afterwards
-    Write(cmd);
-
-    EXPECT_EQ((int *)ret, MessageLoop(caller, msg, msg.glCreateProgram));
-
-    Read(read);
-    EXPECT_EQ(read.glCreateProgram, read.function());
-    EXPECT_EQ(read.BeforeCall, read.type());
-
-    Read(read);
-    EXPECT_EQ(read.glCreateShader, read.function());
-    EXPECT_EQ(read.AfterGeneratedCall, read.type());
-    EXPECT_EQ(GL_FRAGMENT_SHADER, read.ret());
-
-    Read(read);
-    EXPECT_EQ(read.glCreateProgram, read.function());
-    EXPECT_EQ(read.AfterCall, read.type());
-    EXPECT_EQ(ret, read.ret());
-
-    Read(read);
-    EXPECT_EQ(read.glCreateShader, read.function());
-    EXPECT_EQ(read.AfterGeneratedCall, read.type());
-    EXPECT_EQ(GL_VERTEX_SHADER, read.ret());
-
-    EXPECT_EQ(2, createShader);
-    EXPECT_EQ(1, createProgram);
-
-    CheckNoAvailable();
-}
-
-TEST_F(SocketContextTest, MessageLoopSetProp)
-{
-    static const int ret = -342;
-    static unsigned int createShader, createProgram;
-    createShader = 0;
-    createProgram = 0;
-    struct Caller : public FunctionCall {
-        const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
-            const int r = (int)_c->glCreateProgram();
-            msg.set_ret(r);
-            return (int *)r;
-        }
-        static GLuint CreateShader(const GLenum type) {
-            createShader++;
-            return type;
-        }
-        static GLuint CreateProgram() {
-            createProgram++;
-            return ret;
-        }
-    } caller;
-    glesv2debugger::Message msg, read, cmd;
-    hooks.gl.glCreateShader = caller.CreateShader;
-    hooks.gl.glCreateProgram = caller.CreateProgram;
-    dbg->expectResponse.Bit(msg.glCreateProgram, false);
-
-    cmd.set_function(cmd.SETPROP);
-    cmd.set_prop(cmd.ExpectResponse);
-    cmd.set_arg0(cmd.glCreateProgram);
-    cmd.set_arg1(true);
-    cmd.set_expect_response(true);
-    Write(cmd);
-
-    cmd.Clear();
-    cmd.set_function(cmd.glCreateShader);
-    cmd.set_arg0(GL_FRAGMENT_SHADER);
-    cmd.set_expect_response(true);
-    Write(cmd);
-
-    cmd.set_function(cmd.SETPROP);
-    cmd.set_prop(cmd.CaptureDraw);
-    cmd.set_arg0(819);
-    cmd.set_expect_response(true);
-    Write(cmd);
-
-    cmd.Clear();
-    cmd.set_function(cmd.CONTINUE);
-    cmd.set_expect_response(true);
-    Write(cmd);
-
-    cmd.set_function(cmd.glCreateShader);
-    cmd.set_arg0(GL_VERTEX_SHADER);
-    cmd.set_expect_response(false); // MessageLoop should automatically skip afterwards
-    Write(cmd);
-
-    EXPECT_EQ((int *)ret, MessageLoop(caller, msg, msg.glCreateProgram));
-
-    EXPECT_TRUE(dbg->expectResponse.Bit(msg.glCreateProgram));
-    EXPECT_EQ(819, dbg->captureDraw);
-
-    Read(read);
-    EXPECT_EQ(read.glCreateProgram, read.function());
-    EXPECT_EQ(read.BeforeCall, read.type());
-
-    Read(read);
-    EXPECT_EQ(read.glCreateShader, read.function());
-    EXPECT_EQ(read.AfterGeneratedCall, read.type());
-    EXPECT_EQ(GL_FRAGMENT_SHADER, read.ret());
-
-    Read(read);
-    EXPECT_EQ(read.glCreateProgram, read.function());
-    EXPECT_EQ(read.AfterCall, read.type());
-    EXPECT_EQ(ret, read.ret());
-
-    Read(read);
-    EXPECT_EQ(read.glCreateShader, read.function());
-    EXPECT_EQ(read.AfterGeneratedCall, read.type());
-    EXPECT_EQ(GL_VERTEX_SHADER, read.ret());
-
-    EXPECT_EQ(2, createShader);
-    EXPECT_EQ(1, createProgram);
-
-    CheckNoAvailable();
-}
-
-TEST_F(SocketContextTest, TexImage2D)
-{
-    static const GLenum _target = GL_TEXTURE_2D;
-    static const GLint _level = 1, _internalformat = GL_RGBA;
-    static const GLsizei _width = 2, _height = 2;
-    static const GLint _border = 333;
-    static const GLenum _format = GL_RGB, _type = GL_UNSIGNED_SHORT_5_6_5;
-    static const short _pixels [_width * _height] = {11, 22, 33, 44};
-    static unsigned int texImage2D;
-    texImage2D = 0;
-
-    struct Caller {
-        static void TexImage2D(GLenum target, GLint level, GLint internalformat,
-                               GLsizei width, GLsizei height, GLint border,
-                               GLenum format, GLenum type, const GLvoid* pixels) {
-            EXPECT_EQ(_target, target);
-            EXPECT_EQ(_level, level);
-            EXPECT_EQ(_internalformat, internalformat);
-            EXPECT_EQ(_width, width);
-            EXPECT_EQ(_height, height);
-            EXPECT_EQ(_border, border);
-            EXPECT_EQ(_format, format);
-            EXPECT_EQ(_type, type);
-            EXPECT_EQ(0, memcmp(_pixels, pixels, sizeof(_pixels)));
-            texImage2D++;
-        }
-    } caller;
-    glesv2debugger::Message msg, read, cmd;
-    hooks.gl.glTexImage2D = caller.TexImage2D;
-    dbg->expectResponse.Bit(msg.glTexImage2D, false);
-
-    Debug_glTexImage2D(_target, _level, _internalformat, _width, _height, _border,
-                       _format, _type, _pixels);
-    EXPECT_EQ(1, texImage2D);
-
-    Read(read);
-    EXPECT_EQ(read.glTexImage2D, read.function());
-    EXPECT_EQ(read.BeforeCall, read.type());
-    EXPECT_EQ(_target, read.arg0());
-    EXPECT_EQ(_level, read.arg1());
-    EXPECT_EQ(_internalformat, read.arg2());
-    EXPECT_EQ(_width, read.arg3());
-    EXPECT_EQ(_height, read.arg4());
-    EXPECT_EQ(_border, read.arg5());
-    EXPECT_EQ(_format, read.arg6());
-    EXPECT_EQ(_type, read.arg7());
-
-    EXPECT_TRUE(read.has_data());
-    uint32_t dataLen = 0;
-    const unsigned char * data = dbg->Decompress(read.data().data(),
-                                 read.data().length(), &dataLen);
-    EXPECT_EQ(sizeof(_pixels), dataLen);
-    if (sizeof(_pixels) == dataLen)
-        EXPECT_EQ(0, memcmp(_pixels, data, sizeof(_pixels)));
-
-    Read(read);
-    EXPECT_EQ(read.glTexImage2D, read.function());
-    EXPECT_EQ(read.AfterCall, read.type());
-
-    CheckNoAvailable();
-}
-
-TEST_F(SocketContextTest, CopyTexImage2D)
-{
-    static const GLenum _target = GL_TEXTURE_2D;
-    static const GLint _level = 1, _internalformat = GL_RGBA;
-    static const GLint _x = 9, _y = 99;
-    static const GLsizei _width = 2, _height = 3;
-    static const GLint _border = 333;
-    static const int _pixels [_width * _height] = {11, 22, 33, 44, 55, 66};
-    static unsigned int copyTexImage2D, readPixels;
-    copyTexImage2D = 0, readPixels = 0;
-
-    struct Caller {
-        static void CopyTexImage2D(GLenum target, GLint level, GLenum internalformat,
-                                   GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
-            EXPECT_EQ(_target, target);
-            EXPECT_EQ(_level, level);
-            EXPECT_EQ(_internalformat, internalformat);
-            EXPECT_EQ(_x, x);
-            EXPECT_EQ(_y, y);
-            EXPECT_EQ(_width, width);
-            EXPECT_EQ(_height, height);
-            EXPECT_EQ(_border, border);
-            copyTexImage2D++;
-        }
-        static void ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
-                               GLenum format, GLenum type, GLvoid* pixels) {
-            EXPECT_EQ(_x, x);
-            EXPECT_EQ(_y, y);
-            EXPECT_EQ(_width, width);
-            EXPECT_EQ(_height, height);
-            EXPECT_EQ(GL_RGBA, format);
-            EXPECT_EQ(GL_UNSIGNED_BYTE, type);
-            ASSERT_TRUE(pixels != NULL);
-            memcpy(pixels, _pixels, sizeof(_pixels));
-            readPixels++;
-        }
-    } caller;
-    glesv2debugger::Message msg, read, cmd;
-    hooks.gl.glCopyTexImage2D = caller.CopyTexImage2D;
-    hooks.gl.glReadPixels = caller.ReadPixels;
-    dbg->expectResponse.Bit(msg.glCopyTexImage2D, false);
-
-    Debug_glCopyTexImage2D(_target, _level, _internalformat, _x, _y, _width, _height,
-                           _border);
-    ASSERT_EQ(1, copyTexImage2D);
-    ASSERT_EQ(1, readPixels);
-
-    Read(read);
-    EXPECT_EQ(read.glCopyTexImage2D, read.function());
-    EXPECT_EQ(read.BeforeCall, read.type());
-    EXPECT_EQ(_target, read.arg0());
-    EXPECT_EQ(_level, read.arg1());
-    EXPECT_EQ(_internalformat, read.arg2());
-    EXPECT_EQ(_x, read.arg3());
-    EXPECT_EQ(_y, read.arg4());
-    EXPECT_EQ(_width, read.arg5());
-    EXPECT_EQ(_height, read.arg6());
-    EXPECT_EQ(_border, read.arg7());
-
-    EXPECT_TRUE(read.has_data());
-    EXPECT_EQ(read.ReferencedImage, read.data_type());
-    EXPECT_EQ(GL_RGBA, read.pixel_format());
-    EXPECT_EQ(GL_UNSIGNED_BYTE, read.pixel_type());
-    uint32_t dataLen = 0;
-    unsigned char * const data = dbg->Decompress(read.data().data(),
-                                 read.data().length(), &dataLen);
-    ASSERT_EQ(sizeof(_pixels), dataLen);
-    for (unsigned i = 0; i < sizeof(_pixels) / sizeof(*_pixels); i++)
-        EXPECT_EQ(_pixels[i], ((const int *)data)[i]) << "xor with 0 ref is identity";
-    free(data);
-
-    Read(read);
-    EXPECT_EQ(read.glCopyTexImage2D, read.function());
-    EXPECT_EQ(read.AfterCall, read.type());
-
-    CheckNoAvailable();
-}
diff --git a/opengl/libs/GLES_CM/glext_api.in b/opengl/libs/GLES_CM/glext_api.in
index 5393fa6..268a535 100644
--- a/opengl/libs/GLES_CM/glext_api.in
+++ b/opengl/libs/GLES_CM/glext_api.in
@@ -280,15 +280,57 @@
 GLboolean API_ENTRY(glIsVertexArrayOES)(GLuint array) {
     CALL_GL_API_RETURN(glIsVertexArrayOES, array);
 }
+void API_ENTRY(glRenderbufferStorageMultisampleAPPLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glRenderbufferStorageMultisampleAPPLE, target, samples, internalformat, width, height);
+}
+void API_ENTRY(glResolveMultisampleFramebufferAPPLE)(void) {
+    CALL_GL_API(glResolveMultisampleFramebufferAPPLE);
+}
 void API_ENTRY(glDiscardFramebufferEXT)(GLenum target, GLsizei numAttachments, const GLenum *attachments) {
     CALL_GL_API(glDiscardFramebufferEXT, target, numAttachments, attachments);
 }
+void API_ENTRY(glRenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glRenderbufferStorageMultisampleEXT, target, samples, internalformat, width, height);
+}
+void API_ENTRY(glFramebufferTexture2DMultisampleEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
+    CALL_GL_API(glFramebufferTexture2DMultisampleEXT, target, attachment, textarget, texture, level, samples);
+}
 void API_ENTRY(glMultiDrawArraysEXT)(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) {
     CALL_GL_API(glMultiDrawArraysEXT, mode, first, count, primcount);
 }
 void API_ENTRY(glMultiDrawElementsEXT)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount) {
     CALL_GL_API(glMultiDrawElementsEXT, mode, count, type, indices, primcount);
 }
+GLenum API_ENTRY(glGetGraphicsResetStatusEXT)(void) {
+    CALL_GL_API_RETURN(glGetGraphicsResetStatusEXT);
+}
+void API_ENTRY(glReadnPixelsEXT)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data) {
+    CALL_GL_API(glReadnPixelsEXT, x, y, width, height, format, type, bufSize, data);
+}
+void API_ENTRY(glGetnUniformfvEXT)(GLuint program, GLint location, GLsizei bufSize, float *params) {
+    CALL_GL_API(glGetnUniformfvEXT, program, location, bufSize, params);
+}
+void API_ENTRY(glGetnUniformivEXT)(GLuint program, GLint location, GLsizei bufSize, GLint *params) {
+    CALL_GL_API(glGetnUniformivEXT, program, location, bufSize, params);
+}
+void API_ENTRY(glTexStorage1DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
+    CALL_GL_API(glTexStorage1DEXT, target, levels, internalformat, width);
+}
+void API_ENTRY(glTexStorage2DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glTexStorage2DEXT, target, levels, internalformat, width, height);
+}
+void API_ENTRY(glTexStorage3DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
+    CALL_GL_API(glTexStorage3DEXT, target, levels, internalformat, width, height, depth);
+}
+void API_ENTRY(glTextureStorage1DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
+    CALL_GL_API(glTextureStorage1DEXT, texture, target, levels, internalformat, width);
+}
+void API_ENTRY(glTextureStorage2DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
+    CALL_GL_API(glTextureStorage2DEXT, texture, target, levels, internalformat, width, height);
+}
+void API_ENTRY(glTextureStorage3DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
+    CALL_GL_API(glTextureStorage3DEXT, texture, target, levels, internalformat, width, height, depth);
+}
 void API_ENTRY(glClipPlanefIMG)(GLenum p, const GLfloat *eqn) {
     CALL_GL_API(glClipPlanefIMG, p, eqn);
 }
diff --git a/opengl/libs/GLES_trace/.gitignore b/opengl/libs/GLES_trace/.gitignore
new file mode 100644
index 0000000..8df825e
--- /dev/null
+++ b/opengl/libs/GLES_trace/.gitignore
@@ -0,0 +1,4 @@
+java
+*.pyc
+*.swp
+pyratemp.py
diff --git a/opengl/libs/GLES2_dbg/Android.mk b/opengl/libs/GLES_trace/Android.mk
similarity index 69%
rename from opengl/libs/GLES2_dbg/Android.mk
rename to opengl/libs/GLES_trace/Android.mk
index 70853d8..465b6b2 100644
--- a/opengl/libs/GLES2_dbg/Android.mk
+++ b/opengl/libs/GLES_trace/Android.mk
@@ -3,13 +3,14 @@
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := \
-    src/api.cpp \
-    src/caller.cpp \
-    src/dbgcontext.cpp \
-    src/debugger_message.pb.cpp \
-    src/egl.cpp \
-    src/server.cpp \
-    src/vertex.cpp
+    src/gltrace_api.cpp \
+    src/gltrace_context.cpp \
+    src/gltrace_egl.cpp \
+    src/gltrace_eglapi.cpp \
+    src/gltrace_fixup.cpp \
+    src/gltrace_hooks.cpp \
+    src/gltrace.pb.cpp \
+    src/gltrace_transport.cpp
 
 LOCAL_C_INCLUDES := \
     $(LOCAL_PATH) \
@@ -19,20 +20,15 @@
     external \
     bionic
 
-#LOCAL_CFLAGS += -O0 -g -DDEBUG -UNDEBUG
 LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI
 LOCAL_STATIC_LIBRARIES := libprotobuf-cpp-2.3.0-lite liblzf
 LOCAL_SHARED_LIBRARIES := libcutils libutils libstlport
-ifeq ($(TARGET_ARCH),arm)
-	LOCAL_CFLAGS += -fstrict-aliasing
-endif
 
 ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
     LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
 endif
 
-LOCAL_CFLAGS += -DLOG_TAG=\"libGLES2_dbg\"
-
+LOCAL_CFLAGS += -DLOG_TAG=\"libGLES_trace\"
 
 # we need to access the private Bionic header <bionic_tls.h>
 # on ARM platforms, we need to mirror the ARCH_ARM_HAVE_TLS_REGISTER
@@ -42,9 +38,7 @@
 endif
 LOCAL_C_INCLUDES += bionic/libc/private
 
-LOCAL_MODULE:= libGLESv2_dbg
+LOCAL_MODULE:= libGLES_trace
 LOCAL_MODULE_TAGS := optional
 
 include $(BUILD_SHARED_LIBRARY)
-
-include $(LOCAL_PATH)/test/Android.mk
diff --git a/opengl/libs/GLES_trace/DESIGN.txt b/opengl/libs/GLES_trace/DESIGN.txt
new file mode 100644
index 0000000..a189e1d
--- /dev/null
+++ b/opengl/libs/GLES_trace/DESIGN.txt
@@ -0,0 +1,51 @@
+Design of the GLES Tracing Library
+
+Code Runtime Behavior:
+
+    Initialization:
+    
+    egl_display_t::initialize() calls initEglTraceLevel() to figure out whether tracing should be
+    enabled. Currently, the shell properties "debug.egl.trace" and "debug.egl.debug_proc" together
+    control whether tracing should be enabled for a certain process. If tracing is enabled, this
+    calls GLTrace_start() to start the trace server.
+    
+    Note that initEglTraceLevel() is also called from early_egl_init(), but that happens in the
+    context of the zygote, so that invocation has no effect.
+    
+    egl_display_t::initialize() then calls setGLHooksThreadSpecific() where we set the thread
+    specific gl_hooks structure to point to the trace implementation. From this point on, every
+    GLES call is redirected to the trace implementation.
+    
+    Application runtime:
+
+    While the application is running, all its GLES calls are directly routed to their corresponding
+    trace implementation.
+
+    For EGL calls, the trace library provides a bunch of functions that must be explicitly called
+    from the EGL library. These functions are declared in glestrace.h
+
+    Application shutdown:
+
+    Currently, the application is killed when the user stops tracing from the frontend GUI. We need
+    to explore if a more graceful method of stopping the application, or detaching tracing from the
+    application is required.
+
+Code Structure:
+
+    glestrace.h declares all the hooks exposed by libglestrace. These are used by EGL/egl.cpp and
+    EGL/eglApi.cpp to initialize the trace library, and to inform the library of EGL calls.
+
+    All GL calls are present in GLES_Trace/src/gltrace_api.cpp. This file is generated by the
+    GLES_Trace/src/genapi.py script. The structure of all the functions looks like this:
+
+            void GLTrace_glFunction(args) {
+                // declare a protobuf
+                // copy arguments into the protobuf
+                // call the original GLES function
+                // if there is a return value, save it into the protobuf
+                // fixup the protobuf if necessary
+                // transport the protobuf to the host
+            }
+
+    The fixupGLMessage() call does any custom processing of the protobuf based on the GLES call.
+    This typically amounts to copying the data corresponding to input or output pointers.
diff --git a/opengl/libs/GLES_trace/TODO.txt b/opengl/libs/GLES_trace/TODO.txt
new file mode 100644
index 0000000..f5e6e95
--- /dev/null
+++ b/opengl/libs/GLES_trace/TODO.txt
@@ -0,0 +1,14 @@
+TODO:
+    - Context - Currently, we don't do anything regarding the contexts that are created.
+    Need to maintain more state regarding contexts, and figure out what happens in the
+    presence of multiple contexts.
+
+    - Transport: Each GLMessage is sent via a socket as soon as the message is received.
+    i.e., there is no buffering of messages. Buffering should improve performance.
+
+    - Initialization: On first connection, send some basic information that includes:
+        1. version of the trace library
+        2. implementation dependent GL state variables such as # of vertex arrays etc.
+
+    - eglSwapBuffers: The images are lzf compressed, but there is no mode that transfers
+    only the differences from the previous images.
diff --git a/opengl/libs/GLES_trace/dev.make b/opengl/libs/GLES_trace/dev.make
new file mode 100644
index 0000000..1d89999
--- /dev/null
+++ b/opengl/libs/GLES_trace/dev.make
@@ -0,0 +1,15 @@
+## 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
+
+# NOTE: $OUT should be defined in the shell by doing a "lunch <config>"
+# push updated files to device
+push:
+	adb push $(OUT)/system/lib/libGLESv2.so /system/lib/
+	adb push $(OUT)/system/lib/libGLESv1_CM.so /system/lib/
+	adb push $(OUT)/system/lib/libGLES_trace.so /system/lib/
+	adb push $(OUT)/system/lib/libEGL.so /system/lib/
diff --git a/opengl/libs/GLES_trace/gltrace.proto b/opengl/libs/GLES_trace/gltrace.proto
new file mode 100644
index 0000000..11cf24f
--- /dev/null
+++ b/opengl/libs/GLES_trace/gltrace.proto
@@ -0,0 +1,553 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+package android.gltrace;
+
+option optimize_for = LITE_RUNTIME;
+
+option java_package = "com.android.ide.eclipse.gltrace";
+option java_outer_classname = "GLProtoBuf";
+
+message GLMessage {
+    enum Function {
+        glActiveTexture = 0;
+        glAlphaFunc = 1;
+        glAlphaFuncx = 2;
+        glAlphaFuncxOES = 3;
+        glAttachShader = 4;
+        glBeginPerfMonitorAMD = 5;
+        glBindAttribLocation = 6;
+        glBindBuffer = 7;
+        glBindFramebuffer = 8;
+        glBindFramebufferOES = 9;
+        glBindRenderbuffer = 10;
+        glBindRenderbufferOES = 11;
+        glBindTexture = 12;
+        glBindVertexArrayOES = 13;
+        glBlendColor = 14;
+        glBlendEquation = 15;
+        glBlendEquationOES = 16;
+        glBlendEquationSeparate = 17;
+        glBlendEquationSeparateOES = 18;
+        glBlendFunc = 19;
+        glBlendFuncSeparate = 20;
+        glBlendFuncSeparateOES = 21;
+        glBufferData = 22;
+        glBufferSubData = 23;
+        glCheckFramebufferStatus = 24;
+        glCheckFramebufferStatusOES = 25;
+        glClearColor = 26;
+        glClearColorx = 27;
+        glClearColorxOES = 28;
+        glClearDepthf = 29;
+        glClearDepthfOES = 30;
+        glClearDepthx = 31;
+        glClearDepthxOES = 32;
+        glClear = 33;
+        glClearStencil = 34;
+        glClientActiveTexture = 35;
+        glClipPlanef = 36;
+        glClipPlanefIMG = 37;
+        glClipPlanefOES = 38;
+        glClipPlanex = 39;
+        glClipPlanexIMG = 40;
+        glClipPlanexOES = 41;
+        glColor4f = 42;
+        glColor4ub = 43;
+        glColor4x = 44;
+        glColor4xOES = 45;
+        glColorMask = 46;
+        glColorPointer = 47;
+        glCompileShader = 48;
+        glCompressedTexImage2D = 49;
+        glCompressedTexImage3DOES = 50;
+        glCompressedTexSubImage2D = 51;
+        glCompressedTexSubImage3DOES = 52;
+        glCopyTexImage2D = 53;
+        glCopyTexSubImage2D = 54;
+        glCopyTexSubImage3DOES = 55;
+        glCoverageMaskNV = 56;
+        glCoverageOperationNV = 57;
+        glCreateProgram = 58;
+        glCreateShader = 59;
+        glCullFace = 60;
+        glCurrentPaletteMatrixOES = 61;
+        glDeleteBuffers = 62;
+        glDeleteFencesNV = 63;
+        glDeleteFramebuffers = 64;
+        glDeleteFramebuffersOES = 65;
+        glDeletePerfMonitorsAMD = 66;
+        glDeleteProgram = 67;
+        glDeleteRenderbuffers = 68;
+        glDeleteRenderbuffersOES = 69;
+        glDeleteShader = 70;
+        glDeleteTextures = 71;
+        glDeleteVertexArraysOES = 72;
+        glDepthFunc = 73;
+        glDepthMask = 74;
+        glDepthRangef = 75;
+        glDepthRangefOES = 76;
+        glDepthRangex = 77;
+        glDepthRangexOES = 78;
+        glDetachShader = 79;
+        glDisableClientState = 80;
+        glDisableDriverControlQCOM = 81;
+        glDisable = 82;
+        glDisableVertexAttribArray = 83;
+        glDiscardFramebufferEXT = 84;
+        glDrawArrays = 85;
+        glDrawElements = 86;
+        glDrawTexfOES = 87;
+        glDrawTexfvOES = 88;
+        glDrawTexiOES = 89;
+        glDrawTexivOES = 90;
+        glDrawTexsOES = 91;
+        glDrawTexsvOES = 92;
+        glDrawTexxOES = 93;
+        glDrawTexxvOES = 94;
+        glEGLImageTargetRenderbufferStorageOES = 95;
+        glEGLImageTargetTexture2DOES = 96;
+        glEnableClientState = 97;
+        glEnableDriverControlQCOM = 98;
+        glEnable = 99;
+        glEnableVertexAttribArray = 100;
+        glEndPerfMonitorAMD = 101;
+        glEndTilingQCOM = 102;
+        glExtGetBufferPointervQCOM = 103;
+        glExtGetBuffersQCOM = 104;
+        glExtGetFramebuffersQCOM = 105;
+        glExtGetProgramBinarySourceQCOM = 106;
+        glExtGetProgramsQCOM = 107;
+        glExtGetRenderbuffersQCOM = 108;
+        glExtGetShadersQCOM = 109;
+        glExtGetTexLevelParameterivQCOM = 110;
+        glExtGetTexSubImageQCOM = 111;
+        glExtGetTexturesQCOM = 112;
+        glExtIsProgramBinaryQCOM = 113;
+        glExtTexObjectStateOverrideiQCOM = 114;
+        glFinishFenceNV = 115;
+        glFinish = 116;
+        glFlush = 117;
+        glFogf = 118;
+        glFogfv = 119;
+        glFogx = 120;
+        glFogxOES = 121;
+        glFogxv = 122;
+        glFogxvOES = 123;
+        glFramebufferRenderbuffer = 124;
+        glFramebufferRenderbufferOES = 125;
+        glFramebufferTexture2D = 126;
+        glFramebufferTexture2DMultisampleIMG = 127;
+        glFramebufferTexture2DOES = 128;
+        glFramebufferTexture3DOES = 129;
+        glFrontFace = 130;
+        glFrustumf = 131;
+        glFrustumfOES = 132;
+        glFrustumx = 133;
+        glFrustumxOES = 134;
+        glGenBuffers = 135;
+        glGenerateMipmap = 136;
+        glGenerateMipmapOES = 137;
+        glGenFencesNV = 138;
+        glGenFramebuffers = 139;
+        glGenFramebuffersOES = 140;
+        glGenPerfMonitorsAMD = 141;
+        glGenRenderbuffers = 142;
+        glGenRenderbuffersOES = 143;
+        glGenTextures = 144;
+        glGenVertexArraysOES = 145;
+        glGetActiveAttrib = 146;
+        glGetActiveUniform = 147;
+        glGetAttachedShaders = 148;
+        glGetAttribLocation = 149;
+        glGetBooleanv = 150;
+        glGetBufferParameteriv = 151;
+        glGetBufferPointervOES = 152;
+        glGetClipPlanef = 153;
+        glGetClipPlanefOES = 154;
+        glGetClipPlanex = 155;
+        glGetClipPlanexOES = 156;
+        glGetDriverControlsQCOM = 157;
+        glGetDriverControlStringQCOM = 158;
+        glGetError = 159;
+        glGetFenceivNV = 160;
+        glGetFixedv = 161;
+        glGetFixedvOES = 162;
+        glGetFloatv = 163;
+        glGetFramebufferAttachmentParameteriv = 164;
+        glGetFramebufferAttachmentParameterivOES = 165;
+        glGetIntegerv = 166;
+        glGetLightfv = 167;
+        glGetLightxv = 168;
+        glGetLightxvOES = 169;
+        glGetMaterialfv = 170;
+        glGetMaterialxv = 171;
+        glGetMaterialxvOES = 172;
+        glGetPerfMonitorCounterDataAMD = 173;
+        glGetPerfMonitorCounterInfoAMD = 174;
+        glGetPerfMonitorCountersAMD = 175;
+        glGetPerfMonitorCounterStringAMD = 176;
+        glGetPerfMonitorGroupsAMD = 177;
+        glGetPerfMonitorGroupStringAMD = 178;
+        glGetPointerv = 179;
+        glGetProgramBinaryOES = 180;
+        glGetProgramInfoLog = 181;
+        glGetProgramiv = 182;
+        glGetRenderbufferParameteriv = 183;
+        glGetRenderbufferParameterivOES = 184;
+        glGetShaderInfoLog = 185;
+        glGetShaderiv = 186;
+        glGetShaderPrecisionFormat = 187;
+        glGetShaderSource = 188;
+        glGetString = 189;
+        glGetTexEnvfv = 190;
+        glGetTexEnviv = 191;
+        glGetTexEnvxv = 192;
+        glGetTexEnvxvOES = 193;
+        glGetTexGenfvOES = 194;
+        glGetTexGenivOES = 195;
+        glGetTexGenxvOES = 196;
+        glGetTexParameterfv = 197;
+        glGetTexParameteriv = 198;
+        glGetTexParameterxv = 199;
+        glGetTexParameterxvOES = 200;
+        glGetUniformfv = 201;
+        glGetUniformiv = 202;
+        glGetUniformLocation = 203;
+        glGetVertexAttribfv = 204;
+        glGetVertexAttribiv = 205;
+        glGetVertexAttribPointerv = 206;
+        glHint = 207;
+        glIsBuffer = 208;
+        glIsEnabled = 209;
+        glIsFenceNV = 210;
+        glIsFramebuffer = 211;
+        glIsFramebufferOES = 212;
+        glIsProgram = 213;
+        glIsRenderbuffer = 214;
+        glIsRenderbufferOES = 215;
+        glIsShader = 216;
+        glIsTexture = 217;
+        glIsVertexArrayOES = 218;
+        glLightf = 219;
+        glLightfv = 220;
+        glLightModelf = 221;
+        glLightModelfv = 222;
+        glLightModelx = 223;
+        glLightModelxOES = 224;
+        glLightModelxv = 225;
+        glLightModelxvOES = 226;
+        glLightx = 227;
+        glLightxOES = 228;
+        glLightxv = 229;
+        glLightxvOES = 230;
+        glLineWidth = 231;
+        glLineWidthx = 232;
+        glLineWidthxOES = 233;
+        glLinkProgram = 234;
+        glLoadIdentity = 235;
+        glLoadMatrixf = 236;
+        glLoadMatrixx = 237;
+        glLoadMatrixxOES = 238;
+        glLoadPaletteFromModelViewMatrixOES = 239;
+        glLogicOp = 240;
+        glMapBufferOES = 241;
+        glMaterialf = 242;
+        glMaterialfv = 243;
+        glMaterialx = 244;
+        glMaterialxOES = 245;
+        glMaterialxv = 246;
+        glMaterialxvOES = 247;
+        glMatrixIndexPointerOES = 248;
+        glMatrixMode = 249;
+        glMultiDrawArraysEXT = 250;
+        glMultiDrawElementsEXT = 251;
+        glMultiTexCoord4f = 252;
+        glMultiTexCoord4x = 253;
+        glMultiTexCoord4xOES = 254;
+        glMultMatrixf = 255;
+        glMultMatrixx = 256;
+        glMultMatrixxOES = 257;
+        glNormal3f = 258;
+        glNormal3x = 259;
+        glNormal3xOES = 260;
+        glNormalPointer = 261;
+        glOrthof = 262;
+        glOrthofOES = 263;
+        glOrthox = 264;
+        glOrthoxOES = 265;
+        glPixelStorei = 266;
+        glPointParameterf = 267;
+        glPointParameterfv = 268;
+        glPointParameterx = 269;
+        glPointParameterxOES = 270;
+        glPointParameterxv = 271;
+        glPointParameterxvOES = 272;
+        glPointSize = 273;
+        glPointSizePointerOES = 274;
+        glPointSizex = 275;
+        glPointSizexOES = 276;
+        glPolygonOffset = 277;
+        glPolygonOffsetx = 278;
+        glPolygonOffsetxOES = 279;
+        glPopMatrix = 280;
+        glProgramBinaryOES = 281;
+        glPushMatrix = 282;
+        glQueryMatrixxOES = 283;
+        glReadPixels = 284;
+        glReleaseShaderCompiler = 285;
+        glRenderbufferStorage = 286;
+        glRenderbufferStorageMultisampleIMG = 287;
+        glRenderbufferStorageOES = 288;
+        glRotatef = 289;
+        glRotatex = 290;
+        glRotatexOES = 291;
+        glSampleCoverage = 292;
+        glSampleCoveragex = 293;
+        glSampleCoveragexOES = 294;
+        glScalef = 295;
+        glScalex = 296;
+        glScalexOES = 297;
+        glScissor = 298;
+        glSelectPerfMonitorCountersAMD = 299;
+        glSetFenceNV = 300;
+        glShadeModel = 301;
+        glShaderBinary = 302;
+        glShaderSource = 303;
+        glStartTilingQCOM = 304;
+        glStencilFunc = 305;
+        glStencilFuncSeparate = 306;
+        glStencilMask = 307;
+        glStencilMaskSeparate = 308;
+        glStencilOp = 309;
+        glStencilOpSeparate = 310;
+        glTestFenceNV = 311;
+        glTexCoordPointer = 312;
+        glTexEnvf = 313;
+        glTexEnvfv = 314;
+        glTexEnvi = 315;
+        glTexEnviv = 316;
+        glTexEnvx = 317;
+        glTexEnvxOES = 318;
+        glTexEnvxv = 319;
+        glTexEnvxvOES = 320;
+        glTexGenfOES = 321;
+        glTexGenfvOES = 322;
+        glTexGeniOES = 323;
+        glTexGenivOES = 324;
+        glTexGenxOES = 325;
+        glTexGenxvOES = 326;
+        glTexImage2D = 327;
+        glTexImage3DOES = 328;
+        glTexParameterf = 329;
+        glTexParameterfv = 330;
+        glTexParameteri = 331;
+        glTexParameteriv = 332;
+        glTexParameterx = 333;
+        glTexParameterxOES = 334;
+        glTexParameterxv = 335;
+        glTexParameterxvOES = 336;
+        glTexSubImage2D = 337;
+        glTexSubImage3DOES = 338;
+        glTranslatef = 339;
+        glTranslatex = 340;
+        glTranslatexOES = 341;
+        glUniform1f = 342;
+        glUniform1fv = 343;
+        glUniform1i = 344;
+        glUniform1iv = 345;
+        glUniform2f = 346;
+        glUniform2fv = 347;
+        glUniform2i = 348;
+        glUniform2iv = 349;
+        glUniform3f = 350;
+        glUniform3fv = 351;
+        glUniform3i = 352;
+        glUniform3iv = 353;
+        glUniform4f = 354;
+        glUniform4fv = 355;
+        glUniform4i = 356;
+        glUniform4iv = 357;
+        glUniformMatrix2fv = 358;
+        glUniformMatrix3fv = 359;
+        glUniformMatrix4fv = 360;
+        glUnmapBufferOES = 361;
+        glUseProgram = 362;
+        glValidateProgram = 363;
+        glVertexAttrib1f = 364;
+        glVertexAttrib1fv = 365;
+        glVertexAttrib2f = 366;
+        glVertexAttrib2fv = 367;
+        glVertexAttrib3f = 368;
+        glVertexAttrib3fv = 369;
+        glVertexAttrib4f = 370;
+        glVertexAttrib4fv = 371;
+        glVertexAttribPointer = 372;
+        glVertexPointer = 373;
+        glViewport = 374;
+        glWeightPointerOES = 375;
+
+        glActiveShaderProgramEXT = 502;
+        glAlphaFuncQCOM = 503;
+        glBeginQueryEXT = 504;
+        glBindProgramPipelineEXT = 505;
+        glBlitFramebufferANGLE = 506;
+        glCreateShaderProgramvEXT = 507;
+        glDeleteProgramPipelinesEXT = 508;
+        glDeleteQueriesEXT = 509;
+        glDrawBuffersNV = 510;
+        glEndQueryEXT = 511;
+        glFramebufferTexture2DMultisampleEXT = 512;
+        glGenProgramPipelinesEXT = 513;
+        glGenQueriesEXT = 514;
+        glGetGraphicsResetStatusEXT = 515;
+        glGetObjectLabelEXT = 516;
+        glGetProgramPipelineInfoLogEXT = 517;
+        glGetProgramPipelineivEXT = 518;
+        glGetQueryObjectuivEXT = 519;
+        glGetQueryivEXT = 520;
+        glGetnUniformfvEXT = 521;
+        glGetnUniformivEXT = 521;
+        glInsertEventMarkerEXT = 522;
+        glIsProgramPipelineEXT = 523;
+        glIsQueryEXT = 524;
+        glLabelObjectEXT = 525;
+        glPopGroupMarkerEXT = 526;
+        glProgramParameteriEXT = 527;
+        glProgramUniform1fEXT = 528;
+        glProgramUniform1fvEXT = 529;
+        glProgramUniform1iEXT = 530;
+        glProgramUniform1ivEXT = 531;
+        glProgramUniform2fEXT = 532;
+        glProgramUniform2fvEXT = 533;
+        glProgramUniform2iEXT = 534;
+        glProgramUniform2ivEXT = 535;
+        glProgramUniform3fEXT = 536;
+        glProgramUniform3fvEXT = 537;
+        glProgramUniform3iEXT = 538;
+        glProgramUniform3ivEXT = 539;
+        glProgramUniform4fEXT = 540;
+        glProgramUniform4fvEXT = 541;
+        glProgramUniform4iEXT = 542;
+        glProgramUniform4ivEXT = 543;
+        glProgramUniformMatrix2fvEXT = 544;
+        glProgramUniformMatrix3fvEXT = 545;
+        glProgramUniformMatrix4fvEXT = 546;
+        glPushGroupMarkerEXT = 547;
+        glReadBufferNV = 548;
+        glReadnPixelsEXT = 549;
+        glRenderbufferStorageMultisampleANGLE = 550;
+        glRenderbufferStorageMultisampleAPPLE = 551;
+        glRenderbufferStorageMultisampleEXT = 552;
+        glResolveMultisampleFramebufferAPPLE = 553;
+        glTexStorage1DEXT = 554;
+        glTexStorage2DEXT = 555;
+        glTexStorage3DEXT = 556;
+        glTextureStorage1DEXT = 557;
+        glTextureStorage2DEXT = 558;
+        glTextureStorage3DEXT = 559;
+        glUseProgramStagesEXT = 560;
+        glValidateProgramPipelineEXT = 561;
+
+        eglGetDisplay = 2000;
+        eglInitialize = 2001;
+        eglTerminate = 2002;
+        eglGetConfigs = 2003;
+        eglChooseConfig = 2004;
+        eglGetConfigAttrib = 2005;
+        eglCreateWindowSurface = 2006;
+        eglCreatePixmapSurface = 2007;
+        eglCreatePbufferSurface = 2008;
+        eglDestroySurface = 2009;
+        eglQuerySurface = 2010;
+        eglCreateContext = 2011;
+        eglDestroyContext = 2012;
+        eglMakeCurrent = 2013;
+        eglGetCurrentContext = 2014;
+        eglGetCurrentSurface = 2015;
+        eglGetCurrentDisplay = 2016;
+        eglQueryContext = 2017;
+        eglWaitGL = 2018;
+        eglWaitNative = 2019;
+        eglSwapBuffers = 2020;
+        eglCopyBuffers = 2021;
+        eglGetError = 2022;
+        eglQueryString = 2023;
+        eglGetProcAddress = 2024;
+        eglSurfaceAttrib = 2025;
+        eglBindTexImage = 2026;
+        eglReleaseTexImage = 2027;
+        eglSwapInterval = 2028;
+        eglBindAPI = 2029;
+        eglQueryAPI = 2030;
+        eglWaitClient = 2031;
+        eglReleaseThread = 2032;
+        eglCreatePbufferFromClientBuffer = 2033;
+        eglLockSurfaceKHR = 2034;
+        eglUnlockSurfaceKHR = 2035;
+        eglCreateImageKHR = 2036;
+        eglDestroyImageKHR = 2037;
+        eglCreateSyncKHR = 2038;
+        eglDestroySyncKHR = 2039;
+        eglClientWaitSyncKHR = 2040;
+        eglGetSyncAttribKHR = 2041;
+        eglSetSwapRectangleANDROID = 2042;
+        eglGetRenderBufferANDROID = 2043;
+        eglGetSystemTimeFrequencyNV = 2044;
+        eglGetSystemTimeNV = 2045;
+
+        invalid = 3000;
+        frameBufferContents = 3001;
+    }
+
+    // A GL call's return data and arguments are formatted into this DataType
+    message DataType {
+        enum Type {
+            VOID = 1;       // GLvoid
+            CHAR = 2;       // GLchar
+            BYTE = 3;       // GLbyte, GLubyte
+            INT = 4;        // GLbitfield, GLshort, GLint, GLsizei, GLushort, GLuint, GLfixed
+            FLOAT = 5;      // GLfloat, GLclampf
+            BOOL = 6;       // GLboolean
+            ENUM = 7;       // GLenum
+        };
+
+        required Type   type = 1 [default = VOID];
+        required bool   isArray = 2 [default = false];
+
+        repeated int32  intValue = 3;
+        repeated float  floatValue = 4;
+        repeated bytes  charValue = 5;
+        repeated bytes  rawBytes = 6;
+        repeated bool   boolValue = 7;
+    }
+
+    message FrameBuffer {
+        required int32  width = 1;
+        required int32  height = 2;
+        repeated bytes  contents = 3;
+    }
+
+    required int32      context_id = 1;                     // GL context ID
+    required int64      start_time = 2;                     // time when call was invoked
+    required int32      duration = 3;                       // duration of the call
+
+    required Function   function = 4 [default = invalid];   // GL function called
+    repeated DataType   args = 5;                           // GL function's arguments
+    optional DataType   returnValue = 6;                    // GL function's return value
+
+    optional FrameBuffer fb = 7;                            // contents of the framebuffer
+};
diff --git a/opengl/libs/GLES_trace/src/gltrace.pb.cpp b/opengl/libs/GLES_trace/src/gltrace.pb.cpp
new file mode 100644
index 0000000..bb9d4a7
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace.pb.cpp
@@ -0,0 +1,2046 @@
+// 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 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 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::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::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::frameBufferContents;
+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:
+      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::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;
+#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();
+  ::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->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);
+  }
+  
+}
+
+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;
+  }
+  
+  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_);
+  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_);
+    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;
+#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;
+  ::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();
+    }
+  }
+  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->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);
+  }
+  
+}
+
+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());
+    }
+    
+  }
+  // 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());
+    }
+  }
+}
+
+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(_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
new file mode 100644
index 0000000..e3b8990
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace.pb.h
@@ -0,0 +1,1871 @@
+// 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
+};
+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_ENUM;
+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_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_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_frameBufferContents = 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_frameBufferContents;
+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 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();
+  
+  // @@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_;
+  friend void  protobuf_AddDesc_gltrace_2eproto();
+  friend void protobuf_AssignDesc_gltrace_2eproto();
+  friend void protobuf_ShutdownFile_gltrace_2eproto();
+  
+  ::google::protobuf::uint32 _has_bits_[(7 + 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 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 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 frameBufferContents = GLMessage_Function_frameBufferContents;
+  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();
+  
+  // @@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_;
+  friend void  protobuf_AddDesc_gltrace_2eproto();
+  friend void protobuf_AssignDesc_gltrace_2eproto();
+  friend void protobuf_ShutdownFile_gltrace_2eproto();
+  
+  ::google::protobuf::uint32 _has_bits_[(7 + 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_;
+}
+
+// -------------------------------------------------------------------
+
+// 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_;
+}
+
+
+// @@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
new file mode 100644
index 0000000..a2366ac
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_api.cpp
@@ -0,0 +1,14563 @@
+/*
+ * Copyright 2011, 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.
+ *
+ * THIS FILE WAS GENERATED BY A SCRIPT. DO NOT EDIT.
+ */
+
+#include <cutils/log.h>
+#include <utils/Timers.h>
+#include <GLES2/gl2.h>
+
+#include "gltrace.pb.h"
+#include "gltrace_context.h"
+#include "gltrace_fixup.h"
+#include "gltrace_transport.h"
+
+namespace android {
+namespace gltrace {
+
+// Definitions for GL2 APIs
+
+void GLTrace_glActiveTexture(GLenum texture) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glActiveTexture);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::ENUM);
+    arg_texture->add_intvalue((int)texture);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glActiveTexture(texture);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glAttachShader(GLuint program, GLuint shader) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glAttachShader);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument shader
+    GLMessage_DataType *arg_shader = glmsg.add_args();
+    arg_shader->set_isarray(false);
+    arg_shader->set_type(GLMessage::DataType::INT);
+    arg_shader->add_intvalue(shader);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glAttachShader(program, shader);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBindAttribLocation(GLuint program, GLuint index, const GLchar* name) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBindAttribLocation);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument index
+    GLMessage_DataType *arg_index = glmsg.add_args();
+    arg_index->set_isarray(false);
+    arg_index->set_type(GLMessage::DataType::INT);
+    arg_index->add_intvalue(index);
+
+    // copy argument name
+    GLMessage_DataType *arg_name = glmsg.add_args();
+    arg_name->set_isarray(false);
+    arg_name->set_type(GLMessage::DataType::INT);
+    arg_name->add_intvalue((int)name);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBindAttribLocation(program, index, name);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBindBuffer(GLenum target, GLuint buffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBindBuffer);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument buffer
+    GLMessage_DataType *arg_buffer = glmsg.add_args();
+    arg_buffer->set_isarray(false);
+    arg_buffer->set_type(GLMessage::DataType::INT);
+    arg_buffer->add_intvalue(buffer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBindBuffer(target, buffer);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBindFramebuffer(GLenum target, GLuint framebuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBindFramebuffer);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument framebuffer
+    GLMessage_DataType *arg_framebuffer = glmsg.add_args();
+    arg_framebuffer->set_isarray(false);
+    arg_framebuffer->set_type(GLMessage::DataType::INT);
+    arg_framebuffer->add_intvalue(framebuffer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBindFramebuffer(target, framebuffer);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBindRenderbuffer(GLenum target, GLuint renderbuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBindRenderbuffer);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument renderbuffer
+    GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
+    arg_renderbuffer->set_isarray(false);
+    arg_renderbuffer->set_type(GLMessage::DataType::INT);
+    arg_renderbuffer->add_intvalue(renderbuffer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBindRenderbuffer(target, renderbuffer);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBindTexture(GLenum target, GLuint texture) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBindTexture);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::INT);
+    arg_texture->add_intvalue(texture);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBindTexture(target, texture);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBlendColor);
+
+    // copy argument red
+    GLMessage_DataType *arg_red = glmsg.add_args();
+    arg_red->set_isarray(false);
+    arg_red->set_type(GLMessage::DataType::FLOAT);
+    arg_red->add_floatvalue(red);
+
+    // copy argument green
+    GLMessage_DataType *arg_green = glmsg.add_args();
+    arg_green->set_isarray(false);
+    arg_green->set_type(GLMessage::DataType::FLOAT);
+    arg_green->add_floatvalue(green);
+
+    // copy argument blue
+    GLMessage_DataType *arg_blue = glmsg.add_args();
+    arg_blue->set_isarray(false);
+    arg_blue->set_type(GLMessage::DataType::FLOAT);
+    arg_blue->add_floatvalue(blue);
+
+    // copy argument alpha
+    GLMessage_DataType *arg_alpha = glmsg.add_args();
+    arg_alpha->set_isarray(false);
+    arg_alpha->set_type(GLMessage::DataType::FLOAT);
+    arg_alpha->add_floatvalue(alpha);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBlendColor(red, green, blue, alpha);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBlendEquation(GLenum mode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBlendEquation);
+
+    // copy argument mode
+    GLMessage_DataType *arg_mode = glmsg.add_args();
+    arg_mode->set_isarray(false);
+    arg_mode->set_type(GLMessage::DataType::ENUM);
+    arg_mode->add_intvalue((int)mode);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBlendEquation(mode);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBlendEquationSeparate);
+
+    // copy argument modeRGB
+    GLMessage_DataType *arg_modeRGB = glmsg.add_args();
+    arg_modeRGB->set_isarray(false);
+    arg_modeRGB->set_type(GLMessage::DataType::ENUM);
+    arg_modeRGB->add_intvalue((int)modeRGB);
+
+    // copy argument modeAlpha
+    GLMessage_DataType *arg_modeAlpha = glmsg.add_args();
+    arg_modeAlpha->set_isarray(false);
+    arg_modeAlpha->set_type(GLMessage::DataType::ENUM);
+    arg_modeAlpha->add_intvalue((int)modeAlpha);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBlendEquationSeparate(modeRGB, modeAlpha);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBlendFunc(GLenum sfactor, GLenum dfactor) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBlendFunc);
+
+    // copy argument sfactor
+    GLMessage_DataType *arg_sfactor = glmsg.add_args();
+    arg_sfactor->set_isarray(false);
+    arg_sfactor->set_type(GLMessage::DataType::ENUM);
+    arg_sfactor->add_intvalue((int)sfactor);
+
+    // copy argument dfactor
+    GLMessage_DataType *arg_dfactor = glmsg.add_args();
+    arg_dfactor->set_isarray(false);
+    arg_dfactor->set_type(GLMessage::DataType::ENUM);
+    arg_dfactor->add_intvalue((int)dfactor);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBlendFunc(sfactor, dfactor);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBlendFuncSeparate);
+
+    // copy argument srcRGB
+    GLMessage_DataType *arg_srcRGB = glmsg.add_args();
+    arg_srcRGB->set_isarray(false);
+    arg_srcRGB->set_type(GLMessage::DataType::ENUM);
+    arg_srcRGB->add_intvalue((int)srcRGB);
+
+    // copy argument dstRGB
+    GLMessage_DataType *arg_dstRGB = glmsg.add_args();
+    arg_dstRGB->set_isarray(false);
+    arg_dstRGB->set_type(GLMessage::DataType::ENUM);
+    arg_dstRGB->add_intvalue((int)dstRGB);
+
+    // copy argument srcAlpha
+    GLMessage_DataType *arg_srcAlpha = glmsg.add_args();
+    arg_srcAlpha->set_isarray(false);
+    arg_srcAlpha->set_type(GLMessage::DataType::ENUM);
+    arg_srcAlpha->add_intvalue((int)srcAlpha);
+
+    // copy argument dstAlpha
+    GLMessage_DataType *arg_dstAlpha = glmsg.add_args();
+    arg_dstAlpha->set_isarray(false);
+    arg_dstAlpha->set_type(GLMessage::DataType::ENUM);
+    arg_dstAlpha->add_intvalue((int)dstAlpha);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBufferData);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument size
+    GLMessage_DataType *arg_size = glmsg.add_args();
+    arg_size->set_isarray(false);
+    arg_size->set_type(GLMessage::DataType::INT);
+    arg_size->add_intvalue((int)size);
+
+    // copy argument data
+    GLMessage_DataType *arg_data = glmsg.add_args();
+    arg_data->set_isarray(false);
+    arg_data->set_type(GLMessage::DataType::INT);
+    arg_data->add_intvalue((int)data);
+
+    // copy argument usage
+    GLMessage_DataType *arg_usage = glmsg.add_args();
+    arg_usage->set_isarray(false);
+    arg_usage->set_type(GLMessage::DataType::ENUM);
+    arg_usage->add_intvalue((int)usage);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBufferData(target, size, data, usage);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBufferSubData);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument offset
+    GLMessage_DataType *arg_offset = glmsg.add_args();
+    arg_offset->set_isarray(false);
+    arg_offset->set_type(GLMessage::DataType::INT);
+    arg_offset->add_intvalue((int)offset);
+
+    // copy argument size
+    GLMessage_DataType *arg_size = glmsg.add_args();
+    arg_size->set_isarray(false);
+    arg_size->set_type(GLMessage::DataType::INT);
+    arg_size->add_intvalue((int)size);
+
+    // copy argument data
+    GLMessage_DataType *arg_data = glmsg.add_args();
+    arg_data->set_isarray(false);
+    arg_data->set_type(GLMessage::DataType::INT);
+    arg_data->add_intvalue((int)data);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBufferSubData(target, offset, size, data);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLenum GLTrace_glCheckFramebufferStatus(GLenum target) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCheckFramebufferStatus);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLenum retValue = glContext->hooks->gl.glCheckFramebufferStatus(target);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::ENUM);
+    rt->add_intvalue((int)retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glClear(GLbitfield mask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glClear);
+
+    // copy argument mask
+    GLMessage_DataType *arg_mask = glmsg.add_args();
+    arg_mask->set_isarray(false);
+    arg_mask->set_type(GLMessage::DataType::INT);
+    arg_mask->add_intvalue(mask);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glClear(mask);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glClearColor);
+
+    // copy argument red
+    GLMessage_DataType *arg_red = glmsg.add_args();
+    arg_red->set_isarray(false);
+    arg_red->set_type(GLMessage::DataType::FLOAT);
+    arg_red->add_floatvalue(red);
+
+    // copy argument green
+    GLMessage_DataType *arg_green = glmsg.add_args();
+    arg_green->set_isarray(false);
+    arg_green->set_type(GLMessage::DataType::FLOAT);
+    arg_green->add_floatvalue(green);
+
+    // copy argument blue
+    GLMessage_DataType *arg_blue = glmsg.add_args();
+    arg_blue->set_isarray(false);
+    arg_blue->set_type(GLMessage::DataType::FLOAT);
+    arg_blue->add_floatvalue(blue);
+
+    // copy argument alpha
+    GLMessage_DataType *arg_alpha = glmsg.add_args();
+    arg_alpha->set_isarray(false);
+    arg_alpha->set_type(GLMessage::DataType::FLOAT);
+    arg_alpha->add_floatvalue(alpha);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glClearColor(red, green, blue, alpha);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClearDepthf(GLclampf depth) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glClearDepthf);
+
+    // copy argument depth
+    GLMessage_DataType *arg_depth = glmsg.add_args();
+    arg_depth->set_isarray(false);
+    arg_depth->set_type(GLMessage::DataType::FLOAT);
+    arg_depth->add_floatvalue(depth);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glClearDepthf(depth);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClearStencil(GLint s) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glClearStencil);
+
+    // copy argument s
+    GLMessage_DataType *arg_s = glmsg.add_args();
+    arg_s->set_isarray(false);
+    arg_s->set_type(GLMessage::DataType::INT);
+    arg_s->add_intvalue(s);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glClearStencil(s);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glColorMask);
+
+    // copy argument red
+    GLMessage_DataType *arg_red = glmsg.add_args();
+    arg_red->set_isarray(false);
+    arg_red->set_type(GLMessage::DataType::BOOL);
+    arg_red->add_boolvalue(red);
+
+    // copy argument green
+    GLMessage_DataType *arg_green = glmsg.add_args();
+    arg_green->set_isarray(false);
+    arg_green->set_type(GLMessage::DataType::BOOL);
+    arg_green->add_boolvalue(green);
+
+    // copy argument blue
+    GLMessage_DataType *arg_blue = glmsg.add_args();
+    arg_blue->set_isarray(false);
+    arg_blue->set_type(GLMessage::DataType::BOOL);
+    arg_blue->add_boolvalue(blue);
+
+    // copy argument alpha
+    GLMessage_DataType *arg_alpha = glmsg.add_args();
+    arg_alpha->set_isarray(false);
+    arg_alpha->set_type(GLMessage::DataType::BOOL);
+    arg_alpha->add_boolvalue(alpha);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glColorMask(red, green, blue, alpha);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glCompileShader(GLuint shader) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCompileShader);
+
+    // copy argument shader
+    GLMessage_DataType *arg_shader = glmsg.add_args();
+    arg_shader->set_isarray(false);
+    arg_shader->set_type(GLMessage::DataType::INT);
+    arg_shader->add_intvalue(shader);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glCompileShader(shader);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCompressedTexImage2D);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument border
+    GLMessage_DataType *arg_border = glmsg.add_args();
+    arg_border->set_isarray(false);
+    arg_border->set_type(GLMessage::DataType::INT);
+    arg_border->add_intvalue(border);
+
+    // copy argument imageSize
+    GLMessage_DataType *arg_imageSize = glmsg.add_args();
+    arg_imageSize->set_isarray(false);
+    arg_imageSize->set_type(GLMessage::DataType::INT);
+    arg_imageSize->add_intvalue(imageSize);
+
+    // copy argument data
+    GLMessage_DataType *arg_data = glmsg.add_args();
+    arg_data->set_isarray(false);
+    arg_data->set_type(GLMessage::DataType::INT);
+    arg_data->add_intvalue((int)data);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCompressedTexSubImage2D);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument xoffset
+    GLMessage_DataType *arg_xoffset = glmsg.add_args();
+    arg_xoffset->set_isarray(false);
+    arg_xoffset->set_type(GLMessage::DataType::INT);
+    arg_xoffset->add_intvalue(xoffset);
+
+    // copy argument yoffset
+    GLMessage_DataType *arg_yoffset = glmsg.add_args();
+    arg_yoffset->set_isarray(false);
+    arg_yoffset->set_type(GLMessage::DataType::INT);
+    arg_yoffset->add_intvalue(yoffset);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument format
+    GLMessage_DataType *arg_format = glmsg.add_args();
+    arg_format->set_isarray(false);
+    arg_format->set_type(GLMessage::DataType::ENUM);
+    arg_format->add_intvalue((int)format);
+
+    // copy argument imageSize
+    GLMessage_DataType *arg_imageSize = glmsg.add_args();
+    arg_imageSize->set_isarray(false);
+    arg_imageSize->set_type(GLMessage::DataType::INT);
+    arg_imageSize->add_intvalue(imageSize);
+
+    // copy argument data
+    GLMessage_DataType *arg_data = glmsg.add_args();
+    arg_data->set_isarray(false);
+    arg_data->set_type(GLMessage::DataType::INT);
+    arg_data->add_intvalue((int)data);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCopyTexImage2D);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument border
+    GLMessage_DataType *arg_border = glmsg.add_args();
+    arg_border->set_isarray(false);
+    arg_border->set_type(GLMessage::DataType::INT);
+    arg_border->add_intvalue(border);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCopyTexSubImage2D);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument xoffset
+    GLMessage_DataType *arg_xoffset = glmsg.add_args();
+    arg_xoffset->set_isarray(false);
+    arg_xoffset->set_type(GLMessage::DataType::INT);
+    arg_xoffset->add_intvalue(xoffset);
+
+    // copy argument yoffset
+    GLMessage_DataType *arg_yoffset = glmsg.add_args();
+    arg_yoffset->set_isarray(false);
+    arg_yoffset->set_type(GLMessage::DataType::INT);
+    arg_yoffset->add_intvalue(yoffset);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLuint GLTrace_glCreateProgram(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCreateProgram);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLuint retValue = glContext->hooks->gl.glCreateProgram();
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::INT);
+    rt->add_intvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLuint GLTrace_glCreateShader(GLenum type) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCreateShader);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLuint retValue = glContext->hooks->gl.glCreateShader(type);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::INT);
+    rt->add_intvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glCullFace(GLenum mode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCullFace);
+
+    // copy argument mode
+    GLMessage_DataType *arg_mode = glmsg.add_args();
+    arg_mode->set_isarray(false);
+    arg_mode->set_type(GLMessage::DataType::ENUM);
+    arg_mode->add_intvalue((int)mode);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glCullFace(mode);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteBuffers(GLsizei n, const GLuint* buffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDeleteBuffers);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument buffers
+    GLMessage_DataType *arg_buffers = glmsg.add_args();
+    arg_buffers->set_isarray(false);
+    arg_buffers->set_type(GLMessage::DataType::INT);
+    arg_buffers->add_intvalue((int)buffers);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDeleteBuffers(n, buffers);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDeleteFramebuffers);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument framebuffers
+    GLMessage_DataType *arg_framebuffers = glmsg.add_args();
+    arg_framebuffers->set_isarray(false);
+    arg_framebuffers->set_type(GLMessage::DataType::INT);
+    arg_framebuffers->add_intvalue((int)framebuffers);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDeleteFramebuffers(n, framebuffers);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteProgram(GLuint program) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDeleteProgram);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDeleteProgram(program);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDeleteRenderbuffers);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument renderbuffers
+    GLMessage_DataType *arg_renderbuffers = glmsg.add_args();
+    arg_renderbuffers->set_isarray(false);
+    arg_renderbuffers->set_type(GLMessage::DataType::INT);
+    arg_renderbuffers->add_intvalue((int)renderbuffers);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDeleteRenderbuffers(n, renderbuffers);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteShader(GLuint shader) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDeleteShader);
+
+    // copy argument shader
+    GLMessage_DataType *arg_shader = glmsg.add_args();
+    arg_shader->set_isarray(false);
+    arg_shader->set_type(GLMessage::DataType::INT);
+    arg_shader->add_intvalue(shader);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDeleteShader(shader);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteTextures(GLsizei n, const GLuint* textures) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDeleteTextures);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument textures
+    GLMessage_DataType *arg_textures = glmsg.add_args();
+    arg_textures->set_isarray(false);
+    arg_textures->set_type(GLMessage::DataType::INT);
+    arg_textures->add_intvalue((int)textures);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDeleteTextures(n, textures);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDepthFunc(GLenum func) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDepthFunc);
+
+    // copy argument func
+    GLMessage_DataType *arg_func = glmsg.add_args();
+    arg_func->set_isarray(false);
+    arg_func->set_type(GLMessage::DataType::ENUM);
+    arg_func->add_intvalue((int)func);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDepthFunc(func);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDepthMask(GLboolean flag) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDepthMask);
+
+    // copy argument flag
+    GLMessage_DataType *arg_flag = glmsg.add_args();
+    arg_flag->set_isarray(false);
+    arg_flag->set_type(GLMessage::DataType::BOOL);
+    arg_flag->add_boolvalue(flag);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDepthMask(flag);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDepthRangef(GLclampf zNear, GLclampf zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDepthRangef);
+
+    // copy argument zNear
+    GLMessage_DataType *arg_zNear = glmsg.add_args();
+    arg_zNear->set_isarray(false);
+    arg_zNear->set_type(GLMessage::DataType::FLOAT);
+    arg_zNear->add_floatvalue(zNear);
+
+    // copy argument zFar
+    GLMessage_DataType *arg_zFar = glmsg.add_args();
+    arg_zFar->set_isarray(false);
+    arg_zFar->set_type(GLMessage::DataType::FLOAT);
+    arg_zFar->add_floatvalue(zFar);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDepthRangef(zNear, zFar);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDetachShader(GLuint program, GLuint shader) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDetachShader);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument shader
+    GLMessage_DataType *arg_shader = glmsg.add_args();
+    arg_shader->set_isarray(false);
+    arg_shader->set_type(GLMessage::DataType::INT);
+    arg_shader->add_intvalue(shader);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDetachShader(program, shader);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDisable(GLenum cap) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDisable);
+
+    // copy argument cap
+    GLMessage_DataType *arg_cap = glmsg.add_args();
+    arg_cap->set_isarray(false);
+    arg_cap->set_type(GLMessage::DataType::ENUM);
+    arg_cap->add_intvalue((int)cap);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDisable(cap);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDisableVertexAttribArray(GLuint index) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDisableVertexAttribArray);
+
+    // copy argument index
+    GLMessage_DataType *arg_index = glmsg.add_args();
+    arg_index->set_isarray(false);
+    arg_index->set_type(GLMessage::DataType::INT);
+    arg_index->add_intvalue(index);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDisableVertexAttribArray(index);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawArrays(GLenum mode, GLint first, GLsizei count) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDrawArrays);
+
+    // copy argument mode
+    GLMessage_DataType *arg_mode = glmsg.add_args();
+    arg_mode->set_isarray(false);
+    arg_mode->set_type(GLMessage::DataType::ENUM);
+    arg_mode->add_intvalue((int)mode);
+
+    // copy argument first
+    GLMessage_DataType *arg_first = glmsg.add_args();
+    arg_first->set_isarray(false);
+    arg_first->set_type(GLMessage::DataType::INT);
+    arg_first->add_intvalue(first);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDrawArrays(mode, first, count);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDrawElements);
+
+    // copy argument mode
+    GLMessage_DataType *arg_mode = glmsg.add_args();
+    arg_mode->set_isarray(false);
+    arg_mode->set_type(GLMessage::DataType::ENUM);
+    arg_mode->add_intvalue((int)mode);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument indices
+    GLMessage_DataType *arg_indices = glmsg.add_args();
+    arg_indices->set_isarray(false);
+    arg_indices->set_type(GLMessage::DataType::INT);
+    arg_indices->add_intvalue((int)indices);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDrawElements(mode, count, type, indices);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glEnable(GLenum cap) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glEnable);
+
+    // copy argument cap
+    GLMessage_DataType *arg_cap = glmsg.add_args();
+    arg_cap->set_isarray(false);
+    arg_cap->set_type(GLMessage::DataType::ENUM);
+    arg_cap->add_intvalue((int)cap);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glEnable(cap);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glEnableVertexAttribArray(GLuint index) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glEnableVertexAttribArray);
+
+    // copy argument index
+    GLMessage_DataType *arg_index = glmsg.add_args();
+    arg_index->set_isarray(false);
+    arg_index->set_type(GLMessage::DataType::INT);
+    arg_index->add_intvalue(index);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glEnableVertexAttribArray(index);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFinish(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFinish);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFinish();
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFlush(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFlush);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFlush();
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFramebufferRenderbuffer);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument attachment
+    GLMessage_DataType *arg_attachment = glmsg.add_args();
+    arg_attachment->set_isarray(false);
+    arg_attachment->set_type(GLMessage::DataType::ENUM);
+    arg_attachment->add_intvalue((int)attachment);
+
+    // copy argument renderbuffertarget
+    GLMessage_DataType *arg_renderbuffertarget = glmsg.add_args();
+    arg_renderbuffertarget->set_isarray(false);
+    arg_renderbuffertarget->set_type(GLMessage::DataType::ENUM);
+    arg_renderbuffertarget->add_intvalue((int)renderbuffertarget);
+
+    // copy argument renderbuffer
+    GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
+    arg_renderbuffer->set_isarray(false);
+    arg_renderbuffer->set_type(GLMessage::DataType::INT);
+    arg_renderbuffer->add_intvalue(renderbuffer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFramebufferTexture2D);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument attachment
+    GLMessage_DataType *arg_attachment = glmsg.add_args();
+    arg_attachment->set_isarray(false);
+    arg_attachment->set_type(GLMessage::DataType::ENUM);
+    arg_attachment->add_intvalue((int)attachment);
+
+    // copy argument textarget
+    GLMessage_DataType *arg_textarget = glmsg.add_args();
+    arg_textarget->set_isarray(false);
+    arg_textarget->set_type(GLMessage::DataType::ENUM);
+    arg_textarget->add_intvalue((int)textarget);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::INT);
+    arg_texture->add_intvalue(texture);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFramebufferTexture2D(target, attachment, textarget, texture, level);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFrontFace(GLenum mode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFrontFace);
+
+    // copy argument mode
+    GLMessage_DataType *arg_mode = glmsg.add_args();
+    arg_mode->set_isarray(false);
+    arg_mode->set_type(GLMessage::DataType::ENUM);
+    arg_mode->add_intvalue((int)mode);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFrontFace(mode);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenBuffers(GLsizei n, GLuint* buffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGenBuffers);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument buffers
+    GLMessage_DataType *arg_buffers = glmsg.add_args();
+    arg_buffers->set_isarray(false);
+    arg_buffers->set_type(GLMessage::DataType::INT);
+    arg_buffers->add_intvalue((int)buffers);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGenBuffers(n, buffers);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenerateMipmap(GLenum target) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGenerateMipmap);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGenerateMipmap(target);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenFramebuffers(GLsizei n, GLuint* framebuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGenFramebuffers);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument framebuffers
+    GLMessage_DataType *arg_framebuffers = glmsg.add_args();
+    arg_framebuffers->set_isarray(false);
+    arg_framebuffers->set_type(GLMessage::DataType::INT);
+    arg_framebuffers->add_intvalue((int)framebuffers);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGenFramebuffers(n, framebuffers);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenRenderbuffers(GLsizei n, GLuint* renderbuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGenRenderbuffers);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument renderbuffers
+    GLMessage_DataType *arg_renderbuffers = glmsg.add_args();
+    arg_renderbuffers->set_isarray(false);
+    arg_renderbuffers->set_type(GLMessage::DataType::INT);
+    arg_renderbuffers->add_intvalue((int)renderbuffers);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGenRenderbuffers(n, renderbuffers);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenTextures(GLsizei n, GLuint* textures) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGenTextures);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument textures
+    GLMessage_DataType *arg_textures = glmsg.add_args();
+    arg_textures->set_isarray(false);
+    arg_textures->set_type(GLMessage::DataType::INT);
+    arg_textures->add_intvalue((int)textures);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGenTextures(n, textures);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetActiveAttrib);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument index
+    GLMessage_DataType *arg_index = glmsg.add_args();
+    arg_index->set_isarray(false);
+    arg_index->set_type(GLMessage::DataType::INT);
+    arg_index->add_intvalue(index);
+
+    // copy argument bufsize
+    GLMessage_DataType *arg_bufsize = glmsg.add_args();
+    arg_bufsize->set_isarray(false);
+    arg_bufsize->set_type(GLMessage::DataType::INT);
+    arg_bufsize->add_intvalue(bufsize);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue((int)length);
+
+    // copy argument size
+    GLMessage_DataType *arg_size = glmsg.add_args();
+    arg_size->set_isarray(false);
+    arg_size->set_type(GLMessage::DataType::INT);
+    arg_size->add_intvalue((int)size);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::INT);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument name
+    GLMessage_DataType *arg_name = glmsg.add_args();
+    arg_name->set_isarray(false);
+    arg_name->set_type(GLMessage::DataType::INT);
+    arg_name->add_intvalue((int)name);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetActiveAttrib(program, index, bufsize, length, size, type, name);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetActiveUniform);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument index
+    GLMessage_DataType *arg_index = glmsg.add_args();
+    arg_index->set_isarray(false);
+    arg_index->set_type(GLMessage::DataType::INT);
+    arg_index->add_intvalue(index);
+
+    // copy argument bufsize
+    GLMessage_DataType *arg_bufsize = glmsg.add_args();
+    arg_bufsize->set_isarray(false);
+    arg_bufsize->set_type(GLMessage::DataType::INT);
+    arg_bufsize->add_intvalue(bufsize);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue((int)length);
+
+    // copy argument size
+    GLMessage_DataType *arg_size = glmsg.add_args();
+    arg_size->set_isarray(false);
+    arg_size->set_type(GLMessage::DataType::INT);
+    arg_size->add_intvalue((int)size);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::INT);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument name
+    GLMessage_DataType *arg_name = glmsg.add_args();
+    arg_name->set_isarray(false);
+    arg_name->set_type(GLMessage::DataType::INT);
+    arg_name->add_intvalue((int)name);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetActiveUniform(program, index, bufsize, length, size, type, name);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetAttachedShaders);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument maxcount
+    GLMessage_DataType *arg_maxcount = glmsg.add_args();
+    arg_maxcount->set_isarray(false);
+    arg_maxcount->set_type(GLMessage::DataType::INT);
+    arg_maxcount->add_intvalue(maxcount);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue((int)count);
+
+    // copy argument shaders
+    GLMessage_DataType *arg_shaders = glmsg.add_args();
+    arg_shaders->set_isarray(false);
+    arg_shaders->set_type(GLMessage::DataType::INT);
+    arg_shaders->add_intvalue((int)shaders);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetAttachedShaders(program, maxcount, count, shaders);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+int GLTrace_glGetAttribLocation(GLuint program, const GLchar* name) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetAttribLocation);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument name
+    GLMessage_DataType *arg_name = glmsg.add_args();
+    arg_name->set_isarray(false);
+    arg_name->set_type(GLMessage::DataType::INT);
+    arg_name->add_intvalue((int)name);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    int retValue = glContext->hooks->gl.glGetAttribLocation(program, name);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::INT);
+    rt->add_intvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glGetBooleanv(GLenum pname, GLboolean* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetBooleanv);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetBooleanv(pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetBufferParameteriv);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetBufferParameteriv(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLenum GLTrace_glGetError(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetError);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLenum retValue = glContext->hooks->gl.glGetError();
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::ENUM);
+    rt->add_intvalue((int)retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glGetFloatv(GLenum pname, GLfloat* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetFloatv);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetFloatv(pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetFramebufferAttachmentParameteriv);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument attachment
+    GLMessage_DataType *arg_attachment = glmsg.add_args();
+    arg_attachment->set_isarray(false);
+    arg_attachment->set_type(GLMessage::DataType::ENUM);
+    arg_attachment->add_intvalue((int)attachment);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetIntegerv(GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetIntegerv);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetIntegerv(pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetProgramiv(GLuint program, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetProgramiv);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetProgramiv(program, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetProgramInfoLog);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument bufsize
+    GLMessage_DataType *arg_bufsize = glmsg.add_args();
+    arg_bufsize->set_isarray(false);
+    arg_bufsize->set_type(GLMessage::DataType::INT);
+    arg_bufsize->add_intvalue(bufsize);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue((int)length);
+
+    // copy argument infolog
+    GLMessage_DataType *arg_infolog = glmsg.add_args();
+    arg_infolog->set_isarray(false);
+    arg_infolog->set_type(GLMessage::DataType::INT);
+    arg_infolog->add_intvalue((int)infolog);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetProgramInfoLog(program, bufsize, length, infolog);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetRenderbufferParameteriv);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetRenderbufferParameteriv(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetShaderiv(GLuint shader, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetShaderiv);
+
+    // copy argument shader
+    GLMessage_DataType *arg_shader = glmsg.add_args();
+    arg_shader->set_isarray(false);
+    arg_shader->set_type(GLMessage::DataType::INT);
+    arg_shader->add_intvalue(shader);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetShaderiv(shader, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetShaderInfoLog);
+
+    // copy argument shader
+    GLMessage_DataType *arg_shader = glmsg.add_args();
+    arg_shader->set_isarray(false);
+    arg_shader->set_type(GLMessage::DataType::INT);
+    arg_shader->add_intvalue(shader);
+
+    // copy argument bufsize
+    GLMessage_DataType *arg_bufsize = glmsg.add_args();
+    arg_bufsize->set_isarray(false);
+    arg_bufsize->set_type(GLMessage::DataType::INT);
+    arg_bufsize->add_intvalue(bufsize);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue((int)length);
+
+    // copy argument infolog
+    GLMessage_DataType *arg_infolog = glmsg.add_args();
+    arg_infolog->set_isarray(false);
+    arg_infolog->set_type(GLMessage::DataType::INT);
+    arg_infolog->add_intvalue((int)infolog);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetShaderInfoLog(shader, bufsize, length, infolog);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetShaderPrecisionFormat);
+
+    // copy argument shadertype
+    GLMessage_DataType *arg_shadertype = glmsg.add_args();
+    arg_shadertype->set_isarray(false);
+    arg_shadertype->set_type(GLMessage::DataType::ENUM);
+    arg_shadertype->add_intvalue((int)shadertype);
+
+    // copy argument precisiontype
+    GLMessage_DataType *arg_precisiontype = glmsg.add_args();
+    arg_precisiontype->set_isarray(false);
+    arg_precisiontype->set_type(GLMessage::DataType::ENUM);
+    arg_precisiontype->add_intvalue((int)precisiontype);
+
+    // copy argument range
+    GLMessage_DataType *arg_range = glmsg.add_args();
+    arg_range->set_isarray(false);
+    arg_range->set_type(GLMessage::DataType::INT);
+    arg_range->add_intvalue((int)range);
+
+    // copy argument precision
+    GLMessage_DataType *arg_precision = glmsg.add_args();
+    arg_precision->set_isarray(false);
+    arg_precision->set_type(GLMessage::DataType::INT);
+    arg_precision->add_intvalue((int)precision);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetShaderSource);
+
+    // copy argument shader
+    GLMessage_DataType *arg_shader = glmsg.add_args();
+    arg_shader->set_isarray(false);
+    arg_shader->set_type(GLMessage::DataType::INT);
+    arg_shader->add_intvalue(shader);
+
+    // copy argument bufsize
+    GLMessage_DataType *arg_bufsize = glmsg.add_args();
+    arg_bufsize->set_isarray(false);
+    arg_bufsize->set_type(GLMessage::DataType::INT);
+    arg_bufsize->add_intvalue(bufsize);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue((int)length);
+
+    // copy argument source
+    GLMessage_DataType *arg_source = glmsg.add_args();
+    arg_source->set_isarray(false);
+    arg_source->set_type(GLMessage::DataType::INT);
+    arg_source->add_intvalue((int)source);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetShaderSource(shader, bufsize, length, source);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+const GLubyte* GLTrace_glGetString(GLenum name) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetString);
+
+    // copy argument name
+    GLMessage_DataType *arg_name = glmsg.add_args();
+    arg_name->set_isarray(false);
+    arg_name->set_type(GLMessage::DataType::ENUM);
+    arg_name->add_intvalue((int)name);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    const GLubyte* retValue = glContext->hooks->gl.glGetString(name);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::INT);
+    rt->add_intvalue((int)retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetTexParameterfv);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetTexParameterfv(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexParameteriv(GLenum target, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetTexParameteriv);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetTexParameteriv(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetUniformfv(GLuint program, GLint location, GLfloat* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetUniformfv);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetUniformfv(program, location, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetUniformiv(GLuint program, GLint location, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetUniformiv);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetUniformiv(program, location, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+int GLTrace_glGetUniformLocation(GLuint program, const GLchar* name) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetUniformLocation);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument name
+    GLMessage_DataType *arg_name = glmsg.add_args();
+    arg_name->set_isarray(false);
+    arg_name->set_type(GLMessage::DataType::INT);
+    arg_name->add_intvalue((int)name);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    int retValue = glContext->hooks->gl.glGetUniformLocation(program, name);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::INT);
+    rt->add_intvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetVertexAttribfv);
+
+    // copy argument index
+    GLMessage_DataType *arg_index = glmsg.add_args();
+    arg_index->set_isarray(false);
+    arg_index->set_type(GLMessage::DataType::INT);
+    arg_index->add_intvalue(index);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetVertexAttribfv(index, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetVertexAttribiv);
+
+    // copy argument index
+    GLMessage_DataType *arg_index = glmsg.add_args();
+    arg_index->set_isarray(false);
+    arg_index->set_type(GLMessage::DataType::INT);
+    arg_index->add_intvalue(index);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetVertexAttribiv(index, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetVertexAttribPointerv);
+
+    // copy argument index
+    GLMessage_DataType *arg_index = glmsg.add_args();
+    arg_index->set_isarray(false);
+    arg_index->set_type(GLMessage::DataType::INT);
+    arg_index->add_intvalue(index);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument pointer
+    GLMessage_DataType *arg_pointer = glmsg.add_args();
+    arg_pointer->set_isarray(false);
+    arg_pointer->set_type(GLMessage::DataType::INT);
+    arg_pointer->add_intvalue((int)pointer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetVertexAttribPointerv(index, pname, pointer);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glHint(GLenum target, GLenum mode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glHint);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument mode
+    GLMessage_DataType *arg_mode = glmsg.add_args();
+    arg_mode->set_isarray(false);
+    arg_mode->set_type(GLMessage::DataType::ENUM);
+    arg_mode->add_intvalue((int)mode);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glHint(target, mode);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLboolean GLTrace_glIsBuffer(GLuint buffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glIsBuffer);
+
+    // copy argument buffer
+    GLMessage_DataType *arg_buffer = glmsg.add_args();
+    arg_buffer->set_isarray(false);
+    arg_buffer->set_type(GLMessage::DataType::INT);
+    arg_buffer->add_intvalue(buffer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glIsBuffer(buffer);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLboolean GLTrace_glIsEnabled(GLenum cap) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glIsEnabled);
+
+    // copy argument cap
+    GLMessage_DataType *arg_cap = glmsg.add_args();
+    arg_cap->set_isarray(false);
+    arg_cap->set_type(GLMessage::DataType::ENUM);
+    arg_cap->add_intvalue((int)cap);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glIsEnabled(cap);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLboolean GLTrace_glIsFramebuffer(GLuint framebuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glIsFramebuffer);
+
+    // copy argument framebuffer
+    GLMessage_DataType *arg_framebuffer = glmsg.add_args();
+    arg_framebuffer->set_isarray(false);
+    arg_framebuffer->set_type(GLMessage::DataType::INT);
+    arg_framebuffer->add_intvalue(framebuffer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glIsFramebuffer(framebuffer);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLboolean GLTrace_glIsProgram(GLuint program) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glIsProgram);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glIsProgram(program);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLboolean GLTrace_glIsRenderbuffer(GLuint renderbuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glIsRenderbuffer);
+
+    // copy argument renderbuffer
+    GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
+    arg_renderbuffer->set_isarray(false);
+    arg_renderbuffer->set_type(GLMessage::DataType::INT);
+    arg_renderbuffer->add_intvalue(renderbuffer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glIsRenderbuffer(renderbuffer);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLboolean GLTrace_glIsShader(GLuint shader) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glIsShader);
+
+    // copy argument shader
+    GLMessage_DataType *arg_shader = glmsg.add_args();
+    arg_shader->set_isarray(false);
+    arg_shader->set_type(GLMessage::DataType::INT);
+    arg_shader->add_intvalue(shader);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glIsShader(shader);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLboolean GLTrace_glIsTexture(GLuint texture) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glIsTexture);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::INT);
+    arg_texture->add_intvalue(texture);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glIsTexture(texture);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glLineWidth(GLfloat width) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLineWidth);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::FLOAT);
+    arg_width->add_floatvalue(width);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLineWidth(width);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLinkProgram(GLuint program) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLinkProgram);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLinkProgram(program);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPixelStorei(GLenum pname, GLint param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPixelStorei);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPixelStorei(pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPolygonOffset(GLfloat factor, GLfloat units) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPolygonOffset);
+
+    // copy argument factor
+    GLMessage_DataType *arg_factor = glmsg.add_args();
+    arg_factor->set_isarray(false);
+    arg_factor->set_type(GLMessage::DataType::FLOAT);
+    arg_factor->add_floatvalue(factor);
+
+    // copy argument units
+    GLMessage_DataType *arg_units = glmsg.add_args();
+    arg_units->set_isarray(false);
+    arg_units->set_type(GLMessage::DataType::FLOAT);
+    arg_units->add_floatvalue(units);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPolygonOffset(factor, units);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glReadPixels);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument format
+    GLMessage_DataType *arg_format = glmsg.add_args();
+    arg_format->set_isarray(false);
+    arg_format->set_type(GLMessage::DataType::ENUM);
+    arg_format->add_intvalue((int)format);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument pixels
+    GLMessage_DataType *arg_pixels = glmsg.add_args();
+    arg_pixels->set_isarray(false);
+    arg_pixels->set_type(GLMessage::DataType::INT);
+    arg_pixels->add_intvalue((int)pixels);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glReadPixels(x, y, width, height, format, type, pixels);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glReleaseShaderCompiler(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glReleaseShaderCompiler);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glReleaseShaderCompiler();
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glRenderbufferStorage);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glRenderbufferStorage(target, internalformat, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glSampleCoverage(GLclampf value, GLboolean invert) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glSampleCoverage);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::FLOAT);
+    arg_value->add_floatvalue(value);
+
+    // copy argument invert
+    GLMessage_DataType *arg_invert = glmsg.add_args();
+    arg_invert->set_isarray(false);
+    arg_invert->set_type(GLMessage::DataType::BOOL);
+    arg_invert->add_boolvalue(invert);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glSampleCoverage(value, invert);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glScissor(GLint x, GLint y, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glScissor);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glScissor(x, y, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glShaderBinary);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument shaders
+    GLMessage_DataType *arg_shaders = glmsg.add_args();
+    arg_shaders->set_isarray(false);
+    arg_shaders->set_type(GLMessage::DataType::INT);
+    arg_shaders->add_intvalue((int)shaders);
+
+    // copy argument binaryformat
+    GLMessage_DataType *arg_binaryformat = glmsg.add_args();
+    arg_binaryformat->set_isarray(false);
+    arg_binaryformat->set_type(GLMessage::DataType::ENUM);
+    arg_binaryformat->add_intvalue((int)binaryformat);
+
+    // copy argument binary
+    GLMessage_DataType *arg_binary = glmsg.add_args();
+    arg_binary->set_isarray(false);
+    arg_binary->set_type(GLMessage::DataType::INT);
+    arg_binary->add_intvalue((int)binary);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue(length);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glShaderBinary(n, shaders, binaryformat, binary, length);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glShaderSource(GLuint shader, GLsizei count, const GLchar** string, const GLint* length) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glShaderSource);
+
+    // copy argument shader
+    GLMessage_DataType *arg_shader = glmsg.add_args();
+    arg_shader->set_isarray(false);
+    arg_shader->set_type(GLMessage::DataType::INT);
+    arg_shader->add_intvalue(shader);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument string
+    GLMessage_DataType *arg_string = glmsg.add_args();
+    arg_string->set_isarray(false);
+    arg_string->set_type(GLMessage::DataType::INT);
+    arg_string->add_intvalue((int)string);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue((int)length);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glShaderSource(shader, count, string, length);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glStencilFunc(GLenum func, GLint ref, GLuint mask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glStencilFunc);
+
+    // copy argument func
+    GLMessage_DataType *arg_func = glmsg.add_args();
+    arg_func->set_isarray(false);
+    arg_func->set_type(GLMessage::DataType::ENUM);
+    arg_func->add_intvalue((int)func);
+
+    // copy argument ref
+    GLMessage_DataType *arg_ref = glmsg.add_args();
+    arg_ref->set_isarray(false);
+    arg_ref->set_type(GLMessage::DataType::INT);
+    arg_ref->add_intvalue(ref);
+
+    // copy argument mask
+    GLMessage_DataType *arg_mask = glmsg.add_args();
+    arg_mask->set_isarray(false);
+    arg_mask->set_type(GLMessage::DataType::INT);
+    arg_mask->add_intvalue(mask);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glStencilFunc(func, ref, mask);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glStencilFuncSeparate);
+
+    // copy argument face
+    GLMessage_DataType *arg_face = glmsg.add_args();
+    arg_face->set_isarray(false);
+    arg_face->set_type(GLMessage::DataType::ENUM);
+    arg_face->add_intvalue((int)face);
+
+    // copy argument func
+    GLMessage_DataType *arg_func = glmsg.add_args();
+    arg_func->set_isarray(false);
+    arg_func->set_type(GLMessage::DataType::ENUM);
+    arg_func->add_intvalue((int)func);
+
+    // copy argument ref
+    GLMessage_DataType *arg_ref = glmsg.add_args();
+    arg_ref->set_isarray(false);
+    arg_ref->set_type(GLMessage::DataType::INT);
+    arg_ref->add_intvalue(ref);
+
+    // copy argument mask
+    GLMessage_DataType *arg_mask = glmsg.add_args();
+    arg_mask->set_isarray(false);
+    arg_mask->set_type(GLMessage::DataType::INT);
+    arg_mask->add_intvalue(mask);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glStencilFuncSeparate(face, func, ref, mask);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glStencilMask(GLuint mask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glStencilMask);
+
+    // copy argument mask
+    GLMessage_DataType *arg_mask = glmsg.add_args();
+    arg_mask->set_isarray(false);
+    arg_mask->set_type(GLMessage::DataType::INT);
+    arg_mask->add_intvalue(mask);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glStencilMask(mask);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glStencilMaskSeparate(GLenum face, GLuint mask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glStencilMaskSeparate);
+
+    // copy argument face
+    GLMessage_DataType *arg_face = glmsg.add_args();
+    arg_face->set_isarray(false);
+    arg_face->set_type(GLMessage::DataType::ENUM);
+    arg_face->add_intvalue((int)face);
+
+    // copy argument mask
+    GLMessage_DataType *arg_mask = glmsg.add_args();
+    arg_mask->set_isarray(false);
+    arg_mask->set_type(GLMessage::DataType::INT);
+    arg_mask->add_intvalue(mask);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glStencilMaskSeparate(face, mask);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glStencilOp);
+
+    // copy argument fail
+    GLMessage_DataType *arg_fail = glmsg.add_args();
+    arg_fail->set_isarray(false);
+    arg_fail->set_type(GLMessage::DataType::ENUM);
+    arg_fail->add_intvalue((int)fail);
+
+    // copy argument zfail
+    GLMessage_DataType *arg_zfail = glmsg.add_args();
+    arg_zfail->set_isarray(false);
+    arg_zfail->set_type(GLMessage::DataType::ENUM);
+    arg_zfail->add_intvalue((int)zfail);
+
+    // copy argument zpass
+    GLMessage_DataType *arg_zpass = glmsg.add_args();
+    arg_zpass->set_isarray(false);
+    arg_zpass->set_type(GLMessage::DataType::ENUM);
+    arg_zpass->add_intvalue((int)zpass);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glStencilOp(fail, zfail, zpass);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glStencilOpSeparate);
+
+    // copy argument face
+    GLMessage_DataType *arg_face = glmsg.add_args();
+    arg_face->set_isarray(false);
+    arg_face->set_type(GLMessage::DataType::ENUM);
+    arg_face->add_intvalue((int)face);
+
+    // copy argument fail
+    GLMessage_DataType *arg_fail = glmsg.add_args();
+    arg_fail->set_isarray(false);
+    arg_fail->set_type(GLMessage::DataType::ENUM);
+    arg_fail->add_intvalue((int)fail);
+
+    // copy argument zfail
+    GLMessage_DataType *arg_zfail = glmsg.add_args();
+    arg_zfail->set_isarray(false);
+    arg_zfail->set_type(GLMessage::DataType::ENUM);
+    arg_zfail->add_intvalue((int)zfail);
+
+    // copy argument zpass
+    GLMessage_DataType *arg_zpass = glmsg.add_args();
+    arg_zpass->set_isarray(false);
+    arg_zpass->set_type(GLMessage::DataType::ENUM);
+    arg_zpass->add_intvalue((int)zpass);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glStencilOpSeparate(face, fail, zfail, zpass);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexImage2D);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::INT);
+    arg_internalformat->add_intvalue(internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument border
+    GLMessage_DataType *arg_border = glmsg.add_args();
+    arg_border->set_isarray(false);
+    arg_border->set_type(GLMessage::DataType::INT);
+    arg_border->add_intvalue(border);
+
+    // copy argument format
+    GLMessage_DataType *arg_format = glmsg.add_args();
+    arg_format->set_isarray(false);
+    arg_format->set_type(GLMessage::DataType::ENUM);
+    arg_format->add_intvalue((int)format);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument pixels
+    GLMessage_DataType *arg_pixels = glmsg.add_args();
+    arg_pixels->set_isarray(false);
+    arg_pixels->set_type(GLMessage::DataType::INT);
+    arg_pixels->add_intvalue((int)pixels);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexParameterf(GLenum target, GLenum pname, GLfloat param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexParameterf);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::FLOAT);
+    arg_param->add_floatvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexParameterf(target, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexParameterfv);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexParameterfv(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexParameteri(GLenum target, GLenum pname, GLint param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexParameteri);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexParameteri(target, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexParameteriv(GLenum target, GLenum pname, const GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexParameteriv);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexParameteriv(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexSubImage2D);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument xoffset
+    GLMessage_DataType *arg_xoffset = glmsg.add_args();
+    arg_xoffset->set_isarray(false);
+    arg_xoffset->set_type(GLMessage::DataType::INT);
+    arg_xoffset->add_intvalue(xoffset);
+
+    // copy argument yoffset
+    GLMessage_DataType *arg_yoffset = glmsg.add_args();
+    arg_yoffset->set_isarray(false);
+    arg_yoffset->set_type(GLMessage::DataType::INT);
+    arg_yoffset->add_intvalue(yoffset);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument format
+    GLMessage_DataType *arg_format = glmsg.add_args();
+    arg_format->set_isarray(false);
+    arg_format->set_type(GLMessage::DataType::ENUM);
+    arg_format->add_intvalue((int)format);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument pixels
+    GLMessage_DataType *arg_pixels = glmsg.add_args();
+    arg_pixels->set_isarray(false);
+    arg_pixels->set_type(GLMessage::DataType::INT);
+    arg_pixels->add_intvalue((int)pixels);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform1f(GLint location, GLfloat x) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniform1f);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniform1f(location, x);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform1fv(GLint location, GLsizei count, const GLfloat* v) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniform1fv);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument v
+    GLMessage_DataType *arg_v = glmsg.add_args();
+    arg_v->set_isarray(false);
+    arg_v->set_type(GLMessage::DataType::INT);
+    arg_v->add_intvalue((int)v);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniform1fv(location, count, v);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform1i(GLint location, GLint x) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniform1i);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniform1i(location, x);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform1iv(GLint location, GLsizei count, const GLint* v) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniform1iv);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument v
+    GLMessage_DataType *arg_v = glmsg.add_args();
+    arg_v->set_isarray(false);
+    arg_v->set_type(GLMessage::DataType::INT);
+    arg_v->add_intvalue((int)v);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniform1iv(location, count, v);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform2f(GLint location, GLfloat x, GLfloat y) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniform2f);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::FLOAT);
+    arg_y->add_floatvalue(y);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniform2f(location, x, y);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform2fv(GLint location, GLsizei count, const GLfloat* v) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniform2fv);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument v
+    GLMessage_DataType *arg_v = glmsg.add_args();
+    arg_v->set_isarray(false);
+    arg_v->set_type(GLMessage::DataType::INT);
+    arg_v->add_intvalue((int)v);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniform2fv(location, count, v);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform2i(GLint location, GLint x, GLint y) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniform2i);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniform2i(location, x, y);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform2iv(GLint location, GLsizei count, const GLint* v) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniform2iv);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument v
+    GLMessage_DataType *arg_v = glmsg.add_args();
+    arg_v->set_isarray(false);
+    arg_v->set_type(GLMessage::DataType::INT);
+    arg_v->add_intvalue((int)v);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniform2iv(location, count, v);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniform3f);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::FLOAT);
+    arg_y->add_floatvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::FLOAT);
+    arg_z->add_floatvalue(z);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniform3f(location, x, y, z);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform3fv(GLint location, GLsizei count, const GLfloat* v) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniform3fv);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument v
+    GLMessage_DataType *arg_v = glmsg.add_args();
+    arg_v->set_isarray(false);
+    arg_v->set_type(GLMessage::DataType::INT);
+    arg_v->add_intvalue((int)v);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniform3fv(location, count, v);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform3i(GLint location, GLint x, GLint y, GLint z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniform3i);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::INT);
+    arg_z->add_intvalue(z);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniform3i(location, x, y, z);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform3iv(GLint location, GLsizei count, const GLint* v) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniform3iv);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument v
+    GLMessage_DataType *arg_v = glmsg.add_args();
+    arg_v->set_isarray(false);
+    arg_v->set_type(GLMessage::DataType::INT);
+    arg_v->add_intvalue((int)v);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniform3iv(location, count, v);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniform4f);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::FLOAT);
+    arg_y->add_floatvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::FLOAT);
+    arg_z->add_floatvalue(z);
+
+    // copy argument w
+    GLMessage_DataType *arg_w = glmsg.add_args();
+    arg_w->set_isarray(false);
+    arg_w->set_type(GLMessage::DataType::FLOAT);
+    arg_w->add_floatvalue(w);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniform4f(location, x, y, z, w);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform4fv(GLint location, GLsizei count, const GLfloat* v) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniform4fv);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument v
+    GLMessage_DataType *arg_v = glmsg.add_args();
+    arg_v->set_isarray(false);
+    arg_v->set_type(GLMessage::DataType::INT);
+    arg_v->add_intvalue((int)v);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniform4fv(location, count, v);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniform4i);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::INT);
+    arg_z->add_intvalue(z);
+
+    // copy argument w
+    GLMessage_DataType *arg_w = glmsg.add_args();
+    arg_w->set_isarray(false);
+    arg_w->set_type(GLMessage::DataType::INT);
+    arg_w->add_intvalue(w);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniform4i(location, x, y, z, w);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniform4iv(GLint location, GLsizei count, const GLint* v) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniform4iv);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument v
+    GLMessage_DataType *arg_v = glmsg.add_args();
+    arg_v->set_isarray(false);
+    arg_v->set_type(GLMessage::DataType::INT);
+    arg_v->add_intvalue((int)v);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniform4iv(location, count, v);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniformMatrix2fv);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument transpose
+    GLMessage_DataType *arg_transpose = glmsg.add_args();
+    arg_transpose->set_isarray(false);
+    arg_transpose->set_type(GLMessage::DataType::BOOL);
+    arg_transpose->add_boolvalue(transpose);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniformMatrix2fv(location, count, transpose, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniformMatrix3fv);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument transpose
+    GLMessage_DataType *arg_transpose = glmsg.add_args();
+    arg_transpose->set_isarray(false);
+    arg_transpose->set_type(GLMessage::DataType::BOOL);
+    arg_transpose->add_boolvalue(transpose);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniformMatrix3fv(location, count, transpose, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUniformMatrix4fv);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument transpose
+    GLMessage_DataType *arg_transpose = glmsg.add_args();
+    arg_transpose->set_isarray(false);
+    arg_transpose->set_type(GLMessage::DataType::BOOL);
+    arg_transpose->add_boolvalue(transpose);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUniformMatrix4fv(location, count, transpose, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUseProgram(GLuint program) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUseProgram);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUseProgram(program);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glValidateProgram(GLuint program) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glValidateProgram);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glValidateProgram(program);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttrib1f(GLuint indx, GLfloat x) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glVertexAttrib1f);
+
+    // copy argument indx
+    GLMessage_DataType *arg_indx = glmsg.add_args();
+    arg_indx->set_isarray(false);
+    arg_indx->set_type(GLMessage::DataType::INT);
+    arg_indx->add_intvalue(indx);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glVertexAttrib1f(indx, x);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttrib1fv(GLuint indx, const GLfloat* values) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glVertexAttrib1fv);
+
+    // copy argument indx
+    GLMessage_DataType *arg_indx = glmsg.add_args();
+    arg_indx->set_isarray(false);
+    arg_indx->set_type(GLMessage::DataType::INT);
+    arg_indx->add_intvalue(indx);
+
+    // copy argument values
+    GLMessage_DataType *arg_values = glmsg.add_args();
+    arg_values->set_isarray(false);
+    arg_values->set_type(GLMessage::DataType::INT);
+    arg_values->add_intvalue((int)values);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glVertexAttrib1fv(indx, values);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glVertexAttrib2f);
+
+    // copy argument indx
+    GLMessage_DataType *arg_indx = glmsg.add_args();
+    arg_indx->set_isarray(false);
+    arg_indx->set_type(GLMessage::DataType::INT);
+    arg_indx->add_intvalue(indx);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::FLOAT);
+    arg_y->add_floatvalue(y);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glVertexAttrib2f(indx, x, y);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttrib2fv(GLuint indx, const GLfloat* values) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glVertexAttrib2fv);
+
+    // copy argument indx
+    GLMessage_DataType *arg_indx = glmsg.add_args();
+    arg_indx->set_isarray(false);
+    arg_indx->set_type(GLMessage::DataType::INT);
+    arg_indx->add_intvalue(indx);
+
+    // copy argument values
+    GLMessage_DataType *arg_values = glmsg.add_args();
+    arg_values->set_isarray(false);
+    arg_values->set_type(GLMessage::DataType::INT);
+    arg_values->add_intvalue((int)values);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glVertexAttrib2fv(indx, values);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glVertexAttrib3f);
+
+    // copy argument indx
+    GLMessage_DataType *arg_indx = glmsg.add_args();
+    arg_indx->set_isarray(false);
+    arg_indx->set_type(GLMessage::DataType::INT);
+    arg_indx->add_intvalue(indx);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::FLOAT);
+    arg_y->add_floatvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::FLOAT);
+    arg_z->add_floatvalue(z);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glVertexAttrib3f(indx, x, y, z);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttrib3fv(GLuint indx, const GLfloat* values) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glVertexAttrib3fv);
+
+    // copy argument indx
+    GLMessage_DataType *arg_indx = glmsg.add_args();
+    arg_indx->set_isarray(false);
+    arg_indx->set_type(GLMessage::DataType::INT);
+    arg_indx->add_intvalue(indx);
+
+    // copy argument values
+    GLMessage_DataType *arg_values = glmsg.add_args();
+    arg_values->set_isarray(false);
+    arg_values->set_type(GLMessage::DataType::INT);
+    arg_values->add_intvalue((int)values);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glVertexAttrib3fv(indx, values);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glVertexAttrib4f);
+
+    // copy argument indx
+    GLMessage_DataType *arg_indx = glmsg.add_args();
+    arg_indx->set_isarray(false);
+    arg_indx->set_type(GLMessage::DataType::INT);
+    arg_indx->add_intvalue(indx);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::FLOAT);
+    arg_y->add_floatvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::FLOAT);
+    arg_z->add_floatvalue(z);
+
+    // copy argument w
+    GLMessage_DataType *arg_w = glmsg.add_args();
+    arg_w->set_isarray(false);
+    arg_w->set_type(GLMessage::DataType::FLOAT);
+    arg_w->add_floatvalue(w);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glVertexAttrib4f(indx, x, y, z, w);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttrib4fv(GLuint indx, const GLfloat* values) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glVertexAttrib4fv);
+
+    // copy argument indx
+    GLMessage_DataType *arg_indx = glmsg.add_args();
+    arg_indx->set_isarray(false);
+    arg_indx->set_type(GLMessage::DataType::INT);
+    arg_indx->add_intvalue(indx);
+
+    // copy argument values
+    GLMessage_DataType *arg_values = glmsg.add_args();
+    arg_values->set_isarray(false);
+    arg_values->set_type(GLMessage::DataType::INT);
+    arg_values->add_intvalue((int)values);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glVertexAttrib4fv(indx, values);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glVertexAttribPointer);
+
+    // copy argument indx
+    GLMessage_DataType *arg_indx = glmsg.add_args();
+    arg_indx->set_isarray(false);
+    arg_indx->set_type(GLMessage::DataType::INT);
+    arg_indx->add_intvalue(indx);
+
+    // copy argument size
+    GLMessage_DataType *arg_size = glmsg.add_args();
+    arg_size->set_isarray(false);
+    arg_size->set_type(GLMessage::DataType::INT);
+    arg_size->add_intvalue(size);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument normalized
+    GLMessage_DataType *arg_normalized = glmsg.add_args();
+    arg_normalized->set_isarray(false);
+    arg_normalized->set_type(GLMessage::DataType::BOOL);
+    arg_normalized->add_boolvalue(normalized);
+
+    // copy argument stride
+    GLMessage_DataType *arg_stride = glmsg.add_args();
+    arg_stride->set_isarray(false);
+    arg_stride->set_type(GLMessage::DataType::INT);
+    arg_stride->add_intvalue(stride);
+
+    // copy argument ptr
+    GLMessage_DataType *arg_ptr = glmsg.add_args();
+    arg_ptr->set_isarray(false);
+    arg_ptr->set_type(GLMessage::DataType::INT);
+    arg_ptr->add_intvalue((int)ptr);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glViewport(GLint x, GLint y, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glViewport);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glViewport(x, y, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+
+// Definitions for GL2Ext APIs
+
+void GLTrace_glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glEGLImageTargetTexture2DOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument image
+    GLMessage_DataType *arg_image = glmsg.add_args();
+    arg_image->set_isarray(false);
+    arg_image->set_type(GLMessage::DataType::INT);
+    arg_image->add_intvalue((int)image);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glEGLImageTargetTexture2DOES(target, image);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glEGLImageTargetRenderbufferStorageOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument image
+    GLMessage_DataType *arg_image = glmsg.add_args();
+    arg_image->set_isarray(false);
+    arg_image->set_type(GLMessage::DataType::INT);
+    arg_image->add_intvalue((int)image);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glEGLImageTargetRenderbufferStorageOES(target, image);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetProgramBinaryOES);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument bufSize
+    GLMessage_DataType *arg_bufSize = glmsg.add_args();
+    arg_bufSize->set_isarray(false);
+    arg_bufSize->set_type(GLMessage::DataType::INT);
+    arg_bufSize->add_intvalue(bufSize);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue((int)length);
+
+    // copy argument binaryFormat
+    GLMessage_DataType *arg_binaryFormat = glmsg.add_args();
+    arg_binaryFormat->set_isarray(false);
+    arg_binaryFormat->set_type(GLMessage::DataType::INT);
+    arg_binaryFormat->add_intvalue((int)binaryFormat);
+
+    // copy argument binary
+    GLMessage_DataType *arg_binary = glmsg.add_args();
+    arg_binary->set_isarray(false);
+    arg_binary->set_type(GLMessage::DataType::INT);
+    arg_binary->add_intvalue((int)binary);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetProgramBinaryOES(program, bufSize, length, binaryFormat, binary);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramBinaryOES(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramBinaryOES);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument binaryFormat
+    GLMessage_DataType *arg_binaryFormat = glmsg.add_args();
+    arg_binaryFormat->set_isarray(false);
+    arg_binaryFormat->set_type(GLMessage::DataType::ENUM);
+    arg_binaryFormat->add_intvalue((int)binaryFormat);
+
+    // copy argument binary
+    GLMessage_DataType *arg_binary = glmsg.add_args();
+    arg_binary->set_isarray(false);
+    arg_binary->set_type(GLMessage::DataType::INT);
+    arg_binary->add_intvalue((int)binary);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue(length);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramBinaryOES(program, binaryFormat, binary, length);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void* GLTrace_glMapBufferOES(GLenum target, GLenum access) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMapBufferOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument access
+    GLMessage_DataType *arg_access = glmsg.add_args();
+    arg_access->set_isarray(false);
+    arg_access->set_type(GLMessage::DataType::ENUM);
+    arg_access->add_intvalue((int)access);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    void* retValue = glContext->hooks->gl.glMapBufferOES(target, access);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::INT);
+    rt->add_intvalue((int)retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLboolean GLTrace_glUnmapBufferOES(GLenum target) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUnmapBufferOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glUnmapBufferOES(target);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glGetBufferPointervOES(GLenum target, GLenum pname, GLvoid** params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetBufferPointervOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetBufferPointervOES(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexImage3DOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument depth
+    GLMessage_DataType *arg_depth = glmsg.add_args();
+    arg_depth->set_isarray(false);
+    arg_depth->set_type(GLMessage::DataType::INT);
+    arg_depth->add_intvalue(depth);
+
+    // copy argument border
+    GLMessage_DataType *arg_border = glmsg.add_args();
+    arg_border->set_isarray(false);
+    arg_border->set_type(GLMessage::DataType::INT);
+    arg_border->add_intvalue(border);
+
+    // copy argument format
+    GLMessage_DataType *arg_format = glmsg.add_args();
+    arg_format->set_isarray(false);
+    arg_format->set_type(GLMessage::DataType::ENUM);
+    arg_format->add_intvalue((int)format);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument pixels
+    GLMessage_DataType *arg_pixels = glmsg.add_args();
+    arg_pixels->set_isarray(false);
+    arg_pixels->set_type(GLMessage::DataType::INT);
+    arg_pixels->add_intvalue((int)pixels);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexImage3DOES(target, level, internalformat, width, height, depth, border, format, type, pixels);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexSubImage3DOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument xoffset
+    GLMessage_DataType *arg_xoffset = glmsg.add_args();
+    arg_xoffset->set_isarray(false);
+    arg_xoffset->set_type(GLMessage::DataType::INT);
+    arg_xoffset->add_intvalue(xoffset);
+
+    // copy argument yoffset
+    GLMessage_DataType *arg_yoffset = glmsg.add_args();
+    arg_yoffset->set_isarray(false);
+    arg_yoffset->set_type(GLMessage::DataType::INT);
+    arg_yoffset->add_intvalue(yoffset);
+
+    // copy argument zoffset
+    GLMessage_DataType *arg_zoffset = glmsg.add_args();
+    arg_zoffset->set_isarray(false);
+    arg_zoffset->set_type(GLMessage::DataType::INT);
+    arg_zoffset->add_intvalue(zoffset);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument depth
+    GLMessage_DataType *arg_depth = glmsg.add_args();
+    arg_depth->set_isarray(false);
+    arg_depth->set_type(GLMessage::DataType::INT);
+    arg_depth->add_intvalue(depth);
+
+    // copy argument format
+    GLMessage_DataType *arg_format = glmsg.add_args();
+    arg_format->set_isarray(false);
+    arg_format->set_type(GLMessage::DataType::ENUM);
+    arg_format->add_intvalue((int)format);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument pixels
+    GLMessage_DataType *arg_pixels = glmsg.add_args();
+    arg_pixels->set_isarray(false);
+    arg_pixels->set_type(GLMessage::DataType::INT);
+    arg_pixels->add_intvalue((int)pixels);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCopyTexSubImage3DOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument xoffset
+    GLMessage_DataType *arg_xoffset = glmsg.add_args();
+    arg_xoffset->set_isarray(false);
+    arg_xoffset->set_type(GLMessage::DataType::INT);
+    arg_xoffset->add_intvalue(xoffset);
+
+    // copy argument yoffset
+    GLMessage_DataType *arg_yoffset = glmsg.add_args();
+    arg_yoffset->set_isarray(false);
+    arg_yoffset->set_type(GLMessage::DataType::INT);
+    arg_yoffset->add_intvalue(yoffset);
+
+    // copy argument zoffset
+    GLMessage_DataType *arg_zoffset = glmsg.add_args();
+    arg_zoffset->set_isarray(false);
+    arg_zoffset->set_type(GLMessage::DataType::INT);
+    arg_zoffset->add_intvalue(zoffset);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glCopyTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, x, y, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCompressedTexImage3DOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument depth
+    GLMessage_DataType *arg_depth = glmsg.add_args();
+    arg_depth->set_isarray(false);
+    arg_depth->set_type(GLMessage::DataType::INT);
+    arg_depth->add_intvalue(depth);
+
+    // copy argument border
+    GLMessage_DataType *arg_border = glmsg.add_args();
+    arg_border->set_isarray(false);
+    arg_border->set_type(GLMessage::DataType::INT);
+    arg_border->add_intvalue(border);
+
+    // copy argument imageSize
+    GLMessage_DataType *arg_imageSize = glmsg.add_args();
+    arg_imageSize->set_isarray(false);
+    arg_imageSize->set_type(GLMessage::DataType::INT);
+    arg_imageSize->add_intvalue(imageSize);
+
+    // copy argument data
+    GLMessage_DataType *arg_data = glmsg.add_args();
+    arg_data->set_isarray(false);
+    arg_data->set_type(GLMessage::DataType::INT);
+    arg_data->add_intvalue((int)data);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glCompressedTexImage3DOES(target, level, internalformat, width, height, depth, border, imageSize, data);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glCompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCompressedTexSubImage3DOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument xoffset
+    GLMessage_DataType *arg_xoffset = glmsg.add_args();
+    arg_xoffset->set_isarray(false);
+    arg_xoffset->set_type(GLMessage::DataType::INT);
+    arg_xoffset->add_intvalue(xoffset);
+
+    // copy argument yoffset
+    GLMessage_DataType *arg_yoffset = glmsg.add_args();
+    arg_yoffset->set_isarray(false);
+    arg_yoffset->set_type(GLMessage::DataType::INT);
+    arg_yoffset->add_intvalue(yoffset);
+
+    // copy argument zoffset
+    GLMessage_DataType *arg_zoffset = glmsg.add_args();
+    arg_zoffset->set_isarray(false);
+    arg_zoffset->set_type(GLMessage::DataType::INT);
+    arg_zoffset->add_intvalue(zoffset);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument depth
+    GLMessage_DataType *arg_depth = glmsg.add_args();
+    arg_depth->set_isarray(false);
+    arg_depth->set_type(GLMessage::DataType::INT);
+    arg_depth->add_intvalue(depth);
+
+    // copy argument format
+    GLMessage_DataType *arg_format = glmsg.add_args();
+    arg_format->set_isarray(false);
+    arg_format->set_type(GLMessage::DataType::ENUM);
+    arg_format->add_intvalue((int)format);
+
+    // copy argument imageSize
+    GLMessage_DataType *arg_imageSize = glmsg.add_args();
+    arg_imageSize->set_isarray(false);
+    arg_imageSize->set_type(GLMessage::DataType::INT);
+    arg_imageSize->add_intvalue(imageSize);
+
+    // copy argument data
+    GLMessage_DataType *arg_data = glmsg.add_args();
+    arg_data->set_isarray(false);
+    arg_data->set_type(GLMessage::DataType::INT);
+    arg_data->add_intvalue((int)data);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glCompressedTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFramebufferTexture3DOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument attachment
+    GLMessage_DataType *arg_attachment = glmsg.add_args();
+    arg_attachment->set_isarray(false);
+    arg_attachment->set_type(GLMessage::DataType::ENUM);
+    arg_attachment->add_intvalue((int)attachment);
+
+    // copy argument textarget
+    GLMessage_DataType *arg_textarget = glmsg.add_args();
+    arg_textarget->set_isarray(false);
+    arg_textarget->set_type(GLMessage::DataType::ENUM);
+    arg_textarget->add_intvalue((int)textarget);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::INT);
+    arg_texture->add_intvalue(texture);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument zoffset
+    GLMessage_DataType *arg_zoffset = glmsg.add_args();
+    arg_zoffset->set_isarray(false);
+    arg_zoffset->set_type(GLMessage::DataType::INT);
+    arg_zoffset->add_intvalue(zoffset);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFramebufferTexture3DOES(target, attachment, textarget, texture, level, zoffset);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBindVertexArrayOES(GLuint array) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBindVertexArrayOES);
+
+    // copy argument array
+    GLMessage_DataType *arg_array = glmsg.add_args();
+    arg_array->set_isarray(false);
+    arg_array->set_type(GLMessage::DataType::INT);
+    arg_array->add_intvalue(array);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBindVertexArrayOES(array);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDeleteVertexArraysOES);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument arrays
+    GLMessage_DataType *arg_arrays = glmsg.add_args();
+    arg_arrays->set_isarray(false);
+    arg_arrays->set_type(GLMessage::DataType::INT);
+    arg_arrays->add_intvalue((int)arrays);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDeleteVertexArraysOES(n, arrays);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenVertexArraysOES(GLsizei n, GLuint *arrays) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGenVertexArraysOES);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument arrays
+    GLMessage_DataType *arg_arrays = glmsg.add_args();
+    arg_arrays->set_isarray(false);
+    arg_arrays->set_type(GLMessage::DataType::INT);
+    arg_arrays->add_intvalue((int)arrays);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGenVertexArraysOES(n, arrays);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLboolean GLTrace_glIsVertexArrayOES(GLuint array) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glIsVertexArrayOES);
+
+    // copy argument array
+    GLMessage_DataType *arg_array = glmsg.add_args();
+    arg_array->set_isarray(false);
+    arg_array->set_type(GLMessage::DataType::INT);
+    arg_array->add_intvalue(array);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glIsVertexArrayOES(array);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glGetPerfMonitorGroupsAMD(GLint *numGroups, GLsizei groupsSize, GLuint *groups) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetPerfMonitorGroupsAMD);
+
+    // copy argument numGroups
+    GLMessage_DataType *arg_numGroups = glmsg.add_args();
+    arg_numGroups->set_isarray(false);
+    arg_numGroups->set_type(GLMessage::DataType::INT);
+    arg_numGroups->add_intvalue((int)numGroups);
+
+    // copy argument groupsSize
+    GLMessage_DataType *arg_groupsSize = glmsg.add_args();
+    arg_groupsSize->set_isarray(false);
+    arg_groupsSize->set_type(GLMessage::DataType::INT);
+    arg_groupsSize->add_intvalue(groupsSize);
+
+    // copy argument groups
+    GLMessage_DataType *arg_groups = glmsg.add_args();
+    arg_groups->set_isarray(false);
+    arg_groups->set_type(GLMessage::DataType::INT);
+    arg_groups->add_intvalue((int)groups);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetPerfMonitorGroupsAMD(numGroups, groupsSize, groups);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetPerfMonitorCountersAMD(GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetPerfMonitorCountersAMD);
+
+    // copy argument group
+    GLMessage_DataType *arg_group = glmsg.add_args();
+    arg_group->set_isarray(false);
+    arg_group->set_type(GLMessage::DataType::INT);
+    arg_group->add_intvalue(group);
+
+    // copy argument numCounters
+    GLMessage_DataType *arg_numCounters = glmsg.add_args();
+    arg_numCounters->set_isarray(false);
+    arg_numCounters->set_type(GLMessage::DataType::INT);
+    arg_numCounters->add_intvalue((int)numCounters);
+
+    // copy argument maxActiveCounters
+    GLMessage_DataType *arg_maxActiveCounters = glmsg.add_args();
+    arg_maxActiveCounters->set_isarray(false);
+    arg_maxActiveCounters->set_type(GLMessage::DataType::INT);
+    arg_maxActiveCounters->add_intvalue((int)maxActiveCounters);
+
+    // copy argument counterSize
+    GLMessage_DataType *arg_counterSize = glmsg.add_args();
+    arg_counterSize->set_isarray(false);
+    arg_counterSize->set_type(GLMessage::DataType::INT);
+    arg_counterSize->add_intvalue(counterSize);
+
+    // copy argument counters
+    GLMessage_DataType *arg_counters = glmsg.add_args();
+    arg_counters->set_isarray(false);
+    arg_counters->set_type(GLMessage::DataType::INT);
+    arg_counters->add_intvalue((int)counters);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetPerfMonitorCountersAMD(group, numCounters, maxActiveCounters, counterSize, counters);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetPerfMonitorGroupStringAMD);
+
+    // copy argument group
+    GLMessage_DataType *arg_group = glmsg.add_args();
+    arg_group->set_isarray(false);
+    arg_group->set_type(GLMessage::DataType::INT);
+    arg_group->add_intvalue(group);
+
+    // copy argument bufSize
+    GLMessage_DataType *arg_bufSize = glmsg.add_args();
+    arg_bufSize->set_isarray(false);
+    arg_bufSize->set_type(GLMessage::DataType::INT);
+    arg_bufSize->add_intvalue(bufSize);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue((int)length);
+
+    // copy argument groupString
+    GLMessage_DataType *arg_groupString = glmsg.add_args();
+    arg_groupString->set_isarray(false);
+    arg_groupString->set_type(GLMessage::DataType::INT);
+    arg_groupString->add_intvalue((int)groupString);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetPerfMonitorGroupStringAMD(group, bufSize, length, groupString);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetPerfMonitorCounterStringAMD);
+
+    // copy argument group
+    GLMessage_DataType *arg_group = glmsg.add_args();
+    arg_group->set_isarray(false);
+    arg_group->set_type(GLMessage::DataType::INT);
+    arg_group->add_intvalue(group);
+
+    // copy argument counter
+    GLMessage_DataType *arg_counter = glmsg.add_args();
+    arg_counter->set_isarray(false);
+    arg_counter->set_type(GLMessage::DataType::INT);
+    arg_counter->add_intvalue(counter);
+
+    // copy argument bufSize
+    GLMessage_DataType *arg_bufSize = glmsg.add_args();
+    arg_bufSize->set_isarray(false);
+    arg_bufSize->set_type(GLMessage::DataType::INT);
+    arg_bufSize->add_intvalue(bufSize);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue((int)length);
+
+    // copy argument counterString
+    GLMessage_DataType *arg_counterString = glmsg.add_args();
+    arg_counterString->set_isarray(false);
+    arg_counterString->set_type(GLMessage::DataType::INT);
+    arg_counterString->add_intvalue((int)counterString);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetPerfMonitorCounterStringAMD(group, counter, bufSize, length, counterString);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, GLvoid *data) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetPerfMonitorCounterInfoAMD);
+
+    // copy argument group
+    GLMessage_DataType *arg_group = glmsg.add_args();
+    arg_group->set_isarray(false);
+    arg_group->set_type(GLMessage::DataType::INT);
+    arg_group->add_intvalue(group);
+
+    // copy argument counter
+    GLMessage_DataType *arg_counter = glmsg.add_args();
+    arg_counter->set_isarray(false);
+    arg_counter->set_type(GLMessage::DataType::INT);
+    arg_counter->add_intvalue(counter);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument data
+    GLMessage_DataType *arg_data = glmsg.add_args();
+    arg_data->set_isarray(false);
+    arg_data->set_type(GLMessage::DataType::INT);
+    arg_data->add_intvalue((int)data);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetPerfMonitorCounterInfoAMD(group, counter, pname, data);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenPerfMonitorsAMD(GLsizei n, GLuint *monitors) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGenPerfMonitorsAMD);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument monitors
+    GLMessage_DataType *arg_monitors = glmsg.add_args();
+    arg_monitors->set_isarray(false);
+    arg_monitors->set_type(GLMessage::DataType::INT);
+    arg_monitors->add_intvalue((int)monitors);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGenPerfMonitorsAMD(n, monitors);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeletePerfMonitorsAMD(GLsizei n, GLuint *monitors) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDeletePerfMonitorsAMD);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument monitors
+    GLMessage_DataType *arg_monitors = glmsg.add_args();
+    arg_monitors->set_isarray(false);
+    arg_monitors->set_type(GLMessage::DataType::INT);
+    arg_monitors->add_intvalue((int)monitors);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDeletePerfMonitorsAMD(n, monitors);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glSelectPerfMonitorCountersAMD);
+
+    // copy argument monitor
+    GLMessage_DataType *arg_monitor = glmsg.add_args();
+    arg_monitor->set_isarray(false);
+    arg_monitor->set_type(GLMessage::DataType::INT);
+    arg_monitor->add_intvalue(monitor);
+
+    // copy argument enable
+    GLMessage_DataType *arg_enable = glmsg.add_args();
+    arg_enable->set_isarray(false);
+    arg_enable->set_type(GLMessage::DataType::BOOL);
+    arg_enable->add_boolvalue(enable);
+
+    // copy argument group
+    GLMessage_DataType *arg_group = glmsg.add_args();
+    arg_group->set_isarray(false);
+    arg_group->set_type(GLMessage::DataType::INT);
+    arg_group->add_intvalue(group);
+
+    // copy argument numCounters
+    GLMessage_DataType *arg_numCounters = glmsg.add_args();
+    arg_numCounters->set_isarray(false);
+    arg_numCounters->set_type(GLMessage::DataType::INT);
+    arg_numCounters->add_intvalue(numCounters);
+
+    // copy argument countersList
+    GLMessage_DataType *arg_countersList = glmsg.add_args();
+    arg_countersList->set_isarray(false);
+    arg_countersList->set_type(GLMessage::DataType::INT);
+    arg_countersList->add_intvalue((int)countersList);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glSelectPerfMonitorCountersAMD(monitor, enable, group, numCounters, countersList);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBeginPerfMonitorAMD(GLuint monitor) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBeginPerfMonitorAMD);
+
+    // copy argument monitor
+    GLMessage_DataType *arg_monitor = glmsg.add_args();
+    arg_monitor->set_isarray(false);
+    arg_monitor->set_type(GLMessage::DataType::INT);
+    arg_monitor->add_intvalue(monitor);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBeginPerfMonitorAMD(monitor);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glEndPerfMonitorAMD(GLuint monitor) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glEndPerfMonitorAMD);
+
+    // copy argument monitor
+    GLMessage_DataType *arg_monitor = glmsg.add_args();
+    arg_monitor->set_isarray(false);
+    arg_monitor->set_type(GLMessage::DataType::INT);
+    arg_monitor->add_intvalue(monitor);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glEndPerfMonitorAMD(monitor);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetPerfMonitorCounterDataAMD);
+
+    // copy argument monitor
+    GLMessage_DataType *arg_monitor = glmsg.add_args();
+    arg_monitor->set_isarray(false);
+    arg_monitor->set_type(GLMessage::DataType::INT);
+    arg_monitor->add_intvalue(monitor);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument dataSize
+    GLMessage_DataType *arg_dataSize = glmsg.add_args();
+    arg_dataSize->set_isarray(false);
+    arg_dataSize->set_type(GLMessage::DataType::INT);
+    arg_dataSize->add_intvalue(dataSize);
+
+    // copy argument data
+    GLMessage_DataType *arg_data = glmsg.add_args();
+    arg_data->set_isarray(false);
+    arg_data->set_type(GLMessage::DataType::INT);
+    arg_data->add_intvalue((int)data);
+
+    // copy argument bytesWritten
+    GLMessage_DataType *arg_bytesWritten = glmsg.add_args();
+    arg_bytesWritten->set_isarray(false);
+    arg_bytesWritten->set_type(GLMessage::DataType::INT);
+    arg_bytesWritten->add_intvalue((int)bytesWritten);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetPerfMonitorCounterDataAMD(monitor, pname, dataSize, data, bytesWritten);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBlitFramebufferANGLE);
+
+    // copy argument srcX0
+    GLMessage_DataType *arg_srcX0 = glmsg.add_args();
+    arg_srcX0->set_isarray(false);
+    arg_srcX0->set_type(GLMessage::DataType::INT);
+    arg_srcX0->add_intvalue(srcX0);
+
+    // copy argument srcY0
+    GLMessage_DataType *arg_srcY0 = glmsg.add_args();
+    arg_srcY0->set_isarray(false);
+    arg_srcY0->set_type(GLMessage::DataType::INT);
+    arg_srcY0->add_intvalue(srcY0);
+
+    // copy argument srcX1
+    GLMessage_DataType *arg_srcX1 = glmsg.add_args();
+    arg_srcX1->set_isarray(false);
+    arg_srcX1->set_type(GLMessage::DataType::INT);
+    arg_srcX1->add_intvalue(srcX1);
+
+    // copy argument srcY1
+    GLMessage_DataType *arg_srcY1 = glmsg.add_args();
+    arg_srcY1->set_isarray(false);
+    arg_srcY1->set_type(GLMessage::DataType::INT);
+    arg_srcY1->add_intvalue(srcY1);
+
+    // copy argument dstX0
+    GLMessage_DataType *arg_dstX0 = glmsg.add_args();
+    arg_dstX0->set_isarray(false);
+    arg_dstX0->set_type(GLMessage::DataType::INT);
+    arg_dstX0->add_intvalue(dstX0);
+
+    // copy argument dstY0
+    GLMessage_DataType *arg_dstY0 = glmsg.add_args();
+    arg_dstY0->set_isarray(false);
+    arg_dstY0->set_type(GLMessage::DataType::INT);
+    arg_dstY0->add_intvalue(dstY0);
+
+    // copy argument dstX1
+    GLMessage_DataType *arg_dstX1 = glmsg.add_args();
+    arg_dstX1->set_isarray(false);
+    arg_dstX1->set_type(GLMessage::DataType::INT);
+    arg_dstX1->add_intvalue(dstX1);
+
+    // copy argument dstY1
+    GLMessage_DataType *arg_dstY1 = glmsg.add_args();
+    arg_dstY1->set_isarray(false);
+    arg_dstY1->set_type(GLMessage::DataType::INT);
+    arg_dstY1->add_intvalue(dstY1);
+
+    // copy argument mask
+    GLMessage_DataType *arg_mask = glmsg.add_args();
+    arg_mask->set_isarray(false);
+    arg_mask->set_type(GLMessage::DataType::INT);
+    arg_mask->add_intvalue(mask);
+
+    // copy argument filter
+    GLMessage_DataType *arg_filter = glmsg.add_args();
+    arg_filter->set_isarray(false);
+    arg_filter->set_type(GLMessage::DataType::ENUM);
+    arg_filter->add_intvalue((int)filter);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBlitFramebufferANGLE(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glRenderbufferStorageMultisampleANGLE);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument samples
+    GLMessage_DataType *arg_samples = glmsg.add_args();
+    arg_samples->set_isarray(false);
+    arg_samples->set_type(GLMessage::DataType::INT);
+    arg_samples->add_intvalue(samples);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glRenderbufferStorageMultisampleANGLE(target, samples, internalformat, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRenderbufferStorageMultisampleAPPLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glRenderbufferStorageMultisampleAPPLE);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument samples
+    GLMessage_DataType *arg_samples = glmsg.add_args();
+    arg_samples->set_isarray(false);
+    arg_samples->set_type(GLMessage::DataType::INT);
+    arg_samples->add_intvalue(samples);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glRenderbufferStorageMultisampleAPPLE(target, samples, internalformat, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glResolveMultisampleFramebufferAPPLE(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glResolveMultisampleFramebufferAPPLE);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glResolveMultisampleFramebufferAPPLE();
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLabelObjectEXT(GLenum type, GLuint object, GLsizei length, const GLchar *label) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLabelObjectEXT);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument object
+    GLMessage_DataType *arg_object = glmsg.add_args();
+    arg_object->set_isarray(false);
+    arg_object->set_type(GLMessage::DataType::INT);
+    arg_object->add_intvalue(object);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue(length);
+
+    // copy argument label
+    GLMessage_DataType *arg_label = glmsg.add_args();
+    arg_label->set_isarray(false);
+    arg_label->set_type(GLMessage::DataType::INT);
+    arg_label->add_intvalue((int)label);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLabelObjectEXT(type, object, length, label);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetObjectLabelEXT(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetObjectLabelEXT);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument object
+    GLMessage_DataType *arg_object = glmsg.add_args();
+    arg_object->set_isarray(false);
+    arg_object->set_type(GLMessage::DataType::INT);
+    arg_object->add_intvalue(object);
+
+    // copy argument bufSize
+    GLMessage_DataType *arg_bufSize = glmsg.add_args();
+    arg_bufSize->set_isarray(false);
+    arg_bufSize->set_type(GLMessage::DataType::INT);
+    arg_bufSize->add_intvalue(bufSize);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue((int)length);
+
+    // copy argument label
+    GLMessage_DataType *arg_label = glmsg.add_args();
+    arg_label->set_isarray(false);
+    arg_label->set_type(GLMessage::DataType::INT);
+    arg_label->add_intvalue((int)label);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetObjectLabelEXT(type, object, bufSize, length, label);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glInsertEventMarkerEXT(GLsizei length, const GLchar *marker) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glInsertEventMarkerEXT);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue(length);
+
+    // copy argument marker
+    GLMessage_DataType *arg_marker = glmsg.add_args();
+    arg_marker->set_isarray(false);
+    arg_marker->set_type(GLMessage::DataType::INT);
+    arg_marker->add_intvalue((int)marker);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glInsertEventMarkerEXT(length, marker);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPushGroupMarkerEXT(GLsizei length, const GLchar *marker) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPushGroupMarkerEXT);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue(length);
+
+    // copy argument marker
+    GLMessage_DataType *arg_marker = glmsg.add_args();
+    arg_marker->set_isarray(false);
+    arg_marker->set_type(GLMessage::DataType::INT);
+    arg_marker->add_intvalue((int)marker);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPushGroupMarkerEXT(length, marker);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPopGroupMarkerEXT(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPopGroupMarkerEXT);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPopGroupMarkerEXT();
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum *attachments) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDiscardFramebufferEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument numAttachments
+    GLMessage_DataType *arg_numAttachments = glmsg.add_args();
+    arg_numAttachments->set_isarray(false);
+    arg_numAttachments->set_type(GLMessage::DataType::INT);
+    arg_numAttachments->add_intvalue(numAttachments);
+
+    // copy argument attachments
+    GLMessage_DataType *arg_attachments = glmsg.add_args();
+    arg_attachments->set_isarray(false);
+    arg_attachments->set_type(GLMessage::DataType::INT);
+    arg_attachments->add_intvalue((int)attachments);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDiscardFramebufferEXT(target, numAttachments, attachments);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glRenderbufferStorageMultisampleEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument samples
+    GLMessage_DataType *arg_samples = glmsg.add_args();
+    arg_samples->set_isarray(false);
+    arg_samples->set_type(GLMessage::DataType::INT);
+    arg_samples->add_intvalue(samples);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glRenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFramebufferTexture2DMultisampleEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFramebufferTexture2DMultisampleEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument attachment
+    GLMessage_DataType *arg_attachment = glmsg.add_args();
+    arg_attachment->set_isarray(false);
+    arg_attachment->set_type(GLMessage::DataType::ENUM);
+    arg_attachment->add_intvalue((int)attachment);
+
+    // copy argument textarget
+    GLMessage_DataType *arg_textarget = glmsg.add_args();
+    arg_textarget->set_isarray(false);
+    arg_textarget->set_type(GLMessage::DataType::ENUM);
+    arg_textarget->add_intvalue((int)textarget);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::INT);
+    arg_texture->add_intvalue(texture);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument samples
+    GLMessage_DataType *arg_samples = glmsg.add_args();
+    arg_samples->set_isarray(false);
+    arg_samples->set_type(GLMessage::DataType::INT);
+    arg_samples->add_intvalue(samples);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFramebufferTexture2DMultisampleEXT(target, attachment, textarget, texture, level, samples);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMultiDrawArraysEXT(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMultiDrawArraysEXT);
+
+    // copy argument mode
+    GLMessage_DataType *arg_mode = glmsg.add_args();
+    arg_mode->set_isarray(false);
+    arg_mode->set_type(GLMessage::DataType::ENUM);
+    arg_mode->add_intvalue((int)mode);
+
+    // copy argument first
+    GLMessage_DataType *arg_first = glmsg.add_args();
+    arg_first->set_isarray(false);
+    arg_first->set_type(GLMessage::DataType::INT);
+    arg_first->add_intvalue((int)first);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue((int)count);
+
+    // copy argument primcount
+    GLMessage_DataType *arg_primcount = glmsg.add_args();
+    arg_primcount->set_isarray(false);
+    arg_primcount->set_type(GLMessage::DataType::INT);
+    arg_primcount->add_intvalue(primcount);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glMultiDrawArraysEXT(mode, first, count, primcount);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMultiDrawElementsEXT);
+
+    // copy argument mode
+    GLMessage_DataType *arg_mode = glmsg.add_args();
+    arg_mode->set_isarray(false);
+    arg_mode->set_type(GLMessage::DataType::ENUM);
+    arg_mode->add_intvalue((int)mode);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue((int)count);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument indices
+    GLMessage_DataType *arg_indices = glmsg.add_args();
+    arg_indices->set_isarray(false);
+    arg_indices->set_type(GLMessage::DataType::INT);
+    arg_indices->add_intvalue((int)indices);
+
+    // copy argument primcount
+    GLMessage_DataType *arg_primcount = glmsg.add_args();
+    arg_primcount->set_isarray(false);
+    arg_primcount->set_type(GLMessage::DataType::INT);
+    arg_primcount->add_intvalue(primcount);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glMultiDrawElementsEXT(mode, count, type, indices, primcount);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenQueriesEXT(GLsizei n, GLuint *ids) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGenQueriesEXT);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument ids
+    GLMessage_DataType *arg_ids = glmsg.add_args();
+    arg_ids->set_isarray(false);
+    arg_ids->set_type(GLMessage::DataType::INT);
+    arg_ids->add_intvalue((int)ids);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGenQueriesEXT(n, ids);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteQueriesEXT(GLsizei n, const GLuint *ids) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDeleteQueriesEXT);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument ids
+    GLMessage_DataType *arg_ids = glmsg.add_args();
+    arg_ids->set_isarray(false);
+    arg_ids->set_type(GLMessage::DataType::INT);
+    arg_ids->add_intvalue((int)ids);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDeleteQueriesEXT(n, ids);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLboolean GLTrace_glIsQueryEXT(GLuint id) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glIsQueryEXT);
+
+    // copy argument id
+    GLMessage_DataType *arg_id = glmsg.add_args();
+    arg_id->set_isarray(false);
+    arg_id->set_type(GLMessage::DataType::INT);
+    arg_id->add_intvalue(id);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glIsQueryEXT(id);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glBeginQueryEXT(GLenum target, GLuint id) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBeginQueryEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument id
+    GLMessage_DataType *arg_id = glmsg.add_args();
+    arg_id->set_isarray(false);
+    arg_id->set_type(GLMessage::DataType::INT);
+    arg_id->add_intvalue(id);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBeginQueryEXT(target, id);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glEndQueryEXT(GLenum target) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glEndQueryEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glEndQueryEXT(target);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetQueryivEXT(GLenum target, GLenum pname, GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetQueryivEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetQueryivEXT(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetQueryObjectuivEXT);
+
+    // copy argument id
+    GLMessage_DataType *arg_id = glmsg.add_args();
+    arg_id->set_isarray(false);
+    arg_id->set_type(GLMessage::DataType::INT);
+    arg_id->add_intvalue(id);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetQueryObjectuivEXT(id, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLenum GLTrace_glGetGraphicsResetStatusEXT(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetGraphicsResetStatusEXT);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLenum retValue = glContext->hooks->gl.glGetGraphicsResetStatusEXT();
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::ENUM);
+    rt->add_intvalue((int)retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glReadnPixelsEXT);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument format
+    GLMessage_DataType *arg_format = glmsg.add_args();
+    arg_format->set_isarray(false);
+    arg_format->set_type(GLMessage::DataType::ENUM);
+    arg_format->add_intvalue((int)format);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument bufSize
+    GLMessage_DataType *arg_bufSize = glmsg.add_args();
+    arg_bufSize->set_isarray(false);
+    arg_bufSize->set_type(GLMessage::DataType::INT);
+    arg_bufSize->add_intvalue(bufSize);
+
+    // copy argument data
+    GLMessage_DataType *arg_data = glmsg.add_args();
+    arg_data->set_isarray(false);
+    arg_data->set_type(GLMessage::DataType::INT);
+    arg_data->add_intvalue((int)data);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glReadnPixelsEXT(x, y, width, height, format, type, bufSize, data);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, float *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetnUniformfvEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument bufSize
+    GLMessage_DataType *arg_bufSize = glmsg.add_args();
+    arg_bufSize->set_isarray(false);
+    arg_bufSize->set_type(GLMessage::DataType::INT);
+    arg_bufSize->add_intvalue(bufSize);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetnUniformfvEXT(program, location, bufSize, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetnUniformivEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument bufSize
+    GLMessage_DataType *arg_bufSize = glmsg.add_args();
+    arg_bufSize->set_isarray(false);
+    arg_bufSize->set_type(GLMessage::DataType::INT);
+    arg_bufSize->add_intvalue(bufSize);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetnUniformivEXT(program, location, bufSize, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glUseProgramStagesEXT(GLuint pipeline, GLbitfield stages, GLuint program) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glUseProgramStagesEXT);
+
+    // copy argument pipeline
+    GLMessage_DataType *arg_pipeline = glmsg.add_args();
+    arg_pipeline->set_isarray(false);
+    arg_pipeline->set_type(GLMessage::DataType::INT);
+    arg_pipeline->add_intvalue(pipeline);
+
+    // copy argument stages
+    GLMessage_DataType *arg_stages = glmsg.add_args();
+    arg_stages->set_isarray(false);
+    arg_stages->set_type(GLMessage::DataType::INT);
+    arg_stages->add_intvalue(stages);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glUseProgramStagesEXT(pipeline, stages, program);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glActiveShaderProgramEXT(GLuint pipeline, GLuint program) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glActiveShaderProgramEXT);
+
+    // copy argument pipeline
+    GLMessage_DataType *arg_pipeline = glmsg.add_args();
+    arg_pipeline->set_isarray(false);
+    arg_pipeline->set_type(GLMessage::DataType::INT);
+    arg_pipeline->add_intvalue(pipeline);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glActiveShaderProgramEXT(pipeline, program);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLuint GLTrace_glCreateShaderProgramvEXT(GLenum type, GLsizei count, const GLchar **strings) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCreateShaderProgramvEXT);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument strings
+    GLMessage_DataType *arg_strings = glmsg.add_args();
+    arg_strings->set_isarray(false);
+    arg_strings->set_type(GLMessage::DataType::INT);
+    arg_strings->add_intvalue((int)strings);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLuint retValue = glContext->hooks->gl.glCreateShaderProgramvEXT(type, count, strings);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::INT);
+    rt->add_intvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glBindProgramPipelineEXT(GLuint pipeline) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBindProgramPipelineEXT);
+
+    // copy argument pipeline
+    GLMessage_DataType *arg_pipeline = glmsg.add_args();
+    arg_pipeline->set_isarray(false);
+    arg_pipeline->set_type(GLMessage::DataType::INT);
+    arg_pipeline->add_intvalue(pipeline);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBindProgramPipelineEXT(pipeline);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteProgramPipelinesEXT(GLsizei n, const GLuint *pipelines) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDeleteProgramPipelinesEXT);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument pipelines
+    GLMessage_DataType *arg_pipelines = glmsg.add_args();
+    arg_pipelines->set_isarray(false);
+    arg_pipelines->set_type(GLMessage::DataType::INT);
+    arg_pipelines->add_intvalue((int)pipelines);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDeleteProgramPipelinesEXT(n, pipelines);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenProgramPipelinesEXT(GLsizei n, GLuint *pipelines) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGenProgramPipelinesEXT);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument pipelines
+    GLMessage_DataType *arg_pipelines = glmsg.add_args();
+    arg_pipelines->set_isarray(false);
+    arg_pipelines->set_type(GLMessage::DataType::INT);
+    arg_pipelines->add_intvalue((int)pipelines);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGenProgramPipelinesEXT(n, pipelines);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLboolean GLTrace_glIsProgramPipelineEXT(GLuint pipeline) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glIsProgramPipelineEXT);
+
+    // copy argument pipeline
+    GLMessage_DataType *arg_pipeline = glmsg.add_args();
+    arg_pipeline->set_isarray(false);
+    arg_pipeline->set_type(GLMessage::DataType::INT);
+    arg_pipeline->add_intvalue(pipeline);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glIsProgramPipelineEXT(pipeline);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glProgramParameteriEXT(GLuint program, GLenum pname, GLint value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramParameteriEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue(value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramParameteriEXT(program, pname, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetProgramPipelineivEXT(GLuint pipeline, GLenum pname, GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetProgramPipelineivEXT);
+
+    // copy argument pipeline
+    GLMessage_DataType *arg_pipeline = glmsg.add_args();
+    arg_pipeline->set_isarray(false);
+    arg_pipeline->set_type(GLMessage::DataType::INT);
+    arg_pipeline->add_intvalue(pipeline);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetProgramPipelineivEXT(pipeline, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform1iEXT(GLuint program, GLint location, GLint x) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform1iEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform1iEXT(program, location, x);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform2iEXT(GLuint program, GLint location, GLint x, GLint y) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform2iEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform2iEXT(program, location, x, y);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform3iEXT(GLuint program, GLint location, GLint x, GLint y, GLint z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform3iEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::INT);
+    arg_z->add_intvalue(z);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform3iEXT(program, location, x, y, z);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform4iEXT(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform4iEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::INT);
+    arg_z->add_intvalue(z);
+
+    // copy argument w
+    GLMessage_DataType *arg_w = glmsg.add_args();
+    arg_w->set_isarray(false);
+    arg_w->set_type(GLMessage::DataType::INT);
+    arg_w->add_intvalue(w);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform4iEXT(program, location, x, y, z, w);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform1fEXT(GLuint program, GLint location, GLfloat x) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform1fEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform1fEXT(program, location, x);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform2fEXT(GLuint program, GLint location, GLfloat x, GLfloat y) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform2fEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::FLOAT);
+    arg_y->add_floatvalue(y);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform2fEXT(program, location, x, y);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform3fEXT(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform3fEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::FLOAT);
+    arg_y->add_floatvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::FLOAT);
+    arg_z->add_floatvalue(z);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform3fEXT(program, location, x, y, z);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform4fEXT(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform4fEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::FLOAT);
+    arg_y->add_floatvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::FLOAT);
+    arg_z->add_floatvalue(z);
+
+    // copy argument w
+    GLMessage_DataType *arg_w = glmsg.add_args();
+    arg_w->set_isarray(false);
+    arg_w->set_type(GLMessage::DataType::FLOAT);
+    arg_w->add_floatvalue(w);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform4fEXT(program, location, x, y, z, w);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform1ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform1ivEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform1ivEXT(program, location, count, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform2ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform2ivEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform2ivEXT(program, location, count, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform3ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform3ivEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform3ivEXT(program, location, count, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform4ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform4ivEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform4ivEXT(program, location, count, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform1fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform1fvEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform1fvEXT(program, location, count, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform2fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform2fvEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform2fvEXT(program, location, count, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform3fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform3fvEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform3fvEXT(program, location, count, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniform4fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniform4fvEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniform4fvEXT(program, location, count, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniformMatrix2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniformMatrix2fvEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument transpose
+    GLMessage_DataType *arg_transpose = glmsg.add_args();
+    arg_transpose->set_isarray(false);
+    arg_transpose->set_type(GLMessage::DataType::BOOL);
+    arg_transpose->add_boolvalue(transpose);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniformMatrix2fvEXT(program, location, count, transpose, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniformMatrix3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniformMatrix3fvEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument transpose
+    GLMessage_DataType *arg_transpose = glmsg.add_args();
+    arg_transpose->set_isarray(false);
+    arg_transpose->set_type(GLMessage::DataType::BOOL);
+    arg_transpose->add_boolvalue(transpose);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniformMatrix3fvEXT(program, location, count, transpose, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glProgramUniformMatrix4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glProgramUniformMatrix4fvEXT);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument location
+    GLMessage_DataType *arg_location = glmsg.add_args();
+    arg_location->set_isarray(false);
+    arg_location->set_type(GLMessage::DataType::INT);
+    arg_location->add_intvalue(location);
+
+    // copy argument count
+    GLMessage_DataType *arg_count = glmsg.add_args();
+    arg_count->set_isarray(false);
+    arg_count->set_type(GLMessage::DataType::INT);
+    arg_count->add_intvalue(count);
+
+    // copy argument transpose
+    GLMessage_DataType *arg_transpose = glmsg.add_args();
+    arg_transpose->set_isarray(false);
+    arg_transpose->set_type(GLMessage::DataType::BOOL);
+    arg_transpose->add_boolvalue(transpose);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue((int)value);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glProgramUniformMatrix4fvEXT(program, location, count, transpose, value);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glValidateProgramPipelineEXT(GLuint pipeline) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glValidateProgramPipelineEXT);
+
+    // copy argument pipeline
+    GLMessage_DataType *arg_pipeline = glmsg.add_args();
+    arg_pipeline->set_isarray(false);
+    arg_pipeline->set_type(GLMessage::DataType::INT);
+    arg_pipeline->add_intvalue(pipeline);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glValidateProgramPipelineEXT(pipeline);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetProgramPipelineInfoLogEXT(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetProgramPipelineInfoLogEXT);
+
+    // copy argument pipeline
+    GLMessage_DataType *arg_pipeline = glmsg.add_args();
+    arg_pipeline->set_isarray(false);
+    arg_pipeline->set_type(GLMessage::DataType::INT);
+    arg_pipeline->add_intvalue(pipeline);
+
+    // copy argument bufSize
+    GLMessage_DataType *arg_bufSize = glmsg.add_args();
+    arg_bufSize->set_isarray(false);
+    arg_bufSize->set_type(GLMessage::DataType::INT);
+    arg_bufSize->add_intvalue(bufSize);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue((int)length);
+
+    // copy argument infoLog
+    GLMessage_DataType *arg_infoLog = glmsg.add_args();
+    arg_infoLog->set_isarray(false);
+    arg_infoLog->set_type(GLMessage::DataType::INT);
+    arg_infoLog->add_intvalue((int)infoLog);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetProgramPipelineInfoLogEXT(pipeline, bufSize, length, infoLog);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexStorage1DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexStorage1DEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument levels
+    GLMessage_DataType *arg_levels = glmsg.add_args();
+    arg_levels->set_isarray(false);
+    arg_levels->set_type(GLMessage::DataType::INT);
+    arg_levels->add_intvalue(levels);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexStorage1DEXT(target, levels, internalformat, width);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexStorage2DEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument levels
+    GLMessage_DataType *arg_levels = glmsg.add_args();
+    arg_levels->set_isarray(false);
+    arg_levels->set_type(GLMessage::DataType::INT);
+    arg_levels->add_intvalue(levels);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexStorage2DEXT(target, levels, internalformat, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexStorage3DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexStorage3DEXT);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument levels
+    GLMessage_DataType *arg_levels = glmsg.add_args();
+    arg_levels->set_isarray(false);
+    arg_levels->set_type(GLMessage::DataType::INT);
+    arg_levels->add_intvalue(levels);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument depth
+    GLMessage_DataType *arg_depth = glmsg.add_args();
+    arg_depth->set_isarray(false);
+    arg_depth->set_type(GLMessage::DataType::INT);
+    arg_depth->add_intvalue(depth);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexStorage3DEXT(target, levels, internalformat, width, height, depth);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTextureStorage1DEXT);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::INT);
+    arg_texture->add_intvalue(texture);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument levels
+    GLMessage_DataType *arg_levels = glmsg.add_args();
+    arg_levels->set_isarray(false);
+    arg_levels->set_type(GLMessage::DataType::INT);
+    arg_levels->add_intvalue(levels);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTextureStorage1DEXT(texture, target, levels, internalformat, width);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTextureStorage2DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTextureStorage2DEXT);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::INT);
+    arg_texture->add_intvalue(texture);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument levels
+    GLMessage_DataType *arg_levels = glmsg.add_args();
+    arg_levels->set_isarray(false);
+    arg_levels->set_type(GLMessage::DataType::INT);
+    arg_levels->add_intvalue(levels);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTextureStorage2DEXT(texture, target, levels, internalformat, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTextureStorage3DEXT);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::INT);
+    arg_texture->add_intvalue(texture);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument levels
+    GLMessage_DataType *arg_levels = glmsg.add_args();
+    arg_levels->set_isarray(false);
+    arg_levels->set_type(GLMessage::DataType::INT);
+    arg_levels->add_intvalue(levels);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument depth
+    GLMessage_DataType *arg_depth = glmsg.add_args();
+    arg_depth->set_isarray(false);
+    arg_depth->set_type(GLMessage::DataType::INT);
+    arg_depth->add_intvalue(depth);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTextureStorage3DEXT(texture, target, levels, internalformat, width, height, depth);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glRenderbufferStorageMultisampleIMG);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument samples
+    GLMessage_DataType *arg_samples = glmsg.add_args();
+    arg_samples->set_isarray(false);
+    arg_samples->set_type(GLMessage::DataType::INT);
+    arg_samples->add_intvalue(samples);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glRenderbufferStorageMultisampleIMG(target, samples, internalformat, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFramebufferTexture2DMultisampleIMG);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument attachment
+    GLMessage_DataType *arg_attachment = glmsg.add_args();
+    arg_attachment->set_isarray(false);
+    arg_attachment->set_type(GLMessage::DataType::ENUM);
+    arg_attachment->add_intvalue((int)attachment);
+
+    // copy argument textarget
+    GLMessage_DataType *arg_textarget = glmsg.add_args();
+    arg_textarget->set_isarray(false);
+    arg_textarget->set_type(GLMessage::DataType::ENUM);
+    arg_textarget->add_intvalue((int)textarget);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::INT);
+    arg_texture->add_intvalue(texture);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument samples
+    GLMessage_DataType *arg_samples = glmsg.add_args();
+    arg_samples->set_isarray(false);
+    arg_samples->set_type(GLMessage::DataType::INT);
+    arg_samples->add_intvalue(samples);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFramebufferTexture2DMultisampleIMG(target, attachment, textarget, texture, level, samples);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glCoverageMaskNV(GLboolean mask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCoverageMaskNV);
+
+    // copy argument mask
+    GLMessage_DataType *arg_mask = glmsg.add_args();
+    arg_mask->set_isarray(false);
+    arg_mask->set_type(GLMessage::DataType::BOOL);
+    arg_mask->add_boolvalue(mask);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glCoverageMaskNV(mask);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glCoverageOperationNV(GLenum operation) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCoverageOperationNV);
+
+    // copy argument operation
+    GLMessage_DataType *arg_operation = glmsg.add_args();
+    arg_operation->set_isarray(false);
+    arg_operation->set_type(GLMessage::DataType::ENUM);
+    arg_operation->add_intvalue((int)operation);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glCoverageOperationNV(operation);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawBuffersNV(GLsizei n, const GLenum *bufs) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDrawBuffersNV);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument bufs
+    GLMessage_DataType *arg_bufs = glmsg.add_args();
+    arg_bufs->set_isarray(false);
+    arg_bufs->set_type(GLMessage::DataType::INT);
+    arg_bufs->add_intvalue((int)bufs);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDrawBuffersNV(n, bufs);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteFencesNV(GLsizei n, const GLuint *fences) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDeleteFencesNV);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument fences
+    GLMessage_DataType *arg_fences = glmsg.add_args();
+    arg_fences->set_isarray(false);
+    arg_fences->set_type(GLMessage::DataType::INT);
+    arg_fences->add_intvalue((int)fences);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDeleteFencesNV(n, fences);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenFencesNV(GLsizei n, GLuint *fences) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGenFencesNV);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument fences
+    GLMessage_DataType *arg_fences = glmsg.add_args();
+    arg_fences->set_isarray(false);
+    arg_fences->set_type(GLMessage::DataType::INT);
+    arg_fences->add_intvalue((int)fences);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGenFencesNV(n, fences);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLboolean GLTrace_glIsFenceNV(GLuint fence) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glIsFenceNV);
+
+    // copy argument fence
+    GLMessage_DataType *arg_fence = glmsg.add_args();
+    arg_fence->set_isarray(false);
+    arg_fence->set_type(GLMessage::DataType::INT);
+    arg_fence->add_intvalue(fence);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glIsFenceNV(fence);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+GLboolean GLTrace_glTestFenceNV(GLuint fence) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTestFenceNV);
+
+    // copy argument fence
+    GLMessage_DataType *arg_fence = glmsg.add_args();
+    arg_fence->set_isarray(false);
+    arg_fence->set_type(GLMessage::DataType::INT);
+    arg_fence->add_intvalue(fence);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glTestFenceNV(fence);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glGetFenceivNV(GLuint fence, GLenum pname, GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetFenceivNV);
+
+    // copy argument fence
+    GLMessage_DataType *arg_fence = glmsg.add_args();
+    arg_fence->set_isarray(false);
+    arg_fence->set_type(GLMessage::DataType::INT);
+    arg_fence->add_intvalue(fence);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetFenceivNV(fence, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFinishFenceNV(GLuint fence) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFinishFenceNV);
+
+    // copy argument fence
+    GLMessage_DataType *arg_fence = glmsg.add_args();
+    arg_fence->set_isarray(false);
+    arg_fence->set_type(GLMessage::DataType::INT);
+    arg_fence->add_intvalue(fence);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFinishFenceNV(fence);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glSetFenceNV(GLuint fence, GLenum condition) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glSetFenceNV);
+
+    // copy argument fence
+    GLMessage_DataType *arg_fence = glmsg.add_args();
+    arg_fence->set_isarray(false);
+    arg_fence->set_type(GLMessage::DataType::INT);
+    arg_fence->add_intvalue(fence);
+
+    // copy argument condition
+    GLMessage_DataType *arg_condition = glmsg.add_args();
+    arg_condition->set_isarray(false);
+    arg_condition->set_type(GLMessage::DataType::ENUM);
+    arg_condition->add_intvalue((int)condition);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glSetFenceNV(fence, condition);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glReadBufferNV(GLenum mode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glReadBufferNV);
+
+    // copy argument mode
+    GLMessage_DataType *arg_mode = glmsg.add_args();
+    arg_mode->set_isarray(false);
+    arg_mode->set_type(GLMessage::DataType::ENUM);
+    arg_mode->add_intvalue((int)mode);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glReadBufferNV(mode);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glAlphaFuncQCOM(GLenum func, GLclampf ref) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glAlphaFuncQCOM);
+
+    // copy argument func
+    GLMessage_DataType *arg_func = glmsg.add_args();
+    arg_func->set_isarray(false);
+    arg_func->set_type(GLMessage::DataType::ENUM);
+    arg_func->add_intvalue((int)func);
+
+    // copy argument ref
+    GLMessage_DataType *arg_ref = glmsg.add_args();
+    arg_ref->set_isarray(false);
+    arg_ref->set_type(GLMessage::DataType::FLOAT);
+    arg_ref->add_floatvalue(ref);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glAlphaFuncQCOM(func, ref);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetDriverControlsQCOM(GLint *num, GLsizei size, GLuint *driverControls) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetDriverControlsQCOM);
+
+    // copy argument num
+    GLMessage_DataType *arg_num = glmsg.add_args();
+    arg_num->set_isarray(false);
+    arg_num->set_type(GLMessage::DataType::INT);
+    arg_num->add_intvalue((int)num);
+
+    // copy argument size
+    GLMessage_DataType *arg_size = glmsg.add_args();
+    arg_size->set_isarray(false);
+    arg_size->set_type(GLMessage::DataType::INT);
+    arg_size->add_intvalue(size);
+
+    // copy argument driverControls
+    GLMessage_DataType *arg_driverControls = glmsg.add_args();
+    arg_driverControls->set_isarray(false);
+    arg_driverControls->set_type(GLMessage::DataType::INT);
+    arg_driverControls->add_intvalue((int)driverControls);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetDriverControlsQCOM(num, size, driverControls);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetDriverControlStringQCOM);
+
+    // copy argument driverControl
+    GLMessage_DataType *arg_driverControl = glmsg.add_args();
+    arg_driverControl->set_isarray(false);
+    arg_driverControl->set_type(GLMessage::DataType::INT);
+    arg_driverControl->add_intvalue(driverControl);
+
+    // copy argument bufSize
+    GLMessage_DataType *arg_bufSize = glmsg.add_args();
+    arg_bufSize->set_isarray(false);
+    arg_bufSize->set_type(GLMessage::DataType::INT);
+    arg_bufSize->add_intvalue(bufSize);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue((int)length);
+
+    // copy argument driverControlString
+    GLMessage_DataType *arg_driverControlString = glmsg.add_args();
+    arg_driverControlString->set_isarray(false);
+    arg_driverControlString->set_type(GLMessage::DataType::INT);
+    arg_driverControlString->add_intvalue((int)driverControlString);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetDriverControlStringQCOM(driverControl, bufSize, length, driverControlString);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glEnableDriverControlQCOM(GLuint driverControl) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glEnableDriverControlQCOM);
+
+    // copy argument driverControl
+    GLMessage_DataType *arg_driverControl = glmsg.add_args();
+    arg_driverControl->set_isarray(false);
+    arg_driverControl->set_type(GLMessage::DataType::INT);
+    arg_driverControl->add_intvalue(driverControl);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glEnableDriverControlQCOM(driverControl);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDisableDriverControlQCOM(GLuint driverControl) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDisableDriverControlQCOM);
+
+    // copy argument driverControl
+    GLMessage_DataType *arg_driverControl = glmsg.add_args();
+    arg_driverControl->set_isarray(false);
+    arg_driverControl->set_type(GLMessage::DataType::INT);
+    arg_driverControl->add_intvalue(driverControl);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDisableDriverControlQCOM(driverControl);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetTexturesQCOM(GLuint *textures, GLint maxTextures, GLint *numTextures) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glExtGetTexturesQCOM);
+
+    // copy argument textures
+    GLMessage_DataType *arg_textures = glmsg.add_args();
+    arg_textures->set_isarray(false);
+    arg_textures->set_type(GLMessage::DataType::INT);
+    arg_textures->add_intvalue((int)textures);
+
+    // copy argument maxTextures
+    GLMessage_DataType *arg_maxTextures = glmsg.add_args();
+    arg_maxTextures->set_isarray(false);
+    arg_maxTextures->set_type(GLMessage::DataType::INT);
+    arg_maxTextures->add_intvalue(maxTextures);
+
+    // copy argument numTextures
+    GLMessage_DataType *arg_numTextures = glmsg.add_args();
+    arg_numTextures->set_isarray(false);
+    arg_numTextures->set_type(GLMessage::DataType::INT);
+    arg_numTextures->add_intvalue((int)numTextures);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glExtGetTexturesQCOM(textures, maxTextures, numTextures);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetBuffersQCOM(GLuint *buffers, GLint maxBuffers, GLint *numBuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glExtGetBuffersQCOM);
+
+    // copy argument buffers
+    GLMessage_DataType *arg_buffers = glmsg.add_args();
+    arg_buffers->set_isarray(false);
+    arg_buffers->set_type(GLMessage::DataType::INT);
+    arg_buffers->add_intvalue((int)buffers);
+
+    // copy argument maxBuffers
+    GLMessage_DataType *arg_maxBuffers = glmsg.add_args();
+    arg_maxBuffers->set_isarray(false);
+    arg_maxBuffers->set_type(GLMessage::DataType::INT);
+    arg_maxBuffers->add_intvalue(maxBuffers);
+
+    // copy argument numBuffers
+    GLMessage_DataType *arg_numBuffers = glmsg.add_args();
+    arg_numBuffers->set_isarray(false);
+    arg_numBuffers->set_type(GLMessage::DataType::INT);
+    arg_numBuffers->add_intvalue((int)numBuffers);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glExtGetBuffersQCOM(buffers, maxBuffers, numBuffers);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetRenderbuffersQCOM(GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glExtGetRenderbuffersQCOM);
+
+    // copy argument renderbuffers
+    GLMessage_DataType *arg_renderbuffers = glmsg.add_args();
+    arg_renderbuffers->set_isarray(false);
+    arg_renderbuffers->set_type(GLMessage::DataType::INT);
+    arg_renderbuffers->add_intvalue((int)renderbuffers);
+
+    // copy argument maxRenderbuffers
+    GLMessage_DataType *arg_maxRenderbuffers = glmsg.add_args();
+    arg_maxRenderbuffers->set_isarray(false);
+    arg_maxRenderbuffers->set_type(GLMessage::DataType::INT);
+    arg_maxRenderbuffers->add_intvalue(maxRenderbuffers);
+
+    // copy argument numRenderbuffers
+    GLMessage_DataType *arg_numRenderbuffers = glmsg.add_args();
+    arg_numRenderbuffers->set_isarray(false);
+    arg_numRenderbuffers->set_type(GLMessage::DataType::INT);
+    arg_numRenderbuffers->add_intvalue((int)numRenderbuffers);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glExtGetRenderbuffersQCOM(renderbuffers, maxRenderbuffers, numRenderbuffers);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetFramebuffersQCOM(GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glExtGetFramebuffersQCOM);
+
+    // copy argument framebuffers
+    GLMessage_DataType *arg_framebuffers = glmsg.add_args();
+    arg_framebuffers->set_isarray(false);
+    arg_framebuffers->set_type(GLMessage::DataType::INT);
+    arg_framebuffers->add_intvalue((int)framebuffers);
+
+    // copy argument maxFramebuffers
+    GLMessage_DataType *arg_maxFramebuffers = glmsg.add_args();
+    arg_maxFramebuffers->set_isarray(false);
+    arg_maxFramebuffers->set_type(GLMessage::DataType::INT);
+    arg_maxFramebuffers->add_intvalue(maxFramebuffers);
+
+    // copy argument numFramebuffers
+    GLMessage_DataType *arg_numFramebuffers = glmsg.add_args();
+    arg_numFramebuffers->set_isarray(false);
+    arg_numFramebuffers->set_type(GLMessage::DataType::INT);
+    arg_numFramebuffers->add_intvalue((int)numFramebuffers);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glExtGetFramebuffersQCOM(framebuffers, maxFramebuffers, numFramebuffers);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glExtGetTexLevelParameterivQCOM);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::INT);
+    arg_texture->add_intvalue(texture);
+
+    // copy argument face
+    GLMessage_DataType *arg_face = glmsg.add_args();
+    arg_face->set_isarray(false);
+    arg_face->set_type(GLMessage::DataType::ENUM);
+    arg_face->add_intvalue((int)face);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glExtGetTexLevelParameterivQCOM(texture, face, level, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glExtTexObjectStateOverrideiQCOM);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glExtTexObjectStateOverrideiQCOM(target, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glExtGetTexSubImageQCOM);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // copy argument xoffset
+    GLMessage_DataType *arg_xoffset = glmsg.add_args();
+    arg_xoffset->set_isarray(false);
+    arg_xoffset->set_type(GLMessage::DataType::INT);
+    arg_xoffset->add_intvalue(xoffset);
+
+    // copy argument yoffset
+    GLMessage_DataType *arg_yoffset = glmsg.add_args();
+    arg_yoffset->set_isarray(false);
+    arg_yoffset->set_type(GLMessage::DataType::INT);
+    arg_yoffset->add_intvalue(yoffset);
+
+    // copy argument zoffset
+    GLMessage_DataType *arg_zoffset = glmsg.add_args();
+    arg_zoffset->set_isarray(false);
+    arg_zoffset->set_type(GLMessage::DataType::INT);
+    arg_zoffset->add_intvalue(zoffset);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument depth
+    GLMessage_DataType *arg_depth = glmsg.add_args();
+    arg_depth->set_isarray(false);
+    arg_depth->set_type(GLMessage::DataType::INT);
+    arg_depth->add_intvalue(depth);
+
+    // copy argument format
+    GLMessage_DataType *arg_format = glmsg.add_args();
+    arg_format->set_isarray(false);
+    arg_format->set_type(GLMessage::DataType::ENUM);
+    arg_format->add_intvalue((int)format);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument texels
+    GLMessage_DataType *arg_texels = glmsg.add_args();
+    arg_texels->set_isarray(false);
+    arg_texels->set_type(GLMessage::DataType::INT);
+    arg_texels->add_intvalue((int)texels);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glExtGetTexSubImageQCOM(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetBufferPointervQCOM(GLenum target, GLvoid **params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glExtGetBufferPointervQCOM);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glExtGetBufferPointervQCOM(target, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetShadersQCOM(GLuint *shaders, GLint maxShaders, GLint *numShaders) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glExtGetShadersQCOM);
+
+    // copy argument shaders
+    GLMessage_DataType *arg_shaders = glmsg.add_args();
+    arg_shaders->set_isarray(false);
+    arg_shaders->set_type(GLMessage::DataType::INT);
+    arg_shaders->add_intvalue((int)shaders);
+
+    // copy argument maxShaders
+    GLMessage_DataType *arg_maxShaders = glmsg.add_args();
+    arg_maxShaders->set_isarray(false);
+    arg_maxShaders->set_type(GLMessage::DataType::INT);
+    arg_maxShaders->add_intvalue(maxShaders);
+
+    // copy argument numShaders
+    GLMessage_DataType *arg_numShaders = glmsg.add_args();
+    arg_numShaders->set_isarray(false);
+    arg_numShaders->set_type(GLMessage::DataType::INT);
+    arg_numShaders->add_intvalue((int)numShaders);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glExtGetShadersQCOM(shaders, maxShaders, numShaders);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glExtGetProgramsQCOM(GLuint *programs, GLint maxPrograms, GLint *numPrograms) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glExtGetProgramsQCOM);
+
+    // copy argument programs
+    GLMessage_DataType *arg_programs = glmsg.add_args();
+    arg_programs->set_isarray(false);
+    arg_programs->set_type(GLMessage::DataType::INT);
+    arg_programs->add_intvalue((int)programs);
+
+    // copy argument maxPrograms
+    GLMessage_DataType *arg_maxPrograms = glmsg.add_args();
+    arg_maxPrograms->set_isarray(false);
+    arg_maxPrograms->set_type(GLMessage::DataType::INT);
+    arg_maxPrograms->add_intvalue(maxPrograms);
+
+    // copy argument numPrograms
+    GLMessage_DataType *arg_numPrograms = glmsg.add_args();
+    arg_numPrograms->set_isarray(false);
+    arg_numPrograms->set_type(GLMessage::DataType::INT);
+    arg_numPrograms->add_intvalue((int)numPrograms);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glExtGetProgramsQCOM(programs, maxPrograms, numPrograms);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLboolean GLTrace_glExtIsProgramBinaryQCOM(GLuint program) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glExtIsProgramBinaryQCOM);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glExtIsProgramBinaryQCOM(program);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar *source, GLint *length) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glExtGetProgramBinarySourceQCOM);
+
+    // copy argument program
+    GLMessage_DataType *arg_program = glmsg.add_args();
+    arg_program->set_isarray(false);
+    arg_program->set_type(GLMessage::DataType::INT);
+    arg_program->add_intvalue(program);
+
+    // copy argument shadertype
+    GLMessage_DataType *arg_shadertype = glmsg.add_args();
+    arg_shadertype->set_isarray(false);
+    arg_shadertype->set_type(GLMessage::DataType::ENUM);
+    arg_shadertype->add_intvalue((int)shadertype);
+
+    // copy argument source
+    GLMessage_DataType *arg_source = glmsg.add_args();
+    arg_source->set_isarray(false);
+    arg_source->set_type(GLMessage::DataType::INT);
+    arg_source->add_intvalue((int)source);
+
+    // copy argument length
+    GLMessage_DataType *arg_length = glmsg.add_args();
+    arg_length->set_isarray(false);
+    arg_length->set_type(GLMessage::DataType::INT);
+    arg_length->add_intvalue((int)length);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glExtGetProgramBinarySourceQCOM(program, shadertype, source, length);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glStartTilingQCOM);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // copy argument preserveMask
+    GLMessage_DataType *arg_preserveMask = glmsg.add_args();
+    arg_preserveMask->set_isarray(false);
+    arg_preserveMask->set_type(GLMessage::DataType::INT);
+    arg_preserveMask->add_intvalue(preserveMask);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glStartTilingQCOM(x, y, width, height, preserveMask);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glEndTilingQCOM(GLbitfield preserveMask) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glEndTilingQCOM);
+
+    // copy argument preserveMask
+    GLMessage_DataType *arg_preserveMask = glmsg.add_args();
+    arg_preserveMask->set_isarray(false);
+    arg_preserveMask->set_type(GLMessage::DataType::INT);
+    arg_preserveMask->add_intvalue(preserveMask);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glEndTilingQCOM(preserveMask);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+
+// Definitions for GL1 APIs
+
+void GLTrace_glAlphaFunc(GLenum func, GLclampf ref) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glAlphaFunc);
+
+    // copy argument func
+    GLMessage_DataType *arg_func = glmsg.add_args();
+    arg_func->set_isarray(false);
+    arg_func->set_type(GLMessage::DataType::ENUM);
+    arg_func->add_intvalue((int)func);
+
+    // copy argument ref
+    GLMessage_DataType *arg_ref = glmsg.add_args();
+    arg_ref->set_isarray(false);
+    arg_ref->set_type(GLMessage::DataType::FLOAT);
+    arg_ref->add_floatvalue(ref);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glAlphaFunc(func, ref);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClipPlanef(GLenum plane, const GLfloat *equation) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glClipPlanef);
+
+    // copy argument plane
+    GLMessage_DataType *arg_plane = glmsg.add_args();
+    arg_plane->set_isarray(false);
+    arg_plane->set_type(GLMessage::DataType::ENUM);
+    arg_plane->add_intvalue((int)plane);
+
+    // copy argument equation
+    GLMessage_DataType *arg_equation = glmsg.add_args();
+    arg_equation->set_isarray(false);
+    arg_equation->set_type(GLMessage::DataType::INT);
+    arg_equation->add_intvalue((int)equation);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glClipPlanef(plane, equation);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glColor4f);
+
+    // copy argument red
+    GLMessage_DataType *arg_red = glmsg.add_args();
+    arg_red->set_isarray(false);
+    arg_red->set_type(GLMessage::DataType::FLOAT);
+    arg_red->add_floatvalue(red);
+
+    // copy argument green
+    GLMessage_DataType *arg_green = glmsg.add_args();
+    arg_green->set_isarray(false);
+    arg_green->set_type(GLMessage::DataType::FLOAT);
+    arg_green->add_floatvalue(green);
+
+    // copy argument blue
+    GLMessage_DataType *arg_blue = glmsg.add_args();
+    arg_blue->set_isarray(false);
+    arg_blue->set_type(GLMessage::DataType::FLOAT);
+    arg_blue->add_floatvalue(blue);
+
+    // copy argument alpha
+    GLMessage_DataType *arg_alpha = glmsg.add_args();
+    arg_alpha->set_isarray(false);
+    arg_alpha->set_type(GLMessage::DataType::FLOAT);
+    arg_alpha->add_floatvalue(alpha);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glColor4f(red, green, blue, alpha);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFogf(GLenum pname, GLfloat param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFogf);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::FLOAT);
+    arg_param->add_floatvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFogf(pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFogfv(GLenum pname, const GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFogfv);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFogfv(pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFrustumf);
+
+    // copy argument left
+    GLMessage_DataType *arg_left = glmsg.add_args();
+    arg_left->set_isarray(false);
+    arg_left->set_type(GLMessage::DataType::FLOAT);
+    arg_left->add_floatvalue(left);
+
+    // copy argument right
+    GLMessage_DataType *arg_right = glmsg.add_args();
+    arg_right->set_isarray(false);
+    arg_right->set_type(GLMessage::DataType::FLOAT);
+    arg_right->add_floatvalue(right);
+
+    // copy argument bottom
+    GLMessage_DataType *arg_bottom = glmsg.add_args();
+    arg_bottom->set_isarray(false);
+    arg_bottom->set_type(GLMessage::DataType::FLOAT);
+    arg_bottom->add_floatvalue(bottom);
+
+    // copy argument top
+    GLMessage_DataType *arg_top = glmsg.add_args();
+    arg_top->set_isarray(false);
+    arg_top->set_type(GLMessage::DataType::FLOAT);
+    arg_top->add_floatvalue(top);
+
+    // copy argument zNear
+    GLMessage_DataType *arg_zNear = glmsg.add_args();
+    arg_zNear->set_isarray(false);
+    arg_zNear->set_type(GLMessage::DataType::FLOAT);
+    arg_zNear->add_floatvalue(zNear);
+
+    // copy argument zFar
+    GLMessage_DataType *arg_zFar = glmsg.add_args();
+    arg_zFar->set_isarray(false);
+    arg_zFar->set_type(GLMessage::DataType::FLOAT);
+    arg_zFar->add_floatvalue(zFar);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFrustumf(left, right, bottom, top, zNear, zFar);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetClipPlanef(GLenum pname, GLfloat eqn[4]) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetClipPlanef);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument eqn
+    GLMessage_DataType *arg_eqn = glmsg.add_args();
+    arg_eqn->set_isarray(false);
+    arg_eqn->set_type(GLMessage::DataType::INT);
+    arg_eqn->add_intvalue((int)eqn);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetClipPlanef(pname, eqn);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetLightfv(GLenum light, GLenum pname, GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetLightfv);
+
+    // copy argument light
+    GLMessage_DataType *arg_light = glmsg.add_args();
+    arg_light->set_isarray(false);
+    arg_light->set_type(GLMessage::DataType::ENUM);
+    arg_light->add_intvalue((int)light);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetLightfv(light, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetMaterialfv(GLenum face, GLenum pname, GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetMaterialfv);
+
+    // copy argument face
+    GLMessage_DataType *arg_face = glmsg.add_args();
+    arg_face->set_isarray(false);
+    arg_face->set_type(GLMessage::DataType::ENUM);
+    arg_face->add_intvalue((int)face);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetMaterialfv(face, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexEnvfv(GLenum env, GLenum pname, GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetTexEnvfv);
+
+    // copy argument env
+    GLMessage_DataType *arg_env = glmsg.add_args();
+    arg_env->set_isarray(false);
+    arg_env->set_type(GLMessage::DataType::ENUM);
+    arg_env->add_intvalue((int)env);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetTexEnvfv(env, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightModelf(GLenum pname, GLfloat param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLightModelf);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::FLOAT);
+    arg_param->add_floatvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLightModelf(pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightModelfv(GLenum pname, const GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLightModelfv);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLightModelfv(pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightf(GLenum light, GLenum pname, GLfloat param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLightf);
+
+    // copy argument light
+    GLMessage_DataType *arg_light = glmsg.add_args();
+    arg_light->set_isarray(false);
+    arg_light->set_type(GLMessage::DataType::ENUM);
+    arg_light->add_intvalue((int)light);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::FLOAT);
+    arg_param->add_floatvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLightf(light, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightfv(GLenum light, GLenum pname, const GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLightfv);
+
+    // copy argument light
+    GLMessage_DataType *arg_light = glmsg.add_args();
+    arg_light->set_isarray(false);
+    arg_light->set_type(GLMessage::DataType::ENUM);
+    arg_light->add_intvalue((int)light);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLightfv(light, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLoadMatrixf(const GLfloat *m) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLoadMatrixf);
+
+    // copy argument m
+    GLMessage_DataType *arg_m = glmsg.add_args();
+    arg_m->set_isarray(false);
+    arg_m->set_type(GLMessage::DataType::INT);
+    arg_m->add_intvalue((int)m);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLoadMatrixf(m);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMaterialf(GLenum face, GLenum pname, GLfloat param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMaterialf);
+
+    // copy argument face
+    GLMessage_DataType *arg_face = glmsg.add_args();
+    arg_face->set_isarray(false);
+    arg_face->set_type(GLMessage::DataType::ENUM);
+    arg_face->add_intvalue((int)face);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::FLOAT);
+    arg_param->add_floatvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glMaterialf(face, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMaterialfv(GLenum face, GLenum pname, const GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMaterialfv);
+
+    // copy argument face
+    GLMessage_DataType *arg_face = glmsg.add_args();
+    arg_face->set_isarray(false);
+    arg_face->set_type(GLMessage::DataType::ENUM);
+    arg_face->add_intvalue((int)face);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glMaterialfv(face, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMultMatrixf(const GLfloat *m) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMultMatrixf);
+
+    // copy argument m
+    GLMessage_DataType *arg_m = glmsg.add_args();
+    arg_m->set_isarray(false);
+    arg_m->set_type(GLMessage::DataType::INT);
+    arg_m->add_intvalue((int)m);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glMultMatrixf(m);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMultiTexCoord4f);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument s
+    GLMessage_DataType *arg_s = glmsg.add_args();
+    arg_s->set_isarray(false);
+    arg_s->set_type(GLMessage::DataType::FLOAT);
+    arg_s->add_floatvalue(s);
+
+    // copy argument t
+    GLMessage_DataType *arg_t = glmsg.add_args();
+    arg_t->set_isarray(false);
+    arg_t->set_type(GLMessage::DataType::FLOAT);
+    arg_t->add_floatvalue(t);
+
+    // copy argument r
+    GLMessage_DataType *arg_r = glmsg.add_args();
+    arg_r->set_isarray(false);
+    arg_r->set_type(GLMessage::DataType::FLOAT);
+    arg_r->add_floatvalue(r);
+
+    // copy argument q
+    GLMessage_DataType *arg_q = glmsg.add_args();
+    arg_q->set_isarray(false);
+    arg_q->set_type(GLMessage::DataType::FLOAT);
+    arg_q->add_floatvalue(q);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glMultiTexCoord4f(target, s, t, r, q);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glNormal3f);
+
+    // copy argument nx
+    GLMessage_DataType *arg_nx = glmsg.add_args();
+    arg_nx->set_isarray(false);
+    arg_nx->set_type(GLMessage::DataType::FLOAT);
+    arg_nx->add_floatvalue(nx);
+
+    // copy argument ny
+    GLMessage_DataType *arg_ny = glmsg.add_args();
+    arg_ny->set_isarray(false);
+    arg_ny->set_type(GLMessage::DataType::FLOAT);
+    arg_ny->add_floatvalue(ny);
+
+    // copy argument nz
+    GLMessage_DataType *arg_nz = glmsg.add_args();
+    arg_nz->set_isarray(false);
+    arg_nz->set_type(GLMessage::DataType::FLOAT);
+    arg_nz->add_floatvalue(nz);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glNormal3f(nx, ny, nz);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glOrthof);
+
+    // copy argument left
+    GLMessage_DataType *arg_left = glmsg.add_args();
+    arg_left->set_isarray(false);
+    arg_left->set_type(GLMessage::DataType::FLOAT);
+    arg_left->add_floatvalue(left);
+
+    // copy argument right
+    GLMessage_DataType *arg_right = glmsg.add_args();
+    arg_right->set_isarray(false);
+    arg_right->set_type(GLMessage::DataType::FLOAT);
+    arg_right->add_floatvalue(right);
+
+    // copy argument bottom
+    GLMessage_DataType *arg_bottom = glmsg.add_args();
+    arg_bottom->set_isarray(false);
+    arg_bottom->set_type(GLMessage::DataType::FLOAT);
+    arg_bottom->add_floatvalue(bottom);
+
+    // copy argument top
+    GLMessage_DataType *arg_top = glmsg.add_args();
+    arg_top->set_isarray(false);
+    arg_top->set_type(GLMessage::DataType::FLOAT);
+    arg_top->add_floatvalue(top);
+
+    // copy argument zNear
+    GLMessage_DataType *arg_zNear = glmsg.add_args();
+    arg_zNear->set_isarray(false);
+    arg_zNear->set_type(GLMessage::DataType::FLOAT);
+    arg_zNear->add_floatvalue(zNear);
+
+    // copy argument zFar
+    GLMessage_DataType *arg_zFar = glmsg.add_args();
+    arg_zFar->set_isarray(false);
+    arg_zFar->set_type(GLMessage::DataType::FLOAT);
+    arg_zFar->add_floatvalue(zFar);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glOrthof(left, right, bottom, top, zNear, zFar);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointParameterf(GLenum pname, GLfloat param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPointParameterf);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::FLOAT);
+    arg_param->add_floatvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPointParameterf(pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointParameterfv(GLenum pname, const GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPointParameterfv);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPointParameterfv(pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointSize(GLfloat size) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPointSize);
+
+    // copy argument size
+    GLMessage_DataType *arg_size = glmsg.add_args();
+    arg_size->set_isarray(false);
+    arg_size->set_type(GLMessage::DataType::FLOAT);
+    arg_size->add_floatvalue(size);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPointSize(size);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glRotatef);
+
+    // copy argument angle
+    GLMessage_DataType *arg_angle = glmsg.add_args();
+    arg_angle->set_isarray(false);
+    arg_angle->set_type(GLMessage::DataType::FLOAT);
+    arg_angle->add_floatvalue(angle);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::FLOAT);
+    arg_y->add_floatvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::FLOAT);
+    arg_z->add_floatvalue(z);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glRotatef(angle, x, y, z);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glScalef(GLfloat x, GLfloat y, GLfloat z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glScalef);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::FLOAT);
+    arg_y->add_floatvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::FLOAT);
+    arg_z->add_floatvalue(z);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glScalef(x, y, z);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexEnvf(GLenum target, GLenum pname, GLfloat param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexEnvf);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::FLOAT);
+    arg_param->add_floatvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexEnvf(target, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexEnvfv(GLenum target, GLenum pname, const GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexEnvfv);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexEnvfv(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTranslatef(GLfloat x, GLfloat y, GLfloat z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTranslatef);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::FLOAT);
+    arg_y->add_floatvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::FLOAT);
+    arg_z->add_floatvalue(z);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTranslatef(x, y, z);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glAlphaFuncx(GLenum func, GLclampx ref) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glAlphaFuncx);
+
+    // copy argument func
+    GLMessage_DataType *arg_func = glmsg.add_args();
+    arg_func->set_isarray(false);
+    arg_func->set_type(GLMessage::DataType::ENUM);
+    arg_func->add_intvalue((int)func);
+
+    // copy argument ref
+    GLMessage_DataType *arg_ref = glmsg.add_args();
+    arg_ref->set_isarray(false);
+    arg_ref->set_type(GLMessage::DataType::INT);
+    arg_ref->add_intvalue(ref);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glAlphaFuncx(func, ref);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glClearColorx);
+
+    // copy argument red
+    GLMessage_DataType *arg_red = glmsg.add_args();
+    arg_red->set_isarray(false);
+    arg_red->set_type(GLMessage::DataType::INT);
+    arg_red->add_intvalue(red);
+
+    // copy argument green
+    GLMessage_DataType *arg_green = glmsg.add_args();
+    arg_green->set_isarray(false);
+    arg_green->set_type(GLMessage::DataType::INT);
+    arg_green->add_intvalue(green);
+
+    // copy argument blue
+    GLMessage_DataType *arg_blue = glmsg.add_args();
+    arg_blue->set_isarray(false);
+    arg_blue->set_type(GLMessage::DataType::INT);
+    arg_blue->add_intvalue(blue);
+
+    // copy argument alpha
+    GLMessage_DataType *arg_alpha = glmsg.add_args();
+    arg_alpha->set_isarray(false);
+    arg_alpha->set_type(GLMessage::DataType::INT);
+    arg_alpha->add_intvalue(alpha);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glClearColorx(red, green, blue, alpha);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClearDepthx(GLclampx depth) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glClearDepthx);
+
+    // copy argument depth
+    GLMessage_DataType *arg_depth = glmsg.add_args();
+    arg_depth->set_isarray(false);
+    arg_depth->set_type(GLMessage::DataType::INT);
+    arg_depth->add_intvalue(depth);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glClearDepthx(depth);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClientActiveTexture(GLenum texture) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glClientActiveTexture);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::ENUM);
+    arg_texture->add_intvalue((int)texture);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glClientActiveTexture(texture);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClipPlanex(GLenum plane, const GLfixed *equation) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glClipPlanex);
+
+    // copy argument plane
+    GLMessage_DataType *arg_plane = glmsg.add_args();
+    arg_plane->set_isarray(false);
+    arg_plane->set_type(GLMessage::DataType::ENUM);
+    arg_plane->add_intvalue((int)plane);
+
+    // copy argument equation
+    GLMessage_DataType *arg_equation = glmsg.add_args();
+    arg_equation->set_isarray(false);
+    arg_equation->set_type(GLMessage::DataType::INT);
+    arg_equation->add_intvalue((int)equation);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glClipPlanex(plane, equation);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glColor4ub);
+
+    // copy argument red
+    GLMessage_DataType *arg_red = glmsg.add_args();
+    arg_red->set_isarray(false);
+    arg_red->set_type(GLMessage::DataType::BYTE);
+    arg_red->add_intvalue((int)red);
+
+    // copy argument green
+    GLMessage_DataType *arg_green = glmsg.add_args();
+    arg_green->set_isarray(false);
+    arg_green->set_type(GLMessage::DataType::BYTE);
+    arg_green->add_intvalue((int)green);
+
+    // copy argument blue
+    GLMessage_DataType *arg_blue = glmsg.add_args();
+    arg_blue->set_isarray(false);
+    arg_blue->set_type(GLMessage::DataType::BYTE);
+    arg_blue->add_intvalue((int)blue);
+
+    // copy argument alpha
+    GLMessage_DataType *arg_alpha = glmsg.add_args();
+    arg_alpha->set_isarray(false);
+    arg_alpha->set_type(GLMessage::DataType::BYTE);
+    arg_alpha->add_intvalue((int)alpha);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glColor4ub(red, green, blue, alpha);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glColor4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glColor4x);
+
+    // copy argument red
+    GLMessage_DataType *arg_red = glmsg.add_args();
+    arg_red->set_isarray(false);
+    arg_red->set_type(GLMessage::DataType::INT);
+    arg_red->add_intvalue(red);
+
+    // copy argument green
+    GLMessage_DataType *arg_green = glmsg.add_args();
+    arg_green->set_isarray(false);
+    arg_green->set_type(GLMessage::DataType::INT);
+    arg_green->add_intvalue(green);
+
+    // copy argument blue
+    GLMessage_DataType *arg_blue = glmsg.add_args();
+    arg_blue->set_isarray(false);
+    arg_blue->set_type(GLMessage::DataType::INT);
+    arg_blue->add_intvalue(blue);
+
+    // copy argument alpha
+    GLMessage_DataType *arg_alpha = glmsg.add_args();
+    arg_alpha->set_isarray(false);
+    arg_alpha->set_type(GLMessage::DataType::INT);
+    arg_alpha->add_intvalue(alpha);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glColor4x(red, green, blue, alpha);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glColorPointer);
+
+    // copy argument size
+    GLMessage_DataType *arg_size = glmsg.add_args();
+    arg_size->set_isarray(false);
+    arg_size->set_type(GLMessage::DataType::INT);
+    arg_size->add_intvalue(size);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument stride
+    GLMessage_DataType *arg_stride = glmsg.add_args();
+    arg_stride->set_isarray(false);
+    arg_stride->set_type(GLMessage::DataType::INT);
+    arg_stride->add_intvalue(stride);
+
+    // copy argument pointer
+    GLMessage_DataType *arg_pointer = glmsg.add_args();
+    arg_pointer->set_isarray(false);
+    arg_pointer->set_type(GLMessage::DataType::INT);
+    arg_pointer->add_intvalue((int)pointer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glColorPointer(size, type, stride, pointer);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDepthRangex(GLclampx zNear, GLclampx zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDepthRangex);
+
+    // copy argument zNear
+    GLMessage_DataType *arg_zNear = glmsg.add_args();
+    arg_zNear->set_isarray(false);
+    arg_zNear->set_type(GLMessage::DataType::INT);
+    arg_zNear->add_intvalue(zNear);
+
+    // copy argument zFar
+    GLMessage_DataType *arg_zFar = glmsg.add_args();
+    arg_zFar->set_isarray(false);
+    arg_zFar->set_type(GLMessage::DataType::INT);
+    arg_zFar->add_intvalue(zFar);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDepthRangex(zNear, zFar);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDisableClientState(GLenum array) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDisableClientState);
+
+    // copy argument array
+    GLMessage_DataType *arg_array = glmsg.add_args();
+    arg_array->set_isarray(false);
+    arg_array->set_type(GLMessage::DataType::ENUM);
+    arg_array->add_intvalue((int)array);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDisableClientState(array);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glEnableClientState(GLenum array) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glEnableClientState);
+
+    // copy argument array
+    GLMessage_DataType *arg_array = glmsg.add_args();
+    arg_array->set_isarray(false);
+    arg_array->set_type(GLMessage::DataType::ENUM);
+    arg_array->add_intvalue((int)array);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glEnableClientState(array);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFogx(GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFogx);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFogx(pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFogxv(GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFogxv);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFogxv(pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFrustumx(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFrustumx);
+
+    // copy argument left
+    GLMessage_DataType *arg_left = glmsg.add_args();
+    arg_left->set_isarray(false);
+    arg_left->set_type(GLMessage::DataType::INT);
+    arg_left->add_intvalue(left);
+
+    // copy argument right
+    GLMessage_DataType *arg_right = glmsg.add_args();
+    arg_right->set_isarray(false);
+    arg_right->set_type(GLMessage::DataType::INT);
+    arg_right->add_intvalue(right);
+
+    // copy argument bottom
+    GLMessage_DataType *arg_bottom = glmsg.add_args();
+    arg_bottom->set_isarray(false);
+    arg_bottom->set_type(GLMessage::DataType::INT);
+    arg_bottom->add_intvalue(bottom);
+
+    // copy argument top
+    GLMessage_DataType *arg_top = glmsg.add_args();
+    arg_top->set_isarray(false);
+    arg_top->set_type(GLMessage::DataType::INT);
+    arg_top->add_intvalue(top);
+
+    // copy argument zNear
+    GLMessage_DataType *arg_zNear = glmsg.add_args();
+    arg_zNear->set_isarray(false);
+    arg_zNear->set_type(GLMessage::DataType::INT);
+    arg_zNear->add_intvalue(zNear);
+
+    // copy argument zFar
+    GLMessage_DataType *arg_zFar = glmsg.add_args();
+    arg_zFar->set_isarray(false);
+    arg_zFar->set_type(GLMessage::DataType::INT);
+    arg_zFar->add_intvalue(zFar);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFrustumx(left, right, bottom, top, zNear, zFar);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetClipPlanex(GLenum pname, GLfixed eqn[4]) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetClipPlanex);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument eqn
+    GLMessage_DataType *arg_eqn = glmsg.add_args();
+    arg_eqn->set_isarray(false);
+    arg_eqn->set_type(GLMessage::DataType::INT);
+    arg_eqn->add_intvalue((int)eqn);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetClipPlanex(pname, eqn);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetFixedv(GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetFixedv);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetFixedv(pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetLightxv(GLenum light, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetLightxv);
+
+    // copy argument light
+    GLMessage_DataType *arg_light = glmsg.add_args();
+    arg_light->set_isarray(false);
+    arg_light->set_type(GLMessage::DataType::ENUM);
+    arg_light->add_intvalue((int)light);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetLightxv(light, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetMaterialxv(GLenum face, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetMaterialxv);
+
+    // copy argument face
+    GLMessage_DataType *arg_face = glmsg.add_args();
+    arg_face->set_isarray(false);
+    arg_face->set_type(GLMessage::DataType::ENUM);
+    arg_face->add_intvalue((int)face);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetMaterialxv(face, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetPointerv(GLenum pname, GLvoid **params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetPointerv);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetPointerv(pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexEnviv(GLenum env, GLenum pname, GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetTexEnviv);
+
+    // copy argument env
+    GLMessage_DataType *arg_env = glmsg.add_args();
+    arg_env->set_isarray(false);
+    arg_env->set_type(GLMessage::DataType::ENUM);
+    arg_env->add_intvalue((int)env);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetTexEnviv(env, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexEnvxv(GLenum env, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetTexEnvxv);
+
+    // copy argument env
+    GLMessage_DataType *arg_env = glmsg.add_args();
+    arg_env->set_isarray(false);
+    arg_env->set_type(GLMessage::DataType::ENUM);
+    arg_env->add_intvalue((int)env);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetTexEnvxv(env, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexParameterxv(GLenum target, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetTexParameterxv);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetTexParameterxv(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightModelx(GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLightModelx);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLightModelx(pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightModelxv(GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLightModelxv);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLightModelxv(pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightx(GLenum light, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLightx);
+
+    // copy argument light
+    GLMessage_DataType *arg_light = glmsg.add_args();
+    arg_light->set_isarray(false);
+    arg_light->set_type(GLMessage::DataType::ENUM);
+    arg_light->add_intvalue((int)light);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLightx(light, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightxv(GLenum light, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLightxv);
+
+    // copy argument light
+    GLMessage_DataType *arg_light = glmsg.add_args();
+    arg_light->set_isarray(false);
+    arg_light->set_type(GLMessage::DataType::ENUM);
+    arg_light->add_intvalue((int)light);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLightxv(light, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLineWidthx(GLfixed width) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLineWidthx);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLineWidthx(width);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLoadIdentity(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLoadIdentity);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLoadIdentity();
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLoadMatrixx(const GLfixed *m) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLoadMatrixx);
+
+    // copy argument m
+    GLMessage_DataType *arg_m = glmsg.add_args();
+    arg_m->set_isarray(false);
+    arg_m->set_type(GLMessage::DataType::INT);
+    arg_m->add_intvalue((int)m);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLoadMatrixx(m);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLogicOp(GLenum opcode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLogicOp);
+
+    // copy argument opcode
+    GLMessage_DataType *arg_opcode = glmsg.add_args();
+    arg_opcode->set_isarray(false);
+    arg_opcode->set_type(GLMessage::DataType::ENUM);
+    arg_opcode->add_intvalue((int)opcode);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLogicOp(opcode);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMaterialx(GLenum face, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMaterialx);
+
+    // copy argument face
+    GLMessage_DataType *arg_face = glmsg.add_args();
+    arg_face->set_isarray(false);
+    arg_face->set_type(GLMessage::DataType::ENUM);
+    arg_face->add_intvalue((int)face);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glMaterialx(face, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMaterialxv(GLenum face, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMaterialxv);
+
+    // copy argument face
+    GLMessage_DataType *arg_face = glmsg.add_args();
+    arg_face->set_isarray(false);
+    arg_face->set_type(GLMessage::DataType::ENUM);
+    arg_face->add_intvalue((int)face);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glMaterialxv(face, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMatrixMode(GLenum mode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMatrixMode);
+
+    // copy argument mode
+    GLMessage_DataType *arg_mode = glmsg.add_args();
+    arg_mode->set_isarray(false);
+    arg_mode->set_type(GLMessage::DataType::ENUM);
+    arg_mode->add_intvalue((int)mode);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glMatrixMode(mode);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMultMatrixx(const GLfixed *m) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMultMatrixx);
+
+    // copy argument m
+    GLMessage_DataType *arg_m = glmsg.add_args();
+    arg_m->set_isarray(false);
+    arg_m->set_type(GLMessage::DataType::INT);
+    arg_m->add_intvalue((int)m);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glMultMatrixx(m);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMultiTexCoord4x(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMultiTexCoord4x);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument s
+    GLMessage_DataType *arg_s = glmsg.add_args();
+    arg_s->set_isarray(false);
+    arg_s->set_type(GLMessage::DataType::INT);
+    arg_s->add_intvalue(s);
+
+    // copy argument t
+    GLMessage_DataType *arg_t = glmsg.add_args();
+    arg_t->set_isarray(false);
+    arg_t->set_type(GLMessage::DataType::INT);
+    arg_t->add_intvalue(t);
+
+    // copy argument r
+    GLMessage_DataType *arg_r = glmsg.add_args();
+    arg_r->set_isarray(false);
+    arg_r->set_type(GLMessage::DataType::INT);
+    arg_r->add_intvalue(r);
+
+    // copy argument q
+    GLMessage_DataType *arg_q = glmsg.add_args();
+    arg_q->set_isarray(false);
+    arg_q->set_type(GLMessage::DataType::INT);
+    arg_q->add_intvalue(q);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glMultiTexCoord4x(target, s, t, r, q);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glNormal3x(GLfixed nx, GLfixed ny, GLfixed nz) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glNormal3x);
+
+    // copy argument nx
+    GLMessage_DataType *arg_nx = glmsg.add_args();
+    arg_nx->set_isarray(false);
+    arg_nx->set_type(GLMessage::DataType::INT);
+    arg_nx->add_intvalue(nx);
+
+    // copy argument ny
+    GLMessage_DataType *arg_ny = glmsg.add_args();
+    arg_ny->set_isarray(false);
+    arg_ny->set_type(GLMessage::DataType::INT);
+    arg_ny->add_intvalue(ny);
+
+    // copy argument nz
+    GLMessage_DataType *arg_nz = glmsg.add_args();
+    arg_nz->set_isarray(false);
+    arg_nz->set_type(GLMessage::DataType::INT);
+    arg_nz->add_intvalue(nz);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glNormal3x(nx, ny, nz);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glNormalPointer(GLenum type, GLsizei stride, const GLvoid *pointer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glNormalPointer);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument stride
+    GLMessage_DataType *arg_stride = glmsg.add_args();
+    arg_stride->set_isarray(false);
+    arg_stride->set_type(GLMessage::DataType::INT);
+    arg_stride->add_intvalue(stride);
+
+    // copy argument pointer
+    GLMessage_DataType *arg_pointer = glmsg.add_args();
+    arg_pointer->set_isarray(false);
+    arg_pointer->set_type(GLMessage::DataType::INT);
+    arg_pointer->add_intvalue((int)pointer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glNormalPointer(type, stride, pointer);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glOrthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glOrthox);
+
+    // copy argument left
+    GLMessage_DataType *arg_left = glmsg.add_args();
+    arg_left->set_isarray(false);
+    arg_left->set_type(GLMessage::DataType::INT);
+    arg_left->add_intvalue(left);
+
+    // copy argument right
+    GLMessage_DataType *arg_right = glmsg.add_args();
+    arg_right->set_isarray(false);
+    arg_right->set_type(GLMessage::DataType::INT);
+    arg_right->add_intvalue(right);
+
+    // copy argument bottom
+    GLMessage_DataType *arg_bottom = glmsg.add_args();
+    arg_bottom->set_isarray(false);
+    arg_bottom->set_type(GLMessage::DataType::INT);
+    arg_bottom->add_intvalue(bottom);
+
+    // copy argument top
+    GLMessage_DataType *arg_top = glmsg.add_args();
+    arg_top->set_isarray(false);
+    arg_top->set_type(GLMessage::DataType::INT);
+    arg_top->add_intvalue(top);
+
+    // copy argument zNear
+    GLMessage_DataType *arg_zNear = glmsg.add_args();
+    arg_zNear->set_isarray(false);
+    arg_zNear->set_type(GLMessage::DataType::INT);
+    arg_zNear->add_intvalue(zNear);
+
+    // copy argument zFar
+    GLMessage_DataType *arg_zFar = glmsg.add_args();
+    arg_zFar->set_isarray(false);
+    arg_zFar->set_type(GLMessage::DataType::INT);
+    arg_zFar->add_intvalue(zFar);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glOrthox(left, right, bottom, top, zNear, zFar);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointParameterx(GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPointParameterx);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPointParameterx(pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointParameterxv(GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPointParameterxv);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPointParameterxv(pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointSizex(GLfixed size) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPointSizex);
+
+    // copy argument size
+    GLMessage_DataType *arg_size = glmsg.add_args();
+    arg_size->set_isarray(false);
+    arg_size->set_type(GLMessage::DataType::INT);
+    arg_size->add_intvalue(size);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPointSizex(size);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPolygonOffsetx(GLfixed factor, GLfixed units) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPolygonOffsetx);
+
+    // copy argument factor
+    GLMessage_DataType *arg_factor = glmsg.add_args();
+    arg_factor->set_isarray(false);
+    arg_factor->set_type(GLMessage::DataType::INT);
+    arg_factor->add_intvalue(factor);
+
+    // copy argument units
+    GLMessage_DataType *arg_units = glmsg.add_args();
+    arg_units->set_isarray(false);
+    arg_units->set_type(GLMessage::DataType::INT);
+    arg_units->add_intvalue(units);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPolygonOffsetx(factor, units);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPopMatrix(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPopMatrix);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPopMatrix();
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPushMatrix(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPushMatrix);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPushMatrix();
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glRotatex);
+
+    // copy argument angle
+    GLMessage_DataType *arg_angle = glmsg.add_args();
+    arg_angle->set_isarray(false);
+    arg_angle->set_type(GLMessage::DataType::INT);
+    arg_angle->add_intvalue(angle);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::INT);
+    arg_z->add_intvalue(z);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glRotatex(angle, x, y, z);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glSampleCoveragex(GLclampx value, GLboolean invert) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glSampleCoveragex);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue(value);
+
+    // copy argument invert
+    GLMessage_DataType *arg_invert = glmsg.add_args();
+    arg_invert->set_isarray(false);
+    arg_invert->set_type(GLMessage::DataType::BOOL);
+    arg_invert->add_boolvalue(invert);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glSampleCoveragex(value, invert);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glScalex(GLfixed x, GLfixed y, GLfixed z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glScalex);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::INT);
+    arg_z->add_intvalue(z);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glScalex(x, y, z);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glShadeModel(GLenum mode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glShadeModel);
+
+    // copy argument mode
+    GLMessage_DataType *arg_mode = glmsg.add_args();
+    arg_mode->set_isarray(false);
+    arg_mode->set_type(GLMessage::DataType::ENUM);
+    arg_mode->add_intvalue((int)mode);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glShadeModel(mode);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexCoordPointer);
+
+    // copy argument size
+    GLMessage_DataType *arg_size = glmsg.add_args();
+    arg_size->set_isarray(false);
+    arg_size->set_type(GLMessage::DataType::INT);
+    arg_size->add_intvalue(size);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument stride
+    GLMessage_DataType *arg_stride = glmsg.add_args();
+    arg_stride->set_isarray(false);
+    arg_stride->set_type(GLMessage::DataType::INT);
+    arg_stride->add_intvalue(stride);
+
+    // copy argument pointer
+    GLMessage_DataType *arg_pointer = glmsg.add_args();
+    arg_pointer->set_isarray(false);
+    arg_pointer->set_type(GLMessage::DataType::INT);
+    arg_pointer->add_intvalue((int)pointer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexCoordPointer(size, type, stride, pointer);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexEnvi(GLenum target, GLenum pname, GLint param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexEnvi);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexEnvi(target, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexEnvx(GLenum target, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexEnvx);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexEnvx(target, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexEnviv(GLenum target, GLenum pname, const GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexEnviv);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexEnviv(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexEnvxv(GLenum target, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexEnvxv);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexEnvxv(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexParameterx(GLenum target, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexParameterx);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexParameterx(target, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexParameterxv(GLenum target, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexParameterxv);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexParameterxv(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTranslatex(GLfixed x, GLfixed y, GLfixed z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTranslatex);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::INT);
+    arg_z->add_intvalue(z);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTranslatex(x, y, z);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glVertexPointer);
+
+    // copy argument size
+    GLMessage_DataType *arg_size = glmsg.add_args();
+    arg_size->set_isarray(false);
+    arg_size->set_type(GLMessage::DataType::INT);
+    arg_size->add_intvalue(size);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument stride
+    GLMessage_DataType *arg_stride = glmsg.add_args();
+    arg_stride->set_isarray(false);
+    arg_stride->set_type(GLMessage::DataType::INT);
+    arg_stride->add_intvalue(stride);
+
+    // copy argument pointer
+    GLMessage_DataType *arg_pointer = glmsg.add_args();
+    arg_pointer->set_isarray(false);
+    arg_pointer->set_type(GLMessage::DataType::INT);
+    arg_pointer->add_intvalue((int)pointer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glVertexPointer(size, type, stride, pointer);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointSizePointerOES(GLenum type, GLsizei stride, const GLvoid *pointer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPointSizePointerOES);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument stride
+    GLMessage_DataType *arg_stride = glmsg.add_args();
+    arg_stride->set_isarray(false);
+    arg_stride->set_type(GLMessage::DataType::INT);
+    arg_stride->add_intvalue(stride);
+
+    // copy argument pointer
+    GLMessage_DataType *arg_pointer = glmsg.add_args();
+    arg_pointer->set_isarray(false);
+    arg_pointer->set_type(GLMessage::DataType::INT);
+    arg_pointer->add_intvalue((int)pointer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPointSizePointerOES(type, stride, pointer);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+
+// Definitions for GL1Ext APIs
+
+void GLTrace_glBlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBlendEquationSeparateOES);
+
+    // copy argument modeRGB
+    GLMessage_DataType *arg_modeRGB = glmsg.add_args();
+    arg_modeRGB->set_isarray(false);
+    arg_modeRGB->set_type(GLMessage::DataType::ENUM);
+    arg_modeRGB->add_intvalue((int)modeRGB);
+
+    // copy argument modeAlpha
+    GLMessage_DataType *arg_modeAlpha = glmsg.add_args();
+    arg_modeAlpha->set_isarray(false);
+    arg_modeAlpha->set_type(GLMessage::DataType::ENUM);
+    arg_modeAlpha->add_intvalue((int)modeAlpha);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBlendEquationSeparateOES(modeRGB, modeAlpha);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBlendFuncSeparateOES);
+
+    // copy argument srcRGB
+    GLMessage_DataType *arg_srcRGB = glmsg.add_args();
+    arg_srcRGB->set_isarray(false);
+    arg_srcRGB->set_type(GLMessage::DataType::ENUM);
+    arg_srcRGB->add_intvalue((int)srcRGB);
+
+    // copy argument dstRGB
+    GLMessage_DataType *arg_dstRGB = glmsg.add_args();
+    arg_dstRGB->set_isarray(false);
+    arg_dstRGB->set_type(GLMessage::DataType::ENUM);
+    arg_dstRGB->add_intvalue((int)dstRGB);
+
+    // copy argument srcAlpha
+    GLMessage_DataType *arg_srcAlpha = glmsg.add_args();
+    arg_srcAlpha->set_isarray(false);
+    arg_srcAlpha->set_type(GLMessage::DataType::ENUM);
+    arg_srcAlpha->add_intvalue((int)srcAlpha);
+
+    // copy argument dstAlpha
+    GLMessage_DataType *arg_dstAlpha = glmsg.add_args();
+    arg_dstAlpha->set_isarray(false);
+    arg_dstAlpha->set_type(GLMessage::DataType::ENUM);
+    arg_dstAlpha->add_intvalue((int)dstAlpha);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBlendFuncSeparateOES(srcRGB, dstRGB, srcAlpha, dstAlpha);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glBlendEquationOES(GLenum mode) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBlendEquationOES);
+
+    // copy argument mode
+    GLMessage_DataType *arg_mode = glmsg.add_args();
+    arg_mode->set_isarray(false);
+    arg_mode->set_type(GLMessage::DataType::ENUM);
+    arg_mode->add_intvalue((int)mode);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBlendEquationOES(mode);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDrawTexsOES);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::INT);
+    arg_z->add_intvalue(z);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDrawTexsOES(x, y, z, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDrawTexiOES);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::INT);
+    arg_z->add_intvalue(z);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDrawTexiOES(x, y, z, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDrawTexxOES);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::INT);
+    arg_z->add_intvalue(z);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDrawTexxOES(x, y, z, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawTexsvOES(const GLshort *coords) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDrawTexsvOES);
+
+    // copy argument coords
+    GLMessage_DataType *arg_coords = glmsg.add_args();
+    arg_coords->set_isarray(false);
+    arg_coords->set_type(GLMessage::DataType::INT);
+    arg_coords->add_intvalue((int)coords);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDrawTexsvOES(coords);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawTexivOES(const GLint *coords) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDrawTexivOES);
+
+    // copy argument coords
+    GLMessage_DataType *arg_coords = glmsg.add_args();
+    arg_coords->set_isarray(false);
+    arg_coords->set_type(GLMessage::DataType::INT);
+    arg_coords->add_intvalue((int)coords);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDrawTexivOES(coords);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawTexxvOES(const GLfixed *coords) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDrawTexxvOES);
+
+    // copy argument coords
+    GLMessage_DataType *arg_coords = glmsg.add_args();
+    arg_coords->set_isarray(false);
+    arg_coords->set_type(GLMessage::DataType::INT);
+    arg_coords->add_intvalue((int)coords);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDrawTexxvOES(coords);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDrawTexfOES);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::FLOAT);
+    arg_x->add_floatvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::FLOAT);
+    arg_y->add_floatvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::FLOAT);
+    arg_z->add_floatvalue(z);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::FLOAT);
+    arg_width->add_floatvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::FLOAT);
+    arg_height->add_floatvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDrawTexfOES(x, y, z, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDrawTexfvOES(const GLfloat *coords) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDrawTexfvOES);
+
+    // copy argument coords
+    GLMessage_DataType *arg_coords = glmsg.add_args();
+    arg_coords->set_isarray(false);
+    arg_coords->set_type(GLMessage::DataType::INT);
+    arg_coords->add_intvalue((int)coords);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDrawTexfvOES(coords);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glAlphaFuncxOES(GLenum func, GLclampx ref) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glAlphaFuncxOES);
+
+    // copy argument func
+    GLMessage_DataType *arg_func = glmsg.add_args();
+    arg_func->set_isarray(false);
+    arg_func->set_type(GLMessage::DataType::ENUM);
+    arg_func->add_intvalue((int)func);
+
+    // copy argument ref
+    GLMessage_DataType *arg_ref = glmsg.add_args();
+    arg_ref->set_isarray(false);
+    arg_ref->set_type(GLMessage::DataType::INT);
+    arg_ref->add_intvalue(ref);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glAlphaFuncxOES(func, ref);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClearColorxOES(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glClearColorxOES);
+
+    // copy argument red
+    GLMessage_DataType *arg_red = glmsg.add_args();
+    arg_red->set_isarray(false);
+    arg_red->set_type(GLMessage::DataType::INT);
+    arg_red->add_intvalue(red);
+
+    // copy argument green
+    GLMessage_DataType *arg_green = glmsg.add_args();
+    arg_green->set_isarray(false);
+    arg_green->set_type(GLMessage::DataType::INT);
+    arg_green->add_intvalue(green);
+
+    // copy argument blue
+    GLMessage_DataType *arg_blue = glmsg.add_args();
+    arg_blue->set_isarray(false);
+    arg_blue->set_type(GLMessage::DataType::INT);
+    arg_blue->add_intvalue(blue);
+
+    // copy argument alpha
+    GLMessage_DataType *arg_alpha = glmsg.add_args();
+    arg_alpha->set_isarray(false);
+    arg_alpha->set_type(GLMessage::DataType::INT);
+    arg_alpha->add_intvalue(alpha);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glClearColorxOES(red, green, blue, alpha);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClearDepthxOES(GLclampx depth) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glClearDepthxOES);
+
+    // copy argument depth
+    GLMessage_DataType *arg_depth = glmsg.add_args();
+    arg_depth->set_isarray(false);
+    arg_depth->set_type(GLMessage::DataType::INT);
+    arg_depth->add_intvalue(depth);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glClearDepthxOES(depth);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClipPlanexOES(GLenum plane, const GLfixed *equation) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glClipPlanexOES);
+
+    // copy argument plane
+    GLMessage_DataType *arg_plane = glmsg.add_args();
+    arg_plane->set_isarray(false);
+    arg_plane->set_type(GLMessage::DataType::ENUM);
+    arg_plane->add_intvalue((int)plane);
+
+    // copy argument equation
+    GLMessage_DataType *arg_equation = glmsg.add_args();
+    arg_equation->set_isarray(false);
+    arg_equation->set_type(GLMessage::DataType::INT);
+    arg_equation->add_intvalue((int)equation);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glClipPlanexOES(plane, equation);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glColor4xOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glColor4xOES);
+
+    // copy argument red
+    GLMessage_DataType *arg_red = glmsg.add_args();
+    arg_red->set_isarray(false);
+    arg_red->set_type(GLMessage::DataType::INT);
+    arg_red->add_intvalue(red);
+
+    // copy argument green
+    GLMessage_DataType *arg_green = glmsg.add_args();
+    arg_green->set_isarray(false);
+    arg_green->set_type(GLMessage::DataType::INT);
+    arg_green->add_intvalue(green);
+
+    // copy argument blue
+    GLMessage_DataType *arg_blue = glmsg.add_args();
+    arg_blue->set_isarray(false);
+    arg_blue->set_type(GLMessage::DataType::INT);
+    arg_blue->add_intvalue(blue);
+
+    // copy argument alpha
+    GLMessage_DataType *arg_alpha = glmsg.add_args();
+    arg_alpha->set_isarray(false);
+    arg_alpha->set_type(GLMessage::DataType::INT);
+    arg_alpha->add_intvalue(alpha);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glColor4xOES(red, green, blue, alpha);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDepthRangexOES(GLclampx zNear, GLclampx zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDepthRangexOES);
+
+    // copy argument zNear
+    GLMessage_DataType *arg_zNear = glmsg.add_args();
+    arg_zNear->set_isarray(false);
+    arg_zNear->set_type(GLMessage::DataType::INT);
+    arg_zNear->add_intvalue(zNear);
+
+    // copy argument zFar
+    GLMessage_DataType *arg_zFar = glmsg.add_args();
+    arg_zFar->set_isarray(false);
+    arg_zFar->set_type(GLMessage::DataType::INT);
+    arg_zFar->add_intvalue(zFar);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDepthRangexOES(zNear, zFar);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFogxOES(GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFogxOES);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFogxOES(pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFogxvOES(GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFogxvOES);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFogxvOES(pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFrustumxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFrustumxOES);
+
+    // copy argument left
+    GLMessage_DataType *arg_left = glmsg.add_args();
+    arg_left->set_isarray(false);
+    arg_left->set_type(GLMessage::DataType::INT);
+    arg_left->add_intvalue(left);
+
+    // copy argument right
+    GLMessage_DataType *arg_right = glmsg.add_args();
+    arg_right->set_isarray(false);
+    arg_right->set_type(GLMessage::DataType::INT);
+    arg_right->add_intvalue(right);
+
+    // copy argument bottom
+    GLMessage_DataType *arg_bottom = glmsg.add_args();
+    arg_bottom->set_isarray(false);
+    arg_bottom->set_type(GLMessage::DataType::INT);
+    arg_bottom->add_intvalue(bottom);
+
+    // copy argument top
+    GLMessage_DataType *arg_top = glmsg.add_args();
+    arg_top->set_isarray(false);
+    arg_top->set_type(GLMessage::DataType::INT);
+    arg_top->add_intvalue(top);
+
+    // copy argument zNear
+    GLMessage_DataType *arg_zNear = glmsg.add_args();
+    arg_zNear->set_isarray(false);
+    arg_zNear->set_type(GLMessage::DataType::INT);
+    arg_zNear->add_intvalue(zNear);
+
+    // copy argument zFar
+    GLMessage_DataType *arg_zFar = glmsg.add_args();
+    arg_zFar->set_isarray(false);
+    arg_zFar->set_type(GLMessage::DataType::INT);
+    arg_zFar->add_intvalue(zFar);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFrustumxOES(left, right, bottom, top, zNear, zFar);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetClipPlanexOES(GLenum pname, GLfixed eqn[4]) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetClipPlanexOES);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument eqn
+    GLMessage_DataType *arg_eqn = glmsg.add_args();
+    arg_eqn->set_isarray(false);
+    arg_eqn->set_type(GLMessage::DataType::INT);
+    arg_eqn->add_intvalue((int)eqn);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetClipPlanexOES(pname, eqn);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetFixedvOES(GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetFixedvOES);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetFixedvOES(pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetLightxvOES(GLenum light, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetLightxvOES);
+
+    // copy argument light
+    GLMessage_DataType *arg_light = glmsg.add_args();
+    arg_light->set_isarray(false);
+    arg_light->set_type(GLMessage::DataType::ENUM);
+    arg_light->add_intvalue((int)light);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetLightxvOES(light, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetMaterialxvOES(GLenum face, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetMaterialxvOES);
+
+    // copy argument face
+    GLMessage_DataType *arg_face = glmsg.add_args();
+    arg_face->set_isarray(false);
+    arg_face->set_type(GLMessage::DataType::ENUM);
+    arg_face->add_intvalue((int)face);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetMaterialxvOES(face, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexEnvxvOES(GLenum env, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetTexEnvxvOES);
+
+    // copy argument env
+    GLMessage_DataType *arg_env = glmsg.add_args();
+    arg_env->set_isarray(false);
+    arg_env->set_type(GLMessage::DataType::ENUM);
+    arg_env->add_intvalue((int)env);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetTexEnvxvOES(env, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexParameterxvOES(GLenum target, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetTexParameterxvOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetTexParameterxvOES(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightModelxOES(GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLightModelxOES);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLightModelxOES(pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightModelxvOES(GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLightModelxvOES);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLightModelxvOES(pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightxOES(GLenum light, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLightxOES);
+
+    // copy argument light
+    GLMessage_DataType *arg_light = glmsg.add_args();
+    arg_light->set_isarray(false);
+    arg_light->set_type(GLMessage::DataType::ENUM);
+    arg_light->add_intvalue((int)light);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLightxOES(light, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLightxvOES(GLenum light, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLightxvOES);
+
+    // copy argument light
+    GLMessage_DataType *arg_light = glmsg.add_args();
+    arg_light->set_isarray(false);
+    arg_light->set_type(GLMessage::DataType::ENUM);
+    arg_light->add_intvalue((int)light);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLightxvOES(light, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLineWidthxOES(GLfixed width) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLineWidthxOES);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLineWidthxOES(width);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLoadMatrixxOES(const GLfixed *m) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLoadMatrixxOES);
+
+    // copy argument m
+    GLMessage_DataType *arg_m = glmsg.add_args();
+    arg_m->set_isarray(false);
+    arg_m->set_type(GLMessage::DataType::INT);
+    arg_m->add_intvalue((int)m);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLoadMatrixxOES(m);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMaterialxOES(GLenum face, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMaterialxOES);
+
+    // copy argument face
+    GLMessage_DataType *arg_face = glmsg.add_args();
+    arg_face->set_isarray(false);
+    arg_face->set_type(GLMessage::DataType::ENUM);
+    arg_face->add_intvalue((int)face);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glMaterialxOES(face, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMaterialxvOES(GLenum face, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMaterialxvOES);
+
+    // copy argument face
+    GLMessage_DataType *arg_face = glmsg.add_args();
+    arg_face->set_isarray(false);
+    arg_face->set_type(GLMessage::DataType::ENUM);
+    arg_face->add_intvalue((int)face);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glMaterialxvOES(face, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMultMatrixxOES(const GLfixed *m) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMultMatrixxOES);
+
+    // copy argument m
+    GLMessage_DataType *arg_m = glmsg.add_args();
+    arg_m->set_isarray(false);
+    arg_m->set_type(GLMessage::DataType::INT);
+    arg_m->add_intvalue((int)m);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glMultMatrixxOES(m);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMultiTexCoord4xOES(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMultiTexCoord4xOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument s
+    GLMessage_DataType *arg_s = glmsg.add_args();
+    arg_s->set_isarray(false);
+    arg_s->set_type(GLMessage::DataType::INT);
+    arg_s->add_intvalue(s);
+
+    // copy argument t
+    GLMessage_DataType *arg_t = glmsg.add_args();
+    arg_t->set_isarray(false);
+    arg_t->set_type(GLMessage::DataType::INT);
+    arg_t->add_intvalue(t);
+
+    // copy argument r
+    GLMessage_DataType *arg_r = glmsg.add_args();
+    arg_r->set_isarray(false);
+    arg_r->set_type(GLMessage::DataType::INT);
+    arg_r->add_intvalue(r);
+
+    // copy argument q
+    GLMessage_DataType *arg_q = glmsg.add_args();
+    arg_q->set_isarray(false);
+    arg_q->set_type(GLMessage::DataType::INT);
+    arg_q->add_intvalue(q);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glMultiTexCoord4xOES(target, s, t, r, q);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glNormal3xOES(GLfixed nx, GLfixed ny, GLfixed nz) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glNormal3xOES);
+
+    // copy argument nx
+    GLMessage_DataType *arg_nx = glmsg.add_args();
+    arg_nx->set_isarray(false);
+    arg_nx->set_type(GLMessage::DataType::INT);
+    arg_nx->add_intvalue(nx);
+
+    // copy argument ny
+    GLMessage_DataType *arg_ny = glmsg.add_args();
+    arg_ny->set_isarray(false);
+    arg_ny->set_type(GLMessage::DataType::INT);
+    arg_ny->add_intvalue(ny);
+
+    // copy argument nz
+    GLMessage_DataType *arg_nz = glmsg.add_args();
+    arg_nz->set_isarray(false);
+    arg_nz->set_type(GLMessage::DataType::INT);
+    arg_nz->add_intvalue(nz);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glNormal3xOES(nx, ny, nz);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glOrthoxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glOrthoxOES);
+
+    // copy argument left
+    GLMessage_DataType *arg_left = glmsg.add_args();
+    arg_left->set_isarray(false);
+    arg_left->set_type(GLMessage::DataType::INT);
+    arg_left->add_intvalue(left);
+
+    // copy argument right
+    GLMessage_DataType *arg_right = glmsg.add_args();
+    arg_right->set_isarray(false);
+    arg_right->set_type(GLMessage::DataType::INT);
+    arg_right->add_intvalue(right);
+
+    // copy argument bottom
+    GLMessage_DataType *arg_bottom = glmsg.add_args();
+    arg_bottom->set_isarray(false);
+    arg_bottom->set_type(GLMessage::DataType::INT);
+    arg_bottom->add_intvalue(bottom);
+
+    // copy argument top
+    GLMessage_DataType *arg_top = glmsg.add_args();
+    arg_top->set_isarray(false);
+    arg_top->set_type(GLMessage::DataType::INT);
+    arg_top->add_intvalue(top);
+
+    // copy argument zNear
+    GLMessage_DataType *arg_zNear = glmsg.add_args();
+    arg_zNear->set_isarray(false);
+    arg_zNear->set_type(GLMessage::DataType::INT);
+    arg_zNear->add_intvalue(zNear);
+
+    // copy argument zFar
+    GLMessage_DataType *arg_zFar = glmsg.add_args();
+    arg_zFar->set_isarray(false);
+    arg_zFar->set_type(GLMessage::DataType::INT);
+    arg_zFar->add_intvalue(zFar);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glOrthoxOES(left, right, bottom, top, zNear, zFar);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointParameterxOES(GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPointParameterxOES);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPointParameterxOES(pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointParameterxvOES(GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPointParameterxvOES);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPointParameterxvOES(pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPointSizexOES(GLfixed size) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPointSizexOES);
+
+    // copy argument size
+    GLMessage_DataType *arg_size = glmsg.add_args();
+    arg_size->set_isarray(false);
+    arg_size->set_type(GLMessage::DataType::INT);
+    arg_size->add_intvalue(size);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPointSizexOES(size);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glPolygonOffsetxOES(GLfixed factor, GLfixed units) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glPolygonOffsetxOES);
+
+    // copy argument factor
+    GLMessage_DataType *arg_factor = glmsg.add_args();
+    arg_factor->set_isarray(false);
+    arg_factor->set_type(GLMessage::DataType::INT);
+    arg_factor->add_intvalue(factor);
+
+    // copy argument units
+    GLMessage_DataType *arg_units = glmsg.add_args();
+    arg_units->set_isarray(false);
+    arg_units->set_type(GLMessage::DataType::INT);
+    arg_units->add_intvalue(units);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glPolygonOffsetxOES(factor, units);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRotatexOES(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glRotatexOES);
+
+    // copy argument angle
+    GLMessage_DataType *arg_angle = glmsg.add_args();
+    arg_angle->set_isarray(false);
+    arg_angle->set_type(GLMessage::DataType::INT);
+    arg_angle->add_intvalue(angle);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::INT);
+    arg_z->add_intvalue(z);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glRotatexOES(angle, x, y, z);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glSampleCoveragexOES(GLclampx value, GLboolean invert) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glSampleCoveragexOES);
+
+    // copy argument value
+    GLMessage_DataType *arg_value = glmsg.add_args();
+    arg_value->set_isarray(false);
+    arg_value->set_type(GLMessage::DataType::INT);
+    arg_value->add_intvalue(value);
+
+    // copy argument invert
+    GLMessage_DataType *arg_invert = glmsg.add_args();
+    arg_invert->set_isarray(false);
+    arg_invert->set_type(GLMessage::DataType::BOOL);
+    arg_invert->add_boolvalue(invert);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glSampleCoveragexOES(value, invert);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glScalexOES(GLfixed x, GLfixed y, GLfixed z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glScalexOES);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::INT);
+    arg_z->add_intvalue(z);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glScalexOES(x, y, z);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexEnvxOES(GLenum target, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexEnvxOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexEnvxOES(target, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexEnvxvOES(GLenum target, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexEnvxvOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexEnvxvOES(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexParameterxOES(GLenum target, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexParameterxOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexParameterxOES(target, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexParameterxvOES(GLenum target, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexParameterxvOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexParameterxvOES(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTranslatexOES(GLfixed x, GLfixed y, GLfixed z) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTranslatexOES);
+
+    // copy argument x
+    GLMessage_DataType *arg_x = glmsg.add_args();
+    arg_x->set_isarray(false);
+    arg_x->set_type(GLMessage::DataType::INT);
+    arg_x->add_intvalue(x);
+
+    // copy argument y
+    GLMessage_DataType *arg_y = glmsg.add_args();
+    arg_y->set_isarray(false);
+    arg_y->set_type(GLMessage::DataType::INT);
+    arg_y->add_intvalue(y);
+
+    // copy argument z
+    GLMessage_DataType *arg_z = glmsg.add_args();
+    arg_z->set_isarray(false);
+    arg_z->set_type(GLMessage::DataType::INT);
+    arg_z->add_intvalue(z);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTranslatexOES(x, y, z);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLboolean GLTrace_glIsRenderbufferOES(GLuint renderbuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glIsRenderbufferOES);
+
+    // copy argument renderbuffer
+    GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
+    arg_renderbuffer->set_isarray(false);
+    arg_renderbuffer->set_type(GLMessage::DataType::INT);
+    arg_renderbuffer->add_intvalue(renderbuffer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glIsRenderbufferOES(renderbuffer);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glBindRenderbufferOES(GLenum target, GLuint renderbuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBindRenderbufferOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument renderbuffer
+    GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
+    arg_renderbuffer->set_isarray(false);
+    arg_renderbuffer->set_type(GLMessage::DataType::INT);
+    arg_renderbuffer->add_intvalue(renderbuffer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBindRenderbufferOES(target, renderbuffer);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteRenderbuffersOES(GLsizei n, const GLuint* renderbuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDeleteRenderbuffersOES);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument renderbuffers
+    GLMessage_DataType *arg_renderbuffers = glmsg.add_args();
+    arg_renderbuffers->set_isarray(false);
+    arg_renderbuffers->set_type(GLMessage::DataType::INT);
+    arg_renderbuffers->add_intvalue((int)renderbuffers);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDeleteRenderbuffersOES(n, renderbuffers);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenRenderbuffersOES(GLsizei n, GLuint* renderbuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGenRenderbuffersOES);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument renderbuffers
+    GLMessage_DataType *arg_renderbuffers = glmsg.add_args();
+    arg_renderbuffers->set_isarray(false);
+    arg_renderbuffers->set_type(GLMessage::DataType::INT);
+    arg_renderbuffers->add_intvalue((int)renderbuffers);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGenRenderbuffersOES(n, renderbuffers);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glRenderbufferStorageOES(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glRenderbufferStorageOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument internalformat
+    GLMessage_DataType *arg_internalformat = glmsg.add_args();
+    arg_internalformat->set_isarray(false);
+    arg_internalformat->set_type(GLMessage::DataType::ENUM);
+    arg_internalformat->add_intvalue((int)internalformat);
+
+    // copy argument width
+    GLMessage_DataType *arg_width = glmsg.add_args();
+    arg_width->set_isarray(false);
+    arg_width->set_type(GLMessage::DataType::INT);
+    arg_width->add_intvalue(width);
+
+    // copy argument height
+    GLMessage_DataType *arg_height = glmsg.add_args();
+    arg_height->set_isarray(false);
+    arg_height->set_type(GLMessage::DataType::INT);
+    arg_height->add_intvalue(height);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glRenderbufferStorageOES(target, internalformat, width, height);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetRenderbufferParameterivOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetRenderbufferParameterivOES(target, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLboolean GLTrace_glIsFramebufferOES(GLuint framebuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glIsFramebufferOES);
+
+    // copy argument framebuffer
+    GLMessage_DataType *arg_framebuffer = glmsg.add_args();
+    arg_framebuffer->set_isarray(false);
+    arg_framebuffer->set_type(GLMessage::DataType::INT);
+    arg_framebuffer->add_intvalue(framebuffer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLboolean retValue = glContext->hooks->gl.glIsFramebufferOES(framebuffer);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::BOOL);
+    rt->add_boolvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glBindFramebufferOES(GLenum target, GLuint framebuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glBindFramebufferOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument framebuffer
+    GLMessage_DataType *arg_framebuffer = glmsg.add_args();
+    arg_framebuffer->set_isarray(false);
+    arg_framebuffer->set_type(GLMessage::DataType::INT);
+    arg_framebuffer->add_intvalue(framebuffer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glBindFramebufferOES(target, framebuffer);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glDeleteFramebuffersOES(GLsizei n, const GLuint* framebuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDeleteFramebuffersOES);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument framebuffers
+    GLMessage_DataType *arg_framebuffers = glmsg.add_args();
+    arg_framebuffers->set_isarray(false);
+    arg_framebuffers->set_type(GLMessage::DataType::INT);
+    arg_framebuffers->add_intvalue((int)framebuffers);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDeleteFramebuffersOES(n, framebuffers);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenFramebuffersOES(GLsizei n, GLuint* framebuffers) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGenFramebuffersOES);
+
+    // copy argument n
+    GLMessage_DataType *arg_n = glmsg.add_args();
+    arg_n->set_isarray(false);
+    arg_n->set_type(GLMessage::DataType::INT);
+    arg_n->add_intvalue(n);
+
+    // copy argument framebuffers
+    GLMessage_DataType *arg_framebuffers = glmsg.add_args();
+    arg_framebuffers->set_isarray(false);
+    arg_framebuffers->set_type(GLMessage::DataType::INT);
+    arg_framebuffers->add_intvalue((int)framebuffers);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGenFramebuffersOES(n, framebuffers);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLenum GLTrace_glCheckFramebufferStatusOES(GLenum target) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCheckFramebufferStatusOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLenum retValue = glContext->hooks->gl.glCheckFramebufferStatusOES(target);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::ENUM);
+    rt->add_intvalue((int)retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFramebufferRenderbufferOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument attachment
+    GLMessage_DataType *arg_attachment = glmsg.add_args();
+    arg_attachment->set_isarray(false);
+    arg_attachment->set_type(GLMessage::DataType::ENUM);
+    arg_attachment->add_intvalue((int)attachment);
+
+    // copy argument renderbuffertarget
+    GLMessage_DataType *arg_renderbuffertarget = glmsg.add_args();
+    arg_renderbuffertarget->set_isarray(false);
+    arg_renderbuffertarget->set_type(GLMessage::DataType::ENUM);
+    arg_renderbuffertarget->add_intvalue((int)renderbuffertarget);
+
+    // copy argument renderbuffer
+    GLMessage_DataType *arg_renderbuffer = glmsg.add_args();
+    arg_renderbuffer->set_isarray(false);
+    arg_renderbuffer->set_type(GLMessage::DataType::INT);
+    arg_renderbuffer->add_intvalue(renderbuffer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFramebufferRenderbufferOES(target, attachment, renderbuffertarget, renderbuffer);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFramebufferTexture2DOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument attachment
+    GLMessage_DataType *arg_attachment = glmsg.add_args();
+    arg_attachment->set_isarray(false);
+    arg_attachment->set_type(GLMessage::DataType::ENUM);
+    arg_attachment->add_intvalue((int)attachment);
+
+    // copy argument textarget
+    GLMessage_DataType *arg_textarget = glmsg.add_args();
+    arg_textarget->set_isarray(false);
+    arg_textarget->set_type(GLMessage::DataType::ENUM);
+    arg_textarget->add_intvalue((int)textarget);
+
+    // copy argument texture
+    GLMessage_DataType *arg_texture = glmsg.add_args();
+    arg_texture->set_isarray(false);
+    arg_texture->set_type(GLMessage::DataType::INT);
+    arg_texture->add_intvalue(texture);
+
+    // copy argument level
+    GLMessage_DataType *arg_level = glmsg.add_args();
+    arg_level->set_isarray(false);
+    arg_level->set_type(GLMessage::DataType::INT);
+    arg_level->add_intvalue(level);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFramebufferTexture2DOES(target, attachment, textarget, texture, level);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint* params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetFramebufferAttachmentParameterivOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // copy argument attachment
+    GLMessage_DataType *arg_attachment = glmsg.add_args();
+    arg_attachment->set_isarray(false);
+    arg_attachment->set_type(GLMessage::DataType::ENUM);
+    arg_attachment->add_intvalue((int)attachment);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetFramebufferAttachmentParameterivOES(target, attachment, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGenerateMipmapOES(GLenum target) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGenerateMipmapOES);
+
+    // copy argument target
+    GLMessage_DataType *arg_target = glmsg.add_args();
+    arg_target->set_isarray(false);
+    arg_target->set_type(GLMessage::DataType::ENUM);
+    arg_target->add_intvalue((int)target);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGenerateMipmapOES(target);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glCurrentPaletteMatrixOES(GLuint matrixpaletteindex) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glCurrentPaletteMatrixOES);
+
+    // copy argument matrixpaletteindex
+    GLMessage_DataType *arg_matrixpaletteindex = glmsg.add_args();
+    arg_matrixpaletteindex->set_isarray(false);
+    arg_matrixpaletteindex->set_type(GLMessage::DataType::INT);
+    arg_matrixpaletteindex->add_intvalue(matrixpaletteindex);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glCurrentPaletteMatrixOES(matrixpaletteindex);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glLoadPaletteFromModelViewMatrixOES(void) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glLoadPaletteFromModelViewMatrixOES);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glLoadPaletteFromModelViewMatrixOES();
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glMatrixIndexPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glMatrixIndexPointerOES);
+
+    // copy argument size
+    GLMessage_DataType *arg_size = glmsg.add_args();
+    arg_size->set_isarray(false);
+    arg_size->set_type(GLMessage::DataType::INT);
+    arg_size->add_intvalue(size);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument stride
+    GLMessage_DataType *arg_stride = glmsg.add_args();
+    arg_stride->set_isarray(false);
+    arg_stride->set_type(GLMessage::DataType::INT);
+    arg_stride->add_intvalue(stride);
+
+    // copy argument pointer
+    GLMessage_DataType *arg_pointer = glmsg.add_args();
+    arg_pointer->set_isarray(false);
+    arg_pointer->set_type(GLMessage::DataType::INT);
+    arg_pointer->add_intvalue((int)pointer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glMatrixIndexPointerOES(size, type, stride, pointer);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glWeightPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glWeightPointerOES);
+
+    // copy argument size
+    GLMessage_DataType *arg_size = glmsg.add_args();
+    arg_size->set_isarray(false);
+    arg_size->set_type(GLMessage::DataType::INT);
+    arg_size->add_intvalue(size);
+
+    // copy argument type
+    GLMessage_DataType *arg_type = glmsg.add_args();
+    arg_type->set_isarray(false);
+    arg_type->set_type(GLMessage::DataType::ENUM);
+    arg_type->add_intvalue((int)type);
+
+    // copy argument stride
+    GLMessage_DataType *arg_stride = glmsg.add_args();
+    arg_stride->set_isarray(false);
+    arg_stride->set_type(GLMessage::DataType::INT);
+    arg_stride->add_intvalue(stride);
+
+    // copy argument pointer
+    GLMessage_DataType *arg_pointer = glmsg.add_args();
+    arg_pointer->set_isarray(false);
+    arg_pointer->set_type(GLMessage::DataType::INT);
+    arg_pointer->add_intvalue((int)pointer);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glWeightPointerOES(size, type, stride, pointer);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+GLbitfield GLTrace_glQueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16]) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glQueryMatrixxOES);
+
+    // copy argument mantissa
+    GLMessage_DataType *arg_mantissa = glmsg.add_args();
+    arg_mantissa->set_isarray(false);
+    arg_mantissa->set_type(GLMessage::DataType::INT);
+    arg_mantissa->add_intvalue((int)mantissa);
+
+    // copy argument exponent
+    GLMessage_DataType *arg_exponent = glmsg.add_args();
+    arg_exponent->set_isarray(false);
+    arg_exponent->set_type(GLMessage::DataType::INT);
+    arg_exponent->add_intvalue((int)exponent);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    GLbitfield retValue = glContext->hooks->gl.glQueryMatrixxOES(mantissa, exponent);
+    nsecs_t end_time = systemTime();
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::INT);
+    rt->add_intvalue(retValue);
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+
+    return retValue;
+}
+
+void GLTrace_glDepthRangefOES(GLclampf zNear, GLclampf zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glDepthRangefOES);
+
+    // copy argument zNear
+    GLMessage_DataType *arg_zNear = glmsg.add_args();
+    arg_zNear->set_isarray(false);
+    arg_zNear->set_type(GLMessage::DataType::FLOAT);
+    arg_zNear->add_floatvalue(zNear);
+
+    // copy argument zFar
+    GLMessage_DataType *arg_zFar = glmsg.add_args();
+    arg_zFar->set_isarray(false);
+    arg_zFar->set_type(GLMessage::DataType::FLOAT);
+    arg_zFar->add_floatvalue(zFar);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glDepthRangefOES(zNear, zFar);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glFrustumfOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glFrustumfOES);
+
+    // copy argument left
+    GLMessage_DataType *arg_left = glmsg.add_args();
+    arg_left->set_isarray(false);
+    arg_left->set_type(GLMessage::DataType::FLOAT);
+    arg_left->add_floatvalue(left);
+
+    // copy argument right
+    GLMessage_DataType *arg_right = glmsg.add_args();
+    arg_right->set_isarray(false);
+    arg_right->set_type(GLMessage::DataType::FLOAT);
+    arg_right->add_floatvalue(right);
+
+    // copy argument bottom
+    GLMessage_DataType *arg_bottom = glmsg.add_args();
+    arg_bottom->set_isarray(false);
+    arg_bottom->set_type(GLMessage::DataType::FLOAT);
+    arg_bottom->add_floatvalue(bottom);
+
+    // copy argument top
+    GLMessage_DataType *arg_top = glmsg.add_args();
+    arg_top->set_isarray(false);
+    arg_top->set_type(GLMessage::DataType::FLOAT);
+    arg_top->add_floatvalue(top);
+
+    // copy argument zNear
+    GLMessage_DataType *arg_zNear = glmsg.add_args();
+    arg_zNear->set_isarray(false);
+    arg_zNear->set_type(GLMessage::DataType::FLOAT);
+    arg_zNear->add_floatvalue(zNear);
+
+    // copy argument zFar
+    GLMessage_DataType *arg_zFar = glmsg.add_args();
+    arg_zFar->set_isarray(false);
+    arg_zFar->set_type(GLMessage::DataType::FLOAT);
+    arg_zFar->add_floatvalue(zFar);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glFrustumfOES(left, right, bottom, top, zNear, zFar);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glOrthofOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glOrthofOES);
+
+    // copy argument left
+    GLMessage_DataType *arg_left = glmsg.add_args();
+    arg_left->set_isarray(false);
+    arg_left->set_type(GLMessage::DataType::FLOAT);
+    arg_left->add_floatvalue(left);
+
+    // copy argument right
+    GLMessage_DataType *arg_right = glmsg.add_args();
+    arg_right->set_isarray(false);
+    arg_right->set_type(GLMessage::DataType::FLOAT);
+    arg_right->add_floatvalue(right);
+
+    // copy argument bottom
+    GLMessage_DataType *arg_bottom = glmsg.add_args();
+    arg_bottom->set_isarray(false);
+    arg_bottom->set_type(GLMessage::DataType::FLOAT);
+    arg_bottom->add_floatvalue(bottom);
+
+    // copy argument top
+    GLMessage_DataType *arg_top = glmsg.add_args();
+    arg_top->set_isarray(false);
+    arg_top->set_type(GLMessage::DataType::FLOAT);
+    arg_top->add_floatvalue(top);
+
+    // copy argument zNear
+    GLMessage_DataType *arg_zNear = glmsg.add_args();
+    arg_zNear->set_isarray(false);
+    arg_zNear->set_type(GLMessage::DataType::FLOAT);
+    arg_zNear->add_floatvalue(zNear);
+
+    // copy argument zFar
+    GLMessage_DataType *arg_zFar = glmsg.add_args();
+    arg_zFar->set_isarray(false);
+    arg_zFar->set_type(GLMessage::DataType::FLOAT);
+    arg_zFar->add_floatvalue(zFar);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glOrthofOES(left, right, bottom, top, zNear, zFar);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClipPlanefOES(GLenum plane, const GLfloat *equation) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glClipPlanefOES);
+
+    // copy argument plane
+    GLMessage_DataType *arg_plane = glmsg.add_args();
+    arg_plane->set_isarray(false);
+    arg_plane->set_type(GLMessage::DataType::ENUM);
+    arg_plane->add_intvalue((int)plane);
+
+    // copy argument equation
+    GLMessage_DataType *arg_equation = glmsg.add_args();
+    arg_equation->set_isarray(false);
+    arg_equation->set_type(GLMessage::DataType::INT);
+    arg_equation->add_intvalue((int)equation);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glClipPlanefOES(plane, equation);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetClipPlanefOES(GLenum pname, GLfloat eqn[4]) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetClipPlanefOES);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument eqn
+    GLMessage_DataType *arg_eqn = glmsg.add_args();
+    arg_eqn->set_isarray(false);
+    arg_eqn->set_type(GLMessage::DataType::INT);
+    arg_eqn->add_intvalue((int)eqn);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetClipPlanefOES(pname, eqn);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClearDepthfOES(GLclampf depth) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glClearDepthfOES);
+
+    // copy argument depth
+    GLMessage_DataType *arg_depth = glmsg.add_args();
+    arg_depth->set_isarray(false);
+    arg_depth->set_type(GLMessage::DataType::FLOAT);
+    arg_depth->add_floatvalue(depth);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glClearDepthfOES(depth);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexGenfOES(GLenum coord, GLenum pname, GLfloat param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexGenfOES);
+
+    // copy argument coord
+    GLMessage_DataType *arg_coord = glmsg.add_args();
+    arg_coord->set_isarray(false);
+    arg_coord->set_type(GLMessage::DataType::ENUM);
+    arg_coord->add_intvalue((int)coord);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::FLOAT);
+    arg_param->add_floatvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexGenfOES(coord, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexGenfvOES(GLenum coord, GLenum pname, const GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexGenfvOES);
+
+    // copy argument coord
+    GLMessage_DataType *arg_coord = glmsg.add_args();
+    arg_coord->set_isarray(false);
+    arg_coord->set_type(GLMessage::DataType::ENUM);
+    arg_coord->add_intvalue((int)coord);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexGenfvOES(coord, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexGeniOES(GLenum coord, GLenum pname, GLint param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexGeniOES);
+
+    // copy argument coord
+    GLMessage_DataType *arg_coord = glmsg.add_args();
+    arg_coord->set_isarray(false);
+    arg_coord->set_type(GLMessage::DataType::ENUM);
+    arg_coord->add_intvalue((int)coord);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexGeniOES(coord, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexGenivOES(GLenum coord, GLenum pname, const GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexGenivOES);
+
+    // copy argument coord
+    GLMessage_DataType *arg_coord = glmsg.add_args();
+    arg_coord->set_isarray(false);
+    arg_coord->set_type(GLMessage::DataType::ENUM);
+    arg_coord->add_intvalue((int)coord);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexGenivOES(coord, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexGenxOES(GLenum coord, GLenum pname, GLfixed param) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexGenxOES);
+
+    // copy argument coord
+    GLMessage_DataType *arg_coord = glmsg.add_args();
+    arg_coord->set_isarray(false);
+    arg_coord->set_type(GLMessage::DataType::ENUM);
+    arg_coord->add_intvalue((int)coord);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument param
+    GLMessage_DataType *arg_param = glmsg.add_args();
+    arg_param->set_isarray(false);
+    arg_param->set_type(GLMessage::DataType::INT);
+    arg_param->add_intvalue(param);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexGenxOES(coord, pname, param);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glTexGenxvOES(GLenum coord, GLenum pname, const GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glTexGenxvOES);
+
+    // copy argument coord
+    GLMessage_DataType *arg_coord = glmsg.add_args();
+    arg_coord->set_isarray(false);
+    arg_coord->set_type(GLMessage::DataType::ENUM);
+    arg_coord->add_intvalue((int)coord);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glTexGenxvOES(coord, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexGenfvOES(GLenum coord, GLenum pname, GLfloat *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetTexGenfvOES);
+
+    // copy argument coord
+    GLMessage_DataType *arg_coord = glmsg.add_args();
+    arg_coord->set_isarray(false);
+    arg_coord->set_type(GLMessage::DataType::ENUM);
+    arg_coord->add_intvalue((int)coord);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetTexGenfvOES(coord, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexGenivOES(GLenum coord, GLenum pname, GLint *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetTexGenivOES);
+
+    // copy argument coord
+    GLMessage_DataType *arg_coord = glmsg.add_args();
+    arg_coord->set_isarray(false);
+    arg_coord->set_type(GLMessage::DataType::ENUM);
+    arg_coord->add_intvalue((int)coord);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetTexGenivOES(coord, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glGetTexGenxvOES(GLenum coord, GLenum pname, GLfixed *params) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glGetTexGenxvOES);
+
+    // copy argument coord
+    GLMessage_DataType *arg_coord = glmsg.add_args();
+    arg_coord->set_isarray(false);
+    arg_coord->set_type(GLMessage::DataType::ENUM);
+    arg_coord->add_intvalue((int)coord);
+
+    // copy argument pname
+    GLMessage_DataType *arg_pname = glmsg.add_args();
+    arg_pname->set_isarray(false);
+    arg_pname->set_type(GLMessage::DataType::ENUM);
+    arg_pname->add_intvalue((int)pname);
+
+    // copy argument params
+    GLMessage_DataType *arg_params = glmsg.add_args();
+    arg_params->set_isarray(false);
+    arg_params->set_type(GLMessage::DataType::INT);
+    arg_params->add_intvalue((int)params);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glGetTexGenxvOES(coord, pname, params);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClipPlanefIMG(GLenum p, const GLfloat *eqn) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glClipPlanefIMG);
+
+    // copy argument p
+    GLMessage_DataType *arg_p = glmsg.add_args();
+    arg_p->set_isarray(false);
+    arg_p->set_type(GLMessage::DataType::ENUM);
+    arg_p->add_intvalue((int)p);
+
+    // copy argument eqn
+    GLMessage_DataType *arg_eqn = glmsg.add_args();
+    arg_eqn->set_isarray(false);
+    arg_eqn->set_type(GLMessage::DataType::INT);
+    arg_eqn->add_intvalue((int)eqn);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glClipPlanefIMG(p, eqn);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+void GLTrace_glClipPlanexIMG(GLenum p, const GLfixed *eqn) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::glClipPlanexIMG);
+
+    // copy argument p
+    GLMessage_DataType *arg_p = glmsg.add_args();
+    arg_p->set_isarray(false);
+    arg_p->set_type(GLMessage::DataType::ENUM);
+    arg_p->add_intvalue((int)p);
+
+    // copy argument eqn
+    GLMessage_DataType *arg_eqn = glmsg.add_args();
+    arg_eqn->set_isarray(false);
+    arg_eqn->set_type(GLMessage::DataType::INT);
+    arg_eqn->add_intvalue((int)eqn);
+
+    // call function
+    nsecs_t start_time = systemTime();
+    glContext->hooks->gl.glClipPlanexIMG(p, eqn);
+    nsecs_t end_time = systemTime();
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+}
+
+
+}; // namespace gltrace
+}; // namespace android
diff --git a/opengl/libs/GLES_trace/src/gltrace_api.h b/opengl/libs/GLES_trace/src/gltrace_api.h
new file mode 100644
index 0000000..debcac0
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_api.h
@@ -0,0 +1,472 @@
+/*
+ * Copyright 2011, 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.
+ *
+ * THIS FILE WAS GENERATED BY A SCRIPT. DO NOT EDIT.
+ */
+
+namespace android {
+namespace gltrace {
+
+// Declarations for GL2 APIs
+
+void GLTrace_glActiveTexture(GLenum texture);
+void GLTrace_glAttachShader(GLuint program, GLuint shader);
+void GLTrace_glBindAttribLocation(GLuint program, GLuint index, const GLchar* name);
+void GLTrace_glBindBuffer(GLenum target, GLuint buffer);
+void GLTrace_glBindFramebuffer(GLenum target, GLuint framebuffer);
+void GLTrace_glBindRenderbuffer(GLenum target, GLuint renderbuffer);
+void GLTrace_glBindTexture(GLenum target, GLuint texture);
+void GLTrace_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+void GLTrace_glBlendEquation(GLenum mode);
+void GLTrace_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
+void GLTrace_glBlendFunc(GLenum sfactor, GLenum dfactor);
+void GLTrace_glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+void GLTrace_glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
+void GLTrace_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
+GLenum GLTrace_glCheckFramebufferStatus(GLenum target);
+void GLTrace_glClear(GLbitfield mask);
+void GLTrace_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+void GLTrace_glClearDepthf(GLclampf depth);
+void GLTrace_glClearStencil(GLint s);
+void GLTrace_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+void GLTrace_glCompileShader(GLuint shader);
+void GLTrace_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
+void GLTrace_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
+void GLTrace_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+void GLTrace_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GLuint GLTrace_glCreateProgram(void);
+GLuint GLTrace_glCreateShader(GLenum type);
+void GLTrace_glCullFace(GLenum mode);
+void GLTrace_glDeleteBuffers(GLsizei n, const GLuint* buffers);
+void GLTrace_glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers);
+void GLTrace_glDeleteProgram(GLuint program);
+void GLTrace_glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers);
+void GLTrace_glDeleteShader(GLuint shader);
+void GLTrace_glDeleteTextures(GLsizei n, const GLuint* textures);
+void GLTrace_glDepthFunc(GLenum func);
+void GLTrace_glDepthMask(GLboolean flag);
+void GLTrace_glDepthRangef(GLclampf zNear, GLclampf zFar);
+void GLTrace_glDetachShader(GLuint program, GLuint shader);
+void GLTrace_glDisable(GLenum cap);
+void GLTrace_glDisableVertexAttribArray(GLuint index);
+void GLTrace_glDrawArrays(GLenum mode, GLint first, GLsizei count);
+void GLTrace_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
+void GLTrace_glEnable(GLenum cap);
+void GLTrace_glEnableVertexAttribArray(GLuint index);
+void GLTrace_glFinish(void);
+void GLTrace_glFlush(void);
+void GLTrace_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+void GLTrace_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+void GLTrace_glFrontFace(GLenum mode);
+void GLTrace_glGenBuffers(GLsizei n, GLuint* buffers);
+void GLTrace_glGenerateMipmap(GLenum target);
+void GLTrace_glGenFramebuffers(GLsizei n, GLuint* framebuffers);
+void GLTrace_glGenRenderbuffers(GLsizei n, GLuint* renderbuffers);
+void GLTrace_glGenTextures(GLsizei n, GLuint* textures);
+void GLTrace_glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
+void GLTrace_glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
+void GLTrace_glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
+int GLTrace_glGetAttribLocation(GLuint program, const GLchar* name);
+void GLTrace_glGetBooleanv(GLenum pname, GLboolean* params);
+void GLTrace_glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
+GLenum GLTrace_glGetError(void);
+void GLTrace_glGetFloatv(GLenum pname, GLfloat* params);
+void GLTrace_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params);
+void GLTrace_glGetIntegerv(GLenum pname, GLint* params);
+void GLTrace_glGetProgramiv(GLuint program, GLenum pname, GLint* params);
+void GLTrace_glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
+void GLTrace_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params);
+void GLTrace_glGetShaderiv(GLuint shader, GLenum pname, GLint* params);
+void GLTrace_glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
+void GLTrace_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+void GLTrace_glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
+const GLubyte* GLTrace_glGetString(GLenum name);
+void GLTrace_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params);
+void GLTrace_glGetTexParameteriv(GLenum target, GLenum pname, GLint* params);
+void GLTrace_glGetUniformfv(GLuint program, GLint location, GLfloat* params);
+void GLTrace_glGetUniformiv(GLuint program, GLint location, GLint* params);
+int GLTrace_glGetUniformLocation(GLuint program, const GLchar* name);
+void GLTrace_glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
+void GLTrace_glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
+void GLTrace_glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer);
+void GLTrace_glHint(GLenum target, GLenum mode);
+GLboolean GLTrace_glIsBuffer(GLuint buffer);
+GLboolean GLTrace_glIsEnabled(GLenum cap);
+GLboolean GLTrace_glIsFramebuffer(GLuint framebuffer);
+GLboolean GLTrace_glIsProgram(GLuint program);
+GLboolean GLTrace_glIsRenderbuffer(GLuint renderbuffer);
+GLboolean GLTrace_glIsShader(GLuint shader);
+GLboolean GLTrace_glIsTexture(GLuint texture);
+void GLTrace_glLineWidth(GLfloat width);
+void GLTrace_glLinkProgram(GLuint program);
+void GLTrace_glPixelStorei(GLenum pname, GLint param);
+void GLTrace_glPolygonOffset(GLfloat factor, GLfloat units);
+void GLTrace_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
+void GLTrace_glReleaseShaderCompiler(void);
+void GLTrace_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+void GLTrace_glSampleCoverage(GLclampf value, GLboolean invert);
+void GLTrace_glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
+void GLTrace_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
+void GLTrace_glShaderSource(GLuint shader, GLsizei count, const GLchar** string, const GLint* length);
+void GLTrace_glStencilFunc(GLenum func, GLint ref, GLuint mask);
+void GLTrace_glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
+void GLTrace_glStencilMask(GLuint mask);
+void GLTrace_glStencilMaskSeparate(GLenum face, GLuint mask);
+void GLTrace_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
+void GLTrace_glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
+void GLTrace_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
+void GLTrace_glTexParameterf(GLenum target, GLenum pname, GLfloat param);
+void GLTrace_glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params);
+void GLTrace_glTexParameteri(GLenum target, GLenum pname, GLint param);
+void GLTrace_glTexParameteriv(GLenum target, GLenum pname, const GLint* params);
+void GLTrace_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
+void GLTrace_glUniform1f(GLint location, GLfloat x);
+void GLTrace_glUniform1fv(GLint location, GLsizei count, const GLfloat* v);
+void GLTrace_glUniform1i(GLint location, GLint x);
+void GLTrace_glUniform1iv(GLint location, GLsizei count, const GLint* v);
+void GLTrace_glUniform2f(GLint location, GLfloat x, GLfloat y);
+void GLTrace_glUniform2fv(GLint location, GLsizei count, const GLfloat* v);
+void GLTrace_glUniform2i(GLint location, GLint x, GLint y);
+void GLTrace_glUniform2iv(GLint location, GLsizei count, const GLint* v);
+void GLTrace_glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z);
+void GLTrace_glUniform3fv(GLint location, GLsizei count, const GLfloat* v);
+void GLTrace_glUniform3i(GLint location, GLint x, GLint y, GLint z);
+void GLTrace_glUniform3iv(GLint location, GLsizei count, const GLint* v);
+void GLTrace_glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+void GLTrace_glUniform4fv(GLint location, GLsizei count, const GLfloat* v);
+void GLTrace_glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w);
+void GLTrace_glUniform4iv(GLint location, GLsizei count, const GLint* v);
+void GLTrace_glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+void GLTrace_glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+void GLTrace_glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+void GLTrace_glUseProgram(GLuint program);
+void GLTrace_glValidateProgram(GLuint program);
+void GLTrace_glVertexAttrib1f(GLuint indx, GLfloat x);
+void GLTrace_glVertexAttrib1fv(GLuint indx, const GLfloat* values);
+void GLTrace_glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
+void GLTrace_glVertexAttrib2fv(GLuint indx, const GLfloat* values);
+void GLTrace_glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
+void GLTrace_glVertexAttrib3fv(GLuint indx, const GLfloat* values);
+void GLTrace_glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+void GLTrace_glVertexAttrib4fv(GLuint indx, const GLfloat* values);
+void GLTrace_glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
+void GLTrace_glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
+
+// Declarations for GL2Ext APIs
+
+void GLTrace_glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
+void GLTrace_glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
+void GLTrace_glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
+void GLTrace_glProgramBinaryOES(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
+void* GLTrace_glMapBufferOES(GLenum target, GLenum access);
+GLboolean GLTrace_glUnmapBufferOES(GLenum target);
+void GLTrace_glGetBufferPointervOES(GLenum target, GLenum pname, GLvoid** params);
+void GLTrace_glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
+void GLTrace_glTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
+void GLTrace_glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+void GLTrace_glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
+void GLTrace_glCompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
+void GLTrace_glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+void GLTrace_glBindVertexArrayOES(GLuint array);
+void GLTrace_glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays);
+void GLTrace_glGenVertexArraysOES(GLsizei n, GLuint *arrays);
+GLboolean GLTrace_glIsVertexArrayOES(GLuint array);
+void GLTrace_glGetPerfMonitorGroupsAMD(GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+void GLTrace_glGetPerfMonitorCountersAMD(GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+void GLTrace_glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+void GLTrace_glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+void GLTrace_glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, GLvoid *data);
+void GLTrace_glGenPerfMonitorsAMD(GLsizei n, GLuint *monitors);
+void GLTrace_glDeletePerfMonitorsAMD(GLsizei n, GLuint *monitors);
+void GLTrace_glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
+void GLTrace_glBeginPerfMonitorAMD(GLuint monitor);
+void GLTrace_glEndPerfMonitorAMD(GLuint monitor);
+void GLTrace_glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+void GLTrace_glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+void GLTrace_glRenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+void GLTrace_glRenderbufferStorageMultisampleAPPLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+void GLTrace_glResolveMultisampleFramebufferAPPLE(void);
+void GLTrace_glLabelObjectEXT(GLenum type, GLuint object, GLsizei length, const GLchar *label);
+void GLTrace_glGetObjectLabelEXT(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
+void GLTrace_glInsertEventMarkerEXT(GLsizei length, const GLchar *marker);
+void GLTrace_glPushGroupMarkerEXT(GLsizei length, const GLchar *marker);
+void GLTrace_glPopGroupMarkerEXT(void);
+void GLTrace_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum *attachments);
+void GLTrace_glRenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+void GLTrace_glFramebufferTexture2DMultisampleEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+void GLTrace_glMultiDrawArraysEXT(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+void GLTrace_glMultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+void GLTrace_glGenQueriesEXT(GLsizei n, GLuint *ids);
+void GLTrace_glDeleteQueriesEXT(GLsizei n, const GLuint *ids);
+GLboolean GLTrace_glIsQueryEXT(GLuint id);
+void GLTrace_glBeginQueryEXT(GLenum target, GLuint id);
+void GLTrace_glEndQueryEXT(GLenum target);
+void GLTrace_glGetQueryivEXT(GLenum target, GLenum pname, GLint *params);
+void GLTrace_glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint *params);
+GLenum GLTrace_glGetGraphicsResetStatusEXT(void);
+void GLTrace_glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+void GLTrace_glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, float *params);
+void GLTrace_glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint *params);
+void GLTrace_glUseProgramStagesEXT(GLuint pipeline, GLbitfield stages, GLuint program);
+void GLTrace_glActiveShaderProgramEXT(GLuint pipeline, GLuint program);
+GLuint GLTrace_glCreateShaderProgramvEXT(GLenum type, GLsizei count, const GLchar **strings);
+void GLTrace_glBindProgramPipelineEXT(GLuint pipeline);
+void GLTrace_glDeleteProgramPipelinesEXT(GLsizei n, const GLuint *pipelines);
+void GLTrace_glGenProgramPipelinesEXT(GLsizei n, GLuint *pipelines);
+GLboolean GLTrace_glIsProgramPipelineEXT(GLuint pipeline);
+void GLTrace_glProgramParameteriEXT(GLuint program, GLenum pname, GLint value);
+void GLTrace_glGetProgramPipelineivEXT(GLuint pipeline, GLenum pname, GLint *params);
+void GLTrace_glProgramUniform1iEXT(GLuint program, GLint location, GLint x);
+void GLTrace_glProgramUniform2iEXT(GLuint program, GLint location, GLint x, GLint y);
+void GLTrace_glProgramUniform3iEXT(GLuint program, GLint location, GLint x, GLint y, GLint z);
+void GLTrace_glProgramUniform4iEXT(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
+void GLTrace_glProgramUniform1fEXT(GLuint program, GLint location, GLfloat x);
+void GLTrace_glProgramUniform2fEXT(GLuint program, GLint location, GLfloat x, GLfloat y);
+void GLTrace_glProgramUniform3fEXT(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
+void GLTrace_glProgramUniform4fEXT(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+void GLTrace_glProgramUniform1ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value);
+void GLTrace_glProgramUniform2ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value);
+void GLTrace_glProgramUniform3ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value);
+void GLTrace_glProgramUniform4ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value);
+void GLTrace_glProgramUniform1fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+void GLTrace_glProgramUniform2fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+void GLTrace_glProgramUniform3fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+void GLTrace_glProgramUniform4fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+void GLTrace_glProgramUniformMatrix2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+void GLTrace_glProgramUniformMatrix3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+void GLTrace_glProgramUniformMatrix4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+void GLTrace_glValidateProgramPipelineEXT(GLuint pipeline);
+void GLTrace_glGetProgramPipelineInfoLogEXT(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+void GLTrace_glTexStorage1DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+void GLTrace_glTexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+void GLTrace_glTexStorage3DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+void GLTrace_glTextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+void GLTrace_glTextureStorage2DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+void GLTrace_glTextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+void GLTrace_glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+void GLTrace_glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+void GLTrace_glCoverageMaskNV(GLboolean mask);
+void GLTrace_glCoverageOperationNV(GLenum operation);
+void GLTrace_glDrawBuffersNV(GLsizei n, const GLenum *bufs);
+void GLTrace_glDeleteFencesNV(GLsizei n, const GLuint *fences);
+void GLTrace_glGenFencesNV(GLsizei n, GLuint *fences);
+GLboolean GLTrace_glIsFenceNV(GLuint fence);
+GLboolean GLTrace_glTestFenceNV(GLuint fence);
+void GLTrace_glGetFenceivNV(GLuint fence, GLenum pname, GLint *params);
+void GLTrace_glFinishFenceNV(GLuint fence);
+void GLTrace_glSetFenceNV(GLuint fence, GLenum condition);
+void GLTrace_glReadBufferNV(GLenum mode);
+void GLTrace_glAlphaFuncQCOM(GLenum func, GLclampf ref);
+void GLTrace_glGetDriverControlsQCOM(GLint *num, GLsizei size, GLuint *driverControls);
+void GLTrace_glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
+void GLTrace_glEnableDriverControlQCOM(GLuint driverControl);
+void GLTrace_glDisableDriverControlQCOM(GLuint driverControl);
+void GLTrace_glExtGetTexturesQCOM(GLuint *textures, GLint maxTextures, GLint *numTextures);
+void GLTrace_glExtGetBuffersQCOM(GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
+void GLTrace_glExtGetRenderbuffersQCOM(GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
+void GLTrace_glExtGetFramebuffersQCOM(GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
+void GLTrace_glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
+void GLTrace_glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param);
+void GLTrace_glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
+void GLTrace_glExtGetBufferPointervQCOM(GLenum target, GLvoid **params);
+void GLTrace_glExtGetShadersQCOM(GLuint *shaders, GLint maxShaders, GLint *numShaders);
+void GLTrace_glExtGetProgramsQCOM(GLuint *programs, GLint maxPrograms, GLint *numPrograms);
+GLboolean GLTrace_glExtIsProgramBinaryQCOM(GLuint program);
+void GLTrace_glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar *source, GLint *length);
+void GLTrace_glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+void GLTrace_glEndTilingQCOM(GLbitfield preserveMask);
+
+// Declarations for GL1 APIs
+
+void GLTrace_glAlphaFunc(GLenum func, GLclampf ref);
+void GLTrace_glClipPlanef(GLenum plane, const GLfloat *equation);
+void GLTrace_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+void GLTrace_glFogf(GLenum pname, GLfloat param);
+void GLTrace_glFogfv(GLenum pname, const GLfloat *params);
+void GLTrace_glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+void GLTrace_glGetClipPlanef(GLenum pname, GLfloat eqn[4]);
+void GLTrace_glGetLightfv(GLenum light, GLenum pname, GLfloat *params);
+void GLTrace_glGetMaterialfv(GLenum face, GLenum pname, GLfloat *params);
+void GLTrace_glGetTexEnvfv(GLenum env, GLenum pname, GLfloat *params);
+void GLTrace_glLightModelf(GLenum pname, GLfloat param);
+void GLTrace_glLightModelfv(GLenum pname, const GLfloat *params);
+void GLTrace_glLightf(GLenum light, GLenum pname, GLfloat param);
+void GLTrace_glLightfv(GLenum light, GLenum pname, const GLfloat *params);
+void GLTrace_glLoadMatrixf(const GLfloat *m);
+void GLTrace_glMaterialf(GLenum face, GLenum pname, GLfloat param);
+void GLTrace_glMaterialfv(GLenum face, GLenum pname, const GLfloat *params);
+void GLTrace_glMultMatrixf(const GLfloat *m);
+void GLTrace_glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+void GLTrace_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz);
+void GLTrace_glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+void GLTrace_glPointParameterf(GLenum pname, GLfloat param);
+void GLTrace_glPointParameterfv(GLenum pname, const GLfloat *params);
+void GLTrace_glPointSize(GLfloat size);
+void GLTrace_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+void GLTrace_glScalef(GLfloat x, GLfloat y, GLfloat z);
+void GLTrace_glTexEnvf(GLenum target, GLenum pname, GLfloat param);
+void GLTrace_glTexEnvfv(GLenum target, GLenum pname, const GLfloat *params);
+void GLTrace_glTranslatef(GLfloat x, GLfloat y, GLfloat z);
+void GLTrace_glAlphaFuncx(GLenum func, GLclampx ref);
+void GLTrace_glClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+void GLTrace_glClearDepthx(GLclampx depth);
+void GLTrace_glClientActiveTexture(GLenum texture);
+void GLTrace_glClipPlanex(GLenum plane, const GLfixed *equation);
+void GLTrace_glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+void GLTrace_glColor4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+void GLTrace_glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+void GLTrace_glDepthRangex(GLclampx zNear, GLclampx zFar);
+void GLTrace_glDisableClientState(GLenum array);
+void GLTrace_glEnableClientState(GLenum array);
+void GLTrace_glFogx(GLenum pname, GLfixed param);
+void GLTrace_glFogxv(GLenum pname, const GLfixed *params);
+void GLTrace_glFrustumx(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+void GLTrace_glGetClipPlanex(GLenum pname, GLfixed eqn[4]);
+void GLTrace_glGetFixedv(GLenum pname, GLfixed *params);
+void GLTrace_glGetLightxv(GLenum light, GLenum pname, GLfixed *params);
+void GLTrace_glGetMaterialxv(GLenum face, GLenum pname, GLfixed *params);
+void GLTrace_glGetPointerv(GLenum pname, GLvoid **params);
+void GLTrace_glGetTexEnviv(GLenum env, GLenum pname, GLint *params);
+void GLTrace_glGetTexEnvxv(GLenum env, GLenum pname, GLfixed *params);
+void GLTrace_glGetTexParameterxv(GLenum target, GLenum pname, GLfixed *params);
+void GLTrace_glLightModelx(GLenum pname, GLfixed param);
+void GLTrace_glLightModelxv(GLenum pname, const GLfixed *params);
+void GLTrace_glLightx(GLenum light, GLenum pname, GLfixed param);
+void GLTrace_glLightxv(GLenum light, GLenum pname, const GLfixed *params);
+void GLTrace_glLineWidthx(GLfixed width);
+void GLTrace_glLoadIdentity(void);
+void GLTrace_glLoadMatrixx(const GLfixed *m);
+void GLTrace_glLogicOp(GLenum opcode);
+void GLTrace_glMaterialx(GLenum face, GLenum pname, GLfixed param);
+void GLTrace_glMaterialxv(GLenum face, GLenum pname, const GLfixed *params);
+void GLTrace_glMatrixMode(GLenum mode);
+void GLTrace_glMultMatrixx(const GLfixed *m);
+void GLTrace_glMultiTexCoord4x(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+void GLTrace_glNormal3x(GLfixed nx, GLfixed ny, GLfixed nz);
+void GLTrace_glNormalPointer(GLenum type, GLsizei stride, const GLvoid *pointer);
+void GLTrace_glOrthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+void GLTrace_glPointParameterx(GLenum pname, GLfixed param);
+void GLTrace_glPointParameterxv(GLenum pname, const GLfixed *params);
+void GLTrace_glPointSizex(GLfixed size);
+void GLTrace_glPolygonOffsetx(GLfixed factor, GLfixed units);
+void GLTrace_glPopMatrix(void);
+void GLTrace_glPushMatrix(void);
+void GLTrace_glRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+void GLTrace_glSampleCoveragex(GLclampx value, GLboolean invert);
+void GLTrace_glScalex(GLfixed x, GLfixed y, GLfixed z);
+void GLTrace_glShadeModel(GLenum mode);
+void GLTrace_glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+void GLTrace_glTexEnvi(GLenum target, GLenum pname, GLint param);
+void GLTrace_glTexEnvx(GLenum target, GLenum pname, GLfixed param);
+void GLTrace_glTexEnviv(GLenum target, GLenum pname, const GLint *params);
+void GLTrace_glTexEnvxv(GLenum target, GLenum pname, const GLfixed *params);
+void GLTrace_glTexParameterx(GLenum target, GLenum pname, GLfixed param);
+void GLTrace_glTexParameterxv(GLenum target, GLenum pname, const GLfixed *params);
+void GLTrace_glTranslatex(GLfixed x, GLfixed y, GLfixed z);
+void GLTrace_glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+void GLTrace_glPointSizePointerOES(GLenum type, GLsizei stride, const GLvoid *pointer);
+
+// Declarations for GL1Ext APIs
+
+void GLTrace_glBlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha);
+void GLTrace_glBlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+void GLTrace_glBlendEquationOES(GLenum mode);
+void GLTrace_glDrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+void GLTrace_glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height);
+void GLTrace_glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+void GLTrace_glDrawTexsvOES(const GLshort *coords);
+void GLTrace_glDrawTexivOES(const GLint *coords);
+void GLTrace_glDrawTexxvOES(const GLfixed *coords);
+void GLTrace_glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+void GLTrace_glDrawTexfvOES(const GLfloat *coords);
+void GLTrace_glAlphaFuncxOES(GLenum func, GLclampx ref);
+void GLTrace_glClearColorxOES(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+void GLTrace_glClearDepthxOES(GLclampx depth);
+void GLTrace_glClipPlanexOES(GLenum plane, const GLfixed *equation);
+void GLTrace_glColor4xOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+void GLTrace_glDepthRangexOES(GLclampx zNear, GLclampx zFar);
+void GLTrace_glFogxOES(GLenum pname, GLfixed param);
+void GLTrace_glFogxvOES(GLenum pname, const GLfixed *params);
+void GLTrace_glFrustumxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+void GLTrace_glGetClipPlanexOES(GLenum pname, GLfixed eqn[4]);
+void GLTrace_glGetFixedvOES(GLenum pname, GLfixed *params);
+void GLTrace_glGetLightxvOES(GLenum light, GLenum pname, GLfixed *params);
+void GLTrace_glGetMaterialxvOES(GLenum face, GLenum pname, GLfixed *params);
+void GLTrace_glGetTexEnvxvOES(GLenum env, GLenum pname, GLfixed *params);
+void GLTrace_glGetTexParameterxvOES(GLenum target, GLenum pname, GLfixed *params);
+void GLTrace_glLightModelxOES(GLenum pname, GLfixed param);
+void GLTrace_glLightModelxvOES(GLenum pname, const GLfixed *params);
+void GLTrace_glLightxOES(GLenum light, GLenum pname, GLfixed param);
+void GLTrace_glLightxvOES(GLenum light, GLenum pname, const GLfixed *params);
+void GLTrace_glLineWidthxOES(GLfixed width);
+void GLTrace_glLoadMatrixxOES(const GLfixed *m);
+void GLTrace_glMaterialxOES(GLenum face, GLenum pname, GLfixed param);
+void GLTrace_glMaterialxvOES(GLenum face, GLenum pname, const GLfixed *params);
+void GLTrace_glMultMatrixxOES(const GLfixed *m);
+void GLTrace_glMultiTexCoord4xOES(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+void GLTrace_glNormal3xOES(GLfixed nx, GLfixed ny, GLfixed nz);
+void GLTrace_glOrthoxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+void GLTrace_glPointParameterxOES(GLenum pname, GLfixed param);
+void GLTrace_glPointParameterxvOES(GLenum pname, const GLfixed *params);
+void GLTrace_glPointSizexOES(GLfixed size);
+void GLTrace_glPolygonOffsetxOES(GLfixed factor, GLfixed units);
+void GLTrace_glRotatexOES(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+void GLTrace_glSampleCoveragexOES(GLclampx value, GLboolean invert);
+void GLTrace_glScalexOES(GLfixed x, GLfixed y, GLfixed z);
+void GLTrace_glTexEnvxOES(GLenum target, GLenum pname, GLfixed param);
+void GLTrace_glTexEnvxvOES(GLenum target, GLenum pname, const GLfixed *params);
+void GLTrace_glTexParameterxOES(GLenum target, GLenum pname, GLfixed param);
+void GLTrace_glTexParameterxvOES(GLenum target, GLenum pname, const GLfixed *params);
+void GLTrace_glTranslatexOES(GLfixed x, GLfixed y, GLfixed z);
+GLboolean GLTrace_glIsRenderbufferOES(GLuint renderbuffer);
+void GLTrace_glBindRenderbufferOES(GLenum target, GLuint renderbuffer);
+void GLTrace_glDeleteRenderbuffersOES(GLsizei n, const GLuint* renderbuffers);
+void GLTrace_glGenRenderbuffersOES(GLsizei n, GLuint* renderbuffers);
+void GLTrace_glRenderbufferStorageOES(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+void GLTrace_glGetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint* params);
+GLboolean GLTrace_glIsFramebufferOES(GLuint framebuffer);
+void GLTrace_glBindFramebufferOES(GLenum target, GLuint framebuffer);
+void GLTrace_glDeleteFramebuffersOES(GLsizei n, const GLuint* framebuffers);
+void GLTrace_glGenFramebuffersOES(GLsizei n, GLuint* framebuffers);
+GLenum GLTrace_glCheckFramebufferStatusOES(GLenum target);
+void GLTrace_glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+void GLTrace_glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+void GLTrace_glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint* params);
+void GLTrace_glGenerateMipmapOES(GLenum target);
+void GLTrace_glCurrentPaletteMatrixOES(GLuint matrixpaletteindex);
+void GLTrace_glLoadPaletteFromModelViewMatrixOES(void);
+void GLTrace_glMatrixIndexPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+void GLTrace_glWeightPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLbitfield GLTrace_glQueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16]);
+void GLTrace_glDepthRangefOES(GLclampf zNear, GLclampf zFar);
+void GLTrace_glFrustumfOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+void GLTrace_glOrthofOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+void GLTrace_glClipPlanefOES(GLenum plane, const GLfloat *equation);
+void GLTrace_glGetClipPlanefOES(GLenum pname, GLfloat eqn[4]);
+void GLTrace_glClearDepthfOES(GLclampf depth);
+void GLTrace_glTexGenfOES(GLenum coord, GLenum pname, GLfloat param);
+void GLTrace_glTexGenfvOES(GLenum coord, GLenum pname, const GLfloat *params);
+void GLTrace_glTexGeniOES(GLenum coord, GLenum pname, GLint param);
+void GLTrace_glTexGenivOES(GLenum coord, GLenum pname, const GLint *params);
+void GLTrace_glTexGenxOES(GLenum coord, GLenum pname, GLfixed param);
+void GLTrace_glTexGenxvOES(GLenum coord, GLenum pname, const GLfixed *params);
+void GLTrace_glGetTexGenfvOES(GLenum coord, GLenum pname, GLfloat *params);
+void GLTrace_glGetTexGenivOES(GLenum coord, GLenum pname, GLint *params);
+void GLTrace_glGetTexGenxvOES(GLenum coord, GLenum pname, GLfixed *params);
+void GLTrace_glClipPlanefIMG(GLenum p, const GLfloat *eqn);
+void GLTrace_glClipPlanexIMG(GLenum p, const GLfixed *eqn);
+
+}; // namespace gltrace
+}; // namespace android
diff --git a/opengl/libs/GLES_trace/src/gltrace_context.cpp b/opengl/libs/GLES_trace/src/gltrace_context.cpp
new file mode 100644
index 0000000..65b7662
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_context.cpp
@@ -0,0 +1,212 @@
+/*
+ * Copyright 2011, 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 <pthread.h>
+#include <cutils/log.h>
+
+extern "C" {
+#include "liblzf/lzf.h"
+}
+
+#include "gltrace_context.h"
+
+namespace android {
+namespace gltrace {
+
+using ::android::gl_hooks_t;
+
+static pthread_key_t sTLSKey = -1;
+static pthread_once_t sPthreadOnceKey = PTHREAD_ONCE_INIT;
+
+void createTLSKey() {
+    pthread_key_create(&sTLSKey, NULL);
+}
+
+GLTraceContext *getGLTraceContext() {
+    return (GLTraceContext*) pthread_getspecific(sTLSKey);
+}
+
+void setGLTraceContext(GLTraceContext *c) {
+    pthread_setspecific(sTLSKey, c);
+}
+
+void setupTraceContextThreadSpecific(GLTraceContext *context) {
+    pthread_once(&sPthreadOnceKey, createTLSKey);
+    setGLTraceContext(context);
+}
+
+void releaseContext() {
+    GLTraceContext *c = getGLTraceContext();
+    if (c != NULL) {
+        delete c;
+        setGLTraceContext(NULL);
+    }
+}
+
+GLTraceState::GLTraceState(TCPStream *stream) {
+    mTraceContextIds = 0;
+    mStream = stream;
+
+    mCollectFbOnEglSwap = false;
+    mCollectFbOnGlDraw = false;
+    mCollectTextureDataOnGlTexImage = false;
+    pthread_rwlock_init(&mTraceOptionsRwLock, NULL);
+}
+
+GLTraceState::~GLTraceState() {
+    if (mStream) {
+        mStream->closeStream();
+        mStream = NULL;
+    }
+}
+
+TCPStream *GLTraceState::getStream() {
+    return mStream;
+}
+
+void GLTraceState::safeSetValue(bool *ptr, bool value, pthread_rwlock_t *lock) {
+    pthread_rwlock_wrlock(lock);
+    *ptr = value;
+    pthread_rwlock_unlock(lock);
+}
+
+bool GLTraceState::safeGetValue(bool *ptr, pthread_rwlock_t *lock) {
+    pthread_rwlock_rdlock(lock);
+    bool value = *ptr;
+    pthread_rwlock_unlock(lock);
+    return value;
+}
+
+void GLTraceState::setCollectFbOnEglSwap(bool en) {
+    safeSetValue(&mCollectFbOnEglSwap, en, &mTraceOptionsRwLock);
+}
+
+void GLTraceState::setCollectFbOnGlDraw(bool en) {
+    safeSetValue(&mCollectFbOnGlDraw, en, &mTraceOptionsRwLock);
+}
+
+void GLTraceState::setCollectTextureDataOnGlTexImage(bool en) {
+    safeSetValue(&mCollectTextureDataOnGlTexImage, en, &mTraceOptionsRwLock);
+}
+
+bool GLTraceState::shouldCollectFbOnEglSwap() {
+    return safeGetValue(&mCollectFbOnEglSwap, &mTraceOptionsRwLock);
+}
+
+bool GLTraceState::shouldCollectFbOnGlDraw() {
+    return safeGetValue(&mCollectFbOnGlDraw, &mTraceOptionsRwLock);
+}
+
+bool GLTraceState::shouldCollectTextureDataOnGlTexImage() {
+    return safeGetValue(&mCollectTextureDataOnGlTexImage, &mTraceOptionsRwLock);
+}
+
+GLTraceContext *GLTraceState::createTraceContext(int version, EGLContext eglContext) {
+    int id = __sync_fetch_and_add(&mTraceContextIds, 1);
+
+    const size_t DEFAULT_BUFFER_SIZE = 8192;
+    BufferedOutputStream *stream = new BufferedOutputStream(mStream, DEFAULT_BUFFER_SIZE);
+    GLTraceContext *traceContext = new GLTraceContext(id, this, stream);
+    mPerContextState[eglContext] = traceContext;
+
+    return traceContext;
+}
+
+GLTraceContext *GLTraceState::getTraceContext(EGLContext c) {
+    return mPerContextState[c];
+}
+
+GLTraceContext::GLTraceContext(int id, GLTraceState *state, BufferedOutputStream *stream) {
+    mId = id;
+    mState = state;
+
+    fbcontents = fbcompressed = NULL;
+    fbcontentsSize = 0;
+    mBufferedOutputStream = stream;
+}
+
+int GLTraceContext::getId() {
+    return mId;
+}
+
+GLTraceState *GLTraceContext::getGlobalTraceState() {
+    return mState;
+}
+
+void GLTraceContext::resizeFBMemory(unsigned minSize) {
+    if (fbcontentsSize >= minSize) {
+        return;
+    }
+
+    if (fbcontents != NULL) {
+        free(fbcontents);
+        free(fbcompressed);
+    }
+
+    fbcontents = malloc(minSize);
+    fbcompressed = malloc(minSize);
+
+    fbcontentsSize = minSize;
+}
+
+/** obtain a pointer to the compressed framebuffer image */
+void GLTraceContext::getCompressedFB(void **fb, unsigned *fbsize, unsigned *fbwidth, 
+                            unsigned *fbheight, FBBinding fbToRead) {
+    int viewport[4] = {};
+    hooks->gl.glGetIntegerv(GL_VIEWPORT, viewport);
+    unsigned fbContentsSize = viewport[2] * viewport[3] * 4;
+
+    resizeFBMemory(fbContentsSize);
+
+    // switch current framebuffer binding if necessary
+    GLint currentFb = -1;
+    bool fbSwitched = false;
+    if (fbToRead != CURRENTLY_BOUND_FB) {
+        hooks->gl.glGetIntegerv(GL_FRAMEBUFFER_BINDING, &currentFb);
+
+        if (currentFb != 0) {
+            hooks->gl.glBindFramebuffer(GL_FRAMEBUFFER, 0);
+            fbSwitched = true;
+        }
+    }
+
+    hooks->gl.glReadPixels(viewport[0], viewport[1], viewport[2], viewport[3],
+                                        GL_RGBA, GL_UNSIGNED_BYTE, fbcontents);
+
+    // switch back to previously bound buffer if necessary
+    if (fbSwitched) {
+        hooks->gl.glBindFramebuffer(GL_FRAMEBUFFER, currentFb);
+    }
+
+    *fbsize = lzf_compress(fbcontents, fbContentsSize, fbcompressed, fbContentsSize);
+    *fb = fbcompressed;
+    *fbwidth = viewport[2];
+    *fbheight = viewport[3];
+}
+
+void GLTraceContext::traceGLMessage(GLMessage *msg) {
+    mBufferedOutputStream->send(msg);
+
+    GLMessage_Function func = msg->function();
+    if (func == GLMessage::eglSwapBuffers
+        || func == GLMessage::glDrawArrays
+        || func == GLMessage::glDrawElements) {
+        mBufferedOutputStream->flush();
+    }
+}
+
+}; // namespace gltrace
+}; // namespace android
diff --git a/opengl/libs/GLES_trace/src/gltrace_context.h b/opengl/libs/GLES_trace/src/gltrace_context.h
new file mode 100644
index 0000000..129116a
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_context.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2011, 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.
+ */
+
+#ifndef __GLTRACE_CONTEXT_H_
+#define __GLTRACE_CONTEXT_H_
+
+#include <map>
+#include <pthread.h>
+
+#include "hooks.h"
+#include "gltrace_transport.h"
+
+namespace android {
+namespace gltrace {
+
+using ::android::gl_hooks_t;
+
+enum FBBinding {CURRENTLY_BOUND_FB, FB0};
+
+class GLTraceState;
+
+/** GL Trace Context info associated with each EGLContext */
+class GLTraceContext {
+    int mId;                    /* unique context id */
+    GLTraceState *mState;       /* parent GL Trace state (for per process GL Trace State Info) */
+
+    void *fbcontents;           /* memory area to read framebuffer contents */
+    void *fbcompressed;         /* destination for lzf compressed framebuffer */
+    unsigned fbcontentsSize;    /* size of fbcontents & fbcompressed buffers */
+
+    BufferedOutputStream *mBufferedOutputStream; /* stream where trace info is sent */
+
+    void resizeFBMemory(unsigned minSize);
+public:
+    gl_hooks_t *hooks;
+
+    GLTraceContext(int id, GLTraceState *state, BufferedOutputStream *stream);
+    int getId();
+    GLTraceState *getGlobalTraceState();
+    void getCompressedFB(void **fb, unsigned *fbsize,
+                            unsigned *fbwidth, unsigned *fbheight,
+                            FBBinding fbToRead);
+    void traceGLMessage(GLMessage *msg);
+};
+
+/** Per process trace state. */
+class GLTraceState {
+    int mTraceContextIds;
+    TCPStream *mStream;
+    std::map<EGLContext, GLTraceContext*> mPerContextState;
+
+    /* Options controlling additional data to be collected on
+       certain trace calls. */
+    bool mCollectFbOnEglSwap;
+    bool mCollectFbOnGlDraw;
+    bool mCollectTextureDataOnGlTexImage;
+    pthread_rwlock_t mTraceOptionsRwLock;
+
+    /* helper methods to get/set values using provided lock for mutual exclusion. */
+    void safeSetValue(bool *ptr, bool value, pthread_rwlock_t *lock);
+    bool safeGetValue(bool *ptr, pthread_rwlock_t *lock);
+public:
+    GLTraceState(TCPStream *stream);
+    ~GLTraceState();
+
+    GLTraceContext *createTraceContext(int version, EGLContext c);
+    GLTraceContext *getTraceContext(EGLContext c);
+
+    TCPStream *getStream();
+
+    /* Methods to set trace options. */
+    void setCollectFbOnEglSwap(bool en);
+    void setCollectFbOnGlDraw(bool en);
+    void setCollectTextureDataOnGlTexImage(bool en);
+
+    /* Methods to retrieve trace options. */
+    bool shouldCollectFbOnEglSwap();
+    bool shouldCollectFbOnGlDraw();
+    bool shouldCollectTextureDataOnGlTexImage();
+};
+
+void setupTraceContextThreadSpecific(GLTraceContext *context);
+GLTraceContext *getGLTraceContext();
+void releaseContext();
+
+};
+};
+
+#endif
diff --git a/opengl/libs/GLES_trace/src/gltrace_egl.cpp b/opengl/libs/GLES_trace/src/gltrace_egl.cpp
new file mode 100644
index 0000000..9d1682a
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_egl.cpp
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2011, 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 <cutils/log.h>
+#include <utils/Timers.h>
+
+#include "gltrace.pb.h"
+#include "gltrace_context.h"
+#include "gltrace_fixup.h"
+#include "gltrace_transport.h"
+
+namespace android {
+namespace gltrace {
+
+void GLTrace_eglCreateContext(int version, int contextId) {
+    GLMessage glmessage;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmessage.set_context_id(contextId);
+    glmessage.set_function(GLMessage::eglCreateContext);
+
+    // copy argument version
+    GLMessage_DataType *arg_version = glmessage.add_args();
+    arg_version->set_isarray(false);
+    arg_version->set_type(GLMessage::DataType::INT);
+    arg_version->add_intvalue(version);
+
+    // copy argument context
+    GLMessage_DataType *arg_context = glmessage.add_args();
+    arg_context->set_isarray(false);
+    arg_context->set_type(GLMessage::DataType::INT);
+    arg_context->add_intvalue(contextId);
+
+    // set start time and duration
+    glmessage.set_start_time(systemTime());
+    glmessage.set_duration(0);
+
+    glContext->traceGLMessage(&glmessage);
+}
+
+void GLTrace_eglMakeCurrent(int contextId) {
+    GLMessage glmessage;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmessage.set_context_id(contextId);
+    glmessage.set_function(GLMessage::eglMakeCurrent);
+
+    // copy argument context
+    GLMessage_DataType *arg_context = glmessage.add_args();
+    arg_context->set_isarray(false);
+    arg_context->set_type(GLMessage::DataType::INT);
+    arg_context->add_intvalue(contextId);
+
+    // set start time and duration
+    glmessage.set_start_time(systemTime());
+    glmessage.set_duration(0);
+
+    glContext->traceGLMessage(&glmessage);
+}
+
+void GLTrace_eglSwapBuffers(void *dpy, void *draw) {
+    GLMessage glmessage;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmessage.set_context_id(glContext->getId());
+    glmessage.set_function(GLMessage::eglSwapBuffers);
+
+    if (glContext->getGlobalTraceState()->shouldCollectFbOnEglSwap()) {
+        // read FB0 since that is what is displayed on the screen
+        fixup_addFBContents(glContext, &glmessage, FB0);
+    }
+
+    // set start time and duration
+    glmessage.set_start_time(systemTime());
+    glmessage.set_duration(0);
+
+    glContext->traceGLMessage(&glmessage);
+}
+
+};
+};
diff --git a/opengl/libs/GLES_trace/src/gltrace_egl.h b/opengl/libs/GLES_trace/src/gltrace_egl.h
new file mode 100644
index 0000000..f4684c5
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_egl.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2011, 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.
+ */
+
+#ifndef __GLTRACE_EGL_H_
+#define __GLTRACE_EGL_H_
+
+namespace android {
+namespace gltrace {
+
+void GLTrace_eglCreateContext(int version, int contextId);
+void GLTrace_eglMakeCurrent(int contextId);
+void GLTrace_eglSwapBuffers(void *dpy, void *draw);
+
+};
+};
+
+#endif
diff --git a/opengl/libs/GLES_trace/src/gltrace_eglapi.cpp b/opengl/libs/GLES_trace/src/gltrace_eglapi.cpp
new file mode 100644
index 0000000..c442153
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_eglapi.cpp
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2011, 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 <arpa/inet.h>
+#include <stdlib.h>
+#include <cutils/log.h>
+#include <cutils/properties.h>
+
+#include "hooks.h"
+#include "glestrace.h"
+
+#include "gltrace_context.h"
+#include "gltrace_egl.h"
+#include "gltrace_hooks.h"
+#include "gltrace_transport.h"
+
+namespace android {
+
+using gltrace::GLTraceState;
+using gltrace::GLTraceContext;
+using gltrace::TCPStream;
+
+static GLTraceState *sGLTraceState;
+static pthread_t sReceiveThreadId;
+
+/**
+ * Task that monitors the control stream from the host and updates
+ * the trace status according to commands received from the host.
+ */
+static void *commandReceiveTask(void *arg) {
+    GLTraceState *state = (GLTraceState *)arg;
+    TCPStream *stream = state->getStream();
+
+    // Currently, there are very few user configurable settings.
+    // As a result, they can be encoded in a single integer.
+    int cmd;
+    enum TraceSettingsMasks {
+        READ_FB_ON_EGLSWAP_MASK = 1 << 0,
+        READ_FB_ON_GLDRAW_MASK = 1 << 1,
+        READ_TEXTURE_DATA_ON_GLTEXIMAGE_MASK = 1 << 2,
+    };
+
+    while (true) {
+        int n = stream->receive(&cmd, 4);
+        if (n != 4) {
+            break;
+        }
+
+        cmd = ntohl(cmd);
+
+        bool collectFbOnEglSwap = (cmd & READ_FB_ON_EGLSWAP_MASK) != 0;
+        bool collectFbOnGlDraw = (cmd & READ_FB_ON_GLDRAW_MASK) != 0;
+        bool collectTextureData = (cmd & READ_TEXTURE_DATA_ON_GLTEXIMAGE_MASK) != 0;
+
+        state->setCollectFbOnEglSwap(collectFbOnEglSwap);
+        state->setCollectFbOnGlDraw(collectFbOnGlDraw);
+        state->setCollectTextureDataOnGlTexImage(collectTextureData);
+
+        ALOGD("trace options: eglswap: %d, gldraw: %d, texImage: %d",
+            collectFbOnEglSwap, collectFbOnGlDraw, collectTextureData);
+    }
+
+    return NULL;
+}
+
+void GLTrace_start() {
+    char udsName[PROPERTY_VALUE_MAX];
+
+    property_get("debug.egl.debug_portname", udsName, "gltrace");
+    int clientSocket = gltrace::acceptClientConnection(udsName);
+    if (clientSocket < 0) {
+        ALOGE("Error creating GLTrace server socket. Quitting application.");
+        exit(-1);
+    }
+
+    // create communication channel to the host
+    TCPStream *stream = new TCPStream(clientSocket);
+
+    // initialize tracing state
+    sGLTraceState = new GLTraceState(stream);
+
+    pthread_create(&sReceiveThreadId, NULL, commandReceiveTask, sGLTraceState);
+}
+
+void GLTrace_stop() {
+    delete sGLTraceState;
+    sGLTraceState = NULL;
+}
+
+void GLTrace_eglCreateContext(int version, EGLContext c) {
+    // update trace state for new EGL context
+    GLTraceContext *traceContext = sGLTraceState->createTraceContext(version, c);
+    gltrace::setupTraceContextThreadSpecific(traceContext);
+
+    // trace command through to the host
+    gltrace::GLTrace_eglCreateContext(version, traceContext->getId());
+}
+
+void GLTrace_eglMakeCurrent(const unsigned version, gl_hooks_t *hooks, EGLContext c) {
+    // setup per context state
+    GLTraceContext *traceContext = sGLTraceState->getTraceContext(c);
+    traceContext->hooks = hooks;
+    gltrace::setupTraceContextThreadSpecific(traceContext);
+
+    // trace command through to the host
+    gltrace::GLTrace_eglMakeCurrent(traceContext->getId());
+}
+
+void GLTrace_eglReleaseThread() {
+    gltrace::releaseContext();
+}
+
+void GLTrace_eglSwapBuffers(void *dpy, void *draw) {
+    gltrace::GLTrace_eglSwapBuffers(dpy, draw);
+}
+
+gl_hooks_t *GLTrace_getGLHooks() {
+    return gltrace::getGLHooks();
+}
+
+}
diff --git a/opengl/libs/GLES_trace/src/gltrace_fixup.cpp b/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
new file mode 100644
index 0000000..daba3ff
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
@@ -0,0 +1,367 @@
+/*
+ * Copyright 2011, 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 <cutils/log.h>
+#include <GLES2/gl2.h>
+
+#include "gltrace.pb.h"
+#include "gltrace_context.h"
+#include "gltrace_fixup.h"
+
+namespace android {
+namespace gltrace {
+
+unsigned getBytesPerTexel(const GLenum format, const GLenum type) {
+    /*
+    Description from glTexImage2D spec:
+
+    Data is read from data as a sequence of unsigned bytes or shorts, depending on type.
+    When type is GL_UNSIGNED_BYTE, each of the bytes is interpreted as one color component.
+    When type is one of GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_4_4_4_4, or
+    GL_UNSIGNED_SHORT_5_5_5_1, each unsigned short value is interpreted as containing all
+    the components for a single texel, with the color components arranged according to
+    format. Color components are treated as groups of one, two, three, or four values,
+    again based on format. Groups of components are referred to as texels.
+
+    width × height texels are read from memory, starting at location data. By default,
+    these texels are taken from adjacent memory locations, except that after all width
+    texels are read, the read pointer is advanced to the next four-byte boundary.
+    The four-byte row alignment is specified by glPixelStorei with argument
+    GL_UNPACK_ALIGNMENT, and it can be set to one, two, four, or eight bytes.
+    */
+
+    switch (type) {
+    case GL_UNSIGNED_SHORT_5_6_5:
+    case GL_UNSIGNED_SHORT_4_4_4_4:
+    case GL_UNSIGNED_SHORT_5_5_5_1:
+        return 2;
+    case GL_UNSIGNED_BYTE:
+        break;
+    default:
+        ALOGE("GetBytesPerPixel: unknown type %x", type);
+    }
+
+    switch (format) {
+    case GL_ALPHA:
+    case GL_LUMINANCE:
+        return 1;
+    case GL_LUMINANCE_ALPHA:
+        return 2;
+    case GL_RGB:
+        return 3;
+    case GL_RGBA:
+    case 0x80E1: // GL_BGRA_EXT
+        return 4;
+    default:
+        ALOGE("GetBytesPerPixel: unknown format %x", format);
+    }
+
+    return 1;   // in doubt...
+}
+
+/** Generic helper function: extract pointer at argIndex and
+    replace it with the C style string at *pointer */
+void fixup_CStringPtr(int argIndex, GLMessage *glmsg) {
+    GLMessage_DataType *arg = glmsg->mutable_args(argIndex);
+    GLchar *ptr = (GLchar *)arg->intvalue(0);
+
+    arg->set_type(GLMessage::DataType::CHAR);
+    arg->set_isarray(true);
+    arg->add_charvalue(ptr);
+}
+
+void fixup_glGetString(GLMessage *glmsg) {
+    /* const GLubyte* GLTrace_glGetString(GLenum name) */
+    GLMessage_DataType *ret = glmsg->mutable_returnvalue();
+    GLchar *ptr = (GLchar *)ret->intvalue(0);
+
+    if (ptr != NULL) {
+        ret->set_type(GLMessage::DataType::CHAR);
+        ret->set_isarray(true);
+        ret->add_charvalue(ptr);
+    }
+}
+
+/* Add the contents of the framebuffer to the protobuf message */
+void fixup_addFBContents(GLTraceContext *context, GLMessage *glmsg, FBBinding fbToRead) {
+    void *fbcontents;
+    unsigned fbsize, fbwidth, fbheight;
+    context->getCompressedFB(&fbcontents, &fbsize, &fbwidth, &fbheight, fbToRead);
+
+    GLMessage_FrameBuffer *fb = glmsg->mutable_fb();
+    fb->set_width(fbwidth);
+    fb->set_height(fbheight);
+    fb->add_contents(fbcontents, fbsize);
+}
+
+/** Common fixup routing for glTexImage2D & glTexSubImage2D. */
+void fixup_glTexImage(int widthIndex, int heightIndex, GLMessage *glmsg) {
+    GLMessage_DataType arg_width  = glmsg->args(widthIndex);
+    GLMessage_DataType arg_height = glmsg->args(heightIndex);
+
+    GLMessage_DataType arg_format = glmsg->args(6);
+    GLMessage_DataType arg_type   = glmsg->args(7);
+    GLMessage_DataType *arg_data  = glmsg->mutable_args(8);
+
+    GLsizei width  = arg_width.intvalue(0);
+    GLsizei height = arg_height.intvalue(0);
+    GLenum format  = arg_format.intvalue(0);
+    GLenum type    = arg_type.intvalue(0);
+    void *data     = (void *)arg_data->intvalue(0);
+
+    int bytesPerTexel = getBytesPerTexel(format, type);
+
+    arg_data->set_type(GLMessage::DataType::BYTE);
+    arg_data->clear_rawbytes();
+
+    if (data != NULL) {
+        arg_data->set_isarray(true);
+        arg_data->add_rawbytes(data, bytesPerTexel * width * height);
+    } else {
+        arg_data->set_isarray(false);
+        arg_data->set_type(GLMessage::DataType::VOID);
+    }
+}
+
+
+void fixup_glTexImage2D(GLMessage *glmsg) {
+    /* void glTexImage2D(GLenum target,
+                        GLint level,
+                        GLint internalformat,
+                        GLsizei width,
+                        GLsizei height,
+                        GLint border,
+                        GLenum format,
+                        GLenum type,
+                        const GLvoid *data); 
+    */
+    int widthIndex = 3;
+    int heightIndex = 4;
+    fixup_glTexImage(widthIndex, heightIndex, glmsg);
+}
+
+void fixup_glTexSubImage2D(GLMessage *glmsg) {
+    /*
+    void glTexSubImage2D(GLenum target,
+                        GLint level,
+                        GLint xoffset,
+                        GLint yoffset,
+                        GLsizei width,
+                        GLsizei height,
+                        GLenum format,
+                        GLenum type,
+                        const GLvoid * data);
+    */
+    int widthIndex = 4;
+    int heightIndex = 5;
+    fixup_glTexImage(widthIndex, heightIndex, glmsg);
+}
+
+void fixup_glShaderSource(GLMessage *glmsg) {
+    /* void glShaderSource(GLuint shader, GLsizei count, const GLchar** string, 
+                                    const GLint* length) */
+    GLMessage_DataType arg_count  = glmsg->args(1);
+    GLMessage_DataType arg_lenp   = glmsg->args(3);
+    GLMessage_DataType *arg_strpp = glmsg->mutable_args(2);
+
+    GLsizei count = arg_count.intvalue(0);
+    GLchar **stringpp = (GLchar **)arg_strpp->intvalue(0);
+    GLint *lengthp = (GLint *)arg_lenp.intvalue(0);
+
+    arg_strpp->set_type(GLMessage::DataType::CHAR);
+    arg_strpp->set_isarray(true);
+    arg_strpp->clear_charvalue();
+
+    ::std::string src = "";
+    for (int i = 0; i < count; i++) {
+        if (lengthp != NULL)
+            src.append(*stringpp, *lengthp);
+        else
+            src.append(*stringpp);  // assume null terminated
+        stringpp++;
+        lengthp++;
+    }
+
+    arg_strpp->add_charvalue(src);
+}
+
+void fixup_glUniformGeneric(int argIndex, int nFloats, GLMessage *glmsg) {
+    GLMessage_DataType *arg_values = glmsg->mutable_args(argIndex);
+    GLfloat *src = (GLfloat*)arg_values->intvalue(0);
+
+    arg_values->set_type(GLMessage::DataType::FLOAT);
+    arg_values->set_isarray(true);
+    arg_values->clear_floatvalue();
+
+    for (int i = 0; i < nFloats; i++) {
+        arg_values->add_floatvalue(*src++);
+    }
+}
+
+void fixup_glUniformMatrixGeneric(int matrixSize, GLMessage *glmsg) {
+    /* void glUniformMatrix?fv(GLint location, GLsizei count, GLboolean transpose, 
+                                                                const GLfloat* value) */
+    GLMessage_DataType arg_count  = glmsg->args(1);
+    int n_matrices = arg_count.intvalue(0);
+    fixup_glUniformGeneric(3, matrixSize * matrixSize * n_matrices, glmsg);
+}
+
+void fixup_GenericIntArray(int argIndex, int nInts, GLMessage *glmsg) {
+    GLMessage_DataType *arg_intarray = glmsg->mutable_args(argIndex);
+    GLint *intp = (GLint *)arg_intarray->intvalue(0);
+
+    arg_intarray->set_type(GLMessage::DataType::INT);
+    arg_intarray->set_isarray(true);
+    arg_intarray->clear_intvalue();
+
+    for (int i = 0; i < nInts; i++, intp++) {
+        arg_intarray->add_intvalue(*intp);
+    }
+}
+
+void fixup_glGenGeneric(GLMessage *glmsg) {
+    /* void glGen*(GLsizei n, GLuint * buffers); */
+    GLMessage_DataType arg_n  = glmsg->args(0);
+    GLsizei n = arg_n.intvalue(0);
+
+    fixup_GenericIntArray(1, n, glmsg);
+}
+
+void fixup_glDeleteGeneric(GLMessage *glmsg) {
+    /* void glDelete*(GLsizei n, GLuint *buffers); */
+    GLMessage_DataType arg_n  = glmsg->args(0);
+    GLsizei n = arg_n.intvalue(0);
+
+    fixup_GenericIntArray(1, n, glmsg);
+}
+
+void fixup_glGetBooleanv(GLMessage *glmsg) {
+    /* void glGetBooleanv(GLenum pname, GLboolean *params); */
+    GLMessage_DataType *arg_params = glmsg->mutable_args(1);
+    GLboolean *src = (GLboolean*)arg_params->intvalue(0);
+
+    arg_params->set_type(GLMessage::DataType::BOOL);
+    arg_params->set_isarray(true);
+    arg_params->clear_boolvalue();
+    arg_params->add_boolvalue(*src);
+}
+
+void fixup_glGetFloatv(GLMessage *glmsg) {
+    /* void glGetFloatv(GLenum pname, GLfloat *params); */
+    GLMessage_DataType *arg_params = glmsg->mutable_args(1);
+    GLfloat *src = (GLfloat*)arg_params->intvalue(0);
+
+    arg_params->set_type(GLMessage::DataType::FLOAT);
+    arg_params->set_isarray(true);
+    arg_params->clear_floatvalue();
+    arg_params->add_floatvalue(*src);
+}
+
+void fixupGLMessage(GLTraceContext *context, nsecs_t start, nsecs_t end, GLMessage *glmsg) {
+    // for all messages, set the current context id
+    glmsg->set_context_id(context->getId());
+
+    // set start time and duration
+    glmsg->set_start_time(start);
+    glmsg->set_duration((unsigned)(end - start));
+
+    // do any custom message dependent processing
+    switch (glmsg->function()) {
+    case GLMessage::glDeleteBuffers:      /* glDeleteBuffers(GLsizei n, GLuint *buffers); */
+    case GLMessage::glDeleteFramebuffers: /* glDeleteFramebuffers(GLsizei n, GLuint *buffers); */
+    case GLMessage::glDeleteRenderbuffers:/* glDeleteRenderbuffers(GLsizei n, GLuint *buffers); */
+    case GLMessage::glDeleteTextures:     /* glDeleteTextures(GLsizei n, GLuint *textures); */
+        fixup_glDeleteGeneric(glmsg);
+        break;
+    case GLMessage::glGenBuffers:        /* void glGenBuffers(GLsizei n, GLuint *buffers); */
+    case GLMessage::glGenFramebuffers:   /* void glGenFramebuffers(GLsizei n, GLuint *buffers); */
+    case GLMessage::glGenRenderbuffers:  /* void glGenFramebuffers(GLsizei n, GLuint *buffers); */
+    case GLMessage::glGenTextures:       /* void glGenTextures(GLsizei n, GLuint *textures); */
+        fixup_glGenGeneric(glmsg);
+        break;
+    case GLMessage::glGetAttribLocation:  
+    case GLMessage::glGetUniformLocation: 
+        /* int glGetAttribLocation(GLuint program, const GLchar* name) */
+        /* int glGetUniformLocation(GLuint program, const GLchar* name) */
+        fixup_CStringPtr(1, glmsg);
+        break;
+    case GLMessage::glGetBooleanv:
+        fixup_glGetBooleanv(glmsg);
+        break;
+    case GLMessage::glGetFloatv:
+        fixup_glGetFloatv(glmsg);
+        break;
+    case GLMessage::glGetIntegerv:        /* void glGetIntegerv(GLenum pname, GLint *params); */
+        fixup_GenericIntArray(1, 1, glmsg);
+        break;
+    case GLMessage::glGetProgramiv:
+    case GLMessage::glGetRenderbufferParameteriv:
+    case GLMessage::glGetShaderiv:
+        /* void glGetProgramiv(GLuint program, GLenum pname, GLint* params) */
+        /* void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) */
+        /* void glGetShaderiv(GLuint shader, GLenum pname, GLint* params) */
+        fixup_GenericIntArray(2, 1, glmsg);
+        break;
+    case GLMessage::glGetString:
+        fixup_glGetString(glmsg);
+        break;
+    case GLMessage::glTexImage2D:
+        if (context->getGlobalTraceState()->shouldCollectTextureDataOnGlTexImage()) {
+            fixup_glTexImage2D(glmsg);
+        }
+        break;
+    case GLMessage::glTexSubImage2D:
+        if (context->getGlobalTraceState()->shouldCollectTextureDataOnGlTexImage()) {
+            fixup_glTexSubImage2D(glmsg);
+        }
+        break;
+    case GLMessage::glShaderSource:
+        fixup_glShaderSource(glmsg);
+        break;
+    case GLMessage::glUniformMatrix2fv:
+        /* void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose,
+                                                                    const GLfloat* value) */
+        fixup_glUniformMatrixGeneric(2, glmsg);
+        break;
+    case GLMessage::glUniformMatrix3fv:
+        /* void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose,
+                                                                    const GLfloat* value) */
+        fixup_glUniformMatrixGeneric(3, glmsg);
+        break;
+    case GLMessage::glUniformMatrix4fv:
+        /* void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose,
+                                                                    const GLfloat* value) */
+        fixup_glUniformMatrixGeneric(4, glmsg);
+        break;
+    case GLMessage::glDrawArrays:
+        /* void glDrawArrays(GLenum mode, GLint first, GLsizei count) */
+        if (context->getGlobalTraceState()->shouldCollectFbOnGlDraw()) {
+            fixup_addFBContents(context, glmsg, CURRENTLY_BOUND_FB);
+        }
+        break;
+    case GLMessage::glDrawElements:
+        /* void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) */
+        if (context->getGlobalTraceState()->shouldCollectFbOnGlDraw()) {
+            fixup_addFBContents(context, glmsg, CURRENTLY_BOUND_FB);
+        }
+        break;
+    default:
+        break;
+    }
+}
+
+};
+};
diff --git a/opengl/libs/GLES_trace/src/gltrace_fixup.h b/opengl/libs/GLES_trace/src/gltrace_fixup.h
new file mode 100644
index 0000000..64f7545
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_fixup.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2011, 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.
+ */
+
+#ifndef __GLTRACE_FIXUP_H_
+#define __GLTRACE_FIXUP_H_
+
+#include <utils/Timers.h>
+
+#include "gltrace.pb.h"
+#include "gltrace_context.h"
+
+namespace android {
+namespace gltrace {
+
+void fixupGLMessage(GLTraceContext *curContext, nsecs_t start, nsecs_t end, GLMessage *message);
+void fixup_addFBContents(GLTraceContext *curContext, GLMessage *message, FBBinding fbToRead);
+
+};
+};
+
+#endif
diff --git a/opengl/libs/GLES_trace/src/gltrace_hooks.cpp b/opengl/libs/GLES_trace/src/gltrace_hooks.cpp
new file mode 100644
index 0000000..de8d463
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_hooks.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2011, 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 "hooks.h"
+#include "gltrace_api.h"
+#include "gltrace_hooks.h"
+
+namespace android {
+namespace gltrace {
+
+// Hook up all the GLTrace functions
+#define GL_ENTRY(_r, _api, ...) GLTrace_ ## _api,
+EGLAPI gl_hooks_t gHooksDebug = {
+    {
+        #include "entries.in"
+    },
+    {
+        {0}
+    }
+};
+#undef GL_ENTRY
+
+gl_hooks_t *getGLHooks() {
+    return &gHooksDebug;
+}
+
+};
+};
diff --git a/opengl/libs/GLES_trace/src/gltrace_hooks.h b/opengl/libs/GLES_trace/src/gltrace_hooks.h
new file mode 100644
index 0000000..c946a09
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_hooks.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2011, 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.
+ */
+
+#ifndef __GLD_HOOKS_H_
+#define __GLD_HOOKS_H_
+
+#include "hooks.h"
+
+namespace android {
+namespace gltrace {
+
+using ::android::gl_hooks_t;
+
+gl_hooks_t *getGLHooks();
+
+};
+};
+
+#endif
diff --git a/opengl/libs/GLES_trace/src/gltrace_transport.cpp b/opengl/libs/GLES_trace/src/gltrace_transport.cpp
new file mode 100644
index 0000000..5251b12
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_transport.cpp
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2011, 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 <stdlib.h>
+#include <unistd.h>
+
+#include <unistd.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <netinet/in.h>
+
+#include <cutils/log.h>
+
+#include "gltrace_transport.h"
+
+namespace android {
+namespace gltrace {
+
+int acceptClientConnection(char *sockname) {
+    int serverSocket = socket(AF_LOCAL, SOCK_STREAM, 0);
+    if (serverSocket < 0) {
+        ALOGE("Error (%d) while creating socket. Check if app has network permissions.",
+                                                                            serverSocket);
+        return -1;
+    }
+
+    struct sockaddr_un server, client;
+
+    memset(&server, 0, sizeof server);
+    server.sun_family = AF_UNIX;
+    // the first byte of sun_path should be '\0' for abstract namespace
+    strcpy(server.sun_path + 1, sockname);
+
+    // note that sockaddr_len should be set to the exact size of the buffer that is used.
+    socklen_t sockaddr_len = sizeof(server.sun_family) + strlen(sockname) + 1;
+    if (bind(serverSocket, (struct sockaddr *) &server, sockaddr_len) < 0) {
+        close(serverSocket);
+        ALOGE("Failed to bind the server socket");
+        return -1;
+    }
+
+    if (listen(serverSocket, 1) < 0) {
+        close(serverSocket);
+        ALOGE("Failed to listen on server socket");
+        return -1;
+    }
+
+    ALOGD("gltrace::waitForClientConnection: server listening @ path %s", sockname);
+
+    int clientSocket = accept(serverSocket, (struct sockaddr *)&client, &sockaddr_len);
+    if (clientSocket < 0) {
+        close(serverSocket);
+        ALOGE("Failed to accept client connection");
+        return -1;
+    }
+
+    ALOGD("gltrace::waitForClientConnection: client connected.");
+
+    // do not accept any more incoming connections
+    close(serverSocket);
+
+    return clientSocket;
+}
+
+TCPStream::TCPStream(int socket) {
+    mSocket = socket;
+    pthread_mutex_init(&mSocketWriteMutex, NULL);
+}
+
+TCPStream::~TCPStream() {
+    pthread_mutex_destroy(&mSocketWriteMutex);
+}
+
+void TCPStream::closeStream() {
+    if (mSocket > 0) {
+        close(mSocket);
+        mSocket = 0;
+    }
+}
+
+int TCPStream::send(void *buf, size_t len) {
+    if (mSocket <= 0) {
+        return -1;
+    }
+
+    pthread_mutex_lock(&mSocketWriteMutex);
+    int n = write(mSocket, buf, len);
+    pthread_mutex_unlock(&mSocketWriteMutex);
+
+    return n;
+}
+
+int TCPStream::receive(void *data, size_t len) {
+    if (mSocket <= 0) {
+        return -1;
+    }
+
+    return read(mSocket, data, len);
+}
+
+BufferedOutputStream::BufferedOutputStream(TCPStream *stream, size_t bufferSize) {
+    mStream = stream;
+
+    mBufferSize = bufferSize;
+    mStringBuffer = "";
+    mStringBuffer.reserve(bufferSize);
+}
+
+int BufferedOutputStream::flush() {
+    if (mStringBuffer.size() == 0) {
+        return 0;
+    }
+
+    int n = mStream->send((void *)mStringBuffer.data(), mStringBuffer.size());
+    mStringBuffer.clear();
+    return n;
+}
+
+void BufferedOutputStream::enqueueMessage(GLMessage *msg) {
+    const uint32_t len = msg->ByteSize();
+
+    mStringBuffer.append((const char *)&len, sizeof(len));    // append header
+    msg->AppendToString(&mStringBuffer);                      // append message
+}
+
+int BufferedOutputStream::send(GLMessage *msg) {
+    enqueueMessage(msg);
+
+    if (mStringBuffer.size() > mBufferSize) {
+        return flush();
+    }
+
+    return 0;
+}
+
+};  // namespace gltrace
+};  // namespace android
diff --git a/opengl/libs/GLES_trace/src/gltrace_transport.h b/opengl/libs/GLES_trace/src/gltrace_transport.h
new file mode 100644
index 0000000..3665035
--- /dev/null
+++ b/opengl/libs/GLES_trace/src/gltrace_transport.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2011, 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.
+ */
+
+#ifndef __GLTRACE_TRANSPORT_H_
+#define __GLTRACE_TRANSPORT_H_
+
+#include <pthread.h>
+
+#include "gltrace.pb.h"
+
+namespace android {
+namespace gltrace {
+
+/**
+ * TCPStream provides a TCP based communication channel from the device to
+ * the host for transferring GLMessages.
+ */
+class TCPStream {
+    int mSocket;
+    pthread_mutex_t mSocketWriteMutex;
+public:
+    /** Create a TCP based communication channel over @socket */
+    TCPStream(int socket);
+    ~TCPStream();
+
+    /** Close the channel. */
+    void closeStream();
+
+    /** Send @data of size @len to host. . Returns -1 on error, 0 on success. */
+    int send(void *data, size_t len);
+
+    /** Receive data into @buf from the remote end. This is a blocking call. */
+    int receive(void *buf, size_t size);
+};
+
+/**
+ * BufferedOutputStream provides buffering of data sent to the underlying
+ * unbuffered channel.
+ */
+class BufferedOutputStream {
+    TCPStream *mStream;
+
+    size_t mBufferSize;
+    std::string mStringBuffer;
+
+    /** Enqueue message into internal buffer. */
+    void enqueueMessage(GLMessage *msg);
+public:
+    /**
+     * Construct a Buffered stream of size @bufferSize, using @stream as
+     * its underlying channel for transport.
+     */
+    BufferedOutputStream(TCPStream *stream, size_t bufferSize);
+
+    /**
+     * Send @msg. The message could be buffered and sent later with a
+     * subsequent message. Returns -1 on error, 0 on success.
+     */
+    int send(GLMessage *msg);
+
+    /** Send any buffered messages, returns -1 on error, 0 on success. */
+    int flush();
+};
+
+/**
+ * Utility method: start a server listening at @sockName (unix domain socket,
+ * abstract namespace path), and wait for a client connection.
+ * Returns the connected client socket on success, or -1 on failure.
+ */
+int acceptClientConnection(char *sockName);
+
+};
+};
+
+#endif
diff --git a/opengl/libs/GLES_trace/tools/genapi.py b/opengl/libs/GLES_trace/tools/genapi.py
new file mode 100755
index 0000000..557e407
--- /dev/null
+++ b/opengl/libs/GLES_trace/tools/genapi.py
@@ -0,0 +1,393 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2011 Google Inc.
+#
+# 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.
+#
+# ABOUT
+#   This script is used to generate the trace implementations of all
+#   OpenGL calls. When executed, it reads the specs for the OpenGL calls
+#   from the files GLES2/gl2_api.in, GLES2/gl2ext_api.in, GLES_CM/gl_api.in,
+#   and GLES_CM/glext_api.in, and generates trace versions for all the 
+#   defined functions.
+#
+# PREREQUISITES
+#   To generate C++ files, this script uses the 'pyratemp' template
+#   module. The only reason to use pyratemp is that it is extremly
+#   simple to install:
+#   $ wget http://www.simple-is-better.org/template/pyratemp-current/pyratemp.py
+#   Put the file in the GLES_trace/tools folder, or update PYTHONPATH
+#   to point to wherever it was downloaded.
+#
+# USAGE
+#   $ cd GLES_trace       - run the program from GLES2_trace folder
+#   $ ./tools/genapi.py   - generates a .cpp and .h file
+#   $ mv *.cpp *.h src/   - move the generated files into the src folder
+
+import sys
+import re
+import pyratemp
+
+# Constants corresponding to the protobuf DataType.Type
+class DataType:
+    def __init__(self, name):
+        self.name = name
+
+    def __str__(self):
+        if self.name == "pointer":  # pointers map to the INT DataType
+            return "INT"
+        return self.name.upper()
+
+    def getProtobufCall(self):
+        if self.name == "void":
+            raise ValueError("Attempt to set void value")
+        elif self.name == "char" or self.name == "byte" \
+                or self.name == "pointer" or self.name == "enum":
+            return "add_intvalue((int)"
+        elif self.name == "int":
+            return "add_intvalue("
+        elif self.name == "float":
+            return "add_floatvalue("
+        elif self.name == "bool":
+            return "add_boolvalue("
+        else:
+            raise ValueError("Unknown value type %s" % self.name)
+
+DataType.VOID = DataType("void")
+DataType.CHAR = DataType("char")
+DataType.BYTE = DataType("byte")
+DataType.ENUM = DataType("enum")
+DataType.BOOL = DataType("bool")
+DataType.INT = DataType("int")
+DataType.FLOAT = DataType("float")
+DataType.POINTER = DataType("pointer")
+
+# mapping of GL types to protobuf DataType
+GL2PROTOBUF_TYPE_MAP = {
+    "GLvoid":DataType.VOID,
+    "void":DataType.VOID,
+    "GLchar":DataType.CHAR,
+    "GLenum":DataType.ENUM,
+    "GLboolean":DataType.BOOL,
+    "GLbitfield":DataType.INT,
+    "GLbyte":DataType.BYTE,
+    "GLshort":DataType.INT,
+    "GLint":DataType.INT,
+    "int":DataType.INT,
+    "GLsizei":DataType.INT,
+    "GLubyte":DataType.BYTE,
+    "GLushort":DataType.INT,
+    "GLuint":DataType.INT,
+    "GLfloat":DataType.FLOAT,
+    "GLclampf":DataType.FLOAT,
+    "GLfixed":DataType.INT,
+    "GLclampx":DataType.INT,
+    "GLsizeiptr":DataType.POINTER,
+    "GLintptr":DataType.POINTER,
+    "GLeglImageOES":DataType.POINTER,
+}
+
+API_SPECS = [
+    ('GL2','../GLES2/gl2_api.in'),
+    ('GL2Ext','../GLES2/gl2ext_api.in'),
+    ('GL1','../GLES_CM/gl_api.in'),
+    ('GL1Ext','../GLES_CM/glext_api.in'),
+]
+
+HEADER_LICENSE = """/*
+ * Copyright 2011, 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.
+ *
+ * THIS FILE WAS GENERATED BY A SCRIPT. DO NOT EDIT.
+ */
+"""
+
+HEADER_INCLUDES = """
+#include <cutils/log.h>
+#include <utils/Timers.h>
+#include <GLES2/gl2.h>
+
+#include "gltrace.pb.h"
+#include "gltrace_context.h"
+#include "gltrace_fixup.h"
+#include "gltrace_transport.h"
+"""
+
+HEADER_NAMESPACE_START = """
+namespace android {
+namespace gltrace {
+"""
+
+FOOTER_TEXT = """
+}; // namespace gltrace
+}; // namespace android
+"""
+
+TRACE_CALL_TEMPLATE = pyratemp.Template(
+"""$!retType!$ GLTrace_$!func!$($!inputArgList!$) {
+    GLMessage glmsg;
+    GLTraceContext *glContext = getGLTraceContext();
+
+    glmsg.set_function(GLMessage::$!func!$);
+<!--(if len(parsedArgs) > 0)-->
+    <!--(for argname, argtype in parsedArgs)-->
+
+    // copy argument $!argname!$
+    GLMessage_DataType *arg_$!argname!$ = glmsg.add_args();
+    arg_$!argname!$->set_isarray(false);
+    arg_$!argname!$->set_type(GLMessage::DataType::$!argtype!$);
+    arg_$!argname!$->$!argtype.getProtobufCall()!$$!argname!$);
+    <!--(end)-->
+<!--(end)-->
+
+    // call function
+    nsecs_t start_time = systemTime();
+<!--(if retType != "void")-->
+    $!retType!$ retValue = glContext->hooks->gl.$!callsite!$;
+<!--(else)-->
+    glContext->hooks->gl.$!callsite!$;
+<!--(end)-->
+    nsecs_t end_time = systemTime();
+<!--(if retType != "void")-->
+
+    // set return value
+    GLMessage_DataType *rt = glmsg.mutable_returnvalue();
+    rt->set_isarray(false);
+    rt->set_type(GLMessage::DataType::$!retDataType!$);
+    rt->$!retDataType.getProtobufCall()!$retValue);
+<!--(end)-->
+
+    fixupGLMessage(glContext, start_time, end_time, &glmsg);
+    glContext->traceGLMessage(&glmsg);
+<!--(if retType != "void")-->
+
+    return retValue;
+<!--(end)-->
+}
+""")
+
+def getDataTypeFromKw(kw):
+    """ Get the data type given declaration.
+    All pointer declarations are of type DataType.POINTER
+
+    e.g.: GLvoid -> DataType.VOID"""
+
+    if kw.count('*') > 0:
+        return DataType.POINTER
+    return GL2PROTOBUF_TYPE_MAP.get(kw)
+
+def getNameTypePair(decl):
+    """ Split declaration of a variable to a tuple of (variable name, DataType).
+    e.g. "const GLChar* varName" -> (varName, POINTER) """
+    elements = decl.strip().split(' ')
+    name = None
+    if len(elements) > 1:
+        name = " ".join(elements[-1:]).strip()      # last element is the name
+        dataType = " ".join(elements[:-1]).strip()  # everything else is the data type
+
+        # if name is a pointer (e.g. "*ptr"), then remove the "*" from the name
+        # and add it to the data type
+        pointersInName = name.count("*")            
+        if pointersInName > 0:
+            name = name.replace("*", "")
+            dataType += "*" * pointersInName
+
+        # if name is an array (e.g. "array[10]"), then remove the "[X]" from the name
+        # and make the datatype to be a pointer
+        arraysInName = name.count("[")
+        if arraysInName > 0:
+            name = name.split('[')[0]
+            dataType += "*"
+    else:
+        dataType = elements[0]
+    return (name, getDataTypeFromKw(dataType))
+
+def parseArgs(arglist):
+    """ Parse the argument list into a list of (var name, DataType) tuples """
+    args = arglist.split(',')
+    args = map(lambda x: x.strip(), args)    # remove unnecessary whitespaces
+    argtypelist = map(getNameTypePair, args) # split arg into arg type and arg name
+    if len(argtypelist) == 1:
+        (name, argtype) = argtypelist[0]
+        if argtype == DataType.VOID:
+            return []
+
+    return argtypelist
+
+class ApiCall(object):
+    """An ApiCall models all information about a single OpenGL API"""
+
+    # Regex to match API_ENTRY specification:
+    #       e.g. void API_ENTRY(glActiveTexture)(GLenum texture) {
+    # the regex uses a non greedy match (?) to match the first closing paren
+    API_ENTRY_REGEX = "(.*)API_ENTRY\(.*?\)\((.*?)\)"
+
+    # Regex to match CALL_GL_API specification:
+    #       e.g. CALL_GL_API(glCullFace, mode); 
+    #            CALL_GL_API_RETURN(glCreateProgram);
+    CALL_GL_API_REGEX = "CALL_GL_API(_RETURN)?\((.*)\);"
+
+    def __init__(self, prefix, apientry, callsite):
+        """Construct an ApiCall from its specification.
+
+        The specification is provided by the two arguments:
+        prefix: prefix to use for function names
+        defn: specification line containing API_ENTRY macro
+              e.g: void API_ENTRY(glActiveTexture)(GLenum texture) {
+        callsite: specification line containing CALL_GL_API macro
+              e.g: CALL_GL_API(glActiveTexture, texture);        
+        """
+        self.prefix = prefix
+        self.ret = self.getReturnType(apientry)
+        self.arglist = self.getArgList(apientry)
+
+        # some functions (e.g. __glEGLImageTargetRenderbufferStorageOES), define their
+        # names one way in the API_ENTRY and another way in the CALL_GL_API macros.
+        # so self.func is reassigned based on what is there in the call site
+        self.func = self.getFunc(callsite)
+        self.callsite = self.getCallSite(callsite)
+
+    def getReturnType(self, apientry):
+        '''Extract the return type from the API_ENTRY specification'''
+        m = re.search(self.API_ENTRY_REGEX, apientry)
+        if not m:
+            raise ValueError("%s does not match API_ENTRY specification %s" 
+                             % (apientry, self.API_ENTRY_REGEX))
+
+        return m.group(1).strip()
+
+    def getArgList(self, apientry):
+        '''Extract the argument list from the API_ENTRY specification'''
+        m = re.search(self.API_ENTRY_REGEX, apientry)
+        if not m:
+            raise ValueError("%s does not match API_ENTRY specification %s" 
+                             % (apientry, self.API_ENTRY_REGEX))
+
+        return m.group(2).strip()
+
+    def parseCallSite(self, callsite):
+        m = re.search(self.CALL_GL_API_REGEX, callsite)
+        if not m:
+            raise ValueError("%s does not match CALL_GL_API specification (%s)"
+                             % (callsite, self.CALL_GL_API_REGEX))
+
+        arglist = m.group(2)
+        args = arglist.split(',')
+        args = map(lambda x: x.strip(), args)
+
+        return args
+
+    def getCallSite(self, callsite):
+        '''Extract the callsite from the CALL_GL_API specification'''
+        args = self.parseCallSite(callsite)
+        return "%s(%s)" % (args[0], ", ".join(args[1:]))
+
+    def getFunc(self, callsite):
+        '''Extract the function name from the CALL_GL_API specification'''
+        args = self.parseCallSite(callsite)
+        return args[0]
+
+    def genDeclaration(self):
+        return "%s GLTrace_%s(%s);" % (self.ret, self.func, self.arglist)
+
+    def genCode(self):
+        return TRACE_CALL_TEMPLATE(func = self.func, 
+                                   retType = self.ret,
+                                   retDataType = getDataTypeFromKw(self.ret),
+                                   inputArgList = self.arglist,
+                                   callsite = self.callsite,
+                                   parsedArgs = parseArgs(self.arglist),
+                                   DataType=DataType)
+
+def getApis(apiEntryFile, prefix):
+    '''Get a list of all ApiCalls in provided specification file'''
+    lines = open(apiEntryFile).readlines()
+
+    apis = []
+    for i in range(0, len(lines)/3):
+        apis.append(ApiCall(prefix, lines[i*3], lines[i*3+1]))
+
+    return apis
+
+def parseAllSpecs(specs):
+    apis = []
+    for name, specfile in specs:
+        a = getApis(specfile, name)
+        print 'Parsed %s APIs from %s, # of entries = %d' % (name, specfile, len(a))
+        apis.extend(a)
+    return apis
+
+def removeDuplicates(apis):
+    '''Remove all duplicate function entries.
+
+    The input list contains functions declared in GL1 and GL2 APIs.
+    This will return a list that contains only the first function if there are
+    multiple functions with the same name.'''
+    uniqs = []
+    funcs = set()
+    for api in apis:
+        if api.func not in funcs:
+            uniqs.append(api)
+            funcs.add(api.func)
+
+    return uniqs
+
+def genHeaders(apis, fname):
+    lines = []
+    lines.append(HEADER_LICENSE)
+    lines.append(HEADER_NAMESPACE_START)
+    prefix = ""
+    for api in apis:
+        if prefix != api.prefix:
+            lines.append("\n// Declarations for %s APIs\n\n" % api.prefix)
+            prefix = api.prefix
+        lines.append(api.genDeclaration())
+        lines.append("\n")
+    lines.append(FOOTER_TEXT)
+
+    with open(fname, "w") as f:
+        f.writelines(lines)
+
+def genSrcs(apis, fname):
+    lines = []
+    lines.append(HEADER_LICENSE)
+    lines.append(HEADER_INCLUDES)
+    lines.append(HEADER_NAMESPACE_START)
+    prefix = ""
+    for api in apis:
+        if prefix != api.prefix:
+            lines.append("\n// Definitions for %s APIs\n\n" % api.prefix)
+            prefix = api.prefix
+        lines.append(api.genCode())
+        lines.append("\n")
+    lines.append(FOOTER_TEXT)
+
+    with open(fname, "w") as f:
+        f.writelines(lines)
+
+if __name__ == '__main__':
+    apis = parseAllSpecs(API_SPECS)     # read in all the specfiles
+    apis = removeDuplicates(apis)       # remove duplication of functions common to GL1 and GL2
+    genHeaders(apis, 'gltrace_api.h')  # generate header file
+    genSrcs(apis, 'gltrace_api.cpp')   # generate source file
diff --git a/opengl/libs/GLES_trace/tools/testgenapi.py b/opengl/libs/GLES_trace/tools/testgenapi.py
new file mode 100644
index 0000000..fe14954
--- /dev/null
+++ b/opengl/libs/GLES_trace/tools/testgenapi.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2011 Google Inc.
+#
+# 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.
+#
+# USAGE
+#   $ cd GLES_trace/tools
+#   $ python testgenapi.py
+
+import unittest
+from genapi import DataType, ApiCall, getApis, parseArgs
+
+class TestApiCall(unittest.TestCase):
+    def test_parsing(self):
+        apientry = 'void API_ENTRY(glCopyTexSubImage2D)(GLenum target, GLint level, ' \
+                   'GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, ' \
+                   'GLsizei height) {'
+        callsite = 'CALL_GL_API(glCopyTexImage2D, target, level, internalformat, x, y,' \
+                   'width, height, border);'
+
+        api = ApiCall("GL", apientry, callsite)
+        self.assertEqual(api.func, "glCopyTexImage2D")
+        self.assertEqual(api.callsite, 'glCopyTexImage2D(target, level, internalformat, ' \
+                                        'x, y, width, height, border)')
+        self.assertEqual(api.ret, 'void')
+        self.assertEqual(api.arglist, 'GLenum target, GLint level, ' \
+                   'GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, ' \
+                   'GLsizei height')
+
+    def test_num_functions_parsed(self):
+        gl2_apis = getApis('../../GLES2/gl2_api.in', 'GL2')
+        gl2ext_apis = getApis('../../GLES2/gl2ext_api.in', 'GL2Ext')
+        gl_apis = getApis('../../GLES_CM/gl_api.in', "GL1")
+        glext_apis = getApis('../../GLES_CM/glext_api.in', 'GL1Ext')
+
+        self.assertEqual(len(gl2_apis), 142)
+        self.assertEqual(len(gl2ext_apis), 121)
+        self.assertEqual(len(gl_apis), 145)
+        self.assertEqual(len(glext_apis), 140)
+
+    def test_parseArgs(self):
+        args = parseArgs("void")
+        self.assertEqual(len(args), 0)
+
+        args = parseArgs("GLchar a")
+        self.assertEqual(args, [("a", DataType.CHAR)])
+
+        args = parseArgs("GLchar *a")
+        self.assertEqual(args, [("a", DataType.POINTER)])
+
+        args = parseArgs("GLint exponent[16]")
+        self.assertEqual(args, [("exponent", DataType.POINTER)])
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/opengl/libs/entries.in b/opengl/libs/entries.in
index 61acb5f..6316d78 100644
--- a/opengl/libs/entries.in
+++ b/opengl/libs/entries.in
@@ -1,13 +1,17 @@
+GL_ENTRY(void, glActiveShaderProgramEXT, GLuint pipeline, GLuint program)
 GL_ENTRY(void, glActiveTexture, GLenum texture)
 GL_ENTRY(void, glAlphaFunc, GLenum func, GLclampf ref)
+GL_ENTRY(void, glAlphaFuncQCOM, GLenum func, GLclampf ref)
 GL_ENTRY(void, glAlphaFuncx, GLenum func, GLclampx ref)
 GL_ENTRY(void, glAlphaFuncxOES, GLenum func, GLclampx ref)
 GL_ENTRY(void, glAttachShader, GLuint program, GLuint shader)
 GL_ENTRY(void, glBeginPerfMonitorAMD, GLuint monitor)
+GL_ENTRY(void, glBeginQueryEXT, GLenum target, GLuint id)
 GL_ENTRY(void, glBindAttribLocation, GLuint program, GLuint index, const GLchar* name)
 GL_ENTRY(void, glBindBuffer, GLenum target, GLuint buffer)
 GL_ENTRY(void, glBindFramebuffer, GLenum target, GLuint framebuffer)
 GL_ENTRY(void, glBindFramebufferOES, GLenum target, GLuint framebuffer)
+GL_ENTRY(void, glBindProgramPipelineEXT, GLuint pipeline)
 GL_ENTRY(void, glBindRenderbuffer, GLenum target, GLuint renderbuffer)
 GL_ENTRY(void, glBindRenderbufferOES, GLenum target, GLuint renderbuffer)
 GL_ENTRY(void, glBindTexture, GLenum target, GLuint texture)
@@ -20,6 +24,7 @@
 GL_ENTRY(void, glBlendFunc, GLenum sfactor, GLenum dfactor)
 GL_ENTRY(void, glBlendFuncSeparate, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
 GL_ENTRY(void, glBlendFuncSeparateOES, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+GL_ENTRY(void, glBlitFramebufferANGLE, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
 GL_ENTRY(void, glBufferData, GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
 GL_ENTRY(void, glBufferSubData, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)
 GL_ENTRY(GLenum, glCheckFramebufferStatus, GLenum target)
@@ -58,6 +63,7 @@
 GL_ENTRY(void, glCoverageOperationNV, GLenum operation)
 GL_ENTRY(GLuint, glCreateProgram, void)
 GL_ENTRY(GLuint, glCreateShader, GLenum type)
+GL_ENTRY(GLuint, glCreateShaderProgramvEXT, GLenum type, GLsizei count, const GLchar **strings)
 GL_ENTRY(void, glCullFace, GLenum mode)
 GL_ENTRY(void, glCurrentPaletteMatrixOES, GLuint matrixpaletteindex)
 GL_ENTRY(void, glDeleteBuffers, GLsizei n, const GLuint *buffers)
@@ -66,6 +72,8 @@
 GL_ENTRY(void, glDeleteFramebuffersOES, GLsizei n, const GLuint* framebuffers)
 GL_ENTRY(void, glDeletePerfMonitorsAMD, GLsizei n, GLuint *monitors)
 GL_ENTRY(void, glDeleteProgram, GLuint program)
+GL_ENTRY(void, glDeleteProgramPipelinesEXT, GLsizei n, const GLuint *pipelines)
+GL_ENTRY(void, glDeleteQueriesEXT, GLsizei n, const GLuint *ids)
 GL_ENTRY(void, glDeleteRenderbuffers, GLsizei n, const GLuint* renderbuffers)
 GL_ENTRY(void, glDeleteRenderbuffersOES, GLsizei n, const GLuint* renderbuffers)
 GL_ENTRY(void, glDeleteShader, GLuint shader)
@@ -84,6 +92,7 @@
 GL_ENTRY(void, glDisableVertexAttribArray, GLuint index)
 GL_ENTRY(void, glDiscardFramebufferEXT, GLenum target, GLsizei numAttachments, const GLenum *attachments)
 GL_ENTRY(void, glDrawArrays, GLenum mode, GLint first, GLsizei count)
+GL_ENTRY(void, glDrawBuffersNV, GLsizei n, const GLenum *bufs)
 GL_ENTRY(void, glDrawElements, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
 GL_ENTRY(void, glDrawTexfOES, GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
 GL_ENTRY(void, glDrawTexfvOES, const GLfloat *coords)
@@ -100,6 +109,7 @@
 GL_ENTRY(void, glEnableDriverControlQCOM, GLuint driverControl)
 GL_ENTRY(void, glEnableVertexAttribArray, GLuint index)
 GL_ENTRY(void, glEndPerfMonitorAMD, GLuint monitor)
+GL_ENTRY(void, glEndQueryEXT, GLenum target)
 GL_ENTRY(void, glEndTilingQCOM, GLbitfield preserveMask)
 GL_ENTRY(void, glExtGetBufferPointervQCOM, GLenum target, GLvoid **params)
 GL_ENTRY(void, glExtGetBuffersQCOM, GLuint *buffers, GLint maxBuffers, GLint *numBuffers)
@@ -125,6 +135,7 @@
 GL_ENTRY(void, glFramebufferRenderbuffer, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
 GL_ENTRY(void, glFramebufferRenderbufferOES, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
 GL_ENTRY(void, glFramebufferTexture2D, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+GL_ENTRY(void, glFramebufferTexture2DMultisampleEXT, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
 GL_ENTRY(void, glFramebufferTexture2DMultisampleIMG, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
 GL_ENTRY(void, glFramebufferTexture2DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
 GL_ENTRY(void, glFramebufferTexture3DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
@@ -138,6 +149,8 @@
 GL_ENTRY(void, glGenFramebuffers, GLsizei n, GLuint* framebuffers)
 GL_ENTRY(void, glGenFramebuffersOES, GLsizei n, GLuint* framebuffers)
 GL_ENTRY(void, glGenPerfMonitorsAMD, GLsizei n, GLuint *monitors)
+GL_ENTRY(void, glGenProgramPipelinesEXT, GLsizei n, GLuint *pipelines)
+GL_ENTRY(void, glGenQueriesEXT, GLsizei n, GLuint *ids)
 GL_ENTRY(void, glGenRenderbuffers, GLsizei n, GLuint* renderbuffers)
 GL_ENTRY(void, glGenRenderbuffersOES, GLsizei n, GLuint* renderbuffers)
 GL_ENTRY(void, glGenTextures, GLsizei n, GLuint *textures)
@@ -164,6 +177,7 @@
 GL_ENTRY(void, glGetFloatv, GLenum pname, GLfloat *params)
 GL_ENTRY(void, glGetFramebufferAttachmentParameteriv, GLenum target, GLenum attachment, GLenum pname, GLint* params)
 GL_ENTRY(void, glGetFramebufferAttachmentParameterivOES, GLenum target, GLenum attachment, GLenum pname, GLint* params)
+GL_ENTRY(GLenum, glGetGraphicsResetStatusEXT, void)
 GL_ENTRY(void, glGetIntegerv, GLenum pname, GLint *params)
 GL_ENTRY(void, glGetLightfv, GLenum light, GLenum pname, GLfloat *params)
 GL_ENTRY(void, glGetLightxv, GLenum light, GLenum pname, GLfixed *params)
@@ -171,6 +185,7 @@
 GL_ENTRY(void, glGetMaterialfv, GLenum face, GLenum pname, GLfloat *params)
 GL_ENTRY(void, glGetMaterialxv, GLenum face, GLenum pname, GLfixed *params)
 GL_ENTRY(void, glGetMaterialxvOES, GLenum face, GLenum pname, GLfixed *params)
+GL_ENTRY(void, glGetObjectLabelEXT, GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label)
 GL_ENTRY(void, glGetPerfMonitorCounterDataAMD, GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten)
 GL_ENTRY(void, glGetPerfMonitorCounterInfoAMD, GLuint group, GLuint counter, GLenum pname, GLvoid *data)
 GL_ENTRY(void, glGetPerfMonitorCounterStringAMD, GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString)
@@ -180,7 +195,11 @@
 GL_ENTRY(void, glGetPointerv, GLenum pname, GLvoid **params)
 GL_ENTRY(void, glGetProgramBinaryOES, GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary)
 GL_ENTRY(void, glGetProgramInfoLog, GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
+GL_ENTRY(void, glGetProgramPipelineInfoLogEXT, GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
+GL_ENTRY(void, glGetProgramPipelineivEXT, GLuint pipeline, GLenum pname, GLint *params)
 GL_ENTRY(void, glGetProgramiv, GLuint program, GLenum pname, GLint* params)
+GL_ENTRY(void, glGetQueryObjectuivEXT, GLuint id, GLenum pname, GLuint *params)
+GL_ENTRY(void, glGetQueryivEXT, GLenum target, GLenum pname, GLint *params)
 GL_ENTRY(void, glGetRenderbufferParameteriv, GLenum target, GLenum pname, GLint* params)
 GL_ENTRY(void, glGetRenderbufferParameterivOES, GLenum target, GLenum pname, GLint* params)
 GL_ENTRY(void, glGetShaderInfoLog, GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
@@ -205,18 +224,24 @@
 GL_ENTRY(void, glGetVertexAttribPointerv, GLuint index, GLenum pname, GLvoid** pointer)
 GL_ENTRY(void, glGetVertexAttribfv, GLuint index, GLenum pname, GLfloat* params)
 GL_ENTRY(void, glGetVertexAttribiv, GLuint index, GLenum pname, GLint* params)
+GL_ENTRY(void, glGetnUniformfvEXT, GLuint program, GLint location, GLsizei bufSize, float *params)
+GL_ENTRY(void, glGetnUniformivEXT, GLuint program, GLint location, GLsizei bufSize, GLint *params)
 GL_ENTRY(void, glHint, GLenum target, GLenum mode)
+GL_ENTRY(void, glInsertEventMarkerEXT, GLsizei length, const GLchar *marker)
 GL_ENTRY(GLboolean, glIsBuffer, GLuint buffer)
 GL_ENTRY(GLboolean, glIsEnabled, GLenum cap)
 GL_ENTRY(GLboolean, glIsFenceNV, GLuint fence)
 GL_ENTRY(GLboolean, glIsFramebuffer, GLuint framebuffer)
 GL_ENTRY(GLboolean, glIsFramebufferOES, GLuint framebuffer)
 GL_ENTRY(GLboolean, glIsProgram, GLuint program)
+GL_ENTRY(GLboolean, glIsProgramPipelineEXT, GLuint pipeline)
+GL_ENTRY(GLboolean, glIsQueryEXT, GLuint id)
 GL_ENTRY(GLboolean, glIsRenderbuffer, GLuint renderbuffer)
 GL_ENTRY(GLboolean, glIsRenderbufferOES, GLuint renderbuffer)
 GL_ENTRY(GLboolean, glIsShader, GLuint shader)
 GL_ENTRY(GLboolean, glIsTexture, GLuint texture)
 GL_ENTRY(GLboolean, glIsVertexArrayOES, GLuint array)
+GL_ENTRY(void, glLabelObjectEXT, GLenum type, GLuint object, GLsizei length, const GLchar *label)
 GL_ENTRY(void, glLightModelf, GLenum pname, GLfloat param)
 GL_ENTRY(void, glLightModelfv, GLenum pname, const GLfloat *params)
 GL_ENTRY(void, glLightModelx, GLenum pname, GLfixed param)
@@ -278,15 +303,43 @@
 GL_ENTRY(void, glPolygonOffset, GLfloat factor, GLfloat units)
 GL_ENTRY(void, glPolygonOffsetx, GLfixed factor, GLfixed units)
 GL_ENTRY(void, glPolygonOffsetxOES, GLfixed factor, GLfixed units)
+GL_ENTRY(void, glPopGroupMarkerEXT, void)
 GL_ENTRY(void, glPopMatrix, void)
 GL_ENTRY(void, glProgramBinaryOES, GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length)
+GL_ENTRY(void, glProgramParameteriEXT, GLuint program, GLenum pname, GLint value)
+GL_ENTRY(void, glProgramUniform1fEXT, GLuint program, GLint location, GLfloat x)
+GL_ENTRY(void, glProgramUniform1fvEXT, GLuint program, GLint location, GLsizei count, const GLfloat *value)
+GL_ENTRY(void, glProgramUniform1iEXT, GLuint program, GLint location, GLint x)
+GL_ENTRY(void, glProgramUniform1ivEXT, GLuint program, GLint location, GLsizei count, const GLint *value)
+GL_ENTRY(void, glProgramUniform2fEXT, GLuint program, GLint location, GLfloat x, GLfloat y)
+GL_ENTRY(void, glProgramUniform2fvEXT, GLuint program, GLint location, GLsizei count, const GLfloat *value)
+GL_ENTRY(void, glProgramUniform2iEXT, GLuint program, GLint location, GLint x, GLint y)
+GL_ENTRY(void, glProgramUniform2ivEXT, GLuint program, GLint location, GLsizei count, const GLint *value)
+GL_ENTRY(void, glProgramUniform3fEXT, GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z)
+GL_ENTRY(void, glProgramUniform3fvEXT, GLuint program, GLint location, GLsizei count, const GLfloat *value)
+GL_ENTRY(void, glProgramUniform3iEXT, GLuint program, GLint location, GLint x, GLint y, GLint z)
+GL_ENTRY(void, glProgramUniform3ivEXT, GLuint program, GLint location, GLsizei count, const GLint *value)
+GL_ENTRY(void, glProgramUniform4fEXT, GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+GL_ENTRY(void, glProgramUniform4fvEXT, GLuint program, GLint location, GLsizei count, const GLfloat *value)
+GL_ENTRY(void, glProgramUniform4iEXT, GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w)
+GL_ENTRY(void, glProgramUniform4ivEXT, GLuint program, GLint location, GLsizei count, const GLint *value)
+GL_ENTRY(void, glProgramUniformMatrix2fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+GL_ENTRY(void, glProgramUniformMatrix3fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+GL_ENTRY(void, glProgramUniformMatrix4fvEXT, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+GL_ENTRY(void, glPushGroupMarkerEXT, GLsizei length, const GLchar *marker)
 GL_ENTRY(void, glPushMatrix, void)
 GL_ENTRY(GLbitfield, glQueryMatrixxOES, GLfixed mantissa[16], GLint exponent[16])
+GL_ENTRY(void, glReadBufferNV, GLenum mode)
 GL_ENTRY(void, glReadPixels, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
+GL_ENTRY(void, glReadnPixelsEXT, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data)
 GL_ENTRY(void, glReleaseShaderCompiler, void)
 GL_ENTRY(void, glRenderbufferStorage, GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+GL_ENTRY(void, glRenderbufferStorageMultisampleANGLE, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+GL_ENTRY(void, glRenderbufferStorageMultisampleAPPLE, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+GL_ENTRY(void, glRenderbufferStorageMultisampleEXT, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
 GL_ENTRY(void, glRenderbufferStorageMultisampleIMG, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
 GL_ENTRY(void, glRenderbufferStorageOES, GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+GL_ENTRY(void, glResolveMultisampleFramebufferAPPLE, void)
 GL_ENTRY(void, glRotatef, GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
 GL_ENTRY(void, glRotatex, GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
 GL_ENTRY(void, glRotatexOES, GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
@@ -335,8 +388,14 @@
 GL_ENTRY(void, glTexParameterxOES, GLenum target, GLenum pname, GLfixed param)
 GL_ENTRY(void, glTexParameterxv, GLenum target, GLenum pname, const GLfixed *params)
 GL_ENTRY(void, glTexParameterxvOES, GLenum target, GLenum pname, const GLfixed *params)
+GL_ENTRY(void, glTexStorage1DEXT, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
+GL_ENTRY(void, glTexStorage2DEXT, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+GL_ENTRY(void, glTexStorage3DEXT, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
 GL_ENTRY(void, glTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
 GL_ENTRY(void, glTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
+GL_ENTRY(void, glTextureStorage1DEXT, GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
+GL_ENTRY(void, glTextureStorage2DEXT, GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+GL_ENTRY(void, glTextureStorage3DEXT, GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
 GL_ENTRY(void, glTranslatef, GLfloat x, GLfloat y, GLfloat z)
 GL_ENTRY(void, glTranslatex, GLfixed x, GLfixed y, GLfixed z)
 GL_ENTRY(void, glTranslatexOES, GLfixed x, GLfixed y, GLfixed z)
@@ -361,7 +420,9 @@
 GL_ENTRY(void, glUniformMatrix4fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
 GL_ENTRY(GLboolean, glUnmapBufferOES, GLenum target)
 GL_ENTRY(void, glUseProgram, GLuint program)
+GL_ENTRY(void, glUseProgramStagesEXT, GLuint pipeline, GLbitfield stages, GLuint program)
 GL_ENTRY(void, glValidateProgram, GLuint program)
+GL_ENTRY(void, glValidateProgramPipelineEXT, GLuint pipeline)
 GL_ENTRY(void, glVertexAttrib1f, GLuint indx, GLfloat x)
 GL_ENTRY(void, glVertexAttrib1fv, GLuint indx, const GLfloat* values)
 GL_ENTRY(void, glVertexAttrib2f, GLuint indx, GLfloat x, GLfloat y)
diff --git a/opengl/libs/enums.in b/opengl/libs/enums.in
index f9752c2..bfbc866 100644
--- a/opengl/libs/enums.in
+++ b/opengl/libs/enums.in
@@ -1,4 +1,6 @@
 GL_ENUM(0x0000,GL_POINTS)
+GL_ENUM(0x00000001,GL_VERTEX_SHADER_BIT_EXT)
+GL_ENUM(0x00000002,GL_FRAGMENT_SHADER_BIT_EXT)
 GL_ENUM(0x0001,GL_LINES)
 GL_ENUM(0x0002,GL_LINE_LOOP)
 GL_ENUM(0x0003,GL_LINE_STRIP)
@@ -92,6 +94,7 @@
 GL_ENUM(0x0BE2,GL_BLEND)
 GL_ENUM(0x0BF0,GL_LOGIC_OP_MODE)
 GL_ENUM(0x0BF2,GL_COLOR_LOGIC_OP)
+GL_ENUM(0x0C02,GL_READ_BUFFER_NV)
 GL_ENUM(0x0C10,GL_SCISSOR_BOX)
 GL_ENUM(0x0C11,GL_SCISSOR_TEST)
 GL_ENUM(0x0C22,GL_COLOR_CLEAR_VALUE)
@@ -100,6 +103,9 @@
 GL_ENUM(0x0C51,GL_POINT_SMOOTH_HINT)
 GL_ENUM(0x0C52,GL_LINE_SMOOTH_HINT)
 GL_ENUM(0x0C54,GL_FOG_HINT)
+GL_ENUM(0x0CF2,GL_UNPACK_ROW_LENGTH)
+GL_ENUM(0x0CF3,GL_UNPACK_SKIP_ROWS)
+GL_ENUM(0x0CF4,GL_UNPACK_SKIP_PIXELS)
 GL_ENUM(0x0CF5,GL_UNPACK_ALIGNMENT)
 GL_ENUM(0x0D05,GL_PACK_ALIGNMENT)
 GL_ENUM(0x0D1C,GL_ALPHA_SCALE)
@@ -166,6 +172,7 @@
 GL_ENUM(0x1802,GL_STENCIL_EXT)
 GL_ENUM(0x1901,GL_STENCIL_INDEX)
 GL_ENUM(0x1902,GL_DEPTH_COMPONENT)
+GL_ENUM(0x1903,GL_RED_EXT)
 GL_ENUM(0x1906,GL_ALPHA)
 GL_ENUM(0x1907,GL_RGB)
 GL_ENUM(0x1908,GL_RGBA)
@@ -230,10 +237,15 @@
 GL_ENUM(0x8037,GL_POLYGON_OFFSET_FILL)
 GL_ENUM(0x8038,GL_POLYGON_OFFSET_FACTOR)
 GL_ENUM(0x803A,GL_RESCALE_NORMAL)
+GL_ENUM(0x803C,GL_ALPHA8_EXT)
+GL_ENUM(0x8040,GL_LUMINANCE8_EXT)
+GL_ENUM(0x8045,GL_LUMINANCE8_ALPHA8_EXT)
 GL_ENUM(0x8051,GL_RGB8_OES)
+GL_ENUM(0x8052,GL_RGB10_EXT)
 GL_ENUM(0x8056,GL_RGBA4_OES)
 GL_ENUM(0x8057,GL_RGB5_A1_OES)
 GL_ENUM(0x8058,GL_RGBA8_OES)
+GL_ENUM(0x8059,GL_RGB10_A2_EXT)
 GL_ENUM(0x8069,GL_TEXTURE_BINDING_2D)
 GL_ENUM(0x806A,GL_TEXTURE_BINDING_3D_OES)
 GL_ENUM(0x806F,GL_TEXTURE_3D_OES)
@@ -276,11 +288,28 @@
 GL_ENUM(0x8128,GL_POINT_FADE_THRESHOLD_SIZE)
 GL_ENUM(0x8129,GL_POINT_DISTANCE_ATTENUATION)
 GL_ENUM(0x812F,GL_CLAMP_TO_EDGE)
+GL_ENUM(0x813D,GL_TEXTURE_MAX_LEVEL_APPLE)
 GL_ENUM(0x8191,GL_GENERATE_MIPMAP)
 GL_ENUM(0x8192,GL_GENERATE_MIPMAP_HINT)
 GL_ENUM(0x81A5,GL_DEPTH_COMPONENT16_OES)
 GL_ENUM(0x81A6,GL_DEPTH_COMPONENT24_OES)
 GL_ENUM(0x81A7,GL_DEPTH_COMPONENT32_OES)
+GL_ENUM(0x8210,GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT)
+GL_ENUM(0x8211,GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT)
+GL_ENUM(0x8227,GL_RG_EXT)
+GL_ENUM(0x8229,GL_R8_EXT)
+GL_ENUM(0x822B,GL_RG8_EXT)
+GL_ENUM(0x822D,GL_R16F_EXT)
+GL_ENUM(0x822F,GL_RG16F_EXT)
+GL_ENUM(0x8252,GL_LOSE_CONTEXT_ON_RESET_EXT)
+GL_ENUM(0x8253,GL_GUILTY_CONTEXT_RESET_EXT)
+GL_ENUM(0x8254,GL_INNOCENT_CONTEXT_RESET_EXT)
+GL_ENUM(0x8255,GL_UNKNOWN_CONTEXT_RESET_EXT)
+GL_ENUM(0x8256,GL_RESET_NOTIFICATION_STRATEGY_EXT)
+GL_ENUM(0x8258,GL_PROGRAM_SEPARABLE_EXT)
+GL_ENUM(0x8259,GL_ACTIVE_PROGRAM_EXT)
+GL_ENUM(0x825A,GL_PROGRAM_PIPELINE_BINDING_EXT)
+GL_ENUM(0x8261,GL_NO_RESET_NOTIFICATION_EXT)
 GL_ENUM(0x8363,GL_UNSIGNED_SHORT_5_6_5)
 GL_ENUM(0x8365,GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT)
 GL_ENUM(0x8366,GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT)
@@ -372,6 +401,8 @@
 GL_ENUM(0x8599,GL_OPERAND1_ALPHA)
 GL_ENUM(0x859A,GL_OPERAND2_ALPHA)
 GL_ENUM(0x85B5,GL_VERTEX_ARRAY_BINDING_OES)
+GL_ENUM(0x85BA,GL_UNSIGNED_SHORT_8_8_APPLE)
+GL_ENUM(0x85BB,GL_UNSIGNED_SHORT_8_8_REV_APPLE)
 GL_ENUM(0x8622,GL_VERTEX_ATTRIB_ARRAY_ENABLED)
 GL_ENUM(0x8623,GL_VERTEX_ATTRIB_ARRAY_SIZE)
 GL_ENUM(0x8624,GL_VERTEX_ATTRIB_ARRAY_STRIDE)
@@ -401,7 +432,34 @@
 GL_ENUM(0x8801,GL_STENCIL_BACK_FAIL)
 GL_ENUM(0x8802,GL_STENCIL_BACK_PASS_DEPTH_FAIL)
 GL_ENUM(0x8803,GL_STENCIL_BACK_PASS_DEPTH_PASS)
+GL_ENUM(0x8814,GL_RGBA32F_EXT)
+GL_ENUM(0x8815,GL_RGB32F_EXT)
+GL_ENUM(0x8816,GL_ALPHA32F_EXT)
+GL_ENUM(0x8818,GL_LUMINANCE32F_EXT)
+GL_ENUM(0x8819,GL_LUMINANCE_ALPHA32F_EXT)
+GL_ENUM(0x881A,GL_RGBA16F_EXT)
+GL_ENUM(0x881B,GL_RGB16F_EXT)
+GL_ENUM(0x881C,GL_ALPHA16F_EXT)
+GL_ENUM(0x881E,GL_LUMINANCE16F_EXT)
+GL_ENUM(0x881F,GL_LUMINANCE_ALPHA16F_EXT)
 GL_ENUM(0x8823,GL_WRITEONLY_RENDERING_QCOM)
+GL_ENUM(0x8824,GL_MAX_DRAW_BUFFERS_NV)
+GL_ENUM(0x8825,GL_DRAW_BUFFER0_NV)
+GL_ENUM(0x8826,GL_DRAW_BUFFER1_NV)
+GL_ENUM(0x8827,GL_DRAW_BUFFER2_NV)
+GL_ENUM(0x8828,GL_DRAW_BUFFER3_NV)
+GL_ENUM(0x8829,GL_DRAW_BUFFER4_NV)
+GL_ENUM(0x882A,GL_DRAW_BUFFER5_NV)
+GL_ENUM(0x882B,GL_DRAW_BUFFER6_NV)
+GL_ENUM(0x882C,GL_DRAW_BUFFER7_NV)
+GL_ENUM(0x882D,GL_DRAW_BUFFER8_NV)
+GL_ENUM(0x882E,GL_DRAW_BUFFER9_NV)
+GL_ENUM(0x882F,GL_DRAW_BUFFER10_NV)
+GL_ENUM(0x8830,GL_DRAW_BUFFER11_NV)
+GL_ENUM(0x8831,GL_DRAW_BUFFER12_NV)
+GL_ENUM(0x8832,GL_DRAW_BUFFER13_NV)
+GL_ENUM(0x8833,GL_DRAW_BUFFER14_NV)
+GL_ENUM(0x8834,GL_DRAW_BUFFER15_NV)
 GL_ENUM(0x883D,GL_BLEND_EQUATION_ALPHA_OES)
 GL_ENUM(0x8840,GL_MATRIX_PALETTE_OES)
 GL_ENUM(0x8842,GL_MAX_PALETTE_MATRICES_OES)
@@ -411,8 +469,14 @@
 GL_ENUM(0x8847,GL_MATRIX_INDEX_ARRAY_TYPE_OES)
 GL_ENUM(0x8848,GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
 GL_ENUM(0x8849,GL_MATRIX_INDEX_ARRAY_POINTER_OES)
+GL_ENUM(0x884C,GL_TEXTURE_COMPARE_MODE_EXT)
+GL_ENUM(0x884D,GL_TEXTURE_COMPARE_FUNC_EXT)
+GL_ENUM(0x884E,GL_COMPARE_REF_TO_TEXTURE_EXT)
 GL_ENUM(0x8861,GL_POINT_SPRITE_OES)
 GL_ENUM(0x8862,GL_COORD_REPLACE_OES)
+GL_ENUM(0x8865,GL_CURRENT_QUERY_EXT)
+GL_ENUM(0x8866,GL_QUERY_RESULT_EXT)
+GL_ENUM(0x8867,GL_QUERY_RESULT_AVAILABLE_EXT)
 GL_ENUM(0x8869,GL_MAX_VERTEX_ATTRIBS)
 GL_ENUM(0x886A,GL_VERTEX_ATTRIB_ARRAY_NORMALIZED)
 GL_ENUM(0x8872,GL_MAX_TEXTURE_IMAGE_UNITS)
@@ -440,8 +504,12 @@
 GL_ENUM(0x898D,GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
 GL_ENUM(0x898E,GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
 GL_ENUM(0x898F,GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
+GL_ENUM(0x8A1F,GL_RGB_422_APPLE)
+GL_ENUM(0x8A4F,GL_PROGRAM_PIPELINE_OBJECT_EXT)
 GL_ENUM(0x8B30,GL_FRAGMENT_SHADER)
 GL_ENUM(0x8B31,GL_VERTEX_SHADER)
+GL_ENUM(0x8B40,GL_PROGRAM_OBJECT_EXT)
+GL_ENUM(0x8B48,GL_SHADER_OBJECT_EXT)
 GL_ENUM(0x8B4C,GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS)
 GL_ENUM(0x8B4D,GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS)
 GL_ENUM(0x8B4F,GL_SHADER_TYPE)
@@ -461,6 +529,7 @@
 GL_ENUM(0x8B5E,GL_SAMPLER_2D)
 GL_ENUM(0x8B5F,GL_SAMPLER_3D_OES)
 GL_ENUM(0x8B60,GL_SAMPLER_CUBE)
+GL_ENUM(0x8B62,GL_SAMPLER_2D_SHADOW_EXT)
 GL_ENUM(0x8B80,GL_DELETE_STATUS)
 GL_ENUM(0x8B81,GL_COMPILE_STATUS)
 GL_ENUM(0x8B82,GL_LINK_STATUS)
@@ -520,6 +589,11 @@
 GL_ENUM(0x8C08,GL_FRAGMENT_ALPHA_MODULATE_IMG)
 GL_ENUM(0x8C09,GL_ADD_BLEND_IMG)
 GL_ENUM(0x8C0A,GL_SGX_BINARY_IMG)
+GL_ENUM(0x8C17,GL_UNSIGNED_NORMALIZED_EXT)
+GL_ENUM(0x8C2F,GL_ANY_SAMPLES_PASSED_EXT)
+GL_ENUM(0x8C40,GL_SRGB_EXT)
+GL_ENUM(0x8C42,GL_SRGB_ALPHA_EXT)
+GL_ENUM(0x8C43,GL_SRGB8_ALPHA8_EXT)
 GL_ENUM(0x8C92,GL_ATC_RGB_AMD)
 GL_ENUM(0x8C93,GL_ATC_RGBA_EXPLICIT_ALPHA_AMD)
 GL_ENUM(0x8CA3,GL_STENCIL_BACK_REF)
@@ -527,6 +601,10 @@
 GL_ENUM(0x8CA5,GL_STENCIL_BACK_WRITEMASK)
 GL_ENUM(0x8CA6,GL_FRAMEBUFFER_BINDING_OES)
 GL_ENUM(0x8CA7,GL_RENDERBUFFER_BINDING_OES)
+GL_ENUM(0x8CA8,GL_READ_FRAMEBUFFER_APPLE)
+GL_ENUM(0x8CA9,GL_DRAW_FRAMEBUFFER_APPLE)
+GL_ENUM(0x8CAA,GL_READ_FRAMEBUFFER_BINDING_APPLE)
+GL_ENUM(0x8CAB,GL_RENDERBUFFER_SAMPLES_APPLE)
 GL_ENUM(0x8CD0,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES)
 GL_ENUM(0x8CD1,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES)
 GL_ENUM(0x8CD2,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES)
@@ -538,7 +616,23 @@
 GL_ENUM(0x8CD9,GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES)
 GL_ENUM(0x8CDA,GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES)
 GL_ENUM(0x8CDD,GL_FRAMEBUFFER_UNSUPPORTED_OES)
+GL_ENUM(0x8CDF,GL_MAX_COLOR_ATTACHMENTS_NV)
 GL_ENUM(0x8CE0,GL_COLOR_ATTACHMENT0_OES)
+GL_ENUM(0x8CE1,GL_COLOR_ATTACHMENT1_NV)
+GL_ENUM(0x8CE2,GL_COLOR_ATTACHMENT2_NV)
+GL_ENUM(0x8CE3,GL_COLOR_ATTACHMENT3_NV)
+GL_ENUM(0x8CE4,GL_COLOR_ATTACHMENT4_NV)
+GL_ENUM(0x8CE5,GL_COLOR_ATTACHMENT5_NV)
+GL_ENUM(0x8CE6,GL_COLOR_ATTACHMENT6_NV)
+GL_ENUM(0x8CE7,GL_COLOR_ATTACHMENT7_NV)
+GL_ENUM(0x8CE8,GL_COLOR_ATTACHMENT8_NV)
+GL_ENUM(0x8CE9,GL_COLOR_ATTACHMENT9_NV)
+GL_ENUM(0x8CEA,GL_COLOR_ATTACHMENT10_NV)
+GL_ENUM(0x8CEB,GL_COLOR_ATTACHMENT11_NV)
+GL_ENUM(0x8CEC,GL_COLOR_ATTACHMENT12_NV)
+GL_ENUM(0x8CED,GL_COLOR_ATTACHMENT13_NV)
+GL_ENUM(0x8CEE,GL_COLOR_ATTACHMENT14_NV)
+GL_ENUM(0x8CEF,GL_COLOR_ATTACHMENT15_NV)
 GL_ENUM(0x8D00,GL_DEPTH_ATTACHMENT_OES)
 GL_ENUM(0x8D20,GL_STENCIL_ATTACHMENT_OES)
 GL_ENUM(0x8D40,GL_FRAMEBUFFER_OES)
@@ -555,6 +649,8 @@
 GL_ENUM(0x8D53,GL_RENDERBUFFER_ALPHA_SIZE_OES)
 GL_ENUM(0x8D54,GL_RENDERBUFFER_DEPTH_SIZE_OES)
 GL_ENUM(0x8D55,GL_RENDERBUFFER_STENCIL_SIZE_OES)
+GL_ENUM(0x8D56,GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE)
+GL_ENUM(0x8D57,GL_MAX_SAMPLES_APPLE)
 GL_ENUM(0x8D60,GL_TEXTURE_GEN_STR_OES)
 GL_ENUM(0x8D61,GL_HALF_FLOAT_OES)
 GL_ENUM(0x8D62,GL_RGB565_OES)
@@ -563,6 +659,8 @@
 GL_ENUM(0x8D66,GL_SAMPLER_EXTERNAL_OES)
 GL_ENUM(0x8D67,GL_TEXTURE_BINDING_EXTERNAL_OES)
 GL_ENUM(0x8D68,GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES)
+GL_ENUM(0x8D6A,GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT)
+GL_ENUM(0x8D6C,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT)
 GL_ENUM(0x8DF0,GL_LOW_FLOAT)
 GL_ENUM(0x8DF1,GL_MEDIUM_FLOAT)
 GL_ENUM(0x8DF2,GL_HIGH_FLOAT)
@@ -586,9 +684,19 @@
 GL_ENUM(0x8ED5,GL_COVERAGE_ALL_FRAGMENTS_NV)
 GL_ENUM(0x8ED6,GL_COVERAGE_EDGE_FRAGMENTS_NV)
 GL_ENUM(0x8ED7,GL_COVERAGE_AUTOMATIC_NV)
+GL_ENUM(0x8F60,GL_MALI_SHADER_BINARY_ARM)
 GL_ENUM(0x8FA0,GL_PERFMON_GLOBAL_MODE_QCOM)
+GL_ENUM(0x8FC4,GL_SHADER_BINARY_VIV)
+GL_ENUM(0x90F3,GL_CONTEXT_ROBUST_ACCESS_EXT)
+GL_ENUM(0x912F,GL_TEXTURE_IMMUTABLE_FORMAT_EXT)
 GL_ENUM(0x9130,GL_SGX_PROGRAM_BINARY_IMG)
-GL_ENUM(0x9133,GL_RENDERBUFFER_SAMPLES_IMG)
-GL_ENUM(0x9134,GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG)
-GL_ENUM(0x9135,GL_MAX_SAMPLES_IMG)
+GL_ENUM(0x9133,GL_RENDERBUFFER_SAMPLES_EXT)
+GL_ENUM(0x9134,GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT)
+GL_ENUM(0x9135,GL_MAX_SAMPLES_EXT)
 GL_ENUM(0x9136,GL_TEXTURE_SAMPLES_IMG)
+GL_ENUM(0x9151,GL_BUFFER_OBJECT_EXT)
+GL_ENUM(0x9153,GL_QUERY_OBJECT_EXT)
+GL_ENUM(0x9154,GL_VERTEX_ARRAY_OBJECT_EXT)
+GL_ENUM(0x9250,GL_SHADER_BINARY_DMP)
+GL_ENUM(0x93A1,GL_BGRA8_EXT)
+GL_ENUM(0xFFFFFFFF,GL_ALL_SHADER_BITS_EXT)
diff --git a/opengl/libs/glestrace.h b/opengl/libs/glestrace.h
new file mode 100644
index 0000000..a08f97b
--- /dev/null
+++ b/opengl/libs/glestrace.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2011, 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.
+ *
+ * This file declares the API provided by the glestrace library.
+ */
+
+#ifndef _GLES_TRACE_H_
+#define _GLES_TRACE_H_
+
+#include "hooks.h"
+
+namespace android {
+
+/* Hooks to be called by "interesting" EGL functions. */
+void GLTrace_eglCreateContext(int version, EGLContext c);
+void GLTrace_eglMakeCurrent(unsigned version, gl_hooks_t *hooks, EGLContext c);
+void GLTrace_eglReleaseThread();
+void GLTrace_eglSwapBuffers(void*, void*);
+
+/* Start and stop GL Tracing. */
+void GLTrace_start();
+void GLTrace_stop();
+
+/* Obtain the gl_hooks structure filled with the trace implementation for all GL functions. */
+gl_hooks_t *GLTrace_getGLHooks();
+
+};
+
+#endif
diff --git a/opengl/libs/glesv2dbg.h b/opengl/libs/glesv2dbg.h
deleted file mode 100644
index 44bc288..0000000
--- a/opengl/libs/glesv2dbg.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- ** Copyright 2011, 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.
- */
-
-#ifndef _GLESV2_DBG_H_
-#define _GLESV2_DBG_H_
-
-#include <pthread.h>
-
-namespace android
-{
-struct DbgContext;
-
-DbgContext* CreateDbgContext(const unsigned version, const gl_hooks_t * const hooks);
-
-void dbgReleaseThread();
-
-// create and bind socket if haven't already, if failed to create socket or
-//  forceUseFile, then open /data/local/tmp/dump.gles2dbg, exit when size reached
-void StartDebugServer(const unsigned short port, const bool forceUseFile,
-                      const unsigned int maxFileSize, const char * const filePath);
-void StopDebugServer(); // close socket if open
-
-}; // namespace android
-
-#endif // #ifndef _GLESV2_DBG_H_
diff --git a/opengl/libs/glesv2dbg_functions.h b/opengl/libs/glesv2dbg_functions.h
deleted file mode 100644
index 2d70032..0000000
--- a/opengl/libs/glesv2dbg_functions.h
+++ /dev/null
@@ -1,381 +0,0 @@
-extern "C"
-{
-GL_ENTRY(void, glActiveTexture, GLenum texture)
-GL_ENTRY(void, glAlphaFunc, GLenum func, GLclampf ref)
-GL_ENTRY(void, glAlphaFuncx, GLenum func, GLclampx ref)
-GL_ENTRY(void, glAlphaFuncxOES, GLenum func, GLclampx ref)
-GL_ENTRY(void, glAttachShader, GLuint program, GLuint shader)
-GL_ENTRY(void, glBeginPerfMonitorAMD, GLuint monitor)
-GL_ENTRY(void, glBindAttribLocation, GLuint program, GLuint index, const GLchar* name)
-GL_ENTRY(void, glBindBuffer, GLenum target, GLuint buffer)
-GL_ENTRY(void, glBindFramebuffer, GLenum target, GLuint framebuffer)
-GL_ENTRY(void, glBindFramebufferOES, GLenum target, GLuint framebuffer)
-GL_ENTRY(void, glBindRenderbuffer, GLenum target, GLuint renderbuffer)
-GL_ENTRY(void, glBindRenderbufferOES, GLenum target, GLuint renderbuffer)
-GL_ENTRY(void, glBindTexture, GLenum target, GLuint texture)
-GL_ENTRY(void, glBindVertexArrayOES, GLuint array)
-GL_ENTRY(void, glBlendColor, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-GL_ENTRY(void, glBlendEquation,  GLenum mode )
-GL_ENTRY(void, glBlendEquationOES, GLenum mode)
-GL_ENTRY(void, glBlendEquationSeparate, GLenum modeRGB, GLenum modeAlpha)
-GL_ENTRY(void, glBlendEquationSeparateOES, GLenum modeRGB, GLenum modeAlpha)
-GL_ENTRY(void, glBlendFunc, GLenum sfactor, GLenum dfactor)
-GL_ENTRY(void, glBlendFuncSeparate, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-GL_ENTRY(void, glBlendFuncSeparateOES, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-GL_ENTRY(void, glBufferData, GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
-GL_ENTRY(void, glBufferSubData, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)
-GL_ENTRY(GLenum, glCheckFramebufferStatus, GLenum target)
-GL_ENTRY(GLenum, glCheckFramebufferStatusOES, GLenum target)
-GL_ENTRY(void, glClear, GLbitfield mask)
-GL_ENTRY(void, glClearColor, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-GL_ENTRY(void, glClearColorx, GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
-GL_ENTRY(void, glClearColorxOES, GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
-GL_ENTRY(void, glClearDepthf, GLclampf depth)
-GL_ENTRY(void, glClearDepthfOES, GLclampf depth)
-GL_ENTRY(void, glClearDepthx, GLclampx depth)
-GL_ENTRY(void, glClearDepthxOES, GLclampx depth)
-GL_ENTRY(void, glClearStencil, GLint s)
-GL_ENTRY(void, glClientActiveTexture, GLenum texture)
-GL_ENTRY(void, glClipPlanef, GLenum plane, const GLfloat *equation)
-GL_ENTRY(void, glClipPlanefIMG, GLenum p, const GLfloat *eqn)
-GL_ENTRY(void, glClipPlanefOES, GLenum plane, const GLfloat *equation)
-GL_ENTRY(void, glClipPlanex, GLenum plane, const GLfixed *equation)
-GL_ENTRY(void, glClipPlanexIMG, GLenum p, const GLfixed *eqn)
-GL_ENTRY(void, glClipPlanexOES, GLenum plane, const GLfixed *equation)
-GL_ENTRY(void, glColor4f, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
-GL_ENTRY(void, glColor4ub, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
-GL_ENTRY(void, glColor4x, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
-GL_ENTRY(void, glColor4xOES, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
-GL_ENTRY(void, glColorMask, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
-GL_ENTRY(void, glColorPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-GL_ENTRY(void, glCompileShader, GLuint shader)
-GL_ENTRY(void, glCompressedTexImage2D, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
-GL_ENTRY(void, glCompressedTexImage3DOES, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
-GL_ENTRY(void, glCompressedTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
-GL_ENTRY(void, glCompressedTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
-GL_ENTRY(void, glCopyTexImage2D, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
-GL_ENTRY(void, glCopyTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-GL_ENTRY(void, glCopyTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
-GL_ENTRY(void, glCoverageMaskNV, GLboolean mask)
-GL_ENTRY(void, glCoverageOperationNV, GLenum operation)
-GL_ENTRY(GLuint, glCreateProgram, void)
-GL_ENTRY(GLuint, glCreateShader, GLenum type)
-GL_ENTRY(void, glCullFace, GLenum mode)
-GL_ENTRY(void, glCurrentPaletteMatrixOES, GLuint matrixpaletteindex)
-GL_ENTRY(void, glDeleteBuffers, GLsizei n, const GLuint *buffers)
-GL_ENTRY(void, glDeleteFencesNV, GLsizei n, const GLuint *fences)
-GL_ENTRY(void, glDeleteFramebuffers, GLsizei n, const GLuint* framebuffers)
-GL_ENTRY(void, glDeleteFramebuffersOES, GLsizei n, const GLuint* framebuffers)
-GL_ENTRY(void, glDeletePerfMonitorsAMD, GLsizei n, GLuint *monitors)
-GL_ENTRY(void, glDeleteProgram, GLuint program)
-GL_ENTRY(void, glDeleteRenderbuffers, GLsizei n, const GLuint* renderbuffers)
-GL_ENTRY(void, glDeleteRenderbuffersOES, GLsizei n, const GLuint* renderbuffers)
-GL_ENTRY(void, glDeleteShader, GLuint shader)
-GL_ENTRY(void, glDeleteTextures, GLsizei n, const GLuint *textures)
-GL_ENTRY(void, glDeleteVertexArraysOES, GLsizei n, const GLuint *arrays)
-GL_ENTRY(void, glDepthFunc, GLenum func)
-GL_ENTRY(void, glDepthMask, GLboolean flag)
-GL_ENTRY(void, glDepthRangef, GLclampf zNear, GLclampf zFar)
-GL_ENTRY(void, glDepthRangefOES, GLclampf zNear, GLclampf zFar)
-GL_ENTRY(void, glDepthRangex, GLclampx zNear, GLclampx zFar)
-GL_ENTRY(void, glDepthRangexOES, GLclampx zNear, GLclampx zFar)
-GL_ENTRY(void, glDetachShader, GLuint program, GLuint shader)
-GL_ENTRY(void, glDisable, GLenum cap)
-GL_ENTRY(void, glDisableClientState, GLenum array)
-GL_ENTRY(void, glDisableDriverControlQCOM, GLuint driverControl)
-GL_ENTRY(void, glDisableVertexAttribArray, GLuint index)
-GL_ENTRY(void, glDiscardFramebufferEXT, GLenum target, GLsizei numAttachments, const GLenum *attachments)
-GL_ENTRY(void, glDrawArrays, GLenum mode, GLint first, GLsizei count)
-GL_ENTRY(void, glDrawElements, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
-GL_ENTRY(void, glDrawTexfOES, GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
-GL_ENTRY(void, glDrawTexfvOES, const GLfloat *coords)
-GL_ENTRY(void, glDrawTexiOES, GLint x, GLint y, GLint z, GLint width, GLint height)
-GL_ENTRY(void, glDrawTexivOES, const GLint *coords)
-GL_ENTRY(void, glDrawTexsOES, GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
-GL_ENTRY(void, glDrawTexsvOES, const GLshort *coords)
-GL_ENTRY(void, glDrawTexxOES, GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
-GL_ENTRY(void, glDrawTexxvOES, const GLfixed *coords)
-GL_ENTRY(void, glEGLImageTargetRenderbufferStorageOES, GLenum target, GLeglImageOES image)
-GL_ENTRY(void, glEGLImageTargetTexture2DOES, GLenum target, GLeglImageOES image)
-GL_ENTRY(void, glEnable, GLenum cap)
-GL_ENTRY(void, glEnableClientState, GLenum array)
-GL_ENTRY(void, glEnableDriverControlQCOM, GLuint driverControl)
-GL_ENTRY(void, glEnableVertexAttribArray, GLuint index)
-GL_ENTRY(void, glEndPerfMonitorAMD, GLuint monitor)
-GL_ENTRY(void, glEndTilingQCOM, GLbitfield preserveMask)
-GL_ENTRY(void, glExtGetBufferPointervQCOM, GLenum target, GLvoid **params)
-GL_ENTRY(void, glExtGetBuffersQCOM, GLuint *buffers, GLint maxBuffers, GLint *numBuffers)
-GL_ENTRY(void, glExtGetFramebuffersQCOM, GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers)
-GL_ENTRY(void, glExtGetProgramBinarySourceQCOM, GLuint program, GLenum shadertype, GLchar *source, GLint *length)
-GL_ENTRY(void, glExtGetProgramsQCOM, GLuint *programs, GLint maxPrograms, GLint *numPrograms)
-GL_ENTRY(void, glExtGetRenderbuffersQCOM, GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers)
-GL_ENTRY(void, glExtGetShadersQCOM, GLuint *shaders, GLint maxShaders, GLint *numShaders)
-GL_ENTRY(void, glExtGetTexLevelParameterivQCOM, GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params)
-GL_ENTRY(void, glExtGetTexSubImageQCOM, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels)
-GL_ENTRY(void, glExtGetTexturesQCOM, GLuint *textures, GLint maxTextures, GLint *numTextures)
-GL_ENTRY(GLboolean, glExtIsProgramBinaryQCOM, GLuint program)
-GL_ENTRY(void, glExtTexObjectStateOverrideiQCOM, GLenum target, GLenum pname, GLint param)
-GL_ENTRY(void, glFinish, void)
-GL_ENTRY(void, glFinishFenceNV, GLuint fence)
-GL_ENTRY(void, glFlush, void)
-GL_ENTRY(void, glFogf, GLenum pname, GLfloat param)
-GL_ENTRY(void, glFogfv, GLenum pname, const GLfloat *params)
-GL_ENTRY(void, glFogx, GLenum pname, GLfixed param)
-GL_ENTRY(void, glFogxOES, GLenum pname, GLfixed param)
-GL_ENTRY(void, glFogxv, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glFogxvOES, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glFramebufferRenderbuffer, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-GL_ENTRY(void, glFramebufferRenderbufferOES, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-GL_ENTRY(void, glFramebufferTexture2D, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-GL_ENTRY(void, glFramebufferTexture2DMultisampleIMG, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
-GL_ENTRY(void, glFramebufferTexture2DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-GL_ENTRY(void, glFramebufferTexture3DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
-GL_ENTRY(void, glFrontFace, GLenum mode)
-GL_ENTRY(void, glFrustumf, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-GL_ENTRY(void, glFrustumfOES, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-GL_ENTRY(void, glFrustumx, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-GL_ENTRY(void, glFrustumxOES, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-GL_ENTRY(void, glGenBuffers, GLsizei n, GLuint *buffers)
-GL_ENTRY(void, glGenFencesNV, GLsizei n, GLuint *fences)
-GL_ENTRY(void, glGenFramebuffers, GLsizei n, GLuint* framebuffers)
-GL_ENTRY(void, glGenFramebuffersOES, GLsizei n, GLuint* framebuffers)
-GL_ENTRY(void, glGenPerfMonitorsAMD, GLsizei n, GLuint *monitors)
-GL_ENTRY(void, glGenRenderbuffers, GLsizei n, GLuint* renderbuffers)
-GL_ENTRY(void, glGenRenderbuffersOES, GLsizei n, GLuint* renderbuffers)
-GL_ENTRY(void, glGenTextures, GLsizei n, GLuint *textures)
-GL_ENTRY(void, glGenVertexArraysOES, GLsizei n, GLuint *arrays)
-GL_ENTRY(void, glGenerateMipmap, GLenum target)
-GL_ENTRY(void, glGenerateMipmapOES, GLenum target)
-GL_ENTRY(void, glGetActiveAttrib, GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
-GL_ENTRY(void, glGetActiveUniform, GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
-GL_ENTRY(void, glGetAttachedShaders, GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
-GL_ENTRY(int, glGetAttribLocation, GLuint program, const GLchar* name)
-GL_ENTRY(void, glGetBooleanv, GLenum pname, GLboolean *params)
-GL_ENTRY(void, glGetBufferParameteriv, GLenum target, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetBufferPointervOES, GLenum target, GLenum pname, GLvoid ** params)
-GL_ENTRY(void, glGetClipPlanef, GLenum pname, GLfloat eqn[4])
-GL_ENTRY(void, glGetClipPlanefOES, GLenum pname, GLfloat eqn[4])
-GL_ENTRY(void, glGetClipPlanex, GLenum pname, GLfixed eqn[4])
-GL_ENTRY(void, glGetClipPlanexOES, GLenum pname, GLfixed eqn[4])
-GL_ENTRY(void, glGetDriverControlStringQCOM, GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString)
-GL_ENTRY(void, glGetDriverControlsQCOM, GLint *num, GLsizei size, GLuint *driverControls)
-GL_ENTRY(GLenum, glGetError, void)
-GL_ENTRY(void, glGetFenceivNV, GLuint fence, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetFixedv, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetFixedvOES, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetFloatv, GLenum pname, GLfloat *params)
-GL_ENTRY(void, glGetFramebufferAttachmentParameteriv, GLenum target, GLenum attachment, GLenum pname, GLint* params)
-GL_ENTRY(void, glGetFramebufferAttachmentParameterivOES, GLenum target, GLenum attachment, GLenum pname, GLint* params)
-GL_ENTRY(void, glGetIntegerv, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetLightfv, GLenum light, GLenum pname, GLfloat *params)
-GL_ENTRY(void, glGetLightxv, GLenum light, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetLightxvOES, GLenum light, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetMaterialfv, GLenum face, GLenum pname, GLfloat *params)
-GL_ENTRY(void, glGetMaterialxv, GLenum face, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetMaterialxvOES, GLenum face, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetPerfMonitorCounterDataAMD, GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten)
-GL_ENTRY(void, glGetPerfMonitorCounterInfoAMD, GLuint group, GLuint counter, GLenum pname, GLvoid *data)
-GL_ENTRY(void, glGetPerfMonitorCounterStringAMD, GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString)
-GL_ENTRY(void, glGetPerfMonitorCountersAMD, GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters)
-GL_ENTRY(void, glGetPerfMonitorGroupStringAMD, GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString)
-GL_ENTRY(void, glGetPerfMonitorGroupsAMD, GLint *numGroups, GLsizei groupsSize, GLuint *groups)
-GL_ENTRY(void, glGetPointerv, GLenum pname, GLvoid **params)
-GL_ENTRY(void, glGetProgramBinaryOES, GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary)
-GL_ENTRY(void, glGetProgramInfoLog, GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
-GL_ENTRY(void, glGetProgramiv, GLuint program, GLenum pname, GLint* params)
-GL_ENTRY(void, glGetRenderbufferParameteriv, GLenum target, GLenum pname, GLint* params)
-GL_ENTRY(void, glGetRenderbufferParameterivOES, GLenum target, GLenum pname, GLint* params)
-GL_ENTRY(void, glGetShaderInfoLog, GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
-GL_ENTRY(void, glGetShaderPrecisionFormat, GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
-GL_ENTRY(void, glGetShaderSource, GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
-GL_ENTRY(void, glGetShaderiv, GLuint shader, GLenum pname, GLint* params)
-GL_ENTRY(const GLubyte *, glGetString, GLenum name)
-GL_ENTRY(void, glGetTexEnvfv, GLenum env, GLenum pname, GLfloat *params)
-GL_ENTRY(void, glGetTexEnviv, GLenum env, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetTexEnvxv, GLenum env, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetTexEnvxvOES, GLenum env, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetTexGenfvOES, GLenum coord, GLenum pname, GLfloat *params)
-GL_ENTRY(void, glGetTexGenivOES, GLenum coord, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetTexGenxvOES, GLenum coord, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetTexParameterfv, GLenum target, GLenum pname, GLfloat *params)
-GL_ENTRY(void, glGetTexParameteriv, GLenum target, GLenum pname, GLint *params)
-GL_ENTRY(void, glGetTexParameterxv, GLenum target, GLenum pname, GLfixed *params)
-GL_ENTRY(void, glGetTexParameterxvOES, GLenum target, GLenum pname, GLfixed *params)
-GL_ENTRY(int, glGetUniformLocation, GLuint program, const GLchar* name)
-GL_ENTRY(void, glGetUniformfv, GLuint program, GLint location, GLfloat* params)
-GL_ENTRY(void, glGetUniformiv, GLuint program, GLint location, GLint* params)
-GL_ENTRY(void, glGetVertexAttribPointerv, GLuint index, GLenum pname, GLvoid** pointer)
-GL_ENTRY(void, glGetVertexAttribfv, GLuint index, GLenum pname, GLfloat* params)
-GL_ENTRY(void, glGetVertexAttribiv, GLuint index, GLenum pname, GLint* params)
-GL_ENTRY(void, glHint, GLenum target, GLenum mode)
-GL_ENTRY(GLboolean, glIsBuffer, GLuint buffer)
-GL_ENTRY(GLboolean, glIsEnabled, GLenum cap)
-GL_ENTRY(GLboolean, glIsFenceNV, GLuint fence)
-GL_ENTRY(GLboolean, glIsFramebuffer, GLuint framebuffer)
-GL_ENTRY(GLboolean, glIsFramebufferOES, GLuint framebuffer)
-GL_ENTRY(GLboolean, glIsProgram, GLuint program)
-GL_ENTRY(GLboolean, glIsRenderbuffer, GLuint renderbuffer)
-GL_ENTRY(GLboolean, glIsRenderbufferOES, GLuint renderbuffer)
-GL_ENTRY(GLboolean, glIsShader, GLuint shader)
-GL_ENTRY(GLboolean, glIsTexture, GLuint texture)
-GL_ENTRY(GLboolean, glIsVertexArrayOES, GLuint array)
-GL_ENTRY(void, glLightModelf, GLenum pname, GLfloat param)
-GL_ENTRY(void, glLightModelfv, GLenum pname, const GLfloat *params)
-GL_ENTRY(void, glLightModelx, GLenum pname, GLfixed param)
-GL_ENTRY(void, glLightModelxOES, GLenum pname, GLfixed param)
-GL_ENTRY(void, glLightModelxv, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glLightModelxvOES, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glLightf, GLenum light, GLenum pname, GLfloat param)
-GL_ENTRY(void, glLightfv, GLenum light, GLenum pname, const GLfloat *params)
-GL_ENTRY(void, glLightx, GLenum light, GLenum pname, GLfixed param)
-GL_ENTRY(void, glLightxOES, GLenum light, GLenum pname, GLfixed param)
-GL_ENTRY(void, glLightxv, GLenum light, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glLightxvOES, GLenum light, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glLineWidth, GLfloat width)
-GL_ENTRY(void, glLineWidthx, GLfixed width)
-GL_ENTRY(void, glLineWidthxOES, GLfixed width)
-GL_ENTRY(void, glLinkProgram, GLuint program)
-GL_ENTRY(void, glLoadIdentity, void)
-GL_ENTRY(void, glLoadMatrixf, const GLfloat *m)
-GL_ENTRY(void, glLoadMatrixx, const GLfixed *m)
-GL_ENTRY(void, glLoadMatrixxOES, const GLfixed *m)
-GL_ENTRY(void, glLoadPaletteFromModelViewMatrixOES, void)
-GL_ENTRY(void, glLogicOp, GLenum opcode)
-GL_ENTRY(void*, glMapBufferOES, GLenum target, GLenum access)
-GL_ENTRY(void, glMaterialf, GLenum face, GLenum pname, GLfloat param)
-GL_ENTRY(void, glMaterialfv, GLenum face, GLenum pname, const GLfloat *params)
-GL_ENTRY(void, glMaterialx, GLenum face, GLenum pname, GLfixed param)
-GL_ENTRY(void, glMaterialxOES, GLenum face, GLenum pname, GLfixed param)
-GL_ENTRY(void, glMaterialxv, GLenum face, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glMaterialxvOES, GLenum face, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glMatrixIndexPointerOES, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-GL_ENTRY(void, glMatrixMode, GLenum mode)
-GL_ENTRY(void, glMultMatrixf, const GLfloat *m)
-GL_ENTRY(void, glMultMatrixx, const GLfixed *m)
-GL_ENTRY(void, glMultMatrixxOES, const GLfixed *m)
-GL_ENTRY(void, glMultiDrawArraysEXT, GLenum mode, GLint *first, GLsizei *count, GLsizei primcount)
-GL_ENTRY(void, glMultiDrawElementsEXT, GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount)
-GL_ENTRY(void, glMultiTexCoord4f, GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
-GL_ENTRY(void, glMultiTexCoord4x, GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
-GL_ENTRY(void, glMultiTexCoord4xOES, GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
-GL_ENTRY(void, glNormal3f, GLfloat nx, GLfloat ny, GLfloat nz)
-GL_ENTRY(void, glNormal3x, GLfixed nx, GLfixed ny, GLfixed nz)
-GL_ENTRY(void, glNormal3xOES, GLfixed nx, GLfixed ny, GLfixed nz)
-GL_ENTRY(void, glNormalPointer, GLenum type, GLsizei stride, const GLvoid *pointer)
-GL_ENTRY(void, glOrthof, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-GL_ENTRY(void, glOrthofOES, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
-GL_ENTRY(void, glOrthox, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-GL_ENTRY(void, glOrthoxOES, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
-GL_ENTRY(void, glPixelStorei, GLenum pname, GLint param)
-GL_ENTRY(void, glPointParameterf, GLenum pname, GLfloat param)
-GL_ENTRY(void, glPointParameterfv, GLenum pname, const GLfloat *params)
-GL_ENTRY(void, glPointParameterx, GLenum pname, GLfixed param)
-GL_ENTRY(void, glPointParameterxOES, GLenum pname, GLfixed param)
-GL_ENTRY(void, glPointParameterxv, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glPointParameterxvOES, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glPointSize, GLfloat size)
-GL_ENTRY(void, glPointSizePointerOES, GLenum type, GLsizei stride, const GLvoid *pointer)
-GL_ENTRY(void, glPointSizex, GLfixed size)
-GL_ENTRY(void, glPointSizexOES, GLfixed size)
-GL_ENTRY(void, glPolygonOffset, GLfloat factor, GLfloat units)
-GL_ENTRY(void, glPolygonOffsetx, GLfixed factor, GLfixed units)
-GL_ENTRY(void, glPolygonOffsetxOES, GLfixed factor, GLfixed units)
-GL_ENTRY(void, glPopMatrix, void)
-GL_ENTRY(void, glProgramBinaryOES, GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length)
-GL_ENTRY(void, glPushMatrix, void)
-GL_ENTRY(GLbitfield, glQueryMatrixxOES, GLfixed mantissa[16], GLint exponent[16])
-GL_ENTRY(void, glReadPixels, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
-GL_ENTRY(void, glReleaseShaderCompiler, void)
-GL_ENTRY(void, glRenderbufferStorage, GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glRenderbufferStorageMultisampleIMG, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glRenderbufferStorageOES, GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-GL_ENTRY(void, glRotatef, GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
-GL_ENTRY(void, glRotatex, GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
-GL_ENTRY(void, glRotatexOES, GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
-GL_ENTRY(void, glSampleCoverage, GLclampf value, GLboolean invert)
-GL_ENTRY(void, glSampleCoveragex, GLclampx value, GLboolean invert)
-GL_ENTRY(void, glSampleCoveragexOES, GLclampx value, GLboolean invert)
-GL_ENTRY(void, glScalef, GLfloat x, GLfloat y, GLfloat z)
-GL_ENTRY(void, glScalex, GLfixed x, GLfixed y, GLfixed z)
-GL_ENTRY(void, glScalexOES, GLfixed x, GLfixed y, GLfixed z)
-GL_ENTRY(void, glScissor, GLint x, GLint y, GLsizei width, GLsizei height)
-GL_ENTRY(void, glSelectPerfMonitorCountersAMD, GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList)
-GL_ENTRY(void, glSetFenceNV, GLuint fence, GLenum condition)
-GL_ENTRY(void, glShadeModel, GLenum mode)
-GL_ENTRY(void, glShaderBinary, GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length)
-GL_ENTRY(void, glShaderSource, GLuint shader, GLsizei count, const GLchar** string, const GLint* length)
-GL_ENTRY(void, glStartTilingQCOM, GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask)
-GL_ENTRY(void, glStencilFunc, GLenum func, GLint ref, GLuint mask)
-GL_ENTRY(void, glStencilFuncSeparate, GLenum face, GLenum func, GLint ref, GLuint mask)
-GL_ENTRY(void, glStencilMask, GLuint mask)
-GL_ENTRY(void, glStencilMaskSeparate, GLenum face, GLuint mask)
-GL_ENTRY(void, glStencilOp, GLenum fail, GLenum zfail, GLenum zpass)
-GL_ENTRY(void, glStencilOpSeparate, GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
-GL_ENTRY(GLboolean, glTestFenceNV, GLuint fence)
-GL_ENTRY(void, glTexCoordPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-GL_ENTRY(void, glTexEnvf, GLenum target, GLenum pname, GLfloat param)
-GL_ENTRY(void, glTexEnvfv, GLenum target, GLenum pname, const GLfloat *params)
-GL_ENTRY(void, glTexEnvi, GLenum target, GLenum pname, GLint param)
-GL_ENTRY(void, glTexEnviv, GLenum target, GLenum pname, const GLint *params)
-GL_ENTRY(void, glTexEnvx, GLenum target, GLenum pname, GLfixed param)
-GL_ENTRY(void, glTexEnvxOES, GLenum target, GLenum pname, GLfixed param)
-GL_ENTRY(void, glTexEnvxv, GLenum target, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glTexEnvxvOES, GLenum target, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glTexGenfOES, GLenum coord, GLenum pname, GLfloat param)
-GL_ENTRY(void, glTexGenfvOES, GLenum coord, GLenum pname, const GLfloat *params)
-GL_ENTRY(void, glTexGeniOES, GLenum coord, GLenum pname, GLint param)
-GL_ENTRY(void, glTexGenivOES, GLenum coord, GLenum pname, const GLint *params)
-GL_ENTRY(void, glTexGenxOES, GLenum coord, GLenum pname, GLfixed param)
-GL_ENTRY(void, glTexGenxvOES, GLenum coord, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glTexImage2D, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
-GL_ENTRY(void, glTexImage3DOES, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
-GL_ENTRY(void, glTexParameterf, GLenum target, GLenum pname, GLfloat param)
-GL_ENTRY(void, glTexParameterfv, GLenum target, GLenum pname, const GLfloat *params)
-GL_ENTRY(void, glTexParameteri, GLenum target, GLenum pname, GLint param)
-GL_ENTRY(void, glTexParameteriv, GLenum target, GLenum pname, const GLint *params)
-GL_ENTRY(void, glTexParameterx, GLenum target, GLenum pname, GLfixed param)
-GL_ENTRY(void, glTexParameterxOES, GLenum target, GLenum pname, GLfixed param)
-GL_ENTRY(void, glTexParameterxv, GLenum target, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glTexParameterxvOES, GLenum target, GLenum pname, const GLfixed *params)
-GL_ENTRY(void, glTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
-GL_ENTRY(void, glTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
-GL_ENTRY(void, glTranslatef, GLfloat x, GLfloat y, GLfloat z)
-GL_ENTRY(void, glTranslatex, GLfixed x, GLfixed y, GLfixed z)
-GL_ENTRY(void, glTranslatexOES, GLfixed x, GLfixed y, GLfixed z)
-GL_ENTRY(void, glUniform1f, GLint location, GLfloat x)
-GL_ENTRY(void, glUniform1fv, GLint location, GLsizei count, const GLfloat* v)
-GL_ENTRY(void, glUniform1i, GLint location, GLint x)
-GL_ENTRY(void, glUniform1iv, GLint location, GLsizei count, const GLint* v)
-GL_ENTRY(void, glUniform2f, GLint location, GLfloat x, GLfloat y)
-GL_ENTRY(void, glUniform2fv, GLint location, GLsizei count, const GLfloat* v)
-GL_ENTRY(void, glUniform2i, GLint location, GLint x, GLint y)
-GL_ENTRY(void, glUniform2iv, GLint location, GLsizei count, const GLint* v)
-GL_ENTRY(void, glUniform3f, GLint location, GLfloat x, GLfloat y, GLfloat z)
-GL_ENTRY(void, glUniform3fv, GLint location, GLsizei count, const GLfloat* v)
-GL_ENTRY(void, glUniform3i, GLint location, GLint x, GLint y, GLint z)
-GL_ENTRY(void, glUniform3iv, GLint location, GLsizei count, const GLint* v)
-GL_ENTRY(void, glUniform4f, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-GL_ENTRY(void, glUniform4fv, GLint location, GLsizei count, const GLfloat* v)
-GL_ENTRY(void, glUniform4i, GLint location, GLint x, GLint y, GLint z, GLint w)
-GL_ENTRY(void, glUniform4iv, GLint location, GLsizei count, const GLint* v)
-GL_ENTRY(void, glUniformMatrix2fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-GL_ENTRY(void, glUniformMatrix3fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-GL_ENTRY(void, glUniformMatrix4fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-GL_ENTRY(GLboolean, glUnmapBufferOES, GLenum target)
-GL_ENTRY(void, glUseProgram, GLuint program)
-GL_ENTRY(void, glValidateProgram, GLuint program)
-GL_ENTRY(void, glVertexAttrib1f, GLuint indx, GLfloat x)
-GL_ENTRY(void, glVertexAttrib1fv, GLuint indx, const GLfloat* values)
-GL_ENTRY(void, glVertexAttrib2f, GLuint indx, GLfloat x, GLfloat y)
-GL_ENTRY(void, glVertexAttrib2fv, GLuint indx, const GLfloat* values)
-GL_ENTRY(void, glVertexAttrib3f, GLuint indx, GLfloat x, GLfloat y, GLfloat z)
-GL_ENTRY(void, glVertexAttrib3fv, GLuint indx, const GLfloat* values)
-GL_ENTRY(void, glVertexAttrib4f, GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-GL_ENTRY(void, glVertexAttrib4fv, GLuint indx, const GLfloat* values)
-GL_ENTRY(void, glVertexAttribPointer, GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr)
-GL_ENTRY(void, glVertexPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-GL_ENTRY(void, glViewport, GLint x, GLint y, GLsizei width, GLsizei height)
-GL_ENTRY(void, glWeightPointerOES, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
-
-
-}
diff --git a/opengl/libs/hooks.h b/opengl/libs/hooks.h
index 7ac88cd..8b1b389 100644
--- a/opengl/libs/hooks.h
+++ b/opengl/libs/hooks.h
@@ -37,7 +37,12 @@
 #endif
 #undef NELEM
 #define NELEM(x)                    (sizeof(x)/sizeof(*(x)))
-#define MAX_NUMBER_OF_GL_EXTENSIONS 64
+
+// maximum number of GL extensions that can be used simultaneously in
+// a given process. this limitation exists because we need to have
+// a static function for each extension and currently these static functions
+// are generated at compile time.
+#define MAX_NUMBER_OF_GL_EXTENSIONS 256
 
 
 #if defined(HAVE_ANDROID_OS) && !USE_SLOW_BINDING && __OPTIMIZE__
diff --git a/opengl/libs/trace.in b/opengl/libs/trace.in
index 3d492af..a5c5c84 100644
--- a/opengl/libs/trace.in
+++ b/opengl/libs/trace.in
@@ -1,13 +1,17 @@
+TRACE_GL_VOID(glActiveShaderProgramEXT, (GLuint pipeline, GLuint program), (pipeline, program), 2, "GLuint", pipeline, "GLuint", program)
 TRACE_GL_VOID(glActiveTexture, (GLenum texture), (texture), 1, "GLenum", texture)
 TRACE_GL_VOID(glAlphaFunc, (GLenum func, GLclampf ref), (func, ref), 2, "GLenum", func, "GLclampf", ref)
+TRACE_GL_VOID(glAlphaFuncQCOM, (GLenum func, GLclampf ref), (func, ref), 2, "GLenum", func, "GLclampf", ref)
 TRACE_GL_VOID(glAlphaFuncx, (GLenum func, GLclampx ref), (func, ref), 2, "GLenum", func, "GLclampx", ref)
 TRACE_GL_VOID(glAlphaFuncxOES, (GLenum func, GLclampx ref), (func, ref), 2, "GLenum", func, "GLclampx", ref)
 TRACE_GL_VOID(glAttachShader, (GLuint program, GLuint shader), (program, shader), 2, "GLuint", program, "GLuint", shader)
 TRACE_GL_VOID(glBeginPerfMonitorAMD, (GLuint monitor), (monitor), 1, "GLuint", monitor)
+TRACE_GL_VOID(glBeginQueryEXT, (GLenum target, GLuint id), (target, id), 2, "GLenum", target, "GLuint", id)
 TRACE_GL_VOID(glBindAttribLocation, (GLuint program, GLuint index, const GLchar* name), (program, index, name), 3, "GLuint", program, "GLuint", index, "const GLchar*", name)
 TRACE_GL_VOID(glBindBuffer, (GLenum target, GLuint buffer), (target, buffer), 2, "GLenum", target, "GLuint", buffer)
 TRACE_GL_VOID(glBindFramebuffer, (GLenum target, GLuint framebuffer), (target, framebuffer), 2, "GLenum", target, "GLuint", framebuffer)
 TRACE_GL_VOID(glBindFramebufferOES, (GLenum target, GLuint framebuffer), (target, framebuffer), 2, "GLenum", target, "GLuint", framebuffer)
+TRACE_GL_VOID(glBindProgramPipelineEXT, (GLuint pipeline), (pipeline), 1, "GLuint", pipeline)
 TRACE_GL_VOID(glBindRenderbuffer, (GLenum target, GLuint renderbuffer), (target, renderbuffer), 2, "GLenum", target, "GLuint", renderbuffer)
 TRACE_GL_VOID(glBindRenderbufferOES, (GLenum target, GLuint renderbuffer), (target, renderbuffer), 2, "GLenum", target, "GLuint", renderbuffer)
 TRACE_GL_VOID(glBindTexture, (GLenum target, GLuint texture), (target, texture), 2, "GLenum", target, "GLuint", texture)
@@ -20,6 +24,7 @@
 TRACE_GL_VOID(glBlendFunc, (GLenum sfactor, GLenum dfactor), (sfactor, dfactor), 2, "GLenum", sfactor, "GLenum", dfactor)
 TRACE_GL_VOID(glBlendFuncSeparate, (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha), (srcRGB, dstRGB, srcAlpha, dstAlpha), 4, "GLenum", srcRGB, "GLenum", dstRGB, "GLenum", srcAlpha, "GLenum", dstAlpha)
 TRACE_GL_VOID(glBlendFuncSeparateOES, (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha), (srcRGB, dstRGB, srcAlpha, dstAlpha), 4, "GLenum", srcRGB, "GLenum", dstRGB, "GLenum", srcAlpha, "GLenum", dstAlpha)
+TRACE_GL_VOID(glBlitFramebufferANGLE, (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter), (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), 10, "GLint", srcX0, "GLint", srcY0, "GLint", srcX1, "GLint", srcY1, "GLint", dstX0, "GLint", dstY0, "GLint", dstX1, "GLint", dstY1, "GLbitfield", mask, "GLenum", filter)
 TRACE_GL_VOID(glBufferData, (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage), (target, size, data, usage), 4, "GLenum", target, "GLsizeiptr", size, "const GLvoid *", data, "GLenum", usage)
 TRACE_GL_VOID(glBufferSubData, (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data), (target, offset, size, data), 4, "GLenum", target, "GLintptr", offset, "GLsizeiptr", size, "const GLvoid *", data)
 TRACE_GL(GLenum, glCheckFramebufferStatus, (GLenum target), (target), 1, "GLenum", target)
@@ -58,6 +63,7 @@
 TRACE_GL_VOID(glCoverageOperationNV, (GLenum operation), (operation), 1, "GLenum", operation)
 TRACE_GL(GLuint, glCreateProgram, (void), (), 0)
 TRACE_GL(GLuint, glCreateShader, (GLenum type), (type), 1, "GLenum", type)
+TRACE_GL(GLuint, glCreateShaderProgramvEXT, (GLenum type, GLsizei count, const GLchar **strings), (type, count, strings), 3, "GLenum", type, "GLsizei", count, "const GLchar **", strings)
 TRACE_GL_VOID(glCullFace, (GLenum mode), (mode), 1, "GLenum", mode)
 TRACE_GL_VOID(glCurrentPaletteMatrixOES, (GLuint matrixpaletteindex), (matrixpaletteindex), 1, "GLuint", matrixpaletteindex)
 TRACE_GL_VOID(glDeleteBuffers, (GLsizei n, const GLuint *buffers), (n, buffers), 2, "GLsizei", n, "const GLuint *", buffers)
@@ -66,6 +72,8 @@
 TRACE_GL_VOID(glDeleteFramebuffersOES, (GLsizei n, const GLuint* framebuffers), (n, framebuffers), 2, "GLsizei", n, "const GLuint*", framebuffers)
 TRACE_GL_VOID(glDeletePerfMonitorsAMD, (GLsizei n, GLuint *monitors), (n, monitors), 2, "GLsizei", n, "GLuint *", monitors)
 TRACE_GL_VOID(glDeleteProgram, (GLuint program), (program), 1, "GLuint", program)
+TRACE_GL_VOID(glDeleteProgramPipelinesEXT, (GLsizei n, const GLuint *pipelines), (n, pipelines), 2, "GLsizei", n, "const GLuint *", pipelines)
+TRACE_GL_VOID(glDeleteQueriesEXT, (GLsizei n, const GLuint *ids), (n, ids), 2, "GLsizei", n, "const GLuint *", ids)
 TRACE_GL_VOID(glDeleteRenderbuffers, (GLsizei n, const GLuint* renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "const GLuint*", renderbuffers)
 TRACE_GL_VOID(glDeleteRenderbuffersOES, (GLsizei n, const GLuint* renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "const GLuint*", renderbuffers)
 TRACE_GL_VOID(glDeleteShader, (GLuint shader), (shader), 1, "GLuint", shader)
@@ -84,6 +92,7 @@
 TRACE_GL_VOID(glDisableVertexAttribArray, (GLuint index), (index), 1, "GLuint", index)
 TRACE_GL_VOID(glDiscardFramebufferEXT, (GLenum target, GLsizei numAttachments, const GLenum *attachments), (target, numAttachments, attachments), 3, "GLenum", target, "GLsizei", numAttachments, "const GLenum *", attachments)
 TRACE_GL_VOID(glDrawArrays, (GLenum mode, GLint first, GLsizei count), (mode, first, count), 3, "GLenum", mode, "GLint", first, "GLsizei", count)
+TRACE_GL_VOID(glDrawBuffersNV, (GLsizei n, const GLenum *bufs), (n, bufs), 2, "GLsizei", n, "const GLenum *", bufs)
 TRACE_GL_VOID(glDrawElements, (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices), (mode, count, type, indices), 4, "GLenum", mode, "GLsizei", count, "GLenum", type, "const GLvoid *", indices)
 TRACE_GL_VOID(glDrawTexfOES, (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height), (x, y, z, width, height), 5, "GLfloat", x, "GLfloat", y, "GLfloat", z, "GLfloat", width, "GLfloat", height)
 TRACE_GL_VOID(glDrawTexfvOES, (const GLfloat *coords), (coords), 1, "const GLfloat *", coords)
@@ -100,6 +109,7 @@
 TRACE_GL_VOID(glEnableDriverControlQCOM, (GLuint driverControl), (driverControl), 1, "GLuint", driverControl)
 TRACE_GL_VOID(glEnableVertexAttribArray, (GLuint index), (index), 1, "GLuint", index)
 TRACE_GL_VOID(glEndPerfMonitorAMD, (GLuint monitor), (monitor), 1, "GLuint", monitor)
+TRACE_GL_VOID(glEndQueryEXT, (GLenum target), (target), 1, "GLenum", target)
 TRACE_GL_VOID(glEndTilingQCOM, (GLbitfield preserveMask), (preserveMask), 1, "GLbitfield", preserveMask)
 TRACE_GL_VOID(glExtGetBufferPointervQCOM, (GLenum target, GLvoid **params), (target, params), 2, "GLenum", target, "GLvoid **", params)
 TRACE_GL_VOID(glExtGetBuffersQCOM, (GLuint *buffers, GLint maxBuffers, GLint *numBuffers), (buffers, maxBuffers, numBuffers), 3, "GLuint *", buffers, "GLint", maxBuffers, "GLint *", numBuffers)
@@ -125,6 +135,7 @@
 TRACE_GL_VOID(glFramebufferRenderbuffer, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer), (target, attachment, renderbuffertarget, renderbuffer), 4, "GLenum", target, "GLenum", attachment, "GLenum", renderbuffertarget, "GLuint", renderbuffer)
 TRACE_GL_VOID(glFramebufferRenderbufferOES, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer), (target, attachment, renderbuffertarget, renderbuffer), 4, "GLenum", target, "GLenum", attachment, "GLenum", renderbuffertarget, "GLuint", renderbuffer)
 TRACE_GL_VOID(glFramebufferTexture2D, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level), (target, attachment, textarget, texture, level), 5, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level)
+TRACE_GL_VOID(glFramebufferTexture2DMultisampleEXT, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples), (target, attachment, textarget, texture, level, samples), 6, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level, "GLsizei", samples)
 TRACE_GL_VOID(glFramebufferTexture2DMultisampleIMG, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples), (target, attachment, textarget, texture, level, samples), 6, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level, "GLsizei", samples)
 TRACE_GL_VOID(glFramebufferTexture2DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level), (target, attachment, textarget, texture, level), 5, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level)
 TRACE_GL_VOID(glFramebufferTexture3DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset), (target, attachment, textarget, texture, level, zoffset), 6, "GLenum", target, "GLenum", attachment, "GLenum", textarget, "GLuint", texture, "GLint", level, "GLint", zoffset)
@@ -138,6 +149,8 @@
 TRACE_GL_VOID(glGenFramebuffers, (GLsizei n, GLuint* framebuffers), (n, framebuffers), 2, "GLsizei", n, "GLuint*", framebuffers)
 TRACE_GL_VOID(glGenFramebuffersOES, (GLsizei n, GLuint* framebuffers), (n, framebuffers), 2, "GLsizei", n, "GLuint*", framebuffers)
 TRACE_GL_VOID(glGenPerfMonitorsAMD, (GLsizei n, GLuint *monitors), (n, monitors), 2, "GLsizei", n, "GLuint *", monitors)
+TRACE_GL_VOID(glGenProgramPipelinesEXT, (GLsizei n, GLuint *pipelines), (n, pipelines), 2, "GLsizei", n, "GLuint *", pipelines)
+TRACE_GL_VOID(glGenQueriesEXT, (GLsizei n, GLuint *ids), (n, ids), 2, "GLsizei", n, "GLuint *", ids)
 TRACE_GL_VOID(glGenRenderbuffers, (GLsizei n, GLuint* renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "GLuint*", renderbuffers)
 TRACE_GL_VOID(glGenRenderbuffersOES, (GLsizei n, GLuint* renderbuffers), (n, renderbuffers), 2, "GLsizei", n, "GLuint*", renderbuffers)
 TRACE_GL_VOID(glGenTextures, (GLsizei n, GLuint *textures), (n, textures), 2, "GLsizei", n, "GLuint *", textures)
@@ -164,6 +177,7 @@
 TRACE_GL_VOID(glGetFloatv, (GLenum pname, GLfloat *params), (pname, params), 2, "GLenum", pname, "GLfloat *", params)
 TRACE_GL_VOID(glGetFramebufferAttachmentParameteriv, (GLenum target, GLenum attachment, GLenum pname, GLint* params), (target, attachment, pname, params), 4, "GLenum", target, "GLenum", attachment, "GLenum", pname, "GLint*", params)
 TRACE_GL_VOID(glGetFramebufferAttachmentParameterivOES, (GLenum target, GLenum attachment, GLenum pname, GLint* params), (target, attachment, pname, params), 4, "GLenum", target, "GLenum", attachment, "GLenum", pname, "GLint*", params)
+TRACE_GL(GLenum, glGetGraphicsResetStatusEXT, (void), (), 0)
 TRACE_GL_VOID(glGetIntegerv, (GLenum pname, GLint *params), (pname, params), 2, "GLenum", pname, "GLint *", params)
 TRACE_GL_VOID(glGetLightfv, (GLenum light, GLenum pname, GLfloat *params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "GLfloat *", params)
 TRACE_GL_VOID(glGetLightxv, (GLenum light, GLenum pname, GLfixed *params), (light, pname, params), 3, "GLenum", light, "GLenum", pname, "GLfixed *", params)
@@ -171,6 +185,7 @@
 TRACE_GL_VOID(glGetMaterialfv, (GLenum face, GLenum pname, GLfloat *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "GLfloat *", params)
 TRACE_GL_VOID(glGetMaterialxv, (GLenum face, GLenum pname, GLfixed *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "GLfixed *", params)
 TRACE_GL_VOID(glGetMaterialxvOES, (GLenum face, GLenum pname, GLfixed *params), (face, pname, params), 3, "GLenum", face, "GLenum", pname, "GLfixed *", params)
+TRACE_GL_VOID(glGetObjectLabelEXT, (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label), (type, object, bufSize, length, label), 5, "GLenum", type, "GLuint", object, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", label)
 TRACE_GL_VOID(glGetPerfMonitorCounterDataAMD, (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten), (monitor, pname, dataSize, data, bytesWritten), 5, "GLuint", monitor, "GLenum", pname, "GLsizei", dataSize, "GLuint *", data, "GLint *", bytesWritten)
 TRACE_GL_VOID(glGetPerfMonitorCounterInfoAMD, (GLuint group, GLuint counter, GLenum pname, GLvoid *data), (group, counter, pname, data), 4, "GLuint", group, "GLuint", counter, "GLenum", pname, "GLvoid *", data)
 TRACE_GL_VOID(glGetPerfMonitorCounterStringAMD, (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString), (group, counter, bufSize, length, counterString), 5, "GLuint", group, "GLuint", counter, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", counterString)
@@ -180,7 +195,11 @@
 TRACE_GL_VOID(glGetPointerv, (GLenum pname, GLvoid **params), (pname, params), 2, "GLenum", pname, "GLvoid **", params)
 TRACE_GL_VOID(glGetProgramBinaryOES, (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary), (program, bufSize, length, binaryFormat, binary), 5, "GLuint", program, "GLsizei", bufSize, "GLsizei *", length, "GLenum *", binaryFormat, "GLvoid *", binary)
 TRACE_GL_VOID(glGetProgramInfoLog, (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog), (program, bufsize, length, infolog), 4, "GLuint", program, "GLsizei", bufsize, "GLsizei*", length, "GLchar*", infolog)
+TRACE_GL_VOID(glGetProgramPipelineInfoLogEXT, (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog), (pipeline, bufSize, length, infoLog), 4, "GLuint", pipeline, "GLsizei", bufSize, "GLsizei *", length, "GLchar *", infoLog)
+TRACE_GL_VOID(glGetProgramPipelineivEXT, (GLuint pipeline, GLenum pname, GLint *params), (pipeline, pname, params), 3, "GLuint", pipeline, "GLenum", pname, "GLint *", params)
 TRACE_GL_VOID(glGetProgramiv, (GLuint program, GLenum pname, GLint* params), (program, pname, params), 3, "GLuint", program, "GLenum", pname, "GLint*", params)
+TRACE_GL_VOID(glGetQueryObjectuivEXT, (GLuint id, GLenum pname, GLuint *params), (id, pname, params), 3, "GLuint", id, "GLenum", pname, "GLuint *", params)
+TRACE_GL_VOID(glGetQueryivEXT, (GLenum target, GLenum pname, GLint *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint *", params)
 TRACE_GL_VOID(glGetRenderbufferParameteriv, (GLenum target, GLenum pname, GLint* params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint*", params)
 TRACE_GL_VOID(glGetRenderbufferParameterivOES, (GLenum target, GLenum pname, GLint* params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "GLint*", params)
 TRACE_GL_VOID(glGetShaderInfoLog, (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog), (shader, bufsize, length, infolog), 4, "GLuint", shader, "GLsizei", bufsize, "GLsizei*", length, "GLchar*", infolog)
@@ -205,18 +224,24 @@
 TRACE_GL_VOID(glGetVertexAttribPointerv, (GLuint index, GLenum pname, GLvoid** pointer), (index, pname, pointer), 3, "GLuint", index, "GLenum", pname, "GLvoid**", pointer)
 TRACE_GL_VOID(glGetVertexAttribfv, (GLuint index, GLenum pname, GLfloat* params), (index, pname, params), 3, "GLuint", index, "GLenum", pname, "GLfloat*", params)
 TRACE_GL_VOID(glGetVertexAttribiv, (GLuint index, GLenum pname, GLint* params), (index, pname, params), 3, "GLuint", index, "GLenum", pname, "GLint*", params)
+TRACE_GL_VOID(glGetnUniformfvEXT, (GLuint program, GLint location, GLsizei bufSize, float *params), (program, location, bufSize, params), 4, "GLuint", program, "GLint", location, "GLsizei", bufSize, "float *", params)
+TRACE_GL_VOID(glGetnUniformivEXT, (GLuint program, GLint location, GLsizei bufSize, GLint *params), (program, location, bufSize, params), 4, "GLuint", program, "GLint", location, "GLsizei", bufSize, "GLint *", params)
 TRACE_GL_VOID(glHint, (GLenum target, GLenum mode), (target, mode), 2, "GLenum", target, "GLenum", mode)
+TRACE_GL_VOID(glInsertEventMarkerEXT, (GLsizei length, const GLchar *marker), (length, marker), 2, "GLsizei", length, "const GLchar *", marker)
 TRACE_GL(GLboolean, glIsBuffer, (GLuint buffer), (buffer), 1, "GLuint", buffer)
 TRACE_GL(GLboolean, glIsEnabled, (GLenum cap), (cap), 1, "GLenum", cap)
 TRACE_GL(GLboolean, glIsFenceNV, (GLuint fence), (fence), 1, "GLuint", fence)
 TRACE_GL(GLboolean, glIsFramebuffer, (GLuint framebuffer), (framebuffer), 1, "GLuint", framebuffer)
 TRACE_GL(GLboolean, glIsFramebufferOES, (GLuint framebuffer), (framebuffer), 1, "GLuint", framebuffer)
 TRACE_GL(GLboolean, glIsProgram, (GLuint program), (program), 1, "GLuint", program)
+TRACE_GL(GLboolean, glIsProgramPipelineEXT, (GLuint pipeline), (pipeline), 1, "GLuint", pipeline)
+TRACE_GL(GLboolean, glIsQueryEXT, (GLuint id), (id), 1, "GLuint", id)
 TRACE_GL(GLboolean, glIsRenderbuffer, (GLuint renderbuffer), (renderbuffer), 1, "GLuint", renderbuffer)
 TRACE_GL(GLboolean, glIsRenderbufferOES, (GLuint renderbuffer), (renderbuffer), 1, "GLuint", renderbuffer)
 TRACE_GL(GLboolean, glIsShader, (GLuint shader), (shader), 1, "GLuint", shader)
 TRACE_GL(GLboolean, glIsTexture, (GLuint texture), (texture), 1, "GLuint", texture)
 TRACE_GL(GLboolean, glIsVertexArrayOES, (GLuint array), (array), 1, "GLuint", array)
+TRACE_GL_VOID(glLabelObjectEXT, (GLenum type, GLuint object, GLsizei length, const GLchar *label), (type, object, length, label), 4, "GLenum", type, "GLuint", object, "GLsizei", length, "const GLchar *", label)
 TRACE_GL_VOID(glLightModelf, (GLenum pname, GLfloat param), (pname, param), 2, "GLenum", pname, "GLfloat", param)
 TRACE_GL_VOID(glLightModelfv, (GLenum pname, const GLfloat *params), (pname, params), 2, "GLenum", pname, "const GLfloat *", params)
 TRACE_GL_VOID(glLightModelx, (GLenum pname, GLfixed param), (pname, param), 2, "GLenum", pname, "GLfixed", param)
@@ -278,15 +303,43 @@
 TRACE_GL_VOID(glPolygonOffset, (GLfloat factor, GLfloat units), (factor, units), 2, "GLfloat", factor, "GLfloat", units)
 TRACE_GL_VOID(glPolygonOffsetx, (GLfixed factor, GLfixed units), (factor, units), 2, "GLfixed", factor, "GLfixed", units)
 TRACE_GL_VOID(glPolygonOffsetxOES, (GLfixed factor, GLfixed units), (factor, units), 2, "GLfixed", factor, "GLfixed", units)
+TRACE_GL_VOID(glPopGroupMarkerEXT, (void), (), 0)
 TRACE_GL_VOID(glPopMatrix, (void), (), 0)
 TRACE_GL_VOID(glProgramBinaryOES, (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length), (program, binaryFormat, binary, length), 4, "GLuint", program, "GLenum", binaryFormat, "const GLvoid *", binary, "GLint", length)
+TRACE_GL_VOID(glProgramParameteriEXT, (GLuint program, GLenum pname, GLint value), (program, pname, value), 3, "GLuint", program, "GLenum", pname, "GLint", value)
+TRACE_GL_VOID(glProgramUniform1fEXT, (GLuint program, GLint location, GLfloat x), (program, location, x), 3, "GLuint", program, "GLint", location, "GLfloat", x)
+TRACE_GL_VOID(glProgramUniform1fvEXT, (GLuint program, GLint location, GLsizei count, const GLfloat *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
+TRACE_GL_VOID(glProgramUniform1iEXT, (GLuint program, GLint location, GLint x), (program, location, x), 3, "GLuint", program, "GLint", location, "GLint", x)
+TRACE_GL_VOID(glProgramUniform1ivEXT, (GLuint program, GLint location, GLsizei count, const GLint *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
+TRACE_GL_VOID(glProgramUniform2fEXT, (GLuint program, GLint location, GLfloat x, GLfloat y), (program, location, x, y), 4, "GLuint", program, "GLint", location, "GLfloat", x, "GLfloat", y)
+TRACE_GL_VOID(glProgramUniform2fvEXT, (GLuint program, GLint location, GLsizei count, const GLfloat *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
+TRACE_GL_VOID(glProgramUniform2iEXT, (GLuint program, GLint location, GLint x, GLint y), (program, location, x, y), 4, "GLuint", program, "GLint", location, "GLint", x, "GLint", y)
+TRACE_GL_VOID(glProgramUniform2ivEXT, (GLuint program, GLint location, GLsizei count, const GLint *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
+TRACE_GL_VOID(glProgramUniform3fEXT, (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z), (program, location, x, y, z), 5, "GLuint", program, "GLint", location, "GLfloat", x, "GLfloat", y, "GLfloat", z)
+TRACE_GL_VOID(glProgramUniform3fvEXT, (GLuint program, GLint location, GLsizei count, const GLfloat *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
+TRACE_GL_VOID(glProgramUniform3iEXT, (GLuint program, GLint location, GLint x, GLint y, GLint z), (program, location, x, y, z), 5, "GLuint", program, "GLint", location, "GLint", x, "GLint", y, "GLint", z)
+TRACE_GL_VOID(glProgramUniform3ivEXT, (GLuint program, GLint location, GLsizei count, const GLint *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
+TRACE_GL_VOID(glProgramUniform4fEXT, (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w), (program, location, x, y, z, w), 6, "GLuint", program, "GLint", location, "GLfloat", x, "GLfloat", y, "GLfloat", z, "GLfloat", w)
+TRACE_GL_VOID(glProgramUniform4fvEXT, (GLuint program, GLint location, GLsizei count, const GLfloat *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLfloat *", value)
+TRACE_GL_VOID(glProgramUniform4iEXT, (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w), (program, location, x, y, z, w), 6, "GLuint", program, "GLint", location, "GLint", x, "GLint", y, "GLint", z, "GLint", w)
+TRACE_GL_VOID(glProgramUniform4ivEXT, (GLuint program, GLint location, GLsizei count, const GLint *value), (program, location, count, value), 4, "GLuint", program, "GLint", location, "GLsizei", count, "const GLint *", value)
+TRACE_GL_VOID(glProgramUniformMatrix2fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
+TRACE_GL_VOID(glProgramUniformMatrix3fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
+TRACE_GL_VOID(glProgramUniformMatrix4fvEXT, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value), (program, location, count, transpose, value), 5, "GLuint", program, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat *", value)
+TRACE_GL_VOID(glPushGroupMarkerEXT, (GLsizei length, const GLchar *marker), (length, marker), 2, "GLsizei", length, "const GLchar *", marker)
 TRACE_GL_VOID(glPushMatrix, (void), (), 0)
 TRACE_GL(GLbitfield, glQueryMatrixxOES, (GLfixed mantissa[16], GLint exponent[16]), (mantissa, exponent), 2, "GLfixed", mantissa, "GLint", exponent)
+TRACE_GL_VOID(glReadBufferNV, (GLenum mode), (mode), 1, "GLenum", mode)
 TRACE_GL_VOID(glReadPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels), (x, y, width, height, format, type, pixels), 7, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height, "GLenum", format, "GLenum", type, "GLvoid *", pixels)
+TRACE_GL_VOID(glReadnPixelsEXT, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data), (x, y, width, height, format, type, bufSize, data), 8, "GLint", x, "GLint", y, "GLsizei", width, "GLsizei", height, "GLenum", format, "GLenum", type, "GLsizei", bufSize, "void *", data)
 TRACE_GL_VOID(glReleaseShaderCompiler, (void), (), 0)
 TRACE_GL_VOID(glRenderbufferStorage, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height), (target, internalformat, width, height), 4, "GLenum", target, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
+TRACE_GL_VOID(glRenderbufferStorageMultisampleANGLE, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
+TRACE_GL_VOID(glRenderbufferStorageMultisampleAPPLE, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
+TRACE_GL_VOID(glRenderbufferStorageMultisampleEXT, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
 TRACE_GL_VOID(glRenderbufferStorageMultisampleIMG, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height), 5, "GLenum", target, "GLsizei", samples, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
 TRACE_GL_VOID(glRenderbufferStorageOES, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height), (target, internalformat, width, height), 4, "GLenum", target, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
+TRACE_GL_VOID(glResolveMultisampleFramebufferAPPLE, (void), (), 0)
 TRACE_GL_VOID(glRotatef, (GLfloat angle, GLfloat x, GLfloat y, GLfloat z), (angle, x, y, z), 4, "GLfloat", angle, "GLfloat", x, "GLfloat", y, "GLfloat", z)
 TRACE_GL_VOID(glRotatex, (GLfixed angle, GLfixed x, GLfixed y, GLfixed z), (angle, x, y, z), 4, "GLfixed", angle, "GLfixed", x, "GLfixed", y, "GLfixed", z)
 TRACE_GL_VOID(glRotatexOES, (GLfixed angle, GLfixed x, GLfixed y, GLfixed z), (angle, x, y, z), 4, "GLfixed", angle, "GLfixed", x, "GLfixed", y, "GLfixed", z)
@@ -335,8 +388,14 @@
 TRACE_GL_VOID(glTexParameterxOES, (GLenum target, GLenum pname, GLfixed param), (target, pname, param), 3, "GLenum", target, "GLenum", pname, "GLfixed", param)
 TRACE_GL_VOID(glTexParameterxv, (GLenum target, GLenum pname, const GLfixed *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfixed *", params)
 TRACE_GL_VOID(glTexParameterxvOES, (GLenum target, GLenum pname, const GLfixed *params), (target, pname, params), 3, "GLenum", target, "GLenum", pname, "const GLfixed *", params)
+TRACE_GL_VOID(glTexStorage1DEXT, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width), (target, levels, internalformat, width), 4, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width)
+TRACE_GL_VOID(glTexStorage2DEXT, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height), (target, levels, internalformat, width, height), 5, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
+TRACE_GL_VOID(glTexStorage3DEXT, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth), (target, levels, internalformat, width, height, depth), 6, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth)
 TRACE_GL_VOID(glTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels), (target, level, xoffset, yoffset, width, height, format, type, pixels), 9, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLsizei", width, "GLsizei", height, "GLenum", format, "GLenum", type, "const GLvoid *", pixels)
 TRACE_GL_VOID(glTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels), 11, "GLenum", target, "GLint", level, "GLint", xoffset, "GLint", yoffset, "GLint", zoffset, "GLsizei", width, "GLsizei", height, "GLsizei", depth, "GLenum", format, "GLenum", type, "const GLvoid*", pixels)
+TRACE_GL_VOID(glTextureStorage1DEXT, (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width), (texture, target, levels, internalformat, width), 5, "GLuint", texture, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width)
+TRACE_GL_VOID(glTextureStorage2DEXT, (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height), (texture, target, levels, internalformat, width, height), 6, "GLuint", texture, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height)
+TRACE_GL_VOID(glTextureStorage3DEXT, (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth), (texture, target, levels, internalformat, width, height, depth), 7, "GLuint", texture, "GLenum", target, "GLsizei", levels, "GLenum", internalformat, "GLsizei", width, "GLsizei", height, "GLsizei", depth)
 TRACE_GL_VOID(glTranslatef, (GLfloat x, GLfloat y, GLfloat z), (x, y, z), 3, "GLfloat", x, "GLfloat", y, "GLfloat", z)
 TRACE_GL_VOID(glTranslatex, (GLfixed x, GLfixed y, GLfixed z), (x, y, z), 3, "GLfixed", x, "GLfixed", y, "GLfixed", z)
 TRACE_GL_VOID(glTranslatexOES, (GLfixed x, GLfixed y, GLfixed z), (x, y, z), 3, "GLfixed", x, "GLfixed", y, "GLfixed", z)
@@ -361,7 +420,9 @@
 TRACE_GL_VOID(glUniformMatrix4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value), (location, count, transpose, value), 4, "GLint", location, "GLsizei", count, "GLboolean", transpose, "const GLfloat*", value)
 TRACE_GL(GLboolean, glUnmapBufferOES, (GLenum target), (target), 1, "GLenum", target)
 TRACE_GL_VOID(glUseProgram, (GLuint program), (program), 1, "GLuint", program)
+TRACE_GL_VOID(glUseProgramStagesEXT, (GLuint pipeline, GLbitfield stages, GLuint program), (pipeline, stages, program), 3, "GLuint", pipeline, "GLbitfield", stages, "GLuint", program)
 TRACE_GL_VOID(glValidateProgram, (GLuint program), (program), 1, "GLuint", program)
+TRACE_GL_VOID(glValidateProgramPipelineEXT, (GLuint pipeline), (pipeline), 1, "GLuint", pipeline)
 TRACE_GL_VOID(glVertexAttrib1f, (GLuint indx, GLfloat x), (indx, x), 2, "GLuint", indx, "GLfloat", x)
 TRACE_GL_VOID(glVertexAttrib1fv, (GLuint indx, const GLfloat* values), (indx, values), 2, "GLuint", indx, "const GLfloat*", values)
 TRACE_GL_VOID(glVertexAttrib2f, (GLuint indx, GLfloat x, GLfloat y), (indx, x, y), 3, "GLuint", indx, "GLfloat", x, "GLfloat", y)
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index f63c0c1..95d651a 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -2,19 +2,22 @@
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES:= \
-    Layer.cpp 								\
-    LayerBase.cpp 							\
-    LayerDim.cpp 							\
-    LayerScreenshot.cpp						\
-    DdmConnection.cpp						\
-    DisplayHardware/DisplayHardware.cpp 	\
+    EventThread.cpp                         \
+    Layer.cpp                               \
+    LayerBase.cpp                           \
+    LayerDim.cpp                            \
+    LayerScreenshot.cpp                     \
+    DdmConnection.cpp                       \
+    DisplayHardware/DisplayHardware.cpp     \
     DisplayHardware/DisplayHardwareBase.cpp \
-    DisplayHardware/HWComposer.cpp 			\
-    GLExtensions.cpp 						\
-    MessageQueue.cpp 						\
-    SurfaceFlinger.cpp 						\
-    SurfaceTextureLayer.cpp 				\
-    Transform.cpp 							\
+    DisplayHardware/HWComposer.cpp          \
+    DisplayHardware/VSyncBarrier.cpp        \
+    DisplayEventConnection.cpp              \
+    GLExtensions.cpp                        \
+    MessageQueue.cpp                        \
+    SurfaceFlinger.cpp                      \
+    SurfaceTextureLayer.cpp                 \
+    Transform.cpp                           \
     
 
 LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\"
diff --git a/services/surfaceflinger/DisplayEventConnection.cpp b/services/surfaceflinger/DisplayEventConnection.cpp
new file mode 100644
index 0000000..77ecbd2
--- /dev/null
+++ b/services/surfaceflinger/DisplayEventConnection.cpp
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2011 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 <stdint.h>
+#include <sys/types.h>
+
+#include <gui/IDisplayEventConnection.h>
+#include <gui/BitTube.h>
+#include <gui/DisplayEventReceiver.h>
+
+#include <utils/Errors.h>
+
+#include "SurfaceFlinger.h"
+#include "DisplayEventConnection.h"
+#include "EventThread.h"
+
+// ---------------------------------------------------------------------------
+
+namespace android {
+
+// ---------------------------------------------------------------------------
+
+DisplayEventConnection::DisplayEventConnection(
+        const sp<EventThread>& eventThread)
+    : mEventThread(eventThread), mChannel(new BitTube())
+{
+}
+
+DisplayEventConnection::~DisplayEventConnection() {
+    mEventThread->unregisterDisplayEventConnection(this);
+}
+
+void DisplayEventConnection::onFirstRef() {
+    // NOTE: mEventThread doesn't hold a strong reference on us
+    mEventThread->registerDisplayEventConnection(this);
+}
+
+sp<BitTube> DisplayEventConnection::getDataChannel() const {
+    return mChannel;
+}
+
+void DisplayEventConnection::setVsyncRate(uint32_t count) {
+    mEventThread->setVsyncRate(count, this);
+}
+
+void DisplayEventConnection::requestNextVsync() {
+    mEventThread->requestNextVsync(this);
+}
+
+status_t DisplayEventConnection::postEvent(const DisplayEventReceiver::Event& event)
+{
+    ssize_t size = mChannel->write(&event, sizeof(DisplayEventReceiver::Event));
+    return size < 0 ? status_t(size) : status_t(NO_ERROR);
+}
+
+// ---------------------------------------------------------------------------
+
+}; // namespace android
diff --git a/services/surfaceflinger/DisplayEventConnection.h b/services/surfaceflinger/DisplayEventConnection.h
new file mode 100644
index 0000000..cc3ee36
--- /dev/null
+++ b/services/surfaceflinger/DisplayEventConnection.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#ifndef ANDROID_SURFACE_FLINGER_DISPLAY_EVENT_CONNECTION_H
+#define ANDROID_SURFACE_FLINGER_DISPLAY_EVENT_CONNECTION_H
+
+#include <stdint.h>
+#include <sys/types.h>
+
+#include <gui/IDisplayEventConnection.h>
+
+#include <utils/Errors.h>
+#include <gui/DisplayEventReceiver.h>
+
+// ---------------------------------------------------------------------------
+
+namespace android {
+
+// ---------------------------------------------------------------------------
+
+class BitTube;
+class EventThread;
+
+// ---------------------------------------------------------------------------
+
+class DisplayEventConnection : public BnDisplayEventConnection {
+public:
+    DisplayEventConnection(const sp<EventThread>& flinger);
+
+    status_t postEvent(const DisplayEventReceiver::Event& event);
+
+private:
+    virtual ~DisplayEventConnection();
+    virtual void onFirstRef();
+    virtual sp<BitTube> getDataChannel() const;
+    virtual void setVsyncRate(uint32_t count);
+    virtual void requestNextVsync();    // asynchronous
+
+    sp<EventThread> const mEventThread;
+    sp<BitTube> const mChannel;
+};
+
+// ---------------------------------------------------------------------------
+
+}; // namespace android
+
+// ---------------------------------------------------------------------------
+
+#endif /* ANDROID_SURFACE_FLINGER_DISPLAY_EVENT_CONNECTION_H */
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
index 61096e5..986aec5 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
+++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
@@ -140,6 +140,7 @@
     mDpiX = mNativeWindow->xdpi;
     mDpiY = mNativeWindow->ydpi;
     mRefreshRate = fbDev->fps;
+    mNextFakeVSync = 0;
 
 
 /* FIXME: this is a temporary HACK until we are able to report the refresh rate
@@ -152,6 +153,8 @@
 #warning "refresh rate set via makefile to REFRESH_RATE"
 #endif
 
+    mRefreshPeriod = nsecs_t(1e9 / mRefreshRate);
+
     EGLint w, h, dummy;
     EGLint numConfigs=0;
     EGLSurface surface;
@@ -346,12 +349,52 @@
     return mPageFlipCount;
 }
 
-status_t DisplayHardware::compositionComplete() const {
-    return mNativeWindow->compositionComplete();
+// this needs to be thread safe
+nsecs_t DisplayHardware::waitForRefresh() const {
+    nsecs_t timestamp;
+    if (mVSync.wait(&timestamp) < 0) {
+        // vsync not supported!
+        usleep( getDelayToNextVSyncUs(&timestamp) );
+    }
+    mLastHwVSync = timestamp; // FIXME: Not thread safe
+    return timestamp;
 }
 
-int DisplayHardware::getCurrentBufferIndex() const {
-    return mNativeWindow->getCurrentBufferIndex();
+nsecs_t DisplayHardware::getRefreshTimestamp() const {
+    // this returns the last refresh timestamp.
+    // if the last one is not available, we estimate it based on
+    // the refresh period and whatever closest timestamp we have.
+    nsecs_t now = systemTime();
+    return now - ((now - mLastHwVSync) %  mRefreshPeriod);
+}
+
+nsecs_t DisplayHardware::getRefreshPeriod() const {
+    return mRefreshPeriod;
+}
+
+int32_t DisplayHardware::getDelayToNextVSyncUs(nsecs_t* timestamp) const {
+    Mutex::Autolock _l(mFakeVSyncMutex);
+    const nsecs_t period = mRefreshPeriod;
+    const nsecs_t now = systemTime(CLOCK_MONOTONIC);
+    nsecs_t next_vsync = mNextFakeVSync;
+    nsecs_t sleep = next_vsync - now;
+    if (sleep < 0) {
+        // we missed, find where the next vsync should be
+        sleep = (period - ((now - next_vsync) % period));
+        next_vsync = now + sleep;
+    }
+    mNextFakeVSync = next_vsync + period;
+    timestamp[0] = next_vsync;
+
+    // round to next microsecond
+    int32_t sleep_us = (sleep + 999LL) / 1000LL;
+
+    // guaranteed to be > 0
+    return sleep_us;
+}
+
+status_t DisplayHardware::compositionComplete() const {
+    return mNativeWindow->compositionComplete();
 }
 
 void DisplayHardware::flip(const Region& dirty) const
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.h b/services/surfaceflinger/DisplayHardware/DisplayHardware.h
index f02c954..02be4dc 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardware.h
+++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.h
@@ -32,6 +32,7 @@
 #include "GLExtensions.h"
 
 #include "DisplayHardware/DisplayHardwareBase.h"
+#include "DisplayHardware/VSyncBarrier.h"
 
 namespace android {
 
@@ -74,6 +75,11 @@
     uint32_t    getMaxTextureSize() const;
     uint32_t    getMaxViewportDims() const;
 
+    // waits for the next vsync and returns the timestamp of when it happened
+    nsecs_t     waitForRefresh() const;
+    nsecs_t     getRefreshPeriod() const;
+    nsecs_t     getRefreshTimestamp() const;
+
     uint32_t getPageFlipCount() const;
     EGLDisplay getEGLDisplay() const { return mDisplay; }
 
@@ -89,12 +95,10 @@
     }
     inline Rect bounds() const { return getBounds(); }
 
-    // only for debugging
-    int getCurrentBufferIndex() const;
-
 private:
     void init(uint32_t displayIndex) __attribute__((noinline));
     void fini() __attribute__((noinline));
+    int32_t getDelayToNextVSyncUs(nsecs_t* timestamp) const;
 
     sp<SurfaceFlinger> mFlinger;
     EGLDisplay      mDisplay;
@@ -112,7 +116,13 @@
     mutable uint32_t mPageFlipCount;
     GLint           mMaxViewportDims[2];
     GLint           mMaxTextureSize;
-    
+    VSyncBarrier    mVSync;
+
+    mutable Mutex   mFakeVSyncMutex;
+    mutable nsecs_t mNextFakeVSync;
+    nsecs_t         mRefreshPeriod;
+    mutable nsecs_t mLastHwVSync;
+
     HWComposer*     mHwc;
 
     sp<FramebufferNativeWindow> mNativeWindow;
diff --git a/services/surfaceflinger/DisplayHardware/VSyncBarrier.cpp b/services/surfaceflinger/DisplayHardware/VSyncBarrier.cpp
new file mode 100644
index 0000000..187da20
--- /dev/null
+++ b/services/surfaceflinger/DisplayHardware/VSyncBarrier.cpp
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2011 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 <stdint.h>
+#include <sys/types.h>
+
+#include <utils/Errors.h>
+
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <linux/fb.h>
+
+#include "DisplayHardware/VSyncBarrier.h"
+
+#ifndef FBIO_WAITFORVSYNC
+#define FBIO_WAITFORVSYNC   _IOW('F', 0x20, __u32)
+#endif
+
+namespace android {
+// ---------------------------------------------------------------------------
+
+VSyncBarrier::VSyncBarrier() : mFd(-EINVAL) {
+#if HAS_WAITFORVSYNC
+    mFd = open("/dev/graphics/fb0", O_RDWR);
+    if (mFd < 0) {
+        mFd = -errno;
+    }
+    // try to see if FBIO_WAITFORVSYNC is supported
+    uint32_t crt = 0;
+    int err = ioctl(mFd, FBIO_WAITFORVSYNC, &crt);
+    if (err < 0) {
+        close(mFd);
+        mFd = -EINVAL;
+    }
+#endif
+}
+
+VSyncBarrier::~VSyncBarrier() {
+    if (mFd >= 0) {
+        close(mFd);
+    }
+}
+
+status_t VSyncBarrier::initCheck() const {
+    return mFd < 0 ? mFd : status_t(NO_ERROR);
+}
+
+// this must be thread-safe
+status_t VSyncBarrier::wait(nsecs_t* timestamp) const {
+    if (mFd < 0) {
+        return mFd;
+    }
+
+    int err;
+    uint32_t crt = 0;
+    do {
+        err = ioctl(mFd, FBIO_WAITFORVSYNC, &crt);
+    } while (err<0 && errno==EINTR);
+    if (err < 0) {
+        return -errno;
+    }
+    // ideally this would come from the driver
+    timestamp[0] = systemTime();
+    return NO_ERROR;
+}
+
+// ---------------------------------------------------------------------------
+}; // namespace android
diff --git a/services/surfaceflinger/DisplayHardware/VSyncBarrier.h b/services/surfaceflinger/DisplayHardware/VSyncBarrier.h
new file mode 100644
index 0000000..3c32950
--- /dev/null
+++ b/services/surfaceflinger/DisplayHardware/VSyncBarrier.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#ifndef ANDROID_SURFACE_FLINGER_VSYNCBARRIER_H_
+#define ANDROID_SURFACE_FLINGER_VSYNCBARRIER_H_
+
+#include <stdint.h>
+#include <sys/types.h>
+
+#include <utils/Errors.h>
+#include <utils/Timers.h>
+
+namespace android {
+// ---------------------------------------------------------------------------
+
+class VSyncBarrier {
+    int mFd;
+public:
+    VSyncBarrier();
+    ~VSyncBarrier();
+    status_t initCheck() const;
+    status_t wait(nsecs_t* timestamp) const;
+};
+
+// ---------------------------------------------------------------------------
+}; // namespace android
+
+#endif /* ANDROID_SURFACE_FLINGER_VSYNCBARRIER_H_ */
diff --git a/services/surfaceflinger/EventThread.cpp b/services/surfaceflinger/EventThread.cpp
new file mode 100644
index 0000000..6796d7d
--- /dev/null
+++ b/services/surfaceflinger/EventThread.cpp
@@ -0,0 +1,218 @@
+/*
+ * Copyright (C) 2011 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 <stdint.h>
+#include <sys/types.h>
+
+#include <gui/IDisplayEventConnection.h>
+#include <gui/DisplayEventReceiver.h>
+
+#include <utils/Errors.h>
+
+#include "DisplayHardware/DisplayHardware.h"
+#include "DisplayEventConnection.h"
+#include "EventThread.h"
+#include "SurfaceFlinger.h"
+
+// ---------------------------------------------------------------------------
+
+namespace android {
+
+// ---------------------------------------------------------------------------
+
+EventThread::EventThread(const sp<SurfaceFlinger>& flinger)
+    : mFlinger(flinger),
+      mHw(flinger->graphicPlane(0).displayHardware()),
+      mDeliveredEvents(0)
+{
+}
+
+void EventThread::onFirstRef() {
+    run("EventThread", PRIORITY_URGENT_DISPLAY + PRIORITY_MORE_FAVORABLE);
+}
+
+status_t EventThread::registerDisplayEventConnection(
+        const sp<DisplayEventConnection>& connection) {
+    Mutex::Autolock _l(mLock);
+    ConnectionInfo info;
+    mDisplayEventConnections.add(connection, info);
+    mCondition.signal();
+    return NO_ERROR;
+}
+
+status_t EventThread::unregisterDisplayEventConnection(
+        const wp<DisplayEventConnection>& connection) {
+    Mutex::Autolock _l(mLock);
+    mDisplayEventConnections.removeItem(connection);
+    mCondition.signal();
+    return NO_ERROR;
+}
+
+void EventThread::removeDisplayEventConnection(
+        const wp<DisplayEventConnection>& connection) {
+    Mutex::Autolock _l(mLock);
+    mDisplayEventConnections.removeItem(connection);
+}
+
+EventThread::ConnectionInfo* EventThread::getConnectionInfoLocked(
+        const wp<DisplayEventConnection>& connection) {
+    ssize_t index = mDisplayEventConnections.indexOfKey(connection);
+    if (index < 0) return NULL;
+    return &mDisplayEventConnections.editValueAt(index);
+}
+
+void EventThread::setVsyncRate(uint32_t count,
+        const wp<DisplayEventConnection>& connection) {
+    if (int32_t(count) >= 0) { // server must protect against bad params
+        Mutex::Autolock _l(mLock);
+        ConnectionInfo* info = getConnectionInfoLocked(connection);
+        if (info) {
+            info->count = (count == 0) ? -1 : count;
+            mCondition.signal();
+        }
+    }
+}
+
+void EventThread::requestNextVsync(
+        const wp<DisplayEventConnection>& connection) {
+    Mutex::Autolock _l(mLock);
+    ConnectionInfo* info = getConnectionInfoLocked(connection);
+    if (info) {
+        if (info->count < 0) {
+            info->count = 0;
+        }
+        mCondition.signal();
+    }
+}
+
+bool EventThread::threadLoop() {
+
+    nsecs_t timestamp;
+    DisplayEventReceiver::Event vsync;
+    Vector< wp<DisplayEventConnection> > displayEventConnections;
+
+    { // scope for the lock
+        Mutex::Autolock _l(mLock);
+        do {
+            // see if we need to wait for the VSYNC at all
+            do {
+                bool waitForNextVsync = false;
+                size_t count = mDisplayEventConnections.size();
+                for (size_t i=0 ; i<count ; i++) {
+                    const ConnectionInfo& info(
+                            mDisplayEventConnections.valueAt(i));
+                    if (info.count >= 0) {
+                        // at least one continuous mode or active one-shot event
+                        waitForNextVsync = true;
+                        break;
+                    }
+                }
+
+                if (waitForNextVsync)
+                    break;
+
+                mCondition.wait(mLock);
+            } while(true);
+
+            // at least one listener requested VSYNC
+            mLock.unlock();
+            timestamp = mHw.waitForRefresh();
+            mLock.lock();
+            mDeliveredEvents++;
+
+            // now see if we still need to report this VSYNC event
+            bool reportVsync = false;
+            size_t count = mDisplayEventConnections.size();
+            for (size_t i=0 ; i<count ; i++) {
+                const ConnectionInfo& info(
+                        mDisplayEventConnections.valueAt(i));
+                if (info.count >= 1) {
+                    if (info.count==1 || (mDeliveredEvents % info.count) == 0) {
+                        // continuous event, and time to report it
+                        reportVsync = true;
+                    }
+                } else if (info.count >= -1) {
+                    ConnectionInfo& info(
+                            mDisplayEventConnections.editValueAt(i));
+                    if (info.count == 0) {
+                        // fired this time around
+                        reportVsync = true;
+                    }
+                    info.count--;
+                }
+                if (reportVsync) {
+                    displayEventConnections.add(mDisplayEventConnections.keyAt(i));
+                }
+            }
+
+            if (reportVsync) {
+                break;
+            }
+        } while (true);
+
+        // dispatch vsync events to listeners...
+        vsync.header.type = DisplayEventReceiver::DISPLAY_EVENT_VSYNC;
+        vsync.header.timestamp = timestamp;
+        vsync.vsync.count = mDeliveredEvents;
+    }
+
+    const size_t count = displayEventConnections.size();
+    for (size_t i=0 ; i<count ; i++) {
+        sp<DisplayEventConnection> conn(displayEventConnections[i].promote());
+        // make sure the connection didn't die
+        if (conn != NULL) {
+            status_t err = conn->postEvent(vsync);
+            if (err == -EAGAIN || err == -EWOULDBLOCK) {
+                // The destination doesn't accept events anymore, it's probably
+                // full. For now, we just drop the events on the floor.
+                // Note that some events cannot be dropped and would have to be
+                // re-sent later. Right-now we don't have the ability to do
+                // this, but it doesn't matter for VSYNC.
+            } else if (err < 0) {
+                // handle any other error on the pipe as fatal. the only
+                // reasonable thing to do is to clean-up this connection.
+                // The most common error we'll get here is -EPIPE.
+                removeDisplayEventConnection(displayEventConnections[i]);
+            }
+        } else {
+            // somehow the connection is dead, but we still have it in our list
+            // just clean the list.
+            removeDisplayEventConnection(displayEventConnections[i]);
+        }
+    }
+
+    // clear all our references without holding mLock
+    displayEventConnections.clear();
+
+    return true;
+}
+
+status_t EventThread::readyToRun() {
+    ALOGI("EventThread ready to run.");
+    return NO_ERROR;
+}
+
+void EventThread::dump(String8& result, char* buffer, size_t SIZE) const {
+    Mutex::Autolock _l(mLock);
+    result.append("VSYNC state:\n");
+    snprintf(buffer, SIZE, "  numListeners=%u, events-delivered: %u\n",
+            mDisplayEventConnections.size(), mDeliveredEvents);
+    result.append(buffer);
+}
+
+// ---------------------------------------------------------------------------
+
+}; // namespace android
diff --git a/services/surfaceflinger/EventThread.h b/services/surfaceflinger/EventThread.h
new file mode 100644
index 0000000..35bd299
--- /dev/null
+++ b/services/surfaceflinger/EventThread.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#ifndef ANDROID_SURFACE_FLINGER_EVENT_THREAD_H
+#define ANDROID_SURFACE_FLINGER_EVENT_THREAD_H
+
+#include <stdint.h>
+#include <sys/types.h>
+
+#include <gui/IDisplayEventConnection.h>
+
+#include <utils/Errors.h>
+#include <utils/threads.h>
+#include <utils/KeyedVector.h>
+
+#include "DisplayEventConnection.h"
+
+// ---------------------------------------------------------------------------
+
+namespace android {
+
+// ---------------------------------------------------------------------------
+
+class SurfaceFlinger;
+class DisplayHardware;
+
+// ---------------------------------------------------------------------------
+
+class EventThread : public Thread {
+    friend class DisplayEventConnection;
+
+public:
+    EventThread(const sp<SurfaceFlinger>& flinger);
+
+    status_t registerDisplayEventConnection(
+            const sp<DisplayEventConnection>& connection);
+
+    status_t unregisterDisplayEventConnection(
+            const wp<DisplayEventConnection>& connection);
+
+    void setVsyncRate(uint32_t count,
+            const wp<DisplayEventConnection>& connection);
+
+    void requestNextVsync(const wp<DisplayEventConnection>& connection);
+
+    void dump(String8& result, char* buffer, size_t SIZE) const;
+
+private:
+    virtual bool        threadLoop();
+    virtual status_t    readyToRun();
+    virtual void        onFirstRef();
+
+    struct ConnectionInfo {
+        ConnectionInfo() : count(-1) { }
+
+        // count >= 1 : continuous event. count is the vsync rate
+        // count == 0 : one-shot event that has not fired
+        // count ==-1 : one-shot event that fired this round / disabled
+        // count ==-2 : one-shot event that fired the round before
+        int32_t count;
+    };
+
+    void removeDisplayEventConnection(
+            const wp<DisplayEventConnection>& connection);
+
+    ConnectionInfo* getConnectionInfoLocked(
+            const wp<DisplayEventConnection>& connection);
+
+    // constants
+    sp<SurfaceFlinger> mFlinger;
+    const DisplayHardware& mHw;
+
+    mutable Mutex mLock;
+    mutable Condition mCondition;
+
+    // protected by mLock
+    KeyedVector< wp<DisplayEventConnection>, ConnectionInfo > mDisplayEventConnections;
+
+    // main thread only
+    size_t mDeliveredEvents;
+};
+
+// ---------------------------------------------------------------------------
+
+}; // namespace android
+
+// ---------------------------------------------------------------------------
+
+#endif /* ANDROID_SURFACE_FLINGER_EVENT_THREAD_H */
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index d4c4b1f..8e87b88 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -38,6 +38,7 @@
 #include "Layer.h"
 #include "SurfaceFlinger.h"
 #include "SurfaceTextureLayer.h"
+#include <math.h>
 
 #define DEBUG_RESIZE    0
 
@@ -54,6 +55,8 @@
         mCurrentTransform(0),
         mCurrentScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
         mCurrentOpacity(true),
+        mFrameLatencyNeeded(false),
+        mFrameLatencyOffset(0),
         mFormat(PIXEL_FORMAT_NONE),
         mGLExtensions(GLExtensions::getInstance()),
         mOpaqueLayer(true),
@@ -65,6 +68,17 @@
     glGenTextures(1, &mTextureName);
 }
 
+void Layer::onLayerDisplayed() {
+    if (mFrameLatencyNeeded) {
+        const DisplayHardware& hw(graphicPlane(0).displayHardware());
+        mFrameStats[mFrameLatencyOffset].timestamp = mSurfaceTexture->getTimestamp();
+        mFrameStats[mFrameLatencyOffset].set = systemTime();
+        mFrameStats[mFrameLatencyOffset].vsync = hw.getRefreshTimestamp();
+        mFrameLatencyOffset = (mFrameLatencyOffset + 1) % 128;
+        mFrameLatencyNeeded = false;
+    }
+}
+
 void Layer::onFirstRef()
 {
     LayerBaseClient::onFirstRef();
@@ -408,6 +422,7 @@
 
         // update the active buffer
         mActiveBuffer = mSurfaceTexture->getCurrentBuffer();
+        mFrameLatencyNeeded = true;
 
         const Rect crop(mSurfaceTexture->getCurrentCrop());
         const uint32_t transform(mSurfaceTexture->getCurrentTransform());
@@ -543,6 +558,32 @@
     }
 }
 
+void Layer::dumpStats(String8& result, char* buffer, size_t SIZE) const
+{
+    LayerBaseClient::dumpStats(result, buffer, SIZE);
+    const size_t o = mFrameLatencyOffset;
+    const DisplayHardware& hw(graphicPlane(0).displayHardware());
+    const nsecs_t period = hw.getRefreshPeriod();
+    result.appendFormat("%lld\n", period);
+    for (size_t i=0 ; i<128 ; i++) {
+        const size_t index = (o+i) % 128;
+        const nsecs_t time_app   = mFrameStats[index].timestamp;
+        const nsecs_t time_set   = mFrameStats[index].set;
+        const nsecs_t time_vsync = mFrameStats[index].vsync;
+        result.appendFormat("%lld\t%lld\t%lld\n",
+                time_app,
+                time_vsync,
+                time_set);
+    }
+    result.append("\n");
+}
+
+void Layer::clearStats()
+{
+    LayerBaseClient::clearStats();
+    memset(mFrameStats, 0, sizeof(mFrameStats));
+}
+
 uint32_t Layer::getEffectiveUsage(uint32_t usage) const
 {
     // TODO: should we do something special if mSecure is set?
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 2b9471b..2dd4da1 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -34,6 +34,7 @@
 #include "LayerBase.h"
 #include "SurfaceTextureLayer.h"
 #include "Transform.h"
+#include <utils/Timers.h>
 
 namespace android {
 
@@ -78,12 +79,16 @@
     // LayerBaseClient interface
     virtual wp<IBinder> getSurfaceTextureBinder() const;
 
+    virtual void onLayerDisplayed();
+
     // only for debugging
     inline const sp<GraphicBuffer>& getActiveBuffer() const { return mActiveBuffer; }
 
 protected:
     virtual void onFirstRef();
     virtual void dump(String8& result, char* scratch, size_t size) const;
+    virtual void dumpStats(String8& result, char* buffer, size_t SIZE) const;
+    virtual void clearStats();
 
 private:
     friend class SurfaceTextureLayer;
@@ -110,6 +115,16 @@
     uint32_t mCurrentTransform;
     uint32_t mCurrentScalingMode;
     bool mCurrentOpacity;
+    bool mFrameLatencyNeeded;
+    int mFrameLatencyOffset;
+    struct Statistics {
+        Statistics() : timestamp(0), set(0), vsync(0) { }
+        nsecs_t timestamp;  // buffer timestamp
+        nsecs_t set;        // buffer displayed timestamp
+        nsecs_t vsync;      // vsync immediately before set
+    };
+    // protected by mLock
+    Statistics mFrameStats[128];
 
     // constants
     PixelFormat mFormat;
@@ -121,9 +136,6 @@
     bool mSecure;         // no screenshots
     bool mProtectedByApp; // application requires protected path to external sink
     Region mPostedDirtyRegion;
-
-    // binder thread, transaction thread
-    mutable Mutex mLock;
 };
 
 // ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp
index f04add1..d32fcdd 100644
--- a/services/surfaceflinger/LayerBase.cpp
+++ b/services/surfaceflinger/LayerBase.cpp
@@ -240,7 +240,7 @@
     for (size_t i=0 ; i<4 ; i++)
         mVertices[i][1] = hw_h - mVertices[i][1];
 
-    if (UNLIKELY(transformed)) {
+    if (CC_UNLIKELY(transformed)) {
         // NOTE: here we could also punt if we have too many rectangles
         // in the transparent region
         if (tr.preserveRects()) {
@@ -416,7 +416,7 @@
     const State& s(drawingState());
 
     GLenum src = mPremultipliedAlpha ? GL_ONE : GL_SRC_ALPHA;
-    if (UNLIKELY(s.alpha < 0xFF)) {
+    if (CC_UNLIKELY(s.alpha < 0xFF)) {
         const GLfloat alpha = s.alpha * (1.0f/255.0f);
         if (mPremultipliedAlpha) {
             glColor4f(alpha, alpha, alpha, alpha);
@@ -471,6 +471,9 @@
 void LayerBase::dump(String8& result, char* buffer, size_t SIZE) const
 {
     const Layer::State& s(drawingState());
+    s.transparentRegion.dump(result, "transparentRegion");
+    transparentRegionScreen.dump(result, "transparentRegionScreen");
+    visibleRegionScreen.dump(result, "visibleRegionScreen");
     snprintf(buffer, SIZE,
             "+ %s %p (%s)\n"
             "      "
@@ -486,11 +489,15 @@
     result.append(buffer);
 }
 
-void LayerBase::shortDump(String8& result, char* scratch, size_t size) const
-{
+void LayerBase::shortDump(String8& result, char* scratch, size_t size) const {
     LayerBase::dump(result, scratch, size);
 }
 
+void LayerBase::dumpStats(String8& result, char* scratch, size_t SIZE) const {
+}
+
+void LayerBase::clearStats() {
+}
 
 // ---------------------------------------------------------------------------
 
diff --git a/services/surfaceflinger/LayerBase.h b/services/surfaceflinger/LayerBase.h
index 7f62145..6b62c9d 100644
--- a/services/surfaceflinger/LayerBase.h
+++ b/services/surfaceflinger/LayerBase.h
@@ -205,10 +205,14 @@
     /** called with the state lock when the surface is removed from the
      *  current list */
     virtual void onRemoved() { };
-    
+
+    virtual void onLayerDisplayed() { };
+
     /** always call base class first */
     virtual void dump(String8& result, char* scratch, size_t size) const;
     virtual void shortDump(String8& result, char* scratch, size_t size) const;
+    virtual void dumpStats(String8& result, char* buffer, size_t SIZE) const;
+    virtual void clearStats();
 
 
     enum { // flags for doTransaction()
diff --git a/services/surfaceflinger/MessageQueue.cpp b/services/surfaceflinger/MessageQueue.cpp
index 9441019..cbd530c 100644
--- a/services/surfaceflinger/MessageQueue.cpp
+++ b/services/surfaceflinger/MessageQueue.cpp
@@ -29,167 +29,75 @@
 
 // ---------------------------------------------------------------------------
 
-void MessageList::insert(const sp<MessageBase>& node) 
-{
-    LIST::iterator cur(mList.begin());
-    LIST::iterator end(mList.end());
-    while (cur != end) {
-        if (*node < **cur) {
-            mList.insert(cur, node);
-            return;
-        }
-        ++cur;
-    }
-    mList.insert(++end, node);
+MessageBase::MessageBase()
+    : MessageHandler() {
 }
 
-void MessageList::remove(MessageList::LIST::iterator pos) 
-{
-    mList.erase(pos);
+MessageBase::~MessageBase() {
 }
 
+void MessageBase::handleMessage(const Message&) {
+    this->handler();
+    barrier.open();
+};
+
 // ---------------------------------------------------------------------------
 
 MessageQueue::MessageQueue()
-    : mInvalidate(false)
-{
-    mInvalidateMessage = new MessageBase(INVALIDATE);
-}
-
-MessageQueue::~MessageQueue()
+    : mLooper(new Looper(true)), mWorkPending(0)
 {
 }
 
-sp<MessageBase> MessageQueue::waitMessage(nsecs_t timeout)
-{
-    sp<MessageBase> result;
+MessageQueue::~MessageQueue() {
+}
 
-    bool again;
+void MessageQueue::waitMessage() {
     do {
-        const nsecs_t timeoutTime = systemTime() + timeout;
-        while (true) {
-            Mutex::Autolock _l(mLock);
-            nsecs_t now = systemTime();
-            nsecs_t nextEventTime = -1;
+        IPCThreadState::self()->flushCommands();
 
-            LIST::iterator cur(mMessages.begin());
-            if (cur != mMessages.end()) {
-                result = *cur;
-            }
-            
-            if (result != 0) {
-                if (result->when <= now) {
-                    // there is a message to deliver
-                    mMessages.remove(cur);
-                    break;
+        int32_t ret = mLooper->pollOnce(-1);
+        switch (ret) {
+            case ALOOPER_POLL_WAKE:
+            case ALOOPER_POLL_CALLBACK:
+                // callback and/or wake
+                if (android_atomic_and(0, &mWorkPending)) {
+                    return;
                 }
-                nextEventTime = result->when;
-                result = 0;
-            }
+                continue;
 
-            // see if we have an invalidate message
-            if (mInvalidate) {
-                mInvalidate = false;
-                mInvalidateMessage->when = now;
-                result = mInvalidateMessage;
-                break;
-            }
+            case ALOOPER_POLL_TIMEOUT:
+                // timeout (should not happen)
+                continue;
 
-            if (timeout >= 0) {
-                if (timeoutTime < now) {
-                    // we timed-out, return a NULL message
-                    result = 0;
-                    break;
-                }
-                if (nextEventTime > 0) {
-                    if (nextEventTime > timeoutTime) {
-                        nextEventTime = timeoutTime;
-                    }
-                } else {
-                    nextEventTime = timeoutTime;
-                }
-            }
+            case ALOOPER_POLL_ERROR:
+                ALOGE("ALOOPER_POLL_ERROR");
+                continue;
 
-            if (nextEventTime >= 0) {
-                //ALOGD("nextEventTime = %lld ms", nextEventTime);
-                if (nextEventTime > 0) {
-                    // we're about to wait, flush the binder command buffer
-                    IPCThreadState::self()->flushCommands();
-                    const nsecs_t reltime = nextEventTime - systemTime();
-                    if (reltime > 0) {
-                        mCondition.waitRelative(mLock, reltime);
-                    }
-                }
-            } else {
-                //ALOGD("going to wait");
-                // we're about to wait, flush the binder command buffer
-                IPCThreadState::self()->flushCommands();
-                mCondition.wait(mLock);
-            }
-        } 
-        // here we're not holding the lock anymore
-
-        if (result == 0)
-            break;
-
-        again = result->handler();
-        if (again) {
-            // the message has been processed. release our reference to it
-            // without holding the lock.
-            result->notify();
-            result = 0;
+            default:
+                // should not happen
+                ALOGE("Looper::pollOnce() returned unknown status %d", ret);
+                continue;
         }
-        
-    } while (again);
-
-    return result;
+    } while (true);
 }
 
 status_t MessageQueue::postMessage(
-        const sp<MessageBase>& message, nsecs_t relTime, uint32_t flags)
+        const sp<MessageBase>& messageHandler, nsecs_t relTime)
 {
-    return queueMessage(message, relTime, flags);
+    const Message dummyMessage;
+    if (relTime > 0) {
+        mLooper->sendMessageDelayed(relTime, messageHandler, dummyMessage);
+    } else {
+        mLooper->sendMessage(messageHandler, dummyMessage);
+    }
+    return NO_ERROR;
 }
 
 status_t MessageQueue::invalidate() {
-    Mutex::Autolock _l(mLock);
-    mInvalidate = true;
-    mCondition.signal();
-    return NO_ERROR;
-}
-
-status_t MessageQueue::queueMessage(
-        const sp<MessageBase>& message, nsecs_t relTime, uint32_t flags)
-{
-    Mutex::Autolock _l(mLock);
-    message->when = systemTime() + relTime;
-    mMessages.insert(message);
-    
-    //ALOGD("MessageQueue::queueMessage time = %lld ms", message->when);
-    //dumpLocked(message);
-
-    mCondition.signal();
-    return NO_ERROR;
-}
-
-void MessageQueue::dump(const sp<MessageBase>& message)
-{
-    Mutex::Autolock _l(mLock);
-    dumpLocked(message);
-}
-
-void MessageQueue::dumpLocked(const sp<MessageBase>& message)
-{
-    LIST::const_iterator cur(mMessages.begin());
-    LIST::const_iterator end(mMessages.end());
-    int c = 0;
-    while (cur != end) {
-        const char tick = (*cur == message) ? '>' : ' ';
-        ALOGD("%c %d: msg{.what=%08x, when=%lld}",
-                tick, c, (*cur)->what, (*cur)->when);
-        ++cur;
-        c++;
+    if (android_atomic_or(1, &mWorkPending) == 0) {
+        mLooper->wake();
     }
+    return NO_ERROR;
 }
 
 // ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/MessageQueue.h b/services/surfaceflinger/MessageQueue.h
index 890f809..2317d81 100644
--- a/services/surfaceflinger/MessageQueue.h
+++ b/services/surfaceflinger/MessageQueue.h
@@ -23,7 +23,7 @@
 
 #include <utils/threads.h>
 #include <utils/Timers.h>
-#include <utils/List.h>
+#include <utils/Looper.h>
 
 #include "Barrier.h"
 
@@ -31,92 +31,39 @@
 
 // ---------------------------------------------------------------------------
 
-class MessageBase;
-
-class MessageList 
-{
-    List< sp<MessageBase> > mList;
-    typedef List< sp<MessageBase> > LIST;
-public:
-    inline LIST::iterator begin()                { return mList.begin(); }
-    inline LIST::const_iterator begin() const    { return mList.begin(); }
-    inline LIST::iterator end()                  { return mList.end(); }
-    inline LIST::const_iterator end() const      { return mList.end(); }
-    inline bool isEmpty() const { return mList.empty(); }
-    void insert(const sp<MessageBase>& node);
-    void remove(LIST::iterator pos);
-};
-
-// ============================================================================
-
-class MessageBase : 
-    public LightRefBase<MessageBase>
+class MessageBase : public MessageHandler
 {
 public:
-    nsecs_t     when;
-    uint32_t    what;
-    int32_t     arg0;    
-
-    MessageBase() : when(0), what(0), arg0(0) { }
-    MessageBase(uint32_t what, int32_t arg0=0)
-        : when(0), what(what), arg0(arg0) { }
+    MessageBase();
     
     // return true if message has a handler
-    virtual bool handler() { return false; }
+    virtual bool handler() = 0;
 
     // waits for the handler to be processed
     void wait() const { barrier.wait(); }
-    
-    // releases all waiters. this is done automatically if
-    // handler returns true
-    void notify() const { barrier.open(); }
 
 protected:
-    virtual ~MessageBase() { }
+    virtual ~MessageBase();
 
 private:
-    mutable Barrier barrier;
-    friend class LightRefBase<MessageBase>;
-};
+    virtual void handleMessage(const Message& message);
 
-inline bool operator < (const MessageBase& lhs, const MessageBase& rhs) {
-    return lhs.when < rhs.when;
-}
+    mutable Barrier barrier;
+};
 
 // ---------------------------------------------------------------------------
 
-class MessageQueue
-{
-    typedef List< sp<MessageBase> > LIST;
-public:
+class MessageQueue {
+    sp<Looper> mLooper;
+    volatile int32_t mWorkPending;
 
+public:
     MessageQueue();
     ~MessageQueue();
 
-    // pre-defined messages
-    enum {
-        INVALIDATE = '_upd'
-    };
-
-    sp<MessageBase> waitMessage(nsecs_t timeout = -1);
-    
-    status_t postMessage(const sp<MessageBase>& message,
-            nsecs_t reltime=0, uint32_t flags = 0);
-
+    void waitMessage();
+    status_t postMessage(const sp<MessageBase>& message, nsecs_t reltime=0);
     status_t invalidate();
-    
-    void dump(const sp<MessageBase>& message);
-
-private:
-    status_t queueMessage(const sp<MessageBase>& message,
-            nsecs_t reltime, uint32_t flags);
-    void dumpLocked(const sp<MessageBase>& message);
-    
-    Mutex           mLock;
-    Condition       mCondition;
-    MessageList     mMessages;
-    bool            mInvalidate;
-    sp<MessageBase> mInvalidateMessage;
 };
 
 // ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 98277b4..887aee7 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -34,18 +34,21 @@
 #include <binder/MemoryHeapBase.h>
 #include <binder/PermissionCache.h>
 
+#include <gui/IDisplayEventConnection.h>
+
 #include <utils/String8.h>
 #include <utils/String16.h>
 #include <utils/StopWatch.h>
 
 #include <ui/GraphicBufferAllocator.h>
-#include <ui/GraphicLog.h>
 #include <ui/PixelFormat.h>
 
 #include <pixelflinger/pixelflinger.h>
 #include <GLES/gl.h>
 
 #include "clz.h"
+#include "DisplayEventConnection.h"
+#include "EventThread.h"
 #include "GLExtensions.h"
 #include "DdmConnection.h"
 #include "Layer.h"
@@ -56,15 +59,9 @@
 #include "DisplayHardware/DisplayHardware.h"
 #include "DisplayHardware/HWComposer.h"
 
+#include <private/android_filesystem_config.h>
 #include <private/surfaceflinger/SharedBufferStack.h>
 
-/* ideally AID_GRAPHICS would be in a semi-public header
- * or there would be a way to map a user/group name to its id
- */
-#ifndef AID_GRAPHICS
-#define AID_GRAPHICS 1003
-#endif
-
 #define EGL_VERSION_HW_ANDROID  0x3143
 
 #define DISPLAY_COUNT       1
@@ -191,7 +188,8 @@
     // the window manager died on us. prepare its eulogy.
 
     // reset screen orientation
-    setOrientation(0, eOrientationDefault, 0);
+    Vector<ComposerState> state;
+    setTransactionState(state, eOrientationDefault, 0);
 
     // restart the boot-animation
     property_set("ctl.start", "bootanim");
@@ -295,12 +293,16 @@
     // put the origin in the left-bottom corner
     glOrthof(0, w, 0, h, 0, 1); // l=0, r=w ; b=0, t=h
 
-    mReadyToRunBarrier.open();
+
+    // start the EventThread
+    mEventThread = new EventThread(this);
 
     /*
      *  We're now ready to accept clients...
      */
 
+    mReadyToRunBarrier.open();
+
     // start boot animation
     property_set("ctl.start", "bootanim");
 
@@ -313,25 +315,30 @@
 #pragma mark Events Handler
 #endif
 
-void SurfaceFlinger::waitForEvent()
-{
-    while (true) {
-        nsecs_t timeout = -1;
-        sp<MessageBase> msg = mEventQueue.waitMessage(timeout);
-        if (msg != 0) {
-            switch (msg->what) {
-                case MessageQueue::INVALIDATE:
-                    // invalidate message, just return to the main loop
-                    return;
-            }
-        }
-    }
+void SurfaceFlinger::waitForEvent() {
+    mEventQueue.waitMessage();
 }
 
 void SurfaceFlinger::signalEvent() {
     mEventQueue.invalidate();
 }
 
+status_t SurfaceFlinger::postMessageAsync(const sp<MessageBase>& msg,
+        nsecs_t reltime, uint32_t flags) {
+    return mEventQueue.postMessage(msg, reltime);
+}
+
+status_t SurfaceFlinger::postMessageSync(const sp<MessageBase>& msg,
+        nsecs_t reltime, uint32_t flags) {
+    status_t res = mEventQueue.postMessage(msg, reltime);
+    if (res == NO_ERROR) {
+        msg->wait();
+    }
+    return res;
+}
+
+// ----------------------------------------------------------------------------
+
 bool SurfaceFlinger::authenticateSurfaceTexture(
         const sp<ISurfaceTexture>& surfaceTexture) const {
     Mutex::Autolock _l(mStateLock);
@@ -373,20 +380,11 @@
     return false;
 }
 
-status_t SurfaceFlinger::postMessageAsync(const sp<MessageBase>& msg,
-        nsecs_t reltime, uint32_t flags)
-{
-    return mEventQueue.postMessage(msg, reltime, flags);
-}
+// ----------------------------------------------------------------------------
 
-status_t SurfaceFlinger::postMessageSync(const sp<MessageBase>& msg,
-        nsecs_t reltime, uint32_t flags)
-{
-    status_t res = mEventQueue.postMessage(msg, reltime, flags);
-    if (res == NO_ERROR) {
-        msg->wait();
-    }
-    return res;
+sp<IDisplayEventConnection> SurfaceFlinger::createDisplayEventConnection() {
+    sp<DisplayEventConnection> result(new DisplayEventConnection(mEventThread));
+    return result;
 }
 
 // ----------------------------------------------------------------------------
@@ -400,14 +398,14 @@
     waitForEvent();
 
     // check for transactions
-    if (UNLIKELY(mConsoleSignals)) {
+    if (CC_UNLIKELY(mConsoleSignals)) {
         handleConsoleEvents();
     }
 
     // if we're in a global transaction, don't do anything.
     const uint32_t mask = eTransactionNeeded | eTraversalNeeded;
     uint32_t transactionFlags = peekTransactionFlags(mask);
-    if (UNLIKELY(transactionFlags)) {
+    if (CC_UNLIKELY(transactionFlags)) {
         handleTransaction(transactionFlags);
     }
 
@@ -419,33 +417,22 @@
         return true;
     }
 
-    if (UNLIKELY(mHwWorkListDirty)) {
+    if (CC_UNLIKELY(mHwWorkListDirty)) {
         // build the h/w work list
         handleWorkList();
     }
 
     const DisplayHardware& hw(graphicPlane(0).displayHardware());
-    if (LIKELY(hw.canDraw())) {
+    if (CC_LIKELY(hw.canDraw())) {
         // repaint the framebuffer (if needed)
-
-        const int index = hw.getCurrentBufferIndex();
-        GraphicLog& logger(GraphicLog::getInstance());
-
-        logger.log(GraphicLog::SF_REPAINT, index);
         handleRepaint();
-
         // inform the h/w that we're done compositing
-        logger.log(GraphicLog::SF_COMPOSITION_COMPLETE, index);
         hw.compositionComplete();
-
-        logger.log(GraphicLog::SF_SWAP_BUFFERS, index);
         postFramebuffer();
-
-        logger.log(GraphicLog::SF_REPAINT_DONE, index);
     } else {
         // pretend we did the post
         hw.compositionComplete();
-        usleep(16667); // 60 fps period
+        hw.waitForRefresh();
     }
     return true;
 }
@@ -459,6 +446,12 @@
     const nsecs_t now = systemTime();
     mDebugInSwapBuffers = now;
     hw.flip(mSwapRegion);
+
+    size_t numLayers = mVisibleLayersSortedByZ.size();
+    for (size_t i = 0; i < numLayers; i++) {
+        mVisibleLayersSortedByZ[i]->onLayerDisplayed();
+    }
+
     mLastSwapBufferTime = systemTime() - now;
     mDebugInSwapBuffers = 0;
     mSwapRegion.clear();
@@ -625,7 +618,7 @@
 
 
         // handle hidden surfaces by setting the visible region to empty
-        if (LIKELY(!(s.flags & ISurfaceComposer::eLayerHidden) && s.alpha)) {
+        if (CC_LIKELY(!(s.flags & ISurfaceComposer::eLayerHidden) && s.alpha)) {
             const bool translucent = !layer->isOpaque();
             const Rect bounds(layer->visibleBounds());
             visibleRegion.set(bounds);
@@ -810,7 +803,7 @@
     // compute the invalid region
     mSwapRegion.orSelf(mDirtyRegion);
 
-    if (UNLIKELY(mDebugRegion)) {
+    if (CC_UNLIKELY(mDebugRegion)) {
         debugFlashRegions();
     }
 
@@ -964,7 +957,7 @@
     HWComposer& hwc(hw.getHwComposer());
 
     const size_t fbLayerCount = hwc.getLayerCount(HWC_FRAMEBUFFER);
-    if (UNLIKELY(fbLayerCount && !mWormholeRegion.isEmpty())) {
+    if (CC_UNLIKELY(fbLayerCount && !mWormholeRegion.isEmpty())) {
         // should never happen unless the window manager has a bug
         // draw something...
         drawWormhole();
@@ -1049,7 +1042,7 @@
     const int32_t width = hw.getWidth();
     const int32_t height = hw.getHeight();
 
-    if (LIKELY(!mDebugBackground)) {
+    if (CC_LIKELY(!mDebugBackground)) {
         glClearColor(0,0,0,0);
         Region::const_iterator it = region.begin();
         Region::const_iterator const end = region.end();
@@ -1093,23 +1086,6 @@
     }
 }
 
-void SurfaceFlinger::debugShowFPS() const
-{
-    static int mFrameCount;
-    static int mLastFrameCount = 0;
-    static nsecs_t mLastFpsTime = 0;
-    static float mFps = 0;
-    mFrameCount++;
-    nsecs_t now = systemTime();
-    nsecs_t diff = now - mLastFpsTime;
-    if (diff > ms2ns(250)) {
-        mFps =  ((mFrameCount - mLastFrameCount) * float(s2ns(1))) / diff;
-        mLastFpsTime = now;
-        mLastFrameCount = mFrameCount;
-    }
-    // XXX: mFPS has the value we want
- }
-
 status_t SurfaceFlinger::addLayer(const sp<LayerBase>& layer)
 {
     Mutex::Autolock _l(mStateLock);
@@ -1250,26 +1226,6 @@
     }
 }
 
-int SurfaceFlinger::setOrientation(DisplayID dpy,
-        int orientation, uint32_t flags)
-{
-    if (UNLIKELY(uint32_t(dpy) >= DISPLAY_COUNT))
-        return BAD_VALUE;
-
-    Mutex::Autolock _l(mStateLock);
-    if (mCurrentState.orientation != orientation) {
-        if (uint32_t(orientation)<=eOrientation270 || orientation==42) {
-            mCurrentState.orientationFlags = flags;
-            mCurrentState.orientation = orientation;
-            setTransactionFlags(eTransactionNeeded);
-            mTransactionCV.wait(mStateLock);
-        } else {
-            orientation = BAD_VALUE;
-        }
-    }
-    return orientation;
-}
-
 sp<ISurface> SurfaceFlinger::createSurface(
         ISurfaceComposerClient::surface_data_t* params,
         const String8& name,
@@ -1352,7 +1308,7 @@
 
     sp<Layer> layer = new Layer(this, display, client);
     status_t err = layer->setBuffers(w, h, format, flags);
-    if (LIKELY(err != NO_ERROR)) {
+    if (CC_LIKELY(err != NO_ERROR)) {
         ALOGE("createNormalSurfaceLocked() failed (%s)", strerror(-err));
         layer.clear();
     }
@@ -1494,14 +1450,6 @@
                 IPCThreadState::self()->getCallingUid());
         result.append(buffer);
     } else {
-
-        // figure out if we're stuck somewhere
-        const nsecs_t now = systemTime();
-        const nsecs_t inSwapBuffers(mDebugInSwapBuffers);
-        const nsecs_t inTransaction(mDebugInTransaction);
-        nsecs_t inSwapBuffersDuration = (inSwapBuffers) ? now-inSwapBuffers : 0;
-        nsecs_t inTransactionDuration = (inTransaction) ? now-inTransaction : 0;
-
         // Try to get the main lock, but don't insist if we can't
         // (this would indicate SF is stuck, but we want to be able to
         // print something in dumpsys).
@@ -1517,104 +1465,35 @@
             result.append(buffer);
         }
 
-        /*
-         * Dump the visible layer list
-         */
-        const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
-        const size_t count = currentLayers.size();
-        snprintf(buffer, SIZE, "Visible layers (count = %d)\n", count);
-        result.append(buffer);
-        for (size_t i=0 ; i<count ; i++) {
-            const sp<LayerBase>& layer(currentLayers[i]);
-            layer->dump(result, buffer, SIZE);
-            const Layer::State& s(layer->drawingState());
-            s.transparentRegion.dump(result, "transparentRegion");
-            layer->transparentRegionScreen.dump(result, "transparentRegionScreen");
-            layer->visibleRegionScreen.dump(result, "visibleRegionScreen");
+        bool dumpAll = true;
+        size_t index = 0;
+        size_t numArgs = args.size();
+        if (numArgs) {
+            dumpAll = false;
+
+            if ((index < numArgs) &&
+                    (args[index] == String16("--list"))) {
+                index++;
+                listLayersLocked(args, index, result, buffer, SIZE);
+            }
+
+            if ((index < numArgs) &&
+                    (args[index] == String16("--latency"))) {
+                index++;
+                dumpStatsLocked(args, index, result, buffer, SIZE);
+            }
+
+            if ((index < numArgs) &&
+                    (args[index] == String16("--latency-clear"))) {
+                index++;
+                clearStatsLocked(args, index, result, buffer, SIZE);
+            }
         }
 
-        /*
-         * Dump the layers in the purgatory
-         */
-
-        const size_t purgatorySize = mLayerPurgatory.size();
-        snprintf(buffer, SIZE, "Purgatory state (%d entries)\n", purgatorySize);
-        result.append(buffer);
-        for (size_t i=0 ; i<purgatorySize ; i++) {
-            const sp<LayerBase>& layer(mLayerPurgatory.itemAt(i));
-            layer->shortDump(result, buffer, SIZE);
+        if (dumpAll) {
+            dumpAllLocked(result, buffer, SIZE);
         }
 
-        /*
-         * Dump SurfaceFlinger global state
-         */
-
-        snprintf(buffer, SIZE, "SurfaceFlinger global state:\n");
-        result.append(buffer);
-
-        const GLExtensions& extensions(GLExtensions::getInstance());
-        snprintf(buffer, SIZE, "GLES: %s, %s, %s\n",
-                extensions.getVendor(),
-                extensions.getRenderer(),
-                extensions.getVersion());
-        result.append(buffer);
-
-        snprintf(buffer, SIZE, "EGL : %s\n",
-                eglQueryString(graphicPlane(0).getEGLDisplay(),
-                        EGL_VERSION_HW_ANDROID));
-        result.append(buffer);
-
-        snprintf(buffer, SIZE, "EXTS: %s\n", extensions.getExtension());
-        result.append(buffer);
-
-        mWormholeRegion.dump(result, "WormholeRegion");
-        const DisplayHardware& hw(graphicPlane(0).displayHardware());
-        snprintf(buffer, SIZE,
-                "  orientation=%d, canDraw=%d\n",
-                mCurrentState.orientation, hw.canDraw());
-        result.append(buffer);
-        snprintf(buffer, SIZE,
-                "  last eglSwapBuffers() time: %f us\n"
-                "  last transaction time     : %f us\n"
-                "  refresh-rate              : %f fps\n"
-                "  x-dpi                     : %f\n"
-                "  y-dpi                     : %f\n",
-                mLastSwapBufferTime/1000.0,
-                mLastTransactionTime/1000.0,
-                hw.getRefreshRate(),
-                hw.getDpiX(),
-                hw.getDpiY());
-        result.append(buffer);
-
-        if (inSwapBuffersDuration || !locked) {
-            snprintf(buffer, SIZE, "  eglSwapBuffers time: %f us\n",
-                    inSwapBuffersDuration/1000.0);
-            result.append(buffer);
-        }
-
-        if (inTransactionDuration || !locked) {
-            snprintf(buffer, SIZE, "  transaction time: %f us\n",
-                    inTransactionDuration/1000.0);
-            result.append(buffer);
-        }
-
-        /*
-         * Dump HWComposer state
-         */
-        HWComposer& hwc(hw.getHwComposer());
-        snprintf(buffer, SIZE, "  h/w composer %s and %s\n",
-                hwc.initCheck()==NO_ERROR ? "present" : "not present",
-                (mDebugDisableHWC || mDebugRegion) ? "disabled" : "enabled");
-        result.append(buffer);
-        hwc.dump(result, buffer, SIZE, mVisibleLayersSortedByZ);
-
-        /*
-         * Dump gralloc state
-         */
-        const GraphicBufferAllocator& alloc(GraphicBufferAllocator::get());
-        alloc.dump(result);
-        hw.dump(result);
-
         if (locked) {
             mStateLock.unlock();
         }
@@ -1623,6 +1502,168 @@
     return NO_ERROR;
 }
 
+void SurfaceFlinger::listLayersLocked(const Vector<String16>& args, size_t& index,
+        String8& result, char* buffer, size_t SIZE) const
+{
+    const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
+    const size_t count = currentLayers.size();
+    for (size_t i=0 ; i<count ; i++) {
+        const sp<LayerBase>& layer(currentLayers[i]);
+        snprintf(buffer, SIZE, "%s\n", layer->getName().string());
+        result.append(buffer);
+    }
+}
+
+void SurfaceFlinger::dumpStatsLocked(const Vector<String16>& args, size_t& index,
+        String8& result, char* buffer, size_t SIZE) const
+{
+    String8 name;
+    if (index < args.size()) {
+        name = String8(args[index]);
+        index++;
+    }
+
+    const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
+    const size_t count = currentLayers.size();
+    for (size_t i=0 ; i<count ; i++) {
+        const sp<LayerBase>& layer(currentLayers[i]);
+        if (name.isEmpty()) {
+            snprintf(buffer, SIZE, "%s\n", layer->getName().string());
+            result.append(buffer);
+        }
+        if (name.isEmpty() || (name == layer->getName())) {
+            layer->dumpStats(result, buffer, SIZE);
+        }
+    }
+}
+
+void SurfaceFlinger::clearStatsLocked(const Vector<String16>& args, size_t& index,
+        String8& result, char* buffer, size_t SIZE) const
+{
+    String8 name;
+    if (index < args.size()) {
+        name = String8(args[index]);
+        index++;
+    }
+
+    const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
+    const size_t count = currentLayers.size();
+    for (size_t i=0 ; i<count ; i++) {
+        const sp<LayerBase>& layer(currentLayers[i]);
+        if (name.isEmpty() || (name == layer->getName())) {
+            layer->clearStats();
+        }
+    }
+}
+
+void SurfaceFlinger::dumpAllLocked(
+        String8& result, char* buffer, size_t SIZE) const
+{
+    // figure out if we're stuck somewhere
+    const nsecs_t now = systemTime();
+    const nsecs_t inSwapBuffers(mDebugInSwapBuffers);
+    const nsecs_t inTransaction(mDebugInTransaction);
+    nsecs_t inSwapBuffersDuration = (inSwapBuffers) ? now-inSwapBuffers : 0;
+    nsecs_t inTransactionDuration = (inTransaction) ? now-inTransaction : 0;
+
+    /*
+     * Dump the visible layer list
+     */
+    const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
+    const size_t count = currentLayers.size();
+    snprintf(buffer, SIZE, "Visible layers (count = %d)\n", count);
+    result.append(buffer);
+    for (size_t i=0 ; i<count ; i++) {
+        const sp<LayerBase>& layer(currentLayers[i]);
+        layer->dump(result, buffer, SIZE);
+    }
+
+    /*
+     * Dump the layers in the purgatory
+     */
+
+    const size_t purgatorySize = mLayerPurgatory.size();
+    snprintf(buffer, SIZE, "Purgatory state (%d entries)\n", purgatorySize);
+    result.append(buffer);
+    for (size_t i=0 ; i<purgatorySize ; i++) {
+        const sp<LayerBase>& layer(mLayerPurgatory.itemAt(i));
+        layer->shortDump(result, buffer, SIZE);
+    }
+
+    /*
+     * Dump SurfaceFlinger global state
+     */
+
+    snprintf(buffer, SIZE, "SurfaceFlinger global state:\n");
+    result.append(buffer);
+
+    const GLExtensions& extensions(GLExtensions::getInstance());
+    snprintf(buffer, SIZE, "GLES: %s, %s, %s\n",
+            extensions.getVendor(),
+            extensions.getRenderer(),
+            extensions.getVersion());
+    result.append(buffer);
+
+    snprintf(buffer, SIZE, "EGL : %s\n",
+            eglQueryString(graphicPlane(0).getEGLDisplay(),
+                    EGL_VERSION_HW_ANDROID));
+    result.append(buffer);
+
+    snprintf(buffer, SIZE, "EXTS: %s\n", extensions.getExtension());
+    result.append(buffer);
+
+    mWormholeRegion.dump(result, "WormholeRegion");
+    const DisplayHardware& hw(graphicPlane(0).displayHardware());
+    snprintf(buffer, SIZE,
+            "  orientation=%d, canDraw=%d\n",
+            mCurrentState.orientation, hw.canDraw());
+    result.append(buffer);
+    snprintf(buffer, SIZE,
+            "  last eglSwapBuffers() time: %f us\n"
+            "  last transaction time     : %f us\n"
+            "  refresh-rate              : %f fps\n"
+            "  x-dpi                     : %f\n"
+            "  y-dpi                     : %f\n",
+            mLastSwapBufferTime/1000.0,
+            mLastTransactionTime/1000.0,
+            hw.getRefreshRate(),
+            hw.getDpiX(),
+            hw.getDpiY());
+    result.append(buffer);
+
+    snprintf(buffer, SIZE, "  eglSwapBuffers time: %f us\n",
+            inSwapBuffersDuration/1000.0);
+    result.append(buffer);
+
+    snprintf(buffer, SIZE, "  transaction time: %f us\n",
+            inTransactionDuration/1000.0);
+    result.append(buffer);
+
+    /*
+     * VSYNC state
+     */
+    mEventThread->dump(result, buffer, SIZE);
+
+    /*
+     * Dump HWComposer state
+     */
+    HWComposer& hwc(hw.getHwComposer());
+    snprintf(buffer, SIZE, "h/w composer state:\n");
+    result.append(buffer);
+    snprintf(buffer, SIZE, "  h/w composer %s and %s\n",
+            hwc.initCheck()==NO_ERROR ? "present" : "not present",
+                    (mDebugDisableHWC || mDebugRegion) ? "disabled" : "enabled");
+    result.append(buffer);
+    hwc.dump(result, buffer, SIZE, mVisibleLayersSortedByZ);
+
+    /*
+     * Dump gralloc state
+     */
+    const GraphicBufferAllocator& alloc(GraphicBufferAllocator::get());
+    alloc.dump(result);
+    hw.dump(result);
+}
+
 status_t SurfaceFlinger::onTransact(
     uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
 {
@@ -1665,7 +1706,7 @@
     status_t err = BnSurfaceComposer::onTransact(code, data, reply, flags);
     if (err == UNKNOWN_TRANSACTION || err == PERMISSION_DENIED) {
         CHECK_INTERFACE(ISurfaceComposer, data, reply);
-        if (UNLIKELY(!PermissionCache::checkCallingPermission(sHardwareTest))) {
+        if (CC_UNLIKELY(!PermissionCache::checkCallingPermission(sHardwareTest))) {
             IPCThreadState* ipc = IPCThreadState::self();
             const int pid = ipc->getCallingPid();
             const int uid = ipc->getCallingUid();
@@ -1696,11 +1737,6 @@
                 setTransactionFlags(eTransactionNeeded|eTraversalNeeded);
                 return NO_ERROR;
             }
-            case 1006:{ // enable/disable GraphicLog
-                int enabled = data.readInt32();
-                GraphicLog::getInstance().setEnabled(enabled);
-                return NO_ERROR;
-            }
             case 1008:  // toggle use of hw composer
                 n = data.readInt32();
                 mDebugDisableHWC = n ? 1 : 0;
@@ -2250,7 +2286,7 @@
     status_t result = PERMISSION_DENIED;
 
     // only one display supported for now
-    if (UNLIKELY(uint32_t(dpy) >= DISPLAY_COUNT))
+    if (CC_UNLIKELY(uint32_t(dpy) >= DISPLAY_COUNT))
         return BAD_VALUE;
 
     if (!GLExtensions::getInstance().haveFramebufferObject())
@@ -2372,7 +2408,7 @@
         uint32_t minLayerZ, uint32_t maxLayerZ)
 {
     // only one display supported for now
-    if (UNLIKELY(uint32_t(dpy) >= DISPLAY_COUNT))
+    if (CC_UNLIKELY(uint32_t(dpy) >= DISPLAY_COUNT))
         return BAD_VALUE;
 
     if (!GLExtensions::getInstance().haveFramebufferObject())
@@ -2500,7 +2536,7 @@
      const int pid = ipc->getCallingPid();
      const int uid = ipc->getCallingUid();
      const int self_pid = getpid();
-     if (UNLIKELY(pid != self_pid && uid != AID_GRAPHICS && uid != 0)) {
+     if (CC_UNLIKELY(pid != self_pid && uid != AID_GRAPHICS && uid != 0)) {
          // we're called from a different process, do the real check
          if (!PermissionCache::checkCallingPermission(sAccessSurfaceFlinger))
          {
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 17b80a6..c24a9de 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -20,6 +20,8 @@
 #include <stdint.h>
 #include <sys/types.h>
 
+#include <cutils/compiler.h>
+
 #include <utils/Atomic.h>
 #include <utils/Errors.h>
 #include <utils/KeyedVector.h>
@@ -46,14 +48,13 @@
 
 class Client;
 class DisplayHardware;
+class DisplayEventConnection;
+class EventThread;
 class Layer;
 class LayerDim;
 class LayerScreenshot;
 struct surface_flinger_cblk_t;
 
-#define LIKELY( exp )       (__builtin_expect( (exp) != 0, true  ))
-#define UNLIKELY( exp )     (__builtin_expect( (exp) != 0, false ))
-
 // ---------------------------------------------------------------------------
 
 class Client : public BnSurfaceComposerClient
@@ -169,8 +170,8 @@
     virtual void                        bootFinished();
     virtual void                        setTransactionState(const Vector<ComposerState>& state,
                                                             int orientation, uint32_t flags);
-    virtual int                         setOrientation(DisplayID dpy, int orientation, uint32_t flags);
     virtual bool                        authenticateSurfaceTexture(const sp<ISurfaceTexture>& surface) const;
+    virtual sp<IDisplayEventConnection> createDisplayEventConnection();
 
     virtual status_t captureScreen(DisplayID dpy,
             sp<IMemoryHeap>* heap,
@@ -222,6 +223,7 @@
 
 private:
     friend class Client;
+    friend class DisplayEventConnection;
     friend class LayerBase;
     friend class LayerBaseClient;
     friend class Layer;
@@ -332,9 +334,15 @@
             status_t electronBeamOnAnimationImplLocked();
 
             void        debugFlashRegions();
-            void        debugShowFPS() const;
             void        drawWormhole() const;
            
+            void listLayersLocked(const Vector<String16>& args, size_t& index,
+                    String8& result, char* buffer, size_t SIZE) const;
+            void dumpStatsLocked(const Vector<String16>& args, size_t& index,
+                    String8& result, char* buffer, size_t SIZE) const;
+            void clearStatsLocked(const Vector<String16>& args, size_t& index,
+                    String8& result, char* buffer, size_t SIZE) const;
+            void dumpAllLocked(String8& result, char* buffer, size_t SIZE) const;
 
     mutable     MessageQueue    mEventQueue;
 
@@ -362,6 +370,7 @@
                 GLuint                      mWormholeTexName;
                 GLuint                      mProtectedTexName;
                 nsecs_t                     mBootTime;
+                sp<EventThread>             mEventThread;
 
                 // Can only accessed from the main thread, these members
                 // don't need synchronization
diff --git a/services/surfaceflinger/tests/vsync/Android.mk b/services/surfaceflinger/tests/vsync/Android.mk
new file mode 100644
index 0000000..9181760
--- /dev/null
+++ b/services/surfaceflinger/tests/vsync/Android.mk
@@ -0,0 +1,18 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	vsync.cpp
+
+LOCAL_SHARED_LIBRARIES := \
+	libcutils \
+	libutils \
+	libbinder \
+    libui \
+    libgui
+
+LOCAL_MODULE:= test-vsync-events
+
+LOCAL_MODULE_TAGS := tests
+
+include $(BUILD_EXECUTABLE)
diff --git a/services/surfaceflinger/tests/vsync/vsync.cpp b/services/surfaceflinger/tests/vsync/vsync.cpp
new file mode 100644
index 0000000..4f79080
--- /dev/null
+++ b/services/surfaceflinger/tests/vsync/vsync.cpp
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2010 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 <gui/DisplayEventReceiver.h>
+#include <utils/Looper.h>
+
+using namespace android;
+
+int receiver(int fd, int events, void* data)
+{
+    DisplayEventReceiver* q = (DisplayEventReceiver*)data;
+
+    ssize_t n;
+    DisplayEventReceiver::Event buffer[1];
+
+    static nsecs_t oldTimeStamp = 0;
+
+    while ((n = q->getEvents(buffer, 1)) > 0) {
+        for (int i=0 ; i<n ; i++) {
+            if (buffer[i].header.type == DisplayEventReceiver::DISPLAY_EVENT_VSYNC) {
+                printf("event vsync: count=%d\t", buffer[i].vsync.count);
+            }
+            if (oldTimeStamp) {
+                float t = float(buffer[i].header.timestamp - oldTimeStamp) / s2ns(1);
+                printf("%f ms (%f Hz)\n", t*1000, 1.0/t);
+            }
+            oldTimeStamp = buffer[i].header.timestamp;
+        }
+    }
+    if (n<0) {
+        printf("error reading events (%s)\n", strerror(-n));
+    }
+    return 1;
+}
+
+int main(int argc, char** argv)
+{
+    DisplayEventReceiver myDisplayEvent;
+
+
+    sp<Looper> loop = new Looper(false);
+    loop->addFd(myDisplayEvent.getFd(), 0, ALOOPER_EVENT_INPUT, receiver,
+            &myDisplayEvent);
+
+    do {
+        //printf("about to poll...\n");
+        int32_t ret = loop->pollOnce(-1);
+        switch (ret) {
+            case ALOOPER_POLL_WAKE:
+                //("ALOOPER_POLL_WAKE\n");
+                break;
+            case ALOOPER_POLL_CALLBACK:
+                //("ALOOPER_POLL_CALLBACK\n");
+                break;
+            case ALOOPER_POLL_TIMEOUT:
+                printf("ALOOPER_POLL_TIMEOUT\n");
+                break;
+            case ALOOPER_POLL_ERROR:
+                printf("ALOOPER_POLL_TIMEOUT\n");
+                break;
+            default:
+                printf("ugh? poll returned %d\n", ret);
+                break;
+        }
+    } while (1);
+
+    return 0;
+}
diff --git a/services/surfaceflinger/tests/waitforvsync/Android.mk b/services/surfaceflinger/tests/waitforvsync/Android.mk
new file mode 100644
index 0000000..c25f5ab
--- /dev/null
+++ b/services/surfaceflinger/tests/waitforvsync/Android.mk
@@ -0,0 +1,14 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+	waitforvsync.cpp
+
+LOCAL_SHARED_LIBRARIES := \
+	libcutils \
+
+LOCAL_MODULE:= test-waitforvsync
+
+LOCAL_MODULE_TAGS := tests
+
+include $(BUILD_EXECUTABLE)
diff --git a/services/surfaceflinger/tests/waitforvsync/waitforvsync.cpp b/services/surfaceflinger/tests/waitforvsync/waitforvsync.cpp
new file mode 100644
index 0000000..279b88b
--- /dev/null
+++ b/services/surfaceflinger/tests/waitforvsync/waitforvsync.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2011 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 <stdint.h>
+#include <sys/types.h>
+
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <linux/fb.h>
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+
+#ifndef FBIO_WAITFORVSYNC
+#define FBIO_WAITFORVSYNC   _IOW('F', 0x20, __u32)
+#endif
+
+int main(int argc, char** argv) {
+    int fd = open("/dev/graphics/fb0", O_RDWR);
+    if (fd >= 0) {
+        do {
+            uint32_t crt = 0;
+           int err = ioctl(fd, FBIO_WAITFORVSYNC, &crt);
+           if (err < 0) {
+               printf("FBIO_WAITFORVSYNC error: %s\n", strerror(errno));
+               break;
+           }
+        } while(1);
+        close(fd);
+    }
+    return 0;
+}